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

Merge remote-tracking branch 'origin/v19.4_order_performance_progress_20240712' into dev

package com.clx.performance.listener; package com.clx.performance.listener;
import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.clx.performance.common.MqWrapper;
import com.clx.performance.constant.RabbitKeyConstants; import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.model.OrderGoodsAdjustmentPrice; import com.clx.performance.model.OrderGoodsAdjustmentPrice;
import com.clx.performance.service.OrderGoodsAdjustmentPriceService; import com.clx.performance.service.OrderGoodsAdjustmentPriceService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -21,9 +24,11 @@ public class SaveOrderGoodsAdjustmentPriceListener { ...@@ -21,9 +24,11 @@ public class SaveOrderGoodsAdjustmentPriceListener {
@RabbitListener(queues = RabbitKeyConstants.SAVE_ORDER_GOODS_ADJUSTMENT_PRICE_QUEUE) @RabbitListener(queues = RabbitKeyConstants.SAVE_ORDER_GOODS_ADJUSTMENT_PRICE_QUEUE)
public void onMessage(String message) { public void onMessage(Message message) {
log.info("监听到保存货单挂单运费调整记录,消息内容{}", message); log.info("监听到保存货单挂单运费调整记录,消息内容{}", message);
OrderGoodsAdjustmentPrice data = JSONUtil.toBean(message, OrderGoodsAdjustmentPrice.class); OrderGoodsAdjustmentPrice data = JSON.parseObject(new String(message.getBody()),
new TypeReference<MqWrapper<OrderGoodsAdjustmentPrice>>() {
}).getData();
orderGoodsAdjustmentPriceService.saveOrderGoodsAdjustmentPrice(data); orderGoodsAdjustmentPriceService.saveOrderGoodsAdjustmentPrice(data);
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论