Browse Source

feat(all): 增加配送发送广播通知消息开关

1 增加配置文件控制配送节点广播消息
visual
zhaoqiaobo 6 months ago
parent
commit
9489e4c5e8
  1. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/pros/DistributionProperties.java
  2. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/BillReViewReportListener.java
  3. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/BillSignforReportListener.java
  4. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/CarStartReportListener.java
  5. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ConsigneeArriveReportListener.java
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/LoadingReportListener.java
  7. 27
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/PlanReportListener.java
  8. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java
  9. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReViewReportListener.java
  10. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReservationPlanReportListener.java
  11. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReturnWarehouseReportListener.java
  12. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/SignforReportListener.java
  13. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/StockReportListener.java
  14. 76
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java
  15. 3
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/pros/DistributionProperties.java

@ -18,6 +18,10 @@ public class DistributionProperties {
*/
private String name;
/**
* 配送作业节点是否发送广播通知
*/
private Boolean sendFanoutMsg = false;
}

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/BillReViewReportListener.java

@ -71,6 +71,7 @@ public class BillReViewReportListener {
.orderPackageCode(detail.getPackageCode())
.reviewUserName(bean.getOperator())
.reviewTime(bean.getOperatorTime())
.bizCode(detail.getPickupBatch())
.bizStatus(100)
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/BillSignforReportListener.java

@ -72,6 +72,7 @@ public class BillSignforReportListener {
.signUserName(bean.getOperator())
.signTime(bean.getOperatorTime())
.signReservationCode(vo.getPickupBatch())
.bizCode(vo.getPickupBatch())
.bizStatus(90)
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/CarStartReportListener.java

@ -5,15 +5,12 @@ import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.dto.ReportQualityDeliverDTO;
import com.logpm.distribution.entity.QualityDeliverEntity;
import com.logpm.distribution.service.IQualityDeliverService;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.vo.SendMsg;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.report.ReportConstants;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.model.CarStartVO;
import org.springblade.common.model.NodeFanoutMsg;
@ -63,6 +60,7 @@ public class CarStartReportListener {
.set(QualityDeliverEntity::getStartCarUserName, null)
.set(QualityDeliverEntity::getStartCarTime, null)
.eq(QualityDeliverEntity::getLoadTrainNumber, vo.getTrainNumber())
.eq(QualityDeliverEntity::getLoadLicensePlate, vo.getVehicleName())
.ne(QualityDeliverEntity::getBizStatus, 110);
qualityDeliverService.update(wrapper);
}
@ -71,6 +69,7 @@ public class CarStartReportListener {
.set(QualityDeliverEntity::getStartCarUserName, vo.getDriverName())
.set(QualityDeliverEntity::getStartCarTime, bean.getOperatorTime())
.eq(QualityDeliverEntity::getLoadTrainNumber, vo.getTrainNumber())
.eq(QualityDeliverEntity::getLoadLicensePlate, vo.getVehicleName())
.ne(QualityDeliverEntity::getBizStatus, 110);
qualityDeliverService.update(wrapper);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ConsigneeArriveReportListener.java

@ -5,15 +5,12 @@ import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.dto.ReportQualityDeliverDTO;
import com.logpm.distribution.entity.QualityDeliverEntity;
import com.logpm.distribution.service.IQualityDeliverService;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.vo.SendMsg;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.report.ReportConstants;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.model.ConsigneeArriveVO;
import org.springblade.common.model.NodeFanoutMsg;
@ -85,6 +82,7 @@ public class ConsigneeArriveReportListener {
.set(QualityDeliverEntity::getArriveAddress, vo.getAddress())
.set(QualityDeliverEntity::getArrivePositioning, vo.getPositioning())
.eq(QualityDeliverEntity::getLoadTrainNumber, vo.getTrainNumber())
.eq(QualityDeliverEntity::getLoadLicensePlate, vo.getVehicleName())
.eq(QualityDeliverEntity::getBizCode, vo.getReservationCode())
.ne(QualityDeliverEntity::getBizStatus, 110);
qualityDeliverService.update(wrapper);

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/LoadingReportListener.java

@ -74,6 +74,7 @@ public class LoadingReportListener {
.loadTrainNumber(vo.getTrainNumber())
.loadTime(bean.getOperatorTime())
.loadLicensePlate(vo.getVehicleName())
.bizCode(vo.getReservationCode())
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);
@ -81,7 +82,6 @@ public class LoadingReportListener {
sendReport(bizOperation, qualityDeliverEntity);
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setOrderCode(detail.getOrderCode());
qualityDeliverEntity.setBizCode(vo.getReservationCode());
qualityDeliverEntity.setCategory(detail.getProductName());
qualityDeliverEntity.setConditions(2);
sendReport(bizOperation, qualityDeliverEntity);

27
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/PlanReportListener.java

@ -33,7 +33,9 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -73,18 +75,15 @@ public class PlanReportListener {
List<PlanDriverbindCarVO> planDriverbindCars = vo.getPlanDriverbindCars();
String vehicleName = "";
String driverName = "";
if(CollUtil.isNotEmpty(planDriverbindCars)){
if (CollUtil.isNotEmpty(planDriverbindCars)) {
// 用逗号拼接 车辆和司机
vehicleName = planDriverbindCars.stream().map(PlanDriverbindCarVO::getCarPlate).collect(Collectors.joining(","));
driverName = planDriverbindCars.stream().map(PlanDriverbindCarVO::getDriverName).collect(Collectors.joining(","));
}
Map<String, QualityDeliverEntity> invMap = new HashMap<>();
for (ReservationVO reservationVO : reservationVOList) {
List<PackageData> details = reservationVO.getPackageDataList();
if (BizOperationEnums.MODIFY.equals(bizOperation) || BizOperationEnums.DELETE.equals(bizOperation)) {
// 根据预约单号查询出所有这个预约单下的数据 先置空
LambdaUpdateWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaUpdate()
.set(QualityDeliverEntity::getPlanTrainNumber, null)
.set(QualityDeliverEntity::getDeliveryTime, null)
.set(QualityDeliverEntity::getDeliveryType, null)
.set(QualityDeliverEntity::getDeliveryKind, null)
@ -94,10 +93,14 @@ public class PlanReportListener {
.set(QualityDeliverEntity::getDeliveryPlanTime, null)
.set(QualityDeliverEntity::getDeliveryCreateUserName, null)
.eq(QualityDeliverEntity::getPlanTrainNumber, vo.getTrainNumber())
.eq(QualityDeliverEntity::getBizCode, reservationVO.getReservationCode())
.ne(QualityDeliverEntity::getBizStatus, 110);
if (BizOperationEnums.DELETE.equals(bizOperation)) {
wrapper.set(QualityDeliverEntity::getPlanTrainNumber, null);
}
qualityDeliverService.update(wrapper);
}
for (ReservationVO reservationVO : reservationVOList) {
List<PackageData> details = reservationVO.getPackageDataList();
if (CollUtil.isNotEmpty(details)) {
for (PackageData detail : details) {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
@ -113,6 +116,7 @@ public class PlanReportListener {
.distributionCompany(vo.getDistributionCompany())
.deliveryPlanTime(bean.getOperatorTime())
.deliveryCreateUserName(bean.getOperator())
.bizCode(reservationVO.getReservationCode())
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);
@ -141,7 +145,7 @@ public class PlanReportListener {
.build());
}
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.INV)) {
invMap.put(detail.getMallName()+detail.getMaterialCode(), qualityDeliverEntity);
invMap.put(detail.getMallName() + detail.getMaterialCode(), qualityDeliverEntity);
qualityDeliverEntity.setBizCode(reservationVO.getReservationCode());
qualityDeliverEntity.setIncomingBatch(detail.getPickupBatch());
qualityDeliverEntity.setMallName(detail.getMallName());
@ -150,7 +154,7 @@ public class PlanReportListener {
qualityDeliverEntity.setConditions(3);
qualityDeliverEntity.setPlanNum(1);
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
invMap.put(detail.getMallName()+detail.getMaterialCode(), qualityDeliverEntity);
invMap.put(detail.getMallName() + detail.getMaterialCode(), qualityDeliverEntity);
}
}
}
@ -160,9 +164,10 @@ public class PlanReportListener {
for (Map.Entry<String, QualityDeliverEntity> entry : invMap.entrySet()) {
QualityDeliverEntity qualityDeliverEntity = entry.getValue();
qualityDeliverService.update(qualityDeliverEntity, Wrappers.<QualityDeliverEntity>lambdaUpdate()
.eq(QualityDeliverEntity::getPlanReservationCode,qualityDeliverEntity.getPlanReservationCode())
.eq(QualityDeliverEntity::getMallName,qualityDeliverEntity.getMallName())
.eq(QualityDeliverEntity::getMaterielCode,qualityDeliverEntity.getMaterielCode())
.eq(QualityDeliverEntity::getPlanTrainNumber, qualityDeliverEntity.getPlanTrainNumber())
.eq(QualityDeliverEntity::getMallName, qualityDeliverEntity.getMallName())
.eq(QualityDeliverEntity::getMaterielCode, qualityDeliverEntity.getMaterielCode())
.eq(QualityDeliverEntity::getConditions, 3)
.lt(QualityDeliverEntity::getBizStatus, 110)
);
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java

@ -178,11 +178,11 @@ public class QualityDeliverListener {
wrapper.eq(QualityDeliverEntity::getMaterielName, qualityDeliverEntity.getMaterielName());
}
}
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getBizCode())) {
// 有预约单号时加上预约单号过滤:存在同一个库存品在多个预约单中,只根据库存品本身的信息无法查询出对应的数据的情况。
wrapper.eq(QualityDeliverEntity::getBizCode, qualityDeliverEntity.getBizCode());
}
}
return wrapper;
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReViewReportListener.java

@ -71,6 +71,7 @@ public class ReViewReportListener {
.orderPackageCode(detail.getPackageCode())
.reviewUserName(bean.getOperator())
.reviewTime(bean.getOperatorTime())
.bizCode(vo.getReservationCode())
.bizStatus(100)
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
@ -78,7 +79,6 @@ public class ReViewReportListener {
qualityDeliverEntity.setLoadNum(1);
sendReport(bizOperation, qualityDeliverEntity);
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setBizCode(vo.getReservationCode());
qualityDeliverEntity.setOrderCode(detail.getOrderCode());
qualityDeliverEntity.setCategory(detail.getProductName());
qualityDeliverEntity.setConditions(2);

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReservationPlanReportListener.java

@ -77,7 +77,6 @@ public class ReservationPlanReportListener {
.set(QualityDeliverEntity::getPlanReservationTime, null)
.set(QualityDeliverEntity::getPlanReservationUser, null)
.set(QualityDeliverEntity::getPlanNum, null)
// .set(QualityDeliverEntity::getServiceType, null)
.set(QualityDeliverEntity::getReservationConsignee, null)
.set(QualityDeliverEntity::getReservationConsigneePhone, null)
.set(QualityDeliverEntity::getReservationConsigneeAddr, null)

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReturnWarehouseReportListener.java

@ -71,13 +71,13 @@ public class ReturnWarehouseReportListener {
.orderPackageCode(detail.getPackageCode())
.reviewUserName(bean.getOperator())
.reviewTime(bean.getOperatorTime())
.bizCode(vo.getReservationCode())
.bizStatus(100)
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);
sendReport(bizOperation, qualityDeliverEntity);
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setBizCode(vo.getReservationCode());
qualityDeliverEntity.setOrderCode(detail.getOrderCode());
qualityDeliverEntity.setCategory(detail.getProductName());
qualityDeliverEntity.setConditions(2);

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/SignforReportListener.java

@ -78,6 +78,7 @@ public class SignforReportListener {
.signTrainNumber(vo.getTrainNumber())
.signReservationCode(vo.getReservationCode())
.signType(vo.getOperatMode())
.bizCode(vo.getReservationCode())
.bizStatus(90)
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
@ -85,7 +86,6 @@ public class SignforReportListener {
qualityDeliverEntity.setSignNum(1);
sendReport(bizOperation, qualityDeliverEntity);
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setBizCode(vo.getReservationCode());
qualityDeliverEntity.setOrderCode(detail.getOrderCode());
qualityDeliverEntity.setCategory(detail.getProductName());
qualityDeliverEntity.setSignNum(detail.getNumber());

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/StockReportListener.java

@ -75,6 +75,7 @@ public class StockReportListener {
.stockupFinishTime(vo.getStockupDate())
.stockupCreateTime(bean.getOperatorTime())
.stockAllocation(vo.getStockupArea())
.bizCode(vo.getReferenceCode())
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);

76
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java

@ -3,6 +3,7 @@ package com.logpm.distribution.service.impl;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.pros.DistributionProperties;
import com.logpm.distribution.service.IDistributionNodeWorkService;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
@ -11,7 +12,16 @@ import com.logpm.factorydata.vo.PushData;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.model.*;
import org.springblade.common.model.CarStartVO;
import org.springblade.common.model.ConsigneeArriveVO;
import org.springblade.common.model.DistributionLoadVO;
import org.springblade.common.model.DistributionReCheckSignVO;
import org.springblade.common.model.DistributionSignforVO;
import org.springblade.common.model.DistributionTaskVO;
import org.springblade.common.model.FanoutMsg;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.ReservationVO;
import org.springblade.common.model.StockUpVO;
import org.springblade.common.model.workNode.DeliveryOfPickupPlanVO;
import org.springblade.common.model.workNode.FinishDistributionTrainVO;
import org.springblade.common.model.workNode.PickUpByReCheckVO;
@ -36,14 +46,17 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
private RabbitTemplate rabbitTemplate;
@Autowired
private FactoryDataMessageSender factoryDataMessageSender;
@Autowired
private DistributionProperties distributionProperties;
@Override
public void planReservation(NodeFanoutMsg<ReservationVO> nodeFanoutMsg, BladeUser user) {
try {
// rabbitTemplate.convertAndSend(FanoutConstants.reservation.OwnReservation.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.reservation.OwnReservation.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", e);
}
@ -53,18 +66,21 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
@Override
public void planDelivery(NodeFanoutMsg<DistributionTaskVO> nodeFanoutMsg, BladeUser user) {
try {
// rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndPlan.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndPlan.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", e);
}
}
@Override
public void cancelReservation(NodeFanoutMsg<ReservationVO> nodeFanoutMsg, BladeUser user) {
try {
// rabbitTemplate.convertAndSend(FanoutConstants.reservation.OwnReservation.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.reservation.OwnReservation.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", e);
}
@ -74,7 +90,9 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
public void planStock(NodeFanoutMsg<StockUpVO> nodeFanoutMsg, BladeUser user) {
// 备货信息主表
try {
// rabbitTemplate.convertAndSend(FanoutConstants.distribution.stock.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.distribution.stock.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", e);
}
@ -84,7 +102,9 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
@Override
public void nodeLoading(NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg, BladeUser user) {
try {
// rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndLoading.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndLoading.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", e);
}
@ -93,7 +113,9 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
@Override
public void abnormalLoading(NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg, BladeUser user) {
try {
// rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndLoading.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndLoading.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", e);
}
@ -107,7 +129,9 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
@Override
public void carStart(NodeFanoutMsg<CarStartVO> nodeFanoutMsg, BladeUser user) {
try {
// rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndCarStart.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndCarStart.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", e);
}
@ -116,7 +140,9 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
@Override
public void carArrived(NodeFanoutMsg<ConsigneeArriveVO> nodeFanoutMsg, BladeUser user) {
try {
// rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndConsigneeArrive.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndConsigneeArrive.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", e);
}
@ -125,11 +151,13 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
@Override
public void signFor(NodeFanoutMsg<DistributionSignforVO> nodeFanoutMsg, BladeUser user) {
try {
if(nodeFanoutMsg==null){
if (nodeFanoutMsg == null) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> nodeFanoutMsg is null! ");
return;
}
// rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndSignfor.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndSignfor.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 签收节点消息推送失败~ 请联系管理员! ", e);
}
@ -168,19 +196,21 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
@Override
public void signForCheck(NodeFanoutMsg<DistributionReCheckSignVO> nodeFanoutMsg, BladeUser user) {
try {
// rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndrecheck.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndrecheck.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 签收复核消息推送失败~ 请联系管理员! ", e);
}
}
@Override
public void planOfBill(NodeFanoutMsg<DeliveryOfPickupPlanVO> nodeFanoutMsg, BladeUser user) {
try {
// rabbitTemplate.convertAndSend(FanoutConstants.DeliveryOfPickup.BillPlan.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.DeliveryOfPickup.BillPlan.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 自提计划消息推送失败~ 请联系管理员! ", e);
}
@ -189,7 +219,9 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
@Override
public void signByBill(NodeFanoutMsg<PickUpByScanVO> nodeFanoutMsg, BladeUser user) {
try {
// rabbitTemplate.convertAndSend(FanoutConstants.DeliveryOfPickup.BillSign.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.DeliveryOfPickup.BillSign.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 自提签收消息推送失败~ 请联系管理员! ", e);
}
@ -198,7 +230,9 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
@Override
public void billofladingSignforCheck(NodeFanoutMsg<PickUpByReCheckVO> nodeFanoutMsg, BladeUser user) {
try {
// rabbitTemplate.convertAndSend(FanoutConstants.DeliveryOfPickup.BillSignReview.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.DeliveryOfPickup.BillSignReview.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 自提复核消息推送失败~ 请联系管理员! ", e);
}
@ -207,7 +241,9 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
@Override
public void finishDistributionTrain(NodeFanoutMsg<FinishDistributionTrainVO> nodeFanoutMsg, BladeUser user) {
try {
// rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndFinish.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAndFinish.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 车次完成消息推送失败~ 请联系管理员! ", e);
}

3
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

@ -987,11 +987,12 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
opPackagePushLogEntity.setRefId(refId);
opPackagePushLogEntity.setPushOupaiNode(data.getString("Operate"));
if(ouPaiProperties.getSendFactory()){
String token = buildToken();
HttpResponse httpResponse = HttpRequest.post(url).header("Authorization", token).body(data.toJSONString()).execute();
String result = httpResponse.body();
opPackagePushLogEntity.setResp(result);
}
opPackagePushLogService.save(opPackagePushLogEntity);
return opPackagePushLogEntity;
} else {

Loading…
Cancel
Save