| | |
| | | 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"); |
| | |
| | | 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) |
| | |
| | | String[] headers = { |
| | | "会员名称", "优惠券名称", "发布店铺", "面额/折扣", |
| | | "获取方式", "会员优惠券状态", "优惠券类型", |
| | | "使用起始时间", "截止时间" |
| | | "使用起始时间", "截止时间","领取时间" |
| | | }; |
| | | for (int i = 0; i < headers.length; i++) { |
| | | Cell cell = header.createCell(i); |
| | |
| | | } else { |
| | | endTimeCell.setCellValue(""); |
| | | } |
| | | Cell claimTimeCell = row.createCell(9); |
| | | if (Objects.nonNull(dto.getClaimTime())) { |
| | | endTimeCell.setCellValue(DateUtil.formatDateTime(dto.getClaimTime())); |
| | | } else { |
| | | claimTimeCell.setCellValue(""); |
| | | } |
| | | } |
| | | |
| | | return workbook; |