From fb7c28b255062e99e7ed0b05534fac11cd11c611 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Fri, 30 Jun 2023 23:21:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/service/impl/OrderCreateHandleServiceImpl.java | 6 ++++++ .../service/impl/HighDiscountAgentCodeServiceImpl.java | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java index 736fd74f..2c9a6ceb 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java @@ -217,6 +217,12 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getString("msg")); } childOrder.setChannelOrderNo(response.getJSONObject("data").getString("rechargeOrderId")); + } else if (coupon.getCouponSource().equals(5)) { + // 重庆中石油业务状态 + SecConfig cqCnpcStatus = secConfigService.findByCodeType("CQ_CNPC_STATUS_" + coupon.getCouponKey()); + if (cqCnpcStatus != null && StringUtils.isNotBlank(cqCnpcStatus.getCodeValue())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, cqCnpcStatus.getCodeValue()); + } } // 校验优惠券是否可用 如果使用优惠券就只能使用卡券的原价 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java index ac863337..96342a80 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java @@ -78,6 +78,9 @@ public class HighDiscountAgentCodeServiceImpl implements HighDiscountAgentCodeSe @Resource private RedisTemplate redisTemplate; + @Resource + private SecConfigService secConfigService; + @Override public void insertCodeList(List discountAgentCodeList) { highDiscountAgentCodeMapper.insertListCode(discountAgentCodeList); @@ -258,6 +261,11 @@ public class HighDiscountAgentCodeServiceImpl implements HighDiscountAgentCodeSe if (couponList.size() == 0) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券未配置重庆中石油卡券"); } + // 重庆中石油业务状态 + SecConfig cqCnpcStatus = secConfigService.findByCodeType("CQ_CNPC_STATUS_" + couponList.get(0).getHighCoupon().getCouponKey()); + if (cqCnpcStatus != null && StringUtils.isNotBlank(cqCnpcStatus.getCodeValue())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, cqCnpcStatus.getCodeValue()); + } String tradeId = discountAgentCode.getId()+""+System.currentTimeMillis()+""; // 预发码 JSONObject preSendCoupon = ChongQingCNPCService.preSendCoupon(couponList.get(0).getHighCoupon().getCouponKey(), tradeId, 1, userModel.getHighUser().getPhone());