Browse Source

fix bug

release_toaliyun_real
lin 3 years ago
parent
commit
8a316d8669
3 changed files with 22 additions and 8 deletions
  1. +1
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  2. +2
    -2
      mallinkService/src/main/java/com/iformall/service/WxCouponMallService.java
  3. +19
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponMallServiceImpl.java

+ 1
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java View File

@@ -615,6 +615,7 @@ public class WxCouponController extends BaseController {
return new ResultData(wxCouponMallService.list(wxCouponMall,true));
}
@TenantIgnore
@ApiOperation("平台券商场列表")
@GetMapping("/getCouponMall")
@ApiImplicitParams({


+ 2
- 2
mallinkService/src/main/java/com/iformall/service/WxCouponMallService.java View File

@@ -25,7 +25,7 @@ public interface WxCouponMallService {
List<WxCouponMall> list(WxCouponMall wxCouponMall,boolean queryMall);
List<Long> listCouponIds(WxCouponMall wxCouponMall);
void finised(String tenantId,Long couponId,String mallTenantId);
void unfinised(String tenantId, Long couponId,Integer couponType, String mallTenantId) throws Exception;
void finised(String couponTenantId,Long couponId,String mallTenantId);
void unfinised(String couponTenantId, Long couponId,Integer couponType, String mallTenantId) throws Exception;
}

+ 19
- 6
mallinkService/src/main/java/com/iformall/service/impl/WxCouponMallServiceImpl.java View File

@@ -8,6 +8,7 @@ import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumAppPlat;
import com.iformall.enums.EnumCouponChannelStatus;
import com.iformall.enums.EnumCouponMallStatus;
import com.iformall.enums.EnumCouponMerchantStatus;
import com.iformall.enums.EnumCouponType;
import com.iformall.enums.EnumSpuSyncStatus;
import com.iformall.exception.MallinkException;
@@ -31,6 +32,8 @@ public class WxCouponMallServiceImpl implements WxCouponMallService {
WxCouponChannelMapper wxCouponChannelMapper;
@Autowired
WxMallMapper wxMallMapper;
@Autowired
WxCouponMerchantMapper wxCouponMerchantMapper;

@Override
public List<WxCouponMall> list(WxCouponMall wxCouponMall,boolean queryMall){
@@ -72,9 +75,19 @@ public class WxCouponMallServiceImpl implements WxCouponMallService {
}

@Override
public void finised(String tenantId, Long couponId, String mallTenantId) {
public void finised(String couponTenantId, Long couponId, String mallTenantId) {
//查询商户设置了没有
WxCouponMerchant cmParam = new WxCouponMerchant();
cmParam.setTenantId(mallTenantId);
cmParam.setProductId(couponId);
cmParam.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode());
List<WxCouponMerchant> merchantList = wxCouponMerchantMapper.findList(cmParam);
if (null == merchantList || merchantList.size() <= 0 ) {
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"未设置有效商户");
}
WxCouponMall couponMall = new WxCouponMall();
couponMall.setTenantId(tenantId);
couponMall.setTenantId(couponTenantId);
couponMall.setMallTenantId(mallTenantId);
couponMall.setProductId(couponId);
couponMall.setStatus(EnumCouponMallStatus.FINISED.getCode());
@@ -82,17 +95,17 @@ public class WxCouponMallServiceImpl implements WxCouponMallService {
}

@Override
public void unfinised(String tenantId, Long couponId,Integer couponType, String mallTenantId) throws Exception{
public void unfinised(String couponTenantId, Long couponId,Integer couponType, String mallTenantId) throws Exception{
//抖音平台查询的是未提交抖音审核的,微信是未上架的
EnumAppPlat plat = EnumCouponType.getAppPlat(couponType);
if (plat == EnumAppPlat.TOUTIAO) {
TtCouponChannelPoi poi = ttCouponChannelPoiMapper.selectById(tenantId, couponId);
TtCouponChannelPoi poi = ttCouponChannelPoiMapper.selectById(couponTenantId, couponId);
if (null != poi &&( EnumSpuSyncStatus.isValid(poi.getLastStatus()))) {
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"券已在抖音审核流程中,无法修改。");
}
}else if (plat == EnumAppPlat.WX) {
WxCouponChannel couponChannel = new WxCouponChannel();
couponChannel.setTenantId(tenantId);
couponChannel.setTenantId(couponTenantId);
couponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode());
List<WxCouponChannel> clist = wxCouponChannelMapper.findList(couponChannel);
if (null != clist && clist.size() > 0 ) {
@@ -100,7 +113,7 @@ public class WxCouponMallServiceImpl implements WxCouponMallService {
}
}
WxCouponMall couponMall = new WxCouponMall();
couponMall.setTenantId(tenantId);
couponMall.setTenantId(couponTenantId);
couponMall.setMallTenantId(mallTenantId);
couponMall.setProductId(couponId);
couponMall.setStatus(EnumCouponMallStatus.UNFINISED.getCode());


Loading…
Cancel
Save