Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
c33084dc
由
sonin
编写于
2025-03-27 10:09:30 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
巡检分析 巡检设备指标 详情
1 个父辈
9bccf323
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
156 行增加
和
18 行删除
sk-module-inspection/src/main/java/com/skua/modules/inspection/controller/web/InspectionAnalysisController.java
sk-module-inspection/src/main/java/com/skua/modules/inspection/service/IInspectionAnalysisService.java
sk-module-inspection/src/main/java/com/skua/modules/inspection/service/impl/InspectionAnalysisServiceImpl.java
sk-module-inspection/src/main/java/com/skua/modules/inspection/vo/InspectionEquipIndicatorsVO.java
sk-module-inspection/src/main/java/com/skua/modules/inspection/controller/web/InspectionAnalysisController.java
查看文件 @
c33084d
...
...
@@ -221,19 +221,19 @@ public class InspectionAnalysisController {
@GetMapping
(
"/getInspectionEquipIndicators"
)
public
Result
<
InspectionEquipIndicatorsVO
>
getInspectionEquipIndicators
(
String
startDate
,
String
endDate
){
Result
<
InspectionEquipIndicatorsVO
>
result
=
new
Result
<>();
InspectionEquipIndicatorsVO
inspectionEquipIndicatorsVO
=
inspectionAnalysisService
.
getInspectionEquipIndicators
New
(
startDate
,
endDate
);
InspectionEquipIndicatorsVO
inspectionEquipIndicatorsVO
=
inspectionAnalysisService
.
getInspectionEquipIndicators
(
startDate
,
endDate
);
result
.
setSuccess
(
true
);
result
.
setResult
(
inspectionEquipIndicatorsVO
);
return
result
;
}
@ApiOperation
(
value
=
"巡检分析-巡检设备指标-详情"
,
notes
=
"巡检分析-巡检设备指标-详情"
)
@GetMapping
(
"/getInspectionEquipIndicatorsDetail"
)
public
Result
<
List
<
InspectionEquipIndicators
Detail
VO
>>
getInspectionEquipIndicators
(
String
departId
,
String
startDate
,
String
endDate
){
Result
<
List
<
InspectionEquipIndicators
Detail
VO
>>
result
=
new
Result
<>();
public
Result
<
List
<
InspectionEquipIndicatorsVO
>>
getInspectionEquipIndicators
(
String
departId
,
String
startDate
,
String
endDate
){
Result
<
List
<
InspectionEquipIndicatorsVO
>>
result
=
new
Result
<>();
if
(
StringUtils
.
isEmpty
(
departId
)){
departId
=
BaseContextHandler
.
getDeparts
();
}
List
<
InspectionEquipIndicators
Detail
VO
>
dataList
=
inspectionAnalysisService
.
getInspectionEquipIndicatorsDetail
(
JSUtils
.
quoteEach
(
departId
,
","
),
startDate
,
endDate
);
List
<
InspectionEquipIndicatorsVO
>
dataList
=
inspectionAnalysisService
.
getInspectionEquipIndicatorsDetail
(
JSUtils
.
quoteEach
(
departId
,
","
),
startDate
,
endDate
);
result
.
setSuccess
(
true
);
result
.
setResult
(
dataList
);
return
result
;
...
...
sk-module-inspection/src/main/java/com/skua/modules/inspection/service/IInspectionAnalysisService.java
查看文件 @
c33084d
...
...
@@ -43,7 +43,7 @@ public interface IInspectionAnalysisService {
* @param endDate
* @return
*/
List
<
InspectionEquipIndicators
Detail
VO
>
getInspectionEquipIndicatorsDetail
(
String
departIds
,
String
startDate
,
String
endDate
);
List
<
InspectionEquipIndicatorsVO
>
getInspectionEquipIndicatorsDetail
(
String
departIds
,
String
startDate
,
String
endDate
);
/***
* 巡检分析-巡检任务概况
...
...
sk-module-inspection/src/main/java/com/skua/modules/inspection/service/impl/InspectionAnalysisServiceImpl.java
查看文件 @
c33084d
...
...
@@ -679,7 +679,6 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService
public
InspectionEquipIndicatorsVO
getInspectionEquipIndicators
(
String
startDate
,
String
endDate
)
{
InspectionEquipIndicatorsVO
inspectionEquipIndicatorsVO
=
new
InspectionEquipIndicatorsVO
();
//设置初始值
inspectionEquipIndicatorsVO
.
setFinishRate
(
"0"
);
inspectionEquipIndicatorsVO
.
setCompletionRate
(
"0"
);
inspectionEquipIndicatorsVO
.
setUnCompletionRate
(
"0"
);
inspectionEquipIndicatorsVO
.
setAbnormalRate
(
"0"
);
...
...
@@ -707,15 +706,15 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService
Integer
totalInspectionEquipCount
=
equipInfoIdList
.
stream
().
map
(
m
->
ConvertUtils
.
getString
(
m
.
get
(
"equipInfoId"
))).
collect
(
Collectors
.
toSet
()).
size
();
//查询已巡检设备数量
List
<
String
>
inspectionPointFillGroupIdList
=
equipInfoIdList
.
stream
().
map
(
m
->
ConvertUtils
.
getString
(
m
.
get
(
"inspectionPointFillGroupId"
))).
collect
(
Collectors
.
toList
());
List
<
String
>
inspectionFillGroupIdList
=
equipInfoIdList
.
stream
().
map
(
m
->
ConvertUtils
.
getString
(
m
.
get
(
"inspectionFillGroupId"
))).
collect
(
Collectors
.
toList
());
//构筑物
List
<
String
>
inspectionFillGroupIdList
=
equipInfoIdList
.
stream
().
map
(
m
->
ConvertUtils
.
getString
(
m
.
get
(
"inspectionFillGroupId"
))).
collect
(
Collectors
.
toList
());
int
checkedInspectionEquipCount
=
0
;
int
notCheckedInspectionEquipCount
=
0
;
int
abnormalInspectionEquipCount
=
0
;
if
(
inspectionPointFillGroupIdList
.
size
()
>
0
)
{
QueryWrapper
<
InspectionTaskFillContent
>
inspectionTaskFillContentQueryWrapper
=
new
QueryWrapper
<>();
inspectionTaskFillContentQueryWrapper
.
in
(
"isfc.inspection_task_id"
,
inspectionTaskIdList
);
//任务id集合
inspectionTaskFillContentQueryWrapper
.
in
(
"isfc.inspection_point_fill_group_id"
,
inspectionPointFillGroupIdList
);
//巡检点-填报组ID
inspectionTaskFillContentQueryWrapper
.
in
(
"isfc.inspection_fill_group_id"
,
inspectionFillGroupIdList
);
//填报组ID
inspectionTaskFillContentQueryWrapper
.
in
(
"isfc.inspection_task_id"
,
inspectionTaskIdList
);
inspectionTaskFillContentQueryWrapper
.
in
(
"isfc.inspection_point_fill_group_id"
,
inspectionPointFillGroupIdList
);
inspectionTaskFillContentQueryWrapper
.
in
(
"isfc.inspection_fill_group_id"
,
inspectionFillGroupIdList
);
inspectionTaskFillContentQueryWrapper
.
isNotNull
(
"itpfg.equip_info_id"
);
inspectionTaskFillContentQueryWrapper
.
ne
(
"itpfg.equip_info_id"
,
""
);
inspectionTaskFillContentQueryWrapper
.
groupBy
(
"itpfg.equip_info_id"
);
...
...
@@ -766,11 +765,6 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService
if
(
processInstanceStateMap
!=
null
&&
processInstanceStateMap
.
get
(
FlowEngineConstant
.
STATUS_FINISHED
)
!=
null
)
{
processedAbnormalItemsCount
=
processInstanceStateMap
.
get
(
FlowEngineConstant
.
STATUS_FINISHED
).
size
();
}
//完成率
String
finishRate
=
"0"
;
if
(
totalInspectionEquipCount
!=
0
)
{
finishRate
=
numberFormat
.
format
(
checkedInspectionEquipCount
/
(
double
)
totalInspectionEquipCount
*
100
);
}
//覆盖率
String
completionRate
=
"0"
;
if
(
totalInspectionEquipCount
!=
0
)
{
...
...
@@ -791,7 +785,7 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService
if
(
abnormalItemsCount
!=
0
)
{
processedAbnormalRate
=
numberFormat
.
format
(
processedAbnormalItemsCount
/
(
double
)
abnormalItemsCount
*
100
);
}
inspectionEquipIndicatorsVO
.
setFinishRate
(
finish
Rate
);
inspectionEquipIndicatorsVO
.
setFinishRate
(
completion
Rate
);
inspectionEquipIndicatorsVO
.
setCompletionRate
(
completionRate
);
inspectionEquipIndicatorsVO
.
setUnCompletionRate
(
unCompletionRate
);
inspectionEquipIndicatorsVO
.
setAbnormalRate
(
abnormalRate
);
...
...
@@ -837,8 +831,150 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService
* @param endDate
* @return
*/
public
List
<
InspectionEquipIndicatorsDetailVO
>
getInspectionEquipIndicatorsDetail
(
String
departIds
,
String
startDate
,
String
endDate
){
return
inspectionAnalysisMapper
.
getInspectionEquipIndicatorsDetail
(
departIds
,
startDate
,
endDate
);
public
List
<
InspectionEquipIndicatorsVO
>
getInspectionEquipIndicatorsDetail
(
String
departIds
,
String
startDate
,
String
endDate
){
List
<
InspectionEquipIndicatorsVO
>
voList
=
new
ArrayList
<>();
//查询时间内已巡检任务信息
QueryWrapper
<
InspectionTask
>
inspectionTaskQueryWrapper
=
new
QueryWrapper
();
if
(
StringUtils
.
isNotBlank
(
startDate
)
&&
StringUtils
.
isNotBlank
(
endDate
))
{
inspectionTaskQueryWrapper
.
ge
(
"inspection_cycle_start_date"
,
startDate
+
" 00:00:00"
);
inspectionTaskQueryWrapper
.
le
(
"inspection_cycle_start_date"
,
endDate
+
" 23:59:59"
);
}
inspectionTaskQueryWrapper
.
in
(
"task_state"
,
"2"
,
"3"
);
List
<
InspectionTask
>
inspectionTaskList
=
inspectionTaskService
.
list
(
inspectionTaskQueryWrapper
);
// 巡检任务按照departId分组
Map
<
String
,
List
<
String
>>
departId2inspectionTaskIdMap
=
new
LinkedHashMap
<>();
for
(
InspectionTask
inspectionTask
:
inspectionTaskList
)
{
String
departId
=
inspectionTask
.
getDepartId
();
List
<
String
>
inspectionTaskIdList
=
departId2inspectionTaskIdMap
.
computeIfAbsent
(
departId
,
k
->
new
ArrayList
<>());
inspectionTaskIdList
.
add
(
inspectionTask
.
getId
());
}
List
<
CompletableFuture
>
completableFutureList
=
new
ArrayList
<>();
// 翻译
Map
<
String
,
String
>
sysDepartDictMap
=
businessService
.
dictMap
(
"sys_depart"
,
null
);
// 遍历departId
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry0:
departId2inspectionTaskIdMap
.
entrySet
())
{
String
departId
=
entry0
.
getKey
();
List
<
String
>
tempInspectionTaskIdList
=
entry0
.
getValue
();
completableFutureList
.
add
(
CompletableFuture
.
supplyAsync
(()
->
{
InspectionEquipIndicatorsVO
vo
=
new
InspectionEquipIndicatorsVO
();
//设置初始值
vo
.
setDepartName
(
StringUtils
.
isEmpty
(
departId
)
?
departId
:
sysDepartDictMap
.
get
(
departId
));
vo
.
setCompletionRate
(
"0"
);
vo
.
setUnCompletionRate
(
"0"
);
vo
.
setAbnormalRate
(
"0"
);
vo
.
setProcessedAbnormalRate
(
"0"
);
if
(
tempInspectionTaskIdList
.
size
()
>
0
)
{
//查询应检设备数量
QueryWrapper
<
InspectionTaskPointFillGroup
>
inspectionTaskPointFillGroupQueryWrapper
=
new
QueryWrapper
<>();
inspectionTaskPointFillGroupQueryWrapper
.
in
(
"inspection_task_id"
,
tempInspectionTaskIdList
);
inspectionTaskPointFillGroupQueryWrapper
.
select
(
"equip_info_id equipInfoId,inspection_point_fill_group_id inspectionPointFillGroupId,inspection_fill_group_id inspectionFillGroupId,inspection_task_id inspectionTaskId"
);
inspectionTaskPointFillGroupQueryWrapper
.
groupBy
(
"equip_info_id,inspection_point_fill_group_id,inspection_fill_group_id,inspection_task_id"
);
inspectionTaskPointFillGroupQueryWrapper
.
isNotNull
(
"equip_info_id"
);
inspectionTaskPointFillGroupQueryWrapper
.
ne
(
"equip_info_id"
,
""
);
List
<
Map
<
String
,
Object
>>
equipInfoIdList
=
inspectionTaskPointFillGroupService
.
listMaps
(
inspectionTaskPointFillGroupQueryWrapper
);
//应检设备数量
Integer
totalInspectionEquipCount
=
equipInfoIdList
.
stream
().
map
(
m
->
ConvertUtils
.
getString
(
m
.
get
(
"equipInfoId"
))).
collect
(
Collectors
.
toSet
()).
size
();
//查询已巡检设备数量
List
<
String
>
inspectionPointFillGroupIdList
=
equipInfoIdList
.
stream
().
map
(
m
->
ConvertUtils
.
getString
(
m
.
get
(
"inspectionPointFillGroupId"
))).
collect
(
Collectors
.
toList
());
List
<
String
>
inspectionFillGroupIdList
=
equipInfoIdList
.
stream
().
map
(
m
->
ConvertUtils
.
getString
(
m
.
get
(
"inspectionFillGroupId"
))).
collect
(
Collectors
.
toList
());
int
checkedInspectionEquipCount
=
0
;
int
notCheckedInspectionEquipCount
=
0
;
int
abnormalInspectionEquipCount
=
0
;
if
(
inspectionPointFillGroupIdList
.
size
()
>
0
)
{
QueryWrapper
<
InspectionTaskFillContent
>
inspectionTaskFillContentQueryWrapper
=
new
QueryWrapper
<>();
inspectionTaskFillContentQueryWrapper
.
in
(
"isfc.inspection_task_id"
,
tempInspectionTaskIdList
);
inspectionTaskFillContentQueryWrapper
.
in
(
"isfc.inspection_point_fill_group_id"
,
inspectionPointFillGroupIdList
);
inspectionTaskFillContentQueryWrapper
.
in
(
"isfc.inspection_fill_group_id"
,
inspectionFillGroupIdList
);
inspectionTaskFillContentQueryWrapper
.
isNotNull
(
"itpfg.equip_info_id"
);
inspectionTaskFillContentQueryWrapper
.
ne
(
"itpfg.equip_info_id"
,
""
);
inspectionTaskFillContentQueryWrapper
.
groupBy
(
"itpfg.equip_info_id"
);
inspectionTaskFillContentQueryWrapper
.
isNotNull
(
"isfc.fill_content"
);
inspectionTaskFillContentQueryWrapper
.
ne
(
"isfc.fill_content"
,
""
);
List
<
Map
<
String
,
Object
>>
inspectionTaskFillContentList
=
inspectionTaskFillContentService
.
getList
(
inspectionTaskFillContentQueryWrapper
);
//已检设备数量
checkedInspectionEquipCount
=
inspectionTaskFillContentList
.
size
();
//未检设备数量
notCheckedInspectionEquipCount
=
totalInspectionEquipCount
-
checkedInspectionEquipCount
;
//查询异常填报设备数量
inspectionTaskFillContentQueryWrapper
.
eq
(
"choice_state"
,
"0"
);
abnormalInspectionEquipCount
=
inspectionTaskFillContentService
.
getList
(
inspectionTaskFillContentQueryWrapper
).
size
();
}
//查询问题上报id集合
QueryWrapper
<
InspectionTaskProblemReport
>
inspectionTaskProblemReportQueryWrapper
=
new
QueryWrapper
<>();
inspectionTaskProblemReportQueryWrapper
.
in
(
"inspection_task_id"
,
tempInspectionTaskIdList
);
List
<
InspectionTaskProblemReport
>
inspectionTaskProblemReportList
=
inspectionTaskProblemReportService
.
list
(
inspectionTaskProblemReportQueryWrapper
);
List
<
String
>
problemReportIdList
=
inspectionTaskProblemReportList
.
stream
().
map
(
InspectionTaskProblemReport:
:
getProblemReportPlanId
).
collect
(
Collectors
.
toList
());
List
<
ProblemReportPlan
>
problemReportPlanList
=
new
ArrayList
<>();
if
(
problemReportIdList
.
size
()
>
0
)
{
QueryWrapper
<
ProblemReportPlan
>
problemReportPlanQueryWrapper
=
new
QueryWrapper
<>();
problemReportPlanQueryWrapper
.
in
(
"id"
,
problemReportIdList
);
problemReportPlanList
=
problemReportPlanService
.
list
(
problemReportPlanQueryWrapper
);
}
//存放问题上报的实例ID
Set
<
String
>
processInstanceIdList
=
problemReportPlanList
.
stream
().
map
(
ProblemReportPlan:
:
getProcessInstanceId
).
collect
(
Collectors
.
toSet
());
Map
<
String
,
Map
<
String
,
String
>>
processStateMap
=
new
HashMap
<>();
if
(
processInstanceIdList
.
size
()
>
0
)
{
processStateMap
=
flowBusinessService
.
getProcessState
(
processInstanceIdList
);
}
Map
<
String
,
List
<
String
>>
processInstanceStateMap
=
new
HashMap
<>();
List
<
String
>
tempProcessInstanceIdList
;
for
(
Map
.
Entry
<
String
,
Map
<
String
,
String
>>
entry
:
processStateMap
.
entrySet
())
{
tempProcessInstanceIdList
=
new
ArrayList
<>();
String
processInstanceId
=
entry
.
getKey
();
String
state
=
entry
.
getValue
().
get
(
"state"
);
if
(
processInstanceStateMap
.
get
(
state
)
!=
null
)
{
tempProcessInstanceIdList
=
processInstanceStateMap
.
get
(
state
);
}
tempProcessInstanceIdList
.
add
(
processInstanceId
);
processInstanceStateMap
.
put
(
state
,
tempProcessInstanceIdList
);
}
//异常项数量(问题上报)
Integer
abnormalItemsCount
=
problemReportPlanList
.
size
();
//已处理异常项数量(问题上报)
Integer
processedAbnormalItemsCount
=
0
;
if
(
processInstanceStateMap
!=
null
&&
processInstanceStateMap
.
get
(
FlowEngineConstant
.
STATUS_FINISHED
)
!=
null
)
{
processedAbnormalItemsCount
=
processInstanceStateMap
.
get
(
FlowEngineConstant
.
STATUS_FINISHED
).
size
();
}
//覆盖率
String
completionRate
=
"0"
;
if
(
totalInspectionEquipCount
!=
0
)
{
completionRate
=
numberFormat
.
format
(
checkedInspectionEquipCount
/
(
double
)
totalInspectionEquipCount
*
100
);
}
//未检率
String
unCompletionRate
=
"0"
;
if
(
totalInspectionEquipCount
!=
0
)
{
unCompletionRate
=
numberFormat
.
format
(
notCheckedInspectionEquipCount
/
(
double
)
totalInspectionEquipCount
*
100
);
}
//异常率
String
abnormalRate
=
"0"
;
if
(
checkedInspectionEquipCount
!=
0
)
{
abnormalRate
=
numberFormat
.
format
(
abnormalInspectionEquipCount
/
(
double
)
checkedInspectionEquipCount
*
100
);
}
//异常项处理率
String
processedAbnormalRate
=
"0"
;
if
(
abnormalItemsCount
!=
0
)
{
processedAbnormalRate
=
numberFormat
.
format
(
processedAbnormalItemsCount
/
(
double
)
abnormalItemsCount
*
100
);
}
vo
.
setFinishRate
(
completionRate
);
vo
.
setCompletionRate
(
completionRate
);
vo
.
setUnCompletionRate
(
unCompletionRate
);
vo
.
setAbnormalRate
(
abnormalRate
);
vo
.
setProcessedAbnormalRate
(
processedAbnormalRate
);
}
return
vo
;
},
(
Executor
)
SpringContextUtils
.
getBean
(
"taskExecutor2"
)));
}
// 等待所有子线程处理完毕
CompletableFuture
.
allOf
(
completableFutureList
.
toArray
(
new
CompletableFuture
[
0
])).
join
();
for
(
CompletableFuture
completableFuture
:
completableFutureList
)
{
try
{
InspectionEquipIndicatorsVO
vo
=
(
InspectionEquipIndicatorsVO
)
completableFuture
.
get
();
voList
.
add
(
vo
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
voList
;
}
/***
...
...
sk-module-inspection/src/main/java/com/skua/modules/inspection/vo/InspectionEquipIndicatorsVO.java
查看文件 @
c33084d
...
...
@@ -28,4 +28,6 @@ public class InspectionEquipIndicatorsVO {
@ApiModelProperty
(
value
=
"异常项处理率"
)
private
String
processedAbnormalRate
;
private
String
departName
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论