|
|
@@ -677,9 +677,9 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
public List<PtUserAccountVo> getUserAccountVoByDay(Date startDate) {
|
|
|
// 获取指定天数内有更新账户信息的
|
|
|
Date date = new Date();
|
|
|
- // 新增的账户和修改的账户
|
|
|
+ // 1.新增的账户
|
|
|
LambdaQueryWrapper<PtUserAccount> between1 = Wrappers.lambdaQuery(PtUserAccount.class)
|
|
|
- .between(PtUserAccount::getCreateTime, startDate, date).or().between(PtUserAccount::getUpdateTime, startDate, date);
|
|
|
+ .between(PtUserAccount::getCreateTime, startDate, date);
|
|
|
// .eq(PtUserAccount::getAccountStatus, UserAccountStatusEnum.IS_OPEN.code());
|
|
|
List<PtUserAccountVo> increaseList = baseMapper.selectVoList(between1);
|
|
|
|
|
|
@@ -688,14 +688,14 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
rs.addAll(increaseList);
|
|
|
}
|
|
|
|
|
|
- // 查询账户删除的
|
|
|
+ // 2.查询账户删除的
|
|
|
List<PtUserAccountVo> deleteAccounts = baseMapper.getUserAccountByDateScope(startDate, date, DELETED);
|
|
|
if(CollectionUtil.isNotEmpty(deleteAccounts)){
|
|
|
rs.addAll(deleteAccounts);
|
|
|
}
|
|
|
|
|
|
|
|
|
- // 更新人脸的
|
|
|
+ // 3.更新人脸的
|
|
|
//排除 全量同步的数据
|
|
|
LambdaQueryWrapper<PtUserAccount> between = Wrappers.lambdaQuery(PtUserAccount.class)
|
|
|
// .ne(PtUserAccount::getUpdateBy, FULL_SYNC_ADMIN)
|
|
|
@@ -713,10 +713,10 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
rs.addAll(updatePhotos);
|
|
|
}
|
|
|
|
|
|
- // 更新卡片的 卡片有可能是注销的
|
|
|
+ // 4.更新卡片的 卡片有可能是注销的
|
|
|
List<PtCardVo> cardVos = ptCardService.getList(startDate, date);
|
|
|
cardVos = cardVos.stream().filter(e -> e.getFactoryId() != 0L).toList();
|
|
|
- List<Long> userIds = cardVos.stream().map(PtCardVo::getUserId).toList();
|
|
|
+ List<Long> userIds = cardVos.stream().map(PtCardVo::getUserId).distinct().toList();
|
|
|
if (CollectionUtil.isNotEmpty(userIds)) {
|
|
|
LambdaQueryWrapper<PtUserAccount> in = Wrappers.lambdaQuery(PtUserAccount.class).in(PtUserAccount::getUserId, userIds);
|
|
|
List<PtUserAccountVo> userAccountVos1 = baseMapper.selectVoList(in);
|
|
|
@@ -727,8 +727,10 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
PtUserAccountVo userAccountVo = collect.get(userId);
|
|
|
// 没有对应的用户账户userAccountVo==null 说明 这个账号被删除了
|
|
|
if (userAccountVo != null) {
|
|
|
- userAccountVo.setCard(x);
|
|
|
- userAccountVoList.add(userAccountVo);
|
|
|
+ // 复制一个新对象
|
|
|
+ PtUserAccountVo newObject = BeanUtil.copyProperties(userAccountVo, PtUserAccountVo.class);
|
|
|
+ newObject.setCard(x);
|
|
|
+ userAccountVoList.add(newObject);
|
|
|
}
|
|
|
});
|
|
|
rs.addAll(userAccountVoList);
|