提交 b49082c5 authored 作者: 刘海泉's avatar 刘海泉

修改车队定向货单派单数的问题

上级 c31d452e
...@@ -2,6 +2,7 @@ package com.clx.performance.constant; ...@@ -2,6 +2,7 @@ package com.clx.performance.constant;
public class RabbitKeyConstants { public class RabbitKeyConstants {
//更改订单状态为挂单中
public static final String ORDER_POSTED_QUEUE = "clx-order.order.posted.queue"; public static final String ORDER_POSTED_QUEUE = "clx-order.order.posted.queue";
//改订单状态为已挂单 //改订单状态为已挂单
...@@ -12,16 +13,18 @@ public class RabbitKeyConstants { ...@@ -12,16 +13,18 @@ public class RabbitKeyConstants {
public static final String ORDER_ON_ROUTE_KEY ="clx-order.order.on.route.key"; public static final String ORDER_ON_ROUTE_KEY ="clx-order.order.on.route.key";
/*
public static final String ORDER_ON_DEAD_ROUTE_KEY ="clx-order.order.on.dead.route.key"; public static final String ORDER_ON_DEAD_ROUTE_KEY ="clx-order.order.on.dead.route.key";
*/
public static final String ORDER_ON_QUEUE ="clx-order.order.on.queue"; public static final String ORDER_ON_QUEUE ="clx-order.order.on.queue";
public static final String ORDER_ON_EXCHANGE ="clx-order.order.on.exchange"; public static final String ORDER_ON_EXCHANGE ="clx-order.order.on.exchange";
//更改订单状态为挂单中
public static final String ORDER_ON_DEAD_EXCHANGE ="clx-order.order.on.dead.exchange";
public static final String ORDER_ON_DEAD_QUEUE ="clx-order.order.on.dead.queue"; /* public static final String ORDER_ON_DEAD_EXCHANGE ="clx-order.order.on.dead.exchange";
public static final String ORDER_ON_DEAD_QUEUE ="clx-order.order.on.dead.queue";*/
public static final String ORDER_GOODS_SYNC_TRUCK_DRIVER_INFO_QUEUE = "clx-performance.order.goods.sync.truck.driver.info.queue"; public static final String ORDER_GOODS_SYNC_TRUCK_DRIVER_INFO_QUEUE = "clx-performance.order.goods.sync.truck.driver.info.queue";
......
...@@ -10,7 +10,10 @@ import com.msl.common.base.Optional; ...@@ -10,7 +10,10 @@ import com.msl.common.base.Optional;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.exception.ExceptionUtils; import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageBuilder;
import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -29,6 +32,9 @@ public class RabbitOrderGoodsStatusOnHandler { ...@@ -29,6 +32,9 @@ public class RabbitOrderGoodsStatusOnHandler {
@Autowired @Autowired
private LineWarnMqService lineWarnMqService; private LineWarnMqService lineWarnMqService;
@Autowired
private RabbitTemplate rabbitTemplate;
@RabbitListener(queues = RabbitKeyConstants.ORDER_GOODS_ON_DEAD_QUEUE) @RabbitListener(queues = RabbitKeyConstants.ORDER_GOODS_ON_DEAD_QUEUE)
public void onMessage(String message) { public void onMessage(String message) {
log.info("处理货单状态由已挂单变为挂弹中监听器执行,货单ID为{}", message); log.info("处理货单状态由已挂单变为挂弹中监听器执行,货单ID为{}", message);
...@@ -45,6 +51,14 @@ public class RabbitOrderGoodsStatusOnHandler { ...@@ -45,6 +51,14 @@ public class RabbitOrderGoodsStatusOnHandler {
log.info("处理货单状态由已挂单变为挂单中监听器执行,从状态{}-----变更为{}", orderGoods.getOrderGoodsStatus(), OrderGoodsStatusEnum.Status.PAYING.getName()); log.info("处理货单状态由已挂单变为挂单中监听器执行,从状态{}-----变更为{}", orderGoods.getOrderGoodsStatus(), OrderGoodsStatusEnum.Status.PAYING.getName());
orderGoodsDao.updateOrderGoodsStatusByOrderGoodsNo(orderGoods.getOrderGoodsNo(), OrderGoodsStatusEnum.Status.PAYING.getCode()); orderGoodsDao.updateOrderGoodsStatusByOrderGoodsNo(orderGoods.getOrderGoodsNo(), OrderGoodsStatusEnum.Status.PAYING.getCode());
Message orderNoMessage = MessageBuilder.withBody(orderGoods.getOrderNo().getBytes()).build();
//发送mq,更改货单对应的订单为挂单中
rabbitTemplate.send(
RabbitKeyConstants.ORDER_POSTED_EXCHANGE, RabbitKeyConstants.ORDER_POSTED_ROUTE_KEY, orderNoMessage
);
// 发送mq // 发送mq
lineWarnMqService.orderGoodsAdd(orderGoods.getOrderGoodsNo()); lineWarnMqService.orderGoodsAdd(orderGoods.getOrderGoodsNo());
......
package com.clx.performance.strategy; package com.clx.performance.strategy;
import com.clx.order.enums.VehicleUsageEnum;
import com.clx.performance.param.pc.OrderGoodsChildParams;
import com.clx.performance.param.pc.OrderGoodsParams;
import com.clx.order.enums.OrderStopEnum; import com.clx.order.enums.OrderStopEnum;
import com.clx.order.enums.ResultEnum; import com.clx.order.enums.ResultEnum;
import com.clx.order.enums.VehicleUsageEnum;
import com.clx.order.vo.feign.FeignOrderVO; import com.clx.order.vo.feign.FeignOrderVO;
import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.dao.OrderGoodsTruckBindDao; import com.clx.performance.dao.OrderGoodsTruckBindDao;
import com.clx.performance.model.OrderGoodsTruckBind; import com.clx.performance.model.OrderGoodsTruckBind;
import com.clx.performance.param.pc.OrderGoodsChildParams;
import com.clx.performance.param.pc.OrderGoodsParams;
import com.clx.performance.utils.SpringContextUtils; import com.clx.performance.utils.SpringContextUtils;
import com.msl.common.exception.ServiceSystemException; import com.msl.common.exception.ServiceSystemException;
import com.msl.common.utils.DateUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageBuilder;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Slf4j @Slf4j
...@@ -83,7 +81,7 @@ public abstract class GoodsOrderStrategy { ...@@ -83,7 +81,7 @@ public abstract class GoodsOrderStrategy {
throw new ServiceSystemException(ResultEnum.DATA_ERROR, "已被定向单绑定车辆:" + trucks); } throw new ServiceSystemException(ResultEnum.DATA_ERROR, "已被定向单绑定车辆:" + trucks); }
} }
//根据不同的订单类型创建不同的货单 //根据不同的订单类型创建不同的货单
LocalDateTime sendLazyTime = goodsOrderProcess(orderGoodsParams, orderInfo, now); /* LocalDateTime sendLazyTime = goodsOrderProcess(orderGoodsParams, orderInfo, now);
Message message = MessageBuilder.withBody(orderNo.getBytes()).build(); Message message = MessageBuilder.withBody(orderNo.getBytes()).build();
BigDecimal epochMilli = null; BigDecimal epochMilli = null;
...@@ -107,6 +105,6 @@ public abstract class GoodsOrderStrategy { ...@@ -107,6 +105,6 @@ public abstract class GoodsOrderStrategy {
rabbitTemplate.send( rabbitTemplate.send(
RabbitKeyConstants.ORDER_ON_EXCHANGE, RabbitKeyConstants.ORDER_ON_ROUTE_KEY, message RabbitKeyConstants.ORDER_ON_EXCHANGE, RabbitKeyConstants.ORDER_ON_ROUTE_KEY, message
); );
} }*/
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论