|
|
@@ -1391,4 +1391,23 @@ public class KwcContractLogisticsService {
|
|
|
tradeGoodsInfo.setPrice(x.getPrice());
|
|
|
return tradeGoodsInfo;
|
|
|
}
|
|
|
+
|
|
|
+ public Boolean updateLogistics(UpdateLogisticsReq req) {
|
|
|
+ log.info("更新物流合同参数:{}", JSON.toJSONString( req));
|
|
|
+ KwcContractLogistics logistics = kwcContractLogisticsRepository.queryById(req.getLogContractId());
|
|
|
+ if (Objects.isNull(logistics)){
|
|
|
+ throw new BusinessException("物流合同不存在");
|
|
|
+ }
|
|
|
+ KwcContractLogistics updateLogistics = new KwcContractLogistics();
|
|
|
+ if (Objects.nonNull(req.getLogStatus()) && Objects.equals(logistics.getStatus(),
|
|
|
+ ContractStatusEnum.SUBMIT.getCode())){
|
|
|
+ updateLogistics.setStatus(req.getLogStatus());
|
|
|
+ updateLogistics.setId(logistics.getId());
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(req.getLogStatus()) && Objects.equals(logistics.getStatus(),ContractStatusEnum.SIGNED.getCode())){
|
|
|
+ updateLogistics.setStatus(req.getLogStatus());
|
|
|
+ updateLogistics.setId(logistics.getId());
|
|
|
+ }
|
|
|
+ return kwcContractLogisticsRepository.updateLogistics(updateLogistics);
|
|
|
+ }
|
|
|
}
|