Merge pull request !93 from OceansDeep/feature/pg
This commit is contained in:
OceansDeep 2021-12-28 12:02:05 +00:00 committed by Gitee
commit cbbfbae772
3 changed files with 5 additions and 3 deletions

View File

@ -82,7 +82,7 @@ public class FullDiscountExecute implements TradeEvent, OrderStatusChangeEvent {
if ((cartVO.getGiftList() != null && !cartVO.getGiftList().isEmpty())
|| (cartVO.getGiftPoint() != null && cartVO.getGiftPoint() > 0)
|| (cartVO.getGiftCouponList() != null && !cartVO.getGiftCouponList().isEmpty())) {
cache.put(CachePrefix.ORDER.getPrefix() + cartVO.getSn(), cartVO);
cache.put(CachePrefix.ORDER.getPrefix() + cartVO.getSn(), JSONUtil.toJsonStr(cartVO));
}
}
);
@ -92,7 +92,7 @@ public class FullDiscountExecute implements TradeEvent, OrderStatusChangeEvent {
public void orderChange(OrderMessage orderMessage) {
if (orderMessage.getNewStatus().equals(OrderStatusEnum.PAID)) {
log.debug("满减活动,订单状态操作 {}", CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn());
renderGift((CartVO) cache.get(CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn()), orderMessage);
renderGift(JSONUtil.toBean(cache.getString(CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn()), CartVO.class), orderMessage);
}
}

View File

@ -2,6 +2,7 @@ package cn.lili.listener;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ClassLoaderUtil;
import cn.hutool.json.JSONObject;
@ -140,7 +141,7 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
}
break;
case UPDATE_GOODS_INDEX_PROMOTIONS:
this.updateGoodsIndexPromotions(new String(messageExt.getBody()));
ThreadUtil.execAsync(() -> this.updateGoodsIndexPromotions(new String(messageExt.getBody())));
break;
case DELETE_GOODS_INDEX_PROMOTIONS:
BasePromotions promotions = JSONUtil.toBean(new String(messageExt.getBody()), BasePromotions.class);

View File

@ -489,6 +489,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
//修改订单货物可以进行评价
orderItemService.update(new UpdateWrapper<OrderItem>().eq(ORDER_SN_COLUMN, orderSn)
.set("comment_status", CommentStatusEnum.UNFINISHED));
this.update(new LambdaUpdateWrapper<Order>().eq(Order::getSn, orderSn).set(Order::getCompleteTime, new Date()));
//发送订单状态改变消息
OrderMessage orderMessage = new OrderMessage();
orderMessage.setNewStatus(OrderStatusEnum.COMPLETED);