From 095c52c6ec7882ce11177178b49d33e6c886af61 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期一, 17 十一月 2025 15:02:38 +0800
Subject: [PATCH] 添加已完成标识
---
framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponClaimRecordServiceImpl.java | 49 +++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 41 insertions(+), 8 deletions(-)
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 08971a4..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
@@ -201,7 +201,6 @@
storeCouponSingle.setClaimStatus(ClaimStatusEnum.CLAIM.name());
storeCouponSingle.setClaimUserId(userId);
storeCouponSingle.setClaimUserName(nickName);
- storeCouponSingleService.updateById(storeCouponSingle);
//鏍¢獙鏄惁鍦ㄥ崟鍝佸嵎绫婚鍙栬繃
LambdaQueryWrapper<StoreCoupon> storeCoupQuery = Wrappers.<StoreCoupon>lambdaQuery()
.eq(StoreCoupon::getId, storeCouponSingle.getStoreCoupRef()).last("FOR UPDATE");
@@ -213,12 +212,16 @@
throw new ServiceException("褰撳墠搴楅摵浼樻儬鍗风姸鎬佸紓甯�");
}
//棰嗗彇瀵瑰簲鐨勪紭鎯犲嵎鍐欏叆璁板綍
- memberCouponService.receiveCoupon(storeCouponSingle.getCouponId(),userId , nickName);
+ MemberCoupon memberCoupon = memberCouponService.receiveCoupon(storeCouponSingle.getCouponId(), userId, nickName);
+ String memberCouponId = memberCoupon.getId();
+ storeCouponSingle.setMemberCouponId(memberCouponId);
+ storeCouponSingleService.updateById(storeCouponSingle);
StoreCouponClaimRecord storeCouponClaimRecord = getStoreCouponClaimRecord(storeCouponSingle, userId);
+ storeCouponClaimRecord.setMemberCouponId(memberCouponId);
this.save(storeCouponClaimRecord);
LambdaUpdateWrapper<StoreCoupon> updateStoreCoupon = Wrappers.<StoreCoupon>lambdaUpdate().eq(StoreCoupon::getId, storeCoupon.getId())
.set(StoreCoupon::getCouponClaimNum, storeCoupon.getCouponClaimNum() + 1)
- .gt(StoreCoupon::getCouponClaimNum, storeCoupon.getCouponClaimNum() + 1);
+ .ge(StoreCoupon::getCouponNum, storeCoupon.getCouponClaimNum() + 1);
boolean update = storeCouponService.update(updateStoreCoupon);
if (!update) {
throw new ServiceException("鏇存柊澶辫触");
@@ -263,8 +266,8 @@
Row header = sheet.createRow(0);
String[] headers = {
"浼氬憳鍚嶇О", "浼樻儬鍒稿悕绉�", "鍙戝竷搴楅摵", "闈㈤/鎶樻墸",
- "鑾峰彇鏂瑰紡", "浼氬憳浼樻儬鍒哥姸鎬�", "浼樻儬鍒哥被鍨�",
- "浣跨敤璧峰鏃堕棿", "鎴鏃堕棿"
+ "鑾峰彇鏂瑰紡", "浼氬憳浼樻儬鍒哥姸鎬�", "浼樻儬鍒哥被鍨�","璁㈠崟鐘舵��",
+ "浣跨敤璧峰鏃堕棿", "鎴鏃堕棿","棰嗗彇鏃堕棿"
};
for (int i = 0; i < headers.length; i++) {
Cell cell = header.createCell(i);
@@ -352,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 {
@@ -362,12 +389,18 @@
}
// 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(10);
+ if (Objects.nonNull(dto.getClaimTime())) {
+ endTimeCell.setCellValue(DateUtil.formatDateTime(dto.getClaimTime()));
+ } else {
+ claimTimeCell.setCellValue("");
+ }
}
return workbook;
--
Gitblit v1.8.0