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
6ffcf0af
Commit
6ffcf0af
authored
Aug 10, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改人员学习
parent
d150e0a6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
27 deletions
+23
-27
study-manager/pom.xml
study-manager/pom.xml
+1
-19
study-manager/src/main/java/com/mortals/xhx/module/study/service/impl/StudyStatServiceImpl.java
...s/xhx/module/study/service/impl/StudyStatServiceImpl.java
+21
-7
study-manager/src/main/java/com/mortals/xhx/module/study/web/StudyStatController.java
...com/mortals/xhx/module/study/web/StudyStatController.java
+1
-1
No files found.
study-manager/pom.xml
View file @
6ffcf0af
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<profiles.server.port>
17300
</profiles.server.port>
<profiles.server.port>
17300
</profiles.server.port>
<profiles.server.gatewayport>
11078
</profiles.server.gatewayport>
<profiles.server.gatewayport>
11078
</profiles.server.gatewayport>
<profiles.server.path>
/study
</profiles.server.path>
<profiles.server.path>
/study
</profiles.server.path>
<profiles.nacos.server-addr>
1
92.168.0.48
:8848
</profiles.nacos.server-addr>
<profiles.nacos.server-addr>
1
27.0.0.1
:8848
</profiles.nacos.server-addr>
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.namespace>
smart-gov-cs
</profiles.nacos.namespace>
<profiles.nacos.namespace>
smart-gov-cs
</profiles.nacos.namespace>
<profiles.log.path>
/mortals/app/logs
</profiles.log.path>
<profiles.log.path>
/mortals/app/logs
</profiles.log.path>
...
@@ -70,24 +70,6 @@
...
@@ -70,24 +70,6 @@
</properties>
</properties>
</profile>
</profile>
<profile>
<id>
cs-prod
</id>
<properties>
<profiles.active>
cs-prod
</profiles.active>
<profiles.server.port>
17300
</profiles.server.port>
<profiles.server.gatewayport>
11078
</profiles.server.gatewayport>
<profiles.server.path>
/study
</profiles.server.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.nacos.server-addr>
nacos.scsmile.cn:80
</profiles.nacos.server-addr>
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.namespace>
smart-gov-cs
</profiles.nacos.namespace>
<profiles.log.path>
/home/mortals/app/logs
</profiles.log.path>
<profiles.log.level>
INFO
</profiles.log.level>
<package.environment>
test
</package.environment>
<skipUi>
false
</skipUi>
</properties>
</profile>
<profile>
<profile>
<id>
chuanshan-prod
</id>
<id>
chuanshan-prod
</id>
<properties>
<properties>
...
...
study-manager/src/main/java/com/mortals/xhx/module/study/service/impl/StudyStatServiceImpl.java
View file @
6ffcf0af
...
@@ -59,22 +59,33 @@ public class StudyStatServiceImpl extends AbstractCRUDServiceImpl<StudyStatDao,
...
@@ -59,22 +59,33 @@ public class StudyStatServiceImpl extends AbstractCRUDServiceImpl<StudyStatDao,
}
}
}));
}));
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
List
<
Map
<
String
,
Integer
>>
dayList
=
new
ArrayList
<>();
for
(
int
i
=
7
;
i
>
0
;
i
--)
{
for
(
int
i
=
7
;
i
>
0
;
i
--)
{
String
beforeDay
=
DateUtil
.
offsetDay
(
new
Date
(),
-
i
).
toString
();
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
String
beforeDay
=
DateUtil
.
offsetDay
(
new
Date
(),
-
i
).
toDateStr
();
if
(
collect
.
containsKey
(
beforeDay
))
{
if
(
collect
.
containsKey
(
beforeDay
))
{
map
.
put
(
beforeDay
,
collect
.
getOrDefault
(
beforeDay
,
new
ArrayList
<>()).
size
());
map
.
put
(
beforeDay
,
collect
.
getOrDefault
(
beforeDay
,
new
ArrayList
<>()).
size
());
}
else
{
}
else
{
map
.
put
(
beforeDay
,
0
);
map
.
put
(
beforeDay
,
0
);
}
}
dayList
.
add
(
map
);
}
}
model
.
put
(
"day
Trend"
,
map
);
model
.
put
(
"day
List"
,
dayList
);
//首页统计。
//首页统计。
//统计学些类型占比
//统计学些类型占比
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
,
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
);
}
});
model
.
put
(
"studyTypeStat"
,
studyTypeStat
);
model
.
put
(
"studyTypeStat"
,
studyTypeStat
);
//学习量前
//学习量前
...
@@ -85,11 +96,14 @@ public class StudyStatServiceImpl extends AbstractCRUDServiceImpl<StudyStatDao,
...
@@ -85,11 +96,14 @@ public class StudyStatServiceImpl extends AbstractCRUDServiceImpl<StudyStatDao,
int
count
=
projectStudyService
.
count
(
projectStudyQuery
,
context
);
int
count
=
projectStudyService
.
count
(
projectStudyQuery
,
context
);
projectEntity
.
setStudyPersonCount
(
count
);
projectEntity
.
setStudyPersonCount
(
count
);
}
}
List
<
Map
<
String
,
String
>>
leaderList
=
projectEntities
.
stream
()
List
<
ProjectEntity
>
leaderList
=
projectEntities
.
stream
()
.
sorted
(
Comparator
.
comparing
(
ProjectEntity:
:
getStudyPersonCount
,
Comparator
.
reverseOrder
()))
.
sorted
(
Comparator
.
comparing
(
ProjectEntity:
:
getStudyPersonCount
,
Comparator
.
reverseOrder
()))
.
limit
(
5
).
collect
(
Collectors
.
toList
());
.
limit
(
5
).
map
(
item
->{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"title"
,
item
.
getTitle
());
map
.
put
(
"count"
,
item
.
getStudyPersonCount
().
toString
());
return
map
;
}).
collect
(
Collectors
.
toList
());
model
.
put
(
"leaderList"
,
leaderList
);
model
.
put
(
"leaderList"
,
leaderList
);
}
}
...
...
study-manager/src/main/java/com/mortals/xhx/module/study/web/StudyStatController.java
View file @
6ffcf0af
...
@@ -50,7 +50,7 @@ public class StudyStatController extends BaseCRUDJsonBodyMappingController<Study
...
@@ -50,7 +50,7 @@ public class StudyStatController extends BaseCRUDJsonBodyMappingController<Study
/**
/**
* 首页统计
* 首页统计
*/
*/
@
Pos
tMapping
(
value
=
"index"
)
@
Ge
tMapping
(
value
=
"index"
)
@UnAuth
@UnAuth
public
String
indexStat
()
{
public
String
indexStat
()
{
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
...
...
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