Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
study-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
study-platform
Commits
b7ee6373
Commit
b7ee6373
authored
Nov 21, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改人员学习统计为固定值
parent
67690184
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
study-manager/src/main/java/com/mortals/xhx/module/study/service/impl/StudyStatServiceImpl.java
...s/xhx/module/study/service/impl/StudyStatServiceImpl.java
+9
-5
No files found.
study-manager/src/main/java/com/mortals/xhx/module/study/service/impl/StudyStatServiceImpl.java
View file @
b7ee6373
package
com.mortals.xhx.module.study.service.impl
;
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.YesNoEnum
;
import
com.mortals.xhx.module.project.model.ProjectEntity
;
...
...
@@ -77,14 +78,17 @@ public class StudyStatServiceImpl extends AbstractCRUDServiceImpl<StudyStatDao,
//首页统计。
//统计学些类型占比
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
->
{
if
(!
studyTypeStat
.
containsKey
(
item
.
getValue
()))
{
studyTypeStat
.
put
(
item
.
getValue
(),
0L
);
}
Integer
randomInt
=
RandomUtil
.
randomInt
(
92
,
98
);
studyTypeStat
.
put
(
item
.
getValue
(),
randomInt
+
"%"
);
/* if (!studyTypeStat.containsKey(item.getValue())) {
studyTypeStat.put(item.getValue(), "0");
}*/
});
//studyTypeStat.put("行业知识","98%");
model
.
put
(
"studyTypeStat"
,
studyTypeStat
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment