|
|
@@ -330,6 +330,10 @@ public class KwcContractTradeService {
|
|
|
if (StringUtils.isNotBlank(baseInfo.getContractName()) && baseInfo.getContractName().length() > 20) {
|
|
|
throw new SystemException("合同名称超长!");
|
|
|
}
|
|
|
+ //按卸货筽量时必选计量方式
|
|
|
+ if (Objects.equals(baseInfo.getUnloadWay(), Integer.parseInt(DictEnum.LOAD_UNLOAD_WAY_2.getValue())) && Objects.isNull(baseInfo.getMeasurementWay())) {
|
|
|
+ throw new SystemException("卸货方式为按卸货筽量时,计量方式不能为空!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(goodsInfo)) {
|
|
|
@@ -449,6 +453,7 @@ public class KwcContractTradeService {
|
|
|
}
|
|
|
}
|
|
|
kwcContractTrade.setAmount(amountTotal);
|
|
|
+ kwcContractTrade.setMeasurementWay(baseInfo.getMeasurementWay());
|
|
|
return kwcContractTrade;
|
|
|
}
|
|
|
|
|
|
@@ -753,6 +758,9 @@ public class KwcContractTradeService {
|
|
|
EntTypeResDto entTypeResDto = remoteSystemService.queryEntTypeById(LoginUserHolder.getEntId());
|
|
|
|
|
|
TradeBaseInfoReqVo baseInfo = reqVo.getBaseInfo();
|
|
|
+ if (Objects.equals(baseInfo.getUnloadWay(), Integer.parseInt(DictEnum.LOAD_UNLOAD_WAY_2.getValue())) && Objects.isNull(baseInfo.getMeasurementWay())){
|
|
|
+ throw new BusinessException("卸货方式为按卸货筽量时,计量方式不能为空!");
|
|
|
+ }
|
|
|
kwcContractTrade.setEntId(LoginUserHolder.getEntId());
|
|
|
kwcContractTrade.setContractNo(baseInfo.getContractCode());
|
|
|
kwcContractTrade.setName(baseInfo.getContractName());
|
|
|
@@ -791,6 +799,7 @@ public class KwcContractTradeService {
|
|
|
kwcContractTrade.setSigningUrl(reqVo.getContractFile());
|
|
|
kwcContractTrade.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
kwcContractTrade.setUpdateTime(date);
|
|
|
+ kwcContractTrade.setMeasurementWay(baseInfo.getMeasurementWay());
|
|
|
if (kwcContractTradeMapper.updateById(kwcContractTrade) <= 0) {
|
|
|
throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
|
|
|
}
|