计划管理相关功能实现

This commit is contained in:
潘荣晟
2026-01-21 16:09:35 +08:00
parent 4007160524
commit 1bb5c117d2
12 changed files with 170 additions and 39 deletions

View File

@@ -125,11 +125,13 @@ public class ContractServiceImpl implements ContractService {
private ContractReceiveSendService contractReceiveSendService;
@Resource
private AmountDismantleService amountDismantleService;
@Override
public PageResult<ContractMainDO> getContractPage(ContractPageReqVO pageReqVO) {
return contractMainMapper.selectContractPage(pageReqVO);
}
boolean isContractReceiveSendValid(List<ContractReceiveSendSaveReqVO> contractReceiveSends){
boolean isContractReceiveSendValid(List<ContractReceiveSendSaveReqVO> contractReceiveSends) {
if (CollectionUtils.isEmpty(contractReceiveSends)) {
return true;
}
@@ -320,7 +322,7 @@ public class ContractServiceImpl implements ContractService {
});
}
//插入资金拆分表
if(reqVO.getAmountSplit() != null && !reqVO.getAmountSplit().isEmpty()){
if (reqVO.getAmountSplit() != null && !reqVO.getAmountSplit().isEmpty()) {
reqVO.getAmountSplit().forEach(amountDismantle -> {
amountDismantle.setContractId(contractId);
amountDismantleService.createAmountDismantle(amountDismantle);
@@ -961,22 +963,22 @@ public class ContractServiceImpl implements ContractService {
submitErp(newContractMainDO.getId());
}
//更新收发货规则
if (reqVO.getContractReceiveSends() != null && !reqVO.getContractReceiveSends().isEmpty()){
if (reqVO.getContractReceiveSends() != null && !reqVO.getContractReceiveSends().isEmpty()) {
//通过合同id删除收发货规则
List<ContractReceiveSendRespVO> contractReceiveSendListByContract = contractReceiveSendService.getContractReceiveSendListByContractId(id);
contractReceiveSendService.deleteContractReceiveSendListByIds(contractReceiveSendListByContract.stream().map(ContractReceiveSendRespVO::getId).toList());
//重新插入收发货规则
reqVO.getContractReceiveSends().forEach(item->{
reqVO.getContractReceiveSends().forEach(item -> {
item.setContractId(id);
item.setId(null);
contractReceiveSendService.createContractReceiveSend(item);
});
}
//更新资金拆分表(直接先删除后面再插入)
if (reqVO.getAmountSplit()!=null &&!reqVO.getAmountSplit().isEmpty()){
if (reqVO.getAmountSplit() != null && !reqVO.getAmountSplit().isEmpty()) {
List<AmountDismantleDO> amountDismantleList = amountDismantleService.getAmountDismantleListByContractId(id);
amountDismantleService.deleteAmountDismantleListByIds(amountDismantleList.stream().map(AmountDismantleDO::getId).toList());
reqVO.getAmountSplit().forEach(item->{
reqVO.getAmountSplit().forEach(item -> {
item.setContractId(id);
item.setId(null);
amountDismantleService.createAmountDismantle(item);
@@ -1420,10 +1422,14 @@ public class ContractServiceImpl implements ContractService {
}
//收发货
List<ContractReceiveSendRespVO> contractReceiveSendListByContractId = contractReceiveSendService.getContractReceiveSendListByContractId(contractMainDO.getId());
if (contractReceiveSendListByContractId!=null&&!contractReceiveSendListByContractId.isEmpty()){
if (contractReceiveSendListByContractId != null && !contractReceiveSendListByContractId.isEmpty()) {
respDTO.setContractReceiveSends(BeanUtils.toBean(contractReceiveSendListByContractId, ContractReceiveSendRespDTO.class));
}
//金额拆分
List<AmountDismantleDO> amountDismantleListByContractId = amountDismantleService.getAmountDismantleListByContractId(contractMainDO.getId());
if (amountDismantleListByContractId != null && !amountDismantleListByContractId.isEmpty()) {
respDTO.setAmountSplits(BeanUtils.toBean(amountDismantleListByContractId,AmountSplitRespDTO.class));
}
return respDTO;
}
@@ -1513,16 +1519,19 @@ public class ContractServiceImpl implements ContractService {
}
//收发货
List<ContractReceiveSendRespVO> contractReceiveSendListByContractId = contractReceiveSendService.getContractReceiveSendListByContractId(contractMainDO.getId());
if (contractReceiveSendListByContractId!=null&&!contractReceiveSendListByContractId.isEmpty()){
if (contractReceiveSendListByContractId != null && !contractReceiveSendListByContractId.isEmpty()) {
respDTO.setContractReceiveSends(BeanUtils.toBean(contractReceiveSendListByContractId, ContractReceiveSendRespDTO.class));
}
//金额拆分
List<AmountDismantleDO> amountDismantleListByContractId = amountDismantleService.getAmountDismantleListByContractId(contractMainDO.getId());
if (amountDismantleListByContractId != null && !amountDismantleListByContractId.isEmpty()) {
respDTO.setAmountSplits(BeanUtils.toBean(amountDismantleListByContractId,AmountSplitRespDTO.class));
}
return respDTO;
}
@Override
public JSONObject submitErp(Long id) {