From 5c67ffa649378a06b01f78bf42c768517b42eaf6 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期五, 10 一月 2025 18:31:08 +0800 Subject: [PATCH] bug修改 --- manage/src/main/java/com/jilongda/manage/controller/TCouponController.java | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/manage/src/main/java/com/jilongda/manage/controller/TCouponController.java b/manage/src/main/java/com/jilongda/manage/controller/TCouponController.java index 28ac072..e7715b0 100644 --- a/manage/src/main/java/com/jilongda/manage/controller/TCouponController.java +++ b/manage/src/main/java/com/jilongda/manage/controller/TCouponController.java @@ -93,6 +93,7 @@ } tCouponReceive.setAmountCondition(dto.getAmountCondition()); tCouponReceive.setStatus(1); + tCouponReceive.setCouponName(dto.getName()); tCouponReceives.add(tCouponReceive); } couponReceiveService.saveBatch(tCouponReceives); @@ -104,7 +105,7 @@ TCouponReceive tCouponReceive = new TCouponReceive(); tCouponReceive.setCouponId(dto.getId()); tCouponReceive.setUserId(userId); - tCouponReceive.setType(2); + tCouponReceive.setType(3); tCouponReceive.setAmount(dto.getAmount()); tCouponReceive.setStoreId(dto.getStoreId()); if (dto.getTime()!=0){ @@ -112,6 +113,7 @@ } tCouponReceive.setAmountCondition(dto.getAmountCondition()); tCouponReceive.setStatus(1); + tCouponReceive.setCouponName(dto.getName()); tCouponReceives1.add(tCouponReceive); } couponReceiveService.saveBatch(tCouponReceives1); @@ -123,7 +125,8 @@ String s = OssUploadUtil.ossUpload("eyes/", blueFile); dto.setQrCode(s); couponService.updateById(dto); - break; + return ApiResult.success(s); + } return ApiResult.success(); } @@ -154,9 +157,18 @@ .eq(TCouponReceive::getCouponId, id) .eq(TCouponReceive::getStatus, 2)).size(); tCouponInfoVO.setUseCount(size1); - + if (byId.getType()==3){ + // 查询领取人 + List<Integer> collect = couponReceiveService.lambdaQuery() + .eq(TCouponReceive::getCouponId, id).list() + .stream().map(TCouponReceive::getUserId) + .distinct() + .collect(Collectors.toList()); + tCouponInfoVO.setUserIds(collect); + } return ApiResult.success(tCouponInfoVO); } + public static MultipartFile convert(BufferedImage bufferedImage, String fileName) throws IOException { // 将 BufferedImage 转换为字节数组 ByteArrayOutputStream baos = new ByteArrayOutputStream(); -- Gitblit v1.7.1