优化逻辑
This commit is contained in:
parent
ef033aa4bb
commit
82f58dc262
@ -177,7 +177,7 @@ public class DeviceSignalServiceImpl extends ServiceImpl<DeviceSignalMapper, Dev
|
|||||||
queryWrapper.eq(DeviceSignal::getMainComponentId, componentId);
|
queryWrapper.eq(DeviceSignal::getMainComponentId, componentId);
|
||||||
}
|
}
|
||||||
//排序
|
//排序
|
||||||
queryWrapper.orderByDesc(DeviceSignal::getSignalCode);
|
queryWrapper.orderByAsc(DeviceSignal::getOrderno);
|
||||||
return deviceSignalMapper.selectPage(page, queryWrapper);
|
return deviceSignalMapper.selectPage(page, queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,4 +244,10 @@ public class SubstationDevice implements Serializable {
|
|||||||
* 生效区域
|
* 生效区域
|
||||||
*/
|
*/
|
||||||
private String effectiveArea;
|
private String effectiveArea;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 声纹设备缺陷类型,声纹缺陷list集合,采用","分隔
|
||||||
|
*/
|
||||||
|
private String voiceAnalysisTypeList;
|
||||||
}
|
}
|
||||||
|
@ -213,9 +213,12 @@ public class AnalyseCallController {
|
|||||||
filename = StrUtil.replace(filename, "\\", "/");
|
filename = StrUtil.replace(filename, "\\", "/");
|
||||||
}
|
}
|
||||||
String originfilename = Config.getSnapFilePath() + filename;
|
String originfilename = Config.getSnapFilePath() + filename;
|
||||||
|
if (cn.hutool.core.io.FileUtil.exist(originfilename)) {
|
||||||
FileUtil.playAudio(originfilename, response);
|
FileUtil.playAudio(originfilename, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/snapandviewimage")
|
@GetMapping("/snapandviewimage")
|
||||||
@ApiOperation("截取视频流文件并预览图片")
|
@ApiOperation("截取视频流文件并预览图片")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
@ -295,4 +295,9 @@ public class TaskResult implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String phase;
|
private String phase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 声纹设备缺陷类型,声纹缺陷list集合,采用","分隔
|
||||||
|
*/
|
||||||
|
private String voiceAnalysisTypeList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -507,6 +507,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
|
|||||||
taskResult.setTaskCode(taskCode);
|
taskResult.setTaskCode(taskCode);
|
||||||
ordernum++;
|
ordernum++;
|
||||||
taskResult.setOrderNum(ordernum);
|
taskResult.setOrderNum(ordernum);
|
||||||
|
taskResult.setVoiceAnalysisTypeList(substationDevice.getVoiceAnalysisTypeList());
|
||||||
// 点位id
|
// 点位id
|
||||||
String deviceId = substationDevice.getDeviceId();
|
String deviceId = substationDevice.getDeviceId();
|
||||||
taskResult.setDeviceId(deviceId);
|
taskResult.setDeviceId(deviceId);
|
||||||
|
@ -6,6 +6,7 @@ import java.io.BufferedReader;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class VideoToImageUtil {
|
public class VideoToImageUtil {
|
||||||
@ -36,11 +37,13 @@ public class VideoToImageUtil {
|
|||||||
.start();
|
.start();
|
||||||
|
|
||||||
// 等待FFmpeg进程完成
|
// 等待FFmpeg进程完成
|
||||||
int exitCode = process.waitFor();
|
boolean isFlag = process.waitFor(3, TimeUnit.SECONDS);
|
||||||
if (exitCode == 0) {
|
if (isFlag) {
|
||||||
log.info("视频帧提取完毕!");
|
log.info("视频帧提取完毕!");
|
||||||
} else {
|
} else {
|
||||||
log.info("FFmpeg进程出错");
|
log.info("FFmpeg进程出错");
|
||||||
|
process.destroy();
|
||||||
|
throw new RuntimeException("抓取视频失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -44,38 +44,15 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="getDeviceWorkData" resultType="java.util.Map">
|
<select id="getDeviceWorkData" resultType="java.util.Map">
|
||||||
SELECT
|
SELECT
|
||||||
di.*,-- 保留第一个子查询的所有字段
|
ds.signal_id,
|
||||||
COALESCE ( sub.yc_value, '无' ) AS value
|
ds.signal_code itemcode,
|
||||||
,-- 将 NULL 转为 "无"
|
ds.signal_name dictname,
|
||||||
di.unit,
|
COALESCE ( ds.yc_value, '无' ) AS value,
|
||||||
sub.signalId AS sub_signalId,-- 可选:重命名避免字段冲突
|
ds.signal_unit unit
|
||||||
sub.ip AS sub_ip
|
|
||||||
FROM
|
FROM
|
||||||
(
|
fk_device_signal ds
|
||||||
SELECT
|
INNER JOIN iis_substation_component sc ON ds.main_component_id = sc.component_id
|
||||||
*,
|
|
||||||
JSON_UNQUOTE(
|
|
||||||
JSON_EXTRACT( custom1, '$.signalId' )) AS signalId,
|
|
||||||
JSON_UNQUOTE(
|
|
||||||
JSON_EXTRACT( custom1, '$.unit' )) AS unit,
|
|
||||||
JSON_UNQUOTE(
|
|
||||||
JSON_EXTRACT( custom1, '$.ip' )) AS ip -- 确保提取的是 ip 字段
|
|
||||||
|
|
||||||
FROM
|
|
||||||
sys_dictionary_items
|
|
||||||
WHERE
|
WHERE
|
||||||
dictid = 'ca593d0a2a60f7ef37c89e615b97024b'
|
sc.component_name = '微气象设备部件'
|
||||||
) di
|
|
||||||
LEFT JOIN (-- 使用 LEFT JOIN 保留 di 的所有记录
|
|
||||||
SELECT
|
|
||||||
b.yc_value,
|
|
||||||
b.signal_id AS signalId,
|
|
||||||
c.ip_addr AS ip
|
|
||||||
FROM
|
|
||||||
fk_meter_device a
|
|
||||||
INNER JOIN fk_device_signal b ON a.device_id = b.meter_device_id
|
|
||||||
INNER JOIN fk_gateway_device c ON a.netdevice_ip = c.ip_addr
|
|
||||||
) sub ON di.signalId = sub.signalId
|
|
||||||
AND di.ip = sub.ip ORDER BY orderno;
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -70,6 +70,7 @@
|
|||||||
FROM
|
FROM
|
||||||
iis_alarm_log
|
iis_alarm_log
|
||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
|
AND check_flag!='0'
|
||||||
<if test="stationId != null and stationId != ''">
|
<if test="stationId != null and stationId != ''">
|
||||||
AND station_id = #{stationId}
|
AND station_id = #{stationId}
|
||||||
</if>
|
</if>
|
||||||
|
Loading…
Reference in New Issue
Block a user