修改店铺信息发送跟新mq

This commit is contained in:
张松
2025-12-02 15:17:32 +08:00
parent d05f1f1caf
commit 2c2b3765ad
3 changed files with 11 additions and 6 deletions

View File

@@ -7,6 +7,8 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map;
/** /**
* @author GYJoker * @author GYJoker
*/ */
@@ -132,8 +134,11 @@ public class RabbitPublisher {
/** /**
* 订单商品状态消息 * 订单商品状态消息
*/ */
public void sendOrderDetailStatusMsg(String shopId) { public void sendOrderDetailStatusMsg(String shopId, String type) {
sendMsg(RabbitConstants.Queue.ORDER_DETAIL_STATUS_QUEUE, shopId); sendMsg(RabbitConstants.Queue.ORDER_DETAIL_STATUS_QUEUE, JSONObject.toJSONString(Map.of(
"shopId", shopId,
"type", type
)));
} }
private void sendMsg(String queue, String msg) { private void sendMsg(String queue, String msg) {

View File

@@ -316,10 +316,10 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
if (flag) { if (flag) {
sysUserService.updateById(sysUser); sysUserService.updateById(sysUser);
} }
rabbitPublisher.sendOrderDetailStatusMsg(shopInfo.getId().toString(), "shopInfoUpdate");
return true; return true;
} }
rabbitPublisher.sendOrderDetailStatusMsg(shopInfo.getId().toString());
return false; return false;
} }

View File

@@ -325,7 +325,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
redisService.set(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId(), "", 60 * 15); redisService.set(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId(), "", 60 * 15);
} }
rabbitPublisher.sendOrderStockMsg(orderInfo.getId().toString()); rabbitPublisher.sendOrderStockMsg(orderInfo.getId().toString());
rabbitPublisher.sendOrderDetailStatusMsg(orderInfo.getShopId().toString()); rabbitPublisher.sendOrderDetailStatusMsg(orderInfo.getShopId().toString(), "bc");
return orderInfo; return orderInfo;
} }
@@ -1340,7 +1340,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
rabbitPublisher.sendOrderPrintMsg(printParam, isPrint); rabbitPublisher.sendOrderPrintMsg(printParam, isPrint);
// log.info("非事务环境下,直接发送订单{}打印消息", orderId); // log.info("非事务环境下,直接发送订单{}打印消息", orderId);
} }
rabbitPublisher.sendOrderDetailStatusMsg(orderInfo.getShopId().toString()); rabbitPublisher.sendOrderDetailStatusMsg(orderInfo.getShopId().toString(), "bc");
redisService.del(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId()); redisService.del(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId());
} }
@@ -1790,7 +1790,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
} }
} }
rabbitPublisher.sendOrderDetailStatusMsg(shopId.toString()); rabbitPublisher.sendOrderDetailStatusMsg(shopId.toString(), "bc");
return true; return true;
} }
} }