From ec3af40f1d5f420e9b9dea1be6fcd786a5e5e092 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 5 Jan 2022 09:14:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bweb/controller/HighCouponAgentController.java | 2 ++ .../com/cweb/controller/HighCouponAgentController.java | 2 +- .../hai/service/impl/HighCouponAgentServiceImpl.java | 10 ++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java b/hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java index 94d9f79f..78ac2dab 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java @@ -292,6 +292,7 @@ public class HighCouponAgentController { @ResponseBody @ApiOperation(value = "根据代理商和卡券 查询分配的销售码") public ResponseData getCodeListByAgentCoupon(@RequestParam(name = "couponId", required = true) Long couponId, + @RequestParam(name = "type", required = true) Integer type, @RequestParam(name = "status", required = false) String status, @RequestParam(name = "createTimeS", required = false) Long createTimeS, @RequestParam(name = "createTimeE", required = false) Long createTimeE, @@ -309,6 +310,7 @@ public class HighCouponAgentController { Map map = new HashMap<>(); map.put("agentId", userInfoModel.getHighAgent().getId()); + map.put("type", type); map.put("couponId", couponId); map.put("status", status); map.put("createTimeS", createTimeS); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighCouponAgentController.java b/hai-cweb/src/main/java/com/cweb/controller/HighCouponAgentController.java index 099a751a..5645137b 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighCouponAgentController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighCouponAgentController.java @@ -60,7 +60,7 @@ public class HighCouponAgentController { log.error("HighCouponAgentController -> queryConvertCode() error!","无效的兑换码"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无效的兑换码"); } - if (convertCode.getStatus() != 1) { + if (convertCode.getStatus() == 3) { log.error("HighCouponAgentController -> queryConvertCode() error!","兑换码已被使用"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "兑换码已被使用"); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java index d9c312de..89e1dd80 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java @@ -99,6 +99,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { highCouponCodeService.updateCouponCode(code); highCouponAgentCode = new HighCouponAgentCode(); + highCouponAgentCode.setType(highCouponAgentRel.getType()); highCouponAgentCode.setCouponAgentId(highCouponAgentRel.getId()); highCouponAgentCode.setCouponAgentRecordId(record.getId()); highCouponAgentCode.setCouponId(code.getCouponId()); @@ -118,6 +119,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { HighCouponAgentCode highCouponAgentCode; for (int i = 0; i < stockCount; i++) { highCouponAgentCode = new HighCouponAgentCode(); + highCouponAgentCode.setType(highCouponAgentRel.getType()); highCouponAgentCode.setCouponAgentId(highCouponAgentRel.getId()); highCouponAgentCode.setCouponAgentRecordId(record.getId()); highCouponAgentCode.setCouponId(highCoupon.getId()); @@ -127,7 +129,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { highCouponAgentCode.setCreateTime(new Date()); highCouponAgentCode.setOperatorId(highCouponAgentRel.getOperatorId()); highCouponAgentCode.setOperatorName(highCouponAgentRel.getOperatorName()); - highCouponAgentCodeMapper.insert(highCouponAgentCode); + highCouponAgentCodeMapper.insert(highCouponAgentCode); } } } @@ -179,6 +181,10 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { criteria.andCouponAgentIdEqualTo(MapUtils.getLong(map, "couponAgentId")); } + if (MapUtils.getInteger(map, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(map, "type")); + } + if (MapUtils.getLong(map, "couponId") != null) { criteria.andCouponIdEqualTo(MapUtils.getLong(map, "couponId")); } @@ -373,7 +379,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { if (convertCode == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无效的兑换码"); } - if (convertCode.getStatus() != 1) { + if (convertCode.getStatus() == 3) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "兑换码已被使用"); } // 查询未销售的卡券