diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenOrderToLoadListener.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenOrderToLoadListener.java index 0e0da40b5..5b106c18b 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenOrderToLoadListener.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenOrderToLoadListener.java @@ -3,10 +3,8 @@ package com.logpm.trunkline.mq; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; -import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; -import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity; -import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity; -import com.logpm.trunkline.entity.TrunklineCarsOrderEntity; +import com.logpm.trunkline.dto.InComingDTO; +import com.logpm.trunkline.entity.*; import com.logpm.trunkline.service.*; import com.rabbitmq.client.Channel; import lombok.AllArgsConstructor; @@ -27,13 +25,14 @@ import java.util.*; @RabbitListener(queues = RabbitConstant.OPEN_ORDER_LOAD_SCAN_QUEUE) public class OpenOrderToLoadListener { + private final ITrunklineAdvanceService advanceService; private final ITrunklineAdvanceDetailService advanceDetailService; private final ITrunklineCarsLoadScanService carsLoadScanService; private final ITrunklineCarsLoadService carsLoadService; private final ITrunklineCarsOrderService carsOrderService; private final ITrunklineCarsLoadLineService carsLoadLineService; private final ITrunklineWaybillOrderService waybillOrderService; - + private final IInComingService inComingService; @RabbitHandler @Transactional(rollbackFor = Exception.class) @@ -48,6 +47,7 @@ public class OpenOrderToLoadListener { Set loadIds = new HashSet<>(); for (Object object : advanceIds) { Long advanceId = (Long) object; + TrunklineAdvanceEntity advanceEntity = advanceService.getById(advanceId); List advanceDetailEntityList = advanceDetailService.findListByAdvanceId(advanceId); for (TrunklineAdvanceDetailEntity advanceDetailEntity : advanceDetailEntityList) { String orderPackageCode = advanceDetailEntity.getOrderPackageCode(); @@ -61,7 +61,21 @@ public class OpenOrderToLoadListener { carsLoadScanEntity.setIsSupple(1); carsLoadScanEntity.setLoadingAbnormal(0); carsLoadScanEntity.setUnloadAbnormal(0); + String packageStatus = advanceDetailEntity.getPackageStatus(); + if("0".equals(packageStatus)){ + //未入库,强制入库 + Long warehouseId = advanceDetailEntity.getWarehouseId(); + InComingDTO inComingDTO = new InComingDTO(); + inComingDTO.setOrderPackageCode(orderPackageCode); + inComingDTO.setIncomingType(10); + inComingDTO.setWarehouseId(warehouseId); + inComingService.incomingPackage(inComingDTO); + carsLoadScanEntity.setFromWarehouseId(warehouseId); + }else{ + carsLoadScanEntity.setFromWarehouseId(advanceDetailEntity.getIncomingWarehouseId()); + } carsLoadScanService.updateById(carsLoadScanEntity); + Long loadId = carsLoadScanEntity.getLoadId(); Long warehouseId = carsLoadScanEntity.getWarehouseId(); String warehouseName = carsLoadScanEntity.getWarehouseName(); @@ -87,8 +101,8 @@ public class OpenOrderToLoadListener { trunklineCarsOrderEntity.setLoadLineId(carsLoadLineEntity.getId()); trunklineCarsOrderEntity.setOrderCode(orderCode); trunklineCarsOrderEntity.setWaybillNo(waybillNo); - Integer totalNum = waybillOrderService.findTotalNumByWaybillNoAndOrderCode(waybillId,orderCode); - trunklineCarsOrderEntity.setTotalNum(totalNum); +// Integer totalNum = waybillOrderService.findTotalNumByWaybillNoAndOrderCode(waybillId,orderCode); + trunklineCarsOrderEntity.setTotalNum(advanceEntity.getTotalNum()); trunklineCarsOrderEntity.setPlanNum(0); trunklineCarsOrderEntity.setIsCustomer("0"); trunklineCarsOrderEntity.setRealNum(0); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java index 7be1e44fb..ce34756e0 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java @@ -49,7 +49,7 @@ public class InComingServiceImpl implements IInComingService { Long warehouseId = inComingDTO.getWarehouseId();//仓库id String warehouseName = inComingDTO.getWarehouseName(); Long billladingId = inComingDTO.getBillladingId();//提货单id - Integer incomingType = inComingDTO.getIncomingType();//入库类型 1码板打托 2扫码入库 3直接入库 4 按车次号入库 5按订单入库 6扫描入库 7 批量卸车入库 8卸车托盘 9卸分一体 + Integer incomingType = inComingDTO.getIncomingType();//入库类型 1码板打托 2扫码入库 3直接入库 4 按车次号入库 5按订单入库 6扫描入库 7 批量卸车入库 8卸车托盘 9卸分一体 10补录数据入库 String trayCode = inComingDTO.getTrayCode();//托盘码 String trayType = inComingDTO.getTrayType();//打托方式 diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java index 651f06f54..3dbeafe4d 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java @@ -184,7 +184,7 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl