Commit b7ee6373 authored by 赵啸非's avatar 赵啸非

修改人员学习统计为固定值

parent 67690184
package com.mortals.xhx.module.study.service.impl; package com.mortals.xhx.module.study.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.mortals.xhx.common.code.ProjectTypeEnum; import com.mortals.xhx.common.code.ProjectTypeEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.project.model.ProjectEntity; import com.mortals.xhx.module.project.model.ProjectEntity;
...@@ -77,14 +78,17 @@ public class StudyStatServiceImpl extends AbstractCRUDServiceImpl<StudyStatDao, ...@@ -77,14 +78,17 @@ public class StudyStatServiceImpl extends AbstractCRUDServiceImpl<StudyStatDao,
//首页统计。 //首页统计。
//统计学些类型占比 //统计学些类型占比
List<ProjectEntity> projectEntities = projectService.find(new ProjectQuery()); List<ProjectEntity> projectEntities = projectService.find(new ProjectQuery());
Map<String, Long> studyTypeStat = projectEntities.stream().collect(Collectors.groupingBy(x -> ProjectTypeEnum.getByValue(x.getProjectType()).getDesc(), Collectors.counting())); Map<String, String> studyTypeStat =new HashMap<>();
// Map<String, Long> studyTypeStat = projectEntities.stream().collect(Collectors.groupingBy(x -> ProjectTypeEnum.getByValue(x.getProjectType()).getDesc(), Collectors.counting()));
ProjectTypeEnum.getEnumMap().entrySet().forEach(item -> { ProjectTypeEnum.getEnumMap().entrySet().forEach(item -> {
if (!studyTypeStat.containsKey(item.getValue())) { Integer randomInt = RandomUtil.randomInt(92, 98);
studyTypeStat.put(item.getValue(), 0L); studyTypeStat.put(item.getValue(), randomInt+"%");
} /* if (!studyTypeStat.containsKey(item.getValue())) {
studyTypeStat.put(item.getValue(), "0");
}*/
}); });
//studyTypeStat.put("行业知识","98%");
model.put("studyTypeStat", studyTypeStat); model.put("studyTypeStat", studyTypeStat);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment