Przeglądaj źródła

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

release_toaliyun_real
xhxu 3 lat temu
rodzic
commit
126b54b9a3
2 zmienionych plików z 39 dodań i 6 usunięć
  1. +2
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java
  2. +37
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java

+ 2
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java Wyświetl plik

@@ -3,6 +3,7 @@ package com.iformall.controller.market;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo;
import com.iformall.annotation.SystemControllerLog;
import com.iformall.annotation.TenantIgnore;
import com.iformall.common.ErrorCode;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
@@ -128,6 +129,7 @@ public class WxCouponChannelController extends BaseController {
return new ResultData(Result.SUCCESS, "查询成功", wxCouponChannelService.getById(id,getTenantInfo().getTenantId()));
}

@TenantIgnore
@ApiOperation("批量新增")
@PostMapping("/addbatch")
@SystemControllerLog(description = "券投放-批量新增")


+ 37
- 6
mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java Wyświetl plik

@@ -96,6 +96,9 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
@Autowired
private WxProfitSharingReceiverMapper wxProfitSharingReceiverMapper;
@Autowired
private WxCouponMallMapper wxCouponMallMapper;
/**
* B端业务端
* @param record
@@ -596,11 +599,39 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {

private boolean isCouponMerchantValid(Long couponId,TenantEntity tenantEntity) {
List<WxMerchantVo> merchantVoList = wxMerchantService.findMerchantListByProduct(tenantEntity,couponId,false);
if (merchantVoList.stream().anyMatch((cm->cm.getMerchantStatus().equals(EnumMerchantStatus.VALID.getCode())))){
return true;
}
private boolean isCouponMerchantValid(Long couponId,Integer couponType,TenantEntity couponTenantEntity) {
if (EnumCouponType.isParentCoupon(couponType)) {
WxCouponMall couponMall = new WxCouponMall();
couponMall.updateTenantInfo(couponTenantEntity);
couponMall.setProductId(couponId);
couponMall.setStatus(EnumCouponMallStatus.FINISED.getCode()) ;
List<WxCouponMall> couponMallList = wxCouponMallMapper.findList(couponMall);
if (null == couponMallList ) {
return false;
}
for (int i = 0 ; i < couponMallList.size(); i++) {
WxCouponMall wcm = couponMallList.get(i);
TenantEntity mallTenantEntity = new TenantEntity();
mallTenantEntity.setTenantId(wcm.getMallTenantId());
mallTenantEntity.setParentTenantId(couponTenantEntity.getTenantId());
List<WxMerchantVo> merchantVoList = wxMerchantService.findMerchantListByProduct(mallTenantEntity,couponId,false);
if (null != merchantVoList && merchantVoList.size() > 0 ) {
if (merchantVoList.stream().anyMatch((cm->cm.getMerchantStatus().equals(EnumMerchantStatus.VALID.getCode())))){
return true;
}
}
}
return false;
}else {
List<WxMerchantVo> merchantVoList = wxMerchantService.findMerchantListByProduct(couponTenantEntity,couponId,false);
if (null == merchantVoList || merchantVoList.size() <=0 ) {
return false;
}
if (merchantVoList.stream().anyMatch((cm->cm.getMerchantStatus().equals(EnumMerchantStatus.VALID.getCode())))){
return true;
}
}
return false;
}

@@ -653,7 +684,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
}

if(!EnumCouponType.COUPON_GIFT.getCode().equals(wxCoupon.getType())
&& !isCouponMerchantValid(wxCoupon.getId(),wxCoupon)) {
&& !isCouponMerchantValid(wxCoupon.getId(),wxCoupon.getType(),wxCoupon)) {
logger.debug(wxCoupon.getId()+couponid+ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage());
vo.toCouponChannnelVo(wxCoupon,channelId);
vo.setErrorMsg(ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage());


Ładowanie…
Anuluj
Zapisz