Quellcode durchsuchen

feat(采购合同):审核节点数据修改

Wangyafan vor 6 Monaten
Ursprung
Commit
ef88deffe5

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

@@ -32,6 +32,7 @@ import com.sunxung.factoring.service.sys.dto.AttachmentDto;
 import com.sunxung.factoring.service.sys.flowable.FlowableService;
 import com.sunxung.factoring.service.tradingPlatform.PlatformService;
 import com.sunxung.factoring.service.tradingPlatform.TradingPlatformInvoiceInfoService;
+import org.apache.bcel.generic.IF_ACMPEQ;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.util.PDFTextStripper;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -297,7 +298,7 @@ public class PurchContractApprovalServiceImpl extends ServiceImpl<PurchContractA
 
 
         //补充信息
-        PurchContractReplenishInfo replenishInfo = new PurchContractReplenishInfo();
+        PurchContractReplenishInfo replenishInfo = null;
 
         //需方收货人(该业务对应的供应商用户的项目经理)
         List<User> userList = new ArrayList<>();
@@ -354,21 +355,33 @@ 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);
 
             //获取需方收货人
@@ -382,19 +395,25 @@ public class PurchContractApprovalServiceImpl extends ServiceImpl<PurchContractA
                     user.setIdCard(c.getIdCard());
                     user.setName(c.getName());
                     users.add(user);
-                    purchContractApprovalVo.setUserList(users);
                 });
             }
+            purchContractApprovalVo.setUserList(users);
 
 
             //增值税要求
             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);
 
 
@@ -431,6 +450,9 @@ public class PurchContractApprovalServiceImpl extends ServiceImpl<PurchContractA
                 purchContractApprovalVo.getPurchContractApproval().setUploadPurchContracts(list);
             }
         }
+        if (replenishInfo == null){
+            replenishInfo = new PurchContractReplenishInfo();
+        }
         replenishInfo.setContractName(purch.getContractName());
         replenishInfo.setContractNumber(purch.getContractNumber());
 
@@ -545,7 +567,7 @@ public class PurchContractApprovalServiceImpl extends ServiceImpl<PurchContractA
 
 
         if (purchContractApproval.getApprovalConclusion().equals("pass")) {
-//添加合同补充信息
+           //添加合同补充信息
             if (purchContractApprovalVo.getPurchContractReplenishInfo() != null) {
                 PurchContractReplenishInfo replenishInfo = purchContractApprovalVo.getPurchContractReplenishInfo();
                 replenishInfo.setPurchContractApprovalId(purchContractApproval.getId());