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