Browse Source

feat(all): 修改配送明细报表报错问题

dist.1.3.0
zhaoqiaobo 7 months ago
parent
commit
c3c7cd80bf
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java
  2. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java
  3. 120
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/CarStartReportListener.java
  4. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/LoadingReportListener.java
  5. 160
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/PlanReportListener.java
  6. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReservationPlanReportListener.java
  7. 121
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/SignforReportListener.java
  8. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/StockReportListener.java

2
blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java

@ -266,7 +266,7 @@ public abstract class FanoutConstants {
String EXCHANGE = "fanout.distribution.signfor2" + ModuleNameConstant.DEVAUTH;
interface QUEUE {
String REPORT = "fanout.distribution.DeliveryAndSignfor.report" + ModuleNameConstant.DEVAUTH;
}
}

4
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java

@ -363,7 +363,7 @@ public class QualityDeliverEntity extends TenantEntity {
* 发车时间
*/
@ApiModelProperty(value = "发车时间")
private String startCarTime;
private Date startCarTime;
/**
* 到达人
*/
@ -403,7 +403,7 @@ public class QualityDeliverEntity extends TenantEntity {
* 签收时间
*/
@ApiModelProperty(value = "签收时间")
private String signTime;
private Date signTime;
/**
* 签收状态 1.已签收 0 未签收 -1 已回库 -2 滞留
*/

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

@ -0,0 +1,120 @@
package com.logpm.distribution.receiver.report;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
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.enums.PackageTypeEnums;
import org.springblade.common.model.CarStartVO;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* 发车生成明细报表
*
* @author zhaoqiaobo
* @create 2024-03-18 0:02
*/
@Slf4j
@Component
@AllArgsConstructor
public class CarStartReportListener {
@Resource
private IQualityDeliverService qualityDeliverService;
@Resource
private IFactoryDataClient factoryDataClient;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.distribution.DeliveryAndCarStart.QUEUE.REPORT, durable = "true"),
exchange = @Exchange(name = FanoutConstants.distribution.DeliveryAndCarStart.EXCHANGE, type = ExchangeTypes.FANOUT)
))
@Transactional(rollbackFor = Exception.class)
public void buildReport(String msg) {
log.info("发车生成明细报表: {}", msg);
if (StrUtil.isEmpty(msg)) {
return;
}
NodeFanoutMsg bean = JSONUtil.toBean(msg, NodeFanoutMsg.class);
Object main = bean.getMain();
JSONObject entries = JSONUtil.parseObj(main);
CarStartVO vo = JSONUtil.toBean(entries, CarStartVO.class);
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
// if (BizOperationEnums.MODIFY.equals(bizOperation) || BizOperationEnums.DELETE.equals(bizOperation)) {
// // 根据预约单号查询出所有这个预约单下的数据 先置空
// LambdaUpdateWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaUpdate()
// .set(QualityDeliverEntity::getLoadUserName, null)
// .set(QualityDeliverEntity::getLoadTime, null)
// .set(QualityDeliverEntity::getLoadLicensePlate, null)
// .set(QualityDeliverEntity::getLoadNum, null)
// .ne(QualityDeliverEntity::getBizStatus, 110);
// qualityDeliverService.update(wrapper);
// }
List<PackageData> details = new ArrayList<>();
if (CollUtil.isNotEmpty(details)) {
for (PackageData detail : details) {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
.warehouseName(bean.getWarehouse())
.warehouseId(warehouseId)
.orderPackageCode(detail.getPackageCode())
.startCarUserName(bean.getOperator())
.startCarTime(bean.getOperatorTime())
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);
qualityDeliverEntity.setLoadNum(1);
sendReport(bizOperation, qualityDeliverEntity);
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setOrderCode(detail.getOrderCode());
qualityDeliverEntity.setCostCategory(detail.getProductName());
qualityDeliverEntity.setRevenueCategory(detail.getProductName());
qualityDeliverEntity.setConditions(2);
sendReport(bizOperation, qualityDeliverEntity);
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.INV)) {
qualityDeliverEntity.setIncomingBatch(detail.getPickupBatch());
qualityDeliverEntity.setMallName(detail.getMallName());
qualityDeliverEntity.setMaterielCode(detail.getMaterialCode());
qualityDeliverEntity.setMaterielName(detail.getMaterialName());
qualityDeliverEntity.setConditions(3);
sendReport(bizOperation, qualityDeliverEntity);
}
}
}
}
private void sendReport(BizOperationEnums bizOperation, QualityDeliverEntity qualityDeliverEntity) {
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
}
}
}

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

@ -57,12 +57,12 @@ public class LoadingReportListener {
return;
}
NodeFanoutMsg bean = JSONUtil.toBean(msg, NodeFanoutMsg.class);
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
List<PackageData> details = bean.getDetails();
Object main = bean.getMain();
JSONObject entries = JSONUtil.parseObj(main);
DistributionLoadVO vo = JSONUtil.toBean(entries, DistributionLoadVO.class);
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
List<PackageData> details = vo.getPackageDataList();
// if (BizOperationEnums.MODIFY.equals(bizOperation) || BizOperationEnums.DELETE.equals(bizOperation)) {
// // 根据预约单号查询出所有这个预约单下的数据 先置空
// LambdaUpdateWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaUpdate()

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

