Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
site-project
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
site-project
Commits
1a703d3d
Commit
1a703d3d
authored
Feb 26, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
问卷参数统计
parent
bb7477f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
1 deletions
+33
-1
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/EventTrackServiceImpl.java
+33
-1
No files found.
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/EventTrackServiceImpl.java
View file @
1a703d3d
...
@@ -2,6 +2,7 @@ package com.yizhi.site.application.service.impl;
...
@@ -2,6 +2,7 @@ package com.yizhi.site.application.service.impl;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
...
@@ -33,6 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -33,6 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.time.LocalDate
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -289,13 +291,22 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
...
@@ -289,13 +291,22 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
@Override
@Override
public
List
<
EventTrackDeptNumVo
>
queryTgNumByDept
(
Long
typeId
)
{
public
List
<
EventTrackDeptNumVo
>
queryTgNumByDept
(
Long
typeId
)
{
List
<
EventTrackDeptNumVo
>
eventTrackDeptNumVoList
=
this
.
baseMapper
.
queryGropByList
();
List
<
EventTrackDeptNumVo
>
eventTrackDeptNumVoList
=
this
.
baseMapper
.
queryGropByList
();
LocalDate
today
=
LocalDate
.
now
();
List
<
Integer
>
recentMonths
=
new
ArrayList
<>();
// 循环获取最近四个月的月份
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
Integer
month
=
today
.
minusMonths
(
i
).
getMonthValue
();
recentMonths
.
add
(
month
);
}
if
(
CollUtil
.
isNotEmpty
(
eventTrackDeptNumVoList
)){
if
(
CollUtil
.
isNotEmpty
(
eventTrackDeptNumVoList
)){
eventTrackDeptNumVoList
.
stream
().
forEach
(
eventTrackDeptNumVo
->
{
eventTrackDeptNumVoList
.
stream
().
forEach
(
eventTrackDeptNumVo
->
{
List
<
EventTrackTypeNumVo
>
eventTrackTypeNumVoList
=
this
.
baseMapper
.
queryTgNumByDept
(
eventTrackDeptNumVo
.
getDeptName
(),
typeId
);
List
<
EventTrackTypeNumVo
>
eventTrackTypeNumVoList
=
this
.
baseMapper
.
queryTgNumByDept
(
eventTrackDeptNumVo
.
getDeptName
(),
typeId
);
if
(
CollectionUtil
.
isNotEmpty
(
eventTrackTypeNumVoList
)){
if
(
CollectionUtil
.
isNotEmpty
(
eventTrackTypeNumVoList
)){
List
<
EventTrackTypeNumVo
>
voList
=
Lists
.
newArrayList
();
List
<
EventTrackTypeNumVo
>
voList
=
Lists
.
newArrayList
();
eventTrackTypeNumVoList
.
stream
().
forEach
(
numVo
->{
eventTrackTypeNumVoList
.
stream
().
forEach
(
numVo
->{
Optional
<
EventTrackTypeNumVo
>
optional
=
voList
.
stream
().
filter
(
v
->
Objects
.
equals
(
v
.
getType
(),
numVo
.
getType
())).
findFirst
();
Optional
<
EventTrackTypeNumVo
>
optional
=
CollectionUtil
.
isEmpty
(
voList
)?
null
:
voList
.
stream
().
filter
(
v
->
Objects
.
equals
(
v
.
getType
(),
numVo
.
getType
())).
findFirst
();
if
(
optional
!=
null
&&
optional
.
isPresent
()){
if
(
optional
!=
null
&&
optional
.
isPresent
()){
EventTrackTypeNumVo
vo
=
optional
.
get
();
EventTrackTypeNumVo
vo
=
optional
.
get
();
if
(
numVo
.
getNum
()!=
null
)
{
if
(
numVo
.
getNum
()!=
null
)
{
...
@@ -313,8 +324,29 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
...
@@ -313,8 +324,29 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
}
else
{
}
else
{
eventTrackDeptNumVo
.
setEventTrackTypeNumVoList
(
eventTrackTypeNumVoList
);
eventTrackDeptNumVo
.
setEventTrackTypeNumVoList
(
eventTrackTypeNumVoList
);
}
}
eventTrackTypeNumVoList
=
Lists
.
newArrayList
();
for
(
Integer
month:
recentMonths
){
EventTrackTypeNumVo
eventTrackTypeNumVo
=
new
EventTrackTypeNumVo
();
if
(
CollectionUtil
.
isEmpty
(
eventTrackDeptNumVo
.
getEventTrackTypeNumVoList
())){
eventTrackTypeNumVo
.
setNum
(
0
);
eventTrackTypeNumVo
.
setSubType
(
String
.
valueOf
(
month
));
}
else
{
Optional
<
EventTrackTypeNumVo
>
optional
=
eventTrackDeptNumVo
.
getEventTrackTypeNumVoList
().
stream
().
filter
(
e
->
Objects
.
equals
(
Integer
.
valueOf
(
e
.
getSubType
()),
month
)).
findFirst
();
if
(
optional
!=
null
&&
optional
.
isPresent
()){
eventTrackTypeNumVo
=
optional
.
get
();
eventTrackTypeNumVo
.
setSubType
(
Integer
.
valueOf
(
eventTrackTypeNumVo
.
getSubType
()).
toString
());
}
else
{
eventTrackTypeNumVo
.
setNum
(
0
);
eventTrackTypeNumVo
.
setSubType
(
String
.
valueOf
(
month
));
}
}
eventTrackTypeNumVoList
.
add
(
eventTrackTypeNumVo
);
}
eventTrackDeptNumVo
.
setEventTrackTypeNumVoList
(
eventTrackTypeNumVoList
);
});
});
}
}
return
eventTrackDeptNumVoList
;
return
eventTrackDeptNumVoList
;
}
}
...
...
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