From b81c20397b52fd1181b6c71ecb949ef7178b4380 Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 13 Oct 2021 14:47:03 +0800 Subject: [PATCH] update gift --- .../controller/WxCouponController.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java index e61bea376..796c1bf60 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java @@ -80,7 +80,14 @@ public class WxCouponController extends BaseController { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId转换失败" + couponChannelId); } - String key = "cc:" + couponChannelId; + String key = "cc:"; + if(couponChannelIdL > 0){ + key = key + couponChannelIdL; + }else if(couponIdL > 0){ + key = key + couponIdL; + }else{ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空"); + } ValueOperations operations = cdRedisTemplate.opsForValue(); // 缓存 @@ -160,7 +167,14 @@ public class WxCouponController extends BaseController { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId转换失败" + couponChannelId); } - String key = "ch:" + couponChannelId; + String key = "ch:"; + if(couponChannelIdL > 0){ + key = key + couponChannelIdL; + }else if(couponIdL > 0){ + key = key + couponIdL; + }else{ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空"); + } ValueOperations operations = cdRedisTemplate.opsForValue(); // 缓存