From 52969f19b18c38c5e30b70d698e24727aeb0a762 Mon Sep 17 00:00:00 2001 From: wangguangyuan Date: Mon, 15 Sep 2025 11:45:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=8D=E5=85=B4=E6=96=B0=E9=9C=80=E6=B1=82?= =?UTF-8?q?=EF=BC=8C=E6=8A=A5=E5=91=8A=E6=95=B0=E6=8D=AE=E6=9D=A5=E6=BA=90?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=90=E8=AE=BE=E5=A4=87=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/inspect/partrolresult/domain/PatrolResultRef.java | 6 ++++-- .../partrolresult/service/impl/PatrolResultServiceImpl.java | 6 ++++-- .../src/main/resources/mapper/task/PatrolResultMapper.xml | 6 ++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/PatrolResultRef.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/PatrolResultRef.java index 1f81682..4c69913 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/PatrolResultRef.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/PatrolResultRef.java @@ -11,6 +11,7 @@ public class PatrolResultRef { private String lineId; private String deviceId; private String devType; + private String deviceSource; private String time; private String value; private String algType; @@ -42,12 +43,12 @@ public class PatrolResultRef { if (this == object) return true; if (object == null || getClass() != object.getClass()) return false; PatrolResultRef that = (PatrolResultRef) object; - return Objects.equals(lineId, that.lineId) && Objects.equals(deviceId, that.deviceId) && Objects.equals(devType, that.devType) && Objects.equals(time, that.time) && Objects.equals(value, that.value) && Objects.equals(algType, that.algType) && Objects.equals(algName, that.algName) && Objects.equals(threshold, that.threshold) && Objects.equals(filePath, that.filePath) && Objects.equals(description, that.description) && Objects.equals(pointStatus, that.pointStatus) && Objects.equals(valueUnit, that.valueUnit) && Objects.equals(resultContent, that.resultContent); + return Objects.equals(lineId, that.lineId) && Objects.equals(deviceId, that.deviceId) && Objects.equals(devType, that.devType) && Objects.equals(deviceSource, deviceSource) && Objects.equals(time, that.time) && Objects.equals(value, that.value) && Objects.equals(algType, that.algType) && Objects.equals(algName, that.algName) && Objects.equals(threshold, that.threshold) && Objects.equals(filePath, that.filePath) && Objects.equals(description, that.description) && Objects.equals(pointStatus, that.pointStatus) && Objects.equals(valueUnit, that.valueUnit) && Objects.equals(resultContent, that.resultContent); } @Override public int hashCode() { - return Objects.hash(lineId, deviceId, devType, time, value, algType, algName, threshold, filePath, description, pointStatus, valueUnit, resultContent); + return Objects.hash(lineId, deviceId, devType, deviceSource, time, value, algType, algName, threshold, filePath, description, pointStatus, valueUnit, resultContent); } @Override @@ -56,6 +57,7 @@ public class PatrolResultRef { "lineId='" + lineId + '\'' + ", deviceId='" + deviceId + '\'' + ", devType='" + devType + '\'' + + ", deviceSource='" + deviceSource + '\'' + ", time='" + time + '\'' + ", value='" + value + '\'' + ", algType='" + algType + '\'' + diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java index c9c72d5..3b5888a 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java @@ -819,6 +819,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { } } patrolResultRef.setDevType(value.stream().map(item -> item.getDevType() != null ? item.getDevType() : "").distinct().findFirst().orElse("")); + patrolResultRef.setDeviceSource(value.stream().map(item -> item.getDeviceSource() != null ? item.getDeviceSource() : "").distinct().findFirst().orElse("")); patrolResultRef.setTime(value.stream().map(item -> item.getTime() != null ? item.getTime() : "").distinct().findFirst().orElse("")); patrolResultRef.setThreshold(value.stream().map(item -> item.getThreshold() != null ? item.getThreshold() : "").distinct().findFirst().orElse("")); patrolResultRef.setAlgName(value.get(0).getAlgName()); @@ -860,7 +861,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { reportData.setEqName(basePointAreaInfo.getMainName()); reportData.setParts(basePointAreaInfo.getDeviceName()); reportData.setPointName(basePointAreaInfo.getPatrolPointName()); - reportData.setDataSources("0".equals(devType) ? messageUtils.get("无人机") : "1".equals(devType) ? messageUtils.get("机器人") : messageUtils.get("高清视频")); + reportData.setDataSources(patrolResultRef.getDeviceSource()); reportData.setAcquisitionTime(DateUtils.parse(DateUtils.yyyyMMddHHmmss2, patrolResultRef.getTime())); if ("1".equals(patrolResultRef.getResultType()) && validAlgTypes.contains(patrolResultRef.getAlgType())) { reportData.setInspectionResults(patrolResultRef.getValue()); @@ -1366,6 +1367,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { } } patrolResultRef.setDevType(value.stream().map(item -> item.getDevType() != null ? item.getDevType() : "").distinct().findFirst().orElse("")); + patrolResultRef.setDeviceSource(value.stream().map(item -> item.getDeviceSource() != null ? item.getDeviceSource() : "").distinct().findFirst().orElse("")); patrolResultRef.setTime(value.stream().map(item -> item.getTime() != null ? item.getTime() : "").distinct().findFirst().orElse("")); patrolResultRef.setThreshold(value.stream().map(item -> item.getThreshold() != null ? item.getThreshold() : "").distinct().findFirst().orElse("")); patrolResultRef.setAlgName(value.get(0).getAlgName()); @@ -1401,7 +1403,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { reportData.setEqName(basePointAreaInfo.getMainName()); reportData.setParts(basePointAreaInfo.getDeviceName()); reportData.setPointName(basePointAreaInfo.getPatrolPointName()); - reportData.setDataSources("0".equals(devType) ? messageUtils.get("无人机") : "1".equals(devType) ? messageUtils.get("机器人") : messageUtils.get("高清视频")); + reportData.setDataSources(patrolResultRef.getDeviceSource()); reportData.setAcquisitionTime(DateUtils.parse(DateUtils.yyyyMMddHHmmss2, patrolResultRef.getTime())); if ("1".equals(patrolResultRef.getResultType()) && validAlgTypes.contains(patrolResultRef.getAlgType())) { reportData.setInspectionResults(patrolResultRef.getValue()); diff --git a/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml b/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml index a1e9b98..72ff175 100644 --- a/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml +++ b/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml @@ -600,6 +600,7 @@ + @@ -637,6 +638,7 @@ select a.line_id, a.device_id, c.dev_type, + COALESCE(e.device_source, h.device_source) as device_source, a.time, b.res_value value, a.threshold, @@ -655,6 +657,10 @@ left join patrol_task_info c on a.task_code = c.task_major_id and a.device_id = c.device_id and a.patrol_device_code = c.dev_no + left join patrol_preset_pos f1 on c.device_id = f1.patrol_point_id and c.dev_type not in ('0', '1') + left join basedata_eqpbook_channel e on f1.channel_id = e.channel_id and c.dev_type not in ('0', '1') + left join basedata_patrolpoint_preset f2 on c.device_id = f2.patrol_point_id and c.dev_type in ('0', '1') + left join basedata_eqpbook h on f2.eqp_book_id = h.eqp_book_id and c.dev_type in ('0', '1') where a.main_id in