Commit 52365601 authored by zhangfeng's avatar zhangfeng

订单V值触发测试接口

parent eef3c4ae
...@@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.member.enums.ScoreRuleTypeEnum; ...@@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.member.enums.ScoreRuleTypeEnum;
* @author zhangfeng * @author zhangfeng
*/ */
public interface ScoreProducerApi { public interface ScoreProducerApi {
void sendOderMessage(ScoreRuleTypeEnum scoreRuleType, Long orderId); void sendOderMessage(ScoreRuleTypeEnum scoreRuleType, Long orderId, String orderNo);
void sendRecommendMessage(ScoreRuleTypeEnum scoreRuleType, Long userId, String referralCode); void sendRecommendMessage(ScoreRuleTypeEnum scoreRuleType, Long userId, String referralCode);
......
...@@ -121,7 +121,7 @@ public class ScoreRuleController { ...@@ -121,7 +121,7 @@ public class ScoreRuleController {
@GetMapping("/warehouse-tree-region-list") @GetMapping("/warehouse-tree-region-list")
@ApiOperation("获得目的国、目的城市、目的仓列表") @ApiOperation("获得目的国、目的城市、目的仓列表")
public CommonResult<List<WarehouseTreeRegionSimpleVO>> warehouseTreeRegionList() { public CommonResult<List<WarehouseTreeRegionSimpleVO>> warehouseTreeRegionList() {
List<WarehouseTreeRegionSimpleVO> list= scoreRuleService.getWarehouseTreeRegionListSimple(); List<WarehouseTreeRegionSimpleVO> list = scoreRuleService.getWarehouseTreeRegionListSimple();
return success(list); return success(list);
} }
...@@ -129,7 +129,7 @@ public class ScoreRuleController { ...@@ -129,7 +129,7 @@ public class ScoreRuleController {
@ApiOperation("测试订单V值触发") @ApiOperation("测试订单V值触发")
public CommonResult<Void> testScoreRule(@RequestParam Long orderId, @RequestParam String orderNo) { public CommonResult<Void> testScoreRule(@RequestParam Long orderId, @RequestParam String orderNo) {
//applicationContext.publishEvent(new OrderInShippingEvent(orderId, orderNo)); //applicationContext.publishEvent(new OrderInShippingEvent(orderId, orderNo));
scoreProducerApi.sendOderMessage(ScoreRuleTypeEnum.ORDER_V, orderId); scoreProducerApi.sendOderMessage(ScoreRuleTypeEnum.ORDER_V, orderId <= 0 ? null : orderId, orderNo);
return success(null); return success(null);
} }
......
...@@ -51,7 +51,7 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy { ...@@ -51,7 +51,7 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy {
// 获取订单信息 // 获取订单信息
OrderRespDTO order; OrderRespDTO order;
try { try {
order = orderApi.getOrder(orderId, ""); order = orderApi.getOrder(orderId, message.getOrderNo());
} catch (Exception e) { } catch (Exception e) {
log.error("Order in shipping listener: Get order error,orderId:{}", orderId, e); log.error("Order in shipping listener: Get order error,orderId:{}", orderId, e);
return; return;
......
...@@ -20,6 +20,10 @@ public class ScoreMessage extends AbstractStreamMessage { ...@@ -20,6 +20,10 @@ public class ScoreMessage extends AbstractStreamMessage {
* 订单ID:订单V值消息必填 * 订单ID:订单V值消息必填
*/ */
private Long orderId; private Long orderId;
/**
* 订单编号:目前仅测试使用
*/
private String orderNo;
/** /**
* userID:注册必填 * userID:注册必填
*/ */
......
...@@ -19,10 +19,11 @@ public class ScoreProducer implements ScoreProducerApi { ...@@ -19,10 +19,11 @@ public class ScoreProducer implements ScoreProducerApi {
private RedisMQTemplate redisMQTemplate; private RedisMQTemplate redisMQTemplate;
@Override @Override
public void sendOderMessage(ScoreRuleTypeEnum scoreRuleType, Long orderId) { public void sendOderMessage(ScoreRuleTypeEnum scoreRuleType, Long orderId, String orderNo) {
ScoreMessage message = ScoreMessage.builder() ScoreMessage message = ScoreMessage.builder()
.scoreRuleType(scoreRuleType) .scoreRuleType(scoreRuleType)
.orderId(orderId) .orderId(orderId)
.orderNo(orderNo)
.build(); .build();
redisMQTemplate.send(message); redisMQTemplate.send(message);
} }
......
...@@ -1875,7 +1875,7 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -1875,7 +1875,7 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
updateOrderStatusByOrderIdAndTransportType(orderIdList, orderStatus, inWarehouseState, shipmentState, auditType, auditResult, businessTime, estTime, transportType); updateOrderStatusByOrderIdAndTransportType(orderIdList, orderStatus, inWarehouseState, shipmentState, auditType, auditResult, businessTime, estTime, transportType);
if (Objects.equals(orderStatus, OrderStatusEnum.IN_SHIPPING.getValue())) { if (Objects.equals(orderStatus, OrderStatusEnum.IN_SHIPPING.getValue())) {
for (Long orderId : orderIdList) { for (Long orderId : orderIdList) {
scoreProducerApi.sendOderMessage(ScoreRuleTypeEnum.ORDER_V, orderId); scoreProducerApi.sendOderMessage(ScoreRuleTypeEnum.ORDER_V, orderId, null);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment