Browse Source

绍兴报告合并问题

master
wangguangyuan 3 months ago
parent
commit
78059e7355
3 changed files with 11 additions and 6 deletions
  1. +2
    -1
      inspect-gateway/src/main/java/com/inspect/gateway/filter/RequestParamGlobalFilter.java
  2. +7
    -5
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java
  3. +2
    -0
      inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml

+ 2
- 1
inspect-gateway/src/main/java/com/inspect/gateway/filter/RequestParamGlobalFilter.java View File

@ -30,8 +30,9 @@ public class RequestParamGlobalFilter implements GlobalFilter, Ordered {
private static final List<String> PATH_WHITE_LIST = Arrays.asList(
"/patrol/task/add",
"/patrol/task/save",
"patrol/resultmain/reportExport",
"/patrol/resultmain/reportExport",
"/patrol/task/taskInfoExport",
"/basedata/prodevmnt/device/treeProMainDevicePatrolEquSelect",
"/example/path2"
);


+ 7
- 5
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java View File

@ -797,7 +797,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
// 只导出缺陷
patrolResultRefs = patrolResultRefs.stream().filter((item) -> "0".equals(item.getResultType())).collect(Collectors.toList());
// 分组按点位ID和算法类型进行分组
Map<GroupKey, List<PatrolResultRef>> groupKeyListMap = patrolResultRefs.stream().collect(Collectors.groupingBy(item -> new GroupKey(item.getDeviceId(), item.getAlgType())));
Map<GroupKey, List<PatrolResultRef>> groupKeyListMap = patrolResultRefs.stream().collect(Collectors.groupingBy(item -> new GroupKey(item.getDeviceId(), item.getAlgType(), item.getTaskPatrolledId())));
groupKeyListMap.forEach((key, value) -> {
PatrolResultRef patrolResultRef = new PatrolResultRef();
patrolResultRef.setDeviceId(key.objectId);
@ -1345,7 +1345,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
// 只导出缺陷
patrolResultRefs = patrolResultRefs.stream().filter((item) -> "0".equals(item.getResultType())).collect(Collectors.toList());
// 分组按点位ID和算法类型进行分组
Map<GroupKey, List<PatrolResultRef>> groupKeyListMap = patrolResultRefs.stream().collect(Collectors.groupingBy(item -> new GroupKey(item.getDeviceId(), item.getAlgType())));
Map<GroupKey, List<PatrolResultRef>> groupKeyListMap = patrolResultRefs.stream().collect(Collectors.groupingBy(item -> new GroupKey(item.getDeviceId(), item.getAlgType(), item.getTaskPatrolledId())));
groupKeyListMap.forEach((key, value) -> {
PatrolResultRef patrolResultRef = new PatrolResultRef();
patrolResultRef.setDeviceId(key.objectId);
@ -1471,10 +1471,12 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
private static class GroupKey {
private final String objectId;
private final String algType;
private final String taskPatrolled;
public GroupKey(String objectId, String algType) {
public GroupKey(String objectId, String algType, String taskPatrolled) {
this.objectId = objectId;
this.algType = algType;
this.taskPatrolled = taskPatrolled;
}
@Override
@ -1482,13 +1484,13 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GroupKey groupKey = (GroupKey) o;
return Objects.equals(objectId, groupKey.objectId) && Objects.equals(algType, groupKey.algType);
return Objects.equals(objectId, groupKey.objectId) && Objects.equals(algType, groupKey.algType) && Objects.equals(taskPatrolled, groupKey.taskPatrolled);
}
@Override
public int hashCode() {
return Objects.hash(objectId, algType);
return Objects.hash(objectId, algType, taskPatrolled);
}
}


+ 2
- 0
inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml View File

@ -611,6 +611,7 @@
<result property="valueUnit" column="value_unit"/>
<result property="resultContent" column="result_content"/>
<result property="resultType" column="result_type"/>
<result property="taskPatrolledId" column="task_patrol_id"/>
<result property="algType" column="alg_type"/>
<result property="algName" column="alg_name"/>
</resultMap>
@ -647,6 +648,7 @@
b.description,
b.point_status,
b.result_type,
b.task_patrol_id,
a.value_unit,
b.result_content,
b.alg_type,


Loading…
Cancel
Save