@ -22,6 +22,7 @@ import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.model.DistributionTaskVO;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springblade.common.model.ReservationVO;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
@ -60,86 +61,91 @@ public class PlanReportListener {
return;
}
NodeFanoutMsg bean = JSONUtil.toBean(msg, NodeFanoutMsg.class);
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
List<PackageData> details = bean.getDetails();
Object main = bean.getMain();
JSONObject entries = JSONUtil.parseObj(main);
DistributionTaskVO vo = JSONUtil.toBean(entries, DistributionTaskVO.class);
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)
.set(QualityDeliverEntity::getVehicleName, null)
.set(QualityDeliverEntity::getDriverName, null)
.set(QualityDeliverEntity::getDistributionCompany, null)
.set(QualityDeliverEntity::getDeliveryPlanTime, null)
.set(QualityDeliverEntity::getDeliveryCreateUserName, null)
.eq(QualityDeliverEntity::getPlanTrainNumber, vo.getTrainNumber())
.ne(QualityDeliverEntity::getBizStatus, 110);
qualityDeliverService.update(wrapper);
}
if (CollUtil.isNotEmpty(details)) {
for (PackageData detail : details) {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
.warehouseName(bean.getWarehouse())
.warehouseId(warehouseId)
.orderPackageCode(detail.getPackageCode())
.planTrainNumber(vo.getTrainNumber())
.deliveryTime(DateUtil.parseDate(vo.getTaskTime()))
.deliveryType(vo.getType())
.deliveryKind(vo.getKind())
.vehicleName(vo.getVehicleName())
.driverName(vo.getDriverName())
.distributionCompany(vo.getDistributionCompany())
.deliveryPlanTime(bean.getOperatorTime())
.deliveryCreateUserName(bean.getOperator())
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);
qualityDeliverEntity.setPlanNum(1);
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
}
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setOrderCode(detail.getOrderCode());
qualityDeliverEntity.setCostCategory(detail.getProductName());
qualityDeliverEntity.setRevenueCategory(detail.getProductName());
qualityDeliverEntity.setConditions(2);
qualityDeliverEntity.setPlanNum(detail.getNumber());
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
}
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.INV)) {
qualityDeliverEntity.setIncomingBatch(detail.getPickupBatch());
qualityDeliverEntity.setMallName(detail.getMallName());
qualityDeliverEntity.setMaterielCode(detail.getMaterialCode());
qualityDeliverEntity.setMaterielName(detail.getMaterialName());
qualityDeliverEntity.setConditions(3);
qualityDeliverEntity.setPlanNum(detail.getNumber());
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
List<ReservationVO> reservationVOList = vo.getReservationVOList();
if (CollUtil.isNotEmpty(reservationVOList)) {
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)
.set(QualityDeliverEntity::getVehicleName, null)
.set(QualityDeliverEntity::getDriverName, null)
.set(QualityDeliverEntity::getDistributionCompany, null)
.set(QualityDeliverEntity::getDeliveryPlanTime, null)
.set(QualityDeliverEntity::getDeliveryCreateUserName, null)
.eq(QualityDeliverEntity::getPlanTrainNumber, vo.getTrainNumber())
.ne(QualityDeliverEntity::getBizStatus, 110);
qualityDeliverService.update(wrapper);
}
if (CollUtil.isNotEmpty(details)) {
for (PackageData detail : details) {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
.warehouseName(bean.getWarehouse())
.warehouseId(warehouseId)
.orderPackageCode(detail.getPackageCode())
.planTrainNumber(vo.getTrainNumber())
.deliveryTime(DateUtil.parseDate(vo.getTaskTime()))
.deliveryType(vo.getType())
.deliveryKind(vo.getKind())
.vehicleName(vo.getVehicleName())
.driverName(vo.getDriverName())
.distributionCompany(vo.getDistributionCompany())
.deliveryPlanTime(bean.getOperatorTime())
.deliveryCreateUserName(bean.getOperator())
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);
qualityDeliverEntity.setPlanNum(1);
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
}
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setOrderCode(detail.getOrderCode());
qualityDeliverEntity.setCostCategory(detail.getProductName());
qualityDeliverEntity.setRevenueCategory(detail.getProductName());
qualityDeliverEntity.setConditions(2);
qualityDeliverEntity.setPlanNum(detail.getNumber());
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
}
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.INV)) {
qualityDeliverEntity.setIncomingBatch(detail.getPickupBatch());
qualityDeliverEntity.setMallName(detail.getMallName());
qualityDeliverEntity.setMaterielCode(detail.getMaterialCode());
qualityDeliverEntity.setMaterielName(detail.getMaterialName());
qualityDeliverEntity.setConditions(3);
qualityDeliverEntity.setPlanNum(detail.getNumber());
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
}
}
}
}
}

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

