|
|
|
@ -13,6 +13,7 @@ import com.kiisoo.ic.store.entity.WxCusInfoReqDO;
|
|
|
|
|
import com.kiisoo.ic.store.entity.WxCusInfoRespDO;
|
|
|
|
|
import com.kiisoo.ic.store.mapper.PrivilageCpUserStoreDOMapper;
|
|
|
|
|
import com.kiisoo.ic.store.mapper.StorePromotionDataDOMapper;
|
|
|
|
|
import com.kiisoo.ic.utils.DateUtils;
|
|
|
|
|
import com.lmax.disruptor.WorkHandler;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import me.chanjar.weixin.common.error.WxErrorException;
|
|
|
|
@ -56,8 +57,11 @@ public class BehaviorDTOMessageGroupConsumer implements WorkHandler<BehaviorDTOM
|
|
|
|
|
if (storeId == null){
|
|
|
|
|
QueryWrapper<PrivilageCpUserDO> qw = new QueryWrapper<>();
|
|
|
|
|
qw.eq("cp_user_id",cpUserId).last("limit 1");
|
|
|
|
|
PrivilageCpUserDO privilageCpUserDO = privilageCpUserDOMapper.selectOne(qw);
|
|
|
|
|
if (privilageCpUserDO != null){
|
|
|
|
|
regionId = privilageCpUserDOMapper.selectOne(qw).getId();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WxCusInfoReqDO wxCusInfoReqDO = new WxCusInfoReqDO();
|
|
|
|
|
wxCusInfoReqDO.setAccess_token(wxCpService.getAccessToken());
|
|
|
|
@ -65,7 +69,7 @@ public class BehaviorDTOMessageGroupConsumer implements WorkHandler<BehaviorDTOM
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
//todo 分开写便于同步历史数据 最大跨度30天 最久当天往前180天 上线时改为System.currentTimeMillis()
|
|
|
|
|
wxCusInfoReqDO.setStart_time(statDate.getTime() / 1000);
|
|
|
|
|
wxCusInfoReqDO.setEnd_time(statDate.getTime() / 1000);
|
|
|
|
|
wxCusInfoReqDO.setEnd_time(DateUtils.addDay(statDate,1).getTime() / 1000);
|
|
|
|
|
WxCusInfoRespDO wxCusInfoRespDO = getWxCusInfo(wxCusInfoReqDO);
|
|
|
|
|
if (wxCusInfoRespDO == null) {
|
|
|
|
|
return;
|
|
|
|
|