소스 검색

承包规则删除bug

785834757 2 년 전
부모
커밋
8928963fe3

+ 2 - 2
src/main/java/com/ydtech/modules/protocols/entity/po/PtlAgreementProductCostsAttrLinkHistory.java

@@ -20,8 +20,8 @@ import java.time.LocalDateTime;
 @AllArgsConstructor
 public class PtlAgreementProductCostsAttrLinkHistory {
 
-    @TableId(value = "id", type = com.baomidou.mybatisplus.annotation.IdType.AUTO)
-    private Integer id;
+    @TableId(value = "id")
+    private String id;
 
     @ApiModelProperty(value = "费用id")
     @TableField(value = "costs_id")

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

@@ -20,7 +20,7 @@ import java.util.List;
 @AllArgsConstructor
 public class PtlAgreementProductCostsNew {
 
-    @TableId(value = "id",type= IdType.AUTO)
+    @TableId(value = "id")
     private String id;
 
     @ApiModelProperty(value = "协议id")

+ 2 - 2
src/main/java/com/ydtech/modules/protocols/entity/po/PtlAgreementProductCostsNewHistory.java

@@ -22,8 +22,8 @@ import java.util.List;
 @AllArgsConstructor
 public class PtlAgreementProductCostsNewHistory {
 
-    @TableId(value = "id",type= IdType.AUTO)
-    private Integer id;
+    @TableId(value = "id")
+    private String id;
 
     @ApiModelProperty(value = "协议id")
     @TableField(value = "agreement_id")

+ 22 - 11
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -12,6 +12,7 @@ import com.ydtech.modules.protocols.entity.po.*;
 import com.ydtech.modules.protocols.entity.vo.AgreementProductCosts;
 import com.ydtech.modules.protocols.entity.vo.AgreementProductCostsSave;
 import com.ydtech.modules.protocols.service.*;
+import com.ydtech.utils.idgen.IdGenerate;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -282,7 +283,8 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         //校验非车信息是否存在
         List<PtlAgreementProductCostsAttrLink> nonMotorInsurance = agreementProductCosts.getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("NonMotorInsurance")).collect(Collectors.toList());
         if (nonMotorInsurance.size() > 0) {
-            if((!nonMotorInsurance.get(0).getMin().equals("0") || !nonMotorInsurance.get(0).getMax().equals("0"))) {
+            if(nonMotorInsurance.get(0).getMin() != null || nonMotorInsurance.get(0).getMax() != null)
+            {
                 if((agreementProductCosts.getNoCostsProportion() == null || agreementProductCosts.getNoCostsProportion().equals("0"))){
                     throw new SystemException("检测到存在非车费用因子,请填写非车费用!");
                 }
@@ -312,6 +314,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         PtlAgreementProductCostsNewHistory ptlAgreementProductCostsNewHistory = new PtlAgreementProductCostsNewHistory();
         BeanUtils.copyProperties(agreementProductCosts, ptlAgreementProductCostsNewHistory);
         //添加费用ID
+        ptlAgreementProductCostsNewHistory.setId(IdGenerate.nextId());
         ptlAgreementProductCostsNewHistory.setCostsId(ptlAgreementProductCostsNew.getId());
         //生成批次ID
         String uuid = UUID.randomUUID().toString();
@@ -341,6 +344,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 costsAttrLink.add(x);
                 BeanUtils.copyProperties(x, costsAttrLinkHistory);
                 //设置产品费用因子历史记录
+                costsAttrLinkHistory.setId(IdGenerate.nextId());
                 costsAttrLinkHistory.setBatch(uuid);
                 costsAttrLinkHistory.setOperatorType("add");
                 costsAttrLinkHistory.setModifier(BaseController.getUser().getId());
@@ -354,6 +358,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                     costsAttrLink.add(x);
                     BeanUtils.copyProperties(x, costsAttrLinkHistory);
                     //设置产品费用因子历史记录
+                    costsAttrLinkHistory.setId(IdGenerate.nextId());
                     costsAttrLinkHistory.setBatch(uuid);
 
                     costsAttrLinkHistory.setOperatorType("add");
@@ -374,15 +379,15 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
     @Override
     public boolean costsUpdate(AgreementProductCosts agreementProductCosts) {
         //校验非车信息是否存在
-//        List<PtlAgreementProductCostsAttrLink> nonMotorInsurance = agreementProductCosts.getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("NonMotorInsurance")).collect(Collectors.toList());
-//        if (nonMotorInsurance.size() > 0) {
-//
-//            if((!nonMotorInsurance.get(0).getMin().equals("0") || !nonMotorInsurance.get(0).getMax().equals("0"))) {
-//                if((agreementProductCosts.getNoCostsProportion() == null || agreementProductCosts.getNoCostsProportion().equals("0"))){
-//                    throw new SystemException("检测到存在非车费用因子,请填写非车费用!");
-//                }
-//            }
-//        }
+        List<PtlAgreementProductCostsAttrLink> nonMotorInsurance = agreementProductCosts.getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("NonMotorInsurance")).collect(Collectors.toList());
+        if (nonMotorInsurance.size() > 0) {
+            if(nonMotorInsurance.get(0).getMin() != null || nonMotorInsurance.get(0).getMax() != null)
+            {
+                if((agreementProductCosts.getNoCostsProportion() == null || agreementProductCosts.getNoCostsProportion().equals("0"))){
+                    throw new SystemException("检测到存在非车费用因子,请填写非车费用!");
+                }
+            }
+        }
 
         //更新费用主表信息
         PtlAgreementProductCostsNew ptlAgreementProductCostsNew = new PtlAgreementProductCostsNew();
@@ -413,6 +418,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         PtlAgreementProductCostsNewHistory ptlAgreementProductCostsNewHistory = new PtlAgreementProductCostsNewHistory();
         BeanUtils.copyProperties(agreementProductCosts, ptlAgreementProductCostsNewHistory);
         //添加费用ID
+        ptlAgreementProductCostsNewHistory.setId(IdGenerate.nextId());
         ptlAgreementProductCostsNewHistory.setCostsId(ptlAgreementProductCostsNew.getId());
         //生成批次ID
         String uuid = UUID.randomUUID().toString();
@@ -454,6 +460,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 //设置产品费用因子历史记录
                 PtlAgreementProductCostsAttrLinkHistory costsAttrLinkHistory = new PtlAgreementProductCostsAttrLinkHistory();
                 BeanUtils.copyProperties(x, costsAttrLinkHistory);
+                costsAttrLinkHistory.setId(IdGenerate.nextId());
                 costsAttrLinkHistory.setBatch(uuid);
 
                 costsAttrLinkHistory.setOperatorType("update");
@@ -471,6 +478,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                         //设置产品费用因子历史记录
                         PtlAgreementProductCostsAttrLinkHistory costsAttrLinkHistory = new PtlAgreementProductCostsAttrLinkHistory();
                         BeanUtils.copyProperties(x, costsAttrLinkHistory);
+                        costsAttrLinkHistory.setId(IdGenerate.nextId());
                         costsAttrLinkHistory.setBatch(uuid);
 
                         costsAttrLinkHistory.setOperatorType("update");
@@ -487,6 +495,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                         //设置产品费用因子历史记录
                         PtlAgreementProductCostsAttrLinkHistory costsAttrLinkHistory = new PtlAgreementProductCostsAttrLinkHistory();
                         BeanUtils.copyProperties(x, costsAttrLinkHistory);
+                        costsAttrLinkHistory.setId(IdGenerate.nextId());
                         costsAttrLinkHistory.setBatch(uuid);
 
                         costsAttrLinkHistory.setOperatorType("update");
@@ -517,6 +526,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         BeanUtils.copyProperties(ptlAgreementProductCostsNew, ptlAgreementProductCostsNewHistory);
         BeanUtils.copyProperties(productCostsExport, ptlAgreementProductCostsNewHistory);
         //添加费用ID
+        ptlAgreementProductCostsNewHistory.setId(IdGenerate.nextId());
         ptlAgreementProductCostsNewHistory.setCostsId(ptlAgreementProductCostsNew.getId());
         //生成批次ID
         String uuid = UUID.randomUUID().toString();
@@ -538,8 +548,9 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
             PtlAgreementProductCostsAttrLinkHistory costsAttrLinkHistory = new PtlAgreementProductCostsAttrLinkHistory();
             BeanUtils.copyProperties(x, costsAttrLinkHistory);
             //设置产品费用因子历史记录
+            costsAttrLinkHistory.setId(IdGenerate.nextId());
             costsAttrLinkHistory.setBatch(uuid);
-            costsAttrLinkHistory.setOperatorType("add");
+            costsAttrLinkHistory.setOperatorType("delete");
             costsAttrLinkHistory.setModifier(BaseController.getUser().getId());
             costsAttrLinkHistory.setOperatorTime(LocalDateTime.now());
             costsAttrLinkHistories.add(costsAttrLinkHistory);