声纹逻辑优化
This commit is contained in:
parent
3d1b94c8d7
commit
9ab2fd83f9
@ -1,5 +1,6 @@
|
||||
package com.yfd.platform.component.voiceserver.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
|
@ -1290,4 +1290,35 @@ public class SubstationPatroldeviceController {
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/getVoicePrintByArea")
|
||||
@ApiOperation("获取区域下的声纹")
|
||||
public ResponseResult getVoicePrintByArea(String stationId, String deviceName, String status) {
|
||||
if (StrUtil.isBlank(stationId)) {
|
||||
return ResponseResult.error("未传变电站信息");
|
||||
}
|
||||
LambdaQueryWrapper<SubstationPatroldevice> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SubstationPatroldevice::getStationId, stationId);
|
||||
if (StrUtil.isNotBlank(deviceName)) {
|
||||
queryWrapper.like(SubstationPatroldevice::getPatroldeviceName, deviceName);
|
||||
}
|
||||
if (StrUtil.isNotBlank(status)) {
|
||||
queryWrapper.eq(SubstationPatroldevice::getOnline, status);
|
||||
}
|
||||
queryWrapper.eq(SubstationPatroldevice::getType, "14");
|
||||
List<Map<String, Object>> maps = substationPatroldeviceService.listMaps(queryWrapper);
|
||||
if (maps.size() <= 0) {
|
||||
return ResponseResult.successData(null);
|
||||
}
|
||||
Map<String, List<Map<String, Object>>> deviceList = maps.stream().filter(m -> ObjectUtil.isNotEmpty(m.get(
|
||||
"areaName"))).collect(Collectors.groupingBy(m -> m.get("areaName").toString()));
|
||||
List<Map<String, Object>> deviceTree = new ArrayList<>();
|
||||
for (String key : deviceList.keySet()) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("name", key);
|
||||
map.put("children", deviceList.get(key));
|
||||
deviceTree.add(map);
|
||||
}
|
||||
return ResponseResult.successData(deviceTree);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -107,7 +107,6 @@ public class VoicePatrolLogController {
|
||||
// 基础日志对象构建方法
|
||||
private VoicePatrolLog buildBaseLog(SubstationPatroldevice device, String duration) {
|
||||
VoicePatrolLog log = new VoicePatrolLog();
|
||||
log.setId(IdUtil.fastSimpleUUID());
|
||||
log.setPatroldeviceId(device.getPatroldeviceId());
|
||||
log.setPatroldeviceCode(device.getPatroldeviceCode());
|
||||
log.setPatroldeviceName(device.getPatroldeviceName());
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.yfd.platform.modules.basedata.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
@ -7,7 +9,7 @@ import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zhengsl
|
||||
@ -23,6 +25,7 @@ public class VoicePatrolLog implements Serializable {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
|
@ -63,7 +63,7 @@
|
||||
isc.bay_name
|
||||
FROM
|
||||
fk_device_signal fds
|
||||
INNER JOIN iis_substation_component isc ON isc.component_id = fds.main_compnent_id
|
||||
INNER JOIN iis_substation_component isc ON isc.component_id = fds.main_component_id
|
||||
WHERE 1=1
|
||||
<if test="stationCode != null and stationCode != ''">
|
||||
AND isc.station_code = #{stationCode}
|
||||
|
Loading…
Reference in New Issue
Block a user