Browse Source

//coupon

release_toaliyun_real
xhxu 3 years ago
parent
commit
a52ed85b01
2 changed files with 20 additions and 15 deletions
  1. +19
    -14
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  2. +1
    -1
      mallinkService/src/main/resources/mapper/WxCouponMerchantMapper.xml

+ 19
- 14
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java View File

@@ -366,7 +366,7 @@ public class WxCouponServiceImpl implements WxCouponService {
return null;
}

List<WxMerchantVo> merchantList = getMerchantVoList(wxCouponCVo, wxCouponCVo.getId(), wxCouponCVo.getType());
List<WxMerchantVo> merchantList = getMerchantVoList(wxCouponCVo, mallTenantEntity, wxCouponCVo.getId(), wxCouponCVo.getType());

wxCouponCVo.setMerchantVoList(merchantList);
if(EnumCouponType.COUPON_GIFT.getCode().equals(wxCouponCVo.getType())){
@@ -382,21 +382,26 @@ public class WxCouponServiceImpl implements WxCouponService {
return wxCouponCVo;
}

private List<WxMerchantVo> getMerchantVoList(TenantEntity couponTenant,Long couponId,Integer couponType){
if (EnumCouponType.isParentCoupon(couponType)){
WxCouponMall couponMall = new WxCouponMall();
couponMall.updateTenantInfo(couponTenant);
couponMall.setProductId(couponId);
couponMall.setStatus(EnumCouponMallStatus.FINISED.getCode());
List<WxCouponMall> couponMallList = wxCouponMallMapper.findList(couponMall);
List<WxMerchantVo> merchantVoList = new ArrayList<>();
if (null != couponMallList && couponMallList.size()> 0 ) {
for (WxCouponMall cm:couponMallList) {
WxMall mall = wxMallMapper.getByTenantId(cm.getMallTenantId());
merchantVoList.addAll(getCouponMerchantList(couponId, mall));
private List<WxMerchantVo> getMerchantVoList(TenantEntity couponTenant,TenantEntity mallTenant,Long couponId,Integer couponType){
if (EnumCouponType.isParentCoupon(couponType) && couponTenant.getTenantId().equals(mallTenant)){
//集团查券 查询所有门店
if(couponTenant.getTenantId().equals(mallTenant.getTenantId())){
WxCouponMall couponMall = new WxCouponMall();
couponMall.updateTenantInfo(couponTenant);
couponMall.setProductId(couponId);
List<WxCouponMall> couponMallList = wxCouponMallMapper.findList(couponMall);
List<WxMerchantVo> merchantVoList = new ArrayList<>();
if (null != couponMallList && couponMallList.size()> 0 ) {
for (WxCouponMall cm:couponMallList) {
WxMall mall = wxMallMapper.getByTenantId(cm.getMallTenantId());
merchantVoList.addAll(getCouponMerchantList(couponId, mall));
}
}
return merchantVoList;
//子广场查券 只查询自己广场的门店
}else{
return getCouponMerchantList(couponId,mallTenant);
}
return merchantVoList;
}else{
return getCouponMerchantList(couponId,couponTenant);
}


+ 1
- 1
mallinkService/src/main/resources/mapper/WxCouponMerchantMapper.xml View File

@@ -14,7 +14,7 @@
</resultMap>
<sql id="allColumns">
`id`,`product_id`,`merchant_id`,`parameter`,`create_date`,`update_date`,`status`
`id`,`tenant_id`,`parent_tenant_id`,`product_id`,`merchant_id`,`parameter`,`create_date`,`update_date`,`status`
</sql>

<sql id="dynamicWhereConditions">


Loading…
Cancel
Save