|
@@ -82,6 +82,7 @@ import com.fs.store.param.h5.FsUserPageListParam;
|
|
|
import com.fs.store.param.h5.UserStatisticsCommonParam;
|
|
import com.fs.store.param.h5.UserStatisticsCommonParam;
|
|
|
import com.fs.store.service.cache.IFsUserCourseCountCacheService;
|
|
import com.fs.store.service.cache.IFsUserCourseCountCacheService;
|
|
|
import com.fs.store.vo.FsUserLastCount;
|
|
import com.fs.store.vo.FsUserLastCount;
|
|
|
|
|
+import com.fs.store.vo.UserProjectPair;
|
|
|
import com.fs.store.vo.h5.*;
|
|
import com.fs.store.vo.h5.*;
|
|
|
import com.fs.system.mapper.SysDictDataMapper;
|
|
import com.fs.system.mapper.SysDictDataMapper;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
@@ -256,9 +257,9 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
} else {
|
|
} else {
|
|
|
fsUser.setPhone(null);
|
|
fsUser.setPhone(null);
|
|
|
}
|
|
}
|
|
|
- if (ObjectUtils.isNotEmpty(fsUser.getLevel())&&fsUser.getLevel().equals(1)){
|
|
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(fsUser.getLevel()) && fsUser.getLevel().equals(1)) {
|
|
|
fsUser.setIsShow(1);
|
|
fsUser.setIsShow(1);
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
fsUser.setIsShow(0);
|
|
fsUser.setIsShow(0);
|
|
|
}
|
|
}
|
|
|
return fsUserMapper.updateFsUser(fsUser);
|
|
return fsUserMapper.updateFsUser(fsUser);
|
|
@@ -291,6 +292,7 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 列表查询
|
|
* 列表查询
|
|
|
|
|
+ *
|
|
|
* @param fsUser
|
|
* @param fsUser
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -301,6 +303,7 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 导出用户列表
|
|
* 导出用户列表
|
|
|
|
|
+ *
|
|
|
* @param fsUser
|
|
* @param fsUser
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -628,11 +631,11 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//解密
|
|
//解密
|
|
|
- if(fsUserPageListVO.getPhone() != null && fsUserPageListVO.getPhone() != ""){
|
|
|
|
|
- if(param.getIsHidePhoneMiddle()){
|
|
|
|
|
- if (fsUserPageListVO.getPhone().length()>11){
|
|
|
|
|
|
|
+ if (fsUserPageListVO.getPhone() != null && fsUserPageListVO.getPhone() != "") {
|
|
|
|
|
+ if (param.getIsHidePhoneMiddle()) {
|
|
|
|
|
+ if (fsUserPageListVO.getPhone().length() > 11) {
|
|
|
fsUserPageListVO.setPhone(decryptPhoneMk(fsUserPageListVO.getPhone()));
|
|
fsUserPageListVO.setPhone(decryptPhoneMk(fsUserPageListVO.getPhone()));
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
fsUserPageListVO.setPhone(fsUserPageListVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
fsUserPageListVO.setPhone(fsUserPageListVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
@@ -711,6 +714,21 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
}
|
|
}
|
|
|
Map<Long, FsUserLastCount> countMap = fsUserCourseCounts.stream().collect(Collectors.toMap(FsUserLastCount::getUserId, Function.identity()));
|
|
Map<Long, FsUserLastCount> countMap = fsUserCourseCounts.stream().collect(Collectors.toMap(FsUserLastCount::getUserId, Function.identity()));
|
|
|
|
|
|
|
|
|
|
+ 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
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
for (FsUserPageListVO item : fsUserPageListVOS) {
|
|
for (FsUserPageListVO item : fsUserPageListVOS) {
|
|
|
if (item.getCompanyUserId() != null) {
|
|
if (item.getCompanyUserId() != null) {
|
|
|
String companyUserName = companyUserCacheService.selectCompanyUserNameUserById(item.getCompanyUserId());
|
|
String companyUserName = companyUserCacheService.selectCompanyUserNameUserById(item.getCompanyUserId());
|
|
@@ -739,7 +757,8 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
// item.setCourseCountStatus(byUserId.getStatus());
|
|
// item.setCourseCountStatus(byUserId.getStatus());
|
|
|
item.setStopWatchDays(byUserId.getStopWatchDays());
|
|
item.setStopWatchDays(byUserId.getStopWatchDays());
|
|
|
item.setCompleteWatchDate(byUserId.getCompleteWatchDate());
|
|
item.setCompleteWatchDate(byUserId.getCompleteWatchDate());
|
|
|
- item.setLastWatchDate(byUserId.getLastWatchDate());
|
|
|
|
|
|
|
+
|
|
|
|
|
+ item.setLastWatchDate(watchTimeMap.get(item.getUserId() + "_" + item.getProjectId()));
|
|
|
}
|
|
}
|
|
|
FsUserLastCount fsUserCourseCount = countMap.get(item.getUserId());
|
|
FsUserLastCount fsUserCourseCount = countMap.get(item.getUserId());
|
|
|
if (fsUserCourseCount != null) {
|
|
if (fsUserCourseCount != null) {
|
|
@@ -927,7 +946,7 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
|
|
|
|
|
|
|
|
|
|
FsUserSummaryCountVO fsUserSummaryCountVO = fsUserMapper.countUserSummary(userId, companyId);
|
|
FsUserSummaryCountVO fsUserSummaryCountVO = fsUserMapper.countUserSummary(userId, companyId);
|
|
|
- long start3 =System.currentTimeMillis();
|
|
|
|
|
|
|
+ long start3 = System.currentTimeMillis();
|
|
|
logger.info("countTag 执行耗时: {}ms", start3 - start2);
|
|
logger.info("countTag 执行耗时: {}ms", start3 - start2);
|
|
|
List<FsUserSummaryCountTagVO> countTagList = fsUserMapper.countTag(userId, companyId);
|
|
List<FsUserSummaryCountTagVO> countTagList = fsUserMapper.countTag(userId, companyId);
|
|
|
fsUserSummaryCountVO.setTagList(countTagList);
|
|
fsUserSummaryCountVO.setTagList(countTagList);
|
|
@@ -1181,7 +1200,7 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
// 与im账号绑定
|
|
// 与im账号绑定
|
|
|
- if (ImTypeConfig.IMTYPE== ImTypeEnum.OPENIM){
|
|
|
|
|
|
|
+ if (ImTypeConfig.IMTYPE == ImTypeEnum.OPENIM) {
|
|
|
openIMService.checkAndImportFriend(param.getCompanyUserId(), String.valueOf(param.getUserId()));
|
|
openIMService.checkAndImportFriend(param.getCompanyUserId(), String.valueOf(param.getUserId()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1274,8 +1293,8 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
@Override
|
|
@Override
|
|
|
public List<FsUserVO> selectFsUserVOListByProjectNew(FsUser fsUser) {
|
|
public List<FsUserVO> selectFsUserVOListByProjectNew(FsUser fsUser) {
|
|
|
|
|
|
|
|
- List<FsUserVO> list=fsUserMapper.selectFsUserVOListByProjectNew(fsUser);
|
|
|
|
|
- if(list!=null && !list.isEmpty()){
|
|
|
|
|
|
|
+ List<FsUserVO> list = fsUserMapper.selectFsUserVOListByProjectNew(fsUser);
|
|
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
// 查询看课数和最后看课时间
|
|
// 查询看课数和最后看课时间
|
|
|
Set<Long> userIds = list.stream().map(FsUserVO::getUserId).collect(Collectors.toSet());
|
|
Set<Long> userIds = list.stream().map(FsUserVO::getUserId).collect(Collectors.toSet());
|
|
|
List<FsUserCourseCount> fsUserCourseCounts = fsUserCourseCountMapper.selectUserLastCountList(userIds);
|
|
List<FsUserCourseCount> fsUserCourseCounts = fsUserCourseCountMapper.selectUserLastCountList(userIds);
|
|
@@ -1323,7 +1342,7 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
|
|
|
|
|
// 判断是否是管理员
|
|
// 判断是否是管理员
|
|
|
CompanyUser companyUser = companyUserMapper.selectCompanyUserById(param.getUserId());
|
|
CompanyUser companyUser = companyUserMapper.selectCompanyUserById(param.getUserId());
|
|
|
- if (companyUser != null && companyUser.isAdmin()){
|
|
|
|
|
|
|
+ if (companyUser != null && companyUser.isAdmin()) {
|
|
|
param.setUserId(0L);
|
|
param.setUserId(0L);
|
|
|
param.setCompanyId(companyUser.getCompanyId());
|
|
param.setCompanyId(companyUser.getCompanyId());
|
|
|
}
|
|
}
|
|
@@ -1394,14 +1413,12 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
private FsUserStatisticsVO getUserStatisticsNew(UserStatisticsCommonParam param) {
|
|
private FsUserStatisticsVO getUserStatisticsNew(UserStatisticsCommonParam param) {
|
|
|
FsUserStatisticsVO fsUserStatisticsVO = new FsUserStatisticsVO();
|
|
FsUserStatisticsVO fsUserStatisticsVO = new FsUserStatisticsVO();
|
|
|
|
|
|
|
|
// 判断是否是管理员
|
|
// 判断是否是管理员
|
|
|
CompanyUser companyUser = companyUserMapper.selectCompanyUserById(param.getUserId());
|
|
CompanyUser companyUser = companyUserMapper.selectCompanyUserById(param.getUserId());
|
|
|
- if (companyUser != null && companyUser.isAdmin()){
|
|
|
|
|
|
|
+ if (companyUser != null && companyUser.isAdmin()) {
|
|
|
param.setUserId(0L);
|
|
param.setUserId(0L);
|
|
|
param.setCompanyId(companyUser.getCompanyId());
|
|
param.setCompanyId(companyUser.getCompanyId());
|
|
|
}
|
|
}
|
|
@@ -1573,7 +1590,6 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void increaseIntegral(List<Long> userIds, Long scoreAmount) {
|
|
public void increaseIntegral(List<Long> userIds, Long scoreAmount) {
|
|
|
fsUserMapper.incrIntegral(userIds, scoreAmount);
|
|
fsUserMapper.incrIntegral(userIds, scoreAmount);
|