diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java b/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java index 6fde72c8..26dc7bf0 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java @@ -103,7 +103,7 @@ public class HighUserDiscountController { JSONObject jsonObject = JSONObject.parseObject(reqBody); String discountAgentCode = jsonObject.getString("code"); - if (StringUtils.isNotBlank(discountAgentCode)) { + if (StringUtils.isBlank(discountAgentCode)) { log.error("HighDiscountController -> receiveDiscount() error!", "参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java index f7b9360c..2acc324d 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java @@ -137,7 +137,7 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券已达到上线"); } // 查询可分配的优惠券code - List discountAgentCodeList = highDiscountAgentCodeService.getDiscountCodeByDiscountAgentId(discountAgentRel.getId()); + List discountAgentCodeList = highDiscountAgentCodeService.getDiscountCodeByStatus(discountAgentRel.getId(), 1); if (discountAgentCodeList.size() == 0) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券已无库存"); }