|
|
@@ -55,10 +55,7 @@ import com.fs.his.service.IFsUserIntegralLogsService;
|
|
|
import com.fs.his.service.IFsUserProjectTagService;
|
|
|
import com.fs.his.service.IFsUserWxService;
|
|
|
import com.fs.his.utils.PhoneUtil;
|
|
|
-import com.fs.his.vo.FsUserVO;
|
|
|
-import com.fs.his.vo.FsUserExportListVO;
|
|
|
-import com.fs.his.vo.FsUserFollowDoctorVO;
|
|
|
-import com.fs.his.vo.UserVo;
|
|
|
+import com.fs.his.vo.*;
|
|
|
import com.fs.im.config.ImTypeConfig;
|
|
|
import com.fs.im.service.OpenIMService;
|
|
|
import com.fs.hisStore.domain.FsStoreOrderScrm;
|
|
|
@@ -1626,4 +1623,40 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
public List<FsUser> selectUserListByUserIds(List<Long> userIds) {
|
|
|
return fsUserMapper.selectUserListByUserIds(userIds);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<FsUserVO> selectStatisticsList(FsUser fsUser) {
|
|
|
+ // 查询会员
|
|
|
+ List<FsUserVO> list = fsUserMapper.selectStatisticsList(fsUser);
|
|
|
+ if (list == null || list.isEmpty()) {
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Long> userIds = list.stream().map(FsUserVO::getUserId).collect(Collectors.toList());
|
|
|
+ if (userIds.isEmpty()) {
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 将数据以userid为key放入map中
|
|
|
+ List<FsUserWatchDaysStatVO> watchNum = fsUserMapper.selectWatchDaysStatByUserIds(fsUser.getCompanyId(), userIds);
|
|
|
+ Map<Long, FsUserWatchDaysStatVO> map = new HashMap<>();
|
|
|
+ if (watchNum != null) {
|
|
|
+ for (FsUserWatchDaysStatVO s : watchNum) {
|
|
|
+ if (s != null && s.getUserId() != null) {
|
|
|
+ map.put(s.getUserId(), s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ list.stream()
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .filter(vo -> vo.getUserId() != null)
|
|
|
+ .forEach(vo -> {
|
|
|
+ FsUserWatchDaysStatVO s = map.get(vo.getUserId());
|
|
|
+ vo.setWatchDaysLast3(s == null || s.getWatchDaysLast3() == null ? 0 : s.getWatchDaysLast3());
|
|
|
+ vo.setWatchDaysLast5(s == null || s.getWatchDaysLast5() == null ? 0 : s.getWatchDaysLast5());
|
|
|
+ vo.setWatchDaysLast7(s == null || s.getWatchDaysLast7() == null ? 0 : s.getWatchDaysLast7());
|
|
|
+ });
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|