|
|
@@ -1645,28 +1645,31 @@ public class WaybillOrderService {
|
|
|
if (logisticsOrder == null) {
|
|
|
throw new BusinessPlatfromException(ErrorCodeEnum.WAYBILL_ORDER_NOT_FOUND, "[称重过磅]当前物流运单不存在!");
|
|
|
}
|
|
|
- // 山上企业
|
|
|
- Long upEntId = 538039617157337089L;
|
|
|
- // 山下企业
|
|
|
- Long downEntId = 538040297439891457L;
|
|
|
+ // 山上/山下企业
|
|
|
+ List<Long> mockEntIds = Arrays.asList(538039617157337089L, 538040297439891457L);
|
|
|
// 原矿运输
|
|
|
if (Objects.equals(1, logisticsOrder.getOrderType())) {
|
|
|
log.info("[过磅]该过磅订单为原矿运输,订单信息:{}", JSON.toJSONString(logisticsOrder));
|
|
|
+ //查询原矿运输企业的供应商
|
|
|
KwtLogisticsOrderUnit logisticsOrderUnit = logisticsOrderUnitRepository.queryByLOrderIdAndUnitType(logisticsOrder.getId(), 1);
|
|
|
if (logisticsOrderUnit == null) {
|
|
|
throw new BusinessPlatfromException(ErrorCodeEnum.WAYBILL_ORDER_NOT_FOUND, "[称重过磅]当前物流订单关联企业信息不存在!");
|
|
|
}
|
|
|
- //校验走山上还是山下
|
|
|
- if (Objects.equals(param.getEntId(), logisticsOrderUnit.getEntId()) && Objects.equals(logisticsOrderUnit.getEntId(), upEntId)) {
|
|
|
- // 1. 山上装货过磅
|
|
|
- comeIntoHandler(param, waybillOrder);
|
|
|
- } else if (Objects.equals(param.getEntId(), logisticsOrderUnit.getEntId()) && Objects.equals(logisticsOrderUnit.getEntId(), downEntId)) {
|
|
|
- // 2. 山下卸货过磅
|
|
|
- unloadingWeighHnadler(param, waybillOrder);
|
|
|
+ if (mockEntIds.contains(logisticsOrderUnit.getEntId())) {
|
|
|
+ //校验走山上还是山下
|
|
|
+ if (Objects.equals(param.getEntId(), mockEntIds.get(0))) {
|
|
|
+ // 1. 山上装货过磅
|
|
|
+ comeIntoHandler(param, waybillOrder);
|
|
|
+ } else if (Objects.equals(param.getEntId(), mockEntIds.get(1))) {
|
|
|
+ // 2. 山下卸货过磅
|
|
|
+ unloadingWeighHnadler(param, waybillOrder);
|
|
|
+ } else {
|
|
|
+ log.info("[称重过磅]过磅称重匹配失败,地磅企业:{},供应企业:{}",
|
|
|
+ JSON.toJSONString(param.getEntId()), JSON.toJSONString(logisticsOrderUnit.getEntId()));
|
|
|
+ throw new BusinessPlatfromException(ErrorCodeEnum.WAYBILL_ORDER_NOT_FOUND, "[称重过磅]过磅称重匹配失败!");
|
|
|
+ }
|
|
|
} else {
|
|
|
- log.info("[称重过磅]过磅称重匹配失败,地磅企业:{},供应企业:{}",
|
|
|
- JSON.toJSONString(param.getEntId()), JSON.toJSONString(logisticsOrderUnit.getEntId()));
|
|
|
- throw new BusinessPlatfromException(ErrorCodeEnum.WAYBILL_ORDER_NOT_FOUND, "[称重过磅]过磅称重匹配失败!");
|
|
|
+ throw new BusinessPlatfromException(ErrorCodeEnum.WAYBILL_ORDER_NOT_FOUND, "[称重过磅]原矿运输的供应商不属于山上山下企业!");
|
|
|
}
|
|
|
} else {
|
|
|
log.info("[过磅]该过磅订单为产品销售,订单信息:{}", JSON.toJSONString(logisticsOrder));
|