Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
8e716824
Commit
8e716824
authored
Oct 17, 2023
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.赋码只记录场站的
parent
5bb11ac7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
23 deletions
+22
-23
PersonYardTimeTask.java
...oot/module/jxiop/biz/service/impl/PersonYardTimeTask.java
+22
-23
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PersonYardTimeTask.java
View file @
8e716824
...
...
@@ -168,31 +168,30 @@ public class PersonYardTimeTask {
}
// @Scheduled(cron = "0 55 23 1/1 * ? ")
@Scheduled
(
cron
=
"0 0/30 * * * ? "
)
@Scheduled
(
cron
=
"0 0/30 * * * ?"
)
public
void
stationQrCodeStatisticsData
()
{
// 1.先删除数据
String
now
=
DateUtils
.
getDateNowShortStr
();
LambdaQueryWrapper
<
StationQrCodeStatistics
>
qw
=
new
LambdaQueryWrapper
<>();
qw
.
eq
(
StationQrCodeStatistics:
:
getRecordDate
,
DateUtils
.
getDateNowShortStr
());
Integer
integer
=
stationQrCodeStatisticsMapper
.
selectCount
(
qw
);
if
(
integer
<=
0
)
{
// 人员赋码数据
List
<
StationQrCodeStatistics
>
personStatistics
=
personBasicMapper
.
getPersonStatistics
();
// 设备赋码数据
List
<
StationQrCodeStatistics
>
equipQrcodeInfo
=
sjglZsjZsbtzMapper
.
getEquipQrcodeInfo
();
List
<
StationBasicDto
>
stationBasicListAll
=
stationBasicMapper
.
getStationBasicListAll
();
Map
<
String
,
String
>
collect
=
stationBasicListAll
.
stream
().
filter
(
t
->
StringUtils
.
isNotEmpty
(
t
.
getStationNumber
())).
filter
(
t
->
StringUtils
.
isNotEmpty
(
t
.
getProjectOrgCode
())).
collect
(
Collectors
.
toMap
(
StationBasicDto:
:
getStationNumber
,
StationBasicDto:
:
getProjectOrgCode
));
equipQrcodeInfo
.
stream
().
filter
(
t
->
collect
.
containsKey
(
t
.
getCode
())).
forEach
(
item
->
item
.
setCode
(
collect
.
get
(
item
.
getCode
())));
// 任务赋码数据
List
<
StationQrCodeStatistics
>
taskQrcodeInfo
=
sjglZsjZsbtzMapper
.
getTaskQrcodeInfo
();
taskQrcodeInfo
.
stream
().
filter
(
t
->
collect
.
containsKey
(
t
.
getCode
())).
forEach
(
item
->
item
.
setCode
(
collect
.
get
(
item
.
getCode
())));
// 人员、任务、设备整合插入数据库
personStatistics
.
addAll
(
equipQrcodeInfo
);
personStatistics
.
addAll
(
taskQrcodeInfo
);
stationQrCodeStatisticsService
.
saveBatch
(
personStatistics
);
}
qw
.
eq
(
StationQrCodeStatistics:
:
getRecordDate
,
now
);
stationQrCodeStatisticsService
.
remove
(
qw
);
// 2.当天统计数据组装
List
<
StationBasicDto
>
stationBasicListAll
=
stationBasicMapper
.
getStationBasicListAll
();
// 2.1人员赋码数据
List
<
StationQrCodeStatistics
>
personStatistics
=
personBasicMapper
.
getPersonStatistics
();
// 2.2设备赋码数据
List
<
StationQrCodeStatistics
>
equipQrcodeInfo
=
sjglZsjZsbtzMapper
.
getEquipQrcodeInfo
();
Map
<
String
,
String
>
collect
=
stationBasicListAll
.
stream
().
filter
(
t
->
StringUtils
.
isNotEmpty
(
t
.
getStationNumber
())).
filter
(
t
->
StringUtils
.
isNotEmpty
(
t
.
getProjectOrgCode
())).
collect
(
Collectors
.
toMap
(
StationBasicDto:
:
getStationNumber
,
StationBasicDto:
:
getProjectOrgCode
));
equipQrcodeInfo
.
stream
().
filter
(
t
->
collect
.
containsKey
(
t
.
getCode
())).
forEach
(
item
->
item
.
setCode
(
collect
.
get
(
item
.
getCode
())));
// 2.3任务赋码数据
List
<
StationQrCodeStatistics
>
taskQrcodeInfo
=
sjglZsjZsbtzMapper
.
getTaskQrcodeInfo
();
taskQrcodeInfo
.
stream
().
filter
(
t
->
collect
.
containsKey
(
t
.
getCode
())).
forEach
(
item
->
item
.
setCode
(
collect
.
get
(
item
.
getCode
())));
// 3.人员、任务、设备整合且过滤只有场站的才统计(原因评估这边是显示的场站下的数据)
personStatistics
.
addAll
(
equipQrcodeInfo
);
personStatistics
.
addAll
(
taskQrcodeInfo
);
List
<
StationQrCodeStatistics
>
withStationStatistics
=
personStatistics
.
stream
().
filter
(
p
->
StringUtils
.
isNotEmpty
(
p
.
getCode
())
&&
stationBasicListAll
.
stream
().
anyMatch
(
s
->
s
.
getProjectOrgCode
().
equals
(
p
.
getCode
()))).
collect
(
Collectors
.
toList
());
stationQrCodeStatisticsService
.
saveBatch
(
withStationStatistics
);
}
...
...
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