|
@@ -116,13 +116,14 @@ public class ContractUpdateFlow extends FlowDelegate {
|
|
|
|
|
|
|
|
|
for (ContractProductDto contractProductDto : contractProductList) {
|
|
|
+ contractProductDto.setId(null);
|
|
|
+
|
|
|
List<ContractProductBom> contractProductBomList = contractProductDto.getContractProductBomList();
|
|
|
contractProductBomList = ObjectUtils.isEmpty(contractProductBomList) ? new ArrayList<>() : contractProductBomList;
|
|
|
contractProductBomList.forEach(item -> item.setId(null));
|
|
|
}
|
|
|
|
|
|
|
|
|
- contractProductList.forEach(item -> item.setId(null));
|
|
|
contractProjectList.forEach(item -> item.setId(null));
|
|
|
|
|
|
|
|
@@ -160,6 +161,14 @@ public class ContractUpdateFlow extends FlowDelegate {
|
|
|
editAvailableStock(oldContract, oldContractId, businessId);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ List<ContractProductBom> oldCpbList = contractProductBomService.list(q -> q.eq(ContractProductBom::getContractId, oldContractId));
|
|
|
+ List<ContractProductBom> newCpbList = contractProductBomService.list(q -> q.eq(ContractProductBom::getContractId, businessId));
|
|
|
+ oldCpbList.forEach(item -> item.setContractId(businessId));
|
|
|
+ newCpbList.forEach(item -> item.setContractId(oldContractId));
|
|
|
+ contractProductBomService.updateBatchById(oldCpbList);
|
|
|
+ contractProductBomService.updateBatchById(newCpbList);
|
|
|
+
|
|
|
|
|
|
|
|
|
long temNewId = IdWorker.getId();
|
|
@@ -224,6 +233,8 @@ public class ContractUpdateFlow extends FlowDelegate {
|
|
|
}
|
|
|
ObsFileUtil.exchangeBusinessId(oldContractId, businessId);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
void editAvailableStock(Contract oldContract, Long oldContractId, Long businessId) {
|