|
|
|
@@ -2,7 +2,15 @@ package com.iformall.service.impl; |
|
|
|
|
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
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.EnumCouponType; |
|
|
|
import com.iformall.enums.EnumSpuSyncStatus; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.service.*; |
|
|
|
import org.slf4j.Logger; |
|
|
|
@@ -17,6 +25,10 @@ public class WxCouponMallServiceImpl implements WxCouponMallService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCouponMallMapper wxCouponMallMapper; |
|
|
|
@Autowired |
|
|
|
TtCouponChannelPoiMapper ttCouponChannelPoiMapper; |
|
|
|
@Autowired |
|
|
|
WxCouponChannelMapper wxCouponChannelMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<WxCouponMall> list(WxCouponMall wxCouponMall){ |
|
|
|
@@ -28,4 +40,40 @@ public class WxCouponMallServiceImpl implements WxCouponMallService { |
|
|
|
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMallMapper.findList(record)); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void finised(String tenantId, Long couponId, String mallTenantId) { |
|
|
|
WxCouponMall couponMall = new WxCouponMall(); |
|
|
|
couponMall.setTenantId(tenantId); |
|
|
|
couponMall.setMallTenantId(mallTenantId); |
|
|
|
couponMall.setProductId(couponId); |
|
|
|
couponMall.setStatus(EnumCouponMallStatus.FINISED.getCode()); |
|
|
|
wxCouponMallMapper.updateStatus(couponMall); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void unfinised(String tenantId, Long couponId,Integer couponType, String mallTenantId) throws Exception{ |
|
|
|
//抖音平台查询的是未提交抖音审核的,微信是未上架的 |
|
|
|
EnumAppPlat plat = EnumCouponType.getAppPlat(couponType); |
|
|
|
if (plat == EnumAppPlat.TOUTIAO) { |
|
|
|
TtCouponChannelPoi poi = ttCouponChannelPoiMapper.selectById(tenantId, 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.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); |
|
|
|
List<WxCouponChannel> clist = wxCouponChannelMapper.findList(couponChannel); |
|
|
|
if (null != clist && clist.size() > 0 ) { |
|
|
|
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"券已投放且上架,无法修改。"); |
|
|
|
} |
|
|
|
} |
|
|
|
WxCouponMall couponMall = new WxCouponMall(); |
|
|
|
couponMall.setTenantId(tenantId); |
|
|
|
couponMall.setMallTenantId(mallTenantId); |
|
|
|
couponMall.setProductId(couponId); |
|
|
|
couponMall.setStatus(EnumCouponMallStatus.UNFINISED.getCode()); |
|
|
|
wxCouponMallMapper.updateStatus(couponMall); |
|
|
|
} |
|
|
|
|
|
|
|
} |