Переглянути джерело

feat(采购合同):查看修改

Wangyafan 6 місяців тому
батько
коміт
5e3630514b

+ 3 - 18
src/main/java/com/sunxung/factoring/service/purchcontractmanagement/impl/PurchContractApprovalServiceImpl.java

@@ -223,6 +223,9 @@ public class PurchContractApprovalServiceImpl extends ServiceImpl<PurchContractA
         //获取合同补充信息
         PurchContractReplenishInfo replenishInfo = purchContractReplenishInfoService
                 .lambdaQuery().eq(PurchContractReplenishInfo::getPurchContractApprovalId, purchContractApproval.getId()).one();
+        if (replenishInfo == null){
+            replenishInfo = new PurchContractReplenishInfo();
+        }
         replenishInfo.setContractName(purchContractBasicInfo.getContractName());
         replenishInfo.setContractNumber(purchContractBasicInfo.getContractNumber());
         purchContractApprovalVo.setPurchContractReplenishInfo(replenishInfo);
@@ -355,33 +358,21 @@ public class PurchContractApprovalServiceImpl extends ServiceImpl<PurchContractA
             //获取质量与验收
             PurchContractQualityAccept qualityAccept = purchContractQualityAcceptService
                     .lambdaQuery().eq(PurchContractQualityAccept::getPurchContractApprovalId, purchContractApproval.getId()).one();
-            if (qualityAccept == null){
-                qualityAccept = new PurchContractQualityAccept();
-            }
             purchContractApprovalVo.setPurchContractQualityAccept(qualityAccept);
 
             //结算与付款
             PurchContractApprovalSettlePayment approvalSettlePayment = approvalSettlePaymentService.lambdaQuery()
                     .eq(PurchContractApprovalSettlePayment::getPurchContractApprovalId, purchContractApproval.getId()).one();
-            if (approvalSettlePayment == null){
-                approvalSettlePayment = new PurchContractApprovalSettlePayment();
-            }
             purchContractApprovalVo.setApprovalSettlePayment(approvalSettlePayment);
 
             //获取交货规定
             PurchContractDeliverClause deliverClause = purchContractDeliverClauseService
                     .lambdaQuery().eq(PurchContractDeliverClause::getPurchContractApprovalId, purchContractApproval.getId()).one();
-            if (deliverClause == null){
-                deliverClause = new PurchContractDeliverClause();
-            }
             purchContractApprovalVo.setPurchContractDeliverClause(deliverClause);
 
             //获取结算
             PurchContractApprovalSettleCycle settleCycle = approvalSettleCycleService.lambdaQuery()
                     .eq(PurchContractApprovalSettleCycle::getPurchContractApprovalId, purchContractApproval.getId()).one();
-            if (settleCycle == null){
-                settleCycle = new PurchContractApprovalSettleCycle();
-            }
             purchContractApprovalVo.setApprovalSettleCycle(settleCycle);
 
             //获取需方收货人
@@ -403,17 +394,11 @@ public class PurchContractApprovalServiceImpl extends ServiceImpl<PurchContractA
             //增值税要求
             PurchContractApprovalVatInfo approvalVatInfo = approvalVatInfoService.lambdaQuery()
                     .eq(PurchContractApprovalVatInfo::getPurchContractApprovalId, purchContractApproval.getId()).one();
-            if (approvalVatInfo == null){
-                approvalVatInfo = new PurchContractApprovalVatInfo();
-            }
             purchContractApprovalVo.setApprovalVatInfo(approvalVatInfo);
 
             //获取其他条款
             List<PurchContractOtherClause> otherClauseList = purchContractOtherClauseService
                     .lambdaQuery().eq(PurchContractOtherClause::getPurchcontractApprovalId, purchContractApproval.getId()).list();
-            if (CollectionUtil.isEmpty(otherClauseList)){
-                otherClauseList = new ArrayList<>();
-            }
             purchContractApprovalVo.setPurchContractOtherClause(otherClauseList);