Browse Source

优化巡视任务详情中初筛正常的结果也展示

master
wangguangyuan 8 months ago
parent
commit
2e85aeb225
3 changed files with 52 additions and 11 deletions
  1. +22
    -1
      inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/controller/ResultAnalysisController.java
  2. +22
    -4
      inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java
  3. +8
    -6
      inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml

+ 22
- 1
inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/controller/ResultAnalysisController.java View File

@ -528,6 +528,8 @@ public class ResultAnalysisController extends BaseController {
ResultAnalysis resultAnalysis = new ResultAnalysis();
resultAnalysis.setTaskPatrolId(patrolTaskStatus.getTaskPatrolledId());
resultAnalysis.setFilter(patrolTaskStatus.getFilter());
resultAnalysis.setResCode("2000");
resultAnalysis.setPointStatus("0");
resultAnalysis.setResultType("0"); // 0缺陷
startPage();
List<PatrolData> filterList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis);
@ -553,6 +555,15 @@ public class ResultAnalysisController extends BaseController {
// item.setImg(item.getImgAnalyse());
//// item.setImgAnalyse("");
// }
AlgValue algValue = new AlgValue();
if(item.getResValue() != null) {
String str = algValue.formatValue(item.getResValue());
if ("meter".equals(item.getAlgType())) {
if (str.equals("-1")) {
item.setResValue("空值");
}
}
}
});
// logger.info("[RES ANALYZE] filterList2: {}", JSONObject.toJSONString(filterList, true));
Collections.sort(filterList);
@ -631,7 +642,8 @@ public class ResultAnalysisController extends BaseController {
resultAnalysis.setTaskPatrolId(patrolTaskStatus.getTaskPatrolledId());
startPage();
resultAnalysis.setFilter(patrolTaskStatus.getFilter());
// resultAnalysis.setResCode("2000");
resultAnalysis.setResCode("2000");
resultAnalysis.setPointStatus("0");
resultAnalysis.setResultType("2"); // 2异常
resultAnalysis.setPosType(patrolTaskStatus.getPosType());
List<PatrolData> list = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis);
@ -641,6 +653,15 @@ public class ResultAnalysisController extends BaseController {
item.setAlgName((algInfos.stream().filter((alg) -> {
return alg.getAlgSubtypeCode().equals(item.getAlgType());
}).findFirst().get()).getAlgSubtypeName());
AlgValue algValue = new AlgValue();
if(item.getResValue() != null) {
String str = algValue.formatValue(item.getResValue());
if ("meter".equals(item.getAlgType())) {
if (str.equals("-1")) {
item.setResValue("空值");
}
}
}
} catch (Exception e) {
logger.error("list_exception: algType: {}, exception: {}", item.getAlgType(), e.getMessage());
}


+ 22
- 4
inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java View File

@ -204,9 +204,9 @@ public class PatrolTaskController extends BaseController {
// 大模型数据
List<PatrolData> newList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis);
logger.info("----------------[TASK] query newList {}", newList);
if (newList == null) {
return getDataTable(2, new ArrayList<>(), new ArrayList<>());
}
// if (newList == null) {
// return getDataTable(2, new ArrayList<>(), new ArrayList<>());
// }
long t3 = System.currentTimeMillis();
for (PatrolData item : newList) {
// item.setAlgName((algInfos.stream().filter((alg) -> {
@ -240,7 +240,25 @@ public class PatrolTaskController extends BaseController {
}
}
}
}
for (PatrolData item : filterList) {
item.setAlgName(
algInfos.stream().anyMatch((alg) -> {
return alg.getAlgSubtypeCode().equals(item.getAlgType());
}) ?
algInfos.stream().filter((alg) -> {
return alg.getAlgSubtypeCode().equals(item.getAlgType());
}).findFirst().get().getAlgSubtypeName() : ""
);
AlgValue algValue = new AlgValue();
if(item.getResValue() != null) {
String str = algValue.formatValue(item.getResValue());
if ("meter".equals(item.getAlgType())) {
if (str.equals("-1")) {
item.setResValue("空值");
}
}
}
}
newList.addAll(filterList);
if (StringUtils.isNotEmpty(resultAnalysis.getAlgName())) {


+ 8
- 6
inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml View File

@ -252,10 +252,15 @@
<if test="resultType != null and resultType != ''">and b.result_type =
#{resultType}
</if>
<if test="filter != null and filter != '' and resCode == null">and b.filter = #{filter} and b.point_status
= '0' and b.res_code='2000'
<if test="filter != null and filter != ''">
and b.filter = #{filter}
</if>
<if test="resCode != null and resCode!= ''">
and b.res_code=#{resCode}
</if>
<if test="pointStatus != null and pointStatus != ''">
and b.point_status = #{pointStatus}
</if>
<if test="resCode != null and resCode != ''">and b.filter = #{filter} and b.res_code!=#{resCode}</if>
<if test="pointName != null and pointName != ''">and a.device_name like concat('%', #{pointName}, '%')</if>
<if test="deviceName != null and deviceName != ''">and d.device_name like concat('%', #{deviceName}, '%')
</if>
@ -276,9 +281,6 @@
</if>
</if>
<if test="desc != null and desc != ''">and b.description like concat('%', #{desc}, '%')</if>
<if test="pointStatus != null and pointStatus != ''">and b.point_status like concat('%', #{pointStatus},
'%')
</if>
</where>
<if test="abnormal == 0">ORDER BY d.device_name,a.device_name</if>
<if test="abnormal == 1">ORDER BY b.point_status</if>


Loading…
Cancel
Save