Sfoglia il codice sorgente

//coupon

release_toaliyun_real
xhxu 3 anni fa
parent
commit
a52ed85b01
2 ha cambiato i file con 20 aggiunte e 15 eliminazioni
  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 Vedi File

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


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


wxCouponCVo.setMerchantVoList(merchantList); wxCouponCVo.setMerchantVoList(merchantList);
if(EnumCouponType.COUPON_GIFT.getCode().equals(wxCouponCVo.getType())){ if(EnumCouponType.COUPON_GIFT.getCode().equals(wxCouponCVo.getType())){
@@ -382,21 +382,26 @@ public class WxCouponServiceImpl implements WxCouponService {
return wxCouponCVo; 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{ }else{
return getCouponMerchantList(couponId,couponTenant); return getCouponMerchantList(couponId,couponTenant);
} }


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

@@ -14,7 +14,7 @@
</resultMap> </resultMap>
<sql id="allColumns"> <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>


<sql id="dynamicWhereConditions"> <sql id="dynamicWhereConditions">


Caricamento…
Annulla
Salva