|
@@ -116,13 +116,14 @@ public class ContractUpdateFlow extends FlowDelegate {
|
|
|
|
|
|
//清空bomId
|
|
|
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));
|
|
|
}
|
|
|
|
|
|
//清空id
|
|
|
- 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);
|
|
|
}
|
|
|
//-----------------
|
|
|
+ //交换合同产品BOM中的合同id
|
|
|
+ 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);
|
|
|
+ //-----------------
|
|
|
|
|
|
//替换新数据ID为临时ID
|
|
|
long temNewId = IdWorker.getId();
|
|
@@ -224,6 +233,8 @@ public class ContractUpdateFlow extends FlowDelegate {
|
|
|
}
|
|
|
ObsFileUtil.exchangeBusinessId(oldContractId, businessId);
|
|
|
|
|
|
+// throw new ServiceException("1111111111111111111111111");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
void editAvailableStock(Contract oldContract, Long oldContractId, Long businessId) {
|