|
@@ -84,7 +84,7 @@ public class ContractUpdateFlow extends FlowDelegate {
|
|
|
}
|
|
|
//查询原合同
|
|
|
Contract oldContract = contractService.getById(contract.getOldContractId());
|
|
|
- if(ObjectUtil.isEmpty(oldContract)){
|
|
|
+ if (ObjectUtil.isEmpty(oldContract)) {
|
|
|
throw new ServiceException("查询不到原合同信息");
|
|
|
}
|
|
|
//更新原样品单状态为变更中
|
|
@@ -92,12 +92,12 @@ public class ContractUpdateFlow extends FlowDelegate {
|
|
|
contractService.updateById(oldContract);
|
|
|
//查询旧合同的订单产品
|
|
|
List<ContractProduct> oldContractProductList = contractProductService.list(q -> q.eq(ContractProduct::getContractId, oldContractId));
|
|
|
- if(CollectionUtils.isEmpty(oldContractProductList)){
|
|
|
+ if (CollectionUtils.isEmpty(oldContractProductList)) {
|
|
|
throw new ServiceException("原合同没有产品");
|
|
|
}
|
|
|
- Map<Long,List<ContractProduct>> oldContractProductMap = oldContractProductList.stream().collect(Collectors.groupingBy(ContractProduct::getId));
|
|
|
+ Map<Long, List<ContractProduct>> oldContractProductMap = oldContractProductList.stream().collect(Collectors.groupingBy(ContractProduct::getId));
|
|
|
List<ContractProduct> newContractProductList = contract.getContractProductList();
|
|
|
- if(CollectionUtils.isEmpty(newContractProductList)){
|
|
|
+ if (CollectionUtils.isEmpty(newContractProductList)) {
|
|
|
throw new ServiceException("变更合同产品不能为空");
|
|
|
}
|
|
|
/**
|
|
@@ -115,9 +115,9 @@ public class ContractUpdateFlow extends FlowDelegate {
|
|
|
/**
|
|
|
* 计算新合同的剩余数量
|
|
|
*/
|
|
|
- for(ContractProduct newCp:newContractProductList){
|
|
|
+ for (ContractProduct newCp : newContractProductList) {
|
|
|
newCp.setExpendQuantity(newCp.getQuantity());
|
|
|
- if(ObjectUtil.isNotEmpty(newCp.getId())){//如果新合同产品ID不为空
|
|
|
+ if (ObjectUtil.isNotEmpty(newCp.getId())) {//如果新合同产品ID不为空
|
|
|
//取出旧合同
|
|
|
ContractProduct oldContractProduct = oldContractProductMap.getOrDefault(newCp.getId(),null).get(0);
|
|
|
// //取出旧合同包装方式
|
|
@@ -140,8 +140,10 @@ public class ContractUpdateFlow extends FlowDelegate {
|
|
|
}
|
|
|
return update(contract);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 变更
|
|
|
+ *
|
|
|
* @param contract
|
|
|
* @return
|
|
|
*/
|
|
@@ -297,6 +299,7 @@ public class ContractUpdateFlow extends FlowDelegate {
|
|
|
|
|
|
/**
|
|
|
* 重新发起
|
|
|
+ *
|
|
|
* @param flowId
|
|
|
* @param businessId
|
|
|
* @param flowStatus
|