diff --git a/yudao-admin-vue3/src/api/mall/promotion/pointorder/index.ts b/yudao-admin-vue3/src/api/mall/promotion/pointorder/index.ts new file mode 100644 index 0000000..2e34857 --- /dev/null +++ b/yudao-admin-vue3/src/api/mall/promotion/pointorder/index.ts @@ -0,0 +1,49 @@ +import request from '@/config/axios' + +// 兑换记录 VO +export interface PointOrderVO { + id: number // id + orderNumber: string // 订单号 + userId: number // 用户id + productId: number // 商品id + integral: number // 兑换积分 + orderStatus: number // 订单状态 + orderTime: Date // 下单时间 + userName: string + productName: string + imageUrl: string + +} + +// 兑换记录 API +export const PointOrderApi = { + // 查询兑换记录分页 + getPointOrderPage: async (params: any) => { + return await request.get({ url: `/promotion/point-order/page`, params }) + }, + + // 查询兑换记录详情 + getPointOrder: async (id: number) => { + return await request.get({ url: `/promotion/point-order/get?id=` + id }) + }, + + // 新增兑换记录 + createPointOrder: async (data: PointOrderVO) => { + return await request.post({ url: `/promotion/point-order/create`, data }) + }, + + // 修改兑换记录 + updatePointOrder: async (data: PointOrderVO) => { + return await request.put({ url: `/promotion/point-order/update`, data }) + }, + + // 删除兑换记录 + deletePointOrder: async (id: number) => { + return await request.delete({ url: `/promotion/point-order/delete?id=` + id }) + }, + + // 导出兑换记录 Excel + exportPointOrder: async (params) => { + return await request.download({ url: `/promotion/point-order/export-excel`, params }) + }, +} \ No newline at end of file diff --git a/yudao-admin-vue3/src/views/mall/promotion/kefu/components/KeFuConversationList.vue b/yudao-admin-vue3/src/views/mall/promotion/kefu/components/KeFuConversationList.vue index 60188f3..6e01123 100644 --- a/yudao-admin-vue3/src/views/mall/promotion/kefu/components/KeFuConversationList.vue +++ b/yudao-admin-vue3/src/views/mall/promotion/kefu/components/KeFuConversationList.vue @@ -22,8 +22,8 @@
diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/handler/TradeMemberPointOrderHandler.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/handler/TradeMemberPointOrderHandler.java
index 0c1f9d4..a9a13e3 100644
--- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/handler/TradeMemberPointOrderHandler.java
+++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/handler/TradeMemberPointOrderHandler.java
@@ -78,12 +78,10 @@ public class TradeMemberPointOrderHandler implements TradeOrderHandler {
@Override
public void afterCancelOrderItem(TradeOrderDO order, TradeOrderItemDO orderItem) {
- // 扣减(回滚)积分(订单赠送)
- reducePoint(order.getUserId(), orderItem.getGivePoint(), MemberPointBizTypeEnum.ORDER_GIVE_CANCEL_ITEM,
- orderItem.getId());
// 增加(回滚)积分(订单抵扣)
- addPoint(order.getUserId(), orderItem.getUsePoint(), MemberPointBizTypeEnum.ORDER_USE_CANCEL_ITEM,
- orderItem.getId());
+ addPoint(order.getUserId(), orderItem.getUsePoint(), MemberPointBizTypeEnum.ORDER_USE_CANCEL_ITEM, orderItem.getId());
+ // 扣减(回滚)积分(订单赠送)
+ reducePoint(order.getUserId(), orderItem.getGivePoint(), MemberPointBizTypeEnum.ORDER_GIVE_CANCEL_ITEM, orderItem.getId());
// 扣减(回滚)用户经验
AfterSaleDO afterSale = afterSaleService.getAfterSale(orderItem.getAfterSaleId());
diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/handler/TradePointOrderHandler.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/handler/TradePointOrderHandler.java
new file mode 100644
index 0000000..f0b82df
--- /dev/null
+++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/handler/TradePointOrderHandler.java
@@ -0,0 +1,71 @@
+package cn.iocoder.yudao.module.trade.service.order.handler;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.lang.Assert;
+import cn.iocoder.yudao.module.promotion.api.point.PointActivityApi;
+import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO;
+import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO;
+import cn.iocoder.yudao.module.trade.enums.order.TradeOrderStatusEnum;
+import cn.iocoder.yudao.module.trade.enums.order.TradeOrderTypeEnum;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 积分商城活动订单的 {@link TradeOrderHandler} 实现类
+ *
+ * @author HUIHUI
+ */
+@Component
+public class TradePointOrderHandler implements TradeOrderHandler {
+
+ @Resource
+ private PointActivityApi pointActivityApi;
+
+ @Override
+ public void beforeOrderCreate(TradeOrderDO order, List