合同拆分金额与收发货规则优化

This commit is contained in:
潘荣晟
2026-01-22 11:49:37 +08:00
parent 71ba93c7db
commit b8de5bfda7

View File

@@ -976,7 +976,9 @@ public class ContractServiceImpl implements ContractService {
if (reqVO.getContractReceiveSends() != null && !reqVO.getContractReceiveSends().isEmpty()) { if (reqVO.getContractReceiveSends() != null && !reqVO.getContractReceiveSends().isEmpty()) {
//通过合同id删除收发货规则 //通过合同id删除收发货规则
List<ContractReceiveSendRespVO> contractReceiveSendListByContract = contractReceiveSendService.getContractReceiveSendListByContractId(id); List<ContractReceiveSendRespVO> contractReceiveSendListByContract = contractReceiveSendService.getContractReceiveSendListByContractId(id);
contractReceiveSendService.deleteContractReceiveSendListByIds(contractReceiveSendListByContract.stream().map(ContractReceiveSendRespVO::getId).toList()); if (!contractReceiveSendListByContract.isEmpty()){
contractReceiveSendService.deleteContractReceiveSendListByIds(contractReceiveSendListByContract.stream().map(ContractReceiveSendRespVO::getId).toList());
}
//重新插入收发货规则 //重新插入收发货规则
reqVO.getContractReceiveSends().forEach(item -> { reqVO.getContractReceiveSends().forEach(item -> {
item.setContractId(id); item.setContractId(id);
@@ -987,7 +989,9 @@ public class ContractServiceImpl implements ContractService {
//更新资金拆分表(直接先删除后面再插入) //更新资金拆分表(直接先删除后面再插入)
if (reqVO.getAmountSplit() != null && !reqVO.getAmountSplit().isEmpty()) { if (reqVO.getAmountSplit() != null && !reqVO.getAmountSplit().isEmpty()) {
List<AmountDismantleDO> amountDismantleList = amountDismantleService.getAmountDismantleListByContractId(id); List<AmountDismantleDO> amountDismantleList = amountDismantleService.getAmountDismantleListByContractId(id);
amountDismantleService.deleteAmountDismantleListByIds(amountDismantleList.stream().map(AmountDismantleDO::getId).toList()); if(!amountDismantleList.isEmpty()){
amountDismantleService.deleteAmountDismantleListByIds(amountDismantleList.stream().map(AmountDismantleDO::getId).toList());
}
reqVO.getAmountSplit().forEach(item -> { reqVO.getAmountSplit().forEach(item -> {
item.setContractId(id); item.setContractId(id);
item.setId(null); item.setId(null);