|
@@ -70,6 +70,9 @@ public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements I
|
|
if(StringUtils.isNotBlank(param.getEmail())){
|
|
if(StringUtils.isNotBlank(param.getEmail())){
|
|
wrapper.like(User::getEmail,param.getEmail());
|
|
wrapper.like(User::getEmail,param.getEmail());
|
|
}
|
|
}
|
|
|
|
+ if(StringUtils.isNotBlank(param.getNickName())){
|
|
|
|
+ wrapper.like(User::getNickName,param.getNickName());
|
|
|
|
+ }
|
|
wrapper.orderByDesc(User::getCreateTime);
|
|
wrapper.orderByDesc(User::getCreateTime);
|
|
Page<User> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
|
|
Page<User> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
|
|
List<User> records = page.getRecords();
|
|
List<User> records = page.getRecords();
|
|
@@ -102,49 +105,17 @@ public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements I
|
|
|
|
|
|
private List<UserVo> getUserVo(List<User> userList){
|
|
private List<UserVo> getUserVo(List<User> userList){
|
|
List<UserVo> voList = new ArrayList<>();
|
|
List<UserVo> voList = new ArrayList<>();
|
|
|
|
+ Set<Long> collect = voList.stream().map(UserVo::getId).collect(Collectors.toSet());
|
|
|
|
+ HashMap<Long, JyUser> mapByUserIds = jyUserService.getMapByUserIds(collect);
|
|
if(userList.size() >0){
|
|
if(userList.size() >0){
|
|
- List<Long> userIdList = userList.parallelStream().map(User::getId).collect(Collectors.toList());
|
|
|
|
- Set<Long> sysUserIds = userList.stream().map(User::getSysUserId).collect(Collectors.toSet());
|
|
|
|
- HashMap<Long, SysUser> sysMap = sysUserService.getByIds(sysUserIds);
|
|
|
|
-
|
|
|
|
- HashMap<Long,Long> incrementCountMap = userIncrementService.getValidCountGroupByUserId(userIdList);
|
|
|
|
- HashMap<Long,Long> cameraCountMap = cameraDetailService.getCountGroupByUserId(userIdList);
|
|
|
|
- HashMap<Long,Long> sceneCountMap = sceneService.getCountGroupByUserId(userIdList);
|
|
|
|
- HashMap<Long,Long> sceneProCountMap = sceneProService.getCountGroupByUserId(userIdList,0);
|
|
|
|
- HashMap<Long,Long> scenePlusCountMap = scenePlusService.getCountGroupByUserId(userIdList,0);
|
|
|
|
- // HashMap<Long,Long> sceneProCountObjMap = sceneProService.getCountGroupByUserId(userIdList,1);
|
|
|
|
- // HashMap<Long,Long> scenePlusCountObjMap = scenePlusService.getCountGroupByUserId(userIdList,1);
|
|
|
|
-
|
|
|
|
for (User user :userList) {
|
|
for (User user :userList) {
|
|
- long incrementCount = incrementCountMap.get(user.getId()) == null ? 0 : incrementCountMap.get(user.getId());
|
|
|
|
- long cameraCount = cameraCountMap.get(user.getId()) == null ? 0 : cameraCountMap.get(user.getId());
|
|
|
|
- long sceneCount = sceneCountMap.get(user.getId()) == null ? 0 : sceneCountMap.get(user.getId());
|
|
|
|
- long sceneProCount = sceneProCountMap.get(user.getId()) == null ? 0 : sceneProCountMap.get(user.getId());
|
|
|
|
- long scenePlusCount = scenePlusCountMap.get(user.getId()) == null ? 0 : scenePlusCountMap.get(user.getId());
|
|
|
|
- // long sceneProObjCount = sceneProCountObjMap.get(user.getId()) == null ? 0 : sceneProCountObjMap.get(user.getId());
|
|
|
|
- // long scenePlusObjCount = scenePlusCountObjMap.get(user.getId()) == null ? 0 : scenePlusCountObjMap.get(user.getId());
|
|
|
|
-
|
|
|
|
- Long ssNum = 0L;
|
|
|
|
- if(!CacheUtil.uploadType.equals("local")){
|
|
|
|
- SceneParam param = new SceneParam();
|
|
|
|
- param.setUserName(user.getUserName());
|
|
|
|
- PageInfo pageInfo = laserService.pageList(param);
|
|
|
|
- ssNum = pageInfo.getTotal();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
UserVo vo = new UserVo();
|
|
UserVo vo = new UserVo();
|
|
BeanUtils.copyProperties(user,vo);
|
|
BeanUtils.copyProperties(user,vo);
|
|
- vo.setVip(incrementCount > 0 ? 1: 0);
|
|
|
|
- vo.setIncrementCount(incrementCount);
|
|
|
|
- vo.setSurDownNum(user.getDownloadNumTotal() - user.getDownloadNum());
|
|
|
|
- vo.setCameraCount(cameraCount);
|
|
|
|
- vo.setSceneNum(sceneCount + sceneProCount + scenePlusCount + ssNum);
|
|
|
|
- if(user.getSysUserId() != null){
|
|
|
|
- SysUser sysUser = sysMap.get(user.getSysUserId());
|
|
|
|
- if(sysUser != null){
|
|
|
|
- vo.setSysUserName(sysUser.getNickName());
|
|
|
|
- }
|
|
|
|
|
|
+ JyUser jyUser = mapByUserIds.get(user.getId());
|
|
|
|
+ if(jyUser !=null){
|
|
|
|
+ vo.setRyId(jyUser.getRyId());
|
|
}
|
|
}
|
|
|
|
+
|
|
voList.add(vo);
|
|
voList.add(vo);
|
|
}
|
|
}
|
|
}
|
|
}
|