Ver código fonte

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

wks 1 ano atrás
pai
commit
672e5f0cc3

+ 1 - 1
sql/Online.sql

@@ -1,6 +1,6 @@
 --  2024-12-09 BY wks
 alter table ptl_agreement_product_costs_new
-    add valid_status tinyint  null comment '二维码有效状态';
+    add valid_status tinyint  null comment '费用状态';
 
 alter table agent.ins_area_company
     add code_valid_status tinyint  null comment '二维码有效状态';

+ 1 - 2
src/main/java/com/ydtech/modules/protocols/constants/AgreementProductCostsAuditStatus.java

@@ -18,8 +18,7 @@ public enum AgreementProductCostsAuditStatus {
 
     COSTS_AUDIT_STATUS_0(0, "未审核"),
     COSTS_AUDIT_STATUS_1(1, "审核通过"),
-    COSTS_AUDIT_STATUS_2(2, "驳回"),
-    COSTS_AUDIT_STATUS_3(3, "禁用");
+    COSTS_AUDIT_STATUS_2(2, "驳回");
 
     private final Integer code;
 

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

@@ -128,12 +128,19 @@ public class PtlAgreementProductCostsNew {
     private String createBy;
 
     /**
-     * @se com.ydtech.modules.protocols.constants.AgreementProductCostsAuditStatus
+     * @see com.ydtech.modules.protocols.constants.AgreementProductCostsAuditStatus
      */
     @ApiModelProperty(value = "是否审核")
     @TableField(value = "is_audit")
     private Integer isAudit;
 
+    /**
+     * @see com.ydtech.modules.protocol.constants.ValidStatus
+     */
+    @ApiModelProperty(value = "费用状态")
+    @TableField(value = "valid_status")
+    private String validStatus;
+
     @ApiModelProperty(value = "驳回信息")
     @TableField(value = "reject")
     private String reject;

+ 3 - 0
src/main/java/com/ydtech/modules/protocols/entity/vo/AgreementProductQueryVo.java

@@ -23,6 +23,9 @@ public class AgreementProductQueryVo extends PageRequest {
     @ApiModelProperty(value = "协议id")
     private String agreementId;
 
+    /**
+     * @see com.ydtech.modules.protocols.constants.AgreementProductCostsAuditStatus
+     */
     @ApiModelProperty(value = "是否审核")
     private String isAudit;
 

+ 16 - 19
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -186,6 +186,7 @@ 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());
@@ -792,7 +793,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         }
 
         PtlAgreementProductCostsNew old = getById(agreementProductCosts.getId());
-        if (!AgreementProductCostsAuditStatus.COSTS_AUDIT_STATUS_3.getCode().equals(old.getIsAudit())) {
+        if (!ValidStatus.AVS_0.getCode().equals(old.getIsAudit())) {
             throw new SystemException("请先禁用后再编辑修改费用");
         }
         //更新费用主表信息
@@ -2459,16 +2460,15 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 .list();
 
         List<String> insFeeOrderIdList = insFeeOrderNews.stream().map(InsFeeOrderNew::getCostsId).collect(Collectors.toList());
-        if (insFeeOrderIdList.isEmpty()) {
-            return HttpResult.ok("修改成功");
+        if (!insFeeOrderIdList.isEmpty()) {
+            // 修改订单二维码状态
+            insAreaCompanyService.lambdaUpdate()
+                    .set(InsAreaCompany::getCodeValidStatus, ValidStatus.AVS_0.getCode())
+                    .in(InsAreaCompany::getId, insFeeOrderIdList)
+                    .update();
         }
 
-        // 修改订单二维码状态
-        insAreaCompanyService.lambdaUpdate()
-                .set(InsAreaCompany::getCodeValidStatus, ValidStatus.AVS_0.getCode())
-                .in(InsAreaCompany::getId, insFeeOrderIdList)
-                .update();
-        ptlAgreementProductCostsNew.setIsAudit(AgreementProductCostsAuditStatus.COSTS_AUDIT_STATUS_3.getCode());
+        ptlAgreementProductCostsNew.setValidStatus(ValidStatus.AVS_0.getCode());
         boolean b = updateById(ptlAgreementProductCostsNew);
         AssertionUtils.isSucceed(b, "修改费用状态失败");
         return HttpResult.ok("修改成功");
@@ -2493,18 +2493,15 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 .list();
 
         List<String> insFeeOrderIdList = insFeeOrderNews.stream().map(InsFeeOrderNew::getCostsId).collect(Collectors.toList());
-        if (insFeeOrderIdList.isEmpty()) {
-            return HttpResult.ok("修改成功");
+        if (!insFeeOrderIdList.isEmpty()) {
+            // 修改订单二维码状态
+            insAreaCompanyService.lambdaUpdate()
+                    .set(InsAreaCompany::getCodeValidStatus, ValidStatus.AVS_0.getCode())
+                    .in(InsAreaCompany::getId, insFeeOrderIdList)
+                    .update();
         }
 
-        // 修改订单二维码状态
-        insAreaCompanyService.lambdaUpdate()
-                .set(InsAreaCompany::getCodeValidStatus, ValidStatus.AVS_0.getCode())
-                .in(InsAreaCompany::getId, insFeeOrderIdList)
-                .update();
-
-        list.forEach(ptlAgreementProductCostsNew -> ptlAgreementProductCostsNew.setIsAudit(AgreementProductCostsAuditStatus.COSTS_AUDIT_STATUS_3.getCode()));
-
+        list.forEach(ptlAgreementProductCostsNew -> ptlAgreementProductCostsNew.setValidStatus(ValidStatus.AVS_0.getCode()));
         boolean b = updateBatchById(list);
         AssertionUtils.isSucceed(b, "修改费用状态失败");
         return HttpResult.ok("修改成功");