优化逻辑
This commit is contained in:
parent
ba38006687
commit
44576b6147
@ -151,8 +151,8 @@ user-settings:
|
|||||||
- http://192.168.1.8:3000
|
- http://192.168.1.8:3000
|
||||||
# 项目中扩展辅助设置
|
# 项目中扩展辅助设置
|
||||||
station:
|
station:
|
||||||
id: 9b4e9d9f70b2256a69dfcbdecb13c960
|
id: 35c4e466ddd9809445d3f880f94b4a2f
|
||||||
staion_code: 500KV00001
|
staion_code: 7FE4BB37-F54A-4808-852B-6CAB43DD71B3-00001
|
||||||
staion_name: 500Kv标准验证变电站
|
staion_name: 500V变电站
|
||||||
snapfilepath: d:\riis\parent-snapimage\ #上级单位视频截图保存路径
|
snapfilepath: d:\riis\parent-snapimage\ #上级单位视频截图保存路径
|
||||||
ffmpegpath: E:\ffmpeg\bin\ #ffmpeg 工具目录
|
ffmpegpath: E:\ffmpeg\bin\ #ffmpeg 工具目录
|
||||||
|
@ -63,7 +63,8 @@ public class VoiceServerServiceImpl implements VoiceServerService {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if ("OFF".equals(actionPower)) {
|
if ("OFF".equals(actionPower)) {
|
||||||
this.createAudioFile(fileName);
|
FileUtil.copy("D:\\riis\\video\\sound.wav", httpServerConfig.getSnapFilePath() + fileName, true);
|
||||||
|
// this.createAudioFile(fileName);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import com.yfd.platform.config.ResponseResult;
|
|||||||
import com.yfd.platform.modules.algorithm.domain.AlgorithmClass;
|
import com.yfd.platform.modules.algorithm.domain.AlgorithmClass;
|
||||||
import com.yfd.platform.modules.algorithm.domain.AlgorithmParamsRequest;
|
import com.yfd.platform.modules.algorithm.domain.AlgorithmParamsRequest;
|
||||||
import com.yfd.platform.modules.algorithm.service.IAlgorithmClassService;
|
import com.yfd.platform.modules.algorithm.service.IAlgorithmClassService;
|
||||||
|
import com.yfd.platform.modules.basedata.domain.TreeNode;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -40,6 +41,13 @@ public class AlgorithmClassController {
|
|||||||
return ResponseResult.successData(list);
|
return ResponseResult.successData(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getAlgorithmClassTree")
|
||||||
|
@ApiOperation("获取算法分类树")
|
||||||
|
public ResponseResult getAlgorithmClassTree(String algorithmClassName) {
|
||||||
|
List<TreeNode> treeNodes = algorithmClassService.getAlgorithmComponentTree(algorithmClassName);
|
||||||
|
return ResponseResult.successData(treeNodes);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/addAlgorithmClass")
|
@PostMapping("/addAlgorithmClass")
|
||||||
@ApiOperation("新增算法分类")
|
@ApiOperation("新增算法分类")
|
||||||
public ResponseResult addAlgorithmClass(@RequestBody AlgorithmClass algorithmClass) {
|
public ResponseResult addAlgorithmClass(@RequestBody AlgorithmClass algorithmClass) {
|
||||||
@ -86,4 +94,18 @@ public class AlgorithmClassController {
|
|||||||
return ResponseResult.error();
|
return ResponseResult.error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/callAlgorithmAnalyse")
|
||||||
|
@ApiOperation("调用算法分析")
|
||||||
|
public ResponseResult callAlgorithmAnalyse(String id) {
|
||||||
|
if (StrUtil.isBlank(id)) {
|
||||||
|
return ResponseResult.error("算法分类id为空");
|
||||||
|
}
|
||||||
|
boolean isOK = algorithmClassService.deleteAlgorithmClass(id);
|
||||||
|
if (isOK) {
|
||||||
|
return ResponseResult.success();
|
||||||
|
} else {
|
||||||
|
return ResponseResult.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ public class AlgorithmDevice implements Serializable {
|
|||||||
* 算法分类id
|
* 算法分类id
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("算法分类id")
|
@ApiModelProperty("算法分类id")
|
||||||
private String algorithm_id;
|
private String algorithmId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数id
|
* 参数id
|
||||||
|
@ -3,6 +3,9 @@ package com.yfd.platform.modules.algorithm.mapper;
|
|||||||
import com.yfd.platform.modules.algorithm.domain.AlgorithmClassComponent;
|
import com.yfd.platform.modules.algorithm.domain.AlgorithmClassComponent;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Mapper 接口
|
* Mapper 接口
|
||||||
@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
*/
|
*/
|
||||||
public interface AlgorithmClassComponentMapper extends BaseMapper<AlgorithmClassComponent> {
|
public interface AlgorithmClassComponentMapper extends BaseMapper<AlgorithmClassComponent> {
|
||||||
|
|
||||||
|
List<Map<String, Object>> getAlgorithmComponentList(String algorithmClassName);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,9 @@ package com.yfd.platform.modules.algorithm.service;
|
|||||||
import com.yfd.platform.modules.algorithm.domain.AlgorithmClass;
|
import com.yfd.platform.modules.algorithm.domain.AlgorithmClass;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.yfd.platform.modules.algorithm.domain.AlgorithmParamsRequest;
|
import com.yfd.platform.modules.algorithm.domain.AlgorithmParamsRequest;
|
||||||
|
import com.yfd.platform.modules.basedata.domain.TreeNode;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -36,6 +39,18 @@ public interface IAlgorithmClassService extends IService<AlgorithmClass> {
|
|||||||
***********************************/
|
***********************************/
|
||||||
boolean deleteAlgorithmClass(String id);
|
boolean deleteAlgorithmClass(String id);
|
||||||
|
|
||||||
|
/**********************************
|
||||||
|
* 用途说明: 保存算法分类和算法参数
|
||||||
|
* 参数说明 algorithmParamsRequest
|
||||||
|
* 返回值说明: boolean
|
||||||
|
***********************************/
|
||||||
boolean addAlgorithmClassAndParams(AlgorithmParamsRequest algorithmParamsRequest);
|
boolean addAlgorithmClassAndParams(AlgorithmParamsRequest algorithmParamsRequest);
|
||||||
|
|
||||||
|
/***********************************
|
||||||
|
* 用途说明: 获取算法分类树
|
||||||
|
* 参数说明 algorithmClassName
|
||||||
|
* 返回值说明: java.util.List<com.yfd.platform.modules.basedata.domain.TreeNode>
|
||||||
|
***********************************/
|
||||||
|
List<TreeNode> getAlgorithmComponentTree(String algorithmClassName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,18 +8,23 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|||||||
import com.yfd.platform.modules.algorithm.domain.AlgorithmClass;
|
import com.yfd.platform.modules.algorithm.domain.AlgorithmClass;
|
||||||
import com.yfd.platform.modules.algorithm.domain.AlgorithmParams;
|
import com.yfd.platform.modules.algorithm.domain.AlgorithmParams;
|
||||||
import com.yfd.platform.modules.algorithm.domain.AlgorithmParamsRequest;
|
import com.yfd.platform.modules.algorithm.domain.AlgorithmParamsRequest;
|
||||||
|
import com.yfd.platform.modules.algorithm.mapper.AlgorithmClassComponentMapper;
|
||||||
import com.yfd.platform.modules.algorithm.mapper.AlgorithmClassMapper;
|
import com.yfd.platform.modules.algorithm.mapper.AlgorithmClassMapper;
|
||||||
import com.yfd.platform.modules.algorithm.mapper.AlgorithmParamsMapper;
|
import com.yfd.platform.modules.algorithm.mapper.AlgorithmParamsMapper;
|
||||||
import com.yfd.platform.modules.algorithm.service.IAlgorithmClassService;
|
import com.yfd.platform.modules.algorithm.service.IAlgorithmClassService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.yfd.platform.modules.algorithm.service.IAlgorithmParamsService;
|
import com.yfd.platform.modules.algorithm.service.IAlgorithmParamsService;
|
||||||
|
import com.yfd.platform.modules.basedata.domain.TreeNode;
|
||||||
import com.yfd.platform.utils.SecurityUtils;
|
import com.yfd.platform.utils.SecurityUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -36,6 +41,9 @@ public class AlgorithmClassServiceImpl extends ServiceImpl<AlgorithmClassMapper,
|
|||||||
@Resource
|
@Resource
|
||||||
private IAlgorithmParamsService algorithmParamsService;
|
private IAlgorithmParamsService algorithmParamsService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AlgorithmClassComponentMapper algorithmClassComponentMapper;
|
||||||
|
|
||||||
/**********************************
|
/**********************************
|
||||||
* 用途说明: 新增算法分类
|
* 用途说明: 新增算法分类
|
||||||
* 参数说明 algorithmClass
|
* 参数说明 algorithmClass
|
||||||
@ -74,6 +82,11 @@ public class AlgorithmClassServiceImpl extends ServiceImpl<AlgorithmClassMapper,
|
|||||||
throw new RuntimeException("删除错误");
|
throw new RuntimeException("删除错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**********************************
|
||||||
|
* 用途说明: 保存算法分类和算法参数
|
||||||
|
* 参数说明 algorithmParamsRequest
|
||||||
|
* 返回值说明: boolean
|
||||||
|
***********************************/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean addAlgorithmClassAndParams(AlgorithmParamsRequest algorithmParamsRequest) {
|
public boolean addAlgorithmClassAndParams(AlgorithmParamsRequest algorithmParamsRequest) {
|
||||||
@ -96,4 +109,71 @@ public class AlgorithmClassServiceImpl extends ServiceImpl<AlgorithmClassMapper,
|
|||||||
});
|
});
|
||||||
return algorithmParamsService.saveOrUpdateBatch(algorithmParamsList);
|
return algorithmParamsService.saveOrUpdateBatch(algorithmParamsList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************
|
||||||
|
* 用途说明: 获取算法分类树
|
||||||
|
* 参数说明 algorithmClassName
|
||||||
|
* 返回值说明: java.util.List<com.yfd.platform.modules.basedata.domain.TreeNode>
|
||||||
|
***********************************/
|
||||||
|
@Override
|
||||||
|
public List<TreeNode> getAlgorithmComponentTree(String algorithmClassName) {
|
||||||
|
List<Map<String, Object>> dataList =
|
||||||
|
algorithmClassComponentMapper.getAlgorithmComponentList(algorithmClassName);
|
||||||
|
List<TreeNode> treeNodes = this.buildSignalTree(dataList);
|
||||||
|
if (treeNodes.size() <= 0) {
|
||||||
|
return treeNodes;
|
||||||
|
}
|
||||||
|
return treeNodes.get(0).getChildren();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************
|
||||||
|
* 用途说明: 构造树
|
||||||
|
* 参数说明 dataList 数据
|
||||||
|
* 返回值说明: java.util.List<com.yfd.platform.modules.basedata.domain.TreeNode>
|
||||||
|
***********************************/
|
||||||
|
public List<TreeNode> buildSignalTree(List<Map<String, Object>> dataList) {
|
||||||
|
// 存储所有节点(使用ID作为键)
|
||||||
|
Map<String, TreeNode> nodeMap = new HashMap<>();
|
||||||
|
// 存储最终返回的根节点列表
|
||||||
|
List<TreeNode> roots = new ArrayList<>();
|
||||||
|
// 遍历原始数据
|
||||||
|
for (Map<String, Object> data : dataList) {
|
||||||
|
// 1. 解析各层级信息(根据实际字段名称调整)
|
||||||
|
String stationCode = (String) data.get("stationCode");
|
||||||
|
String stationName = (String) data.get("stationName");
|
||||||
|
String algorithmId = (String) data.get("algorithmId");
|
||||||
|
String algorithmClassName = (String) data.get("algorithmClassName");
|
||||||
|
String componentId = (String) data.get("componentId");
|
||||||
|
String componentName = (String) data.get("componentName");
|
||||||
|
|
||||||
|
TreeNode stationNode = nodeMap.computeIfAbsent(stationCode,
|
||||||
|
k -> {
|
||||||
|
TreeNode node = new TreeNode(stationCode, stationName);
|
||||||
|
roots.add(node); // 将变电站作为根节点
|
||||||
|
return node;
|
||||||
|
});
|
||||||
|
if (StrUtil.isNotBlank(algorithmId)) {
|
||||||
|
// 处理变电站层级
|
||||||
|
TreeNode areaNode = nodeMap.computeIfAbsent(algorithmId,
|
||||||
|
k -> {
|
||||||
|
TreeNode node = new TreeNode(algorithmId, algorithmClassName);
|
||||||
|
stationNode.getChildren().add(node); // 将变电站作为根节点
|
||||||
|
return node;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 处理区域层级
|
||||||
|
if (StrUtil.isNotBlank(componentId)) {
|
||||||
|
nodeMap.computeIfAbsent(componentId,
|
||||||
|
k -> {
|
||||||
|
TreeNode node = new TreeNode(componentId, componentName);
|
||||||
|
areaNode.getChildren().add(node);
|
||||||
|
return node;
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return roots;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.yfd.platform.modules.auxcontrol.controller;
|
package com.yfd.platform.modules.auxcontrol.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.yfd.platform.config.ResponseResult;
|
import com.yfd.platform.config.ResponseResult;
|
||||||
import com.yfd.platform.modules.auxcontrol.domain.DeviceSignal;
|
import com.yfd.platform.modules.auxcontrol.domain.DeviceSignal;
|
||||||
@ -67,7 +68,7 @@ public class DeviceWorkDataController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 按分钟分组数据
|
// 按分钟分组数据
|
||||||
Map<LocalDateTime, BigDecimal> minuteDataMap = new HashMap<>();
|
Map<LocalDateTime, String> minuteDataMap = new HashMap<>();
|
||||||
for (DeviceWorkData data : deviceWorkDataList) {
|
for (DeviceWorkData data : deviceWorkDataList) {
|
||||||
LocalDateTime minuteKey = data.getStartTime().truncatedTo(ChronoUnit.MINUTES);
|
LocalDateTime minuteKey = data.getStartTime().truncatedTo(ChronoUnit.MINUTES);
|
||||||
minuteDataMap.put(minuteKey, data.getValue());
|
minuteDataMap.put(minuteKey, data.getValue());
|
||||||
@ -79,8 +80,11 @@ public class DeviceWorkDataController {
|
|||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH时mm分");
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH时mm分");
|
||||||
for (LocalDateTime slot : minuteSlots) {
|
for (LocalDateTime slot : minuteSlots) {
|
||||||
xAxisData.add(slot.format(formatter));
|
xAxisData.add(slot.format(formatter));
|
||||||
BigDecimal value = minuteDataMap.getOrDefault(slot, BigDecimal.ZERO);
|
String value = minuteDataMap.getOrDefault(slot, "0");
|
||||||
seriesData.add(value.doubleValue());
|
if (!NumberUtil.isDouble(value)) {
|
||||||
|
value="0";
|
||||||
|
}
|
||||||
|
seriesData.add(NumberUtil.parseDouble(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建ECharts数据结构
|
// 构建ECharts数据结构
|
||||||
|
@ -77,7 +77,7 @@ public class DeviceWorkData implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 值
|
* 值
|
||||||
*/
|
*/
|
||||||
private BigDecimal value;
|
private String value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备用1
|
* 备用1
|
||||||
|
@ -59,7 +59,7 @@ public class DeviceWorkDataServiceImpl extends ServiceImpl<DeviceWorkDataMapper,
|
|||||||
workdata.setSignalId(map.get("signalId").toString());
|
workdata.setSignalId(map.get("signalId").toString());
|
||||||
workdata.setSignalName(map.get("signalName").toString());
|
workdata.setSignalName(map.get("signalName").toString());
|
||||||
workdata.setUnit(ObjUtil.isNotEmpty(map.get("signalUnit")) ? map.get("signalUnit").toString() : "");
|
workdata.setUnit(ObjUtil.isNotEmpty(map.get("signalUnit")) ? map.get("signalUnit").toString() : "");
|
||||||
workdata.setValue(new BigDecimal(value));
|
workdata.setValue(value);
|
||||||
if (StrUtil.isEmpty(dateTimeString) || "null".equals(dateTimeString)) {
|
if (StrUtil.isEmpty(dateTimeString) || "null".equals(dateTimeString)) {
|
||||||
workdata.setStartTime(LocalDateTime.now());
|
workdata.setStartTime(LocalDateTime.now());
|
||||||
} else {
|
} else {
|
||||||
|
@ -124,7 +124,7 @@ public class SubstationPatroldeviceController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ("1".equals(flag)) {
|
if ("1".equals(flag)) {
|
||||||
queryWrapper.and(i -> i.isNull(SubstationPatroldevice::getStationId).or().eq(SubstationPatroldevice::getStationId, ""));
|
queryWrapper.and(i -> i.isNull(SubstationPatroldevice::getAreaId).or().eq(SubstationPatroldevice::getAreaId, ""));
|
||||||
} else {
|
} else {
|
||||||
queryWrapper.eq(SubstationPatroldevice::getStationId, stationId);
|
queryWrapper.eq(SubstationPatroldevice::getStationId, stationId);
|
||||||
if (StrUtil.isNotBlank(areaId)) {
|
if (StrUtil.isNotBlank(areaId)) {
|
||||||
|
@ -593,51 +593,75 @@ public class SubstationPatroldeviceServiceImpl extends ServiceImpl<SubstationPat
|
|||||||
}
|
}
|
||||||
List<SubstationPatroldevice> list = this.list(queryWrapper);
|
List<SubstationPatroldevice> list = this.list(queryWrapper);
|
||||||
List<Map<String, Object>> mapList = new ArrayList<>();
|
List<Map<String, Object>> mapList = new ArrayList<>();
|
||||||
List<Map<String, Object>> patrolEquipmentType = sysDictionaryItemsService.getDeviceByType(
|
Map<String, Object> patrolEquipmentType = sysDictionaryItemsService.getDeviceMapByType(
|
||||||
"PatrolEquipmentType");
|
"PatrolEquipmentType");
|
||||||
|
JSONObject patrolEquipmentTypeMap=JSONUtil.parseObj(patrolEquipmentType.get("resultMap"));
|
||||||
|
|
||||||
for (SubstationPatroldevice substationPatroldevice : list) {
|
Map<String, Object> manuFacturer = sysDictionaryItemsService.getDeviceMapByType(
|
||||||
String devtype = "";
|
"ManuFacturer");
|
||||||
for (Map<String, Object> map : patrolEquipmentType) {
|
JSONObject manuFacturerMap=JSONUtil.parseObj(manuFacturer.get("resultMap"));
|
||||||
String itemcode = (String) map.get("itemcode");
|
for (int i = 0; i < list.size(); i++) {
|
||||||
if (itemcode.equals(type)) {
|
SubstationPatroldevice substationPatroldevice = list.get(i);
|
||||||
devtype = map.get("dictname").toString();
|
String devtype = StrUtil.isNotBlank(type) ? patrolEquipmentTypeMap.getStr(type) : "";
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
map.put("devtype", devtype);
|
map.put("序号", (i + 1));
|
||||||
map.put("devname", substationPatroldevice.getPatroldeviceName());
|
map.put("设备名称", substationPatroldevice.getPatroldeviceName());
|
||||||
map.put("devdesc", "");
|
map.put("设备类型", devtype);
|
||||||
map.put("devmodel", substationPatroldevice.getDeviceModel());
|
map.put("设备型号", substationPatroldevice.getDeviceModel());
|
||||||
map.put("manufacturer", substationPatroldevice.getManufacturer());
|
map.put("设备来源", substationPatroldevice.getDeviceSource());
|
||||||
map.put("madein", "");
|
String manufacturerName = StrUtil.isNotBlank(substationPatroldevice.getManufacturer()) ? manuFacturerMap.getStr(substationPatroldevice.getManufacturer()) : "";
|
||||||
map.put("productionnum", substationPatroldevice.getProductionCode());
|
map.put("生产厂家", manufacturerName);
|
||||||
map.put("productiondate", substationPatroldevice.getProductionDate());
|
map.put("安装位置", substationPatroldevice.getPlace());
|
||||||
map.put("phyassetID", substationPatroldevice.getMaterialId());
|
String online = "1".equals(substationPatroldevice.getOnline()) ? "在线" : "离线";
|
||||||
map.put("position_x", "");
|
map.put("实时状态", online);
|
||||||
map.put("position_y", "");
|
String datastatus = "1".equals(substationPatroldevice.getDatastatus()) ? "有效" : "无效";
|
||||||
map.put("region", "");
|
map.put("设备状态", datastatus);
|
||||||
map.put("cabinet", "");
|
mapList.add(map);
|
||||||
map.put("hwRev", "");
|
|
||||||
map.put("SwRev", "");
|
|
||||||
if ("1".equals(type) || "2".equals(type) || "3".equals(type)) {
|
|
||||||
map.put("SwRevCRC", "");
|
|
||||||
map.put("IPAddr", substationPatroldevice.getIpaddr());
|
|
||||||
map.put("MacAddr", substationPatroldevice.getMacaddr());
|
|
||||||
} else if ("10".equals(type)) {
|
|
||||||
map.put("SwRevCRC", "");
|
|
||||||
map.put("IPAddr", substationPatroldevice.getIpaddr());
|
|
||||||
map.put("MacAddr", substationPatroldevice.getMacaddr());
|
|
||||||
} else if ("11".equals(type)) {
|
|
||||||
map.put("SwRevCRC", "");
|
|
||||||
map.put("IPAddr", substationPatroldevice.getIpaddr());
|
|
||||||
map.put("MacAddr", substationPatroldevice.getMacaddr());
|
|
||||||
} else if ("13".equals(type)) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
mapList.add(map);
|
|
||||||
}
|
// for (SubstationPatroldevice substationPatroldevice : list) {
|
||||||
|
// String devtype = "";
|
||||||
|
// for (Map<String, Object> map : patrolEquipmentType) {
|
||||||
|
// String itemcode = (String) map.get("itemcode");
|
||||||
|
// if (itemcode.equals(type)) {
|
||||||
|
// devtype = map.get("dictname").toString();
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// Map<String, Object> map = new LinkedHashMap<>();
|
||||||
|
// map.put("devtype", devtype);
|
||||||
|
// map.put("devname", substationPatroldevice.getPatroldeviceName());
|
||||||
|
// map.put("devdesc", "");
|
||||||
|
// map.put("devmodel", substationPatroldevice.getDeviceModel());
|
||||||
|
// map.put("manufacturer", substationPatroldevice.getManufacturer());
|
||||||
|
// map.put("madein", "");
|
||||||
|
// map.put("productionnum", substationPatroldevice.getProductionCode());
|
||||||
|
// map.put("productiondate", substationPatroldevice.getProductionDate());
|
||||||
|
// map.put("phyassetID", substationPatroldevice.getMaterialId());
|
||||||
|
// map.put("position_x", "");
|
||||||
|
// map.put("position_y", "");
|
||||||
|
// map.put("region", "");
|
||||||
|
// map.put("cabinet", "");
|
||||||
|
// map.put("hwRev", "");
|
||||||
|
// map.put("SwRev", "");
|
||||||
|
// if ("1".equals(type) || "2".equals(type) || "3".equals(type)) {
|
||||||
|
// map.put("SwRevCRC", "");
|
||||||
|
// map.put("IPAddr", substationPatroldevice.getIpaddr());
|
||||||
|
// map.put("MacAddr", substationPatroldevice.getMacaddr());
|
||||||
|
// } else if ("10".equals(type)) {
|
||||||
|
// map.put("SwRevCRC", "");
|
||||||
|
// map.put("IPAddr", substationPatroldevice.getIpaddr());
|
||||||
|
// map.put("MacAddr", substationPatroldevice.getMacaddr());
|
||||||
|
// } else if ("11".equals(type)) {
|
||||||
|
// map.put("SwRevCRC", "");
|
||||||
|
// map.put("IPAddr", substationPatroldevice.getIpaddr());
|
||||||
|
// map.put("MacAddr", substationPatroldevice.getMacaddr());
|
||||||
|
// } else if ("13".equals(type)) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// mapList.add(map);
|
||||||
|
// }
|
||||||
// String[] headers = {"设备类型", "设备名称", "中文描述", "设备型号", "生产厂家", "生产国家", "出厂编号", "出厂日期", "实物 ID",
|
// String[] headers = {"设备类型", "设备名称", "中文描述", "设备型号", "生产厂家", "生产国家", "出厂编号", "出厂日期", "实物 ID",
|
||||||
// "相对空间位置 x", "相对空间位置 y", "所属区域标识"};
|
// "相对空间位置 x", "相对空间位置 y", "所属区域标识"};
|
||||||
// String[] keys = { "devtype", "devname", "devdesc", "devmodel","manufacturer", "madein",
|
// String[] keys = { "devtype", "devname", "devdesc", "devmodel","manufacturer", "madein",
|
||||||
|
@ -19,6 +19,8 @@ import com.yfd.platform.modules.basedata.domain.DeviceChannel;
|
|||||||
import com.yfd.platform.modules.basedata.service.IDeviceChannelService;
|
import com.yfd.platform.modules.basedata.service.IDeviceChannelService;
|
||||||
import com.yfd.platform.modules.basedata.service.ISubstationDeviceService;
|
import com.yfd.platform.modules.basedata.service.ISubstationDeviceService;
|
||||||
import com.yfd.platform.modules.patroltask.domain.AlarmLog;
|
import com.yfd.platform.modules.patroltask.domain.AlarmLog;
|
||||||
|
import com.yfd.platform.modules.patroltask.domain.TaskResult;
|
||||||
|
import com.yfd.platform.modules.patroltask.mapper.TaskResultMapper;
|
||||||
import com.yfd.platform.modules.patroltask.service.IAlarmLogService;
|
import com.yfd.platform.modules.patroltask.service.IAlarmLogService;
|
||||||
import com.yfd.platform.modules.patroltask.service.ITaskTodoService;
|
import com.yfd.platform.modules.patroltask.service.ITaskTodoService;
|
||||||
import com.yfd.platform.utils.SecurityUtils;
|
import com.yfd.platform.utils.SecurityUtils;
|
||||||
@ -62,6 +64,9 @@ public class AlarmLogController {
|
|||||||
@Resource
|
@Resource
|
||||||
private DeviceSignalMapper deviceSignalMapper;
|
private DeviceSignalMapper deviceSignalMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TaskResultMapper taskResultMapper;
|
||||||
|
|
||||||
@GetMapping("/getAlarmLogList")
|
@GetMapping("/getAlarmLogList")
|
||||||
@ApiOperation("查询报警信息")
|
@ApiOperation("查询报警信息")
|
||||||
public ResponseResult getAlarmLogList(String stationId) {
|
public ResponseResult getAlarmLogList(String stationId) {
|
||||||
@ -289,7 +294,11 @@ public class AlarmLogController {
|
|||||||
@ApiOperation("发送报警")
|
@ApiOperation("发送报警")
|
||||||
public ResponseResult sendAlarmById(String stationId,String id) {
|
public ResponseResult sendAlarmById(String stationId,String id) {
|
||||||
AlarmLog alarmLog = alarmLogService.getById(id);
|
AlarmLog alarmLog = alarmLogService.getById(id);
|
||||||
WebSocketServer.sendInfo(stationId, JSONUtil.parseObj(alarmLog).toString());
|
JSONObject jsonObject = JSONUtil.parseObj(alarmLog);
|
||||||
|
TaskResult taskResult = taskResultMapper.selectById(alarmLog.getTaskResultId());
|
||||||
|
jsonObject.putOpt("channelId", taskResult.getPatroldeviceChannelcode());
|
||||||
|
jsonObject.putOpt("deviceId", taskResult.getPatroldeviceCode());
|
||||||
|
WebSocketServer.sendInfo(stationId, jsonObject.toString());
|
||||||
return ResponseResult.success();
|
return ResponseResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,10 +402,10 @@ public class TodoTaskJob extends QuartzJobBean implements InterruptableJob {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
String patroldeviceCode = map.get("patroldeviceCode").toString();
|
String patroldeviceCode = map.get("patroldeviceCode").toString();
|
||||||
// voiceServerService.sendVoiceServerControl(patroldeviceCode, "ON", fullfilename);
|
voiceServerService.sendVoiceServerControl(patroldeviceCode, "ON", fullfilename);
|
||||||
FileUtil.copy("D:\\riis\\video\\sound.wav", config.getSnapFilePath() + fullfilename, true);
|
// FileUtil.copy("D:\\riis\\video\\sound.wav", config.getSnapFilePath() + fullfilename, true);
|
||||||
Thread.sleep(duration * 1000);
|
Thread.sleep(duration * 1000);
|
||||||
// voiceServerService.sendVoiceServerControl(patroldeviceCode, "OFF", fullfilename);
|
voiceServerService.sendVoiceServerControl(patroldeviceCode, "OFF", fullfilename);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
import com.yfd.platform.system.domain.SysDictionaryItems;
|
import com.yfd.platform.system.domain.SysDictionaryItems;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -15,4 +16,6 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface SysDictionaryItemsMapper extends BaseMapper<SysDictionaryItems> {
|
public interface SysDictionaryItemsMapper extends BaseMapper<SysDictionaryItems> {
|
||||||
List<SysDictionaryItems> getDictItemByType(String dictcode, String alarmType);
|
List<SysDictionaryItems> getDictItemByType(String dictcode, String alarmType);
|
||||||
|
|
||||||
|
Map<String, Object> getDeviceMapByType(String dictcode);
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,8 @@ public interface ISysDictionaryItemsService extends IService<SysDictionaryItems>
|
|||||||
***********************************/
|
***********************************/
|
||||||
List<Map<String, Object>> getDeviceByType(String dictcode);
|
List<Map<String, Object>> getDeviceByType(String dictcode);
|
||||||
|
|
||||||
|
Map<String, Object> getDeviceMapByType(String dictcode);
|
||||||
|
|
||||||
List<SysDictionaryItems> getDictItemByType(String dictcode, String alarmType);
|
List<SysDictionaryItems> getDictItemByType(String dictcode, String alarmType);
|
||||||
|
|
||||||
List<Map<String, Object>> getDictionaryItems(String dictCodes);
|
List<Map<String, Object>> getDictionaryItems(String dictCodes);
|
||||||
|
@ -148,6 +148,11 @@ public class SysDictionaryItemsServiceImpl extends ServiceImpl<SysDictionaryItem
|
|||||||
return itemCode;
|
return itemCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getDeviceMapByType(String dictcode) {
|
||||||
|
return sysDictionaryItemsMapper.getDeviceMapByType(dictcode);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysDictionaryItems> getDictItemByType(String dictcode, String alarmType) {
|
public List<SysDictionaryItems> getDictItemByType(String dictcode, String alarmType) {
|
||||||
return sysDictionaryItemsMapper.getDictItemByType(dictcode, alarmType);
|
return sysDictionaryItemsMapper.getDictItemByType(dictcode, alarmType);
|
||||||
|
@ -2,4 +2,15 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.yfd.platform.modules.algorithm.mapper.AlgorithmClassComponentMapper">
|
<mapper namespace="com.yfd.platform.modules.algorithm.mapper.AlgorithmClassComponentMapper">
|
||||||
|
|
||||||
|
<select id="getAlgorithmComponentList" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
acc.*,ac.algorithm_class_name
|
||||||
|
FROM
|
||||||
|
iis_algorithm_class ac
|
||||||
|
INNER JOIN iis_algorithm_class_component acc ON ac.id = acc.algorithm_id
|
||||||
|
WHERE 1=1
|
||||||
|
<if test="algorithmClassName != null and algorithmClassName != ''">
|
||||||
|
AND ac.algorithm_class_name LIKE CONCAT('%',#{algorithmClassName},'%')
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -54,5 +54,6 @@
|
|||||||
INNER JOIN iis_substation_component sc ON ds.main_component_id = sc.component_id
|
INNER JOIN iis_substation_component sc ON ds.main_component_id = sc.component_id
|
||||||
WHERE
|
WHERE
|
||||||
sc.component_name = '微气象设备部件'
|
sc.component_name = '微气象设备部件'
|
||||||
|
ORDER BY orderno
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -12,4 +12,13 @@
|
|||||||
AND di.itemcode = #{alarmType}
|
AND di.itemcode = #{alarmType}
|
||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getDeviceMapByType" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
JSON_OBJECTAGG(di.itemcode, di.dictname) AS result_map
|
||||||
|
FROM
|
||||||
|
sys_dictionary_items di
|
||||||
|
INNER JOIN sys_dictionary d ON di.dictid = d.id
|
||||||
|
WHERE
|
||||||
|
d.dictcode = #{dictcode};
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user