Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
f79dca3b
提交
f79dca3b
authored
9月 03, 2021
作者:
Matrix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(核查模块): 修复省统计中核查结果没有正确显示为无的问题
修复省统计中核查结果没有正确显示为无的问题
上级
ddec201f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
31 行增加
和
6 行删除
+31
-6
DeviceCheckController.java
...device/confirmcheck/controller/DeviceCheckController.java
+31
-6
没有找到文件。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
浏览文件 @
f79dca3b
...
@@ -324,6 +324,7 @@ public class DeviceCheckController {
...
@@ -324,6 +324,7 @@ public class DeviceCheckController {
List
<
CheckAreaStatVo
>
totalList
=
new
ArrayList
<>();
List
<
CheckAreaStatVo
>
totalList
=
new
ArrayList
<>();
for
(
Task
cct
:
cctask
)
{
for
(
Task
cct
:
cctask
)
{
long
start1
=
System
.
currentTimeMillis
();
Integer
detailId
=
cct
.
getBillId
();
Integer
detailId
=
cct
.
getBillId
();
DeviceCheckDetail
childDetail
=
detailRepo
.
findById
(
detailId
).
get
();
DeviceCheckDetail
childDetail
=
detailRepo
.
findById
(
detailId
).
get
();
...
@@ -332,6 +333,8 @@ public class DeviceCheckController {
...
@@ -332,6 +333,8 @@ public class DeviceCheckController {
.
flatMap
(
checkAreaStatVos
->
checkAreaStatVos
.
stream
())
.
flatMap
(
checkAreaStatVos
->
checkAreaStatVos
.
stream
())
.
collect
(
toList
());
.
collect
(
toList
());
totalList
.
addAll
(
casList
);
totalList
.
addAll
(
casList
);
long
end1
=
System
.
currentTimeMillis
();
log
.
info
(
"[性能分析] task id = {} cost {} ms"
,
cct
.
getId
(),
end1
-
start1
);
}
}
//
//
String
areaName
=
auService
.
findOne
(
AuExample
.
UnitId
,
child
.
getOwnUnit
()).
getName
();
String
areaName
=
auService
.
findOne
(
AuExample
.
UnitId
,
child
.
getOwnUnit
()).
getName
();
...
@@ -521,10 +524,18 @@ public class DeviceCheckController {
...
@@ -521,10 +524,18 @@ public class DeviceCheckController {
// 核查情况 所有子任务都是初始状态 = 无 10=未
// 核查情况 所有子任务都是初始状态 = 无 10=未
String
checkReuslt
=
""
;
String
checkReuslt
=
""
;
boolean
allIsNotInit
=
detailTasks
.
stream
()
// Task 先将历史数据给过滤掉 - 方法是按照billId分组排序,跳出主键id最大的即最新的一条
.
anyMatch
(
t
->
t
.
getBillStatus
().
equals
(
END
.
id
));
detailTasks
=
detailTasks
.
stream
()
.
collect
(
groupingBy
(
Task:
:
getBillId
,
collectingAndThen
(
maxBy
(
Comparator
.
comparing
(
Task:
:
getId
)),
Optional:
:
get
)))
.
values
().
stream
()
.
collect
(
toList
());
// 不能存在有9999的任务
boolean
notExistsEnd
=
detailTasks
.
stream
()
.
allMatch
(
t
->
!
t
.
getBillStatus
().
equals
(
END
.
id
));
if
(
!
allIsNotInit
)
{
if
(
notExistsEnd
)
{
checkReuslt
=
"无"
;
checkReuslt
=
"无"
;
}
else
{
}
else
{
// 任意一个是10则是待审核
// 任意一个是10则是待审核
...
@@ -853,7 +864,7 @@ public class DeviceCheckController {
...
@@ -853,7 +864,7 @@ public class DeviceCheckController {
if
(
unit
.
getLevel
()
==
1
||
unit
.
getLevel
()
==
2
)
{
if
(
unit
.
getLevel
()
==
1
||
unit
.
getLevel
()
==
2
)
{
fatherId
=
cityExamIdMap
.
get
(
unit
.
getUnitId
());
fatherId
=
cityExamIdMap
.
get
(
unit
.
getUnitId
());
initStatusId
=
CHECK_DETAIL_CITY_0
.
id
;
initStatusId
=
CHECK_DETAIL_CITY_0
.
id
;
if
(
fatherId
==
null
){
if
(
fatherId
==
null
)
{
fatherId
=
provStatTask
.
getId
();
fatherId
=
provStatTask
.
getId
();
}
}
}
else
{
}
else
{
...
@@ -1120,7 +1131,7 @@ public class DeviceCheckController {
...
@@ -1120,7 +1131,7 @@ public class DeviceCheckController {
long
count
=
devLibVo
.
getDevInLibrary
().
stream
()
long
count
=
devLibVo
.
getDevInLibrary
().
stream
()
.
filter
(
deviceInLibVo
->
deviceInLibVo
.
getProofResult
()
%
10
!=
9
)
.
filter
(
deviceInLibVo
->
deviceInLibVo
.
getProofResult
()
%
10
!=
9
)
.
count
();
.
count
();
detailRepo
.
updateCheckDetailWithT
(
id
,
detailString
,
checkResult
,
currentUser
.
getUserId
(),
assignUserId
,
(
int
)
count
,
terminalInfo
);
detailRepo
.
updateCheckDetailWithT
(
id
,
detailString
,
checkResult
,
currentUser
.
getUserId
(),
assignUserId
,
(
int
)
count
,
terminalInfo
);
//2. 推进TASK 状态
//2. 推进TASK 状态
TaskBto
currentTask
=
taskService
.
get
(
id
,
CONFIRM_CHECK_DETAIL
.
id
);
TaskBto
currentTask
=
taskService
.
get
(
id
,
CONFIRM_CHECK_DETAIL
.
id
);
currentTask
.
getInvolveUserIdList
().
set
(
0
,
authenticationUtils
.
getAuthentication
().
getCurrentUserInfo
().
getUserId
());
currentTask
.
getInvolveUserIdList
().
set
(
0
,
authenticationUtils
.
getAuthentication
().
getCurrentUserInfo
().
getUserId
());
...
@@ -1734,6 +1745,8 @@ public class DeviceCheckController {
...
@@ -1734,6 +1745,8 @@ public class DeviceCheckController {
String
[]
statArray
=
statString
.
split
(
","
);
String
[]
statArray
=
statString
.
split
(
","
);
//将 id - status 转化为 model - count - status(只统计新增和无误的作为数量)
//将 id - status 转化为 model - count - status(只统计新增和无误的作为数量)
long
start1
=
System
.
currentTimeMillis
();
// 根这里unid可以从detail里拿,根据unitId 查到 areaId 根据 areaId 查询到 areaName
// 根这里unid可以从detail里拿,根据unitId 查到 areaId 根据 areaId 查询到 areaName
String
areaName
=
auService
.
findOne
(
AuExample
.
UnitName
,
detail
.
getCheckUnit
()).
getName
();
String
areaName
=
auService
.
findOne
(
AuExample
.
UnitName
,
detail
.
getCheckUnit
()).
getName
();
...
@@ -1743,22 +1756,29 @@ public class DeviceCheckController {
...
@@ -1743,22 +1756,29 @@ public class DeviceCheckController {
int
statId
=
Optional
.
ofNullable
(
taskRepo
.
findBillId
(
task
.
getParentTaskId
(),
CONFIRM_CHECK_STAT
.
id
))
int
statId
=
Optional
.
ofNullable
(
taskRepo
.
findBillId
(
task
.
getParentTaskId
(),
CONFIRM_CHECK_STAT
.
id
))
.
orElse
(
0
);
.
orElse
(
0
);
long
end1
=
System
.
currentTimeMillis
();
log
.
info
(
"[核查TEST] 基础数据查询消耗 {} ms "
,
end1
-
start1
);
// checkDevice 批量查询做一个MAP缓存
// checkDevice 批量查询做一个MAP缓存
long
start
=
System
.
currentTimeMillis
();
List
<
Integer
>
idList
=
Arrays
.
stream
(
statArray
)
List
<
Integer
>
idList
=
Arrays
.
stream
(
statArray
)
.
filter
(
StringUtils:
:
isNotEmpty
)
.
filter
(
StringUtils:
:
isNotEmpty
)
.
map
(
s
->
s
.
split
(
"-"
)[
0
])
.
map
(
s
->
s
.
split
(
"-"
)[
0
])
.
map
(
Integer:
:
parseInt
)
.
map
(
Integer:
:
parseInt
)
.
collect
(
toList
());
.
collect
(
toList
());
long
start
=
System
.
currentTimeMillis
();
List
<
DeviceLibrary
>
allDevice
=
dcService
.
getAllDeviceLibraryList
();
List
<
DeviceLibrary
>
allDevice
=
dcService
.
getAllDeviceLibraryList
();
Map
<
Integer
,
DeviceLibrary
>
deviceMap
=
allDevice
.
stream
()
Map
<
Integer
,
DeviceLibrary
>
deviceMap
=
allDevice
.
stream
()
.
filter
(
d
->
idList
.
contains
(
d
.
getId
()))
.
filter
(
d
->
idList
.
contains
(
d
.
getId
()))
.
collect
(
toMap
(
DeviceLibrary:
:
getId
,
Function
.
identity
()));
.
collect
(
toMap
(
DeviceLibrary:
:
getId
,
Function
.
identity
()));
long
end
=
System
.
currentTimeMillis
();
long
end
=
System
.
currentTimeMillis
();
log
.
info
(
"[核查TEST] 批量查询id集合耗时 {} ms "
,
end
-
start
);
log
.
info
(
"[核查TEST] 批量查询id集合耗时 {} ms "
,
end
-
start
);
long
start2
=
System
.
currentTimeMillis
();
for
(
String
s
:
statArray
)
{
for
(
String
s
:
statArray
)
{
if
(
StringUtils
.
isEmpty
(
s
))
{
if
(
StringUtils
.
isEmpty
(
s
))
{
continue
;
continue
;
...
@@ -1768,6 +1788,9 @@ public class DeviceCheckController {
...
@@ -1768,6 +1788,9 @@ public class DeviceCheckController {
int
proofResult
=
Integer
.
parseInt
(
device
[
1
]);
int
proofResult
=
Integer
.
parseInt
(
device
[
1
]);
DeviceLibrary
checkDevice
=
deviceMap
.
get
(
deviceId
);
DeviceLibrary
checkDevice
=
deviceMap
.
get
(
deviceId
);
if
(
Objects
.
isNull
(
checkDevice
)){
continue
;
}
CheckAreaStatVo
checkAreaStatVo
;
CheckAreaStatVo
checkAreaStatVo
;
// 百位数 0/1 待审核 2 无误 3未通过
// 百位数 0/1 待审核 2 无误 3未通过
...
@@ -1805,6 +1828,8 @@ public class DeviceCheckController {
...
@@ -1805,6 +1828,8 @@ public class DeviceCheckController {
statVoList
.
add
(
new
CheckDeviceStatVo
(
checkDevice
.
getModel
(),
checkDevice
.
getName
(),
1
,
areaStatVoList
));
statVoList
.
add
(
new
CheckDeviceStatVo
(
checkDevice
.
getModel
(),
checkDevice
.
getName
(),
1
,
areaStatVoList
));
}
}
long
end2
=
System
.
currentTimeMillis
();
log
.
info
(
"[核查TEST] 拼装deviceStat数据消耗了 {} ms "
,
end2
-
start2
);
return
statVoList
;
return
statVoList
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论