Просмотр исходного кода

Merge branch 'release_toaliyun_real_202211' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real_202211

release_toaliyun_real
xhxu 3 лет назад
Родитель
Сommit
00c3e8ed09
3 измененных файлов: 41 добавлений и 2 удалений
  1. +37
    -1
      mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java
  2. +3
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/util/CouponCacheUtils.java

+ 37
- 1
mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java Просмотреть файл

@@ -317,7 +317,7 @@ public class WxCouponController extends BaseController {
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) {
volist = couponService.getCouponMerchantList(getTenantInfo(), couponChannel.getCouponId());
if (null != volist && volist.size() > 0 ) {
@@ -327,6 +327,42 @@ public class WxCouponController extends BaseController {
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
@ApiOperation("根据id(couponChannel)查询接口")


+ 3
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java Просмотреть файл

@@ -1869,6 +1869,9 @@ public class WxCouponServiceImpl implements WxCouponService {
for (Long mid:wxCoupon.getMerchantIds()) {
//开通了支付宝就可以
WxProfitSharingReceiver receiver = payShareServie.getReceiver(payAccount, mid, null, payMchType.getCode());
if (null == receiver) {
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"商户"+mid+"未设置收款账户");
}
if (MerchantImportStatus.improt_success.getCode().equals(receiver.getAlipayImportStatus())) {
merchantAutoShareMap.put(mid, true);
}else {


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/util/CouponCacheUtils.java Просмотреть файл

@@ -59,7 +59,7 @@ public class CouponCacheUtils {
public static Map<String,List<WxMerchantVo>> getCouponMerchantCache(RedisTemplate<String, Object> template,Long couponId) {
String key = "couponMerchantNew:"+couponId;
return (Map<String, List<WxMerchantVo>>) RedisCacheUtils.getCacheListObject(template, key,Map.class);
return (Map<String, List<WxMerchantVo>>) RedisCacheUtils.getCacheMap(template, key);
}
public static void removeDouyinLivePageCache(RedisTemplate<String, Object> template,String tenantId,Integer targetAd,Integer bussiness) {


Загрузка…
Отмена
Сохранить