diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java index b57c18ceb..47ac0d799 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java @@ -1604,11 +1604,16 @@ public class DistributionStockupAppController extends BladeController { mapState.put("createTime", new Date().getTime()); - //将消息携带绑定键值 - rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_STATE_UPDATE_EXCHANGE, RabbitConstant.STOCKUP_STATE_UPDATE_ROUTING, mapState); String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.saomiaochenggong.getValue()); + log.info(">>>>>>>>>>>>>>>>>>>> 对扫码的包件进行下架"); + //将消息携带绑定键值 + rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_STATE_UPDATE_EXCHANGE, RabbitConstant.STOCKUP_STATE_UPDATE_ROUTING, mapState,message -> { + message.getMessageProperties() + .setHeader("x-delay", 3000); + return message; + }); //查询是否货位数据是否该下架 // distributionAsyncService.stockupSelfOffShelf(stockupDTO); return Resp.scanSuccess(PdaAudioLingoStatus.saomiaochenggong.getName(), audioValue); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml index 43d368afc..d62f25cd4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml @@ -452,7 +452,7 @@ FROM logpm_distribution_stock_list ldsl - ldsl.service_type = #{par.serviceType} and ldsl.warehouse_id = #{par.warehouseId} and ldsl.is_deleted = 0 + ldsl.service_type = #{par.serviceType} and ldsl.warehouse_id = #{par.warehouseId} and ldsl.is_deleted = 0 and (ldsl.quantity_stock - ldsl.quantity_occupied) > 0 and ldsl.incoming_batch like concat('%',#{par.incomingBatch},'%') diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java index d23471843..9e1e0416d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java @@ -35,13 +35,18 @@ public class StockupStateUpdateHandler { public void stockupScanHandler(Map map, Message message, Channel channel) throws IOException, InterruptedException { log.info("##################StockupStateUpdateHandler: 处理补全扫码作业其他数据"); final long deliveryTag = message.getMessageProperties().getDeliveryTag(); - StockupDTO messageData = new StockupDTO(); + try{ + StockupDTO messageData = new StockupDTO(); messageData.setStockupId((Long) map.get("stockupId")); messageData.setTypeService(String.valueOf( map.get("typeService"))); messageData.setReservationId((Long) map.get("reservationId")); - //查询是否货位数据是否该下架 + //查询是否货位数据是否该下架 distributionAsyncService.stockupSelfOffShelf(messageData); log.info("######STOCKUP_STATE_UPDATE_QUEUE:备货下架查询成功"); + }catch (Exception e){ + log.error(">>>>>> 备货下架 报错",e); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java index fe5a5385c..43adcabb8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java @@ -76,7 +76,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { private final DistributionReservationMapper distributionReservationMapper; private final DistributionReservationPackageMapper distributionReservationPackageMapper; private final DistributionParcelListServiceImpl distributionParcelListService; - private final DistributionStockupMapper distributionStockupService; + private final DistributionStockupMapper distributionStockupMapper; private final DistributionStockupInfoMapper distributionStockupInfoMapper; private final DistributionReservationStockarticleMapper distributionReservationStockarticleMapper; private final IDistributionReservationStockarticleService distributionReservationStockarticleService; @@ -653,12 +653,10 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { List distributionStockupSelfVO = new ArrayList<>(); if (stockupDTO.getTypeService().equals(DistributionTypeConstant.ziti.getValue())) { //自 - Thread.sleep(300); - distributionStockupSelfVO = distributionStockupService.stockupSelfOffShelf(stockupDTO); + distributionStockupSelfVO = distributionStockupMapper.stockupSelfOffShelf(stockupDTO); } else { //商 市 - Thread.sleep(300); - distributionStockupSelfVO = distributionStockupService.stockupOffShelf(stockupDTO); + distributionStockupSelfVO = distributionStockupMapper.stockupOffShelf(stockupDTO); } //有 List collectY = distributionStockupSelfVO.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList()); @@ -685,27 +683,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { }); - //没有 - /*List collectW = distributionStockupSelfVO.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList()); - - List list = new ArrayList<>(); - AtomicInteger a = new AtomicInteger(); - AtomicInteger b = new AtomicInteger(); - collectW.forEach(i -> { - if (ObjectUtils.isNull(i.getLwugId())) { - a.addAndGet(1); - if (ObjectUtils.isNotNull(i.getLdsId())) { - b.addAndGet(1); - list.add(i.getOrderPackageCode()); - } - } - }); - if (a.get() == b.get()) { - //下架 - list.forEach(i -> { - warehouseUpdownTypeClient.downPackage(i); - }); - }*/ } @Override @@ -1165,7 +1142,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } stockupEntity.setId(stockupDTO.getStockupId()); - distributionStockupService.updateById(stockupEntity); + distributionStockupMapper.updateById(stockupEntity); } @Override @@ -2426,7 +2403,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { //判断数量 int i = (nu.get() + ku.get()) - (nuy.get() + num); //查询备货状态 - DistributionStockupEntity distributionStockupEntity = distributionStockupService.selectById(stockupDTO.getStockupId()); + DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(stockupDTO.getStockupId()); DistributionStockupEntity distributionStockup = new DistributionStockupEntity(); DistributionReservationEntity reservationEntity = new DistributionReservationEntity(); boolean fa = false; @@ -2462,7 +2439,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { if (!fa) { //没有 //修改备货状态 - distributionStockupService.updateById(distributionStockup); + distributionStockupMapper.updateById(distributionStockup); //修改预约状态 distributionReservationMapper.updateById(reservationEntity); @@ -2555,7 +2532,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } });*/ - DistributionStockupEntity distributionStockupEntity = distributionStockupService.selectById(stockupDTO.getStockupId()); + DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(stockupDTO.getStockupId()); DistributionStockupEntity distributionStockup = new DistributionStockupEntity(); boolean fa = false; if (distributionStockupEntity.getStockupStatus().equals(StockupStatusConstant.beihuozhong.getValue())) { @@ -2583,7 +2560,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } if (!fa) { - distributionStockupService.updateById(distributionStockup); + distributionStockupMapper.updateById(distributionStockup); } //绑定库存品包条码数据 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 71cb1a046..3ba29e112 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -6110,7 +6110,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl keyongshuliang) { + throw new RuntimeException("库存品库内数量不足!!!"); + } //新增库存品 reservationStocklistEntity.setStocklistId(distributionStockListDTO.getId()); reservationStocklistEntity.setReservationId(id); @@ -2025,8 +2029,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl