From e2d5c94d2e313523edfdc0335862b03fff7be8bd Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期一, 29 九月 2025 17:16:43 +0800
Subject: [PATCH] 商家优惠劵领取

---
 framework/src/main/java/cn/lili/modules/order/order/entity/dto/StoreCouponClaimRecordDTO.java   |    2 ++
 framework/src/main/resources/mapper/lmk/StoreCouponClaimRecordMapper.xml                        |   14 ++++++++++++--
 framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreCouponClaimRecordVO.java             |    5 +++++
 framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponClaimRecordServiceImpl.java |   34 +++++++++++++++++++++++++++++-----
 4 files changed, 48 insertions(+), 7 deletions(-)

diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreCouponClaimRecordVO.java b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreCouponClaimRecordVO.java
index c50d499..1fbe16e 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreCouponClaimRecordVO.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/StoreCouponClaimRecordVO.java
@@ -105,6 +105,11 @@
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date claimTime;
 
+    @ApiModelProperty("璁㈠崟鐘舵��")
+    private String orderStatus;
+
+
+
     public static StoreCouponClaimRecordVO getVoByEntity(@NonNull StoreCouponClaimRecord entity, StoreCouponClaimRecordVO vo) {
         if(vo == null) {
             vo = new StoreCouponClaimRecordVO();
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponClaimRecordServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponClaimRecordServiceImpl.java
index f759752..88e4c51 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponClaimRecordServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponClaimRecordServiceImpl.java
@@ -266,7 +266,7 @@
         Row header = sheet.createRow(0);
         String[] headers = {
                 "浼氬憳鍚嶇О", "浼樻儬鍒稿悕绉�", "鍙戝竷搴楅摵", "闈㈤/鎶樻墸",
-                 "鑾峰彇鏂瑰紡", "浼氬憳浼樻儬鍒哥姸鎬�", "浼樻儬鍒哥被鍨�",
+                 "鑾峰彇鏂瑰紡", "浼氬憳浼樻儬鍒哥姸鎬�", "浼樻儬鍒哥被鍨�","璁㈠崟鐘舵��",
                  "浣跨敤璧峰鏃堕棿", "鎴鏃堕棿","棰嗗彇鏃堕棿"
         };
         for (int i = 0; i < headers.length; i++) {
@@ -355,9 +355,33 @@
             }
             row.createCell(6).setCellValue(couponTypeDesc);
 
-
+            //7.璁㈠崟鐘舵��
+            String orderStatusType = dto.getOrderStatus();
+            System.out.println(orderStatusType);
+            String orderStatusDesc;
+            if ("UNPAID".equals(orderStatusType)) {
+                orderStatusDesc = "鏈粯娆�";
+            } else if ("PAID".equals(orderStatusType)) {
+                orderStatusDesc = "宸蹭粯娆�";
+            }else if ("UNDELIVERED".equals(orderStatusType)) {
+                orderStatusDesc = "寰呭彂璐�";
+            }else if ("DELIVERED".equals(orderStatusType)) {
+                orderStatusDesc = "宸插彂璐�";
+            }else if ("COMPLETED".equals(orderStatusType)) {
+                orderStatusDesc = "宸插畬鎴�";
+            }else if ("STAY_PICKED_UP".equals(orderStatusType)) {
+                orderStatusDesc = "寰呰嚜鎻�";
+            }else if ("TAKE".equals(orderStatusType)) {
+                orderStatusDesc = "寰呮牳楠�";
+            }else if ("CANCELLED".equals(orderStatusType)) {
+                orderStatusDesc = "宸插叧闂�";
+            }else {
+                orderStatusDesc ="鏈煡";
+            }
+            Cell orderStatus = row.createCell(7);
+            orderStatus.setCellValue(orderStatusDesc);
             // 10. 浣跨敤璧峰鏃堕棿锛堝鐞唍ull锛屾牸寮忓寲鏃堕棿锛�
-            Cell startTimeCell = row.createCell(7);
+            Cell startTimeCell = row.createCell(8);
             if (Objects.nonNull(dto.getStartTime())) {
                 startTimeCell.setCellValue(DateUtil.formatDateTime(dto.getStartTime()));
             } else {
@@ -365,13 +389,13 @@
             }
 
             // 11. 鎴鏃堕棿锛堝悓涓婏級
-            Cell endTimeCell = row.createCell(8);
+            Cell endTimeCell = row.createCell(9);
             if (Objects.nonNull(dto.getEndTime())) {
                 endTimeCell.setCellValue(DateUtil.formatDateTime(dto.getEndTime()));
             } else {
                 endTimeCell.setCellValue("");
             }
-            Cell claimTimeCell = row.createCell(9);
+            Cell claimTimeCell = row.createCell(10);
             if (Objects.nonNull(dto.getClaimTime())) {
                 endTimeCell.setCellValue(DateUtil.formatDateTime(dto.getClaimTime()));
             } else {
diff --git a/framework/src/main/java/cn/lili/modules/order/order/entity/dto/StoreCouponClaimRecordDTO.java b/framework/src/main/java/cn/lili/modules/order/order/entity/dto/StoreCouponClaimRecordDTO.java
index b1f9b75..94a5a21 100644
--- a/framework/src/main/java/cn/lili/modules/order/order/entity/dto/StoreCouponClaimRecordDTO.java
+++ b/framework/src/main/java/cn/lili/modules/order/order/entity/dto/StoreCouponClaimRecordDTO.java
@@ -98,4 +98,6 @@
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date claimTime;
+
+    private String orderStatus;
 }
diff --git a/framework/src/main/resources/mapper/lmk/StoreCouponClaimRecordMapper.xml b/framework/src/main/resources/mapper/lmk/StoreCouponClaimRecordMapper.xml
index d5d9b94..4f8091b 100644
--- a/framework/src/main/resources/mapper/lmk/StoreCouponClaimRecordMapper.xml
+++ b/framework/src/main/resources/mapper/lmk/StoreCouponClaimRecordMapper.xml
@@ -53,6 +53,8 @@
         <result column="user_id" property="userId"/>
         <result column="coupon_name" property="couponName"/>
         <result column="claimTime" property="claimTime"/>
+        <result column="order_status" property="orderStatus"/>
+
     </resultMap>
 
     <select id="getPage" resultMap="BaseResultMapByManager">
@@ -75,14 +77,18 @@
         lsccr.user_id,
         lsccr.coupon_name,
         lsccr.create_time AS claimTime,
-        lsccr.coupon_id
+        lsccr.coupon_id,
+        lo.order_status
         FROM
         lmk_store_coupon_claim_record lsccr
         INNER JOIN
         li_member_coupon lmc ON lmc.id = lsccr.member_coupon_id
+        LEFT JOIN li_order lo ON lo.use_platform_member_coupon_id = lmc.id AND lo.delete_flag = 0
         WHERE
         lmc.delete_flag = 0
         AND lsccr.delete_flag = 0
+        AND lmc.member_id = lsccr.user_id
+
         <!-- 1. 浼氬憳鍚嶇О妯$硦鏌ヨ锛堝叧鑱攍i_member_coupon琛級 -->
         <if test="query.memberName != null and query.memberName != ''">
             AND lmc.member_name LIKE CONCAT('%', #{query.memberName}, '%')
@@ -131,15 +137,19 @@
         lsccr.user_id,
         lsccr.coupon_name,
         lsccr.create_time AS claimTime,
-        lsccr.coupon_id
+        lsccr.coupon_id,
+        lo.order_status
         FROM
         lmk_store_coupon_claim_record lsccr
         INNER JOIN
         li_member_coupon lmc ON lmc.id = lsccr.member_coupon_id
+        LEFT JOIN li_order lo ON lo.use_platform_member_coupon_id = lmc.id AND lo.delete_flag = 0
+
         WHERE
         lmc.delete_flag = 0
         AND lsccr.delete_flag = 0
         AND lmc.member_id = lsccr.user_id
+
         <!-- 1. 浼氬憳鍚嶇О妯$硦鏌ヨ锛堝叧鑱攍i_member_coupon琛級 -->
         <if test="query.memberName != null and query.memberName != ''">
             AND lmc.member_name LIKE CONCAT('%', #{query.memberName}, '%')

--
Gitblit v1.8.0