From 6de437634cdea0872519883808885915b1d89008 Mon Sep 17 00:00:00 2001 From: sonjinyon <2476687577@qq.com> Date: Wed, 16 Oct 2024 14:35:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A7=AF=E5=88=86=E5=95=86?= =?UTF-8?q?=E5=9F=8E=E8=AE=A2=E5=8D=95=E6=8F=90=E4=BA=A4=E6=8A=A5=E9=94=99?= =?UTF-8?q?,=E5=A2=9E=E5=8A=A0=E5=90=8E=E5=8F=B0=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/mall/promotion/pointorder/index.ts | 49 ++++ .../kefu/components/KeFuConversationList.vue | 22 +- .../kefu/components/KeFuMessageList.vue | 20 +- .../history/MemberBrowsingHistory.vue | 4 +- .../history/ProductBrowsingHistory.vue | 1 + .../kefu/components/message/OrderItem.vue | 45 ++- .../kefu/components/message/ProductItem.vue | 28 +- .../promotion/kefu/components/tools/emoji.ts | 11 +- .../src/views/mall/promotion/kefu/index.vue | 199 +++++++------ .../promotion/pointorder/PointOrderForm.vue | 123 ++++++++ .../views/mall/promotion/pointorder/index.vue | 220 ++++++++++++++ .../mybatis/core/mapper/BaseMapperX.java | 4 +- .../mybatis/core/util/JdbcUtils.java | 20 +- .../api/spu/dto/ProductSpuRespDTO.java | 9 + .../promotion/api/coupon/CouponApi.java | 10 + .../api/reward/RewardActivityApi.java | 2 + .../dto/RewardActivityMatchRespDTO.java | 63 +++- .../promotion/enums/ErrorCodeConstants.java | 3 + .../common/PromotionProductScopeEnum.java | 21 +- .../promotion/api/coupon/CouponApiImpl.java | 7 + .../api/discount/DiscountActivityApiImpl.java | 6 +- .../pointorder/PointOrderController.java | 95 ++++++ .../pointorder/vo/PointOrderPageReqVO.java | 41 +++ .../admin/pointorder/vo/PointOrderRespVO.java | 53 ++++ .../pointorder/vo/PointOrderSaveReqVO.java | 35 +++ .../dataobject/pointorder/PointOrderDO.java | 71 +++++ .../mysql/discount/DiscountProductMapper.java | 11 + .../mysql/pointorder/PointOrderMapper.java | 32 ++ .../service/pointorder/PointOrderService.java | 55 ++++ .../pointorder/PointOrderServiceImpl.java | 100 +++++++ .../trade/enums/ErrorCodeConstants.java | 4 + .../trade/enums/MessageTemplateConstants.java | 2 + .../enums/order/TradeOrderCancelTypeEnum.java | 4 +- .../trade/enums/order/TradeOrderTypeEnum.java | 6 +- .../yudao-module-trade-biz/pom.xml | 5 + .../aftersale/TradeAfterSaleController.http | 33 --- .../admin/order/TradeOrderController.java | 103 +------ .../app/cart/AppCartController.http | 42 --- .../app/order/AppTradeOrderController.http | 5 + .../app/order/AppTradeOrderController.java | 79 ++--- .../app/order/vo/AppPointOrderVO.java | 18 ++ .../vo/AppTradeOrderSettlementReqVO.java | 6 +- .../vo/AppTradeOrderSettlementRespVO.java | 56 +++- .../vo/AppTradeProductSettlementRespVO.java | 81 ++++++ .../convert/order/TradeOrderConvert.java | 4 +- .../dal/dataobject/order/TradeOrderDO.java | 30 ++ .../dataobject/order/TradeOrderItemDO.java | 2 + .../dal/mysql/order/TradeOrderMapper.java | 9 + .../client/impl/ExpressClientFactoryImpl.java | 2 +- .../service/order/TradeOrderQueryService.java | 6 + .../order/TradeOrderQueryServiceImpl.java | 11 + .../order/TradeOrderUpdateService.java | 10 + .../order/TradeOrderUpdateServiceImpl.java | 73 +++-- .../handler/TradeMemberPointOrderHandler.java | 8 +- .../order/handler/TradePointOrderHandler.java | 71 +++++ .../service/price/TradePriceService.java | 12 +- .../service/price/TradePriceServiceImpl.java | 33 ++- .../price/bo/TradePriceCalculateReqBO.java | 6 +- .../price/bo/TradePriceCalculateRespBO.java | 102 ++++++- ...adeCombinationActivityPriceCalculator.java | 1 - .../TradeCouponPriceCalculator.java | 86 ++++-- .../TradeDeliveryPriceCalculator.java | 26 +- .../TradeDiscountActivityPriceCalculator.java | 114 ++++++-- .../TradeMemberLevelPriceCalculator.java | 176 +++++------ .../TradePointActivityPriceCalculator.java | 95 ++++++ .../TradePointUsePriceCalculator.java | 70 ++--- .../calculator/TradePriceCalculator.java | 1 + .../TradePriceCalculatorHelper.java | 43 +-- .../TradeRewardActivityPriceCalculator.java | 7 +- .../TradeSeckillActivityPriceCalculator.java | 1 + .../price/TradePriceServiceImplTest.java | 274 +++++++++--------- .../TradeMemberLevelPriceCalculatorTest.java | 236 +++++++-------- .../SocialWxaSubscribeMessageSendReqDTO.java | 61 ++++ .../SocialWxaSubscribeTemplateRespDTO.java | 42 +++ .../system/enums/ErrorCodeConstants.java | 3 +- 75 files changed, 2510 insertions(+), 909 deletions(-) create mode 100644 yudao-admin-vue3/src/api/mall/promotion/pointorder/index.ts create mode 100644 yudao-admin-vue3/src/views/mall/promotion/pointorder/PointOrderForm.vue create mode 100644 yudao-admin-vue3/src/views/mall/promotion/pointorder/index.vue create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/pointorder/PointOrderController.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/pointorder/vo/PointOrderPageReqVO.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/pointorder/vo/PointOrderRespVO.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/pointorder/vo/PointOrderSaveReqVO.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/pointorder/PointOrderDO.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/pointorder/PointOrderMapper.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/pointorder/PointOrderService.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/pointorder/PointOrderServiceImpl.java delete mode 100644 yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/TradeAfterSaleController.http delete mode 100644 yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/AppCartController.http create mode 100644 yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppPointOrderVO.java create mode 100644 yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeProductSettlementRespVO.java create mode 100644 yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/handler/TradePointOrderHandler.java create mode 100644 yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradePointActivityPriceCalculator.java create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialWxaSubscribeMessageSendReqDTO.java create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/social/dto/SocialWxaSubscribeTemplateRespDTO.java 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