记得上下班打卡 | git大法好,push需谨慎

Commit a65d4815 authored by jiangxiulong's avatar jiangxiulong

sendMsgByRedisGoblinStock type改为传参

parent c3cd29c5
...@@ -580,7 +580,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -580,7 +580,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
GoblinOrderAttrVo orderAttrVo = GoblinOrderAttrVo.getNew().copy(orderAttr); GoblinOrderAttrVo orderAttrVo = GoblinOrderAttrVo.getNew().copy(orderAttr);
//待支付发送队列 //待支付发送队列
queueUtils.sendMsgByRedisGoblinStock(orderVo.getMasterOrderCode(), storeOrder.getCreatedAt()); queueUtils.sendMsgByRedisGoblinStock(orderVo.getMasterOrderCode(), storeOrder.getCreatedAt(), "GOBLIN");
//redis 赋值 //redis 赋值
orderVo.setOrderAttrVo(orderAttrVo); orderVo.setOrderAttrVo(orderAttrVo);
orderVo.setOrderSkuVoIds(goblinOrderSkuIdList); orderVo.setOrderSkuVoIds(goblinOrderSkuIdList);
......
...@@ -51,7 +51,7 @@ public class QueueUtils { ...@@ -51,7 +51,7 @@ public class QueueUtils {
* @param createTime 订单创建时间 * @param createTime 订单创建时间
* @param masterOrderCode Goblin主订单号 * @param masterOrderCode Goblin主订单号
*/ */
public void sendMsgByRedisGoblinStock(String masterOrderCode, LocalDateTime createTime) { public void sendMsgByRedisGoblinStock(String masterOrderCode, LocalDateTime createTime, String type) {
String streamKey; String streamKey;
int key = createTime.getMinute() % 10; int key = createTime.getMinute() % 10;
switch (key) { switch (key) {
...@@ -88,7 +88,7 @@ public class QueueUtils { ...@@ -88,7 +88,7 @@ public class QueueUtils {
} }
HashMap<String, String> map = ObjectUtil.cloneHashMapStringAndString(); HashMap<String, String> map = ObjectUtil.cloneHashMapStringAndString();
map.put("id", masterOrderCode); map.put("id", masterOrderCode);
map.put("type", "GOBLIN"); map.put("type", type);
map.put("time", createTime.toString()); map.put("time", createTime.toString());
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
} }
......
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