fix(algorithm):优化算法方案逻辑
优化了方案图片前端预览慢和布点图片保存问题
This commit is contained in:
parent
fef76e3618
commit
e0800f781c
@ -158,13 +158,12 @@ public class IEC61850Service {
|
|||||||
} else {
|
} else {
|
||||||
FcModelNode fcModelNode = (FcModelNode) serverModel.findModelNode(address, Fc.SP);
|
FcModelNode fcModelNode = (FcModelNode) serverModel.findModelNode(address, Fc.SP);
|
||||||
if (fcModelNode == null) {
|
if (fcModelNode == null) {
|
||||||
throw new IllegalArgumentException("Model node not found for address: " + address);
|
throw new IllegalArgumentException("找不到地址的模型节点: " + address);
|
||||||
}
|
}
|
||||||
// 获取 "SetVal" 子节点
|
// 获取 "SetVal" 子节点
|
||||||
ModelNode setValNode = fcModelNode.getChild("SetVal");
|
ModelNode setValNode = fcModelNode.getChild("SetVal");
|
||||||
if (!(setValNode instanceof BdaFloat32)) {
|
if (!(setValNode instanceof BdaFloat32)) {
|
||||||
throw new IllegalArgumentException("'SetVal' child node not found or not of type " +
|
throw new IllegalArgumentException("找不到模型节点的“SetVal”子节点或其类型不是BdaFloat32: " + address);
|
||||||
"BdaFloat32 for model node: " + address);
|
|
||||||
}
|
}
|
||||||
// 将 "SetVal" 子节点强制转换为 BdaFloat32 并设置值
|
// 将 "SetVal" 子节点强制转换为 BdaFloat32 并设置值
|
||||||
BdaFloat32 setVal = (BdaFloat32) setValNode;
|
BdaFloat32 setVal = (BdaFloat32) setValNode;
|
||||||
|
@ -107,8 +107,8 @@ public class WebConfig implements WebMvcConfigurer {
|
|||||||
registry.addResourceHandler("/mainDevice/**").addResourceLocations(mainDeviceUrl).setCachePeriod(0);
|
registry.addResourceHandler("/mainDevice/**").addResourceLocations(mainDeviceUrl).setCachePeriod(0);
|
||||||
|
|
||||||
// 变电站平面图地址
|
// 变电站平面图地址
|
||||||
String planUrl = "file:" + planFilePath;
|
// String planUrl = "file:" + planFilePath;
|
||||||
registry.addResourceHandler("/plan/**").addResourceLocations(planUrl).setCachePeriod(0);
|
// registry.addResourceHandler("/plan/**").addResourceLocations(planUrl).setCachePeriod(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package com.yfd.platform.modules.algorithm.controller;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
@ -17,6 +16,8 @@ import com.deepoove.poi.util.PoitlIOUtils;
|
|||||||
import com.yfd.platform.config.HttpServerConfig;
|
import com.yfd.platform.config.HttpServerConfig;
|
||||||
import com.yfd.platform.config.ResponseResult;
|
import com.yfd.platform.config.ResponseResult;
|
||||||
import com.yfd.platform.modules.algorithm.domain.AlgorithmArrange;
|
import com.yfd.platform.modules.algorithm.domain.AlgorithmArrange;
|
||||||
|
import com.yfd.platform.modules.algorithm.domain.AlgorithmArrangeDevice;
|
||||||
|
import com.yfd.platform.modules.algorithm.domain.ArrangeDeviceRequest;
|
||||||
import com.yfd.platform.modules.algorithm.service.IAlgorithmArrangeDeviceService;
|
import com.yfd.platform.modules.algorithm.service.IAlgorithmArrangeDeviceService;
|
||||||
import com.yfd.platform.modules.algorithm.service.IAlgorithmArrangeService;
|
import com.yfd.platform.modules.algorithm.service.IAlgorithmArrangeService;
|
||||||
import com.yfd.platform.modules.basedata.domain.Substation;
|
import com.yfd.platform.modules.basedata.domain.Substation;
|
||||||
@ -27,14 +28,15 @@ import com.yfd.platform.utils.SecurityUtils;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.ClassUtils;
|
import org.springframework.util.ClassUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.URLDecoder;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
@ -54,6 +56,7 @@ import java.util.stream.Collectors;
|
|||||||
@RequestMapping("/algorithm/algorithm-arrange")
|
@RequestMapping("/algorithm/algorithm-arrange")
|
||||||
@Api(value = "AlgorithmArrangeController", tags = "算法布点模块")
|
@Api(value = "AlgorithmArrangeController", tags = "算法布点模块")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@Transactional
|
||||||
public class AlgorithmArrangeController {
|
public class AlgorithmArrangeController {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
@ -136,7 +139,7 @@ public class AlgorithmArrangeController {
|
|||||||
// 上传文件
|
// 上传文件
|
||||||
String fileUrl = algorithmArrangeService.uploadImage(file);
|
String fileUrl = algorithmArrangeService.uploadImage(file);
|
||||||
LambdaUpdateWrapper<AlgorithmArrange> updateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<AlgorithmArrange> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
updateWrapper.eq(AlgorithmArrange::getId, id).set(AlgorithmArrange::getArrangeImageUrl, fileUrl);
|
updateWrapper.eq(AlgorithmArrange::getId, id).set(AlgorithmArrange::getImageUrl, fileUrl);
|
||||||
algorithmArrangeService.update(updateWrapper);
|
algorithmArrangeService.update(updateWrapper);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return ResponseResult.error("文件上传失败:" + e.getMessage());
|
return ResponseResult.error("文件上传失败:" + e.getMessage());
|
||||||
@ -145,6 +148,41 @@ public class AlgorithmArrangeController {
|
|||||||
return ResponseResult.success();
|
return ResponseResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/saveArrangeDevice")
|
||||||
|
@ApiOperation("保存布点详情")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public ResponseResult saveArrangeDevice(@RequestPart("data") @Valid ArrangeDeviceRequest arrangeDeviceRequest,
|
||||||
|
@RequestParam("file") MultipartFile file) {
|
||||||
|
// 文件上传逻辑
|
||||||
|
if (file != null && !file.isEmpty()) {
|
||||||
|
try {
|
||||||
|
AlgorithmArrange arrange = algorithmArrangeService.getById(arrangeDeviceRequest.getArrangeId());
|
||||||
|
if (StrUtil.isNotBlank(arrange.getArrangeImageUrl())) {
|
||||||
|
algorithmArrangeService.removeImage(httpServerConfig.getPlanFilePath() + arrange.getArrangeImageUrl());
|
||||||
|
}
|
||||||
|
// 上传文件
|
||||||
|
String fileUrl = algorithmArrangeService.uploadImage(file);
|
||||||
|
LambdaUpdateWrapper<AlgorithmArrange> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(AlgorithmArrange::getId, arrangeDeviceRequest.getArrangeId()).set(AlgorithmArrange::getCustom3, "1").set(AlgorithmArrange::getArrangeImageUrl, fileUrl);
|
||||||
|
algorithmArrangeService.update(updateWrapper);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResponseResult.error("文件上传失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<AlgorithmArrangeDevice> algorithmArrangeDevice = arrangeDeviceRequest.getAlgorithmArrangeDevice();
|
||||||
|
if (algorithmArrangeDevice != null && !algorithmArrangeDevice.isEmpty()) {
|
||||||
|
algorithmArrangeDevice.forEach(r -> r.setArrangeId(arrangeDeviceRequest.getArrangeId()));
|
||||||
|
// 获取修改的参数id
|
||||||
|
Set<String> idList =
|
||||||
|
algorithmArrangeDevice.stream().map(AlgorithmArrangeDevice::getId).filter(StrUtil::isNotBlank).collect(Collectors.toSet());
|
||||||
|
if (!idList.isEmpty()) {
|
||||||
|
algorithmArrangeDeviceService.remove(new LambdaQueryWrapper<AlgorithmArrangeDevice>().notIn(AlgorithmArrangeDevice::getId, idList));
|
||||||
|
}
|
||||||
|
algorithmArrangeDeviceService.saveOrUpdateBatch(algorithmArrangeDevice);
|
||||||
|
}
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/updateAlgorithmArrange")
|
@PostMapping("/updateAlgorithmArrange")
|
||||||
@ApiOperation("修改算法布点")
|
@ApiOperation("修改算法布点")
|
||||||
public ResponseResult updateAlgorithmArrange(AlgorithmArrange algorithmArrange, MultipartFile file) {
|
public ResponseResult updateAlgorithmArrange(AlgorithmArrange algorithmArrange, MultipartFile file) {
|
||||||
@ -178,6 +216,7 @@ public class AlgorithmArrangeController {
|
|||||||
algorithmArrange.setStationName(substation.getStationName());
|
algorithmArrange.setStationName(substation.getStationName());
|
||||||
algorithmArrange.setStationCode(substation.getStationCode());
|
algorithmArrange.setStationCode(substation.getStationCode());
|
||||||
}
|
}
|
||||||
|
algorithmArrange.setCustom3("1");
|
||||||
boolean save = algorithmArrangeService.updateById(algorithmArrange);
|
boolean save = algorithmArrangeService.updateById(algorithmArrange);
|
||||||
if (!save) {
|
if (!save) {
|
||||||
return ResponseResult.error();
|
return ResponseResult.error();
|
||||||
@ -197,7 +236,7 @@ public class AlgorithmArrangeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/deleteAlgorithmArrangeByIds")
|
@PostMapping("/deleteAlgorithmArrangeByIds")
|
||||||
@ApiOperation("删除布点数据")
|
@ApiOperation("批量删除布点数据")
|
||||||
public ResponseResult deleteAlgorithmArrangeByIds(@RequestBody List<String> ids) {
|
public ResponseResult deleteAlgorithmArrangeByIds(@RequestBody List<String> ids) {
|
||||||
boolean b = algorithmArrangeService.removeByIds(ids);
|
boolean b = algorithmArrangeService.removeByIds(ids);
|
||||||
if (b) {
|
if (b) {
|
||||||
@ -282,6 +321,12 @@ public class AlgorithmArrangeController {
|
|||||||
public ResponseResult exportArrangeById(String id) throws IOException {
|
public ResponseResult exportArrangeById(String id) throws IOException {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
AlgorithmArrange algorithmArrange = algorithmArrangeService.getById(id);
|
AlgorithmArrange algorithmArrange = algorithmArrangeService.getById(id);
|
||||||
|
if ("0".equals(algorithmArrange.getCustom3())) {
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(algorithmArrange.getCustom2())) {
|
||||||
|
algorithmArrangeService.removeImage(httpServerConfig.getPlanFilePath() + algorithmArrange.getCustom2());
|
||||||
|
}
|
||||||
map.put("arrangeName", algorithmArrange.getArrangeName());
|
map.put("arrangeName", algorithmArrange.getArrangeName());
|
||||||
map.put("stationName", algorithmArrange.getStationName());
|
map.put("stationName", algorithmArrange.getStationName());
|
||||||
Map<String, Object> businessTypeMap = sysDictionaryItemsService.getDeviceMapByType("businessType");
|
Map<String, Object> businessTypeMap = sysDictionaryItemsService.getDeviceMapByType("businessType");
|
||||||
@ -335,7 +380,7 @@ public class AlgorithmArrangeController {
|
|||||||
Files.createDirectories(reportPath.getParent());
|
Files.createDirectories(reportPath.getParent());
|
||||||
template.write(Files.newOutputStream(reportPath));
|
template.write(Files.newOutputStream(reportPath));
|
||||||
LambdaUpdateWrapper<AlgorithmArrange> updateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<AlgorithmArrange> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
updateWrapper.eq(AlgorithmArrange::getId, id).set(AlgorithmArrange::getCustom2, fileName);
|
updateWrapper.eq(AlgorithmArrange::getId, id).set(AlgorithmArrange::getCustom2, fileName).set(AlgorithmArrange::getCustom3, "0");
|
||||||
algorithmArrangeService.update(updateWrapper);
|
algorithmArrangeService.update(updateWrapper);
|
||||||
return ResponseResult.success();
|
return ResponseResult.success();
|
||||||
}
|
}
|
||||||
@ -384,6 +429,21 @@ public class AlgorithmArrangeController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/viewFile")
|
||||||
|
@ApiOperation("预览方案图片")
|
||||||
|
public void serveVideo(String id, String type, HttpServletResponse response) {
|
||||||
|
AlgorithmArrange algorithmArrange = algorithmArrangeService.getById(id);
|
||||||
|
if (algorithmArrange == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ("1".equals(type) && StrUtil.isNotBlank(algorithmArrange.getImageUrl())) {
|
||||||
|
FileUtil.serveVideo(httpServerConfig.getPlanFilePath(), algorithmArrange.getImageUrl(), response);
|
||||||
|
}
|
||||||
|
if ("2".equals(type) && StrUtil.isNotBlank(algorithmArrange.getArrangeImageUrl())) {
|
||||||
|
FileUtil.serveVideo(httpServerConfig.getPlanFilePath(), algorithmArrange.getArrangeImageUrl(), response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private List<Map<String, Object>> getMapData() {
|
private List<Map<String, Object>> getMapData() {
|
||||||
List<Map<String, Object>> demo = new ArrayList<>();
|
List<Map<String, Object>> demo = new ArrayList<>();
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -40,6 +41,13 @@ public class AlgorithmClassComponentController {
|
|||||||
return ResponseResult.successData(algorithmClassComponentPage);
|
return ResponseResult.successData(algorithmClassComponentPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getMainDeviceInfo")
|
||||||
|
@ApiOperation("获取主设备信息")
|
||||||
|
public ResponseResult getMainDeviceInfo(String componentId) {
|
||||||
|
Map<String, Object> mainDeviceInfo = algorithmClassComponentService.getMainDeviceInfo(componentId);
|
||||||
|
return ResponseResult.successData(mainDeviceInfo);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/deleteAlgorithmClassComponent")
|
@PostMapping("/deleteAlgorithmClassComponent")
|
||||||
@ApiOperation("删除算法关联主设备部件")
|
@ApiOperation("删除算法关联主设备部件")
|
||||||
public ResponseResult deleteAlgorithmClassComponent(String id) {
|
public ResponseResult deleteAlgorithmClassComponent(String id) {
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.yfd.platform.modules.algorithm.domain;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Date: 2025/6/9 10:26
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("算法方案布点数请求对象")
|
||||||
|
public class ArrangeDeviceRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty("算法布点方案ID")
|
||||||
|
private String arrangeId;
|
||||||
|
@ApiModelProperty("算法布点详情对象")
|
||||||
|
private List<AlgorithmArrangeDevice> algorithmArrangeDevice;
|
||||||
|
}
|
@ -17,4 +17,6 @@ import java.util.Map;
|
|||||||
public interface AlgorithmClassComponentMapper extends BaseMapper<AlgorithmClassComponent> {
|
public interface AlgorithmClassComponentMapper extends BaseMapper<AlgorithmClassComponent> {
|
||||||
|
|
||||||
List<Map<String, Object>> getAlgorithmComponentList(String stationCode,String algorithmClassName);
|
List<Map<String, Object>> getAlgorithmComponentList(String stationCode,String algorithmClassName);
|
||||||
|
|
||||||
|
Map<String, Object> getMainDeviceInfo(String componentId);
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -48,4 +49,6 @@ public interface IAlgorithmClassComponentService extends IService<AlgorithmClass
|
|||||||
boolean setAlgorithmClassComponentStatus(String id, String isenable) throws ParseException;
|
boolean setAlgorithmClassComponentStatus(String id, String isenable) throws ParseException;
|
||||||
|
|
||||||
boolean createAlgorithmTaskList(AlgorithmClassComponent algorithmClassComponent) throws ParseException;
|
boolean createAlgorithmTaskList(AlgorithmClassComponent algorithmClassComponent) throws ParseException;
|
||||||
|
|
||||||
|
Map<String, Object> getMainDeviceInfo(String componentId);
|
||||||
}
|
}
|
||||||
|
@ -125,10 +125,13 @@ public class AlgorithmArrangeServiceImpl extends ServiceImpl<AlgorithmArrangeMap
|
|||||||
***********************************/
|
***********************************/
|
||||||
@Override
|
@Override
|
||||||
public String uploadImage(MultipartFile file) {
|
public String uploadImage(MultipartFile file) {
|
||||||
|
String extensionName = FileUtil.getExtensionName(file.getOriginalFilename());
|
||||||
|
if ("blob".equals(extensionName)) {
|
||||||
|
extensionName = "png";
|
||||||
|
}
|
||||||
// 文件存储地址
|
// 文件存储地址
|
||||||
String fileName =
|
String fileName =
|
||||||
IdUtil.fastSimpleUUID() + "." + FileUtil.getExtensionName(file.getOriginalFilename());
|
IdUtil.fastSimpleUUID() + "." + extensionName;
|
||||||
// 上传文件
|
// 上传文件
|
||||||
String name =
|
String name =
|
||||||
Objects.requireNonNull(FileUtil.upload(file, httpServerConfig.getPlanFilePath(), fileName)).getName();
|
Objects.requireNonNull(FileUtil.upload(file, httpServerConfig.getPlanFilePath(), fileName)).getName();
|
||||||
|
@ -17,8 +17,10 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -35,6 +37,9 @@ public class AlgorithmClassComponentServiceImpl extends ServiceImpl<AlgorithmCla
|
|||||||
@Resource
|
@Resource
|
||||||
private AlgorithmDeviceMapper algorithmDeviceMapper;
|
private AlgorithmDeviceMapper algorithmDeviceMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AlgorithmClassComponentMapper algorithmClassComponentMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AlgorithmTaskManager algorithmTaskManager;
|
private AlgorithmTaskManager algorithmTaskManager;
|
||||||
|
|
||||||
@ -150,6 +155,11 @@ public class AlgorithmClassComponentServiceImpl extends ServiceImpl<AlgorithmCla
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getMainDeviceInfo(String componentId) {
|
||||||
|
return algorithmClassComponentMapper.getMainDeviceInfo(componentId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置待办任务的时间
|
* 设置待办任务的时间
|
||||||
* 此方法用于根据提供的算法类组件和触发时间来安排待办任务
|
* 此方法用于根据提供的算法类组件和触发时间来安排待办任务
|
||||||
|
@ -101,20 +101,20 @@ public class AlgorithmClassServiceImpl extends ServiceImpl<AlgorithmClassMapper,
|
|||||||
List<AlgorithmParams> algorithmParamsList = algorithmParamsRequest.getAlgorithmParamsList();
|
List<AlgorithmParams> algorithmParamsList = algorithmParamsRequest.getAlgorithmParamsList();
|
||||||
// 获取修改的参数id
|
// 获取修改的参数id
|
||||||
Set<String> paramIdList =
|
Set<String> paramIdList =
|
||||||
algorithmParamsList.stream().filter(a -> StrUtil.isNotBlank(a.getId())).map(AlgorithmParams::getId).collect(Collectors.toSet());
|
algorithmParamsList.stream().map(AlgorithmParams::getId).filter(StrUtil::isNotBlank).collect(Collectors.toSet());
|
||||||
|
|
||||||
// 排除修改的算法参数,删除掉其他算法参数和点位信息
|
// 排除修改的算法参数,删除掉其他算法参数和点位信息
|
||||||
|
|
||||||
LambdaQueryWrapper<AlgorithmDevice> deviceQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AlgorithmDevice> deviceQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
deviceQueryWrapper.eq(AlgorithmDevice::getAlgorithmId, algorithmClass.getId());
|
deviceQueryWrapper.eq(AlgorithmDevice::getAlgorithmId, algorithmClass.getId());
|
||||||
if (paramIdList.size() > 0) {
|
if (!paramIdList.isEmpty()) {
|
||||||
deviceQueryWrapper.notIn(AlgorithmDevice::getParamId, paramIdList);
|
deviceQueryWrapper.notIn(AlgorithmDevice::getParamId, paramIdList);
|
||||||
}
|
}
|
||||||
algorithmDeviceService.remove(deviceQueryWrapper);
|
algorithmDeviceService.remove(deviceQueryWrapper);
|
||||||
|
|
||||||
LambdaQueryWrapper<AlgorithmParams> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AlgorithmParams> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(AlgorithmParams::getAlgorithmId, algorithmClass.getId());
|
queryWrapper.eq(AlgorithmParams::getAlgorithmId, algorithmClass.getId());
|
||||||
if (paramIdList.size() > 0) {
|
if (!paramIdList.isEmpty()) {
|
||||||
queryWrapper.notIn(AlgorithmParams::getId, paramIdList);
|
queryWrapper.notIn(AlgorithmParams::getId, paramIdList);
|
||||||
}
|
}
|
||||||
algorithmParamsService.remove(queryWrapper);
|
algorithmParamsService.remove(queryWrapper);
|
||||||
@ -124,7 +124,7 @@ public class AlgorithmClassServiceImpl extends ServiceImpl<AlgorithmClassMapper,
|
|||||||
r.setLastmodifier(currentUsername);
|
r.setLastmodifier(currentUsername);
|
||||||
r.setLastmodifydate(LocalDateTime.now());
|
r.setLastmodifydate(LocalDateTime.now());
|
||||||
});
|
});
|
||||||
if (algorithmParamsList.size() > 0) {
|
if (!algorithmParamsList.isEmpty()) {
|
||||||
return algorithmParamsService.saveOrUpdateBatch(algorithmParamsList);
|
return algorithmParamsService.saveOrUpdateBatch(algorithmParamsList);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.yfd.platform.modules.auxcontrol.controller;
|
package com.yfd.platform.modules.auxcontrol.controller;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@ -34,7 +33,6 @@ import java.util.Map;
|
|||||||
@Api(value = "DeviceSignalController", tags = "变电站辅控设备信号")
|
@Api(value = "DeviceSignalController", tags = "变电站辅控设备信号")
|
||||||
public class DeviceSignalController {
|
public class DeviceSignalController {
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IDeviceSignalService deviceSignalService;
|
private IDeviceSignalService deviceSignalService;
|
||||||
|
|
||||||
@ -49,13 +47,14 @@ public class DeviceSignalController {
|
|||||||
***********************************/
|
***********************************/
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@ApiOperation("分页查询变电站辅控设备信号")
|
@ApiOperation("分页查询变电站辅控设备信号")
|
||||||
public ResponseResult getDeviceSignalPage(String systemcode,String meterDeviceId,String mainDeviceId, String mainComponentId, String signalName, Page<DeviceSignal> page) {
|
public ResponseResult getDeviceSignalPage(String systemcode, String meterDeviceId, String mainDeviceId,
|
||||||
|
String mainComponentId, String signalName, Page<DeviceSignal> page) {
|
||||||
//参数校验 辅控设备ID不能为空
|
//参数校验 辅控设备ID不能为空
|
||||||
Page<DeviceSignal> deviceSignalPage = deviceSignalService.getDeviceSignalPage(systemcode,meterDeviceId,mainDeviceId,mainComponentId, signalName, page);
|
Page<DeviceSignal> deviceSignalPage = deviceSignalService.getDeviceSignalPage(systemcode, meterDeviceId,
|
||||||
|
mainDeviceId, mainComponentId, signalName, page);
|
||||||
return ResponseResult.successData(deviceSignalPage);
|
return ResponseResult.successData(deviceSignalPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************
|
/**********************************
|
||||||
* 用途说明: 查询遥信遥测数据
|
* 用途说明: 查询遥信遥测数据
|
||||||
* 参数说明
|
* 参数说明
|
||||||
@ -71,6 +70,19 @@ public class DeviceSignalController {
|
|||||||
return ResponseResult.successData(list);
|
return ResponseResult.successData(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**********************************
|
||||||
|
* 用途说明: 查询遥信数据
|
||||||
|
* 参数说明
|
||||||
|
* areaid 区域ID
|
||||||
|
* 返回值说明: 变电站辅控设备信号集合
|
||||||
|
***********************************/
|
||||||
|
@GetMapping("/queryYxData")
|
||||||
|
@ApiOperation("查询遥信数据")
|
||||||
|
public ResponseResult queryYxData(Page<Map<String, Object>> page, String areaId, String type) {
|
||||||
|
Page<Map<String, Object>> mapPage = deviceSignalService.queryYxData(page, areaId, type);
|
||||||
|
return ResponseResult.successData(mapPage);
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************
|
/**********************************
|
||||||
* 用途说明: 查询信号信息
|
* 用途说明: 查询信号信息
|
||||||
* 参数说明
|
* 参数说明
|
||||||
@ -112,7 +124,7 @@ public class DeviceSignalController {
|
|||||||
* 参数说明 deviceSignal 变电站辅控设备信号
|
* 参数说明 deviceSignal 变电站辅控设备信号
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回修改成功或者失败
|
* 返回值说明: com.yfd.platform.config.ResponseResult 返回修改成功或者失败
|
||||||
***********************************/
|
***********************************/
|
||||||
@Log(module = "变电站辅控设备信号", value = "修改变电站辅控设备信号",type = "1")
|
@Log(module = "变电站辅控设备信号", value = "修改变电站辅控设备信号", type = "1")
|
||||||
@PostMapping("/updateDeviceSignal")
|
@PostMapping("/updateDeviceSignal")
|
||||||
@ApiOperation("修改变电站辅控设备信号")
|
@ApiOperation("修改变电站辅控设备信号")
|
||||||
public ResponseResult updateDeviceSignal(@RequestBody DeviceSignal deviceSignal) {
|
public ResponseResult updateDeviceSignal(@RequestBody DeviceSignal deviceSignal) {
|
||||||
@ -132,7 +144,7 @@ public class DeviceSignalController {
|
|||||||
* 参数说明 id 变电站辅控设备信号ID
|
* 参数说明 id 变电站辅控设备信号ID
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回删除成功或者失败
|
* 返回值说明: com.yfd.platform.config.ResponseResult 返回删除成功或者失败
|
||||||
***********************************/
|
***********************************/
|
||||||
@Log(module = "变电站辅控设备信号", value = "根据ID删除变电站辅控设备信号",type = "1")
|
@Log(module = "变电站辅控设备信号", value = "根据ID删除变电站辅控设备信号", type = "1")
|
||||||
@PostMapping("/deleteDeviceSignalById")
|
@PostMapping("/deleteDeviceSignalById")
|
||||||
@ApiOperation("根据ID删除变电站辅控设备信号")
|
@ApiOperation("根据ID删除变电站辅控设备信号")
|
||||||
public ResponseResult deleteDeviceSignalById(@RequestParam String id) {
|
public ResponseResult deleteDeviceSignalById(@RequestParam String id) {
|
||||||
@ -147,13 +159,12 @@ public class DeviceSignalController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************
|
/**********************************
|
||||||
* 用途说明: 批量删除变电站辅控设备信号
|
* 用途说明: 批量删除变电站辅控设备信号
|
||||||
* 参数说明 ids 变电站辅控设备信号id数组
|
* 参数说明 ids 变电站辅控设备信号id数组
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回批量删除成功或失败
|
* 返回值说明: com.yfd.platform.config.ResponseResult 返回批量删除成功或失败
|
||||||
***********************************/
|
***********************************/
|
||||||
@Log(module = "变电站辅控设备信号", value = "批量删除变电站辅控设备信号",type = "1")
|
@Log(module = "变电站辅控设备信号", value = "批量删除变电站辅控设备信号", type = "1")
|
||||||
@PostMapping("/deleteDeviceSignalByIds")
|
@PostMapping("/deleteDeviceSignalByIds")
|
||||||
@ApiOperation("批量删除变电站辅控设备信号")
|
@ApiOperation("批量删除变电站辅控设备信号")
|
||||||
public ResponseResult deleteDeviceByIds(@RequestParam String ids) {
|
public ResponseResult deleteDeviceByIds(@RequestParam String ids) {
|
||||||
@ -169,5 +180,4 @@ public class DeviceSignalController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,8 @@ public class MeterDeviceController {
|
|||||||
return ResponseResult.error("参数为空");
|
return ResponseResult.error("参数为空");
|
||||||
}
|
}
|
||||||
//分页查询
|
//分页查询
|
||||||
Page<MeterDevice> devicePage = meterDeviceService.getDevicePage(stationId,deviceName, deviceModel, deviceType, status,
|
Page<MeterDevice> devicePage = meterDeviceService.getDevicePage(stationId, deviceName, deviceModel,
|
||||||
|
deviceType, status,
|
||||||
systemcode, page);
|
systemcode, page);
|
||||||
return ResponseResult.successData(devicePage);
|
return ResponseResult.successData(devicePage);
|
||||||
}
|
}
|
||||||
@ -127,7 +128,8 @@ public class MeterDeviceController {
|
|||||||
if (StrUtil.isBlank(batchUpdateIpRequest.getIp())) {
|
if (StrUtil.isBlank(batchUpdateIpRequest.getIp())) {
|
||||||
return ResponseResult.error("参数为空");
|
return ResponseResult.error("参数为空");
|
||||||
}
|
}
|
||||||
boolean isOk = meterDeviceService.batchUpdateDeviceIp(batchUpdateIpRequest.getIds(), batchUpdateIpRequest.getIp());
|
boolean isOk = meterDeviceService.batchUpdateDeviceIp(batchUpdateIpRequest.getIds(),
|
||||||
|
batchUpdateIpRequest.getIp());
|
||||||
if (isOk) {
|
if (isOk) {
|
||||||
return ResponseResult.success();
|
return ResponseResult.success();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.yfd.platform.modules.auxcontrol.mapper;
|
package com.yfd.platform.modules.auxcontrol.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.yfd.platform.modules.auxcontrol.domain.DeviceSignal;
|
import com.yfd.platform.modules.auxcontrol.domain.DeviceSignal;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Update;
|
import org.apache.ibatis.annotations.Update;
|
||||||
@ -29,4 +30,5 @@ public interface DeviceSignalMapper extends BaseMapper<DeviceSignal> {
|
|||||||
|
|
||||||
Map<String, Object> querySignalDataById(String signalId);
|
Map<String, Object> querySignalDataById(String signalId);
|
||||||
|
|
||||||
|
Page<Map<String, Object>> queryYxData(Page<Map<String, Object>> page, String areaId, String type);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,9 @@ package com.yfd.platform.modules.auxcontrol.mapper;
|
|||||||
import com.yfd.platform.modules.auxcontrol.domain.MeterDevice;
|
import com.yfd.platform.modules.auxcontrol.domain.MeterDevice;
|
||||||
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 接口
|
||||||
|
@ -69,4 +69,5 @@ public interface IDeviceSignalService extends IService<DeviceSignal> {
|
|||||||
***********************************/
|
***********************************/
|
||||||
Map<String, Object> querySignalDataById(String signalId);
|
Map<String, Object> querySignalDataById(String signalId);
|
||||||
|
|
||||||
|
Page<Map<String, Object>> queryYxData(Page<Map<String, Object>> page, String areaId, String type);
|
||||||
}
|
}
|
||||||
|
@ -58,4 +58,6 @@ public interface IMeterDeviceService extends IService<MeterDevice> {
|
|||||||
* 返回值说明: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
* 返回值说明: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||||
***********************************/
|
***********************************/
|
||||||
List<Map<String, Object>> getMeterDeviceByCode(String stationId, String systemCode);
|
List<Map<String, Object>> getMeterDeviceByCode(String stationId, String systemCode);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -208,4 +208,9 @@ public class DeviceSignalServiceImpl extends ServiceImpl<DeviceSignalMapper, Dev
|
|||||||
public Map<String, Object> querySignalDataById(String signalId) {
|
public Map<String, Object> querySignalDataById(String signalId) {
|
||||||
return deviceSignalMapper.querySignalDataById(signalId);
|
return deviceSignalMapper.querySignalDataById(signalId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<Map<String, Object>> queryYxData(Page<Map<String, Object>> page, String areaId, String type) {
|
||||||
|
return deviceSignalMapper.queryYxData(page, areaId, type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.yfd.platform.utils.SecurityUtils;
|
import com.yfd.platform.utils.SecurityUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -29,6 +31,9 @@ import java.util.Map;
|
|||||||
@Service
|
@Service
|
||||||
public class MeterDeviceServiceImpl extends ServiceImpl<MeterDeviceMapper, MeterDevice> implements IMeterDeviceService {
|
public class MeterDeviceServiceImpl extends ServiceImpl<MeterDeviceMapper, MeterDevice> implements IMeterDeviceService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MeterDeviceMapper meterDeviceMapper;
|
||||||
|
|
||||||
/**********************************
|
/**********************************
|
||||||
* 用途说明: 分页查询变电站辅控设备
|
* 用途说明: 分页查询变电站辅控设备
|
||||||
* 参数说明 deviceName 设备名称
|
* 参数说明 deviceName 设备名称
|
||||||
@ -37,10 +42,12 @@ public class MeterDeviceServiceImpl extends ServiceImpl<MeterDeviceMapper, Meter
|
|||||||
* 参数说明 status 状态
|
* 参数说明 status 状态
|
||||||
* 参数说明 systemcode 系统编码
|
* 参数说明 systemcode 系统编码
|
||||||
* 参数说明 page
|
* 参数说明 page
|
||||||
* 返回值说明: com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.yfd.platform.modules.auxcontrol.domain.MeterDevice>
|
* 返回值说明: com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.yfd.platform.modules.auxcontrol.domain
|
||||||
|
* .MeterDevice>
|
||||||
***********************************/
|
***********************************/
|
||||||
@Override
|
@Override
|
||||||
public Page<MeterDevice> getDevicePage(String stationId,String deviceName, String deviceModel, String deviceType, String status,
|
public Page<MeterDevice> getDevicePage(String stationId, String deviceName, String deviceModel, String deviceType
|
||||||
|
, String status,
|
||||||
String systemcode, Page<MeterDevice> page) {
|
String systemcode, Page<MeterDevice> page) {
|
||||||
LambdaQueryWrapper<MeterDevice> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<MeterDevice> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(StrUtil.isNotBlank(stationId), MeterDevice::getStationId, stationId);
|
queryWrapper.eq(StrUtil.isNotBlank(stationId), MeterDevice::getStationId, stationId);
|
||||||
@ -128,4 +135,6 @@ public class MeterDeviceServiceImpl extends ServiceImpl<MeterDeviceMapper, Meter
|
|||||||
queryWrapper.eq(StrUtil.isNotBlank(stationId), MeterDevice::getStationId, stationId).eq(StrUtil.isNotBlank(systemCode), MeterDevice::getSystemcode, systemCode).select(MeterDevice::getDeviceId, MeterDevice::getDeviceName).orderByAsc(MeterDevice::getDeviceCode);
|
queryWrapper.eq(StrUtil.isNotBlank(stationId), MeterDevice::getStationId, stationId).eq(StrUtil.isNotBlank(systemCode), MeterDevice::getSystemcode, systemCode).select(MeterDevice::getDeviceId, MeterDevice::getDeviceName).orderByAsc(MeterDevice::getDeviceCode);
|
||||||
return this.listMaps(queryWrapper);
|
return this.listMaps(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ import org.apache.poi.xssf.streaming.SXSSFSheet;
|
|||||||
import org.apache.poi.xssf.usermodel.*;
|
import org.apache.poi.xssf.usermodel.*;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
@ -56,6 +57,7 @@ import java.net.HttpURLConnection;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@ -175,6 +177,43 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
|||||||
}
|
}
|
||||||
return resultSize;
|
return resultSize;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 服务视频文件
|
||||||
|
* 根据提供的文件路径和文件名,设置HTTP响应的内容类型,并将文件内容写入响应中
|
||||||
|
*
|
||||||
|
* @param snapFilePath 文件所在的目录路径
|
||||||
|
* @param filename 要服务的文件名
|
||||||
|
* @param response HTTP响应对象,用于设置响应头和输出流
|
||||||
|
*/
|
||||||
|
public static void serveVideo(String snapFilePath,String filename, HttpServletResponse response) {
|
||||||
|
File file = new File(snapFilePath, filename);
|
||||||
|
if (file.exists()) {
|
||||||
|
// 根据文件扩展名设置合适的 Content-Type
|
||||||
|
if (filename.endsWith(".mp4")) {
|
||||||
|
response.setContentType("video/mp4");
|
||||||
|
} else if (filename.endsWith(".jpg") || filename.endsWith(".jpeg")) {
|
||||||
|
response.setContentType("image/jpeg");
|
||||||
|
} else if (filename.endsWith(".png")) {
|
||||||
|
response.setContentType("image/png");
|
||||||
|
} else {
|
||||||
|
response.setContentType("application/octet-stream");
|
||||||
|
}
|
||||||
|
|
||||||
|
try (InputStream is = Files.newInputStream(file.toPath())) {
|
||||||
|
byte[] buffer = new byte[4096];
|
||||||
|
int bytesRead;
|
||||||
|
while ((bytesRead = is.read(buffer)) != -1) {
|
||||||
|
response.getOutputStream().write(buffer, 0, bytesRead);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
log.info(e.getMessage());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* inputStream 转 File
|
* inputStream 转 File
|
||||||
|
@ -20,4 +20,13 @@
|
|||||||
AND ac.algorithm_class_name LIKE CONCAT('%',#{algorithmClassName},'%')
|
AND ac.algorithm_class_name LIKE CONCAT('%',#{algorithmClassName},'%')
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getMainDeviceInfo" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
sm.*
|
||||||
|
FROM
|
||||||
|
`iis_substation_component` sc
|
||||||
|
INNER JOIN iis_substation_maindevice sm ON sc.main_device_id = sm.main_device_id
|
||||||
|
WHERE
|
||||||
|
component_id = #{componentId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -128,5 +128,26 @@
|
|||||||
WHERE signal_id =#{signalId}
|
WHERE signal_id =#{signalId}
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
<select id="queryYxData" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
md.device_type,
|
||||||
|
ds.signal_name,
|
||||||
|
ds.signal_code,
|
||||||
|
ds.yx_addr,
|
||||||
|
ds.yx_value
|
||||||
|
FROM
|
||||||
|
fk_device_signal ds
|
||||||
|
INNER JOIN fk_meter_device md ON ds.meter_device_id = md.device_id
|
||||||
|
WHERE
|
||||||
|
ds.yx_addr IS NOT NULL
|
||||||
|
AND ds.yx_addr != ''
|
||||||
|
AND md.region = #{areaId}
|
||||||
|
<if test="type != null and type != ''">
|
||||||
|
AND md.device_type = #{type}
|
||||||
|
</if>
|
||||||
|
ORDER BY
|
||||||
|
md.device_type,
|
||||||
|
ds.signal_code
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user