| @@ -317,7 +317,7 @@ public class WxCouponController extends BaseController { | |||||
| CouponCacheUtils.setCouponChannelCache(redisTemplate, couponChannelIdL, couponChannel); | CouponCacheUtils.setCouponChannelCache(redisTemplate, couponChannelIdL, couponChannel); | ||||
| } | } | ||||
| Map<String,List<WxMerchantVo>> volist = CouponCacheUtils.getCouponMerchantCache(redisTemplate, couponChannel.getId()); | |||||
| Map<String,List<WxMerchantVo>> volist = CouponCacheUtils.getCouponMerchantCache(redisTemplate, couponChannel.getCouponId()); | |||||
| if (null == volist) { | if (null == volist) { | ||||
| volist = couponService.getCouponMerchantList(getTenantInfo(), couponChannel.getCouponId()); | volist = couponService.getCouponMerchantList(getTenantInfo(), couponChannel.getCouponId()); | ||||
| if (null != volist && volist.size() > 0 ) { | if (null != volist && volist.size() > 0 ) { | ||||
| @@ -327,6 +327,42 @@ public class WxCouponController extends BaseController { | |||||
| return new ResultData(volist); | return new ResultData(volist); | ||||
| } | } | ||||
| @TenantIgnore | |||||
| @ApiOperation("根据couponId查询商品商户接口") | |||||
| @GetMapping("/couponMerchantByCouponId") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "couponId", value = "couponId", dataType = "String", paramType = "query", required = true)}) | |||||
| public ResultData couponMerchantByCouponId(String couponId) { | |||||
| if ((StringUtils.isBlank(couponId) || couponId.equalsIgnoreCase(Constant.UNDEFINED)) | |||||
| ) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId为空"); | |||||
| } | |||||
| Long couponIdL = 0L; | |||||
| try { | |||||
| if (StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||||
| couponIdL = Long.valueOf(couponId); | |||||
| } | |||||
| } catch (NumberFormatException e) { | |||||
| logger.error("id转换失败" + couponId); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId转换失败" + couponId); | |||||
| } | |||||
| if(couponIdL <= 0){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId为空"); | |||||
| } | |||||
| Map<String,List<WxMerchantVo>> volist = CouponCacheUtils.getCouponMerchantCache(redisTemplate, couponIdL); | |||||
| if (null == volist) { | |||||
| volist = couponService.getCouponMerchantList(getTenantInfo(), couponIdL); | |||||
| if (null != volist && volist.size() > 0 ) { | |||||
| CouponCacheUtils.setCouponMerchantCache(redisTemplate, couponIdL, volist); | |||||
| } | |||||
| } | |||||
| return new ResultData(volist); | |||||
| } | |||||
| @Deprecated | @Deprecated | ||||
| @ApiOperation("根据id(couponChannel)查询接口") | @ApiOperation("根据id(couponChannel)查询接口") | ||||