Commit 52365601 authored by zhangfeng's avatar zhangfeng

订单V值触发测试接口

parent eef3c4ae
......@@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.member.enums.ScoreRuleTypeEnum;
* @author zhangfeng
*/
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);
......
......@@ -121,7 +121,7 @@ public class ScoreRuleController {
@GetMapping("/warehouse-tree-region-list")
@ApiOperation("获得目的国、目的城市、目的仓列表")
public CommonResult<List<WarehouseTreeRegionSimpleVO>> warehouseTreeRegionList() {
List<WarehouseTreeRegionSimpleVO> list= scoreRuleService.getWarehouseTreeRegionListSimple();
List<WarehouseTreeRegionSimpleVO> list = scoreRuleService.getWarehouseTreeRegionListSimple();
return success(list);
}
......@@ -129,7 +129,7 @@ public class ScoreRuleController {
@ApiOperation("测试订单V值触发")
public CommonResult<Void> testScoreRule(@RequestParam Long orderId, @RequestParam String 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);
}
......
......@@ -51,7 +51,7 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy {
// 获取订单信息
OrderRespDTO order;
try {
order = orderApi.getOrder(orderId, "");
order = orderApi.getOrder(orderId, message.getOrderNo());
} catch (Exception e) {
log.error("Order in shipping listener: Get order error,orderId:{}", orderId, e);
return;
......
......@@ -20,6 +20,10 @@ public class ScoreMessage extends AbstractStreamMessage {
* 订单ID:订单V值消息必填
*/
private Long orderId;
/**
* 订单编号:目前仅测试使用
*/
private String orderNo;
/**
* userID:注册必填
*/
......
......@@ -19,10 +19,11 @@ public class ScoreProducer implements ScoreProducerApi {
private RedisMQTemplate redisMQTemplate;
@Override
public void sendOderMessage(ScoreRuleTypeEnum scoreRuleType, Long orderId) {
public void sendOderMessage(ScoreRuleTypeEnum scoreRuleType, Long orderId, String orderNo) {
ScoreMessage message = ScoreMessage.builder()
.scoreRuleType(scoreRuleType)
.orderId(orderId)
.orderNo(orderNo)
.build();
redisMQTemplate.send(message);
}
......
......@@ -1875,7 +1875,7 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
updateOrderStatusByOrderIdAndTransportType(orderIdList, orderStatus, inWarehouseState, shipmentState, auditType, auditResult, businessTime, estTime, transportType);
if (Objects.equals(orderStatus, OrderStatusEnum.IN_SHIPPING.getValue())) {
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