|
|
@@ -13,8 +13,8 @@ import com.sckw.fleet.api.model.vo.RDriverScoreVo;
|
|
|
import com.sckw.fleet.api.model.vo.RDriverVo;
|
|
|
import com.sckw.fleet.api.model.vo.RTruckVo;
|
|
|
import com.sckw.fleet.api.model.vo.TruckDispatchCoefficientVO;
|
|
|
-import com.sckw.order.api.model.OrderDetailRes;
|
|
|
import com.sckw.order.api.model.OrderDetailVo;
|
|
|
+import com.sckw.order.api.model.OrderUnitInfoDetailVO;
|
|
|
import com.sckw.order.api.model.UpdateActualAmountParam;
|
|
|
import com.sckw.product.api.model.KwpGoods;
|
|
|
import com.sckw.transport.model.*;
|
|
|
@@ -172,19 +172,11 @@ public class TakingOrderHandler extends AbstractWaybillOrderHandler<OrderCircula
|
|
|
log.info("开始创建门卫订单,入参参数:{}", JSON.toJSONString(waybillOrder));
|
|
|
CompletableFuture.runAsync(() -> {
|
|
|
try {
|
|
|
-// Long entId = null;
|
|
|
-// // 原矿运输山上、上下门卫企业id
|
|
|
-// List<Long> mockEntIds = Arrays.asList(538039617157337089L, 538040297439891457L);
|
|
|
-// if (Objects.equals(1, logOrder.getOrderType())) {
|
|
|
-// entId = mockEntIds.get(0);
|
|
|
-// } else {
|
|
|
-// OrderDetailRes tradeOrderDetail = tradeOrderInfoService.
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
+ // 获取企业id
|
|
|
+ Long entId = getEntId(logOrder);
|
|
|
|
|
|
KwtGatekeeperWaybillOrder gatekeeper = new KwtGatekeeperWaybillOrder();
|
|
|
- gatekeeper.setEntId(waybillOrder.getEntId());
|
|
|
+ gatekeeper.setEntId(entId);
|
|
|
gatekeeper.setWOrderId(waybillOrder.getId());
|
|
|
gatekeeper.setWOrderNo(waybillOrder.getWOrderNo());
|
|
|
gatekeeper.setLOrderId(waybillOrder.getLOrderId());
|
|
|
@@ -223,6 +215,33 @@ public class TakingOrderHandler extends AbstractWaybillOrderHandler<OrderCircula
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取企业id
|
|
|
+ * @param logOrder
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private Long getEntId(KwtLogisticsOrder logOrder) {
|
|
|
+ log.info("[创建装货门卫]开始查询企业id,入参参数:{}", JSON.toJSONString(logOrder));
|
|
|
+ Long entId;
|
|
|
+ KwtLogisticsOrderUnit kwtLogisticsOrderUnit = logisticsOrderUnitRepository.queryByLOrderIdAndUnitType(logOrder.getId(), 1);
|
|
|
+ if (kwtLogisticsOrderUnit == null) {
|
|
|
+ throw new BusinessPlatfromException(ErrorCodeEnum.LOGISTICS_ORDER_NOT_FOUND, "[接单]物流企业信息数据不存在");
|
|
|
+ }
|
|
|
+ // 原矿运输山上、上下门卫企业id
|
|
|
+ List<Long> mockEntIds = Arrays.asList(538039617157337089L, 538040297439891457L);
|
|
|
+ if (Objects.equals(1, logOrder.getOrderType()) && mockEntIds.contains(kwtLogisticsOrderUnit.getEntId())) {
|
|
|
+ entId = mockEntIds.get(0);
|
|
|
+ } else {
|
|
|
+ List<OrderUnitInfoDetailVO> unitInfoDetailVOS = tradeOrderInfoService.queryOrderUnitByTradeOrderId(logOrder.getTOrderId());
|
|
|
+ OrderUnitInfoDetailVO unitInfoDetailVO = unitInfoDetailVOS.stream()
|
|
|
+ .filter(unit -> Objects.equals(unit.getUnitType(), "2"))
|
|
|
+ .findFirst().orElse(new OrderUnitInfoDetailVO());
|
|
|
+ entId = unitInfoDetailVO.getEntId();
|
|
|
+ }
|
|
|
+ log.info("[创建装货门卫]查询企业id完成,入参参数:{}", JSON.toJSONString(entId));
|
|
|
+ return entId;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
protected void calculateAutoDispatchScore(OrderCirculateTakingQueryParam param, KwtWaybillOrder waybillOrder) {
|
|
|
|