|
|
@@ -50,8 +50,7 @@ public class SyncUserDataScheduledService {
|
|
|
* 定义一个按一定频率执行的定时任务 每天三点执行一次 更新同步用户
|
|
|
* 本地生活
|
|
|
*/
|
|
|
-// @Scheduled(cron = "0 0 3 * * ?")
|
|
|
- @PostConstruct
|
|
|
+ @Scheduled(cron = "0 0 3 * * ?")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void syncUserDataScheduled() {
|
|
|
try {
|
|
|
@@ -62,7 +61,7 @@ public class SyncUserDataScheduledService {
|
|
|
}
|
|
|
log.info("同步本地生活用户 start ==================================");
|
|
|
LocalAppUserDto localAppUserDto = new LocalAppUserDto();
|
|
|
-// this.setDate(localAppUserDto);
|
|
|
+ this.setDate(localAppUserDto);
|
|
|
Date now = new Date();
|
|
|
// 查询本地生活 所有的用户 条件 普通用户 创建时间
|
|
|
List<LocalAppUserVo> localAppUserList = localAppUserService.selectUserList(localAppUserDto);
|
|
|
@@ -116,7 +115,7 @@ public class SyncUserDataScheduledService {
|
|
|
log.info("同步本地生活用户 end ==================================");
|
|
|
log.info("同步晋掌柜用户 start ==================================");
|
|
|
SysUserJzgDto sysUserDto = new SysUserJzgDto();
|
|
|
-// this.setDate(sysUserDto);
|
|
|
+ this.setDate(sysUserDto);
|
|
|
// 查询本地生活 所有的用户 条件 普通用户 创建时间
|
|
|
List<SysUserJzgVo> sysUserJzgVoList = sysUserJzgService.selectUserList(sysUserDto);
|
|
|
List<SysUserJzgVo> distinctUserList = sysUserJzgVoList.stream()
|
|
|
@@ -181,7 +180,7 @@ public class SyncUserDataScheduledService {
|
|
|
}
|
|
|
log.info("同步本地生活微信用户 start ==================================");
|
|
|
LocalAppUserDto localAppUserDto = new LocalAppUserDto();
|
|
|
-// this.setDate(localAppUserDto);
|
|
|
+ this.setDate(localAppUserDto);
|
|
|
// 查询本地生活 所有的用户 条件 普通用户 创建时间
|
|
|
localAppUserDto.setIsWx(1);
|
|
|
List<LocalAppUserVo> localAppUserList = localAppUserService.selectUserList(localAppUserDto);
|
|
|
@@ -202,7 +201,7 @@ public class SyncUserDataScheduledService {
|
|
|
phoenWrapper.select(WeUser::getId);
|
|
|
phoenWrapper.select(WeUser::getUserCode);
|
|
|
phoenWrapper.select(WeUser::getPhone);
|
|
|
- phoenWrapper.eq(WeUser::getPhone, userPhoneList);
|
|
|
+ phoenWrapper.in(WeUser::getPhone, userPhoneList);
|
|
|
phoenWrapper.eq(WeUser::getSource, 1);
|
|
|
List<WeUser> users = weUserService.list(phoenWrapper);
|
|
|
// 转为 Map,手机号为 key
|
|
|
@@ -239,10 +238,10 @@ public class SyncUserDataScheduledService {
|
|
|
}else{
|
|
|
customerUser.setStatus(0);
|
|
|
}
|
|
|
- customerUser.setWxNickname(localAppUserVo.getWechatNickname());
|
|
|
- customerUser.setWxPhone(localAppUserVo.getPhone());
|
|
|
- customerUser.setWxOpenid(localAppUserVo.getOpenId());
|
|
|
- customerUser.setWxAvatar(localAppUserVo.getWechatHeadPhoto());
|
|
|
+ customerUser.setWxNickname(StringUtils.isNotEmpty(localAppUserVo.getWechatNickname())? localAppUserVo.getWechatNickname(): null);
|
|
|
+ customerUser.setWxPhone(StringUtils.isNotEmpty(localAppUserVo.getPhone())? localAppUserVo.getPhone() : null);
|
|
|
+ customerUser.setWxOpenid(StringUtils.isNotEmpty(localAppUserVo.getOpenId())? localAppUserVo.getOpenId() : null);
|
|
|
+ customerUser.setWxAvatar(StringUtils.isNotEmpty(localAppUserVo.getWechatHeadPhoto())? localAppUserVo.getWechatHeadPhoto(): null);
|
|
|
customerUser.setCreateTime(now);
|
|
|
weCustomerUserList.add(customerUser);
|
|
|
}
|