Browse Source

绍兴新需求,报告数据来源修改成设备来源

master
wangguangyuan 3 months ago
parent
commit
52969f19b1
3 changed files with 14 additions and 4 deletions
  1. +4
    -2
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/PatrolResultRef.java
  2. +4
    -2
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java
  3. +6
    -0
      inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml

+ 4
- 2
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/PatrolResultRef.java View File

@ -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 + '\'' +


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

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


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

@ -600,6 +600,7 @@
<result property="lineId" column="line_id"/>
<result property="deviceId" column="device_id"/>
<result property="devType" column="dev_type"/>
<result property="deviceSource" column="device_source"/>
<result property="time" column="time"/>
<result property="value" column="value"/>
<result property="threshold" column="threshold"/>
@ -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
<foreach collection="mainIds" item="item" index="index" open="(" separator="," close=")">


Loading…
Cancel
Save