From 34cd76ac611c3422b3ab467c5b29d8476f266032 Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期三, 01 十月 2025 16:44:01 +0800 Subject: [PATCH] 更新 --- framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponClaimRecordServiceImpl.java | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 40 insertions(+), 7 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 ddcc7c1..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,8 +212,12 @@ 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) @@ -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