| | |
| | | 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("更新失败"); |
| | |
| | | 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; |