|
@@ -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
|