|
|
|
@ -351,25 +351,18 @@ public class StorePromotionDataService {
|
|
|
|
|
//获取token
|
|
|
|
|
String token = mainService.getAccessToken();
|
|
|
|
|
WxCpExternalContactService externalContactService = mainService.getExternalContactService();
|
|
|
|
|
List<String> cpUserIds = externalContactService.listFollowUser();
|
|
|
|
|
cpUserIds.forEach(cpUserId -> {
|
|
|
|
|
List<PrivilageCpUserDO> privilageCpUserDOS = privilageCpUserDOMapper.selectList(null);
|
|
|
|
|
privilageCpUserDOS.forEach(privilageCpUserDO -> {
|
|
|
|
|
// 返回
|
|
|
|
|
try {
|
|
|
|
|
Long storeId = privilageCpUserStoreDOMapper.selectOneByCpUserId(cpUserId);
|
|
|
|
|
Long storeId = privilageCpUserStoreDOMapper.selectOneByCpUserId(privilageCpUserDO.getCpUserId());
|
|
|
|
|
Long regionId = null;
|
|
|
|
|
if (storeId == null){
|
|
|
|
|
QueryWrapper<PrivilageCpUserDO> cpUserQw = new QueryWrapper<>();
|
|
|
|
|
cpUserQw.eq("cpUserId",cpUserId).last("limit 1");
|
|
|
|
|
PrivilageCpUserDO privilageCpUserDO = privilageCpUserDOMapper.selectOne(cpUserQw);
|
|
|
|
|
if (privilageCpUserDO != null){
|
|
|
|
|
regionId = privilageCpUserDO.getId();
|
|
|
|
|
}else {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
regionId = privilageCpUserDO.getId();
|
|
|
|
|
}
|
|
|
|
|
WxCusInfoReqDO wxCusInfoReqDO = new WxCusInfoReqDO();
|
|
|
|
|
wxCusInfoReqDO.setAccess_token(token);
|
|
|
|
|
wxCusInfoReqDO.setUserid(cpUserId);
|
|
|
|
|
wxCusInfoReqDO.setUserid(privilageCpUserDO.getCpUserId());
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
//todo 分开写便于同步历史数据 最大跨度30天 最久当天往前180天 上线时改为System.currentTimeMillis()
|
|
|
|
|
wxCusInfoReqDO.setStart_time(startDate.getTime() / 1000);
|
|
|
|
|