|
|
|
@ -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); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|