소스 검색

1.支付码根据协议的状态置为失效。

wks 1 년 전
부모
커밋
51944d0eef

+ 28 - 0
src/main/java/com/ydtech/modules/protocols/constants/AgreementProductCostsAuditStatus.java

@@ -0,0 +1,28 @@
+package com.ydtech.modules.protocols.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.Getter;
+
+
+
+/**
+ * @version
+ * @description: 审核状态
+ * @author: wenks
+ * @date: 2024/12/9 15:36
+ **/
+@AllArgsConstructor
+@Getter
+public enum AgreementProductCostsAuditStatus {
+
+    COSTS_AUDIT_STATUS_0(0, "未审核"),
+    COSTS_AUDIT_STATUS_1(1, "审核通过"),
+    COSTS_AUDIT_STATUS_2(2, "驳回"),
+    COSTS_AUDIT_STATUS_3(3, "禁用");
+
+    private final Integer code;
+
+    private final String description;
+
+}

+ 4 - 8
src/main/java/com/ydtech/modules/protocols/entity/po/PtlAgreementProductCostsNew.java

@@ -23,7 +23,7 @@ import java.util.List;
 @AllArgsConstructor
 public class PtlAgreementProductCostsNew {
 
-    @TableId(value = "id",type= IdType.AUTO)
+    @TableId(value = "id", type = IdType.AUTO)
     private String id;
 
     @ApiModelProperty(value = "保险公司名称")
@@ -46,13 +46,6 @@ public class PtlAgreementProductCostsNew {
     @TableField(value = "product_name")
     private String productName;
 
-    /**
-     * @see com.ydtech.modules.protocol.constants.ValidStatus
-     */
-    @ApiModelProperty(value = "费用状态")
-    @TableField(value = "valid_status")
-    private String validStatus;
-
     @ApiModelProperty(value = "费用比例(交强)")
     @TableField(value = "jq_car_costs_proportion")
     private String jqCarCostsProportion;
@@ -134,6 +127,9 @@ public class PtlAgreementProductCostsNew {
     @TableField(value = "create_by")
     private String createBy;
 
+    /**
+     * @se com.ydtech.modules.protocols.constants.AgreementProductCostsAuditStatus
+     */
     @ApiModelProperty(value = "是否审核")
     @TableField(value = "is_audit")
     private Integer isAudit;

+ 5 - 8
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -43,6 +43,7 @@ import com.ydtech.modules.protocol.entity.po.PtlAreaLicense;
 import com.ydtech.modules.protocol.service.PtlAgreementService;
 import com.ydtech.modules.protocol.service.PtlAreaLicenseService;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
+import com.ydtech.modules.protocols.constants.AgreementProductCostsAuditStatus;
 import com.ydtech.modules.protocols.dao.PtlAgreementProductCostsNewMapper;
 import com.ydtech.modules.protocols.entity.po.*;
 import com.ydtech.modules.protocols.entity.vo.*;
@@ -185,9 +186,6 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                         .gt(PtlAgreementProductCostsNew::getCostsEndDate, LocalDateTime.now());
             }
         }
-        // 费用状态
-        ptlAgreementProductCostsNewLambdaQueryWrapper
-                .eq(agreementProductQueryVo.getValidStatus() != null, PtlAgreementProductCostsNew::getValidStatus, agreementProductQueryVo.getValidStatus());
         //统配描述
         if (agreementProductQueryVo.getDesc() != null) {
             ptlAgreementProductCostsNewLambdaQueryWrapper.like(PtlAgreementProductCostsNew::getDesc, agreementProductQueryVo.getDesc());
@@ -528,7 +526,6 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 .lt(PtlAgreementProductCostsNew::getCostsStartDate, formattedDateTime)
                 .gt(PtlAgreementProductCostsNew::getCostsEndDate, formattedDateTime)
                 .eq(PtlAgreementProductCostsNew::getIsAudit, "1")//查找审核已通过的
-                .eq(PtlAgreementProductCostsNew::getValidStatus, ValidStatus.AVS_1.getCode()) // 有效状态
                 .orderBy(true, true, PtlAgreementProductCostsNew::getPriorityLevel));
 
         List<AgreementProductCosts> agreementProductCosts = new ArrayList<>();
@@ -795,8 +792,8 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         }
 
         PtlAgreementProductCostsNew old = getById(agreementProductCosts.getId());
-        if (!ValidStatus.AVS_0.getCode().equals(old.getValidStatus())) {
-            throw new SystemException("请先禁用后再编辑费用");
+        if (!AgreementProductCostsAuditStatus.COSTS_AUDIT_STATUS_3.getCode().equals(old.getIsAudit())) {
+            throw new SystemException("请先禁用后再编辑修改费用");
         }
         //更新费用主表信息
         PtlAgreementProductCostsNew ptlAgreementProductCost = ptlAgreementProductCostsNewService.getById(agreementProductCosts.getId());
@@ -2471,7 +2468,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 .set(InsAreaCompany::getCodeValidStatus, ValidStatus.AVS_0.getCode())
                 .in(InsAreaCompany::getId, insFeeOrderIdList)
                 .update();
-        ptlAgreementProductCostsNew.setValidStatus(ValidStatus.AVS_0.getCode());
+        ptlAgreementProductCostsNew.setIsAudit(AgreementProductCostsAuditStatus.COSTS_AUDIT_STATUS_3.getCode());
         boolean b = updateById(ptlAgreementProductCostsNew);
         AssertionUtils.isSucceed(b, "修改费用状态失败");
         return HttpResult.ok("修改成功");
@@ -2506,7 +2503,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 .in(InsAreaCompany::getId, insFeeOrderIdList)
                 .update();
 
-        list.forEach(ptlAgreementProductCostsNew -> ptlAgreementProductCostsNew.setValidStatus(ValidStatus.AVS_0.getCode()));
+        list.forEach(ptlAgreementProductCostsNew -> ptlAgreementProductCostsNew.setIsAudit(AgreementProductCostsAuditStatus.COSTS_AUDIT_STATUS_3.getCode()));
 
         boolean b = updateBatchById(list);
         AssertionUtils.isSucceed(b, "修改费用状态失败");