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 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, "不是目的仓"); }