Browse Source

feat(all): 增加梦天回推老接口开关

dist.1.3.0
zhaoqiaobo 6 months ago
parent
commit
fa57fe7750
  1. 9
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/receiver/BusinessData2FactoryHandler.java
  2. 7
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/receiver/BusinessDataClerkCheck2FactoryHandler.java
  3. 3
      blade-service/logpm-factory/src/main/java/com/logpm/factory/props/MtFactoryProperties.java
  4. 14
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/HwyOrderStatusHandler.java
  5. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/HwyUnloadCarComHandler.java
  6. 21
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java

9
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/receiver/BusinessData2FactoryHandler.java

@ -1,12 +1,11 @@
package com.logpm.factory.mt.receiver;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.logpm.factory.mt.service.IMtFactoryDataService;
import com.logpm.factory.props.MtFactoryProperties;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
@ -30,6 +29,8 @@ public class BusinessData2FactoryHandler {
@Autowired
private IMtFactoryDataService mtFactoryDataService;
@Autowired
private MtFactoryProperties mtFactoryProperties;
@RabbitHandler
public void sendOrderPackageScan(Map map, Message message, Channel channel) throws IOException, NoSuchAlgorithmException {
@ -44,7 +45,9 @@ public class BusinessData2FactoryHandler {
String destinationWarehouse = object.getString("destinationWarehouse");
try {
mtFactoryDataService.qianshouScanForNewSystem(orderPackageCode, operationTime, distributionContactId, destinationWarehouse);
if(mtFactoryProperties.getSendEnable()){
mtFactoryDataService.qianshouScanForNewSystem(orderPackageCode, operationTime, distributionContactId, destinationWarehouse);
}
} catch (Exception e) {
log.error(">>>>>>", e);
}

7
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/receiver/BusinessDataClerkCheck2FactoryHandler.java

@ -3,6 +3,7 @@ package com.logpm.factory.mt.receiver;
import com.alibaba.fastjson.JSONObject;
import com.logpm.factory.mt.dto.MtReceiveDTO;
import com.logpm.factory.mt.service.IMtFactoryDataService;
import com.logpm.factory.props.MtFactoryProperties;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
@ -29,6 +30,8 @@ public class BusinessDataClerkCheck2FactoryHandler {
@Autowired
private IMtFactoryDataService mtFactoryDataService;
@Autowired
private MtFactoryProperties mtFactoryProperties;
@RabbitHandler
public void sendOrderPackageScan(Map map, Message message, Channel channel) throws IOException, NoSuchAlgorithmException {
@ -38,7 +41,9 @@ public class BusinessDataClerkCheck2FactoryHandler {
MtReceiveDTO mtReceiveDTO = JSONObject.parseObject(json,MtReceiveDTO.class);
try {
mtFactoryDataService.sendReceiveInfoByNewSystem(mtReceiveDTO);
if(mtFactoryProperties.getSendEnable()){
mtFactoryDataService.sendReceiveInfoByNewSystem(mtReceiveDTO);
}
} catch (Exception e) {
log.error(">>>>>>", e);
}

3
blade-service/logpm-factory/src/main/java/com/logpm/factory/props/MtFactoryProperties.java

@ -19,5 +19,8 @@ public class MtFactoryProperties {
private String userpwd ;
/** 是否推送梦天 */
private Boolean sendEnable = true;
}

14
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/HwyOrderStatusHandler.java

@ -6,6 +6,7 @@ import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.factory.mt.service.IMtFactoryDataService;
import com.logpm.factory.oupai.service.IOuPaiFactoryService;
import com.logpm.factory.pan.service.IPanFactoryDataService;
import com.logpm.factory.props.MtFactoryProperties;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.feign.ITrunklineAdvanceClient;
import com.rabbitmq.client.Channel;
@ -37,6 +38,7 @@ import java.util.Objects;
public class HwyOrderStatusHandler {
private final IPanFactoryDataService panFactoryDataService;
private final MtFactoryProperties mtFactoryProperties;
private final IMtFactoryDataService mtFactoryDataService;
private final IOuPaiFactoryService ouPaiFactoryService;
private final ITrunklineAdvanceClient trunklineAdvanceClient;
@ -70,11 +72,13 @@ public class HwyOrderStatusHandler {
}
break;
case FactoryConstant.MENGT:
r = mtFactoryDataService.handleStatusData(orderStatusDTO);
if (r.getCode() == 400 || r.getCode() == 200) {
log.info("TAG {} ##################hwyOrderStatusHandler: 该条数据不用处理 orderNo={}", FactoryConstant.MENGT, orderSelfNum);
} else {
throw new CustomerException(r.getCode(), r.getMsg());
if(mtFactoryProperties.getSendEnable()){
r = mtFactoryDataService.handleStatusData(orderStatusDTO);
if (r.getCode() == 400 || r.getCode() == 200) {
log.info("TAG {} ##################hwyOrderStatusHandler: 该条数据不用处理 orderNo={}", FactoryConstant.MENGT, orderSelfNum);
} else {
throw new CustomerException(r.getCode(), r.getMsg());
}
}
break;
case FactoryConstant.OUPAI:

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/HwyUnloadCarComHandler.java

@ -14,6 +14,7 @@ import com.logpm.factory.mt.entity.MtPushData;
import com.logpm.factory.mt.service.IMtFactoryDataService;
import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
import com.logpm.factory.mt.service.IMtPushDataService;
import com.logpm.factory.props.MtFactoryProperties;
import com.logpm.factory.snm.vo.MTOrderPackageRelationVO;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.vo.NodePushMsg;
@ -61,6 +62,9 @@ public class HwyUnloadCarComHandler {
@Autowired
private IMtPushDataService mtPushDataService;
@Autowired
private MtFactoryProperties mtFactoryProperties;
@RabbitHandler
public void unloadCarComDataHandler(NodePushMsg nodePushMsg, Message message, Channel channel) {
@ -68,7 +72,9 @@ public class HwyUnloadCarComHandler {
BrandEnums brand = nodePushMsg.getBrand();
switch (brand) {
case MTMM:
pushMentTian(nodePushMsg);
if(mtFactoryProperties.getSendEnable()){
pushMentTian(nodePushMsg);
}
break;
}
}

21
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java

@ -7,13 +7,18 @@ import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.factory.mt.service.IMtFactoryDataService;
import com.logpm.factory.oupai.service.IOuPaiFactoryService;
import com.logpm.factory.pan.service.IPanFactoryDataService;
import com.logpm.factory.props.MtFactoryProperties;
import com.logpm.factory.zb.service.IZbFactoryDataService;
import com.logpm.oldproject.entity.AdvanceEntity;
import com.logpm.oldproject.feign.IAdvanceClient;
import com.logpm.oldproject.feign.ITrayClient;
import com.logpm.oldproject.feign.ITrayScanClient;
import com.logpm.oldproject.feign.ITrayScanDesClient;
import com.logpm.warehouse.feign.*;
import com.logpm.warehouse.feign.IWarehouseTaryAllocationClient;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
@ -50,6 +55,8 @@ public class OrderStatusHandler {
private IMtFactoryDataService mtFactoryDataService;
@Autowired
private IZbFactoryDataService zbFactoryDataService;
@Autowired
private MtFactoryProperties mtFactoryProperties;
@Autowired
private IOuPaiFactoryService ouPaiFactoryService;
@ -105,11 +112,13 @@ public class OrderStatusHandler {
}
break;
case FactoryConstant.MENGT:
r = mtFactoryDataService.handleStatusData(orderStatusDTO);
if (r.getCode() == 400 || r.getCode() == 200) {
log.info("TAG {} ##################orderStatusHandler: 该条数据不用处理 orderNo={}", FactoryConstant.MENGT, orderSelfNum);
} else {
throw new CustomerException(r.getCode(), r.getMsg());
if(mtFactoryProperties.getSendEnable()){
r = mtFactoryDataService.handleStatusData(orderStatusDTO);
if (r.getCode() == 400 || r.getCode() == 200) {
log.info("TAG {} ##################orderStatusHandler: 该条数据不用处理 orderNo={}", FactoryConstant.MENGT, orderSelfNum);
} else {
throw new CustomerException(r.getCode(), r.getMsg());
}
}
break;
case FactoryConstant.ZHIBANG:

Loading…
Cancel
Save