Pārlūkot izejas kodu

1、多次暂存后发起导致状态依旧为草稿状态,只暂存一次则正常(销售合同)

2、暂存不生成合同编码(报价单、销售合同)
caozj 1 gadu atpakaļ
vecāks
revīzija
affb0e69d6

+ 8 - 24
hx-sale/src/main/java/com/fjhx/sale/service/contract/impl/ContractServiceImpl.java

@@ -517,10 +517,10 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
         if (StringUtils.isEmpty(contract.getCurrency())) {
             throw new ServiceException("币种不能为空");
         }
-        if(ObjectUtil.isEmpty(contract.getId())){
-            //赋值合同号
-            contract.setCode(codingRuleService.createCode(CodingRuleEnum.CONTRACT.getKey(), contract.getBuyCorporationId()));
-        }
+//        if(ObjectUtil.isEmpty(contract.getId())){
+//            //赋值合同号
+//            contract.setCode(codingRuleService.createCode(CodingRuleEnum.CONTRACT.getKey(), contract.getBuyCorporationId()));
+//        }
         // 保存合同产品
         List<ContractProduct> contractProductList = contract.getContractProductList();
         // 赋值待处理数量
@@ -546,9 +546,6 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
         // 保存合同产品
         List<ContractProduct> contractProductList = contract.getContractProductList();
         if (CollectionUtils.isNotEmpty(contractProductList)) {
-            if (ObjectUtil.isNotEmpty(contract.getId())) {
-                contractProductService.editLinked(contractProductList, ContractProduct::getContractId, contract.getId());
-            }
             for (ContractProduct c : contractProductList) {
                 c.setContractId(contract.getId());
             }
@@ -557,9 +554,6 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
         // 保存收费项目
         List<ContractProject> contractProjectList = contract.getContractProjectList();
         if (CollectionUtils.isNotEmpty(contractProjectList)) {
-            if (ObjectUtil.isNotEmpty(contract.getId())) {
-                contractProjectService.editLinked(contractProjectList, ContractProject::getContractId, contract.getId());
-            }
             for (ContractProject c : contractProjectList) {
                 c.setContractId(contract.getId());
             }
@@ -568,25 +562,15 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
         // 保存自定义出货
         List<ContractShipment> contractShipmentList = contract.getContractShipmentList();
         if (CollectionUtils.isNotEmpty(contractShipmentList)) {
-            if (ObjectUtil.isNotEmpty(contract.getId())) {
-                contractShipmentService.editLinked(contractShipmentList, ContractShipment::getContractId, contract.getId());
-            }
             for (ContractShipment c : contractShipmentList) {
                 c.setContractId(contract.getId());
             }
             contractShipmentService.saveOrUpdateBatch(contractShipmentList);
         }
-        if (ObjectUtil.isNotEmpty(contract.getId())) {
-            // 交接单附件列表
-            ObsFileUtil.editFile(contract.getFileList(), contract.getId(), 1);
-            // 包装指示附件列表
-            ObsFileUtil.editFile(contract.getPackageFileList(), contract.getId(), 2);
-        } else {
-            // 交接单附件列表
-            ObsFileUtil.saveFile(contract.getFileList(), contract.getId(), 1);
-            // 包装指示附件列表
-            ObsFileUtil.saveFile(contract.getPackageFileList(), contract.getId(), 2);
-        }
+        // 交接单附件列表
+        ObsFileUtil.saveFile(contract.getFileList(), contract.getId(), 1);
+        // 包装指示附件列表
+        ObsFileUtil.saveFile(contract.getPackageFileList(), contract.getId(), 2);
         return contract;
     }
     @DSTransactional

+ 4 - 10
hx-sale/src/main/java/com/fjhx/sale/service/sale/impl/SaleQuotationServiceImpl.java

@@ -179,10 +179,10 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         saleQuotation.setBuyCityId(saleQuotation.getCityId());
         saleQuotation.setBuyCountryId(saleQuotation.getCountryId());
         saleQuotation.setBuyProvinceId(saleQuotation.getProvinceId());
-        //添加报价编码
-        if(ObjectUtil.isEmpty(saleQuotation.getId())){
-            saleQuotation.setCode(codingRuleService.createCode(CodingRuleEnum.SALE_QUOTATION.getKey(),saleQuotation.getBuyCorporationId()));
-        }
+//        //添加报价编码
+//        if(ObjectUtil.isEmpty(saleQuotation.getId())){
+//            saleQuotation.setCode(codingRuleService.createCode(CodingRuleEnum.SALE_QUOTATION.getKey(),saleQuotation.getBuyCorporationId()));
+//        }
 
         //添加报价状态
         saleQuotation.setStatus(SaleQuotationEnum.DRAFT.getKey());
@@ -190,17 +190,11 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         this.saveOrUpdate(saleQuotation);
         List<QuotationProduct> quotationProductList = saleQuotation.getQuotationProductList();
         if(CollectionUtils.isNotEmpty(quotationProductList)){//保存报价产品信息
-            if (ObjectUtil.isNotEmpty(saleQuotation.getId())) {
-                quotationProductService.editLinked(quotationProductList, QuotationProduct::getSaleQuotationId, saleQuotation.getId());
-            }
             quotationProductList.forEach(quotationProduct -> quotationProduct.setSaleQuotationId(saleQuotation.getId()));
             quotationProductService.saveOrUpdateBatch(quotationProductList);
         }
         List<QuotationPay> quotationPayList = saleQuotation.getQuotationPayList();
         if(CollectionUtils.isNotEmpty(quotationPayList)){//保存报价项目信息
-            if (ObjectUtil.isNotEmpty(saleQuotation.getId())) {
-                quotationPayService.editLinked(quotationPayList, QuotationPay::getSaleQuotationId, saleQuotation.getId());
-            }
             quotationPayList.forEach(quotationPay -> quotationPay.setSaleQuotationId(saleQuotation.getId()));
             quotationPayService.saveOrUpdateBatch(quotationPayList);
         }