Browse Source

Merge remote-tracking branch 'origin/dev' into pre-production

pre-production
zhenghaoyu 2 months ago
parent
commit
33cd41e261
  1. 7
      blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java
  2. 19
      blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java
  3. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/OrderInfoUpdateHandler.java
  4. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/BillPlanReportListener.java
  5. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/LoadingReportListener.java
  6. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/PlanReportListener.java
  7. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReportListener.java
  8. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReservationPlanReportListener.java
  9. 92
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReturnWarehouseReportListener.java
  10. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  11. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  12. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml

7
blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java

@ -241,7 +241,12 @@ public interface RabbitConstant {
String AFTERSALES_OVER_TIME_ROUTING = "aftersales_over_time_routing" + ModuleNameConstant.DEVAUTH;
/**
* 更新订单信息
*/
String ORDER_INFO_UPDATE_QUEUE = "order_info_update_queue" + ModuleNameConstant.DEVAUTH;
String ORDER_INFO_UPDATE_EXCHANGE = "order_info_update_exchange" + ModuleNameConstant.DEVAUTH;
String ORDER_INFO_UPDATE_ROUTING = "order_info_update_routing" + ModuleNameConstant.DEVAUTH;
}

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

@ -286,6 +286,11 @@ public abstract class FanoutConstants {
}
}
/**
* 配送回库
*
* @see org.springblade.common.model.ReservationVO
**/
interface DeliveryRetention {
String EXCHANGE = "fanout.distribution.retention" + ModuleNameConstant.DEVAUTH;
@ -388,20 +393,6 @@ public abstract class FanoutConstants {
}
}
/**
* 配送回库
*
* @see org.springblade.common.model.workNode.RetentionDataByScanVO
*/
interface DeliveryAndReturnWarehouse {
String EXCHANGE = "fanout.distribution.ReturnWarehouse" + ModuleNameConstant.DEVAUTH;
interface QUEUE {
String REPORT = "fanout.distribution.DeliveryAndReturnWarehouse.report" + ModuleNameConstant.DEVAUTH;
}
}
/**
* 车次完成
* @see org.springblade.common.model.workNode.FinishDistributionTrainVO

41
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/OrderInfoUpdateHandler.java

@ -0,0 +1,41 @@
package com.logpm.distribution.receiver;
import cn.hutool.json.JSONUtil;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.factorydata.FactoryDataConstants;
import org.springblade.core.tool.utils.StringUtil;
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;
@Slf4j
@Component
@AllArgsConstructor
public class OrderInfoUpdateHandler {
private final IDistributionStockArticleService distributionStockArticleService;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = RabbitConstant.ORDER_INFO_UPDATE_QUEUE, durable = "true"),
exchange = @Exchange(name = RabbitConstant.ORDER_INFO_UPDATE_EXCHANGE,
type = ExchangeTypes.DIRECT,
delayed = FactoryDataConstants.Mq.DELAYED)
))
public void updateOrderInfo(String msg, Channel channel) {
if(StringUtil.isNotBlank(msg)){
DistributionStockArticleEntity bean = JSONUtil.toBean(msg, DistributionStockArticleEntity.class);
distributionStockArticleService.updateOrderInfoByDistributionStockArticleEntity(bean);
}
}
}

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

@ -106,6 +106,7 @@ public class BillPlanReportListener implements ReportService {
.bizCode(vo.getPickupBatch())
.deliveryPlanTime(bean.getOperatorTime())
.deliveryCreateUserName(bean.getOperator())
.bizStatus(70)
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);

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

@ -93,6 +93,7 @@ public class LoadingReportListener implements ReportService {
.loadTime(bean.getOperatorTime())
.loadLicensePlate(vo.getVehicleName())
.bizCode(vo.getReservationCode())
.bizStatus(80)
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
// qualityDeliverEntity.setConditions(1);

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

@ -172,6 +172,7 @@ public class PlanReportListener implements ReportService {
if(BizOperationEnums.ADD.equals(bizOperation)){
qualityDeliverEntity.setDeliveryPlanTime(bean.getOperatorTime());
qualityDeliverEntity.setDeliveryCreateUserName(bean.getOperator());
qualityDeliverEntity.setBizStatus(70);
}
sendReport(qualityDeliverEntity, BizOperationEnums.MODIFY);
}
@ -191,6 +192,7 @@ public class PlanReportListener implements ReportService {
if(BizOperationEnums.ADD.equals(bizOperation)){
qualityDeliverEntity.setDeliveryPlanTime(bean.getOperatorTime());
qualityDeliverEntity.setDeliveryCreateUserName(bean.getOperator());
qualityDeliverEntity.setBizStatus(70);
}
sendReport(qualityDeliverEntity, BizOperationEnums.MODIFY);
}
@ -223,6 +225,7 @@ public class PlanReportListener implements ReportService {
if(BizOperationEnums.ADD.equals(bizOperation)){
qualityDeliverEntity.setDeliveryPlanTime(bean.getOperatorTime());
qualityDeliverEntity.setDeliveryCreateUserName(bean.getOperator());
qualityDeliverEntity.setBizStatus(70);
}
sendReport(qualityDeliverEntity, BizOperationEnums.MODIFY);
}

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

@ -334,8 +334,8 @@ public class ReportListener {
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.distribution.DeliveryAndReturnWarehouse.QUEUE.REPORT, durable = "true"),
exchange = @Exchange(name = FanoutConstants.distribution.DeliveryAndReturnWarehouse.EXCHANGE, type = ExchangeTypes.FANOUT)
value = @Queue(name = FanoutConstants.distribution.DeliveryRetention.QUEUE.REPORT, durable = "true"),
exchange = @Exchange(name = FanoutConstants.distribution.DeliveryRetention.EXCHANGE, type = ExchangeTypes.FANOUT)
), ackMode = "MANUAL")
public void returnWarehouseReportListener(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
Boolean flag = Boolean.TRUE;

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

@ -125,6 +125,7 @@ public class ReservationPlanReportListener implements ReportService {
.reservationConsignee(vo.getConsignee())
.reservationConsigneePhone(vo.getDeliveryPhone())
.reservationConsigneeAddr(vo.getDeliveryAddress())
.bizStatus(60)
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);

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

@ -1,9 +1,13 @@
package com.logpm.distribution.receiver.report;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.dto.ReportQualityDeliverDTO;
import com.logpm.distribution.entity.QualityDeliverEntity;
import com.logpm.distribution.pros.DistributionProperties;
@ -12,17 +16,21 @@ 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.WorkNodeEnums;
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.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 回库生成明细报表
@ -47,51 +55,77 @@ public class ReturnWarehouseReportListener implements ReportService {
NodeFanoutMsg bean = JSONUtil.toBean(msg, NodeFanoutMsg.class);
Object main = bean.getMain();
JSONObject entries = JSONUtil.parseObj(main);
DistributionSignforVO vo = JSONUtil.toBean(entries, DistributionSignforVO.class);
ReservationVO vo = JSONUtil.toBean(entries, ReservationVO.class);
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
List<PackageData> details = vo.getPackageDataList();
String referenceCode = vo.getReservationCode();
Map<String, List<QualityDeliverEntity>> cmpMap = new HashMap<>();
Map<String, List<QualityDeliverEntity>> ltlMap = new HashMap<>();
Map<String, List<QualityDeliverEntity>> invMap = new HashMap<>();
if (StrUtil.isNotEmpty(referenceCode)) {
List<QualityDeliverEntity> qualityDeliverEntities = qualityDeliverService.list(Wrappers.<QualityDeliverEntity>lambdaQuery()
.eq(QualityDeliverEntity::getPlanReservationCode, referenceCode));
if (CollUtil.isNotEmpty(qualityDeliverEntities)) {
cmpMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.CMP.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
ltlMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.LTL.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getCategory()) && StrUtil.isNotEmpty(item.getOrderCode()))
.collect(Collectors.groupingBy(item -> item.getCategory() + item.getOrderCode()));
invMap = qualityDeliverEntities.stream()
.filter(item -> NumberUtil.equals(item.getConditions(), PackageTypeEnums.INV.getCode()))
.filter(item -> StrUtil.isNotEmpty(item.getOrderPackageCode()))
.collect(Collectors.groupingBy(item -> item.getOrderPackageCode()));
}
}
if (CollUtil.isNotEmpty(details)) {
for (PackageData detail : details) {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
.warehouseName(bean.getWarehouse())
.warehouseId(warehouseId)
.orderPackageCode(detail.getPackageCode())
.reviewUserName(bean.getOperator())
.reviewTime(bean.getOperatorTime())
.retentionUserName(bean.getOperator())
.retentionTime(DateUtil.formatDateTime(bean.getOperatorTime()))
.retentionNum(detail.getNumber())
.bizCode(vo.getReservationCode())
.bizStatus(-1)
.bizStatus(110)
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);
sendReport(bizOperation, qualityDeliverEntity);
qualityDeliverEntity.setRetentionNum(1);
// 装车包件是计划内的 更新
if (cmpMap.containsKey(detail.getPackageCode())) {
qualityDeliverEntity.setId(cmpMap.get(detail.getPackageCode()).get(0).getId());
sendReport(qualityDeliverEntity, BizOperationEnums.MODIFY);
}
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setOrderCode(detail.getOrderCode());
qualityDeliverEntity.setCategory(detail.getProductName());
qualityDeliverEntity.setConditions(2);
sendReport(bizOperation, qualityDeliverEntity);
if (ltlMap.containsKey(detail.getProductName() + detail.getOrderCode())) {
qualityDeliverEntity.setId(ltlMap.get(detail.getProductName() + detail.getOrderCode()).get(0).getId());
sendReport(qualityDeliverEntity, BizOperationEnums.MODIFY);
}
} 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);
qualityDeliverEntity.setRetentionNum(1);
if (invMap.containsKey(detail.getPackageCode())) {
qualityDeliverEntity.setId(invMap.get(detail.getPackageCode()).get(0).getId());
sendReport(qualityDeliverEntity, BizOperationEnums.MODIFY);
}
}
}
}
}
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());
}
private void sendReport(QualityDeliverEntity qualityDeliverEntity, BizOperationEnums operationEnums) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder()
.data(JSONUtil.toJsonStr(qualityDeliverEntity))
.operation(operationEnums)
.node(WorkNodeEnums.DISTRIBUTION_RETENTION.getValue())
.build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
}
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java

@ -332,4 +332,6 @@ public interface IDistributionStockArticleService extends BaseService<Distributi
R getOrderWarehouseDetail(String orderCode);
IPage<DistributionStockArticleVO> pageListOweNew(IPage<Object> page, Map<String, Object> distributionStockArticle);
void updateOrderInfoByDistributionStockArticleEntity(DistributionStockArticleEntity bean);
}

26
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -51,6 +51,8 @@ import com.logpm.distribution.vo.app.queryOrderVO;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleNewWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.vo.SendMsg;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
@ -60,6 +62,7 @@ import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.loading.LoadingStatusConstant;
import org.springblade.common.constant.order.OrderReservationStatusConstant;
@ -140,6 +143,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
private final IWarehouseWaybillDetailClient warehouseWaybillDetailClient;
private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient;
private final ISysClient sysClient;
private final IFactoryDataClient factoryDataClient;
@Override
public IPage<DistributionStockArticleVO> selectDistributionStockArticlePage(IPage<DistributionStockArticleVO> page, DistributionStockArticleVO distributionStockArticle) {
@ -1502,6 +1506,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
}
@Override
public void updateOrderInfoByDistributionStockArticleEntity(DistributionStockArticleEntity stockArticleEntity) {
if (Objects.isNull(stockArticleEntity)) {
@ -1694,7 +1699,16 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
if (Objects.isNull(stockArticleEntity)) {
return;
}
updateOrderInfoByDistributionStockArticleEntity(stockArticleEntity);
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(RabbitConstant.ORDER_INFO_UPDATE_EXCHANGE)
.routingKey(RabbitConstant.ORDER_INFO_UPDATE_ROUTING)
.message(JSONUtil.toJsonStr(stockArticleEntity))
.delay(1000)
.build());
// updateOrderInfoByDistributionStockArticleEntity(stockArticleEntity);
}
@ -1728,9 +1742,17 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return;
}
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(RabbitConstant.ORDER_INFO_UPDATE_EXCHANGE)
.routingKey(RabbitConstant.ORDER_INFO_UPDATE_ROUTING)
.message(JSONUtil.toJsonStr(stockArticleEntity))
.delay(1000)
.build());
//查询入库件数
// updateStockArticleByextracted(warehouseId, stockArticleEntity);
updateOrderInfoByDistributionStockArticleEntity(stockArticleEntity);
// updateOrderInfoByDistributionStockArticleEntity(stockArticleEntity);
log.info(">>>>> T updateOrdersInfo end");
}

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml

@ -12,6 +12,7 @@
</select>
<select id="advancePageList" resultType="com.logpm.trunkline.vo.TrunklineAdvanceVO">
/*FORCE_MASTER*/
select lta.*,
if( NOW() > DATE_ADD(lta.create_time, INTERVAL 24 HOUR), 1,0) isTimeOut,
lbc.client_name htMallName

Loading…
Cancel
Save