From ec9714b52cf997e4eb824d64d7036b424b0adc8b Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Thu, 26 Sep 2024 14:11:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E8=A7=A3=E5=86=B3=E5=85=B6=E5=AE=83?= =?UTF-8?q?=E7=89=A9=E6=B5=81=E5=85=AC=E5=8F=B8=E5=9B=9E=E4=BC=A0=E5=B7=A5?= =?UTF-8?q?=E5=8E=82=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../factory/comfac/dto/OrderStatusDTO.java | 16 +++++++++++++++ .../impl/PanFactoryDataServiceImpl.java | 6 +++--- .../factory/receiver/DealWithDataHandler.java | 15 ++++++++++++-- .../factory/receiver/OrderStatusHandler.java | 20 ++++++++++++------- .../impl/ZbFactoryDataServiceImpl.java | 20 +++++++++---------- 5 files changed, 55 insertions(+), 22 deletions(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java index ccc3d3129..6a755131a 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java @@ -56,6 +56,16 @@ public class OrderStatusDTO implements Serializable { @NotEmpty(message = "目的仓库不能为空") private String destinationWarehouse;//目的仓库 + + @NotEmpty(message = "当前仓库不能为空") + //当前仓库名称 + private String currentWarehouseName; + + @NotEmpty(message = "目的仓库不能为空") + //目的仓库名称 + private String destinationWarehouseName; + + @NotEmpty(message = "状态不能为空") private String status;//状态 @@ -71,6 +81,12 @@ public class OrderStatusDTO implements Serializable { @NotEmpty(message = "操作人名称") private String username; + @NotEmpty(message = "品牌") + private String brandName; + + @NotEmpty(message = "来源 汇通 桃源 世平") + private String sourceName; + /** * 验证参数是否都存在 diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java index 56343ed2c..3017d753c 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java @@ -254,15 +254,15 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { } String plantId = one.getPlantId(); //查询destinationWarehouse logiBillNo plantId数据 - Map supplyData = advanceDetailClient.getSupplyData(unitNo); +// Map supplyData = advanceDetailClient.getSupplyData(unitNo); //根据仓库ID查询仓库名字 currentWarehouse = warehouseClient.selectNameById(Integer.parseInt(currentWarehouse)); orderStatusDTO.setPlantId(plantId); orderStatusDTO.setCurrentWarehouse(currentWarehouse); - orderStatusDTO.setDestinationWarehouse(supplyData.get("destinationWarehouse")); - orderStatusDTO.setLogiBillNo(supplyData.get("logiBillNo")); + orderStatusDTO.setDestinationWarehouse(orderStatusDTO.getDestinationWarehouseName()); + orderStatusDTO.setLogiBillNo(orderStatusDTO.getLogiBillNo()); //修改状态映射 orderStatusDTO.setStatus(statusName(orderStatusDTO.getStatus())); diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java index 3f51c3b34..ea46e7d34 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java @@ -8,6 +8,7 @@ import com.logpm.factory.entity.OrderPackageStatusPushFailLogEntity; import com.rabbitmq.client.Channel; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.RabbitConstant; +import org.springblade.core.tool.utils.StringUtil; import org.springframework.amqp.core.Message; import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitListener; @@ -41,7 +42,7 @@ public class DealWithDataHandler { @RabbitHandler public void dealWithDataHandler(Map map, Message message, Channel channel) throws IOException { // 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉 - log.info("##################dealWithDataHandler: 处理在库订单数据到新系统"); + OrderStatusDTO orderStatusDTO = (OrderStatusDTO) map.get("messageData"); String status = orderStatusDTO.getStatus(); String unitNo = orderStatusDTO.getUnitNo(); @@ -49,7 +50,17 @@ public class DealWithDataHandler { Integer trayId = orderStatusDTO.getTrayId(); String currentWarehouseId = orderStatusDTO.getCurrentWarehouse();//当前仓Id - factoryCommonService.extracted(status, unitNo, currentWarehouseId, operationTime, trayId); + String sourceName=orderStatusDTO.getSourceName(); + if(StringUtil.isEmpty(sourceName)){ + sourceName = "汇通"; + } + log.info("##################dealWithDataHandler: 处理在库订单数据到新系统 来源:{} 品牌:{}",sourceName,orderStatusDTO.getBrandName()); + if("汇通".equals(orderStatusDTO.getSourceName())){ + factoryCommonService.extracted(status, unitNo, currentWarehouseId, operationTime, trayId); + }else{ + log.warn(">>>> 不是汇通的数据 不进入汇通入库数据"); + } + // extracted(unitNo,currentWarehouseId); //extracted(unitNo,currentWarehouseId); diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java index cd54d98f5..50742269d 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java @@ -86,19 +86,25 @@ public class OrderStatusHandler { public void orderStatusHandler(Map map, Message message, Channel channel) throws IOException, NoSuchAlgorithmException { // 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉 final long deliveryTag = message.getMessageProperties().getDeliveryTag(); - String msg = new String(message.getBody()); +// String msg = new String(message.getBody()); log.info("##################orderStatusHandler: 处理扫码作业数据"); OrderStatusDTO orderStatusDTO = (OrderStatusDTO) map.get("messageData"); String orderSelfNum = orderStatusDTO.getOrderNo();//订单自编号 String unitNo = orderStatusDTO.getUnitNo(); //通过订单自编号去查询该条订单是属于哪个工厂 - AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderSelfNum); - if (Objects.isNull(advanceEntity)) { - log.info("##################orderStatusHandler: 未找到对应订单 orderNo={}", orderSelfNum); +// + String type = orderStatusDTO.getBrandName();//品牌 + + + if (type == null) { + AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderSelfNum); + if (Objects.isNull(advanceEntity)) { + log.info("##################orderStatusHandler: 未找到对应订单 orderNo={}", orderSelfNum); // channel.basicAck(deliveryTag,true); - return; + return; + } + type = advanceEntity.getType(); } - String type = advanceEntity.getType();//品牌 R r = null; switch (type) { @@ -112,7 +118,7 @@ public class OrderStatusHandler { } break; case FactoryConstant.MENGT: - if(mtFactoryProperties.getSendEnable()){ + if (mtFactoryProperties.getSendEnable()) { r = mtFactoryDataService.handleStatusData(orderStatusDTO); if (r.getCode() == 400 || r.getCode() == 200) { log.info("TAG {} ##################orderStatusHandler: 该条数据不用处理 orderNo={}", FactoryConstant.MENGT, orderSelfNum); diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/zb/service/impl/ZbFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/zb/service/impl/ZbFactoryDataServiceImpl.java index e9c24b8e3..3b2e1662e 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/zb/service/impl/ZbFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/zb/service/impl/ZbFactoryDataServiceImpl.java @@ -119,21 +119,21 @@ public class ZbFactoryDataServiceImpl implements IZbFactoryDataService { } //继续判断是否到达目的仓 - String currentWarehouseId = orderStatusDTO.getCurrentWarehouse();//当前仓Id + String currentWarehouse = orderStatusDTO.getCurrentWarehouseName();//当前仓 //查询destinationWarehouse logiBillNo plantId数据 log.info("handleStatusData >>> unitNo={}",unitNo); - Map supplyData = advanceDetailClient.getSupplyData(unitNo); - if(ObjectUtils.isEmpty(supplyData)){ - return Resp.fail(400, "未查询到该单据信息"); - } - String destinationWarehouseId = supplyData.get("destinationWarehouseId");//目的仓id - if (StringUtil.isBlank(currentWarehouseId) || StringUtil.isBlank(destinationWarehouseId)) { - log.warn("##############handleStatusData: 仓库数据有问题currentWarehouseId={} destinationWarehouseId={}", currentWarehouseId, destinationWarehouseId); +// Map supplyData = advanceDetailClient.getSupplyData(unitNo); +// if(ObjectUtils.isEmpty(supplyData)){ +// return Resp.fail(400, "未查询到该单据信息"); +// } + String destinationWarehouse = orderStatusDTO.getDestinationWarehouseName();//目的仓 + if (StringUtil.isBlank(currentWarehouse) || StringUtil.isBlank(destinationWarehouse)) { + log.warn("##############handleStatusData: 仓库数据有问题currentWarehouseId={} destinationWarehouseId={}", currentWarehouse, destinationWarehouse); return Resp.fail(400, "仓库数据有误"); } - if (!currentWarehouseId.equals(destinationWarehouseId)) { - log.info("##############handleStatusData: 不用处理的状态 currentWarehouseId={} destinationWarehouseId={}", currentWarehouseId, destinationWarehouseId); + if (!currentWarehouse.equals(destinationWarehouse)) { + log.info("##############handleStatusData: 不用处理的状态 currentWarehouseId={} destinationWarehouseId={}", currentWarehouse, destinationWarehouse); return Resp.fail(400, "不是目的仓"); } From 5cb4c21bd9ed6360acc9add30255b910b3b2d7b1 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Thu, 26 Sep 2024 17:30:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E8=B4=A7=E4=BD=8D?= =?UTF-8?q?=E7=9A=84=E5=91=88=E7=8E=B0=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/BasicdataGoodsShelfServiceImpl.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java index 3a3626d15..459c5cb0e 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java @@ -440,7 +440,9 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl