|
|
@@ -717,17 +717,19 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
List<UserProjectPair> pairs = fsUserPageListVOS.stream()
|
|
|
.map(user -> new UserProjectPair(user.getUserId(), user.getProjectId()))
|
|
|
.collect(Collectors.toList());
|
|
|
- List<Map<String, Object>> mapList = fsUserMapper.selectLastWatchTimeByUserAndProject(pairs);
|
|
|
Map<Object, Date> watchTimeMap = new HashMap<>();
|
|
|
- if (!CollectionUtils.isEmpty(mapList)) {
|
|
|
- watchTimeMap = mapList.stream()
|
|
|
- .collect(HashMap::new,
|
|
|
- (map, item) -> map.put(
|
|
|
- item.get("userProjectKey"),
|
|
|
- (Date) item.get("lastWatchTime")
|
|
|
- ),
|
|
|
- HashMap::putAll
|
|
|
- );
|
|
|
+ if(CollectionUtils.isNotEmpty(pairs)){
|
|
|
+ List<Map<String, Object>> mapList = fsUserMapper.selectLastWatchTimeByUserAndProject(pairs);
|
|
|
+ if (!CollectionUtils.isEmpty(mapList)) {
|
|
|
+ watchTimeMap = mapList.stream()
|
|
|
+ .collect(HashMap::new,
|
|
|
+ (map, item) -> map.put(
|
|
|
+ item.get("userProjectKey"),
|
|
|
+ (Date) item.get("lastWatchTime")
|
|
|
+ ),
|
|
|
+ HashMap::putAll
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
for (FsUserPageListVO item : fsUserPageListVOS) {
|
|
|
if (item.getCompanyUserId() != null) {
|
|
|
@@ -757,8 +759,7 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
// item.setCourseCountStatus(byUserId.getStatus());
|
|
|
item.setStopWatchDays(byUserId.getStopWatchDays());
|
|
|
item.setCompleteWatchDate(byUserId.getCompleteWatchDate());
|
|
|
-
|
|
|
- item.setLastWatchDate(watchTimeMap.get(item.getUserId() + "_" + item.getProjectId()));
|
|
|
+ item.setLastWatchDate(watchTimeMap.getOrDefault(item.getUserId() + "_" + item.getProjectId(),null));
|
|
|
}
|
|
|
FsUserLastCount fsUserCourseCount = countMap.get(item.getUserId());
|
|
|
if (fsUserCourseCount != null) {
|