@ -60,12 +60,12 @@ public class ReservationPlanReportListener {
return;
}
NodeFanoutMsg bean = JSONUtil.toBean(msg, NodeFanoutMsg.class);
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
List<PackageData> details = bean.getDetails();
Object main = bean.getMain();
JSONObject entries = JSONUtil.parseObj(main);
ReservationVO vo = JSONUtil.toBean(entries, ReservationVO.class);
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
List<PackageData> details = vo.getPackageDataList();
if (BizOperationEnums.MODIFY.equals(bizOperation) || BizOperationEnums.DELETE.equals(bizOperation)) {
// 根据预约单号查询出所有这个预约单下的数据 先置空
LambdaUpdateWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaUpdate()

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

@ -0,0 +1,121 @@
package com.logpm.distribution.receiver.report;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
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.enums.PackageTypeEnums;
import org.springblade.common.model.DistributionSignforVO;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springblade.common.model.ReservationVO;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* 签收扫描生成明细报表
*
* @author zhaoqiaobo
* @create 2024-03-18 0:02
*/
@Slf4j
@Component
@AllArgsConstructor
public class SignforReportListener {
@Resource
private IQualityDeliverService qualityDeliverService;
@Resource
private IFactoryDataClient factoryDataClient;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.distribution.DeliveryAndSignfor.QUEUE.REPORT, durable = "true"),
exchange = @Exchange(name = FanoutConstants.distribution.DeliveryAndSignfor.EXCHANGE, type = ExchangeTypes.FANOUT)
))
@Transactional(rollbackFor = Exception.class)
public void buildReport(String msg) {
log.info("签收扫描生成明细报表: {}", msg);
if (StrUtil.isEmpty(msg)) {
return;
}
NodeFanoutMsg bean = JSONUtil.toBean(msg, NodeFanoutMsg.class);
Object main = bean.getMain();
JSONObject entries = JSONUtil.parseObj(main);
DistributionSignforVO vo = JSONUtil.toBean(entries, DistributionSignforVO.class);
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
List<PackageData> details = vo.getPackageDataList();
// if (BizOperationEnums.MODIFY.equals(bizOperation) || BizOperationEnums.DELETE.equals(bizOperation)) {
// // 根据预约单号查询出所有这个预约单下的数据 先置空
// LambdaUpdateWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaUpdate()
// .set(QualityDeliverEntity::getLoadUserName, null)
// .set(QualityDeliverEntity::getLoadTime, null)
// .set(QualityDeliverEntity::getLoadLicensePlate, null)
// .set(QualityDeliverEntity::getLoadNum, null)
// .ne(QualityDeliverEntity::getBizStatus, 110);
// qualityDeliverService.update(wrapper);
// }
if (CollUtil.isNotEmpty(details)) {
for (PackageData detail : details) {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
.warehouseName(bean.getWarehouse())
.warehouseId(warehouseId)
.orderPackageCode(detail.getPackageCode())
.signUserName(bean.getOperator())
.signTime(bean.getOperatorTime())
.signCarNumber(vo.getVehicleName())
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);
qualityDeliverEntity.setLoadNum(1);
sendReport(bizOperation, qualityDeliverEntity);
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setOrderCode(detail.getOrderCode());
qualityDeliverEntity.setCostCategory(detail.getProductName());
qualityDeliverEntity.setRevenueCategory(detail.getProductName());
qualityDeliverEntity.setConditions(2);
sendReport(bizOperation, qualityDeliverEntity);
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.INV)) {
qualityDeliverEntity.setIncomingBatch(detail.getPickupBatch());
qualityDeliverEntity.setMallName(detail.getMallName());
qualityDeliverEntity.setMaterielCode(detail.getMaterialCode());
qualityDeliverEntity.setMaterielName(detail.getMaterialName());
qualityDeliverEntity.setConditions(3);
sendReport(bizOperation, qualityDeliverEntity);
}
}
}
}
private void sendReport(BizOperationEnums bizOperation, QualityDeliverEntity qualityDeliverEntity) {
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
}
}
}

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

@ -59,12 +59,12 @@ public class StockReportListener {
return;
}
NodeFanoutMsg bean = JSONUtil.toBean(msg, NodeFanoutMsg.class);
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
List<PackageData> details = bean.getDetails();
Object main = bean.getMain();
JSONObject entries = JSONUtil.parseObj(main);
StockUpVO vo = JSONUtil.toBean(entries, StockUpVO.class);
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
List<PackageData> details = vo.getReservationVO().getPackageDataList();
if (BizOperationEnums.MODIFY.equals(bizOperation) || BizOperationEnums.DELETE.equals(bizOperation)) {
// 根据预约单号查询出所有这个预约单下的数据 先置空
LambdaUpdateWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaUpdate()

Loading…
Cancel
Save