|
|
|
@@ -1,12 +1,18 @@ |
|
|
|
package com.iformall.schedule; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.iformall.domain.po.WxCouponChannel; |
|
|
|
import com.iformall.domain.po.WxGame; |
|
|
|
import com.iformall.domain.po.WxMall; |
|
|
|
import com.iformall.domain.vo.WxCouponCVo; |
|
|
|
import com.iformall.domain.vo.WxCouponChannelVo; |
|
|
|
import com.iformall.enums.EnumCouponChannelStatus; |
|
|
|
import com.iformall.enums.EnumCouponChannelType; |
|
|
|
import com.iformall.enums.EnumGameStatus; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.utils.Constant; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@@ -17,6 +23,8 @@ import org.springframework.transaction.annotation.Propagation; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
@Component |
|
|
|
public class CouponExpiringSchedule { |
|
|
|
@@ -126,6 +134,20 @@ public class CouponExpiringSchedule { |
|
|
|
List<WxGame> list = wxGameMapper.findList(wxGame); |
|
|
|
if (null != list && list.size() > 0 ) { |
|
|
|
list.stream().forEach(g->{ |
|
|
|
JSONArray couponChannelIds = JSON.parseArray(g.getCouponIds()); |
|
|
|
boolean isCreditFlag = false; |
|
|
|
for(int i = 0; i<couponChannelIds.size();i++) { |
|
|
|
JSONObject couponChanObj = (JSONObject) couponChannelIds.get(i); |
|
|
|
Integer prizeType = couponChanObj.getInteger("prizeType"); |
|
|
|
if(prizeType != null && prizeType == Constant.creditPlayType){ |
|
|
|
isCreditFlag = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if(isCreditFlag){ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
WxCouponChannel couponChannel = new WxCouponChannel(); |
|
|
|
couponChannel.updateTenantInfo(g); |
|
|
|
couponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_GAME.getCode()); |
|
|
|
|