抽取公共代码提供给物联项目使用
This commit is contained in:
@@ -20,10 +20,9 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pq-device-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<artifactId>pq-device-com</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>system-api</artifactId>
|
||||
@@ -39,26 +38,10 @@
|
||||
<artifactId>common-web</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-oss</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn.platform</groupId>
|
||||
<artifactId>message-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>supervision-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn.platform</groupId>
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@@ -11,14 +11,12 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.IOverLimitService;
|
||||
import com.njcn.device.pq.service.IPqsDeviceUnitService;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -57,9 +55,6 @@ public class CommTerminalController extends BaseController {
|
||||
|
||||
private final IPqsDeviceUnitService iPqsDeviceUnitService;
|
||||
|
||||
private final IOverLimitService iOverLimitService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过部门获取所有子集部门所拥有的监测点基本信息
|
||||
@@ -241,34 +236,6 @@ public class CommTerminalController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOverLimitData")
|
||||
@ApiOperation("根据监测点id获取越限数值")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<Overlimit> getOverLimitData(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getOverLimitData");
|
||||
Overlimit result = lineService.getOverLimitData(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getAllLineOverLimit")
|
||||
@ApiOperation("获取投运在线的监测点的限值")
|
||||
public HttpResult<List<Overlimit>> getAllLineOverLimit() {
|
||||
String methodDescribe = getMethodDescribe("getAllLineOverLimit");
|
||||
List<Overlimit> result = lineService.getAllLineOverLimit("harmonic-boot", null);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOverLimitDataByIds")
|
||||
@ApiOperation("根据监测点id集合获取越限数值")
|
||||
@ApiImplicitParam(name = "ids", value = "监测点id集合", required = true)
|
||||
public HttpResult<List<Overlimit>> getOverLimitDataByIds(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("getOverLimitDataByIds");
|
||||
List<Overlimit> result = iOverLimitService.listByIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/getLineBySubstationRelation")
|
||||
@ApiOperation("获取变电站和监测点的关系")
|
||||
|
||||
@@ -7,10 +7,10 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.pq.mapper.DeptLineMapper;
|
||||
import com.njcn.device.line.mapper.DeptLineMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.pojo.param.DeptLineParam;
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
@@ -1,232 +0,0 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.tocrhz.mqtt.annotation.MqttSubscribe;
|
||||
import com.github.tocrhz.mqtt.annotation.NamedValue;
|
||||
import com.github.tocrhz.mqtt.annotation.Payload;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.dto.DevComFlagDTO;
|
||||
import com.njcn.device.pq.pojo.dto.DeviceDTO;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.ConstantValueParam;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.vo.DevStatusNumVO;
|
||||
import com.njcn.device.pq.service.IDeviceService;
|
||||
import com.njcn.device.pq.service.impl.GeneralDeviceService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.paho.client.mqttv3.MqttMessage;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
||||
/**
|
||||
* pqs
|
||||
* 设备相关
|
||||
* @author cdf
|
||||
* @date 2023/4/4
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "台账-设备相关")
|
||||
@RestController
|
||||
@RequestMapping("/dev")
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceController extends BaseController {
|
||||
|
||||
private final IDeviceService iDeviceService;
|
||||
|
||||
private final GeneralDeviceService generalDeviceService;
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/socketLine")
|
||||
@ApiOperation("获取监测点定值信息")
|
||||
public HttpResult<String> socketLine(@RequestBody @Validated ConstantValueParam.Constant param) {
|
||||
String methodDescribe = getMethodDescribe("socketLine");
|
||||
if(StrUtil.isBlank(param.getIp())){
|
||||
param.setIp(RequestUtil.getRealIp());
|
||||
}
|
||||
String s = iDeviceService.sentLine(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/updateSocketLine")
|
||||
@ApiOperation("修改监测点定值信息")
|
||||
public HttpResult<String> updateSocketLine(@RequestBody @Validated ConstantValueParam.ValueData param) {
|
||||
String methodDescribe = getMethodDescribe("updateSocketLine");
|
||||
if(StrUtil.isBlank(param.getIp())){
|
||||
param.setIp(RequestUtil.getRealIp());
|
||||
}
|
||||
String s = iDeviceService.sentLineData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/socketDev")
|
||||
@ApiOperation("获取终端定值信息")
|
||||
public HttpResult<String> socketDev(@RequestBody @Validated ConstantValueParam.Constant param) {
|
||||
String methodDescribe = getMethodDescribe("socketDev");
|
||||
if(StrUtil.isBlank(param.getIp())){
|
||||
param.setIp(RequestUtil.getRealIp());
|
||||
}
|
||||
String s = iDeviceService.sentDev(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/updateSocketDev")
|
||||
@ApiOperation("修改终端定值信息")
|
||||
public HttpResult<String> updateSocketDev(@RequestBody @Validated ConstantValueParam.ValueData param) {
|
||||
String methodDescribe = getMethodDescribe("updateSocketDev");
|
||||
if(StrUtil.isBlank(param.getIp())){
|
||||
param.setIp(RequestUtil.getRealIp());
|
||||
}
|
||||
String s = iDeviceService.sentDevData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/socketDevProperty")
|
||||
@ApiOperation("获取终端性能信息")
|
||||
public HttpResult<String> socketDevProperty(String devID) {
|
||||
String methodDescribe = getMethodDescribe("socketDevProperty");
|
||||
String s = iDeviceService.socketDevProperty(devID);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/socketDevPropertyClose")
|
||||
@ApiOperation("终端性能关闭")
|
||||
public HttpResult<String> socketDevPropertyClose(String devID) {
|
||||
String methodDescribe = getMethodDescribe("socketDevPropertyClose");
|
||||
String s = iDeviceService.socketDevPropertyClose(devID);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/realTimeData")
|
||||
@ApiOperation("监测点实时数据查看")
|
||||
public HttpResult<String> realTimeData(String lineID) {
|
||||
String methodDescribe = getMethodDescribe("realTimeData");
|
||||
String s = iDeviceService.realTimeData(lineID);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/heartRealTimeData")
|
||||
@ApiOperation("监测实施数据心跳")
|
||||
public HttpResult<String> heartRealTimeData(String lineID) {
|
||||
String methodDescribe = getMethodDescribe("heartRealTimeData");
|
||||
String s = iDeviceService.heartRealTimeData(lineID);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/closeRealTimeData")
|
||||
@ApiOperation("监测点实施数据关闭")
|
||||
public HttpResult<String> closeRealTimeData(String lineID) {
|
||||
String methodDescribe = getMethodDescribe("closeRealTimeData");
|
||||
String s = iDeviceService.closeRealTimeData(lineID);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getDevUpgrades")
|
||||
@ApiOperation("终端版本升级")
|
||||
public HttpResult<String> getDevUpgrades(@RequestBody @Validated ConstantValueParam.Upgrades param) {
|
||||
String methodDescribe = getMethodDescribe("getDevUpgrades");
|
||||
String s = iDeviceService.getDevUpgrades(param.getList(),param.getEdIndex());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/closeUpgrades")
|
||||
@ApiOperation("终端升级取消")
|
||||
public HttpResult<String> closeUpgrades(@RequestBody List<String> devList) {
|
||||
String methodDescribe = getMethodDescribe("closeUpgrades");
|
||||
String s = iDeviceService.closeUpgrades(devList);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/restartDev")
|
||||
@ApiOperation("重启装置命令")
|
||||
public HttpResult<String> restartDev(@RequestBody List<String> devList) {
|
||||
String methodDescribe = getMethodDescribe("restartDev");
|
||||
String s = iDeviceService.restartDev(devList);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
@MqttSubscribe(value = "/zl/devData/{devID}",qos = 1)
|
||||
public void responseRtData(String topic, @NamedValue("devID") String pageId, MqttMessage message, @Payload String payload) {
|
||||
Console.log("receive from : {}", topic);
|
||||
Console.log("receive from : {}", pageId);
|
||||
Console.log("message : {}", message.getPayload());
|
||||
Console.log("message payload : {}", new String(message.getPayload(), StandardCharsets.UTF_8));
|
||||
Console.log("string payload : {}", payload);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/updateDevCheckTime")
|
||||
@ApiOperation("技术监督修改装置定检时间")
|
||||
public HttpResult<String> updateDevCheckTime(String devId, String thisTimeCheck, String nextTimeCheck) {
|
||||
String methodDescribe = getMethodDescribe("updateDevCheckTime");
|
||||
iDeviceService.updateDevCheckTime(devId,thisTimeCheck,nextTimeCheck);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "success", methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/updateDevComFlag")
|
||||
@ApiOperation("修改装置通讯状态及时间")
|
||||
public HttpResult<Boolean> updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO) {
|
||||
String methodDescribe = getMethodDescribe("updateDevComFlag");
|
||||
boolean update = iDeviceService.lambdaUpdate().set(Objects.nonNull(devComFlagDTO.getStatus()),Device::getComFlag,devComFlagDTO.getStatus() ).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getDeviceInfo")
|
||||
@ApiOperation("查询设备详情")
|
||||
public HttpResult<DeviceDTO> getDeviceInfo(@RequestParam("devId") String devId) {
|
||||
String methodDescribe = getMethodDescribe("getDeviceInfo");
|
||||
Device one = iDeviceService.lambdaQuery().eq(Device::getId, devId).one();
|
||||
DeviceDTO dto = new DeviceDTO();
|
||||
BeanUtils.copyProperties(one,dto);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, dto, methodDescribe);
|
||||
}
|
||||
|
||||
@ApiOperation("台账状态统计")
|
||||
@PostMapping(value = "statisticDevNum")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
public HttpResult<DevStatusNumVO> statisticDevNum(@RequestBody DeviceInfoParam deviceInfoParam) {
|
||||
DevStatusNumVO devStatusNumVO = new DevStatusNumVO();
|
||||
String methodDescribe = getMethodDescribe("statisticDevNum");
|
||||
deviceInfoParam.setStatisticalType(new SimpleDTO());
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam,new ArrayList<>(), Stream.of(1).collect(Collectors.toList()));
|
||||
List<String> devIds = generalDeviceDTOList.stream().flatMap(list->list.getDeviceIndexes().stream()).collect(Collectors.toList());
|
||||
if(CollectionUtil.isEmpty(devIds)){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, devStatusNumVO, methodDescribe);
|
||||
}
|
||||
devStatusNumVO = iDeviceService.statisticDevNum(devIds);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, devStatusNumVO, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,6 +6,8 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.common.service.TerminalBaseService;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
@@ -13,8 +15,6 @@ import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.TerminalBaseService;
|
||||
import com.njcn.device.pq.service.impl.GeneralDeviceService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
|
||||
@@ -1,591 +0,0 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.mapper.DeviceMapper;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.device.pq.pojo.dto.*;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/2/23
|
||||
* 监测点相关
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "监测点管理")
|
||||
@RestController
|
||||
@RequestMapping("/line")
|
||||
@RequiredArgsConstructor
|
||||
public class LineController extends BaseController {
|
||||
|
||||
private final LineService lineService;
|
||||
|
||||
private final DeviceMapper deviceMapper;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
|
||||
private final RStatIntegrityDMapper integrityDMapper;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineDetailData")
|
||||
@ApiOperation("根据监测点id获取监测点详情")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<LineDetailDataVO> getLineDetailData(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineDetailData");
|
||||
LineDetailDataVO result = lineService.getLineDetailData(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据装置id获取装置详情")
|
||||
@ApiImplicitParam(name = "id", value = "装置id", required = true)
|
||||
@PostMapping("/getDeviceDetailData")
|
||||
HttpResult<DeviceVO> getDeviceDetailData(@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("getDeviceDetailData");
|
||||
DeviceVO result = lineService.getDeviceDetailData(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineOverLimitData")
|
||||
@ApiOperation("根据监测点id获取越限详情")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<LineOverLimitVO> getLineOverLimitData(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineOverLimitData");
|
||||
LineOverLimitVO result = lineService.getLineOverLimitData(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getSubstationData")
|
||||
@ApiOperation("根据变电站id获取变电站详情")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<List<SubstationDetailVO>> getSubstationData(@RequestBody List<String> id) {
|
||||
String methodDescribe = getMethodDescribe("getSubstationData");
|
||||
List<SubstationDetailVO> result = lineService.getSubstationData(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据变电站id获取子节数据
|
||||
*
|
||||
* @param id 变电站id
|
||||
* @return 结果
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据变电站id获取子节数据")
|
||||
@PostMapping("getSubIndexLineDetail")
|
||||
public HttpResult<List<Line>> getSubIndexLineDetail(@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("getSubIndexLineDetail");
|
||||
List<Line> result = lineService.getSubIndexLineDetail(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
};
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getComFlagInfoData")
|
||||
@ApiOperation("根据监测点Id终端状态信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true),
|
||||
@ApiImplicitParam(name = "searchBeginTime", value = "起始时间"),
|
||||
@ApiImplicitParam(name = "searchEndTime", value = "截止时间")
|
||||
})
|
||||
public HttpResult<CommunicateVO> getComFlagInfoData(@RequestParam(required = false) @ApiParam("id") String id,
|
||||
@RequestParam("searchBeginTime") String searchBeginTime,
|
||||
@RequestParam("searchEndTime") String searchEndTime) {
|
||||
String methodDescribe = getMethodDescribe("getComFlagInfoData");
|
||||
CommunicateVO result = lineService.getComFlagInfoData(id, searchBeginTime, searchEndTime);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineIdByDevId")
|
||||
@ApiOperation("根据监测点Id终端状态信息")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<String> getLineIdByDevId(@RequestParam(required = false) @ApiParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getComFlagInfoData");
|
||||
String result = lineService.getLineIdByDevId(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getDevListByLineIdList")
|
||||
@ApiOperation("根据监测点id集合获取装置id集合")
|
||||
@ApiImplicitParam(name = "list", value = "监测点id集合", required = true)
|
||||
public HttpResult<Set<String>> getDevListByLineIdList(@RequestBody List<String> list) {
|
||||
String methodDescribe = getMethodDescribe("getDevListByLineIdList");
|
||||
Set<String> result = lineService.getDevListByLineIdList(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOverLimitData")
|
||||
@ApiOperation("根据监测点id获取越限数值")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<Overlimit> getOverLimitData(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getOverLimitData");
|
||||
Overlimit result = lineService.getOverLimitData(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取投运在线的监测点的限值
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/3/23
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getAllLineOverLimit")
|
||||
@ApiOperation("获取投运在线的监测点的限值")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "serverName", value = "服务名称", required = true),
|
||||
@ApiImplicitParam(name = "deptId", value = "部门id")
|
||||
})
|
||||
public HttpResult<List<Overlimit>> getAllLineOverLimit(@RequestParam("serverName") String serverName, @RequestParam(value = "deptId", required = false) String deptId) {
|
||||
String methodDescribe = getMethodDescribe("getAllLineOverLimit");
|
||||
List<Overlimit> result = lineService.getAllLineOverLimit(serverName, deptId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getAllLine")
|
||||
@ApiOperation("获取所有监测点")
|
||||
@ApiImplicitParam(name = "id", value = "监测点集合", required = true)
|
||||
public HttpResult<List<LineDeviceStateVO>> getAllLine(@RequestBody List<String> id) {
|
||||
String methodDescribe = getMethodDescribe("getAllLine");
|
||||
List<LineDeviceStateVO> result = lineMapper.getLineDeviceStateVO(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getDeviceState")
|
||||
@ApiOperation("获取变电站详情(pq_line)")
|
||||
@ApiImplicitParam(name = "id", value = "变电站id", required = true)
|
||||
public HttpResult<Integer> getDeviceState(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getDeviceState");
|
||||
String result = lineService.getLineIdByDevId(id);
|
||||
Device device = deviceMapper.selectById(result);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, device.getComFlag(), methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getSubstationInfo")
|
||||
@ApiOperation("获取变电站信息")
|
||||
@ApiImplicitParam(name = "id", value = "变电站id", required = true)
|
||||
@ApiIgnore
|
||||
public HttpResult<PollutionSubstationDTO> getSubstationInfo(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getSubstationInfo");
|
||||
LogUtil.njcnDebug(log, "{},变电站id:{}", methodDescribe, id);
|
||||
PollutionSubstationDTO pollutionSubstation = lineService.getSubstationInfo(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pollutionSubstation, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineInfo")
|
||||
@ApiOperation("获取监测点信息")
|
||||
@ApiImplicitParam(name = "pollutionParamDTO", value = "对象", required = true)
|
||||
@ApiIgnore
|
||||
public HttpResult<List<PollutionLineDTO>> getLineInfo(@RequestBody PollutionParamDTO pollutionParamDTO) {
|
||||
String methodDescribe = getMethodDescribe("getLineInfo");
|
||||
LogUtil.njcnDebug(log, "{},对象:{}", methodDescribe, pollutionParamDTO);
|
||||
List<PollutionLineDTO> result = lineService.getLineInfo(pollutionParamDTO);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineSubGdDetail")
|
||||
@ApiOperation("根据监测点id集合获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "监测点集合", required = true)
|
||||
@ApiIgnore
|
||||
public HttpResult<LineDetailVO> getLineSubGdDetail(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineSubGdDetail");
|
||||
LineDetailVO result = lineMapper.getLineSubGdDetail(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineInfoVO")
|
||||
@ApiOperation("根据监测点id集合获取详细信息")
|
||||
@ApiIgnore
|
||||
public HttpResult<LineDetailVO> getLineInfoVO(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineInfoVO");
|
||||
LineDetailVO result = lineMapper.getLineInfoVO(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/updateDeviceRunFlag")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("更新终端运行状态")
|
||||
@ApiIgnore
|
||||
public HttpResult<Boolean> updateDeviceRunFlag(@RequestParam("deviceId")String deviceId, @RequestParam("status")Integer status){
|
||||
String methodDescribe = getMethodDescribe("updateDeviceRunFlag");
|
||||
deviceMapper.updateDeviceRunFlag(deviceId,status);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/updateLineRunFlag")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("更新监测点运行状态")
|
||||
@ApiIgnore
|
||||
public HttpResult<Boolean> updateLineRunFlag(@RequestParam("lineId")String lineId, @RequestParam("status")Integer status){
|
||||
String methodDescribe = getMethodDescribe("updateLineRunFlag");
|
||||
lineDetailMapper.updateLineRunFlag(lineId,status);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getWarningSub")
|
||||
@ApiOperation("获取告警变电站信息")
|
||||
@ApiImplicitParam(name = "list", value = "变电站集合", required = true)
|
||||
@ApiIgnore
|
||||
public HttpResult<List<WarningSubstationDTO>> getWarningSub(@RequestParam("list") List<String> list) {
|
||||
String methodDescribe = getMethodDescribe("getWarningSub");
|
||||
LogUtil.njcnDebug(log, "{},变电站集合:{}", methodDescribe, list);
|
||||
List<WarningSubstationDTO> result = lineMapper.getWarningSub(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOverLimitLineInfo")
|
||||
@ApiOperation("监测点稳态超标信息")
|
||||
@ApiImplicitParam(name = "pollutionParamDTO", value = "实体", required = true)
|
||||
public HttpResult<List<OverLimitLineDTO>> getOverLimitLineInfo(@RequestBody PollutionParamDTO pollutionParamDTO) {
|
||||
String methodDescribe = getMethodDescribe("getOverLimitLineInfo");
|
||||
LogUtil.njcnDebug(log, "{},变电站集合:{}", methodDescribe, pollutionParamDTO);
|
||||
List<OverLimitLineDTO> result = lineMapper.getOverLimitLineInfo(pollutionParamDTO.getLineList());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineList")
|
||||
@ApiOperation("获取生成limitRate的监测点")
|
||||
@ApiIgnore
|
||||
public HttpResult<List<String>> getLineList() {
|
||||
String methodDescribe = getMethodDescribe("getLineList");
|
||||
List<String> result = lineMapper.getLineList();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOverLimitByList")
|
||||
@ApiOperation("获取监测点限值")
|
||||
@ApiImplicitParam(name = "pollutionParamDTO", value = "实体", required = true)
|
||||
@ApiIgnore
|
||||
public HttpResult<List<Overlimit>> getOverLimitByList(@RequestBody PollutionParamDTO pollutionParamDTO) {
|
||||
String methodDescribe = getMethodDescribe("getOverLimitByList");
|
||||
LogUtil.njcnDebug(log, "{},监测点集合:{}", methodDescribe, pollutionParamDTO);
|
||||
List<Overlimit> result = lineService.getOverLimitByList(pollutionParamDTO);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取监测点及以上层的基础信息(含区域信息)
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getBaseLineAreaInfo")
|
||||
@ApiOperation("获取监测点及以上层的基础信息(含区域信息)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "lineIndex", value = "监测点集合", required = true)
|
||||
})
|
||||
public HttpResult<List<AreaLineInfoVO>> getBaseLineAreaInfo(@RequestBody List<String> lineIndex) {
|
||||
String methodDescribe = getMethodDescribe("getBaseLineAreaInfo");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineService.getBaseLineAreaInfo(lineIndex,null,null), methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取丰富的监测点信息(扩展模糊查询)
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getRichLineInfo")
|
||||
@ApiOperation("获取丰富的监测点信息(扩展模糊查询)")
|
||||
@ApiImplicitParam(name = "lineBaseQueryParam", value = "监测点参数", required = true)
|
||||
public HttpResult<List<AreaLineInfoVO>> getRichLineInfo(@RequestBody @Validated LineBaseQueryParam lineBaseQueryParam) {
|
||||
String methodDescribe = getMethodDescribe("getRichLineInfo");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineService.getBaseLineAreaInfo(lineBaseQueryParam.getLineIds(),lineBaseQueryParam.getSearchValue(),lineBaseQueryParam.getComFlag()), methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据监测点ids获取监测点基本信息
|
||||
* @author cdf
|
||||
* @date 2022/6/30
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getBaseLineList")
|
||||
@ApiOperation("获取最基础的监测点信息")
|
||||
@ApiImplicitParam(name = "lineIndex", value = "监测点集合", required = true)
|
||||
public HttpResult<List<Line>> getBaseLineList(@RequestBody List<String> lineIndex) {
|
||||
String methodDescribe = getMethodDescribe("getBaseLineList");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineService.getBaseLineList(lineIndex), methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述: 获取指定条件的监测点信息
|
||||
* @author xy
|
||||
* @date 2022/7/8 14:24
|
||||
* @return 监测点详情集合
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineDetail")
|
||||
@ApiOperation("根据监测点集合获取监测点详情")
|
||||
@ApiImplicitParam(name = "list", value = "监测点集合")
|
||||
@ApiIgnore
|
||||
public HttpResult<List<LineDetail>> getLineDetail(@RequestBody(required = false) List<String> list) {
|
||||
String methodDescribe = getMethodDescribe("getLineDetail");
|
||||
LogUtil.njcnDebug(log, "{},监测点集合:{}", methodDescribe, list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineDetailMapper.getSpecifyLineDetail(list), methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getDeviceList")
|
||||
@ApiOperation("获取生成在线率的装置Id")
|
||||
@ApiIgnore
|
||||
public HttpResult<List<String>> getDeviceList() {
|
||||
String methodDescribe = getMethodDescribe("getDeviceList");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineMapper.getDeviceList(), methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前状态在线的监测点数量
|
||||
* @param lineIds 监测点集合
|
||||
* @return 在线的监测点数量
|
||||
* @author cdf
|
||||
* @date 2022/8/1
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOnLineCount")
|
||||
@ApiOperation("获取当前状态在线的监测点数量")
|
||||
@ApiImplicitParam(name = "lineIds", value = "监测点集合", required = true)
|
||||
public HttpResult<Integer> getOnLineCount(@RequestBody List<String> lineIds) {
|
||||
String methodDescribe = getMethodDescribe("getOnLineCount");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineMapper.getOnLineCount(lineIds), methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前状态在线和离线的监测点
|
||||
* @param lineBaseQueryParam 监测点查询参数
|
||||
* @return 在线的监测点id集
|
||||
* @author cdf
|
||||
* @date 2022/8/1
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOnOrUnLine")
|
||||
@ApiOperation("获取当前状态在线和离线的监测点")
|
||||
@ApiImplicitParam(name = "lineBaseQueryParam", value = "监测点查询参数", required = true)
|
||||
public HttpResult<List<String>> getOnOrUnLine(@RequestBody @Validated LineBaseQueryParam lineBaseQueryParam) {
|
||||
String methodDescribe = getMethodDescribe("getOnOrUnLine");
|
||||
if(Objects.isNull(lineBaseQueryParam.getComFlag())){
|
||||
throw new BusinessException(DeviceResponseEnum.PARAM_VAL_ERR);
|
||||
}
|
||||
List<String> idsRes = lineMapper.getOnOrUnLine(lineBaseQueryParam.getLineIds(),lineBaseQueryParam.getComFlag());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,idsRes, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getDeptLineCount")
|
||||
@ApiOperation("根据部门索引,查询出该部门的直接子部门关联的监测点数量")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceInfoParam", value = "监测点查询条件", required = true)
|
||||
})
|
||||
public HttpResult<List<DeptLineCountVO>> getDeptLineCount(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
|
||||
String methodDescribe = getMethodDescribe("getDeptLineCount");
|
||||
List<DeptLineCountVO> deptLineCountVOS = lineService.getDeptLineCount(deviceInfoParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptLineCountVOS, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/getLineBySubstationRelation")
|
||||
@ApiOperation("获取变电站和监测点的关系(分稳态暂态)")
|
||||
@ApiImplicitParam(name = "devDataType", value = "数据类型(0:暂态系统;1:稳态系统;)", required = true)
|
||||
public HttpResult<Map<String,List<String>>> getLineBySubstationRelation(@RequestParam("devDataType") Integer devDataType) {
|
||||
String methodDescribe = getMethodDescribe("getLineBySubstationRelation");
|
||||
Map<String,List<String>> map= lineService.getLineBySubstationRelation(devDataType);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, map, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取基础监测点详细信息
|
||||
* @author cdf
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@PostMapping("/getLineDetailList")
|
||||
@ApiOperation("获取基础监测点详细信息")
|
||||
@ApiImplicitParam(name = "lineIds", value = "监测点id集合", required = true)
|
||||
public HttpResult<List<LineDetailDataVO>> getLineDetailList(@RequestBody List<String> lineIds) {
|
||||
String methodDescribe = getMethodDescribe("getLineDetailList");
|
||||
List<LineDetailDataVO> resList= lineService.getLineDetailList(lineIds);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, resList, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getLineCountBySubstation")
|
||||
@ApiOperation("获取变电站下监测点数")
|
||||
@ApiImplicitParam(name = "subIndex", value = "数据类型(0:暂态系统;1:稳态系统;)", required = true)
|
||||
public HttpResult<Integer> getLineCountBySubstation(@RequestParam("subIndex") String subIndex) {
|
||||
String methodDescribe = getMethodDescribe("getLineBySubstationRelation");
|
||||
Integer count = lineService.getLineCountBySubstation(subIndex);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, count, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/getDeviceCountBySubstation")
|
||||
@ApiOperation("获取变电站下终端数")
|
||||
@ApiImplicitParam(name = "subIndex", value = "数据类型(0:暂态系统;1:稳态系统;)", required = true)
|
||||
public HttpResult<Integer> getDeviceCountBySubstation(@RequestParam("subIndex") String subIndex) {
|
||||
String methodDescribe = getMethodDescribe("getDeviceCountBySubstation");
|
||||
Integer count = lineService.getDeviceCountBySubstation(subIndex);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, count, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/getOnIntegrityByIds")
|
||||
@ApiOperation("监测点数据完整率(谐波专用)")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<List<RStatIntegrityVO>> getOnIntegrityByIds(@RequestBody OnlineRateParam param) {
|
||||
String methodDescribe = getMethodDescribe("getOnlineRateByDevIds");
|
||||
List<RStatIntegrityVO> onIntegrityByIds = integrityDMapper.getOnIntegrityByIds(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onIntegrityByIds,methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getOnIntegrityByIdsAndTime")
|
||||
@ApiOperation("监测点数据完整率")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<List<RStatIntegrityVO>> getOnIntegrityByIdsAndTime(@RequestBody LineBaseQueryParam param) {
|
||||
String methodDescribe = getMethodDescribe("getOnIntegrityByIdsAndTime");
|
||||
List<RStatIntegrityVO> onIntegrityByIds = integrityDMapper.getOnIntegrityByIdsAndTime (param.getLineIds(),param.getStartTime(),param.getEndTime());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onIntegrityByIds,methodDescribe);
|
||||
}
|
||||
@PostMapping("/getHalfReport")
|
||||
@ApiOperation("监测点半月报")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<Page<HalfReportVO>> getHalfReport(@RequestBody TerminalMainQueryParam param) {
|
||||
String methodDescribe = getMethodDescribe("getHalfReport");
|
||||
Page<HalfReportVO> halfReportVOS = lineService.halfReport(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,halfReportVOS,methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/getLineDetailByIds")
|
||||
@ApiOperation("根据监测点id获取监测点集合")
|
||||
@ApiImplicitParam(name = "ids", value = "参数实体", required = true)
|
||||
public HttpResult<List<LineDetailVO.Detail>> getLineDetailByIds(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("getLineDetailByIds");
|
||||
List<LineDetailVO.Detail> line = lineService.getLineDetailByIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,line,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据装置部门和模糊搜索获取装置详情")
|
||||
@PostMapping("/getDeptDeviceDetailData")
|
||||
HttpResult<List<LineDetailVO.Detail>> getDeptDeviceDetailData(@RequestBody DataParam param){
|
||||
String methodDescribe = getMethodDescribe("getDeptDeviceDetailData");
|
||||
List<LineDetailVO.Detail> deptDeviceDetailData = lineService.getDeptDeviceDetailData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptDeviceDetailData, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("获取当日无数据的监测点")
|
||||
@PostMapping("/getNoDataLine")
|
||||
HttpResult<List<LineDetailVO.noDataLineInfo>> getNoDataLine(){
|
||||
String methodDescribe = getMethodDescribe("getNoDataLine");
|
||||
List<LineDetailVO.noDataLineInfo> result = lineService.getNoDataLine();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据监测点id获取预告警单基础信息")
|
||||
@PostMapping("/getReportLineInfo")
|
||||
HttpResult<List<ReportLineInfoVo>> getReportLineInfo(@RequestBody List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("getReportLineInfo");
|
||||
List<ReportLineInfoVo> result = lineService.getReportLineInfo(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据监测点名称和电网侧变电站名称模糊搜索")
|
||||
@PostMapping("/getByName")
|
||||
HttpResult<List<LineDetail>> getByName(@RequestBody LineBaseQueryParam param){
|
||||
String methodDescribe = getMethodDescribe("getByName");
|
||||
List<LineDetail> list = lineService.getByName(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("获取部门下终端信息和终端下监测点信息")
|
||||
@GetMapping("/getByDeptDevLine")
|
||||
HttpResult<List<DevAndLine>> getByDeptDevLine(String id){
|
||||
String methodDescribe = getMethodDescribe("getByDeptDevLine");
|
||||
List<DevAndLine> list = lineService.getByDeptDevLine(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据部门获取所有指定等级的监测点id")
|
||||
@GetMapping("/getLevelMonitorIdByDept")
|
||||
HttpResult<List<String>> getLevelMonitorIdByDept(@RequestParam("level") String level,@RequestParam("deptId")String deptId){
|
||||
String methodDescribe = getMethodDescribe("getLevelMonitorIdByDept");
|
||||
List<String> list = lineService.getLevelMonitorByDept(level,deptId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据对象名称获取监测到信息")
|
||||
@GetMapping("/getMonitorByObjId")
|
||||
public HttpResult<List<LineDetail>> getMonitorByObjId(@RequestParam("objId") String objId){
|
||||
String methodDescribe = getMethodDescribe("getMonitorByObjId");
|
||||
List<LineDetail> list = lineService.getMonitorByObjId(objId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据监测点集合获取电网侧以及用户侧场站")
|
||||
@PostMapping("/getPowerStationByMonitorIds")
|
||||
public HttpResult<List<PollutionSubstationDTO>> getPowerStationByMonitorIds(@RequestBody List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("getPowerStationByMonitorIds");
|
||||
List<PollutionSubstationDTO> list = lineService.getPowerStationByMonitorIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,167 +0,0 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.param.NodeParam;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
import com.njcn.device.pq.service.INodeService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 前置程序控制器
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "前置机管理")
|
||||
@RestController
|
||||
@RequestMapping("node")
|
||||
@RequiredArgsConstructor
|
||||
public class NodeController extends BaseController {
|
||||
|
||||
private final INodeService iNodeService;
|
||||
|
||||
/**
|
||||
* 新增前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("新增前置机")
|
||||
@ApiImplicitParam(value = "前置机信息",name = "nodeParam",required = true)
|
||||
@PostMapping("addNode")
|
||||
public HttpResult<Boolean> addNode(@Validated @RequestBody NodeParam nodeParam){
|
||||
String methodDescribe = getMethodDescribe("addNode");
|
||||
boolean result = iNodeService.addNode(nodeParam);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation("修改前置机")
|
||||
@ApiImplicitParam(value = "前置机信息",name = "updateNodeParam",required = true)
|
||||
@PutMapping("updateNode")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPDATE)
|
||||
public HttpResult<Boolean> updateNode(@Validated @RequestBody NodeParam.NodeUpdateParam updateNodeParam){
|
||||
String methodDescribe = getMethodDescribe("updateNode");
|
||||
boolean result = iNodeService.updateNode(updateNodeParam);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除前置
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation(value = "删除前置机")
|
||||
@ApiImplicitParam(value = "前置机id",name = "id",required = true)
|
||||
@PostMapping("delNode")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||
public HttpResult<Boolean> delNode(@Validated @NotNull(message = "id不可为空") @RequestParam("id")String id){
|
||||
String methodDescribe = getMethodDescribe("delNode");
|
||||
boolean result = iNodeService.delNode(id);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 变更前置机状态
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation(value = "变更前置机状态")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(value = "前置机id",name = "id",required = true ),
|
||||
@ApiImplicitParam(value = "前置机状态",name = "state",required = true )
|
||||
})
|
||||
@PostMapping("updateNodeState")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPDATE)
|
||||
public HttpResult<Boolean> updateNodeState(@Validated @NotNull(message = "id不可为空") @RequestParam("id")String id,@NotNull(message = "状态不为空") @RequestParam("state")Integer state){
|
||||
String methodDescribe = getMethodDescribe("updateNodeState");
|
||||
boolean result = iNodeService.updateNodeState(id,state);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部前置机分页
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation("获取全部前置机")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@PostMapping("nodeList")
|
||||
public HttpResult<Page<Node>> nodeList(@RequestBody NodeParam.NodeQueryParam nodeQueryParam){
|
||||
String methodDescribe = getMethodDescribe("nodeList");
|
||||
Page<Node> page = iNodeService.nodeList(nodeQueryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部前置机不分页
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation("获取全部前置机")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@GetMapping("/nodeAllList")
|
||||
public HttpResult<List<Node>> nodeAllList(){
|
||||
String methodDescribe = getMethodDescribe("nodeAllList");
|
||||
List<Node> resList = iNodeService.nodeAllList();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, resList, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation("根据id获取前置机")
|
||||
@ApiImplicitParam(value = "前置机id",name = "id",required = true)
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@GetMapping("/getNodeById")
|
||||
public HttpResult<Node> getNodeById(@Validated @NotNull(message = "id不可为空") @RequestParam("id")String id){
|
||||
String methodDescribe = getMethodDescribe("getNodeById");
|
||||
Node node = iNodeService.getNodeById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, node, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.dto.DeviceInfo;
|
||||
import com.njcn.device.pq.pojo.dto.NodeProcessDeviceTree;
|
||||
import com.njcn.device.pq.pojo.param.NodeDeviceParam;
|
||||
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
import com.njcn.device.pq.service.NodeDeviceService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 前置程序控制器
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "前置机终端管理")
|
||||
@RestController
|
||||
@RequestMapping("nodeDevice")
|
||||
@RequiredArgsConstructor
|
||||
public class NodeDeviceController extends BaseController {
|
||||
|
||||
private final NodeDeviceService nodeDeviceService;
|
||||
|
||||
|
||||
/**
|
||||
* 根据前置ip获取对应的终端台账信息
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation("根据前置ip获取对应的终端台账信息")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@PostMapping("nodeDeviceList")
|
||||
public HttpResult<List<DeviceInfo>> nodeDeviceList(@RequestBody NodeDeviceParam nodeDeviceParam){
|
||||
String methodDescribe = getMethodDescribe("nodeDeviceList");
|
||||
List<DeviceInfo> list = nodeDeviceService.nodeDeviceList(nodeDeviceParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@ApiOperation("查询前置-进程-设备-设备树")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@PostMapping("nodeDeviceTree")
|
||||
public HttpResult<NodeProcessDeviceTree> nodeDeviceTree(@RequestParam("nodeId") String nodeId){
|
||||
String methodDescribe = getMethodDescribe("nodeDeviceTree");
|
||||
NodeProcessDeviceTree list = nodeDeviceService.nodeDeviceTree(nodeId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@ApiOperation("一键分配装置所属进程号")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@PostMapping("oneKeyDistribution")
|
||||
public HttpResult<Boolean> oneKeyDistribution(@RequestParam("nodeId") String nodeId){
|
||||
String methodDescribe = getMethodDescribe("oneKeyDistribution");
|
||||
nodeDeviceService.oneKeyDistribution(nodeId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
@ApiOperation("更新设备进程号")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@PostMapping("updateDeviceProcess")
|
||||
public HttpResult<Boolean> updateDeviceProcess(@RequestBody DeviceProcess deviceProcess){
|
||||
String methodDescribe = getMethodDescribe("updateDeviceProcess");
|
||||
Boolean flag = nodeDeviceService.updateDeviceProcess(deviceProcess);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,20 +7,18 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.PqsParam;
|
||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.param.AlarmStrategyParam;
|
||||
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
||||
import com.njcn.device.pq.service.AlarmStrategyService;
|
||||
import com.njcn.device.pq.service.IOverLimitService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测点限值
|
||||
* @author cdf
|
||||
* @date 2023/6/7
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/overLimit")
|
||||
@Api(tags = "监测点限值")
|
||||
@RequiredArgsConstructor
|
||||
public class OverLimitController extends BaseController {
|
||||
|
||||
private final IOverLimitService iOverLimitService;
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOverLimitByLineIds")
|
||||
@ApiOperation("监测点集合获取限值")
|
||||
@ApiImplicitParam(name = "lineIds", value = "监测点ids", required = true)
|
||||
@ApiIgnore
|
||||
public HttpResult<List<Overlimit>> getOverLimitByLineIds(@RequestBody List<String> lineIds){
|
||||
String methodDescribe = getMethodDescribe("getOverLimitByLineIds");
|
||||
List<Overlimit> overLimitList= iOverLimitService.list(new LambdaQueryWrapper<Overlimit>().in(Overlimit::getId,lineIds));
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, overLimitList, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLimitMapsByLineIds")
|
||||
@ApiOperation("监测点集合获取限值")
|
||||
@ApiImplicitParam(name = "lineIds", value = "监测点ids", required = true)
|
||||
@ApiIgnore
|
||||
public HttpResult<List<Map<String, Object>>> getLimitMapsByLineIds(@RequestBody List<String> lineIds){
|
||||
String methodDescribe = getMethodDescribe("getLimitMapsByLineIds");
|
||||
List<Map<String, Object>> overLimitList= iOverLimitService.listMaps(new LambdaQueryWrapper<Overlimit>().in(Overlimit::getId,lineIds));
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, overLimitList, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.param.PqDevTypeParam;
|
||||
import com.njcn.device.pq.pojo.po.PqDevType;
|
||||
import com.njcn.device.pq.service.PqDevTypeService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 前置程序控制器
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "装置型号管理")
|
||||
@RestController
|
||||
@RequestMapping("/devType")
|
||||
@RequiredArgsConstructor
|
||||
public class PqDevTypeController extends BaseController {
|
||||
|
||||
private final PqDevTypeService pqDevTypeService;
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getDevTypeList")
|
||||
@ApiOperation("查询装置型号全部信息")
|
||||
public HttpResult<List<PqDevType>> getDevTypeList() {
|
||||
String methodDescribe = getMethodDescribe("getDevTypeList");
|
||||
List<PqDevType> list = pqDevTypeService.list(new LambdaQueryWrapper<PqDevType>()
|
||||
.eq(PqDevType::getState, DataStateEnum.ENABLE.getCode())
|
||||
.orderByDesc(PqDevType::getCreateTime)
|
||||
);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/pageDevTypeList")
|
||||
@ApiOperation("分页查询装置型号信息")
|
||||
public HttpResult<Page<PqDevType>> pageDevTypeList(@RequestBody BaseParam param) {
|
||||
String methodDescribe = getMethodDescribe("pageDevTypeList");
|
||||
Page<PqDevType> list = pqDevTypeService.pageDevTypeList(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("新增装置型号")
|
||||
@PostMapping("/addDevType")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.ADD)
|
||||
public HttpResult<Boolean> addDevType(@RequestBody PqDevTypeParam param) {
|
||||
String methodDescribe = getMethodDescribe("addDevType");
|
||||
Boolean result = pqDevTypeService.addDevType(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@ApiOperation("更新装置型号")
|
||||
@PostMapping("/updateDevType")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.UPDATE)
|
||||
public HttpResult<Boolean> updateDevType(@RequestBody PqDevTypeParam.PqDevTypeUpdateParam param) {
|
||||
String methodDescribe = getMethodDescribe("updateDevType");
|
||||
Boolean result = pqDevTypeService.updateDevType(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/delDevType")
|
||||
@ApiOperation(value = "删除新装置型号")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DELETE)
|
||||
public HttpResult<Boolean> delIDevType(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("delIDevType");
|
||||
Boolean flag = pqDevTypeService.delIDevType(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.param.LogsListParam;
|
||||
import com.njcn.device.pq.pojo.po.PqsTerminalLogs;
|
||||
import com.njcn.device.pq.pojo.vo.LogsListVO;
|
||||
import com.njcn.device.pq.service.IPqsTerminalLogsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2023-04-13
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "日志")
|
||||
@RestController
|
||||
@RequestMapping("/pqsTerminalLogs")
|
||||
@RequiredArgsConstructor
|
||||
public class PqsTerminalLogsController extends BaseController {
|
||||
|
||||
private final IPqsTerminalLogsService iPqsTerminalLogsService;
|
||||
|
||||
/**
|
||||
* 新增日志表数据
|
||||
*
|
||||
* @author zbj
|
||||
* @date 2023/4/13
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/saveLogs")
|
||||
@ApiOperation("新增日志表数据")
|
||||
@ApiImplicitParam(name = "pqsTerminalLogs", value = "实体", required = true)
|
||||
public HttpResult<Object> saveLogs(@RequestBody PqsTerminalLogs pqsTerminalLogs) {
|
||||
String methodDescribe = getMethodDescribe("saveLogs");
|
||||
boolean res = iPqsTerminalLogsService.saveLogs(pqsTerminalLogs);
|
||||
if (res) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 运维日志页面展示
|
||||
*
|
||||
* @author zbj
|
||||
* @date 2023/4/13
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getList")
|
||||
@ApiOperation("运维日志页面展示")
|
||||
@ApiImplicitParam(name = "logsListParam", value = "实体", required = true)
|
||||
public HttpResult<Page<PqsTerminalLogs>> getList(@RequestBody LogsListParam logsListParam) {
|
||||
String methodDescribe = getMethodDescribe("getList");
|
||||
Page<PqsTerminalLogs> result = iPqsTerminalLogsService.getList(logsListParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.param.ProgramParam;
|
||||
import com.njcn.device.pq.pojo.vo.VersionVO;
|
||||
import com.njcn.device.pq.service.ProgramVersionService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: chenchao
|
||||
* @date: 2022/05/19 14:44
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/programVersion")
|
||||
@Api(tags = "终端版本维护")
|
||||
@AllArgsConstructor
|
||||
public class ProgramVersionController extends BaseController {
|
||||
|
||||
private final ProgramVersionService programService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getProgramVersion")
|
||||
@ApiOperation("程序版本查询")
|
||||
@ApiImplicitParam(name = "programParam", value = "程序版本查询", required = true)
|
||||
public HttpResult<Page<VersionVO>> getProgramVersion(@RequestBody @Validated ProgramParam programParam) {
|
||||
String methodDescribe = getMethodDescribe("getProgramVersion");
|
||||
Page<VersionVO> list = programService.getProgramVersion(programParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ResponseBody
|
||||
@PostMapping("/addProgramVersion")
|
||||
@ApiOperation("新增程序版本")
|
||||
public HttpResult addProgramVersion(@RequestParam("name") String name,
|
||||
@RequestParam("protocol") String protocol,
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd") @RequestParam("date") LocalDate date,
|
||||
@RequestParam("devType") String devType,
|
||||
@RequestParam("remark") String remark,
|
||||
@RequestParam(value = "versionType",required = false) String versionType,
|
||||
@RequestParam("filename") String fileName,
|
||||
@ApiParam(value = "文件") @RequestPart(value = "file",required = false) MultipartFile file) {
|
||||
String methodDescribe = getMethodDescribe("addProgramVersion");
|
||||
boolean res = programService.addProgramVersion(name,protocol,date,devType,remark,versionType,fileName,file);
|
||||
if (res) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
throw new BusinessException(CommonResponseEnum.FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getProgramVersionById")
|
||||
@ApiOperation("版本文件是否存在")
|
||||
@ApiImplicitParam(name = "id", value = "终端版本id", required = true)
|
||||
public HttpResult getProgramVersionById(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getProgramVersionById");
|
||||
boolean res = programService.getProgramVersionById(id);
|
||||
if (res) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FILE_EXIST, null, methodDescribe);
|
||||
} else {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateProgramVersion")
|
||||
@ApiOperation("修改程序版本")
|
||||
public HttpResult updateProgramVersion(@RequestParam("id") String id,
|
||||
@RequestParam("name") String name,
|
||||
@RequestParam("protocol") String protocol,
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd") @RequestParam("date") LocalDate date,
|
||||
@RequestParam("devType") String devType,
|
||||
@RequestParam("remark") String remark,
|
||||
@RequestParam(value = "versionType",required = false) String versionType,
|
||||
@RequestParam("filename") String fileName,
|
||||
@ApiParam(value = "文件") @RequestPart(name = "file",required = false) MultipartFile file) {
|
||||
String methodDescribe = getMethodDescribe("updateProgramVersion");
|
||||
boolean res = programService.updateProgramVersion(id,name,protocol,date,devType,remark,versionType,fileName,file);
|
||||
if (res) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
throw new BusinessException(CommonResponseEnum.FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateVersionFlag")
|
||||
@ApiOperation("修改程序版本状态")
|
||||
@ApiImplicitParam(name = "id", value = "终端版本id", required = true)
|
||||
public HttpResult updateVersionFlag(@RequestParam("id") String id, @RequestParam("versionFlag") Integer flag) {
|
||||
String methodDescribe = getMethodDescribe("updateVersionFlag");
|
||||
boolean res = programService.updateVersionFlag(id,flag);
|
||||
if (res) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
throw new BusinessException(CommonResponseEnum.FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/delProgramVersion")
|
||||
@ApiOperation("删除程序版本")
|
||||
@ApiImplicitParam(name = "id", value = "终端版本id", required = true)
|
||||
public HttpResult delProgramVersion(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("delProgramVersion");
|
||||
boolean res = programService.delProgramVersion(id);
|
||||
if (res) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
throw new BusinessException(CommonResponseEnum.FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getVersion")
|
||||
@ApiOperation("查看除本外其他版本信息")
|
||||
@ApiImplicitParam(name = "param", value = "程序版本查询", required = true)
|
||||
public HttpResult<List<VersionVO>> getVersion(@RequestBody @Validated ProgramParam.Version param) {
|
||||
String methodDescribe = getMethodDescribe("getVersion");
|
||||
List<VersionVO> version = programService.getVersion(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, version, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,9 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.common.service.TerminalBaseService;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.pq.pojo.bo.DeviceType;
|
||||
import com.njcn.device.pq.pojo.bo.excel.TerminalBaseExcel;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
@@ -20,10 +23,6 @@ import com.njcn.device.pq.pojo.dto.PushResultDTO;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.device.pq.service.TerminalBaseService;
|
||||
import com.njcn.device.pq.service.impl.GeneralDeviceService;
|
||||
import com.njcn.message.constant.DeviceRebootType;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@@ -1,214 +0,0 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.PqsParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalMainQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalParam;
|
||||
import com.njcn.device.pq.pojo.vo.LineFlowMealDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalDaliyFlowVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalMaintainVO;
|
||||
import com.njcn.device.pq.service.TerminalMaintainService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
* 终端运维管理
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "终端运维管理")
|
||||
@RestController
|
||||
@RequestMapping("/maintain")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
public class TerminalMaintainController extends BaseController {
|
||||
|
||||
private final TerminalMaintainService terminalMaintainService;
|
||||
|
||||
/**
|
||||
* 查询终端运维主界面列表
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getTerminalMainList")
|
||||
@ApiOperation("获取终端运维主列表")
|
||||
@ApiImplicitParam(name = "terminalMainQueryParam",required = true)
|
||||
public HttpResult<List<TerminalMaintainVO>> getTerminalMainList(@RequestBody TerminalMainQueryParam terminalMainQueryParam) {
|
||||
String methodDescribe = getMethodDescribe("getTerminalMainList");
|
||||
List<TerminalMaintainVO> resList = terminalMaintainService.getTerminalMainList(terminalMainQueryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, resList, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonthFlow")
|
||||
@ApiOperation("获取每月流量")
|
||||
@ApiImplicitParam(name = "deviceInfoParam", value = "实体", required = true)
|
||||
public HttpResult<List<LineFlowMealDetailVO>> getMonthFlow (@RequestBody PqsParam deviceInfoParam){
|
||||
String methodDescribe = getMethodDescribe("getMonthFlow");
|
||||
LogUtil.njcnDebug(log, "{},参数集合:{}", methodDescribe, deviceInfoParam);
|
||||
if (deviceInfoParam.getDeptIndex() == null) {
|
||||
DeviceInfoParam param = new DeviceInfoParam(RequestUtil.getDeptIndex(),null);
|
||||
deviceInfoParam.setDeptIndex(param.getDeptIndex());
|
||||
}
|
||||
List<LineFlowMealDetailVO> result = terminalMaintainService.getMonthFlow(deviceInfoParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 终端状态管理,流量管理,流量策略管理主界面
|
||||
*
|
||||
* @param ids 装置id集
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getStatusManageList")
|
||||
@ApiOperation("终端状态管理列表")
|
||||
public HttpResult<List<TerminalMaintainVO>> getStatusManageList(@RequestBody @NotEmpty(message = "id不可为空") List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("getStatusManageList");
|
||||
List<TerminalMaintainVO> resList = terminalMaintainService.getManageList(ids, 0);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, resList, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 终端流量配置主界面
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getFlowManageList")
|
||||
@ApiOperation("终端流量管理列表")
|
||||
public HttpResult<List<TerminalMaintainVO>> getFlowManageList(@RequestBody @NotEmpty(message = "id不可为空") List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("getFlowManageList");
|
||||
List<TerminalMaintainVO> resList = terminalMaintainService.getManageList(ids, 1);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, resList, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getFlowManageDetail")
|
||||
@ApiOperation("终端流量管理详情")
|
||||
public HttpResult<List<TerminalDaliyFlowVO>> getFlowManageDetail(@RequestBody TerminalMainQueryParam param) {
|
||||
String methodDescribe = getMethodDescribe("getFlowManageDetail");
|
||||
List<TerminalDaliyFlowVO> res = terminalMaintainService.getFlowManageDetail(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 终端流量策略配置主界面
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getFlowStrategyManageList")
|
||||
@ApiOperation("终端流量策略列表")
|
||||
public HttpResult<List<TerminalMaintainVO>> getFlowStrategyManageList(@RequestBody @NotEmpty(message = "id不可为空") List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("getFlowStrategyManageList");
|
||||
List<TerminalMaintainVO> resList = terminalMaintainService.getManageList(ids, 2);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, resList, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改终端状态
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/updateRunFlagManage")
|
||||
@ApiOperation("批量修改终端状态")
|
||||
@ApiImplicitParam(name = "terminalParam", value = "实体", required = true)
|
||||
public HttpResult<List<TerminalMaintainVO>> updateRunFlagManage(@RequestBody TerminalParam terminalParam) {
|
||||
String methodDescribe = getMethodDescribe("updateRunFlagManage");
|
||||
if(Objects.isNull(terminalParam.getRunFlag())){
|
||||
throw new BusinessException(CommonResponseEnum.ILLEGAL_ARGUMENT_EXCEPTION);
|
||||
}
|
||||
boolean res = terminalMaintainService.updateRunFlagManage(terminalParam);
|
||||
if (res) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量修改终端流量
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/updateDevFlowMeal")
|
||||
@ApiOperation("批量修改终端流量套餐")
|
||||
@ApiImplicitParam(name = "terminalParam", value = "实体", required = true)
|
||||
public HttpResult<Object> updateDevFlowMeal(@RequestBody TerminalParam terminalParam) {
|
||||
String methodDescribe = getMethodDescribe("updateDevFlowMeal");
|
||||
if(StrUtil.isBlank(terminalParam.getBaseMealId()) && StrUtil.isBlank(terminalParam.getExtendMealId())){
|
||||
throw new BusinessException(CommonResponseEnum.ILLEGAL_ARGUMENT_EXCEPTION);
|
||||
}
|
||||
boolean res = terminalMaintainService.updateFlowMeal(terminalParam);
|
||||
if (res) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量修改终端流量策略
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/updateDevFlowStrategy")
|
||||
@ApiOperation("批量修改终端流量策略")
|
||||
@ApiImplicitParam(name = "terminalParam", value = "实体", required = true)
|
||||
public HttpResult<Object> updateDevFlowStrategy(@RequestBody TerminalParam terminalParam) {
|
||||
String methodDescribe = getMethodDescribe("updateDevFlowStrategy");
|
||||
if(StrUtil.isBlank(terminalParam.getFlowStrategyId())){
|
||||
throw new BusinessException(CommonResponseEnum.ILLEGAL_ARGUMENT_EXCEPTION);
|
||||
}
|
||||
boolean res = terminalMaintainService.updateFlowStrategy(terminalParam);
|
||||
if (res) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.param.TerminalMainQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.DevVersion;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalVersionVO;
|
||||
import com.njcn.device.pq.service.TerminalVersionService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
* 终端程序版本管理
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "终端程序版本管理")
|
||||
@RestController
|
||||
@RequestMapping("/version")
|
||||
@RequiredArgsConstructor
|
||||
public class TerminalVersionController extends BaseController {
|
||||
|
||||
private final TerminalVersionService terminalVersionService;
|
||||
|
||||
/**
|
||||
* 查询终端程序版本主列表
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getTerminalVersionList")
|
||||
@ApiOperation("查询终端程序版本主列表")
|
||||
public HttpResult<List<TerminalVersionVO>> getTerminalVersionList(@RequestBody TerminalMainQueryParam terminalMainQueryParam) {
|
||||
String methodDescribe = getMethodDescribe("getTerminalVersionList");
|
||||
List<TerminalVersionVO> resList = terminalVersionService.getTerminalVersionList(terminalMainQueryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, resList, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询装置升级日志
|
||||
* @author cdf
|
||||
* @date 2022/5/17
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getTerminalUpLog")
|
||||
@ApiOperation("查询终端程序版本升级日志")
|
||||
public HttpResult<List<DevVersion>> getTerminalUpLog(@RequestParam("id")String id) {
|
||||
String methodDescribe = getMethodDescribe("getTerminalUpLog");
|
||||
List<DevVersion> resList = terminalVersionService.getTerminalUpLog(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, resList, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getDevVersionList")
|
||||
@ApiOperation("查询终端版本信息")
|
||||
public HttpResult<List<TerminalVersionVO.Version>> getVersionList(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("getVersionList");
|
||||
List<TerminalVersionVO.Version> versionList = terminalVersionService.getVersionList(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, versionList, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,21 +4,13 @@ import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import com.njcn.dataProcess.api.PqsCommunicateFeignClient;
|
||||
import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto;
|
||||
import com.njcn.device.pq.constant.Param;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.NodeMapper;
|
||||
import com.njcn.device.pq.mapper.PqsTerminalLogsMapper;
|
||||
import com.njcn.device.pq.pojo.dto.DeviceInfo;
|
||||
import com.njcn.device.pq.pojo.dto.NodeProcessDeviceTree;
|
||||
import com.njcn.device.device.service.DeviceProcessService;
|
||||
import com.njcn.device.device.service.IDeviceService;
|
||||
import com.njcn.device.node.mapper.NodeMapper;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
import com.njcn.device.pq.pojo.po.PqsTerminalLogs;
|
||||
import com.njcn.device.pq.service.DeviceProcessService;
|
||||
import com.njcn.device.pq.service.IDeviceService;
|
||||
import com.njcn.message.constant.DeviceRebootType;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
@@ -26,12 +18,9 @@ import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.dto.TerminalGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author denghuajun
|
||||
* @since 2022-01-12 18:04
|
||||
*/
|
||||
public interface DeptLineMapper extends BaseMapper<DeptLine> {
|
||||
/**
|
||||
* 换绑监测点
|
||||
* @param id 部门id
|
||||
* @param lineId 监测点id
|
||||
* @return
|
||||
*/
|
||||
int deptChangeBindLine(@Param("id")String id,@Param("lineId")String lineId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有绑定的监测点
|
||||
*/
|
||||
List<String> getAllBindLine();
|
||||
|
||||
/**
|
||||
* 查询其他绑定的监测点
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
List<String> getOtherBindLine(@Param("deptId")String deptId);
|
||||
|
||||
/**
|
||||
* 查询自己绑定的监测点
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
List<String> getMyselfBindLine(@Param("deptId")String deptId);
|
||||
|
||||
@Select ("SELECT\n" +
|
||||
"\tpq_dept_line.Id,\n" +
|
||||
"\tpq_dept_line.Line_Id\n" +
|
||||
"FROM\n" +
|
||||
"\tpq_dept_line\n" +
|
||||
"WHERE\n" +
|
||||
"\tEXISTS (\n" +
|
||||
"\t\tSELECT\n" +
|
||||
"\t\t\t1\n" +
|
||||
"\t\tFROM\n" +
|
||||
"\t\t\tpq_device,\n" +
|
||||
"\t\t\tpq_line\n" +
|
||||
"\t\tWHERE\n" +
|
||||
"\t\t\tSUBSTRING_INDEX(\n" +
|
||||
"\t\t\t\tSUBSTRING_INDEX(pq_line.Pids, ',', 5),\n" +
|
||||
"\t\t\t\t',',\n" +
|
||||
"\t\t\t\t- 1\n" +
|
||||
"\t\t\t) = pq_device.Id\n" +
|
||||
"\t\tAND pq_line.Id = pq_dept_line.Line_Id and (pq_device.Dev_Data_Type= 2 or pq_device.Dev_Data_Type = #{devDataType})\n" +
|
||||
"\t)")
|
||||
List<DeptLine> getLineByDeptRelation(@Param("devDataType")Integer devDataType);
|
||||
|
||||
|
||||
List<LineDevGetDTO> lineDevGet(@Param("list")List<Integer> devType,@Param("type")Integer type,@Param("lineRunFlag") Integer lineRunFlag);
|
||||
|
||||
List<TerminalGetBase> orgSubStationGet(@Param("list")List<Integer> devType);
|
||||
|
||||
List<TerminalGetBase.Extend> orgSubStationInfoGet(@Param("list")List<Integer> devType,@Param("powerFlag")Integer powerFlag,@Param("lineRunFlag") Integer lineRunFlag);
|
||||
|
||||
List<String> getLineIdByDeptIds(@Param("deptIds")List<String> deptIds,@Param("manufacturer")String manufacturer,@Param("runFlag")List<Integer> runFlag,@Param("dataType")List<Integer> dataType,@Param("objType")String objType);
|
||||
|
||||
|
||||
List<SubGetBase> selectSubStationList(@Param("param") SubstationParam substationParam);
|
||||
|
||||
List<String> getLineByDeptIdAndNewStation(@Param("ids") List<String> id,@Param("dictTree")List<String> dictTree);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.DevFuction;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
public interface DevFuctionMapper extends BaseMapper<DevFuction> {
|
||||
|
||||
int addBatch(@Param("list") List<DevFuction> list);
|
||||
|
||||
//查询pq_line表等级为5的装置去device表查装置id与装置功能存入cld_dev_fuction表
|
||||
List<DevFuction> selectLineTable();
|
||||
List<DevFuction> selectDictTable();
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.DevMeal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
public interface DevMealMapper extends BaseMapper<DevMeal> {
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.DevStrategy;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
public interface DevStrategyMapper extends BaseMapper<DevStrategy> {
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.DevVersion;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
public interface DevVersionMapper extends BaseMapper<DevVersion> {
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.biz.pojo.po.DeviceBak;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface DeviceBakMapper extends BaseMapper<DeviceBak> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunManageVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunTimeVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface DeviceMapper extends BaseMapper<Device> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取变电站下面装置
|
||||
* @param subId 变电站id
|
||||
* @param ip 装置ip
|
||||
* @param port 装置端口号
|
||||
* @author cdf
|
||||
* @date 2022/12/26
|
||||
*/
|
||||
List<Device> getDeviceBySubId(@Param("subId") String subId,@Param("ip") String ip,@Param("port") Integer port,@Param("devId")String devId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取监测点台账信息
|
||||
* @param list 监测点集合
|
||||
* @param comFlag 状态
|
||||
* @param searchValue
|
||||
* @return 结果
|
||||
*/
|
||||
List<RunManageVO> getRunManageList(@Param("list") List<String> list,
|
||||
@Param("comFlag") List<Integer> comFlag,
|
||||
@Param("runFlag") List<Integer> runFlag,
|
||||
@Param("searchValue") String searchValue);
|
||||
|
||||
/**
|
||||
* 获取监测点台账信息
|
||||
* @param list 终端集合
|
||||
* @param comFlag 状态
|
||||
* @param runFlag 状态
|
||||
* @param manufacturer
|
||||
* @param searchValue
|
||||
* @return 结果
|
||||
*/
|
||||
List<RunTimeVO> getRunManageDevList(@Param("list") List<String> list,
|
||||
@Param("comFlag") List<Integer> comFlag,
|
||||
@Param("runFlag") List<Integer> runFlag,
|
||||
@Param("manufacturers") List<String> manufacturer,
|
||||
@Param("searchValue") String searchValue);
|
||||
|
||||
|
||||
Page<RunTimeVO> getDeviceLedger(@Param("page")Page<RunTimeVO> page,
|
||||
@Param("list") List<String> list,
|
||||
@Param("comFlag") List<Integer> comFlag,
|
||||
@Param("runFlag") List<Integer> runFlag,
|
||||
@Param("manufacturers") List<String> manufacturer,
|
||||
@Param("searchValue") String searchValue);
|
||||
|
||||
|
||||
List<LineInfluxDbOnlineVO> getOnlineEvaluate(@Param("list") List<String> devIndexes,
|
||||
@Param("begin") String searchBeginTime,
|
||||
@Param("end") String searchEndTime);
|
||||
|
||||
/**
|
||||
* @Description: 获取终端集合信息
|
||||
* @param ids
|
||||
* @return: java.util.List<com.njcn.cloud.pojo.vo.app.DevDetail>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/7 15:40
|
||||
*/
|
||||
List<DevDetail> selectDevByIds(@Param("ids") List<String> ids);
|
||||
|
||||
void updateDeviceRunFlag(@Param("id")String deviceId, @Param("runFlag")Integer status);
|
||||
|
||||
List<PollutionLineInfoDTO> getPollutionDeviceInfo(@Param("id")List<String> devId);
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunManageVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunTimeVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface DeviceProcessMapper extends BaseMapper<DeviceProcess> {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface LineBakMapper extends BaseMapper<LineBak> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface LineDetailMapper extends BaseMapper<LineDetail> {
|
||||
|
||||
/**
|
||||
* 查询装置下监测点号号是否已被占用
|
||||
* @param devIndex 装置索引
|
||||
* @param num 线路号
|
||||
* @return 监测点信息
|
||||
*/
|
||||
List<LineDetail> getLineDetail(@Param("devIndex") String devIndex, @Param("num") List<Integer> num);
|
||||
|
||||
/**
|
||||
* 实际设备下的监测点&&稳态系统和两个系统的监测点&&投运终端下的监测点
|
||||
* 获取指定条件的监测点信息
|
||||
* @param list 监测点集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineDetail> getSpecifyLineDetail(@Param("list") List<String> list);
|
||||
|
||||
|
||||
/**
|
||||
* 获取指定的监测点信息以及电压等级(需要其他字段可在基础上扩充)
|
||||
* @param lineIds 监测点集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineDetailDataVO> getLineDetailInfo(@Param("lineIds") List<String> lineIds);
|
||||
|
||||
|
||||
@Select ("select count(1) from pq_line a where a.Level=4 and SUBSTRING_INDEX(SUBSTRING_INDEX(a.Pids, ',', 4),',',-1)=#{subIndex}")
|
||||
Integer getDeviceCountBySubstation(@Param("subIndex")String subIndex);
|
||||
|
||||
@Select ("select count(1) from pq_line a where a.Level=6 and SUBSTRING_INDEX(SUBSTRING_INDEX(a.Pids, ',', 4),',',-1)=#{subIndex}")
|
||||
Integer getLineCountBySubstation(@Param("subIndex")String subIndex);
|
||||
|
||||
|
||||
LineDevGetDTO getMonitorDetail(@Param("monitorId")String monitorId);
|
||||
|
||||
void updateLineRunFlag(@Param("id")String lineId, @Param("runFlag")Integer status);
|
||||
|
||||
void updateLineRunFlagBatch(@Param("lineIds") List<String> lineIds, @Param("runFlag") Integer status);
|
||||
|
||||
/**
|
||||
* 根据监测点信息获取监测点详情(关联终端和母线)
|
||||
* 获取指定条件的监测点信息
|
||||
* @param Ids 监测点集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineDetail> getLineDetailByIds(@Param("ids") List<String> Ids);
|
||||
|
||||
/**
|
||||
* 判断该新能源场站信息是否绑定了测点ID
|
||||
*/
|
||||
Integer checkExistsLineByNewStationId(@Param("newStationId") String newStationId);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,589 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.advanced.UpDevVO;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.bo.DeviceType;
|
||||
import com.njcn.device.pq.pojo.bo.excel.TerminalBaseExcel;
|
||||
import com.njcn.device.pq.pojo.dto.*;
|
||||
import com.njcn.device.pq.pojo.dto.OverLimitLineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.pq.pojo.dto.WarningSubstationDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalMainQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.web.pojo.vo.LineDataVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface LineMapper extends BaseMapper<Line> {
|
||||
|
||||
/**
|
||||
* 查询变电站下面的装置
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/5
|
||||
*/
|
||||
List<Device> getDeviceBySubId(@Param("subId") String subId, @Param("list") List<String> ipList);
|
||||
|
||||
/**
|
||||
* 查询变电站下面的装置
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/5
|
||||
*/
|
||||
List<Device> getDeviceBySubIdForUpdate(@Param("subId") String subId, @Param("ipList") List<String> ipList, @Param("devList") List<String> devList);
|
||||
|
||||
/**
|
||||
* 查询装置下的监测点完整信息
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/6
|
||||
*/
|
||||
List<LineDetail> getLineDetailByDeviceId(@Param("devId") String devId);
|
||||
|
||||
/**
|
||||
* 查询装置下的母线信息
|
||||
*
|
||||
* @param devId 设备id
|
||||
* @date 2022/7/1
|
||||
*/
|
||||
List<Voltage> getVoltageByDevId(@Param("devId") String devId);
|
||||
|
||||
|
||||
/**
|
||||
* 通过监测点id获取母线详情
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/6
|
||||
*/
|
||||
Voltage getVoltageByLineId(@Param("lineId") String lineId);
|
||||
|
||||
|
||||
/**
|
||||
* 返回所有树节点(全部pq_line表数据)
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/13
|
||||
*/
|
||||
List<TerminalTree> getAllList();
|
||||
|
||||
/**
|
||||
* 获取区域
|
||||
*
|
||||
* @return TerminalTree 终端树数据
|
||||
* @author cdf
|
||||
* @date 2022/2/14
|
||||
*/
|
||||
List<TerminalTree> getProvinceList(@Param("pids") List<String> pids, @Param("type") Integer type);
|
||||
|
||||
|
||||
List<MonitorInfoDTO> getLineListByIds(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* 返回未绑定的监测点
|
||||
*/
|
||||
List<TerminalTree> getUnBindList();
|
||||
|
||||
/**
|
||||
* 返回省份的上级
|
||||
*/
|
||||
List<String> selectProject(@Param("areaId") String areaId);
|
||||
|
||||
/**
|
||||
* @param areaId
|
||||
* @return 返回省份名称
|
||||
*/
|
||||
String getProviceName(@Param("areaId") String areaId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据终端id,获取所有对应终端
|
||||
*
|
||||
* @param devIds 终端id
|
||||
* @param deviceType 终端条件筛选
|
||||
* @return 终端数据
|
||||
*/
|
||||
List<Line> getDeviceById(@Param("devIds") List<String> devIds, @Param("deviceType") DeviceType deviceType);
|
||||
|
||||
|
||||
/**
|
||||
* 获取离线装置
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/4/3
|
||||
*/
|
||||
List<TerminalBaseVO> getDeviceByIdOnOrOff(@Param("devIds") List<String> devIds, @Param("deviceType") DeviceType deviceType, @Param("comFlag") Integer comFlag);
|
||||
|
||||
|
||||
List<LineDataVO> getLineDetail(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据监测点id,获取所有监测点
|
||||
*
|
||||
* @param ids 监测点id
|
||||
* @param deviceInfoParam 监测点查询条件
|
||||
* @return 监测点数据
|
||||
*/
|
||||
List<Line> getLineByCondition(@Param("ids") List<String> ids, @Param("deviceInfoParam") DeviceInfoParam deviceInfoParam);
|
||||
|
||||
/**
|
||||
* 查询终端信息
|
||||
*
|
||||
* @param devIds 终端索引
|
||||
* @param deviceType 终端筛选条件
|
||||
* @param manufacturer 终端厂家
|
||||
*/
|
||||
List<Line> getDeviceByCondition(@Param("devIds") List<String> devIds, @Param("deviceType") DeviceType deviceType, @Param("manufacturer") List<SimpleDTO> manufacturer);
|
||||
|
||||
/**
|
||||
* 查询母线信息
|
||||
*
|
||||
* @param voltageIds 母线索引
|
||||
* @param scale 电压等级
|
||||
*/
|
||||
List<Line> getVoltageByCondition(@Param("voltageIds") List<String> voltageIds, @Param("scale") List<SimpleDTO> scale);
|
||||
|
||||
/**
|
||||
* 查询母线id
|
||||
*
|
||||
* @param voltageIds 母线索引集合
|
||||
* @param scale 电压等级
|
||||
*/
|
||||
List<String> getVoltageIdByScale(@Param("voltageIds") List<String> voltageIds, @Param("scale") String scale);
|
||||
|
||||
/**
|
||||
* 查询变电站id
|
||||
*
|
||||
* @param subIds 变电站索引集合
|
||||
* @param scale 电压等级
|
||||
*/
|
||||
List<String> getSubIdByScale(@Param("subIds") List<String> subIds, @Param("scale") String scale);
|
||||
|
||||
/**
|
||||
* 查询监测点id
|
||||
*
|
||||
* @param lineIds 监测点索引集合
|
||||
* @param loadType 干扰源类型
|
||||
*/
|
||||
List<String> getLineIdByLoadType(@Param("lineIds") List<String> lineIds, @Param("loadType") String loadType);
|
||||
|
||||
|
||||
/**
|
||||
* 查询终端id
|
||||
*
|
||||
* @param deviceIds 终端索引集合
|
||||
* @param manufacturer 制造厂家
|
||||
*/
|
||||
List<String> getDeviceIdByManufacturer(@Param("deviceIds") List<String> deviceIds, @Param("manufacturer") String manufacturer);
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有在线投运的监测点限值
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/3/23
|
||||
*/
|
||||
List<Overlimit> getAllLineOverLimit(@Param("list") List<Integer> list);
|
||||
|
||||
/**
|
||||
* 根据监测点集合查询基础信息
|
||||
*
|
||||
* @param lineIndex 监测点结合
|
||||
* @return 基础信息
|
||||
*/
|
||||
List<BaseLineInfo> getBaseLineInfo(@Param("list") List<String> lineIndex);
|
||||
|
||||
|
||||
/**
|
||||
* 获取监测点区域详细信息(原基础上添加监测点区域经纬度信息)
|
||||
*
|
||||
* @param lineIndex 监测点结合
|
||||
* @date 2022/6/29
|
||||
*/
|
||||
List<AreaLineInfoVO> getBaseLineAreaInfo(@Param("list") List<String> lineIndex, @Param("searchValue") String searchValue, @Param("comFlag") Integer comFlag);
|
||||
|
||||
/**
|
||||
* 返回监测点信息及通讯状态
|
||||
*
|
||||
* @param lineIndex 监测点集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineDeviceStateVO> getLineDeviceStateVO(@Param("list") List<String> lineIndex);
|
||||
|
||||
|
||||
/**
|
||||
* 获取变电站信息
|
||||
*
|
||||
* @param id 变电站id
|
||||
* @return 结果
|
||||
*/
|
||||
PollutionSubstationDTO getSubstationInfo(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* 获取监测点信息
|
||||
*
|
||||
* @param list 监测点集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<PollutionLineDTO> getLineInfo(@Param("list") List<String> list);
|
||||
|
||||
/**
|
||||
* 获取监测点信息
|
||||
*
|
||||
* @param id 监测点id
|
||||
* @return 结果
|
||||
*/
|
||||
LineDetailVO getLineSubGdDetail(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* 获取告警变电站信息
|
||||
*
|
||||
* @param list 变电站集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<WarningSubstationDTO> getWarningSub(@Param("list") List<String> list);
|
||||
|
||||
/**
|
||||
* 获取监测点信息
|
||||
*
|
||||
* @param list 变电站集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<OverLimitLineDTO> getOverLimitLineInfo(@Param("list") List<String> list);
|
||||
|
||||
/**
|
||||
* 获取监测点状态信息
|
||||
*
|
||||
* @param list 变电站集合
|
||||
* @return 结果
|
||||
*/
|
||||
LineStateVO getLineStatisticsDetail(@Param("list") List<String> list);
|
||||
|
||||
/**
|
||||
* 获取监测点信息
|
||||
*
|
||||
* @param list 变电站集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineStatisticsTableVO> getLineInfoByTableList(@Param("list") List<String> list);
|
||||
|
||||
/**
|
||||
* 获取监测点信息
|
||||
*
|
||||
* @param list 变电站集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineFlowMealDetailVO> getFlowLineInfoByTableList(@Param("list") List<String> list);
|
||||
|
||||
/**
|
||||
* 获取监测点信息
|
||||
*
|
||||
* @param list 变电站集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineStatisticsTableVO> getLineStatisticsTableData(@Param("list") List<String> list);
|
||||
|
||||
/**
|
||||
* 监测点运行统计
|
||||
*
|
||||
* @param list 监测点集合
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineFlowMealDetailVO> getLineRunStatistics(@Param("list") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
|
||||
/**
|
||||
* 监测点运行统计
|
||||
*
|
||||
* @param list 监测点集合
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineFlowMealDetailVO> getFlowLineRunStatistics(@Param("list") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
|
||||
/**
|
||||
* 获取生成limitRate表的监测点集合
|
||||
*
|
||||
* @return 监测点id集合
|
||||
*/
|
||||
List<String> getLineList();
|
||||
|
||||
|
||||
/**
|
||||
* 导出终端台账信息
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/5/17
|
||||
*/
|
||||
List<TerminalBaseExcel> getTerminalBaseExcel();
|
||||
|
||||
/**
|
||||
* 根据监测点id获取终端id
|
||||
*
|
||||
* @param lineId 监测点id
|
||||
* @return 结果
|
||||
*/
|
||||
String getDevIndex(@Param("lineId") String lineId);
|
||||
|
||||
/**
|
||||
* 获取变电站下母线
|
||||
*
|
||||
* @param subId 变电站id
|
||||
* @return 结果
|
||||
* @author cdf
|
||||
* @date 2022/7/4
|
||||
*/
|
||||
List<Line> getVoltageListBySubId(@Param("subId") String subId, @Param("voltageName") List<String> voltageName);
|
||||
|
||||
/**
|
||||
* 获取生成在线率的装置Id
|
||||
*
|
||||
* @return 装置Id
|
||||
*/
|
||||
List<String> getDeviceList();
|
||||
|
||||
/**
|
||||
* 获取当前状态在线的监测点数量
|
||||
*
|
||||
* @return Integer 在线监测点数量
|
||||
*/
|
||||
Integer getOnLineCount(@Param("lineIds") List<String> lineIds);
|
||||
|
||||
/**
|
||||
* 获取当前状态在线和离线的监测点
|
||||
*
|
||||
* @return 在线或离线监测点ids
|
||||
*/
|
||||
List<String> getOnOrUnLine(@Param("list") List<String> lineIds, @Param("comFlag") Integer comFlag);
|
||||
|
||||
/**
|
||||
* @Description: 获取变电站id和监测点id用
|
||||
* @Param: [devDataType]
|
||||
* @return: java.util.List<com.njcn.device.pq.pojo.po.Line>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/20
|
||||
*/
|
||||
@Select("SELECT\n" +
|
||||
"\tpq_line.Id,\n" +
|
||||
"\tSUBSTRING_INDEX(\n" +
|
||||
"\t\tSUBSTRING_INDEX(pq_line.Pids, ',', 4),\n" +
|
||||
"\t\t',' ,- 1\n" +
|
||||
"\t) AS Pids\n" +
|
||||
"FROM\n" +
|
||||
"\tpq_line,\n" +
|
||||
"\tpq_device\n" +
|
||||
"WHERE\n" +
|
||||
"\tpq_line.Level = 6\n" +
|
||||
"AND SUBSTRING_INDEX(\n" +
|
||||
"\tSUBSTRING_INDEX(pq_line.Pids, ',', 5),\n" +
|
||||
"\t',' ,- 1\n" +
|
||||
") = pq_device.Id\n" +
|
||||
"AND (\n" +
|
||||
"\tpq_device.Dev_Data_Type = 2\n" +
|
||||
"\tOR pq_device.Dev_Data_Type = #{devDataType}\n" +
|
||||
") ")
|
||||
List<Line> getLineBySubstationRelation(@Param("devDataType") Integer devDataType);
|
||||
|
||||
|
||||
@Select({"<script>",
|
||||
"SELECT\n" +
|
||||
"\tcount(1)\n",
|
||||
"FROM\n",
|
||||
"\t(\n",
|
||||
"\t\tSELECT\n",
|
||||
"\t\t\ta.pid\n",
|
||||
"\t\tFROM\n",
|
||||
"\t\t\tpq_line a\n",
|
||||
"\t\tINNER JOIN pq_device b ON a.id = b.id\n",
|
||||
"where b.com_flag = 1 and a.Pid in",
|
||||
"<foreach item='item' index='index' collection='items' open='(' separator=',' close=')'>",
|
||||
"#{item}",
|
||||
"</foreach>",
|
||||
"\t\tGROUP BY\n",
|
||||
"\t\t\ta.pid\n",
|
||||
"\t) TEMPTABLE\n",
|
||||
"</script>"
|
||||
})
|
||||
Integer queryOnlineSubstaion(@Param("items") List<String> deviceIds);
|
||||
|
||||
LineStateVO getDeviceStatus(List<String> deviceIndexes);
|
||||
|
||||
List<LineFlowMealDetailVO> getDeviceRunStatistics(@Param("list") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
|
||||
Page<LineFlowMealDetailVO> getNewDeviceRunStatistics(Page<LineFlowMealDetailVO> page, @Param("devs") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
|
||||
Page<LineFlowMealDetailVO> getNewDeviceFlowStatistics(Page<LineFlowMealDetailVO> page, @Param("devs") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
|
||||
|
||||
/**
|
||||
* 通过电站id获取监测点信息
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
List<LineDevGetDTO> getLineBySubStation(@Param("subId") String subId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据监测点集合获取监测详细信息
|
||||
* @author cdf
|
||||
* @date 2023/9/20
|
||||
*/
|
||||
List<LineDevGetDTO> getMonitorListDetail(@Param("monitorIds") List<String> monitorIds);
|
||||
|
||||
|
||||
List<LineDetailDataVO> getLineDetailDataVO(@Param("monitorIds") List<String> monitorIds);
|
||||
|
||||
/**
|
||||
* 根据条件进行监测筛选出监测点id
|
||||
*
|
||||
* @author wr
|
||||
* @date 2023/5/25
|
||||
*/
|
||||
List<String> getLineByIDs(@Param("searchValue") String searchValue);
|
||||
|
||||
/**
|
||||
* 通过电站id集合,和电压等级
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
List<Line> getSubStations(@Param("subId") List<String> subId, @Param("scale") List<String> scale);
|
||||
|
||||
|
||||
/**
|
||||
* 根据变电站获取母线信息(变电站策略专用)
|
||||
*
|
||||
* @param subId
|
||||
* @param type (0是除了本变电站所有变电站母线信息 1是获取本变电站所有母线信息 2是根据母线获取信息)
|
||||
* @return
|
||||
*/
|
||||
List<TerminalTree> getvoltage(@Param("id") String subId, @Param("type") Integer type);
|
||||
|
||||
|
||||
/**
|
||||
* 根据监测点id获取终端信息
|
||||
*
|
||||
* @param lineId 监测点id
|
||||
* @return 结果
|
||||
*/
|
||||
UpDevVO getDevInfo(@Param("lineId") String lineId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据终端id或者或者监测id,查询前置表ip信息
|
||||
*
|
||||
* @param devID 终端id
|
||||
* @param type 终端=1 监测点=0
|
||||
* @return 结果
|
||||
*/
|
||||
String getNodeIp(@Param("devID") String devID, @Param("type") Integer type);
|
||||
|
||||
/**
|
||||
* 根据监测点集合获取终端数量
|
||||
*
|
||||
* @param lineId 监测点id
|
||||
* @return 结果
|
||||
*/
|
||||
Integer getDevIndexs(@Param("lineIds") Set<String> lineId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据终端id集合查询终端版本信息
|
||||
* @param devIds
|
||||
* @return
|
||||
*/
|
||||
List<DeviceIpRVO> getDevicesIp(@Param("devIds") List<String> devIds);
|
||||
|
||||
/**
|
||||
* @Description: 监测点半月报功能
|
||||
* @param
|
||||
* @return: java.util.List<com.njcn.device.pq.pojo.vo.DeviceIpRVO>
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/29 12:50
|
||||
*/
|
||||
Page<HalfReportVO> selectHalfReport(Page page,@Param("param") TerminalMainQueryParam param,@Param("deptIdList") List<String> deptIdList);
|
||||
|
||||
/**
|
||||
* @Description: 根据监测点id获取监测点信息
|
||||
* @param id
|
||||
* @return: com.njcn.device.biz.pojo.dto.LineDTO
|
||||
* @Author: wr
|
||||
* @Date: 2023/9/22 10:20
|
||||
*/
|
||||
LineDTO selectLineDetail(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* @Description: 根据监测点id批量获取监测点信息
|
||||
*/
|
||||
List<LineDTO> selectLineDetailBatch(@Param("ids") List<String> ids);
|
||||
|
||||
|
||||
Map<String,String> getCustomDetailByLineId(@Param("lineId")String lineId);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 获取监测点集合信息
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/3 14:37
|
||||
*/
|
||||
List<LineDetailVO.Detail> selectByIds(@Param("ids") List<String> ids);
|
||||
|
||||
|
||||
List<String> getDeviceIdByPowerFlag(@Param("lineIds")List<String> lineIds, @Param("powerFlag")Integer manufacturer);
|
||||
|
||||
DeviceVO getDeviceDetailData(@Param("id")String id);
|
||||
|
||||
List<LineDetailVO.Detail> getDeptDeviceDetailData(@Param("ids")List<String> ids,
|
||||
@Param("searchValue")String searchValue,
|
||||
@Param("type")Integer type);
|
||||
|
||||
LineDetailVO getLineInfoVO(@Param("id")String id);
|
||||
|
||||
List<LineDetailVO.noDataLineInfo> getNoDataLine(@Param("time")String time);
|
||||
|
||||
List<ReportLineInfoVo> getReportLineInfo(@Param("ids")List<String> ids);
|
||||
|
||||
List<Line> getSubByCondition(@Param("subIds") List<String> subIds, @Param("scale") List<SimpleDTO> scale);
|
||||
|
||||
List<LineDetail> selectByName(@Param("param") LineBaseQueryParam param);
|
||||
|
||||
List<MonitorInfo> getLineByDeviceId(@Param("id") String id);
|
||||
|
||||
List<TerminalTree> getLineAndLineDetail();
|
||||
|
||||
|
||||
List<DevDetailVO> getLineDeviceByDevIds(@Param("powerFlag") Integer powerFlag,
|
||||
@Param("lineIds") List<String> lineIds,
|
||||
@Param("devIds") List<String> devIds);
|
||||
|
||||
/**
|
||||
* 根据Pid获取所有子节点
|
||||
*/
|
||||
List<String> getSubIdByPid(@Param("pid") String pid);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.dto.DeviceInfo;
|
||||
import com.njcn.device.pq.pojo.param.NodeDeviceParam;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface NodeMapper extends BaseMapper<Node> {
|
||||
|
||||
List<DeviceInfo> nodeDeviceList(@Param("nodeDeviceParam") NodeDeviceParam nodeDeviceParam);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface OverlimitMapper extends BaseMapper<Overlimit> {
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.PqDevType;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/11/5 11:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqDevTypeMapper extends BaseMapper<PqDevType> {
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.param.LogsListParam;
|
||||
import com.njcn.device.pq.pojo.po.PqsTerminalLogs;
|
||||
import com.njcn.device.pq.pojo.vo.LogsListVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2023-04-12
|
||||
*/
|
||||
public interface PqsTerminalLogsMapper extends BaseMapper<PqsTerminalLogs> {
|
||||
|
||||
List<LogsListVO> getList(Page<LogsListVO> page, @Param("logsListParam") LogsListParam logsListParam);
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.njcn.device.pq.pojo.param.ProgramParam;
|
||||
import com.njcn.device.pq.pojo.vo.ShowVersionVO;
|
||||
import com.njcn.device.pq.pojo.vo.VersionVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: chenchao
|
||||
* @date: 2022/05/23 13:23
|
||||
*/
|
||||
public interface ProgramVersionMapper {
|
||||
|
||||
/**
|
||||
* 获取终端版本信息,根据装置型号查询
|
||||
*/
|
||||
List<VersionVO> getVersion(ProgramParam programParam);
|
||||
/**
|
||||
* 根据id获取终端版本信息
|
||||
*/
|
||||
ShowVersionVO getProgramVersionById(String id);
|
||||
/**
|
||||
* 修改程序版本状态
|
||||
*/
|
||||
void updateVersionFlag(Integer flag,String id);
|
||||
/**
|
||||
* 修改程序版本状态
|
||||
*/
|
||||
void updateVersionState(String id);
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.LineDataIntegrity;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.vo.RStatIntegrityVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据完整性日表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2023-03-28
|
||||
*/
|
||||
public interface RStatIntegrityDMapper extends MppBaseMapper<RStatIntegrityD> {
|
||||
|
||||
|
||||
/**
|
||||
* 获取监测点数据完整性
|
||||
* @author cdf
|
||||
* @date 2023/3/29
|
||||
*/
|
||||
List<LineDataIntegrity> getLineIntegrityRate(@Param("lineIds")List<String> lineIds,@Param("startTime")String startTime,@Param("endTime")String endTime);
|
||||
|
||||
/***
|
||||
* 监测点完整性
|
||||
* @author wr
|
||||
* @date 2023-04-03 10:10
|
||||
* @param param
|
||||
* @return List<OnlineRate>
|
||||
*/
|
||||
List<RStatIntegrityVO> getOnIntegrityByIds(@Param("param") OnlineRateParam param);
|
||||
|
||||
List<RStatIntegrityVO> getOnIntegrityByIdsAndTime (@Param("list")List<String> lineIds,@Param("startTime")String startTime,@Param("endTime")String endTime);
|
||||
|
||||
/**
|
||||
* @Description: 通过监测点集合查询总监测点数据完整性
|
||||
* @param param
|
||||
* @return: java.lang.Float
|
||||
* @Author: wr
|
||||
* @Date: 2024/1/8 14:01
|
||||
*/
|
||||
Float selectTotalIntegrityByLineIds(@Param("param") LineBaseQueryParam param);
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.dto.SubstationDTO;
|
||||
import com.njcn.device.pq.pojo.po.Substation;
|
||||
import com.njcn.device.pq.pojo.vo.SubstationDetailVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface SubstationMapper extends BaseMapper<Substation> {
|
||||
/**
|
||||
* 获取变电站相关
|
||||
* @param id 变电站集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<SubstationDetailVO> getSubstationData(@Param("id") List<String> id);
|
||||
|
||||
/**
|
||||
* 根据变电站ID获取变电站信息
|
||||
*
|
||||
* @param subId 变电站ID
|
||||
* @return 变电站信息
|
||||
*/
|
||||
List<SubstationDTO> getSubstationById(@Param("id")List<String> subId);
|
||||
|
||||
|
||||
List<Substation> test();
|
||||
|
||||
//仅供测试冀北电网台账使用
|
||||
List<SubstationDTO> subTest();
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.njcn.device.pq.pojo.param.BaseReamParam;
|
||||
import com.njcn.device.pq.pojo.param.SuperDataParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zbj
|
||||
* @since 2023-04-12
|
||||
*/
|
||||
public interface SuperDataMapper {
|
||||
|
||||
SuperDataParam getPointSuper(@Param("id") String id);
|
||||
|
||||
SuperDataParam getDeviceSuper(@Param("id") String id);
|
||||
|
||||
BaseReamParam getBaseReam(@Param("id") String id);
|
||||
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.njcn.device.pq.pojo.vo.LineFlowMealDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalDaliyFlowVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalMaintainVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
* 终端运维
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
public interface TerminalMaintainMapper {
|
||||
|
||||
|
||||
/**
|
||||
* 或取装置及关联信息
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
List<TerminalMaintainVO> getTerminalDevInfo(@Param("devIds") List<String> devIds, @Param("comFlag") Integer comFlag, @Param("devType") String devType);
|
||||
|
||||
/**
|
||||
* 获取区域
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
List<TerminalMaintainVO> getProvList();
|
||||
|
||||
/**
|
||||
* 获取公司,单位
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
List<TerminalMaintainVO> getGdAndSubList(@Param("level") Integer level);
|
||||
|
||||
/**
|
||||
* 根据ids获取pq_line省份信息
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
List<TerminalMaintainVO> getPqLineProvList(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据ids获取pq_line公司单位信息
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
List<TerminalMaintainVO> getPqLineGdAndSubList(@Param("ids") List<String> ids);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据装置ids获取所有终端运行状态
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
List<TerminalMaintainVO> getRunFlagList(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据装置ids获取所有终端流量套餐
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
List<TerminalMaintainVO> getFlowMealList(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据装置ids获取所有终端流量策略
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
List<TerminalMaintainVO> getFlowStrategyList(@Param("ids") List<String> ids);
|
||||
|
||||
|
||||
TerminalDaliyFlowVO getFlowManageDetail(@Param("devId") String deviceId);
|
||||
|
||||
List<LineFlowMealDetailVO> getMonthFlow (@Param("devs") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.njcn.device.pq.pojo.param.TerminalMainQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.DevVersion;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalMaintainVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalVersionVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
* 终端程序版本
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
public interface TerminalVersionMapper {
|
||||
|
||||
/**
|
||||
* 或取装置及关联信息
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
List<TerminalVersionVO> getTerminalVersionInfo(@Param("queryParam")TerminalMainQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 获取区域
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
List<TerminalVersionVO> getProvList();
|
||||
|
||||
/**
|
||||
* 获取公司,单位
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
List<TerminalVersionVO> getGdAndSubList(@Param("level") Integer level);
|
||||
|
||||
/**
|
||||
* 根据ids获取pq_line省份信息
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
List<TerminalVersionVO> getPqLineProvList(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据ids获取pq_line公司单位信息
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
List<TerminalVersionVO> getPqLineGdAndSubList(@Param("ids") List<String> ids);
|
||||
|
||||
|
||||
List<DevVersion> selectListById(String id);
|
||||
|
||||
List<TerminalVersionVO.Version> selectDevVersion(@Param("ids")List<String> ids);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TopMsgMapper {
|
||||
Page<TopMsgPO> dailyDeviceAbnormalStatistics(Page<TopMsgPO> page,@Param("lineGrade") String lineGrade, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
|
||||
List<TopMsgPO> dailyDeviceAbnormal(@Param("lineGrade") String lineGrade,@Param("startTime") DateTime startTime);
|
||||
List<TopMsgPO> selectByIds(@Param("param") OnlineRateParam param);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.param.ProgramParam;
|
||||
import com.njcn.device.pq.pojo.po.Version;
|
||||
import com.njcn.device.pq.pojo.vo.VersionVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
public interface VersionMapper extends BaseMapper<Version> {
|
||||
|
||||
List<VersionVO> selectVersion(@Param("param") ProgramParam.Version param);
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.po.Voltage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface VoltageMapper extends BaseMapper<Voltage> {
|
||||
|
||||
/**
|
||||
* 查询装置下母线号是否已被占用
|
||||
* @param devIndex 装置索引
|
||||
* @param num 线路号
|
||||
* @return 母线信息
|
||||
*/
|
||||
List<Voltage> getVoltageByNum(@Param("devIndex") String devIndex, @Param("num") List<Integer> num);
|
||||
|
||||
|
||||
/**
|
||||
* 通过母线id获取下层所有监测点详情
|
||||
* @author cdf
|
||||
* @date 2023/5/24
|
||||
*/
|
||||
List<LineDetail> getLineDetailByBusBarId(@Param("busBarId")String busBarId);
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.DeptLineMapper">
|
||||
|
||||
<update id="deptChangeBindLine" >
|
||||
update pq_dept_line set id = #{id} where Line_Id = #{lineId}
|
||||
</update>
|
||||
|
||||
<select id="getAllBindLine" resultType="String">
|
||||
select line_id from pq_dept_line
|
||||
</select>
|
||||
|
||||
<select id="getOtherBindLine" resultType="String">
|
||||
select line_id from pq_dept_line where Id !=#{deptId}
|
||||
</select>
|
||||
|
||||
<select id="getMyselfBindLine" resultType="String">
|
||||
select line_id from pq_dept_line where Id =#{deptId}
|
||||
</select>
|
||||
|
||||
<select id="lineDevGet" resultType="com.njcn.device.biz.pojo.dto.LineDevGetDTO">
|
||||
select
|
||||
<!--监测点-->
|
||||
<if test="type == 1">
|
||||
pq_dept_line.id unitId,
|
||||
point.id pointId,
|
||||
lineDetail.Time_Interval as timeInterval,
|
||||
lineDetail.load_type lineTag,
|
||||
dic.id voltageLevel,
|
||||
dev.id devId,
|
||||
device.com_flag comFlag,
|
||||
1 as lineType,
|
||||
0 as type,
|
||||
lineDetail.obj_id,
|
||||
lineDetail.monitor_flag as isUpToGrid,
|
||||
point.name pointName
|
||||
</if>
|
||||
<!--母线-->
|
||||
<if test="type == 2">
|
||||
DISTINCT
|
||||
pq_dept_line.id unitId,
|
||||
dic.id voltageLevel,
|
||||
voltage.id pointId,
|
||||
point.id devId
|
||||
</if>
|
||||
<!--装置-->
|
||||
<if test="type == 3">
|
||||
DISTINCT
|
||||
pq_dept_line.id unitId,
|
||||
dev.id devId,
|
||||
dic.id voltageLevel,
|
||||
1 as type ,
|
||||
device.update_time,
|
||||
device.Com_Flag as comFlag
|
||||
</if>
|
||||
from pq_dept_line pq_dept_line
|
||||
inner join pq_line point on pq_dept_line.line_id = point.id
|
||||
inner join pq_line_detail lineDetail on point.id = lineDetail.id
|
||||
inner join pq_line voltage on point.pid = voltage.id
|
||||
inner join pq_voltage pq_voltage on voltage.id = pq_voltage.id
|
||||
inner join sys_dict_data dic on pq_voltage.Scale= dic.id
|
||||
inner join pq_line dev on voltage.pid = dev.id
|
||||
inner join pq_device device on dev.id = device.id
|
||||
where device.Dev_Model = 1
|
||||
and point.state = 1
|
||||
and device.Dev_Data_Type in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
and device.Run_Flag = 0
|
||||
<if test="lineRunFlag!=null ">
|
||||
and lineDetail.Run_Flag = #{lineRunFlag}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="orgSubStationGet" resultType="com.njcn.device.biz.pojo.dto.TerminalGetBase">
|
||||
select
|
||||
DISTINCT
|
||||
pq_dept_line.id unitId,
|
||||
substation.id ledgerId,
|
||||
lineDetail.OBJ_ID objId,
|
||||
point.id lineId
|
||||
from pq_dept_line pq_dept_line
|
||||
inner join pq_line point on pq_dept_line.line_id = point.id
|
||||
inner join pq_line_detail lineDetail on point.id = lineDetail.id
|
||||
inner join pq_line voltage on point.pid = voltage.id
|
||||
inner join pq_line dev on voltage.pid = dev.id
|
||||
inner join pq_device device on dev.id = device.id
|
||||
inner join pq_line substation on dev.pid = substation.id
|
||||
where device.Dev_Model = 1
|
||||
and point.state = 1
|
||||
and device.Dev_Data_Type in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="orgSubStationInfoGet" resultType="com.njcn.device.biz.pojo.dto.TerminalGetBase$Extend">
|
||||
select
|
||||
DISTINCT
|
||||
point.id lineId,
|
||||
pq_dept_line.id unitId,
|
||||
substation.id ledgerId,
|
||||
substation.name subName,
|
||||
sub.Scale voltageLevel,
|
||||
lineDetail.Monitor_Flag as monitorFlag
|
||||
from pq_dept_line pq_dept_line
|
||||
inner join pq_line point on pq_dept_line.line_id = point.id
|
||||
inner join pq_line_detail lineDetail on point.id = lineDetail.id
|
||||
inner join pq_line voltage on point.pid = voltage.id
|
||||
inner join pq_line dev on voltage.pid = dev.id
|
||||
inner join pq_device device on dev.id = device.id
|
||||
inner join pq_line substation on dev.pid = substation.id
|
||||
left join pq_substation sub on sub.id = substation.id
|
||||
where device.Dev_Model = 1
|
||||
and point.state = 1
|
||||
and device.Run_Flag = 0
|
||||
and device.Dev_Data_Type in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="powerFlag!=null ">
|
||||
and lineDetail.Power_Flag = #{powerFlag}
|
||||
</if>
|
||||
<if test="lineRunFlag!=null ">
|
||||
and lineDetail.Run_Flag = #{lineRunFlag}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getLineIdByDeptIds" resultType="string">
|
||||
select
|
||||
DISTINCT
|
||||
pq_dept_line.line_id
|
||||
from pq_dept_line pq_dept_line
|
||||
inner join pq_line point on pq_dept_line.line_id = point.id
|
||||
inner join pq_line_detail lineDetail on point.id = lineDetail.id
|
||||
inner join pq_line voltage on point.pid = voltage.id
|
||||
inner join pq_line dev on voltage.pid = dev.id
|
||||
inner join pq_device device on dev.id = device.id
|
||||
where device.Dev_Model = 1
|
||||
and device.Dev_Data_Type in
|
||||
<foreach collection="dataType" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
and device.run_flag in
|
||||
<foreach collection="runFlag" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="objType!=null and objType!=''">
|
||||
and lineDetail.big_obj_type = #{objType}
|
||||
</if>
|
||||
and pq_dept_line.id in
|
||||
<foreach collection="deptIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="manufacturer!=null and manufacturer!='' ">
|
||||
and device.Manufacturer = #{manufacturer}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectSubStationList" resultType="com.njcn.device.biz.pojo.dto.SubGetBase">
|
||||
select
|
||||
DISTINCT
|
||||
substation.id id,
|
||||
substation.name name,
|
||||
pq_dept_line.id orgId,
|
||||
sub.Scale voltageLevel,
|
||||
sub.lng lng,
|
||||
sub.lat lat
|
||||
from pq_dept_line pq_dept_line
|
||||
inner join pq_line point on pq_dept_line.line_id = point.id
|
||||
inner join pq_line_detail lineDetail on point.id = lineDetail.id
|
||||
inner join pq_line voltage on point.pid = voltage.id
|
||||
inner join pq_line dev on voltage.pid = dev.id
|
||||
inner join pq_device device on dev.id = device.id
|
||||
inner join pq_line substation on dev.pid = substation.id
|
||||
inner join pq_substation sub on sub.id = substation.id
|
||||
<where>
|
||||
device.Dev_Model = 1
|
||||
and point.state = 1
|
||||
<if test="param.orgIds!=null and param.orgIds.size!=0">
|
||||
and pq_dept_line.id in
|
||||
<foreach collection="param.orgIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.powerIds!=null and param.powerIds.size!=0">
|
||||
and substation.id in
|
||||
<foreach collection="param.powerIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.powerName !=null and param.powerName!='' ">
|
||||
and substation.name like CONCAT(CONCAT('%', #{param.powerName}), '%')
|
||||
</if>
|
||||
<if test="param.powerVoltageLevel!=null and param.powerVoltageLevel.size!=0">
|
||||
and sub.Scale in
|
||||
<foreach collection="param.powerVoltageLevel" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getLineByDeptIdAndNewStation" resultType="string">
|
||||
SELECT
|
||||
pld.id
|
||||
FROM
|
||||
pq_dept_line pdl
|
||||
INNER JOIN pq_line_detail pld ON pdl.Line_Id = pld.Id
|
||||
<where>
|
||||
pld.Obj_Id IS NOT NULL and pld.Obj_Id !=''
|
||||
<if test="ids!=null and ids.size!=0">
|
||||
and pdl.Id in
|
||||
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="dictTree!=null and dictTree.size!=0">
|
||||
and pld.Big_Obj_Type in
|
||||
<foreach collection="dictTree" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.DevFuctionMapper">
|
||||
|
||||
<insert id="addBatch">
|
||||
insert into cld_dev_fuction (id,line_id,fuc_name) values
|
||||
<foreach collection="list" item="item" separator="," index="index">
|
||||
(#{item.id},#{item.lineId},#{item.fucName})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!--查询pq_line表等级为5的装置去device表查装置id与装置功能存入cld_dev_fuction表-->
|
||||
<select id="selectLineTable" resultType="com.njcn.device.pq.pojo.po.DevFuction">
|
||||
SELECT pd.id "lineId" FROM pq_device pd
|
||||
inner join pq_line pl on pd.id = pl.id
|
||||
where pl.Level = 4
|
||||
</select>
|
||||
<select id="selectDictTable" resultType="com.njcn.device.pq.pojo.po.DevFuction">
|
||||
select sdd.id "fucName" from sys_dict_type sdt
|
||||
inner join sys_dict_data sdd on sdd.Type_Id = sdt.Id
|
||||
where sdt.Code = 'Dev_Fun'
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.DevMealMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.DevStrategyMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.DevVersionMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.DeviceBakMapper">
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,390 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.DeviceMapper">
|
||||
|
||||
|
||||
<select id="getDeviceBySubId" resultType="com.njcn.device.pq.pojo.po.Device">
|
||||
select * from pq_line a
|
||||
inner join pq_device b on a.id=b.id
|
||||
where a.pid = #{subId}
|
||||
and a.state = 1
|
||||
and b.ip = #{ip}
|
||||
and b.port = #{port}
|
||||
<if test="devId !=null and devId !=''">
|
||||
and a.id != #{devId}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getRunManageList" resultType="com.njcn.device.pq.pojo.vo.RunManageVO">
|
||||
SELECT
|
||||
linedetail.Num AS id,
|
||||
line.NAME AS lineName,
|
||||
area.NAME AS areaName,
|
||||
gd.NAME AS gdName,
|
||||
sub.NAME AS bdName,
|
||||
scaleId.Name as scale,
|
||||
manufacturerId.name as manufacturer,
|
||||
dev.name as devName,
|
||||
device.IP as ip,
|
||||
case linedetail.Run_Flag
|
||||
when 0 then '投运'
|
||||
when 1 then '检修'
|
||||
when 2 then '停运'
|
||||
when 3 then '调试'
|
||||
when 4 then '退运'
|
||||
end as runFlag,
|
||||
case device.Com_Flag
|
||||
when 0 then '中断'
|
||||
when 1 then '正常'
|
||||
end as comFlag,
|
||||
loadtypeId.Name as loadType,
|
||||
businesstypeId.name as businessType,
|
||||
linedetail.Obj_Id as objId,
|
||||
IFNULL(linedetail.Obj_Name,'/') as objName,
|
||||
case linedetail.PT_Type
|
||||
when 0 then '星型接线'
|
||||
when 1 then '三角型接线'
|
||||
when 2 then '开口三角型接线'
|
||||
end as ptType,
|
||||
CONCAT(linedetail.PT1,'/', linedetail.PT2) as pt,
|
||||
CONCAT(linedetail.CT1,'/', linedetail.CT2) as ct,
|
||||
linedetail.Standard_Capacity as standardCapacity,
|
||||
linedetail.Short_Capacity as shortCapacity,
|
||||
linedetail.Dev_Capacity as devCapacity,
|
||||
linedetail.Deal_Capacity as dealCapacity,
|
||||
overlimit.Freq_Dev as freqDev,
|
||||
overlimit.Voltage_Dev as voltageDev,
|
||||
overlimit.Uvoltage_Dev as uvoltageDev,
|
||||
overlimit.Ubalance as ubalance,
|
||||
overlimit.I_Neg as iNeg,
|
||||
overlimit.Flicker as flicker,
|
||||
overlimit.Uaberrance as uaberrance,
|
||||
overlimit.Uharm_3 as oddHarm,
|
||||
overlimit.Uharm_2 as evenHarm,
|
||||
overlimit.Iharm_2 as iharm2,
|
||||
overlimit.Iharm_3 as iharm3,
|
||||
overlimit.Iharm_4 as iharm4,
|
||||
overlimit.Iharm_5 as iharm5,
|
||||
overlimit.Iharm_6 as iharm6,
|
||||
overlimit.Iharm_7 as iharm7,
|
||||
overlimit.Iharm_8 as iharm8,
|
||||
overlimit.Iharm_9 as iharm9,
|
||||
overlimit.Iharm_10 as iharm10,
|
||||
overlimit.Iharm_11 as iharm11,
|
||||
overlimit.Iharm_12 as iharm12,
|
||||
overlimit.Iharm_13 as iharm13,
|
||||
overlimit.Iharm_14 as iharm14,
|
||||
overlimit.Iharm_15 as iharm15,
|
||||
overlimit.Iharm_16 as iharm16,
|
||||
overlimit.Iharm_17 as iharm17,
|
||||
overlimit.Iharm_18 as iharm18,
|
||||
overlimit.Iharm_19 as iharm19,
|
||||
overlimit.Iharm_20 as iharm20,
|
||||
overlimit.Iharm_21 as iharm21,
|
||||
overlimit.Iharm_22 as iharm22,
|
||||
overlimit.Iharm_23 as iharm23,
|
||||
overlimit.Iharm_24 as iharm24,
|
||||
overlimit.Iharm_25 as iharm25,
|
||||
overlimit.InUharm_1 as inUharm,
|
||||
overlimit.InUharm_16 as inUharm16
|
||||
FROM pq_line line
|
||||
INNER JOIN pq_line vol ON vol.Id = line.Pid
|
||||
INNER JOIN pq_line dev ON dev.Id = vol.Pid
|
||||
INNER JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
INNER JOIN pq_line gd ON gd.Id = sub.Pid
|
||||
INNER JOIN pq_line areaId ON areaId.Id = gd.Pid
|
||||
INNER JOIN sys_area area ON area.Id = areaId.NAME
|
||||
INNER JOIN pq_overlimit overlimit ON overlimit.Id = line.Id
|
||||
INNER JOIN pq_voltage voltage ON voltage.Id = vol.Id
|
||||
INNER JOIN sys_dict_data scaleId ON scaleId.Id = voltage.Scale
|
||||
INNER JOIN pq_device device ON device.Id = dev.Id
|
||||
INNER JOIN sys_dict_data manufacturerId ON manufacturerId.Id = device.Manufacturer
|
||||
INNER JOIN pq_line_detail linedetail ON linedetail.Id = line.Id
|
||||
INNER JOIN sys_dict_data loadtypeId ON loadtypeId.Id = linedetail.Load_Type
|
||||
INNER JOIN sys_dict_data businesstypeId ON businesstypeId.Id = linedetail.Business_Type
|
||||
WHERE line.Id in
|
||||
<foreach item="item" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="comFlag.size()!=0">
|
||||
and device.Com_Flag in
|
||||
<foreach item="item2" collection="comFlag" open="(" separator="," close=")">
|
||||
#{item2}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="runFlag.size()!=0">
|
||||
and linedetail.run_Flag in
|
||||
<foreach item="item" collection="runFlag" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="searchValue != '' and searchValue != null ">
|
||||
<bind name="searchValueLike" value="'%'+searchValue+'%'"/>
|
||||
AND sub.NAME LIKE #{searchValueLike}
|
||||
OR dev.name LIKE #{searchValueLike}
|
||||
OR line.NAME LIKE #{searchValueLike}
|
||||
</if>
|
||||
ORDER BY
|
||||
gdName,
|
||||
bdName,
|
||||
devNAME,
|
||||
objName;
|
||||
</select>
|
||||
|
||||
<select id="getRunManageDevList" resultType="com.njcn.device.pq.pojo.vo.RunTimeVO">
|
||||
SELECT
|
||||
dev.Id AS id,
|
||||
area.NAME AS areaName,
|
||||
gd.NAME AS gdName,
|
||||
sub.NAME AS bdName,
|
||||
manufacturerId.NAME AS manufacturer,
|
||||
dev.NAME AS devName,
|
||||
device.IP AS ip,
|
||||
device.Login_Time AS loginTime,
|
||||
devT.Name AS devType,
|
||||
device.PORT AS PORT,
|
||||
CASE
|
||||
device.Run_Flag
|
||||
WHEN 0 THEN
|
||||
'投运'
|
||||
WHEN 1 THEN
|
||||
'热备用'
|
||||
WHEN 2 THEN
|
||||
'停运'
|
||||
END AS runFlag,
|
||||
CASE
|
||||
device.Com_Flag
|
||||
WHEN 0 THEN
|
||||
'中断'
|
||||
WHEN 1 THEN
|
||||
'正常'
|
||||
END AS comFlag,
|
||||
device.Update_Time AS updateTime
|
||||
FROM
|
||||
pq_line dev
|
||||
INNER JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
INNER JOIN pq_line gd ON gd.Id = sub.Pid
|
||||
INNER JOIN pq_line areaId ON areaId.Id = gd.Pid
|
||||
INNER JOIN sys_area area ON area.Id = areaId.NAME
|
||||
INNER JOIN pq_device device ON device.Id = dev.Id
|
||||
INNER JOIN sys_dict_data manufacturerId ON manufacturerId.Id = device.Manufacturer
|
||||
INNER JOIN pq_dev_type devT ON devT.Id = device.Dev_Type
|
||||
WHERE dev.Id in
|
||||
<foreach item="item" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="runFlag.size()!=0">
|
||||
and device.Run_Flag in
|
||||
<foreach item="item1" collection="runFlag" separator="," open="(" close=")">
|
||||
#{item1}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="comFlag.size()!=0">
|
||||
and device.Com_Flag in
|
||||
<foreach item="item2" collection="comFlag" separator="," open="(" close=")">
|
||||
#{item2}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="manufacturers.size() != 0">
|
||||
and device.Manufacturer in
|
||||
<foreach collection="manufacturers" item="item3" separator="," open="(" close=")">
|
||||
#{item3}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="searchValue != '' and searchValue != null ">
|
||||
<bind name="searchValueLike" value="'%'+searchValue+'%'"/>
|
||||
AND sub.NAME LIKE #{searchValueLike}
|
||||
OR dev.NAME LIKE #{searchValueLike}
|
||||
OR devT.Name LIKE #{searchValueLike}
|
||||
OR device.IP LIKE #{searchValueLike}
|
||||
</if>
|
||||
ORDER BY
|
||||
gdName,
|
||||
bdName,
|
||||
devName
|
||||
</select>
|
||||
<select id="getOnlineEvaluate" resultType="com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO">
|
||||
SELECT
|
||||
SUM(r.online_min) / (SUM(r.online_min)+SUM(r.offline_min)) AS onlineRate,
|
||||
r.dev_index AS devIndex
|
||||
FROM r_stat_onlinerate_d r
|
||||
<where>
|
||||
<if test=" begin != null and begin !=''">
|
||||
AND time_id >= #{begin}
|
||||
</if>
|
||||
<if test="end != null and end != ''">
|
||||
AND time_id <= #{end}
|
||||
</if>
|
||||
<if test="list.size > 0">
|
||||
AND r.dev_index IN
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
GROUP BY r.dev_index
|
||||
</select>
|
||||
<select id="selectDevByIds" resultType="com.njcn.device.pq.pojo.vo.DevDetail">
|
||||
SELECT DISTINCT
|
||||
device.id as devIndex,
|
||||
gd.NAME as gdName,
|
||||
substation.NAME as bdzName,
|
||||
device.NAME as devName,
|
||||
lineDetail.Line_Grade AS lineGrade,
|
||||
deviceDetail.Update_Time AS timeID,
|
||||
deviceDetail.ip as ip,
|
||||
deviceDetail.Com_Flag as comFlag,
|
||||
deviceDetail.Next_Time_Check as nextTimeCheck
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line voltage,
|
||||
pq_line device,
|
||||
pq_line substation,
|
||||
pq_line gd,
|
||||
pq_device deviceDetail,
|
||||
pq_line_detail lineDetail
|
||||
<where>
|
||||
<if test="ids!=null and ids.size()>0">
|
||||
device.id IN
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
AND line.pid = voltage.id
|
||||
AND voltage.pid = device.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gd.id
|
||||
AND device.id = deviceDetail.id
|
||||
AND line.id = lineDetail.id
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateDeviceRunFlag" >
|
||||
update pq_device
|
||||
set run_flag = #{runFlag}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getDeviceLedger" resultType="com.njcn.device.pq.pojo.vo.RunTimeVO">
|
||||
SELECT
|
||||
dev.Id AS id,
|
||||
area.NAME AS areaName,
|
||||
gd.NAME AS gdName,
|
||||
sub.NAME AS bdName,
|
||||
manufacturerId.NAME AS manufacturer,
|
||||
dev.NAME AS devName,
|
||||
device.IP AS ip,
|
||||
device.Login_Time AS loginTime,
|
||||
devT.Name AS devType,
|
||||
device.PORT AS PORT,
|
||||
CASE
|
||||
device.Run_Flag
|
||||
WHEN 0 THEN
|
||||
'投运'
|
||||
WHEN 1 THEN
|
||||
'检修'
|
||||
WHEN 2 THEN
|
||||
'停运'
|
||||
WHEN 3 THEN
|
||||
'调试'
|
||||
WHEN 4 THEN
|
||||
'退运'
|
||||
END AS runFlag,
|
||||
CASE
|
||||
device.Com_Flag
|
||||
WHEN 0 THEN
|
||||
'中断'
|
||||
WHEN 1 THEN
|
||||
'正常'
|
||||
END AS comFlag,
|
||||
device.Update_Time AS updateTime
|
||||
FROM
|
||||
pq_line dev
|
||||
INNER JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
INNER JOIN pq_line gd ON gd.Id = sub.Pid
|
||||
INNER JOIN pq_line areaId ON areaId.Id = gd.Pid
|
||||
INNER JOIN sys_area area ON area.Id = areaId.NAME
|
||||
INNER JOIN pq_device device ON device.Id = dev.Id
|
||||
left JOIN sys_dict_data manufacturerId ON manufacturerId.Id = device.Manufacturer
|
||||
left JOIN pq_dev_type devT ON devT.Id = device.Dev_Type
|
||||
WHERE dev.Id in
|
||||
<foreach item="item" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="runFlag.size()!=0">
|
||||
and device.Run_Flag in
|
||||
<foreach item="item1" collection="runFlag" separator="," open="(" close=")">
|
||||
#{item1}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="comFlag.size()!=0">
|
||||
and device.Com_Flag in
|
||||
<foreach item="item2" collection="comFlag" separator="," open="(" close=")">
|
||||
#{item2}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="manufacturers.size() != 0">
|
||||
and device.Manufacturer in
|
||||
<foreach collection="manufacturers" item="item3" separator="," open="(" close=")">
|
||||
#{item3}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="searchValue != '' and searchValue != null ">
|
||||
<bind name="searchValueLike" value="'%'+searchValue+'%'"/>
|
||||
AND sub.NAME LIKE #{searchValueLike}
|
||||
OR dev.NAME LIKE #{searchValueLike}
|
||||
OR devT.Name LIKE #{searchValueLike}
|
||||
OR device.IP LIKE #{searchValueLike}
|
||||
</if>
|
||||
ORDER BY
|
||||
gdName,
|
||||
bdName,
|
||||
devName
|
||||
</select>
|
||||
|
||||
<select id="getPollutionDeviceInfo" resultType="com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO">
|
||||
SELECT
|
||||
line.id lineId,
|
||||
line.name lineName,
|
||||
gdinfo.NAME AS gdName,
|
||||
substation.NAME AS subStationName,
|
||||
device.NAME AS devName,
|
||||
deviceDetail.Com_Flag AS comFlag,
|
||||
lineDetail.power_Flag AS powerFlag,
|
||||
lineDetail.business_type AS businessType,
|
||||
lineDetail.load_type AS loadtype,
|
||||
lineDetail.obj_name AS objName,
|
||||
lineDetail.power_substation_name AS powerSubstationName,
|
||||
lineDetail.Time_Interval as timeInterval,
|
||||
deviceDetail.manufacturer AS manufacturer,
|
||||
deviceDetail.dev_Type AS devType,
|
||||
deviceDetail.login_Time AS loginTime,
|
||||
deviceDetail.id deviceId,
|
||||
pv.scale lineVoltage,
|
||||
lineDetail.monitor_id monitorId
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line_detail lineDetail,
|
||||
pq_line subv,
|
||||
pq_line device,
|
||||
pq_device deviceDetail,
|
||||
pq_line substation,
|
||||
pq_line gdinfo,
|
||||
pq_voltage pv
|
||||
WHERE line.id in
|
||||
<foreach collection="id" close=")" item="item" open="(" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND line.id = lineDetail.id
|
||||
AND line.pid = subv.id
|
||||
AND subv.pid = device.id
|
||||
AND device.id = deviceDetail.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gdinfo.id
|
||||
AND subv.id = pv.id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.DeviceProcessMapper">
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.LineBakMapper">
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.LineDetailMapper">
|
||||
|
||||
<select id="getLineDetail" resultType="LineDetail">
|
||||
select b.* from pq_line a
|
||||
inner join pq_line_detail b on a.id=b.id
|
||||
where
|
||||
find_in_set(#{devIndex}, a.pids)
|
||||
and a.state = 1
|
||||
and b.Num in
|
||||
<foreach collection="num" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getSpecifyLineDetail" resultType="LineDetail">
|
||||
SELECT
|
||||
D.*
|
||||
FROM
|
||||
pq_line A1,
|
||||
pq_line A2,
|
||||
pq_line A3,
|
||||
pq_line_detail B,
|
||||
pq_device C,
|
||||
pq_line_detail D
|
||||
WHERE
|
||||
<if test="list != null and list.size() > 0">
|
||||
A1.Id in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND
|
||||
</if>
|
||||
A1.Level = 6 AND A1.Id = B.Id AND
|
||||
A1.Pid = A2.Id AND A2.Pid = A3.Id AND A3.Id = C.Id AND
|
||||
C.Dev_Model = 1 AND C.Dev_Data_Type IN (1,2) AND C.Run_Flag = 0 AND A1.Id = D.Id
|
||||
</select>
|
||||
|
||||
<select id="getLineDetailInfo" resultType="com.njcn.device.pq.pojo.vo.LineDetailDataVO">
|
||||
select
|
||||
c.id lineId,
|
||||
a.name lineName,
|
||||
c.Time_Interval,
|
||||
d.Scale AS scale,
|
||||
c.Obj_Id obyId,
|
||||
c.Big_Obj_Type bigObjType
|
||||
from pq_line a
|
||||
inner join pq_line b on a.pid = b.id
|
||||
inner join pq_line_detail c on a.id = c.id
|
||||
inner join pq_voltage d on b.id = d.id
|
||||
left join sys_dict_data e on d.scale = e.id
|
||||
where a.id in
|
||||
<foreach collection="lineIds" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getMonitorDetail" resultType="com.njcn.device.biz.pojo.dto.LineDevGetDTO">
|
||||
select a.id pointId,a.name pointName,b.Time_Interval timeInterval,bus.pid devId,b.PT_Type wiringMethod
|
||||
from pq_line a
|
||||
inner join pq_line_detail b on a.id=b.id
|
||||
inner join pq_line bus on a.pid =bus.id
|
||||
where a.id = #{monitorId}
|
||||
</select>
|
||||
<select id="getLineDetailByIds" resultType="com.njcn.device.pq.pojo.po.LineDetail">
|
||||
SELECT
|
||||
DISTINCT
|
||||
detail.*,
|
||||
pqd.Com_Flag as comFlag
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line_detail detail,
|
||||
pq_line vo,
|
||||
pq_voltage vg,
|
||||
pq_line dev,
|
||||
pq_device pqd
|
||||
<where>
|
||||
line.id = detail.id
|
||||
AND vo.id = line.pid
|
||||
AND dev.id = vo.pid
|
||||
AND vo.id = vg.id
|
||||
AND pqd.id = dev.id
|
||||
AND pqd.id = dev.id
|
||||
and pqd.Dev_Model =1
|
||||
and pqd.Run_Flag = 0
|
||||
and detail.Run_Flag = 0
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND line.id IN
|
||||
<foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateLineRunFlag" >
|
||||
update pq_line_detail
|
||||
set run_flag = #{runFlag}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateLineRunFlagBatch" >
|
||||
update pq_line_detail
|
||||
set run_flag = #{runFlag}
|
||||
where id in
|
||||
<foreach item="item" collection="lineIds" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="checkExistsLineByNewStationId" resultType="int">
|
||||
select count(1) from pq_line pl inner join pq_line_detail pld
|
||||
on pl.id = pld.id and pl.State = 1 and pld.New_Station_Id = #{newStationId}
|
||||
</select>
|
||||
</mapper>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.NodeMapper">
|
||||
|
||||
|
||||
<select id="nodeDeviceList" resultType="com.njcn.device.pq.pojo.dto.DeviceInfo">
|
||||
SELECT
|
||||
pq_device.Id id,
|
||||
pq_device.IP ip,
|
||||
s1.Name devType,
|
||||
pq_device.Port port,
|
||||
pq_line.Name name,
|
||||
sub.Name subName,
|
||||
pq_device.Update_Time updateTime,
|
||||
s2.Name manufacturer,
|
||||
pq_device.Com_Flag status,
|
||||
pq_device.Series series,
|
||||
pq_device_process.process_no processNo,
|
||||
pq_device.Dev_Key devKey,
|
||||
pq_node.max_Process_Num maxProcessNum
|
||||
FROM
|
||||
pq_device
|
||||
LEFT JOIN pq_node ON pq_node.Id = pq_device.Node_Id
|
||||
LEFT JOIN pq_line on pq_device.id = pq_line.id
|
||||
LEFT JOIN pq_line sub on pq_line.pid = sub.id
|
||||
LEFT JOIN pq_device_process on pq_device_process.id = pq_device.id
|
||||
LEFT JOIN pq_dev_type s1 ON pq_device.Dev_Type = s1.id
|
||||
LEFT JOIN sys_dict_data s2 ON pq_device.Manufacturer = s2.id
|
||||
<where>
|
||||
<if test="nodeDeviceParam.ip!=null and nodeDeviceParam.ip != ''">
|
||||
pq_node.ip=#{nodeDeviceParam.ip}
|
||||
</if>
|
||||
<if test="nodeDeviceParam.devId!=null and nodeDeviceParam.devId != ''">
|
||||
pq_device.id=#{nodeDeviceParam.devId}
|
||||
</if>
|
||||
<if test="nodeDeviceParam.runFlag!=null and nodeDeviceParam.runFlag.size()!=0">
|
||||
AND pq_device.Run_Flag in
|
||||
<foreach collection="nodeDeviceParam.runFlag" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.OverlimitMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.PqDevTypeMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.PqsTerminalLogsMapper">
|
||||
|
||||
<!--<select id="getList" resultType="com.njcn.device.pq.pojo.vo.LogsListVO">
|
||||
SELECT
|
||||
sdd.Name "type",
|
||||
ptl.Create_By "updateBy",
|
||||
ptl.Create_Time "updateTime",
|
||||
ptl.Terminal_Describe "remark"
|
||||
FROM
|
||||
pqs_terminal_logs ptl
|
||||
LEFT JOIN sys_dict_data sdd ON sdd.Id = ptl.Terminal_Type
|
||||
<where>
|
||||
<if test="logsListParam.searchBeginTime != null and logsListParam.searchBeginTime != ''">
|
||||
and date_format(ptl.Create_Time,'%y%m%d') >= date_format(#{logsListParam.searchBeginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="logsListParam.searchEndTime != null and logsListParam.searchEndTime != ''">
|
||||
and date_format(ptl.Create_Time,'%y%m%d') <= date_format(#{logsListParam.searchEndTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="logsListParam.searchValue !=null and logsListParam.searchValue !=''">
|
||||
and (ptl.Terminal_Describe like CONCAT('%', #{logsListParam.searchValue},'%')
|
||||
</if>
|
||||
<if test="logsListParam.type !=null and logsListParam.type !=''">
|
||||
and sdd.Code = #{logsListParam.type}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ptl.Create_Time DESC
|
||||
LIMIT #{page.current},#{page.size}
|
||||
</select>-->
|
||||
<select id="getList" resultType="com.njcn.device.pq.pojo.vo.LogsListVO">
|
||||
SELECT
|
||||
logs.logs_type type,
|
||||
ptl.Create_By updateBy,
|
||||
ptl.Create_Time updateTime,
|
||||
ptl.Terminal_Describe remark
|
||||
FROM
|
||||
pqs_terminal_logs logs
|
||||
<where>
|
||||
|
||||
<if test="logsListParam.searchValue !=null and logsListParam.searchValue !=''">
|
||||
and ptl.Terminal_Describe like CONCAT('%', #{logsListParam.searchValue},'%')
|
||||
</if>
|
||||
<if test="logsListParam.type !=null and logsListParam.type !=''">
|
||||
and sdd.Code = #{logsListParam.type}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ptl.Create_Time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.ProgramVersionMapper">
|
||||
|
||||
<select id="getVersion" resultType="VersionVO">
|
||||
SELECT
|
||||
A.Id id,
|
||||
B.Name devType,
|
||||
A.Name name,
|
||||
A.Protocol protocol,
|
||||
A.Date date,
|
||||
C.Name updateBy,
|
||||
A.Update_Time updateTime,
|
||||
A.Remark remark,
|
||||
A.Version_Type versionType,
|
||||
A.Version_Flag versionFlag,
|
||||
A.File_Name fileName
|
||||
FROM
|
||||
cld_version A,
|
||||
sys_dict_data B,
|
||||
sys_user C
|
||||
WHERE A.State = 1
|
||||
AND A.Dev_Type = B.Id
|
||||
AND A.Update_By = C.Id
|
||||
<if test="devType != null and devType != ''">
|
||||
AND A.Dev_Type = #{devType}
|
||||
</if>
|
||||
<if test="searchValue != null and searchValue != ''">
|
||||
AND (A.Name like concat('%',#{searchValue},'%') or A.Protocol like concat('%',#{searchValue},'%') or A.Remark like concat('%',#{searchValue},'%'))
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getProgramVersionById" resultType="ShowVersionVO">
|
||||
SELECT
|
||||
File file
|
||||
FROM
|
||||
cld_version
|
||||
WHERE Id = #{id}
|
||||
AND State = 1
|
||||
</select>
|
||||
|
||||
<update id="updateVersionFlag">
|
||||
UPDATE
|
||||
cld_version
|
||||
SET
|
||||
Version_Flag = #{flag}
|
||||
WHERE Id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateVersionState">
|
||||
UPDATE
|
||||
cld_version
|
||||
SET
|
||||
State = 0
|
||||
WHERE Id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -1,89 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.RStatIntegrityDMapper">
|
||||
|
||||
<select id="getLineIntegrityRate" resultType="LineDataIntegrity">
|
||||
select line_index lineId,
|
||||
avg(real_time*1.0/due_time)*100 integrityData,
|
||||
sum(real_time) mysqlReal,
|
||||
sum(due_time) due
|
||||
from r_stat_integrity_d
|
||||
where line_index in
|
||||
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
and time_id between #{startTime} and #{endTime}
|
||||
group by line_index
|
||||
</select>
|
||||
|
||||
<select id="getOnIntegrityByIds" resultType="com.njcn.device.pq.pojo.vo.RStatIntegrityVO">
|
||||
SELECT
|
||||
line_index AS lineIndex,
|
||||
ROUND(sum( real_time )*1.0 / sum( due_time ) * 100,2) AS integrityRate
|
||||
FROM
|
||||
r_stat_integrity_d
|
||||
<where>
|
||||
<if test="param!=null and param.ids != null and param.ids.size > 0">
|
||||
AND line_index IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test=" param.startTime != null and param.startTime !=''">
|
||||
AND time_id >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
AND time_id <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
group by line_index ;
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getOnIntegrityByIdsAndTime" resultType="com.njcn.device.pq.pojo.vo.RStatIntegrityVO">
|
||||
SELECT
|
||||
line_index AS lineIndex,
|
||||
sum( real_time*1.0 )/ sum( due_time )* 100 AS integrityRate
|
||||
FROM
|
||||
r_stat_integrity_d
|
||||
<where>
|
||||
<if test="list.size > 0">
|
||||
AND line_index IN
|
||||
<foreach collection='list' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="startTime != null and startTime !=''">
|
||||
AND time_id >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND time_id <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
group by line_index ;
|
||||
</select>
|
||||
<select id="selectTotalIntegrityByLineIds" resultType="java.lang.Float">
|
||||
select
|
||||
if(sum(real_time*1.0)/sum(due_time)*100>100,
|
||||
100,
|
||||
IFNULL(ROUND( sum(real_time)/sum(due_time)*100,2),0))
|
||||
as integrityRate
|
||||
from
|
||||
r_stat_integrity_d
|
||||
<where>
|
||||
<if test="param!=null and param.lineIds != null and param.lineIds.size > 0">
|
||||
AND line_index IN
|
||||
<foreach collection='param.lineIds' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test=" param.startTime != null and param.startTime !=''">
|
||||
AND time_id >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
AND time_id <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,104 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.SubstationMapper">
|
||||
<select id="getSubstationData" resultType="com.njcn.device.pq.pojo.vo.SubstationDetailVO">
|
||||
SELECT
|
||||
line.id id,
|
||||
line.NAME srbName,
|
||||
sub.Lng coordY,
|
||||
sub.Lat coordX,
|
||||
'blue' color,
|
||||
dic.name scale
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_substation sub,
|
||||
sys_dict_data dic
|
||||
WHERE
|
||||
line.Id = sub.Id
|
||||
and
|
||||
sub.scale = dic.id
|
||||
AND
|
||||
sub.Id IN
|
||||
<foreach collection="id" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getSubstationById" resultType="com.njcn.device.pq.pojo.dto.SubstationDTO">
|
||||
SELECT
|
||||
line.id ,
|
||||
line.NAME ,
|
||||
line.sort ,
|
||||
sub.scale scale,
|
||||
sub.Lng Lng,
|
||||
sub.Lat Lat
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_substation sub
|
||||
WHERE
|
||||
line.Id = sub.Id
|
||||
AND
|
||||
sub.Id IN
|
||||
<foreach collection="id" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="test" resultType="Substation">
|
||||
SELECT
|
||||
line.id ,
|
||||
line.NAME scale,
|
||||
sub.Lng Lng,
|
||||
sub.Lat Lat
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_substation sub
|
||||
WHERE
|
||||
line.Id = sub.Id
|
||||
|
||||
</select>
|
||||
<select id="subTest" resultType="com.njcn.device.pq.pojo.dto.SubstationDTO">
|
||||
SELECT DISTINCT
|
||||
pid as id,
|
||||
powerSubstationName as name ,
|
||||
( SELECT id FROM sys_dict_data WHERE NAME = CONCAT( SUBSTRING_INDEX( powerSubstationName, 'kV', 1 ), "kV" ) ) as scale
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
substation.pid AS pid,
|
||||
substation.id AS substationId,
|
||||
substation.NAME AS substationName,
|
||||
device.id AS deviceId,
|
||||
device.NAME AS deviceName,
|
||||
voltage.id AS voltageId,
|
||||
voltage.NAME AS voltageName,
|
||||
line.id AS lineId,
|
||||
line.NAME AS lineName,
|
||||
lineDetail.Power_Substation_Name AS powerSubstationName,
|
||||
( SELECT id FROM pq_line WHERE Name = lineDetail.Power_Substation_Name ) AS Power_Substation_id
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line voltage,
|
||||
pq_line device,
|
||||
pq_line substation,
|
||||
pq_line gd,
|
||||
pq_line area,
|
||||
pq_device deviceDetail,
|
||||
pq_line_detail lineDetail,
|
||||
pq_voltage vg
|
||||
WHERE
|
||||
line.pid = voltage.id
|
||||
AND voltage.pid = device.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gd.id
|
||||
AND gd.pid = area.id
|
||||
AND device.id = deviceDetail.id
|
||||
AND line.id = lineDetail.id
|
||||
AND vg.Id = voltage.id
|
||||
ORDER BY
|
||||
substation.Name
|
||||
) cc
|
||||
WHERE
|
||||
Power_Substation_id IS NULL;
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.SuperDataMapper">
|
||||
|
||||
|
||||
<select id="getPointSuper" resultType="com.njcn.device.pq.pojo.param.SuperDataParam">
|
||||
SELECT pl.Name AS "mName",
|
||||
pl1.Name AS "pName",
|
||||
pl2.Name AS "devName",
|
||||
pl3.Name AS "subName",
|
||||
pl4.Name AS "urbanName"
|
||||
FROM pq_line pl
|
||||
LEFT JOIN pq_line pl1 ON pl.Pid = pl1.Id
|
||||
LEFT JOIN pq_line pl2 ON pl1.Pid = pl2.Id
|
||||
LEFT JOIN pq_line pl3 ON pl2.Pid = pl3.Id
|
||||
LEFT JOIN pq_line pl4 ON pl3.Pid = pl4.Id
|
||||
WHERE pl.Id = #{id}
|
||||
</select>
|
||||
<select id="getDeviceSuper" resultType="com.njcn.device.pq.pojo.param.SuperDataParam">
|
||||
SELECT
|
||||
pl.Name AS "devName",
|
||||
pl1.Name AS "subName",
|
||||
pl2.Name AS "urbanName"
|
||||
FROM
|
||||
pq_line pl
|
||||
LEFT JOIN pq_line pl1 ON pl.Pid = pl1.Id
|
||||
LEFT JOIN pq_line pl2 ON pl1.Pid = pl2.Id
|
||||
WHERE
|
||||
pl.Id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getBaseReam" resultType="com.njcn.device.pq.pojo.param.BaseReamParam">
|
||||
SELECT cdm.Line_Id "id",cdm.Base_Meal_Id "baseMealId",cdm.Ream_Meal_Id "extendMealId",cfm.Name "baseMealName",cfm1.Name "extendMealName",cfm.Flow "baseMealFlow",cfm1.Flow "extendMealFlow"
|
||||
FROM cld_dev_meal cdm
|
||||
|
||||
left join cld_flow_meal cfm on cdm.Base_Meal_Id = cfm.Id
|
||||
left join cld_flow_meal cfm1 on cdm.Ream_Meal_Id = cfm1.Id
|
||||
where cdm.Line_Id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,220 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.TerminalMaintainMapper">
|
||||
|
||||
<select id="getTerminalDevInfo" resultType="TerminalMaintainVO">
|
||||
SELECT
|
||||
a.id,
|
||||
a.pid,
|
||||
a.NAME,
|
||||
a.level,
|
||||
b.run_flag,
|
||||
b.ip,
|
||||
b.com_flag,
|
||||
b.dev_type devType,
|
||||
ifnull(g.name,'/') version,
|
||||
ifnull(d.flow,(select flow from cld_flow_meal where type = 0 and flag = 1)) baseFlowMeal,
|
||||
ifnull(d1.flow,0) reamFlowMeal,
|
||||
ROUND(ifnull(mo.Actual_Value,0)/1024/1024,2) statisValue
|
||||
FROM
|
||||
pq_line a
|
||||
INNER JOIN pq_device b ON a.id = b.id
|
||||
LEFT JOIN cld_dev_meal c ON b.id = c.line_id
|
||||
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
|
||||
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
|
||||
LEFT JOIN cld_dev_version f on a.id = f.line_id and f.flag = 1 and f.state = 1
|
||||
LEFT JOIN cld_version g on f.version_id = g.id
|
||||
LEFT JOIN
|
||||
(select * from cld_month_flow where DATE_FORMAT(time_id,'%Y-%m' ) = DATE_FORMAT(now(),'%Y-%m')) mo on a.id = mo.Dev_Id
|
||||
where a.id in
|
||||
<foreach collection="devIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="comFlag != null">
|
||||
AND b.Com_Flag=#{comFlag}
|
||||
</if>
|
||||
<if test="devType !=null and devType != ''">
|
||||
AND b.Dev_Type =#{devType}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getGdAndSubList" resultType="TerminalMaintainVO">
|
||||
select id,name,level,pid from pq_line where level = #{level} and state = 1 order by sort
|
||||
</select>
|
||||
|
||||
<select id="getProvList" resultType="TerminalMaintainVO">
|
||||
select a.id,b.name,a.level,a.pid from pq_line a
|
||||
inner join sys_area b on a.name = b.id
|
||||
where a.level = 1
|
||||
and a.state = 1
|
||||
order by a.sort
|
||||
</select>
|
||||
|
||||
<select id="getPqLineProvList" resultType="TerminalMaintainVO">
|
||||
select a.id,b.name,a.level,a.pid from pq_line a
|
||||
inner join sys_area b on a.name = b.id
|
||||
where a.level = 1
|
||||
and a.id in
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by a.sort
|
||||
</select>
|
||||
|
||||
<select id="getPqLineGdAndSubList" resultType="TerminalMaintainVO">
|
||||
select a.id,
|
||||
a.name,
|
||||
a.level,
|
||||
a.pid
|
||||
from pq_line a
|
||||
where a.id in
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by a.sort
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getRunFlagList" resultType="TerminalMaintainVO">
|
||||
SELECT
|
||||
a.id,
|
||||
a.pid,
|
||||
a.NAME,
|
||||
b.ip,
|
||||
a.level,
|
||||
b.run_flag
|
||||
FROM
|
||||
pq_line a
|
||||
INNER JOIN pq_device b ON a.id = b.id
|
||||
WHERE a.id in
|
||||
<foreach collection="ids" item="item" separator="," index="index" open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by a.sort
|
||||
</select>
|
||||
|
||||
<select id="getFlowMealList" resultType="TerminalMaintainVO">
|
||||
SELECT
|
||||
a.id,
|
||||
a.pid,
|
||||
a.name,
|
||||
a.level,
|
||||
h.ip,
|
||||
ifnull(f.Flow,(select flow from cld_flow_meal where type = 0 and flag = 1)) baseFlowMeal,
|
||||
ifnull(g.Flow,0) reamFlowMeal
|
||||
FROM
|
||||
pq_line a
|
||||
inner join pq_device h on a.id = h.id
|
||||
Left join cld_dev_meal e on a.id = e.Line_Id
|
||||
left join cld_flow_meal f on e.Base_Meal_Id = f.Id
|
||||
left join cld_flow_meal g on e.Ream_Meal_Id = g.Id
|
||||
WHERE a.id in
|
||||
<foreach collection="ids" item="item" separator="," index="index" open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by a.sort
|
||||
</select>
|
||||
|
||||
<select id="getFlowStrategyList" resultType="TerminalMaintainVO">
|
||||
SELECT
|
||||
a.id,
|
||||
a.pid,
|
||||
a.name,
|
||||
a.level,
|
||||
ifnull(f.name,(select name from cld_flow_strategy where flag = 1 and state = 1)) flowStrategy,
|
||||
ifnull(f.flag,1) as strategyFlag
|
||||
FROM
|
||||
pq_line a
|
||||
Left join cld_dev_strategy e on a.id = e.Line_Id
|
||||
left join cld_flow_strategy f on e.Strategy_Id = f.Id
|
||||
WHERE a.id in
|
||||
<foreach collection="ids" item="item" separator="," index="index" open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by a.sort
|
||||
</select>
|
||||
<select id="getFlowManageDetail" resultType="com.njcn.device.pq.pojo.vo.TerminalDaliyFlowVO">
|
||||
SELECT
|
||||
c.Line_Id devId,
|
||||
IFNULL(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) baseFlow,
|
||||
IFNULL(d1.flow, 0) extendFlow,
|
||||
IFNULL(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + IFNULL(d1.flow, 0) flowMeal
|
||||
FROM pq_line device
|
||||
LEFT JOIN cld_dev_meal c ON device.id = c.Line_Id
|
||||
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
|
||||
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
|
||||
WHERE device.Id = #{devId}
|
||||
</select>
|
||||
|
||||
<select id="getMonthFlow" resultType="com.njcn.device.pq.pojo.vo.LineFlowMealDetailVO">
|
||||
select t.*,
|
||||
(t.statisValue)/t.flowMeal flowProportion
|
||||
from (
|
||||
SELECT
|
||||
a.id id,
|
||||
a.name deviceName,
|
||||
a.level,
|
||||
sub.name substation,
|
||||
gd.name electricPowerCompany,
|
||||
b.IP DeviceIP,
|
||||
b.id deviceId,
|
||||
-- ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
||||
-- ifnull(convert(m.Actual_Value/1024/1024,decimal(7,2)),0) statisValue
|
||||
COALESCE(d.flow, (SELECT flow FROM cld_flow_meal WHERE type = 0 AND flag = 1)) + COALESCE(d1.flow, 0) AS flowMeal,
|
||||
COALESCE(CAST(m.Actual_Value / 1024 / 1024 AS DECIMAL(7, 2)), 0) AS statisValue
|
||||
FROM pq_line a
|
||||
INNER JOIN pq_line sub ON sub.id = a.pid
|
||||
INNER JOIN pq_line gd ON gd.id = sub.pid
|
||||
INNER JOIN pq_device b ON a.id = b.id
|
||||
LEFT JOIN cld_month_flow m ON b.id = m.Dev_Id
|
||||
LEFT JOIN cld_dev_meal c ON b.id = c.line_id
|
||||
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
|
||||
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
|
||||
WHERE a.id IN
|
||||
<foreach item="item" collection="devs" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND
|
||||
m.Time_Id between #{startTime} and #{endTime}
|
||||
AND
|
||||
b.Run_Flag != 2
|
||||
) t
|
||||
ORDER BY flowProportion DESC
|
||||
</select>
|
||||
|
||||
<select id="getMonthFlowNew" resultType="com.njcn.device.pq.pojo.vo.LineFlowMealDetailVO">
|
||||
select t.*,
|
||||
(t.statisValue)/t.flowMeal flowProportion
|
||||
from (
|
||||
SELECT
|
||||
a.id id,
|
||||
a.name deviceName,
|
||||
a.level,
|
||||
sub.name substation,
|
||||
gd.name electricPowerCompany,
|
||||
b.IP DeviceIP,
|
||||
b.id deviceId,
|
||||
ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
||||
ifnull(convert(m.Actual_Value/1024/1024,decimal(7,2)),0) statisValue
|
||||
FROM pq_line a
|
||||
INNER JOIN pq_line sub ON sub.id = a.pid
|
||||
INNER JOIN pq_line gd ON gd.id = sub.pid
|
||||
INNER JOIN pq_device b ON a.id = b.id
|
||||
LEFT JOIN cld_month_flow m ON b.id = m.Dev_Id
|
||||
LEFT JOIN cld_dev_meal c ON b.id = c.line_id
|
||||
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
|
||||
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
|
||||
where a.id in
|
||||
<foreach item="item" collection="devs" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and
|
||||
m.Time_Id between #{startTime} and #{endTime}
|
||||
and
|
||||
b.Run_Flag != 2
|
||||
) t
|
||||
ORDER BY flowProportion DESC
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,110 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.TerminalVersionMapper">
|
||||
|
||||
|
||||
<select id="getTerminalVersionInfo" resultType="TerminalVersionVO">
|
||||
SELECT
|
||||
a.id,
|
||||
a.pid,
|
||||
a.NAME,
|
||||
a.LEVEL,
|
||||
b.run_flag,
|
||||
b.com_flag,
|
||||
b.dev_type devType,
|
||||
ifnull(e.NAME,'/') versionName,
|
||||
ifnull(e.protocol,'/') protocol,
|
||||
ifnull(e.date,'/') versionDate,
|
||||
ifnull(e.update_time,'/') updateTime,
|
||||
ifnull(e.update_by,'/') updateBy,
|
||||
e.id as versionId
|
||||
FROM
|
||||
pq_line a
|
||||
INNER JOIN pq_device b ON a.id = b.id
|
||||
LEFT JOIN cld_dev_version d ON b.id = d.Line_Id and d.flag = 1 and d.Result = 1
|
||||
LEFT JOIN cld_version e ON d.Version_Id = e.id
|
||||
LEFT JOIN sys_user f on d.update_by = f.id
|
||||
WHERE
|
||||
b.dev_model = 1
|
||||
<if test="queryParam.runFlag!=null">
|
||||
and b.run_flag = #{queryParam.runFlag}
|
||||
</if>
|
||||
<if test="queryParam.comFlag!=null">
|
||||
and b.com_flag = #{queryParam.comFlag}
|
||||
</if>
|
||||
<if test="queryParam.devType!=null and queryParam.devType!=''">
|
||||
and b.dev_type = #{queryParam.devType}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getGdAndSubList" resultType="TerminalVersionVO">
|
||||
select id,name,level,pid from pq_line where level = #{level} and state = 1 order by sort
|
||||
</select>
|
||||
|
||||
<select id="getProvList" resultType="TerminalVersionVO">
|
||||
select a.id,b.name,a.level,a.pid from pq_line a
|
||||
inner join sys_area b on a.name = b.id
|
||||
where a.level = 1
|
||||
and a.state = 1
|
||||
order by a.sort
|
||||
</select>
|
||||
|
||||
<select id="getPqLineProvList" resultType="TerminalVersionVO">
|
||||
select a.id,b.name,a.level,a.pid from pq_line a
|
||||
inner join sys_area b on a.name = b.id
|
||||
where a.level = 1
|
||||
and a.id in
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by a.sort
|
||||
</select>
|
||||
|
||||
<select id="getPqLineGdAndSubList" resultType="TerminalVersionVO">
|
||||
select a.id,a.name,a.level,a.pid from pq_line a
|
||||
where a.id in
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by a.sort
|
||||
</select>
|
||||
<select id="selectListById" resultType="com.njcn.device.pq.pojo.po.DevVersion">
|
||||
SELECT
|
||||
cdv.*,
|
||||
pd.Dev_Type AS devType,
|
||||
sdd.Name AS devTypeName
|
||||
FROM cld_dev_version cdv
|
||||
LEFT JOIN pq_device pd ON cdv.Line_Id = pd.Id
|
||||
LEFT JOIN pq_dev_type sdd ON pd.Dev_Type = sdd.Id
|
||||
WHERE cdv.Line_Id = #{id}
|
||||
</select>
|
||||
<select id="selectDevVersion" resultType="com.njcn.device.pq.pojo.vo.TerminalVersionVO$Version">
|
||||
SELECT
|
||||
a.id,
|
||||
a.NAME,
|
||||
ifnull( e.NAME, '/' ) versionName,
|
||||
ifnull( e.protocol, '/' ) protocol,
|
||||
ifnull( e.date, '/' ) versionDate,
|
||||
e.Dev_Type AS devSeries,
|
||||
b.dev_type AS devType,
|
||||
sub.NAME subName,
|
||||
gb.NAME gbName,
|
||||
ifnull( e.update_time, '/' ) updateTime,
|
||||
ifnull( e.update_by, '/' ) updateBy
|
||||
FROM
|
||||
pq_line a
|
||||
INNER JOIN pq_device b ON a.id = b.id
|
||||
INNER JOIN pq_line sub ON a.pid = sub.id
|
||||
INNER JOIN pq_line gb ON sub.pid = gb.id
|
||||
LEFT JOIN cld_dev_version d ON b.id = d.Line_Id AND d.flag = 1 AND d.Result = 1
|
||||
LEFT JOIN cld_version e ON d.Version_Id = e.id
|
||||
WHERE
|
||||
b.dev_model = 1 and a.State=1
|
||||
and a.id in
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,107 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.TopMsgMapper">
|
||||
|
||||
<select id="dailyDeviceAbnormalStatistics" resultType="com.njcn.device.pq.pojo.po.TopMsgPO">
|
||||
SELECT
|
||||
ptm.Time_Id AS time,
|
||||
IFNULL(COUNT(ptm.Dev_Id),3.14159)AS deviceAbnormalNum
|
||||
FROM pqs_top_msg ptm
|
||||
INNER JOIN pq_line device ON ptm.Dev_Id = device.Id
|
||||
INNER JOIN pq_line vol ON vol.pid = device.Id
|
||||
INNER JOIN pq_line line ON line.pid = vol.id
|
||||
INNER JOIN pq_line_detail pld ON pld.Id=line.Id
|
||||
WHERE
|
||||
ptm.State=1
|
||||
AND
|
||||
ptm.Time_Id between #{startTime} and #{endTime}
|
||||
<if test="lineGrade!=null and lineGrade!=''">
|
||||
AND pld.Line_Grade=#{lineGrade}
|
||||
</if>
|
||||
GROUP BY ptm.Time_Id
|
||||
ORDER BY ptm.Time_Id DESC
|
||||
</select>
|
||||
|
||||
<select id="dailyDeviceAbnormal" resultType="com.njcn.device.pq.pojo.po.TopMsgPO">
|
||||
SELECT
|
||||
device.Id AS devId,
|
||||
city.Name AS cityName,
|
||||
sub.Name AS subName,
|
||||
device.Name AS deviceName,
|
||||
CAST(ptm.Integrity_Value as DECIMAL(13,2)) AS integrityValue,
|
||||
ptm.Integrity_Flag AS integrityFlag,
|
||||
ptm.Comout_Count AS comOutCount,
|
||||
ptm.Comout_Desc AS comOutDesc,
|
||||
ptm.Alarm_Count AS alarmCount,
|
||||
ptm.Alarm_Desc AS alarmDesc,
|
||||
CAST(ptm.Flow_Value as DECIMAL(13,2)) AS flowValue,
|
||||
ptm.OnlineRate_Flag AS onlineRateFlag,
|
||||
CAST(ptm.OnlineRate_Value as DECIMAL(13,2)) AS onlineRateValue
|
||||
FROM pq_line line
|
||||
INNER JOIN pq_line vol ON line.pid=vol.id
|
||||
INNER JOIN pq_line device ON vol.pid=device.id
|
||||
INNER JOIN pq_line sub ON device.pid=sub.id
|
||||
INNER JOIN pq_line city ON sub.pid=city.id
|
||||
INNER JOIN pqs_top_msg ptm ON ptm.Dev_Id = device.Id
|
||||
LEFT JOIN pq_line_detail pld ON pld.Id=line.Id
|
||||
WHERE
|
||||
ptm.State=1
|
||||
AND
|
||||
ptm.Time_Id = #{startTime}
|
||||
<if test="lineGrade!=null and lineGrade!=''">
|
||||
AND pld.Line_Grade=#{lineGrade}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByIds" resultType="com.njcn.device.pq.pojo.po.TopMsgPO">
|
||||
SELECT DISTINCT
|
||||
top_id as topId,
|
||||
dev.Id AS devId,
|
||||
city.NAME AS cityName,
|
||||
sub.NAME AS subName,
|
||||
dev.NAME AS deviceName,
|
||||
device.ip AS ip,
|
||||
ptm.Time_Id AS time,
|
||||
CAST(
|
||||
ptm.Integrity_Value AS DECIMAL ( 13, 2 )) AS integrityValue,
|
||||
ptm.Integrity_Flag AS integrityFlag,
|
||||
ptm.Comout_Count AS comOutCount,
|
||||
ptm.Comout_Desc AS comOutDesc,
|
||||
ptm.Alarm_Count AS alarmCount,
|
||||
ptm.Alarm_Desc AS alarmDesc,
|
||||
CAST(
|
||||
ptm.Flow_Value AS DECIMAL ( 13, 2 )) AS flowValue,
|
||||
ptm.OnlineRate_Flag AS onlineRateFlag,
|
||||
CAST(
|
||||
ptm.OnlineRate_Value AS DECIMAL ( 13, 2 )) AS onlineRateValue
|
||||
FROM
|
||||
pq_line dev
|
||||
INNER JOIN pq_line sub ON dev.pid = sub.id
|
||||
INNER JOIN pq_line city ON sub.pid = city.id
|
||||
INNER JOIN pqs_top_msg ptm ON ptm.Dev_Id = dev.Id
|
||||
INNER JOIN pq_device device ON dev.id = device.Id
|
||||
<where>
|
||||
<if test="param.type == 0">
|
||||
<if test="param.ids!=null and param.ids.size()!=0">
|
||||
ptm.Top_Id IN
|
||||
<foreach collection="param.ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</if>
|
||||
<if test="param.type == 1">
|
||||
<if test="param.ids!=null and param.ids.size()!=0">
|
||||
dev.Id IN
|
||||
<foreach collection="param.ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</if>
|
||||
<if test=" param.startTime != null and param.startTime !=''">
|
||||
AND ptm.Time_Id >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
AND ptm.Time_Id <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.VersionMapper">
|
||||
|
||||
<select id="selectVersion" resultType="com.njcn.device.pq.pojo.vo.VersionVO">
|
||||
select
|
||||
Id,
|
||||
Name,
|
||||
Protocol,
|
||||
Date,
|
||||
Dev_Type,
|
||||
Version_Type,
|
||||
case ISNULL(File) when 1 then 0 else 1 end as isFile,
|
||||
File_Name,
|
||||
Version_Flag,
|
||||
Remark,
|
||||
State
|
||||
from
|
||||
cld_version
|
||||
<where>
|
||||
State = 1
|
||||
and Dev_Type = #{param.devType}
|
||||
and Id not in
|
||||
<foreach collection="param.versionIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.VoltageMapper">
|
||||
|
||||
<select id="getVoltageByNum" resultType="Voltage">
|
||||
select b.* from pq_line a
|
||||
inner join pq_voltage b on a.id=b.id
|
||||
where a.pid = #{devIndex}
|
||||
and a.state = 1
|
||||
and b.Num in
|
||||
<foreach collection="num" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getLineDetailByBusBarId" resultType="LineDetail">
|
||||
select pq_line_detail.* from pq_line pq_line
|
||||
inner join pq_line_detail pq_line_detail on pq_line.id = pq_line_detail.id
|
||||
where pid = #{busBarId}
|
||||
and pq_line.state = 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,145 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.dto.TerminalGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
|
||||
import com.njcn.web.pojo.param.DeptLineParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/12 17:30
|
||||
*
|
||||
*/
|
||||
public interface DeptLineService extends IService<DeptLine> {
|
||||
|
||||
/**
|
||||
* 部门绑定监测点
|
||||
* @param deptLineParam 部门监测点的实体类
|
||||
* @return 绑定结果
|
||||
*/
|
||||
void deptBindLine(DeptLineParam deptLineParam);
|
||||
|
||||
|
||||
/**
|
||||
* 部门解绑监测点
|
||||
* @param deptLineParam 部门监测点的实体类
|
||||
* @return 解绑结果
|
||||
*/
|
||||
void deptDeleteBindLine(DeptLineParam deptLineParam);
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门ids集合查询是否绑定监测点
|
||||
* @param ids 部门ids
|
||||
* @return 查询结果
|
||||
*/
|
||||
List<DeptLine> selectDeptBindLines(List<String> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门ids集合查询所有监测点id
|
||||
* @param ids 部门ids
|
||||
* @return 查询结果
|
||||
*/
|
||||
List<String> getLineByDeptIds(List<String> ids,String manufacturer,List<Integer> runFlag,List<Integer> dataType,String objType);
|
||||
|
||||
/**
|
||||
* 部门解除绑定监测点
|
||||
* @param id 部门id
|
||||
* @return 解绑结果
|
||||
*/
|
||||
int removeBind(String id);
|
||||
|
||||
/**
|
||||
* 功能描述: 根据部门id获取绑定的监测点
|
||||
*
|
||||
* @param id
|
||||
* @return java.util.List<java.lang.String>
|
||||
* @author xy
|
||||
* @date 2022/1/25 9:28
|
||||
*/
|
||||
List<String> getLineByDeptId(String id);
|
||||
|
||||
/**
|
||||
* 功能描述: 根据部门id获取绑定的监测点且再根据NewStation进行过滤
|
||||
* @param id,type
|
||||
* @author guofeihu
|
||||
* @date 2024/8/19
|
||||
*/
|
||||
List<String> getLineByDeptIdAndNewStation(String id);
|
||||
|
||||
/**
|
||||
* @Description: 根据部门id获取所有子集部门所包含的部门信息
|
||||
* @param id
|
||||
* @return: java.util.List<java.lang.String>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/8 14:54
|
||||
*/
|
||||
List<String> getLineNodeByDeptId(String id);
|
||||
|
||||
/**
|
||||
* @Description: 获取部门和监测点的关系(分稳态暂态)
|
||||
* @Param: [devDataType]
|
||||
* @return: java.util.Map<java.lang.String,java.util.List<java.lang.String>>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/19
|
||||
*/
|
||||
Map<String, List<String>> getLineByDeptRelation(Integer devDataType);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取根据单位分组的监测点集合信息
|
||||
* param 系统类型 0暂态 1稳态 2 双类型
|
||||
* param type 台账类型 1监测点 2母线 3 装置
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
Map<String, List<LineDevGetDTO>> lineDevGet(List<Integer> devType,Integer type,Integer lineRunFlag);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取根据单位分组的变电站集合信息
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
Map<String, List<TerminalGetBase>> orgSubStationGet(List<Integer> devType);
|
||||
|
||||
|
||||
List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType,Integer powerFlag,Integer lineRunFlag);
|
||||
|
||||
List<SubGetBase> getSubStationList(SubstationParam substationParam);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据监测点id集合查询部门信息id
|
||||
* @param ids 部门ids
|
||||
* @return 查询结果
|
||||
*/
|
||||
DeptLine getLineByLineIds(String ids);
|
||||
|
||||
List<DeptLine> getDeptListByLineId(String id);
|
||||
|
||||
List<LineDeviceStateVO> getLineDetailByDeptId(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门id和终端id筛选信息
|
||||
* @param orgId
|
||||
* @return
|
||||
*/
|
||||
List<DevDetailVO> getLineDetailByDeptIdAndDevIds(String orgId,Integer powerFlag, List<String> devIds);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.po.DevFuction;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 终端异常统计业务层
|
||||
* @author zbj
|
||||
* @date 2023/05/24
|
||||
*/
|
||||
@Service
|
||||
public interface DevFuctionService extends IService<DevFuction> {
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.biz.pojo.po.DeviceBak;
|
||||
|
||||
/**
|
||||
* 监测点类
|
||||
* @author denghuajun
|
||||
* @date 2022/2/23
|
||||
*
|
||||
*/
|
||||
public interface DeviceBakService extends IService<DeviceBak> {
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.biz.pojo.po.DeviceBak;
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
|
||||
/**
|
||||
* 监测点类
|
||||
* @author denghuajun
|
||||
* @date 2022/2/23
|
||||
*
|
||||
*/
|
||||
public interface DeviceProcessService extends IService<DeviceProcess> {
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.po.DevMeal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
public interface IDevMealService extends IService<DevMeal> {
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.po.DevStrategy;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
public interface IDevStrategyService extends IService<DevStrategy> {
|
||||
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.param.ConstantValueParam;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.vo.DevStatusNumVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
public interface IDeviceService extends IService<Device> {
|
||||
|
||||
|
||||
/***
|
||||
* @Description: mqtt获取外部定值
|
||||
* @param param
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/14 10:17
|
||||
*/
|
||||
String sentLine(ConstantValueParam.Constant param);
|
||||
|
||||
/***
|
||||
* @Description: mqtt修改外部定值
|
||||
* @param param
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/14 11:07
|
||||
*/
|
||||
String sentLineData(ConstantValueParam.ValueData param);
|
||||
|
||||
/**
|
||||
* @param param
|
||||
* @Description: mqtt获取内部定值
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/14 14:51
|
||||
*/
|
||||
String sentDev(ConstantValueParam.Constant param);
|
||||
|
||||
/**
|
||||
* @param param
|
||||
* @Description: mqtt修改内部定值
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/14 14:51
|
||||
*/
|
||||
String sentDevData(ConstantValueParam.ValueData param);
|
||||
|
||||
/**
|
||||
* @param devID
|
||||
* @Description: 终端性能查看
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/15 11:27
|
||||
*/
|
||||
String socketDevProperty(String devID);
|
||||
|
||||
/**
|
||||
* @param devID
|
||||
* @Description: 终端性能关闭
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/15 16:13
|
||||
*/
|
||||
String socketDevPropertyClose(String devID);
|
||||
|
||||
/**
|
||||
* @param lineIndex
|
||||
* @Description: 监测点实时数据查看
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/15 16:13
|
||||
*/
|
||||
String realTimeData(String lineIndex);
|
||||
|
||||
/**
|
||||
* @param lineIndex
|
||||
* @Description: 监测实施数据心跳
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/15 16:14
|
||||
*/
|
||||
String heartRealTimeData(String lineIndex);
|
||||
|
||||
/**
|
||||
* @param lineIndex
|
||||
* @Description: 监测点实施数据关闭
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/15 16:14
|
||||
*/
|
||||
String closeRealTimeData(String lineIndex);
|
||||
|
||||
/**
|
||||
* 终端版本升级,批量升级条件必须是相同终端系列的终端才能升级
|
||||
*
|
||||
* @param list
|
||||
* @param edIndex
|
||||
* @return
|
||||
*/
|
||||
String getDevUpgrades(List<String> list, String edIndex);
|
||||
|
||||
/**
|
||||
* @param devList
|
||||
* @Description: 终端升级取消
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/17 9:24
|
||||
*/
|
||||
String closeUpgrades(List<String> devList);
|
||||
|
||||
/**
|
||||
* @param devList
|
||||
* @Description: 重启装置命令
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/17 9:24
|
||||
*/
|
||||
String restartDev(List<String> devList);
|
||||
|
||||
/**
|
||||
* @param devId 装置id
|
||||
* @param thisTimeCheck 本次定检时间
|
||||
* @param nextTimeCheck 下次定检时间
|
||||
* @Description: 技术监督修改装置定检时间
|
||||
*/
|
||||
void updateDevCheckTime(String devId, String thisTimeCheck, String nextTimeCheck);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 统计不同运行状态的终端数量
|
||||
*/
|
||||
DevStatusNumVO statisticDevNum(List<String> devIds);
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.bo.excel.NodeExcel;
|
||||
import com.njcn.device.pq.pojo.param.NodeParam;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
public interface INodeService extends IService<Node> {
|
||||
|
||||
|
||||
/**
|
||||
* 新增前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
boolean addNode(NodeParam nodeParam);
|
||||
|
||||
/**
|
||||
* 修改前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
boolean updateNode(NodeParam.NodeUpdateParam nodeParam);
|
||||
|
||||
/**
|
||||
* 删除前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
boolean delNode(String id);
|
||||
|
||||
/**
|
||||
* 修改前置机状态
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
boolean updateNodeState(String id, Integer state);
|
||||
|
||||
/**
|
||||
* 查询前置机列表
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
Page<Node> nodeList(NodeParam.NodeQueryParam nodeQueryParam);
|
||||
|
||||
/**
|
||||
* 查询前置机列表不分页
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
List<Node> nodeAllList();
|
||||
|
||||
/**
|
||||
* 根据前置机id获取前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
Node getNodeById(String id);
|
||||
|
||||
/**
|
||||
* 背景:从oracle中导入到mysql中
|
||||
* 批量导入前置机信息
|
||||
* @param nodeExcels 前置信息
|
||||
*/
|
||||
void saveBatchNodeInfo(List<NodeExcel> nodeExcels);
|
||||
|
||||
/**
|
||||
* 根据前置机名称获取详细信息
|
||||
* @param nodeName 前置机名称
|
||||
* @return 前置信息
|
||||
*/
|
||||
Node getNodeByNodeName(String nodeName);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 越限表实体
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2023-03-28
|
||||
*/
|
||||
public interface IOverLimitService extends IService<Overlimit> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.param.LogsListParam;
|
||||
import com.njcn.device.pq.pojo.po.PqsTerminalLogs;
|
||||
import com.njcn.device.pq.pojo.vo.LogsListVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2023-04-13
|
||||
*/
|
||||
|
||||
public interface IPqsTerminalLogsService extends IService<PqsTerminalLogs> {
|
||||
|
||||
boolean saveLogs(PqsTerminalLogs pqsTerminalLogs);
|
||||
|
||||
Page<PqsTerminalLogs> getList(LogsListParam logsListParam);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.po.LineBak;
|
||||
|
||||
/**
|
||||
* 监测点类
|
||||
* @author denghuajun
|
||||
* @date 2022/2/23
|
||||
*
|
||||
*/
|
||||
public interface LineBakService extends IService<LineBak> {
|
||||
|
||||
}
|
||||
@@ -1,261 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionParamDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 监测点类
|
||||
* @author denghuajun
|
||||
* @date 2022/2/23
|
||||
*
|
||||
*/
|
||||
public interface LineService extends IService<Line> {
|
||||
/**
|
||||
* 获取监测点详情
|
||||
* @param id 监测点id
|
||||
* @return 结果
|
||||
*/
|
||||
LineDetailDataVO getLineDetailData(String id);
|
||||
|
||||
/**
|
||||
* 获取监测点越限详情
|
||||
* @param id 监测点id
|
||||
* @return 结果
|
||||
*/
|
||||
LineOverLimitVO getLineOverLimitData(String id);
|
||||
|
||||
/**
|
||||
* 获取变电站信息
|
||||
* @param id 监测点id
|
||||
* @return 结果
|
||||
*/
|
||||
List<SubstationDetailVO> getSubstationData(List<String> id);
|
||||
|
||||
/**
|
||||
* 获取终端状态信息
|
||||
* @param id 监测点id
|
||||
* @param searchBeginTime 开始时间
|
||||
* @param searchEndTime 结束时间
|
||||
* @return 结果
|
||||
*/
|
||||
CommunicateVO getComFlagInfoData(String id, String searchBeginTime, String searchEndTime);
|
||||
|
||||
/**
|
||||
* 获取变电站id
|
||||
* @param id 监测点id
|
||||
* @return 结果
|
||||
*/
|
||||
String getLineIdByDevId(String id);
|
||||
|
||||
Set<String> getDevListByLineIdList(List<String> list);
|
||||
|
||||
/**
|
||||
* 获取限值表信息
|
||||
* @param id 监测点id
|
||||
* @return 结果
|
||||
*/
|
||||
Overlimit getOverLimitData(String id);
|
||||
|
||||
/**
|
||||
* 获取投运在线的监测点的限值
|
||||
* @param serverType 服务名称
|
||||
* @param deptId 部门id
|
||||
* @return 结果
|
||||
*/
|
||||
List<Overlimit> getAllLineOverLimit(String serverType,String deptId);
|
||||
|
||||
/**
|
||||
* 获取变电站信息
|
||||
* @param id 变电站id
|
||||
* @return 结果
|
||||
*/
|
||||
PollutionSubstationDTO getSubstationInfo(String id);
|
||||
|
||||
/**
|
||||
* 获取监测点信息
|
||||
* @param pollutionParamDTO 监测点对象
|
||||
* @return 结果
|
||||
*/
|
||||
List<PollutionLineDTO> getLineInfo(PollutionParamDTO pollutionParamDTO);
|
||||
|
||||
/**
|
||||
* 获取监测点分布
|
||||
* @param deviceInfoParam 参数
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineDistributionVO> getLineDistribution(DeviceInfoParam deviceInfoParam);
|
||||
|
||||
/**
|
||||
* 获取监测点统计
|
||||
* @param deviceInfoParam 参数
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineStatisticsDetailVO> getLineStatisticsDetail(DeviceInfoParam.BusinessParam deviceInfoParam);
|
||||
|
||||
/**
|
||||
* 获取监测点统计
|
||||
* @param deviceInfoParam 参数
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineStatisticsTableVO> getLineStatisticsTable(DeviceInfoParam.BusinessParam deviceInfoParam);
|
||||
|
||||
|
||||
/**
|
||||
* 获取监测点限值信息
|
||||
* @param pollutionParamDTO 监测点集合
|
||||
* @return 结果
|
||||
*/
|
||||
List<Overlimit> getOverLimitByList(PollutionParamDTO pollutionParamDTO);
|
||||
|
||||
/**
|
||||
* 获取监测点区域详细信息(原基础上添加监测点区域经纬度信息)
|
||||
* @param lineIndex 监测点结合
|
||||
* @date 2022/6/29
|
||||
*/
|
||||
List<AreaLineInfoVO> getBaseLineAreaInfo(List<String> lineIndex,String searchValue,Integer comFlag);
|
||||
|
||||
/**
|
||||
* 获取监测点基本信息
|
||||
* @param lineIndex 监测点结合
|
||||
* @date 2022/6/29
|
||||
*/
|
||||
List<Line> getBaseLineList(List<String> lineIndex);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 通过部门索引查询其下监测点数
|
||||
* @Param: [deviceInfoParam] 监测点查询条件
|
||||
* @return: java.util.List<com.njcn.device.pq.pojo.vo.DeptLineCountVO>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/10
|
||||
*/
|
||||
List<DeptLineCountVO> getDeptLineCount(DeviceInfoParam deviceInfoParam);
|
||||
|
||||
/**
|
||||
* @Description: 获取变电站和监测点的关系(分稳态暂态)
|
||||
* @Param: [devDataType]
|
||||
* @return: java.util.Map<java.lang.String,java.util.List<java.lang.String>>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/20
|
||||
*/
|
||||
Map<String, List<String>> getLineBySubstationRelation(Integer devDataType);
|
||||
|
||||
/**
|
||||
* 获取监测点基础详情
|
||||
* @param lineIds 监测点id集合
|
||||
* @return 监测点详情信息
|
||||
* @author cdf
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
List<LineDetailDataVO> getLineDetailList(List<String> lineIds);
|
||||
/**
|
||||
* @Description: 获取变电站下终端数
|
||||
* @Param: [subIndex]
|
||||
* @return: java.lang.Integer
|
||||
* @Author: clam
|
||||
* @Date: 2022/11/9
|
||||
*/
|
||||
Integer getDeviceCountBySubstation(String subIndex);
|
||||
/**
|
||||
* @Description: 获取变电站下监测点数
|
||||
* @Param: [subIndex]
|
||||
* @return: java.lang.Integer
|
||||
* @Author: clam
|
||||
* @Date: 2022/11/9
|
||||
*/
|
||||
Integer getLineCountBySubstation(String subIndex);
|
||||
|
||||
Page<LineFlowMealDetailVO>getNewDeviceRunStatistics(PqsParam deviceInfoParam);
|
||||
|
||||
Page<TopMsgPO> dailyDeviceAbnormalStatistics(PqsParam param);
|
||||
|
||||
List<TopMsgPO> dailyDeviceAbnormal(DeviceInfoParam.BusinessParam conditionBusinessParam);
|
||||
|
||||
Page<HalfReportVO> halfReport(TerminalMainQueryParam param);
|
||||
|
||||
/**
|
||||
* @Description: 根据监测点获取监测点信息
|
||||
* @param id
|
||||
* @return: com.njcn.device.biz.pojo.dto.LineDTO
|
||||
* @Author: wr
|
||||
* @Date: 2023/9/22 10:46
|
||||
*/
|
||||
LineDTO getLineDetail(String id);
|
||||
|
||||
/**
|
||||
* 根据监测点批量获取监测点信息
|
||||
*/
|
||||
List<LineDTO> getLineDetailBatch(List<String> ids);
|
||||
|
||||
/**
|
||||
* @Description: 获取监测点集合(APP)
|
||||
* @param ids
|
||||
* @return: java.util.List<com.njcn.device.pq.pojo.vo.LineDetailVO.Detail>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/8 15:46
|
||||
*/
|
||||
List<LineDetailVO.Detail> getLineDetailByIds(List<String> ids);
|
||||
|
||||
LineALLInfoDTO getLineAllDetail(String id);
|
||||
|
||||
DeviceVO getDeviceDetailData(String id);
|
||||
|
||||
List<Line> getSubIndexLineDetail(String id);
|
||||
|
||||
List<LineALLInfoDTO> getLineAllDetailList(List<String> ids);
|
||||
|
||||
List<LineDetailVO.Detail> getDeptDeviceDetailData(DataParam param);
|
||||
|
||||
List<LineDetailVO.noDataLineInfo> getNoDataLine();
|
||||
|
||||
List<ReportLineInfoVo> getReportLineInfo(List<String> ids);
|
||||
|
||||
List<LineDetail> getByName(LineBaseQueryParam param);
|
||||
|
||||
/**
|
||||
* 获取部门下终端信息和终端下监测点信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<DevAndLine> getByDeptDevLine(String id);
|
||||
|
||||
List<String> getLevelMonitorByDept(@RequestParam("level") String level, @RequestParam("deptId")String deptId);
|
||||
|
||||
|
||||
List<LineDetail> getMonitorByObjId(String objId);
|
||||
|
||||
List<PollutionSubstationDTO> getPowerStationByMonitorIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取污区值监测点相关信息
|
||||
* @author hongawen
|
||||
*/
|
||||
List<PollutionLineInfoDTO> getPollutionLineInfo(List<String> id);
|
||||
|
||||
/**
|
||||
* 根据pid获取所有子节点的ID
|
||||
*/
|
||||
List<String> getSubIdByPid(String pid);
|
||||
|
||||
/**
|
||||
* 终端运行状态修改时,同时调整监测点的运行状态
|
||||
*/
|
||||
void updateLineRunFlag(String id, Integer status);
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.njcn.device.pq.pojo.dto.DeviceInfo;
|
||||
import com.njcn.device.pq.pojo.dto.NodeProcessDeviceTree;
|
||||
import com.njcn.device.pq.pojo.param.NodeDeviceParam;
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/11/5 8:51【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
|
||||
public interface NodeDeviceService {
|
||||
List<DeviceInfo> nodeDeviceList(NodeDeviceParam nodeDeviceParam);
|
||||
|
||||
void oneKeyDistribution(String nodeId);
|
||||
|
||||
NodeProcessDeviceTree nodeDeviceTree(String nodeId);
|
||||
|
||||
Boolean updateDeviceProcess(DeviceProcess deviceProcess);
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.param.PqDevTypeParam;
|
||||
import com.njcn.device.pq.pojo.po.PqDevType;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/11/5 11:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqDevTypeService extends IService<PqDevType>{
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 分页查询装置型号信息
|
||||
* @param param
|
||||
* @return: com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.njcn.device.pq.pojo.po.PqIcdPath>
|
||||
* @Author: wr
|
||||
* @Date: 2025/4/17 10:47
|
||||
*/
|
||||
Page<PqDevType> pageDevTypeList(BaseParam param);
|
||||
|
||||
/**
|
||||
* @Description: 新增装置型号
|
||||
* @param param
|
||||
* @return: java.lang.Boolean
|
||||
* @Author: wr
|
||||
* @Date: 2025/4/17 10:43
|
||||
*/
|
||||
Boolean addDevType(PqDevTypeParam param);
|
||||
|
||||
/**
|
||||
* @Description: 修改装置型号
|
||||
* @param param
|
||||
* @return: java.lang.Boolean
|
||||
* @Author: wr
|
||||
* @Date: 2025/4/17 10:43
|
||||
*/
|
||||
Boolean updateDevType(PqDevTypeParam.PqDevTypeUpdateParam param);
|
||||
|
||||
/**
|
||||
* 删除装置型号信息
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
Boolean delIDevType(List<String> ids);
|
||||
|
||||
void batchTerminal(MultipartFile file, HttpServletResponse response);
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.param.ProgramParam;
|
||||
import com.njcn.device.pq.pojo.po.Version;
|
||||
import com.njcn.device.pq.pojo.vo.VersionVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: chenchao
|
||||
* @date: 2022/05/19 15:53
|
||||
*/
|
||||
public interface ProgramVersionService extends IService<Version> {
|
||||
|
||||
/**
|
||||
* 根据终端类型分页获取程序版本管理信息
|
||||
* @return
|
||||
*/
|
||||
Page<VersionVO> getProgramVersion(ProgramParam programParam);
|
||||
/**
|
||||
* 新增程序版本管理信息
|
||||
* @return
|
||||
*/
|
||||
boolean addProgramVersion(String name, String protocol, LocalDate date, String devType, String remark, String versionType,String fileName, MultipartFile file);
|
||||
/**
|
||||
* 版本文件是否存在
|
||||
* @return
|
||||
*/
|
||||
boolean getProgramVersionById(String id);
|
||||
/**
|
||||
* 修改程序版本管理信息
|
||||
* @return
|
||||
*/
|
||||
boolean updateProgramVersion(String id, String name, String protocol, LocalDate date, String devType, String remark, String versionType,String fileName, MultipartFile file);
|
||||
/**
|
||||
* 修改程序版本状态
|
||||
* @return
|
||||
*/
|
||||
boolean updateVersionFlag(String id, Integer flag);
|
||||
/**
|
||||
* 删除版本
|
||||
* @return
|
||||
*/
|
||||
boolean delProgramVersion(String id);
|
||||
|
||||
/**
|
||||
* 终端版本升级,查看除了当前版本的其他版本信息
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<VersionVO> getVersion(ProgramParam.Version param);
|
||||
}
|
||||
@@ -1,298 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.bo.DeviceType;
|
||||
import com.njcn.device.pq.pojo.bo.excel.TerminalBaseExcel;
|
||||
import com.njcn.device.pq.pojo.dto.PreCommandDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PushResultDTO;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.vo.DevStatusNumVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineWiringDiagramVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalBaseVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/4
|
||||
*/
|
||||
public interface TerminalBaseService {
|
||||
|
||||
/**
|
||||
* 新增终端
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2021/7/6
|
||||
*/
|
||||
boolean addTerminal(AddTerminalParam addTerminalParam);
|
||||
|
||||
/**
|
||||
* 终端修改操作
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2021/7/20
|
||||
*/
|
||||
Boolean updateTerminal(UpdateTerminalParam updateTerminalParam);
|
||||
|
||||
/**
|
||||
* 终端查询操作
|
||||
* @param id 设备id
|
||||
* @author cdf
|
||||
* @date 2021/7/19
|
||||
*/
|
||||
TerminalVO queryTerminal(String id,Integer level);
|
||||
|
||||
/**
|
||||
* 终端查询操作
|
||||
* @param devName 设备名称
|
||||
* @author cdf
|
||||
* @date 2021/7/19
|
||||
*/
|
||||
Line queryTerminalByName(String devName);
|
||||
|
||||
/**
|
||||
* 终端删除操作
|
||||
* @param id 设备id
|
||||
* @author cdf
|
||||
* @date 2021/7/21
|
||||
*/
|
||||
Boolean delTerminal(String id);
|
||||
|
||||
/**
|
||||
* 根据变电站id,获取所有变电站
|
||||
*
|
||||
* @param substationIds 监测点id
|
||||
* @return 变电站信息
|
||||
*/
|
||||
List<Line> getSubstationByIds(List<String> substationIds,List<String> scale);
|
||||
|
||||
/**
|
||||
* 根据监测点id,获取所有监测点
|
||||
*
|
||||
* @param lineIds 监测点id
|
||||
* @return 监测点数据
|
||||
*/
|
||||
List<Line> getLineById(List<String> lineIds);
|
||||
|
||||
/**
|
||||
* 根据监测点id,获取所有监测点
|
||||
*
|
||||
* @param lineIds 监测点id
|
||||
* @param deviceInfoParam 监测点查询条件
|
||||
* @return 监测点数据
|
||||
*/
|
||||
List<Line> getLineByCondition(List<String> lineIds, DeviceInfoParam deviceInfoParam);
|
||||
|
||||
/**
|
||||
* 根据终端id,获取所有对应终端
|
||||
*
|
||||
* @param devIds 终端id
|
||||
* @param deviceType 终端条件筛选
|
||||
* @return 终端数据
|
||||
*/
|
||||
List<Line> getDeviceById(List<String> devIds, DeviceType deviceType);
|
||||
|
||||
/**
|
||||
* 根据终端id,获取所有对应终端
|
||||
*
|
||||
* @param devIds 终端id
|
||||
* @param deviceType 终端条件筛选
|
||||
* @param comFlag 是否中断标志
|
||||
* @return 终端数据
|
||||
*/
|
||||
List<TerminalBaseVO> getDeviceByIdOnOrOff(List<String> devIds, DeviceType deviceType, Integer comFlag);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 功能描述: 根据id查询变电站信息
|
||||
*
|
||||
* @param list
|
||||
* @return java.util.List<com.njcn.device.pq.pojo.po.Line>
|
||||
* @author xy
|
||||
* @date 2022/2/21 18:47
|
||||
*/
|
||||
List<Line> getSubstationById(List<String> list);
|
||||
|
||||
|
||||
/**
|
||||
* 查询终端信息
|
||||
*
|
||||
* @param devIds 终端索引
|
||||
* @param deviceType 终端筛选条件
|
||||
* @param manufacturer 终端厂家
|
||||
*/
|
||||
List<Line> getDeviceByCondition(List<String> devIds, DeviceType deviceType, List<SimpleDTO> manufacturer);
|
||||
|
||||
/**
|
||||
* 查询母线信息
|
||||
*
|
||||
* @param voltageIds 母线索引
|
||||
* @param scale 电压等级
|
||||
*/
|
||||
List<Line> getVoltageByCondition(List<String> voltageIds, List<SimpleDTO> scale);
|
||||
|
||||
/**
|
||||
* 查询变电站信息
|
||||
*
|
||||
* @param subIds 变电站索引
|
||||
* @param scale 电压等级
|
||||
*/
|
||||
List<Line> getSubByCondition(List<String> subIds, List<SimpleDTO> scale);
|
||||
|
||||
/**
|
||||
* 根据指定电压等级查询母线id
|
||||
*
|
||||
* @param voltageIds 母线id
|
||||
* @param scale 电压等级
|
||||
*/
|
||||
List<String> getVoltageIdByScale(List<String> voltageIds, String scale);
|
||||
|
||||
/**
|
||||
* 根据指定电压等级查询母线id
|
||||
* @param subIds
|
||||
* @param scale
|
||||
* @return: java.util.List<java.lang.String>
|
||||
* @Author: wr
|
||||
* @Date: 2024/10/12 15:58
|
||||
*/
|
||||
List<String> getSubIdByScale(List<String> subIds, String scale);
|
||||
|
||||
/**
|
||||
* 根据干扰源获取对应的监测点id
|
||||
*
|
||||
* @param lineIds 监测点id
|
||||
* @param loadType 干扰源类型
|
||||
*/
|
||||
List<String> getLineIdByLoadType(List<String> lineIds, String loadType);
|
||||
|
||||
/**
|
||||
* 根据终端厂家获取对应的终端id
|
||||
*
|
||||
* @param deviceIds 终端id
|
||||
* @param manufacturer 终端厂家
|
||||
*/
|
||||
List<String> getDeviceIdByManufacturer(List<String> deviceIds, String manufacturer);
|
||||
/**
|
||||
* 根据监测点性质获取监测信息
|
||||
*
|
||||
* @param lineIds 监测点id
|
||||
* @param manufacturer 监测点性质
|
||||
*/
|
||||
List<String> getDeviceIdByPowerFlag(List<String> lineIds, Integer manufacturer);
|
||||
|
||||
|
||||
/**
|
||||
* 根据监测点集合查询基础信息
|
||||
* @param lineIndex 监测点结合
|
||||
* @return 基础信息
|
||||
*/
|
||||
List<BaseLineInfo> getBaseLineInfo(List<String> lineIndex);
|
||||
|
||||
/**
|
||||
* 将原始数据导入新库
|
||||
* @param file 原始数据信息
|
||||
*/
|
||||
String importOracleTerminalData(MultipartFile file, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 导出台账
|
||||
* @author cdf
|
||||
* @date 2022/5/17
|
||||
*/
|
||||
List<TerminalBaseExcel> exportTerminalBase();
|
||||
|
||||
/**
|
||||
* 导出台账模板
|
||||
* @author cdf
|
||||
* @date 2022/5/17
|
||||
*/
|
||||
void downTerminalTemplate(HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 导出台账生成的excel(离线装置)
|
||||
* @author zbj
|
||||
* @date 2023/4/26
|
||||
*/
|
||||
void downTerminalAutonomeTemplate(HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 将台账数据导入终端相关表
|
||||
* @param file 原始数据信息
|
||||
*/
|
||||
void importTerminalBase(MultipartFile file, HttpServletResponse response);
|
||||
|
||||
|
||||
Integer updatePqOverLimit();
|
||||
|
||||
/**
|
||||
* 监测点主接线图上传
|
||||
* @author cdf
|
||||
* @date 2023/6/15
|
||||
*/
|
||||
Boolean wiringDiagramUpload(MultipartFile[] files,String lineId);
|
||||
|
||||
|
||||
/**
|
||||
* 监测点主接线图展示
|
||||
* @author cdf
|
||||
* @date 2023/6/15
|
||||
*/
|
||||
List<LineWiringDiagramVO> wiringDiagramShow(String lineId);
|
||||
|
||||
/**
|
||||
* 监测点主接线图展示
|
||||
* @author cdf
|
||||
* @date 2023/6/15
|
||||
*/
|
||||
boolean wiringDiagramChange(MultipartFile file,String lineId,String wiringDiagramName);
|
||||
|
||||
/**
|
||||
* 监测点主接线图删除
|
||||
* @author cdf
|
||||
* @date 2023/6/15
|
||||
*/
|
||||
boolean wiringDiagramDel(String lineId,String wiringDiagramName);
|
||||
/**
|
||||
* @Description: 临时表数据同步到台账表
|
||||
* @Param:
|
||||
* @return: void
|
||||
* @Author: clam
|
||||
* @Date: 2024/5/29
|
||||
*/
|
||||
String terminalSync(SyncTerminalParam syncTerminalParam);
|
||||
|
||||
/**
|
||||
* 监测点和装置同步成运行状态
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
Boolean terminalSyncRunFly(String lineId);
|
||||
|
||||
/**
|
||||
* 监测数据删除
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
Boolean terminalSyncDeleteFly(String lineId);
|
||||
|
||||
//通知前置重启设备
|
||||
// void askRestartProcess(Integer processNo,String processType,String deviceRebootType);
|
||||
|
||||
// void askRestartDevice(List<String> devId, String deviceRebootType,Integer processNo);
|
||||
|
||||
List<PreCommandDTO> ledgerChangePush();
|
||||
|
||||
PushResultDTO getPushResult(String guid);
|
||||
|
||||
|
||||
void askRestartProcess( RestartParam restartParam);
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.PqsParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalMainQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalParam;
|
||||
import com.njcn.device.pq.pojo.vo.LineFlowMealDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalDaliyFlowVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalMaintainVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
public interface TerminalMaintainService {
|
||||
|
||||
/**
|
||||
* 查询终端运维主界面列表
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
List<TerminalMaintainVO> getTerminalMainList(TerminalMainQueryParam terminalMainQueryParam);
|
||||
|
||||
|
||||
/**
|
||||
* 0,终端状态管理,1.流量管理,2.流量策略管理主界面
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
List<TerminalMaintainVO> getManageList(List<String> ids,Integer type);
|
||||
|
||||
/**
|
||||
* 修改终端参数
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
boolean updateRunFlagManage(TerminalParam terminalParam);
|
||||
|
||||
/**
|
||||
* 修改终端流量
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
boolean updateFlowMeal(TerminalParam terminalParam);
|
||||
|
||||
/**
|
||||
* 修改终端流量策略
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
boolean updateFlowStrategy(TerminalParam terminalParam);
|
||||
|
||||
|
||||
List<TerminalDaliyFlowVO> getFlowManageDetail(TerminalMainQueryParam param);
|
||||
|
||||
List<LineFlowMealDetailVO> getMonthFlow(PqsParam deviceInfoParam);
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.njcn.device.pq.pojo.param.TerminalMainQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.DevVersion;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalVersionVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
* 终端程序版本管理
|
||||
* @author cdf
|
||||
* @date 2022/5/12
|
||||
*/
|
||||
public interface TerminalVersionService {
|
||||
|
||||
/**
|
||||
* 查询终端版本主界面列表
|
||||
* @author cdf
|
||||
* @date 2022/5/11
|
||||
*/
|
||||
List<TerminalVersionVO> getTerminalVersionList(TerminalMainQueryParam terminalMainQueryParam);
|
||||
|
||||
|
||||
/**
|
||||
* 查询装置升级日志
|
||||
* @author cdf
|
||||
* @date 2022/5/17
|
||||
* @return
|
||||
*/
|
||||
List<DevVersion> getTerminalUpLog(String id);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 查询终端版本信息
|
||||
* @param ids
|
||||
* @return: java.util.List<com.njcn.device.pq.pojo.vo.TerminalVersionVO.Version>
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/16 15:07
|
||||
*/
|
||||
List<TerminalVersionVO.Version> getVersionList(List<String> ids);
|
||||
}
|
||||
@@ -10,11 +10,11 @@ import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.pq.enums.RunFlagEnum;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
|
||||
@@ -3,8 +3,7 @@ package com.njcn.device.pq.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.device.pq.mapper.OnlineRateMapper;
|
||||
import com.njcn.device.pq.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.param.PulicTimeParam;
|
||||
@@ -12,23 +11,17 @@ import com.njcn.device.pq.pojo.param.PulicTimeStatisParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.CommunicateService;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.device.pq.utils.PublicDateUtil;
|
||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.web.enums.DateFlagEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,13 +4,9 @@ package com.njcn.device.pq.service.impl;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.*;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.C;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.dataProcess.api.DataLimitRateDetailFeignClient;
|
||||
@@ -21,31 +17,23 @@ import com.njcn.dataProcess.enums.DataCleanEnum;
|
||||
import com.njcn.dataProcess.param.DataCleanParam;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitTargetDto;
|
||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.pq.constant.Param;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.DataVerifyMapper;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.PqDataVerifyBakMapper;
|
||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||
import com.njcn.device.pq.pojo.po.DataVerify;
|
||||
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.*;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.IDataVerifyService;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
||||
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
@@ -58,16 +46,12 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.DateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,234 +0,0 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.dto.TerminalGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.mapper.DeptLineMapper;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import com.njcn.system.enums.DicTreeEnum;
|
||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.web.pojo.param.DeptLineParam;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/12 17:32
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> implements DeptLineService {
|
||||
|
||||
private final DeptLineMapper deptLineMapper;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final LineMapper lineMapper;
|
||||
private final DictTreeFeignClient dictTreeFeignClient;
|
||||
private final LineDetailMapper detailMapper;
|
||||
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deptBindLine(DeptLineParam deptLineParam) {
|
||||
//先解绑,再进行绑定
|
||||
QueryWrapper<DeptLine> deptLineQueryWrapper = new QueryWrapper<>();
|
||||
deptLineQueryWrapper.eq("pq_dept_line.id", deptLineParam.getId());
|
||||
this.baseMapper.delete(deptLineQueryWrapper);
|
||||
List<DeptLine> deptLines = deptLineParam.getIds().stream().map(id -> {
|
||||
DeptLine deptLine = new DeptLine();
|
||||
deptLine.setId(deptLineParam.getId());
|
||||
deptLine.setLineId(id);
|
||||
return deptLine;
|
||||
}).collect(Collectors.toList());
|
||||
List<String> ids = deptLineParam.getIds();
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
List<LineDetail> list = detailMapper.selectList(new LambdaQueryWrapper<LineDetail>()
|
||||
.in(LineDetail::getId, ids)
|
||||
.isNull(LineDetail::getActualArea)
|
||||
);
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
Dept data = deptFeignClient.getDeptById(deptLineParam.getId()).getData();
|
||||
List<String> lineIds = list.stream().map(LineDetail::getId).collect(Collectors.toList());
|
||||
detailMapper.update(null, new LambdaUpdateWrapper<LineDetail>()
|
||||
.set(LineDetail::getActualArea, data.getArea())
|
||||
.in(LineDetail::getId, lineIds));
|
||||
}
|
||||
}
|
||||
this.saveBatch(deptLines);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deptDeleteBindLine(DeptLineParam deptLineParam) {
|
||||
for (int i = 0; i < deptLineParam.getIds().size(); i++) {
|
||||
QueryWrapper<DeptLine> deptLineQueryWrapper = new QueryWrapper<>();
|
||||
deptLineQueryWrapper.eq("pq_dept_line.id", deptLineParam.getId());
|
||||
deptLineQueryWrapper.eq("pq_dept_line.Line_Id", deptLineParam.getIds().get(i));
|
||||
this.baseMapper.delete(deptLineQueryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeptLine> selectDeptBindLines(List<String> ids) {
|
||||
return this.lambdaQuery().in(DeptLine::getId, ids).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLineByDeptIds(List<String> ids,String manufacturer, List<Integer> runFlag, List<Integer> dataType, String objType) {
|
||||
return this.baseMapper.getLineIdByDeptIds(ids, manufacturer ,runFlag, dataType, objType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int removeBind(String id) {
|
||||
QueryWrapper<DeptLine> deptLineQueryWrapper = new QueryWrapper<>();
|
||||
deptLineQueryWrapper.eq("pq_dept_line.id", id);
|
||||
return this.baseMapper.delete(deptLineQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLineByDeptId(String id) {
|
||||
return this.lambdaQuery().in(DeptLine::getId, id).list().stream().map(DeptLine::getLineId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLineByDeptIdAndNewStation(String id) {
|
||||
List<String> dictTree = new ArrayList<>();
|
||||
DictTreeVO powerStation = dictTreeFeignClient.queryByCode(DicTreeEnum.Power_Station.getCode()).getData();
|
||||
if (ObjectUtil.isNotNull(powerStation)) {
|
||||
dictTree.add(powerStation.getId());
|
||||
}
|
||||
DictTreeVO windFarms = dictTreeFeignClient.queryByCode(DicTreeEnum.Wind_Farms.getCode()).getData();
|
||||
if (ObjectUtil.isNotNull(windFarms)) {
|
||||
dictTree.add(windFarms.getId());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(dictTree)) {
|
||||
List<String> ids = new ArrayList<>();
|
||||
if (StrUtil.isNotBlank(id)) {
|
||||
ids.addAll(deptFeignClient.getDepSonIdtByDeptId(id).getData());
|
||||
}
|
||||
return this.baseMapper.getLineByDeptIdAndNewStation(ids, dictTree);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLineNodeByDeptId(String id) {
|
||||
List<DeptDTO> deptInfos = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptInfos.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList());
|
||||
List<DeptLine> userLine = this.list(new LambdaQueryWrapper<DeptLine>()
|
||||
.in(DeptLine::getId, deptIds)
|
||||
);
|
||||
return userLine.stream().map(DeptLine::getLineId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param devDataType
|
||||
* @Description: 获取部门和监测点的关系(分稳态暂态)
|
||||
* @Param: [devDataType]
|
||||
* @return: java.util.Map<java.lang.String, java.util.List < java.lang.String>>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/19
|
||||
*/
|
||||
@Override
|
||||
public Map<String, List<String>> getLineByDeptRelation(Integer devDataType) {
|
||||
List<DeptLine> deptLines = deptLineMapper.getLineByDeptRelation(devDataType);
|
||||
return deptLines.stream().collect(Collectors.groupingBy(DeptLine::getId, Collectors.mapping(DeptLine::getLineId, Collectors.toList())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<LineDevGetDTO>> lineDevGet(List<Integer> devDataType, Integer type, Integer lineRunFlag) {
|
||||
List<LineDevGetDTO> deptLines = deptLineMapper.lineDevGet(devDataType, type, lineRunFlag);
|
||||
return deptLines.stream().collect(Collectors.groupingBy(LineDevGetDTO::getUnitId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<TerminalGetBase>> orgSubStationGet(List<Integer> devDataType) {
|
||||
List<TerminalGetBase> deptLines = deptLineMapper.orgSubStationGet(devDataType);
|
||||
return deptLines.stream().collect(Collectors.groupingBy(TerminalGetBase::getUnitId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType, Integer powerFlag, Integer lineRunFlag) {
|
||||
return deptLineMapper.orgSubStationInfoGet(devType, powerFlag, lineRunFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SubGetBase> getSubStationList(SubstationParam substationParam) {
|
||||
return deptLineMapper.selectSubStationList(substationParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeptLine getLineByLineIds(String ids) {
|
||||
return this.getOne(new LambdaQueryWrapper<DeptLine>()
|
||||
.eq(DeptLine::getLineId, ids)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeptLine> getDeptListByLineId(String id) {
|
||||
return this.list(new LambdaQueryWrapper<DeptLine>()
|
||||
.eq(DeptLine::getLineId, id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LineDeviceStateVO> getLineDetailByDeptId(String id) {
|
||||
List<String> lineByDeptId = this.getLineNodeByDeptId(id);
|
||||
List<LineDeviceStateVO> lineDeviceStateVO = lineMapper.getLineDeviceStateVO(lineByDeptId);
|
||||
return lineDeviceStateVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DevDetailVO> getLineDetailByDeptIdAndDevIds(String orgId,Integer powerFlag, List<String> devIds) {
|
||||
List<String> lineByDeptId = this.getLineNodeByDeptId(orgId);
|
||||
List<DevDetailVO> lineDeviceByDevIds = lineMapper.getLineDeviceByDevIds(powerFlag,lineByDeptId, devIds);
|
||||
if(CollUtil.isNotEmpty(lineDeviceByDevIds)){
|
||||
List<String> objIds = lineDeviceByDevIds.stream()
|
||||
.filter(x -> StrUtil.isNotBlank(x.getObjId()))
|
||||
.map(DevDetailVO::getObjId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(objIds)){
|
||||
List<NewUserReportVO> data = userLedgerFeignClient.getUserReportByIds(objIds).getData();
|
||||
Map<String, String> userMap = data.stream().collect(Collectors.toMap(NewUserReportVO::getId, NewUserReportVO::getProjectName));
|
||||
for (DevDetailVO lineDeviceByDevId : lineDeviceByDevIds) {
|
||||
if(StrUtil.isNotBlank(lineDeviceByDevId.getObjId())){
|
||||
if(userMap.containsKey(lineDeviceByDevId.getObjId())){
|
||||
lineDeviceByDevId.setSubName(userMap.get(lineDeviceByDevId.getObjId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return lineDeviceByDevIds;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.pq.mapper.DevFuctionMapper;
|
||||
import com.njcn.device.pq.pojo.po.DevFuction;
|
||||
import com.njcn.device.pq.service.DevFuctionService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zbj
|
||||
* @date 2022/05/24
|
||||
*/
|
||||
@Service
|
||||
public class DevFuctionServiceImpl extends ServiceImpl<DevFuctionMapper, DevFuction> implements DevFuctionService {
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.pq.mapper.DevMealMapper;
|
||||
import com.njcn.device.pq.pojo.po.DevMeal;
|
||||
import com.njcn.device.pq.service.IDevMealService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
@Service
|
||||
public class DevMealServiceImpl extends ServiceImpl<DevMealMapper, DevMeal> implements IDevMealService {
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.pq.mapper.DevStrategyMapper;
|
||||
import com.njcn.device.pq.pojo.po.DevStrategy;
|
||||
import com.njcn.device.pq.service.IDevStrategyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
@Service
|
||||
public class DevStrategyServiceImpl extends ServiceImpl<DevStrategyMapper, DevStrategy> implements IDevStrategyService {
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.pq.mapper.DeviceBakMapper;
|
||||
import com.njcn.device.biz.pojo.po.DeviceBak;
|
||||
import com.njcn.device.pq.service.DeviceBakService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author denghuajun
|
||||
* @date 2022/2/23
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceBakServiceImpl extends ServiceImpl<DeviceBakMapper, DeviceBak> implements DeviceBakService {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.biz.pojo.po.DeviceBak;
|
||||
import com.njcn.device.pq.mapper.DeviceBakMapper;
|
||||
import com.njcn.device.pq.mapper.DeviceProcessMapper;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
import com.njcn.device.pq.service.DeviceProcessService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/01/22 下午 1:59【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceProcessServiceImpl extends ServiceImpl<DeviceProcessMapper, DeviceProcess> implements DeviceProcessService {
|
||||
}
|
||||
@@ -9,7 +9,9 @@ import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.njcn.device.pq.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DevRunEvaluateParam;
|
||||
@@ -23,11 +25,10 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.enums.PowerFlagEnum;
|
||||
import com.njcn.device.pq.enums.RunFlagEnum;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.pojo.dto.MonitorInfoDTO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalEvaluateAreaVO;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
import com.njcn.device.pq.service.DeviceRunEvaluateService;
|
||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.harmonic.api.RStatLimitRateDClient;
|
||||
import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
|
||||
@@ -1,428 +0,0 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.biz.enums.RunFlagEnum;
|
||||
import com.njcn.device.pq.mapper.DevVersionMapper;
|
||||
import com.njcn.device.pq.mapper.DeviceMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.pojo.advanced.*;
|
||||
import com.njcn.device.pq.pojo.param.ConstantValueParam;
|
||||
import com.njcn.device.pq.pojo.po.DevVersion;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.Version;
|
||||
import com.njcn.device.pq.pojo.vo.DevStatusNumVO;
|
||||
import com.njcn.device.pq.pojo.vo.DeviceIpRVO;
|
||||
import com.njcn.device.pq.service.IDeviceService;
|
||||
import com.njcn.device.pq.service.ProgramVersionService;
|
||||
import com.njcn.device.pq.utils.SocketClient;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements IDeviceService {
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
private final SocketClient socketClient;
|
||||
private final DevVersionMapper devVersionMapper;
|
||||
private final ProgramVersionService programVersionService;
|
||||
|
||||
@Value("${socket.port:60000}")
|
||||
private Integer socketPort;
|
||||
|
||||
@Override
|
||||
public String sentLine(ConstantValueParam.Constant param) {
|
||||
try {
|
||||
//获取根据监测点获取终端信息
|
||||
UpDevVO upDevVO = lineMapper.getDevInfo(param.getId());
|
||||
//查询前置ip
|
||||
String host = lineMapper.getNodeIp(upDevVO.getDevIndex(),0);
|
||||
//拼接属性
|
||||
ContValueRVO upParamVO = new ContValueRVO();
|
||||
ContValueVO valueVO = new ContValueVO();
|
||||
valueVO.setType(param.getType());
|
||||
valueVO.setLineid(param.getId());
|
||||
valueVO.setHander(param.getHander());
|
||||
JSONObject jsonStr = new JSONObject(valueVO);
|
||||
Integer len = jsonStr.toString().length();
|
||||
upParamVO.setLen(len.toString());
|
||||
upParamVO.setData(valueVO);
|
||||
JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
String str = jsonObject.toString();
|
||||
List<UpDevVO> devList = new ArrayList<>();
|
||||
devList.add(upDevVO);
|
||||
return socketClient.sentLine(param.getIp(), str, host, socketPort, "wr", devList);
|
||||
} catch (Exception e) {
|
||||
return "获取定值失败";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String sentLineData(ConstantValueParam.ValueData param) {
|
||||
try {
|
||||
//获取根据监测点获取终端信息
|
||||
UpDevVO upDevVO = lineMapper.getDevInfo(param.getId());
|
||||
//查询前置ip
|
||||
String host = lineMapper.getNodeIp(upDevVO.getDevIndex(),0);
|
||||
ContUpdateValueRVO upParamVO = new ContUpdateValueRVO();
|
||||
ContUpdateValueVO valueVO = new ContUpdateValueVO();
|
||||
valueVO.setType(param.getType());
|
||||
valueVO.setLineid(param.getId());
|
||||
valueVO.setHander(param.getHander());
|
||||
float[] intArr;
|
||||
if (StrUtil.isBlank(param.getInterValue())) {
|
||||
intArr = new float[0];
|
||||
} else {
|
||||
String[] valueArr = param.getInterValue().split(",");
|
||||
intArr = new float[valueArr.length];
|
||||
for (int i = 0; i < valueArr.length; i++) {
|
||||
intArr[i] = Float.parseFloat(valueArr[i]);
|
||||
}
|
||||
}
|
||||
valueVO.setValue(intArr);
|
||||
JSONObject jsonStr = new JSONObject(valueVO);
|
||||
Integer len = jsonStr.toString().length();
|
||||
upParamVO.setLen(len.toString());
|
||||
upParamVO.setData(valueVO);
|
||||
JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
String str = jsonObject.toString();
|
||||
List<UpDevVO> devList = new ArrayList<>();
|
||||
devList.add(upDevVO);
|
||||
return socketClient.sentLine(param.getIp(), str, host, socketPort, "wr", devList);
|
||||
} catch (Exception e) {
|
||||
return "运行失败";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String sentDev(ConstantValueParam.Constant param) {
|
||||
try {
|
||||
Line line = lineMapper.selectById(param.getId());
|
||||
UpDevVO upDevVO = new UpDevVO();
|
||||
upDevVO.setDevIndex(line.getId());
|
||||
upDevVO.setDevName(line.getName());
|
||||
String host = lineMapper.getNodeIp(line.getId(),1);
|
||||
ContValueRVO upParamVO = new ContValueRVO();
|
||||
ContValueVO valueVO = new ContValueVO();
|
||||
valueVO.setType(param.getType());
|
||||
valueVO.setIndex(param.getId());
|
||||
valueVO.setHander(param.getHander());
|
||||
JSONObject jsonStr = new JSONObject(valueVO);
|
||||
Integer len = jsonStr.toString().length();
|
||||
upParamVO.setLen(len.toString());
|
||||
upParamVO.setData(valueVO);
|
||||
JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
String str = jsonObject.toString();
|
||||
List<UpDevVO> devList = new ArrayList<>();
|
||||
devList.add(upDevVO);
|
||||
return socketClient.sentDZDev(param.getIp(), str, host, socketPort, "wr", devList);
|
||||
} catch (Exception e) {
|
||||
return "获取定值失败";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String sentDevData(ConstantValueParam.ValueData param) {
|
||||
try {
|
||||
Line line = lineMapper.selectById(param.getId());
|
||||
UpDevVO upDevVO = new UpDevVO();
|
||||
upDevVO.setDevIndex(line.getId());
|
||||
upDevVO.setDevName(line.getName());
|
||||
String host = lineMapper.getNodeIp(line.getId(),1);
|
||||
ContUpdateDevValueRVO upParamVO = new ContUpdateDevValueRVO();
|
||||
ContUpdateDevValueVO valueVO = new ContUpdateDevValueVO();
|
||||
valueVO.setType(param.getType());
|
||||
valueVO.setIndex(line.getId());
|
||||
valueVO.setHander(String.valueOf(param.getHander()));
|
||||
int[] intArr;
|
||||
if (StrUtil.isBlank(param.getInterValue())) {
|
||||
intArr = new int[0];
|
||||
} else {
|
||||
String[] valueArr = param.getInterValue().split(",");
|
||||
intArr = new int[valueArr.length];
|
||||
for (int i = 0; i < valueArr.length; i++) {
|
||||
intArr[i] = Integer.parseInt(valueArr[i]);
|
||||
}
|
||||
}
|
||||
valueVO.setInterValue(intArr);
|
||||
JSONObject jsonStr = new JSONObject(valueVO);
|
||||
Integer len = jsonStr.toString().length();
|
||||
upParamVO.setLen(len.toString());
|
||||
upParamVO.setData(valueVO);
|
||||
JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
String str = jsonObject.toString();
|
||||
|
||||
List<UpDevVO> devList = new ArrayList<>();
|
||||
devList.add(upDevVO);
|
||||
return socketClient.sentDZDev(param.getIp(), str, host, socketPort, "wr", devList);
|
||||
} catch (Exception e) {
|
||||
return "运行失败";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String socketDevProperty(String devID) {
|
||||
String host = lineMapper.getNodeIp(devID,1);
|
||||
if(StrUtil.isBlank(host)){
|
||||
return "前置ip获取失败";
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("type","190");
|
||||
map.put("index",devID);
|
||||
map.put("hander","1");
|
||||
jsonObject.set("data", map);
|
||||
Integer len = jsonObject.get("data").toString().length();
|
||||
jsonObject.set("len", len.toString());
|
||||
socketClient.showProperty(jsonObject.toString(),host,socketPort,RequestUtil.getLoginName());
|
||||
return "终端性能获取成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String socketDevPropertyClose(String devID) {
|
||||
String host = lineMapper.getNodeIp(devID,1);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("type", "190");
|
||||
map.put("index", devID);
|
||||
map.put("hander", "0");
|
||||
jsonObject.set("data", map);
|
||||
Integer len = jsonObject.get("data").toString().length();
|
||||
jsonObject.set("len", len.toString());
|
||||
socketClient.closeDevSocket(jsonObject.toString(),host,socketPort,RequestUtil.getLoginName());
|
||||
return "执行成功";
|
||||
}catch (Exception e){
|
||||
return "执行失败";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String realTimeData(String lineIndex) {
|
||||
//查询前置ip
|
||||
String host = lineMapper.getNodeIp(lineIndex,0);
|
||||
if(StrUtil.isBlank(host)){
|
||||
return "设备前置机服务器配置异常,请联系管理员";
|
||||
}else {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("LineId", lineIndex);
|
||||
jsonObject.set("type", 0);
|
||||
cn.hutool.json.JSONObject jsonObject1 = new cn.hutool.json.JSONObject();
|
||||
jsonObject1.set("len",0);
|
||||
jsonObject1.set("data",jsonObject);
|
||||
socketClient.realTimeData(jsonObject1.toString(),host,socketPort,lineIndex);
|
||||
}
|
||||
return "请求成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String heartRealTimeData(String lineIndex) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("LineId", lineIndex);
|
||||
jsonObject.set("type", 1);
|
||||
cn.hutool.json.JSONObject jsonObject1 = new cn.hutool.json.JSONObject();
|
||||
jsonObject1.set("len", 0);
|
||||
jsonObject1.set("data", jsonObject);
|
||||
String host = lineMapper.getNodeIp(lineIndex,0);
|
||||
socketClient.heartRealData(jsonObject1.toString(),host,socketPort,lineIndex);
|
||||
return "实时数据心跳请求成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String closeRealTimeData(String lineIndex) {
|
||||
socketClient.closeRealData(lineIndex);
|
||||
return "关闭实时数据请求成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDevUpgrades(List<String> list, String edIndex) {
|
||||
List<DeviceIpRVO> resTemlist = new ArrayList<>();
|
||||
|
||||
List<DeviceIpRVO> relist = lineMapper.getDevicesIp(list);
|
||||
//判断设备版本号
|
||||
Integer isExit = devVersionMapper.selectCount(new LambdaQueryWrapper<DevVersion>()
|
||||
.eq(DevVersion::getVersionId,edIndex)
|
||||
.in(DevVersion::getLineId,list)
|
||||
.eq(DevVersion::getState,1)
|
||||
);
|
||||
if (isExit > 0) {
|
||||
return "请勿选择相同版本号升级";
|
||||
}
|
||||
if (!CollectionUtil.isEmpty(relist)) {
|
||||
Version version = programVersionService.getById(edIndex);
|
||||
String series = version.getDevType();
|
||||
//判断设备是否存在相同型号
|
||||
for (DeviceIpRVO deviceIpRVO : relist) {
|
||||
if (!series.equals(deviceIpRVO.getDevSeries())) {
|
||||
return "当前装置版本系列与目标版本系列不相同";
|
||||
}
|
||||
}
|
||||
|
||||
//判断是否断开
|
||||
if (relist.stream().filter(w -> w.getComFlag() == 0).findAny().isPresent()) {
|
||||
return "存在通讯中断设备";
|
||||
}
|
||||
|
||||
|
||||
Set<String> set = new HashSet<>();
|
||||
for (DeviceIpRVO d : relist) {
|
||||
set.add(d.getIp());
|
||||
}
|
||||
Iterator<String> iterator = set.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
List<UpDevVO> devIndex = new ArrayList<>();
|
||||
DeviceIpRVO deviceIpRVO = new DeviceIpRVO();
|
||||
String ip = iterator.next();
|
||||
for (DeviceIpRVO d : relist) {
|
||||
UpDevVO upDevVO = new UpDevVO();
|
||||
upDevVO.setDevIndex(d.getDevIndex());
|
||||
upDevVO.setDevName(d.getDevName());
|
||||
if (ip.equals(d.getIp())) {
|
||||
devIndex.add(upDevVO);
|
||||
}
|
||||
}
|
||||
deviceIpRVO.setIp(ip);
|
||||
deviceIpRVO.setDevlist(devIndex);
|
||||
resTemlist.add(deviceIpRVO);
|
||||
}
|
||||
} else {
|
||||
return "存在未知错误";
|
||||
}
|
||||
for (DeviceIpRVO deviceIpRVO : resTemlist) {
|
||||
String ip = deviceIpRVO.getIp();
|
||||
List<UpDevVO> devlist = deviceIpRVO.getDevlist();
|
||||
UpDataVO upDataVO = new UpDataVO();
|
||||
UpParamVO upParamVO = new UpParamVO();
|
||||
upDataVO.setTerminal(devlist);
|
||||
upDataVO.setType("180");
|
||||
upDataVO.setEdIndex(edIndex);
|
||||
upDataVO.setUserIndex(RequestUtil.getUserIndex());
|
||||
JSONObject jsonstr = new JSONObject(upDataVO);
|
||||
Integer len = jsonstr.toString().length();
|
||||
upParamVO.setData(upDataVO);
|
||||
upParamVO.setLen(len.toString());
|
||||
JSONObject jsonObject = new JSONObject(upParamVO);
|
||||
String str = jsonObject.toString();
|
||||
socketClient.sentUpgrades(str, ip, socketPort, RequestUtil.getLoginName(), edIndex, devlist);
|
||||
}
|
||||
return "运行成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String closeUpgrades(List<String> devList) {
|
||||
List<DeviceIpRVO> relist = lineMapper.getDevicesIp(devList);
|
||||
if(CollectionUtil.isEmpty(relist)){
|
||||
return "前置机为空";
|
||||
}else {
|
||||
List<String> nodeIp = relist.stream().map(DeviceIpRVO::getIp).distinct().collect(Collectors.toList());
|
||||
for(String ip: nodeIp){
|
||||
List<DeviceIpRVO> devLl= relist.stream().filter(item->item.getIp().equals(ip)).collect(Collectors.toList());
|
||||
if(CollectionUtil.isEmpty(devLl)){
|
||||
return "出错啦";
|
||||
}
|
||||
|
||||
List<JSONObject> list = new ArrayList<>();
|
||||
for(DeviceIpRVO devRVO:devLl){
|
||||
JSONObject dev = new JSONObject();
|
||||
dev.put("devIndex",devRVO.getDevIndex());
|
||||
dev.put("devName",devRVO.getDevName());
|
||||
list.add(dev);
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("terminal", list);
|
||||
jsonObject.set("type", 182);
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
jsonObject1.set("len", 0);
|
||||
jsonObject1.set("data", jsonObject);
|
||||
socketClient.cancelUp(jsonObject1.toString(),ip,socketPort,devLl.size());
|
||||
}
|
||||
}
|
||||
return "取消命令发送成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String restartDev(List<String> devList) {
|
||||
List<DeviceIpRVO> relist = lineMapper.getDevicesIp(devList);
|
||||
if(CollUtil.isEmpty(relist)){
|
||||
return "前置机为空";
|
||||
}else {
|
||||
List<String> nodeIp = relist.stream().map(DeviceIpRVO::getIp).distinct().collect(Collectors.toList());
|
||||
for(String ip: nodeIp){
|
||||
List<DeviceIpRVO> devLl = relist.stream().filter(item->item.getIp().equals(ip)).collect(Collectors.toList());
|
||||
if(CollUtil.isEmpty(devLl)){
|
||||
return "出错啦";
|
||||
}
|
||||
|
||||
List<JSONObject> list = new ArrayList<>();
|
||||
List<String> devIn = new ArrayList<>();
|
||||
for(DeviceIpRVO devRVO:devLl){
|
||||
devIn.add(devRVO.getDevIndex());
|
||||
JSONObject dev = new JSONObject();
|
||||
dev.set("devIndex", devRVO.getDevIndex());
|
||||
dev.set("devName", devRVO.getDevName());
|
||||
list.add(dev);
|
||||
}
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("terminal", list);
|
||||
jsonObject.set("type", 181);
|
||||
jsonObject.set("userIndex", RequestUtil.getUserIndex());
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
jsonObject1.set("len", 0);
|
||||
jsonObject1.set("data", jsonObject);
|
||||
|
||||
socketClient.restartDev(jsonObject1.toString(),ip,socketPort,devIn);
|
||||
}
|
||||
}
|
||||
return "命令发送成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDevCheckTime(String devId, String thisTimeCheck, String nextTimeCheck) {
|
||||
LambdaUpdateWrapper<Device> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(Device::getId, devId)
|
||||
.set(Device::getThisTimeCheck, thisTimeCheck)
|
||||
.set(Device::getNextTimeCheck, nextTimeCheck);
|
||||
this.update(updateWrapper);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DevStatusNumVO statisticDevNum(List<String> devIds) {
|
||||
DevStatusNumVO devStatusNumVO = new DevStatusNumVO();
|
||||
List<Device> deviceList = this.baseMapper.selectList(new LambdaQueryWrapper<Device>().in(Device::getId,devIds));
|
||||
Map<Integer,Long> map = deviceList.stream().collect(Collectors.groupingBy(Device::getRunFlag,Collectors.counting()));
|
||||
devStatusNumVO.setRunNum(map.getOrDefault(RunFlagEnum.RUNNING.getStatus(),0L).intValue());
|
||||
devStatusNumVO.setCheckNum(map.getOrDefault(RunFlagEnum.CHECK.getStatus(),0L).intValue());
|
||||
devStatusNumVO.setStopRunNum(map.getOrDefault(RunFlagEnum.STOP.getStatus(),0L).intValue());
|
||||
devStatusNumVO.setQuiteNum(map.getOrDefault(RunFlagEnum.QUIT.getStatus(),0L).intValue());
|
||||
devStatusNumVO.setTestNum(map.getOrDefault(RunFlagEnum.TEST.getStatus(),0L).intValue());
|
||||
devStatusNumVO.setAllNum(deviceList.size());
|
||||
return devStatusNumVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,813 +0,0 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||
import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.enums.PowerFlagEnum;
|
||||
import com.njcn.device.pq.mapper.DeviceMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.TopMsgMapper;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.bo.DeviceType;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.DeptDeviceDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.DeptSubstationDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.ExceptionDeviceInfoVO;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
import com.njcn.device.pq.service.TerminalBaseService;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.enums.StatisticsEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 终端信息处理器,根据需求返回笼统的台账信息。
|
||||
* ii * 包括:类别名称、类别索引、监测点索引集合、终端索引集合、变电站索引集bb合、供电公司索引集合。
|
||||
* PS:若后期需要比如:省会、项目时再动态添加。
|
||||
*
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年02月11日 09:29
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class GeneralDeviceService {
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
private final DeptLineService deptLineService;
|
||||
|
||||
private final TerminalBaseService terminalBaseService;
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
private final DeviceMapper deviceMapper;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
private final TopMsgMapper topMsgMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门id、远程服务名、远程客户端类型,以部门的方式
|
||||
*
|
||||
* @param runFlag 终端状态
|
||||
* @param devModel 终端模型
|
||||
* @return 部门分类终端信息
|
||||
*/
|
||||
@Deprecated
|
||||
public List<GeneralDeviceDTO> getDeviceInfoAsDept(DeviceInfoParam deviceInfoParam, List<Integer> runFlag, List<Integer> devModel) {
|
||||
List<GeneralDeviceDTO> deviceInfos = new ArrayList<>();
|
||||
List<Integer> deptType = WebUtil.filterDeptType();
|
||||
//获取包括当前部门的后代所有部门信息
|
||||
List<DeptDTO> deptInfos = deptFeignClient.getDeptDescendantIndexes(deviceInfoParam.getDeptIndex(), deptType).getData();
|
||||
|
||||
DeviceType deviceType = new DeviceType();
|
||||
if (CollectionUtil.isEmpty(devModel)) {
|
||||
deviceType.setDevModel(null);
|
||||
} else {
|
||||
deviceType.setDevModel(devModel);
|
||||
}
|
||||
if (CollectionUtil.isEmpty(runFlag)) {
|
||||
deviceType.setRunFlag(null);
|
||||
} else {
|
||||
deviceType.setRunFlag(runFlag);
|
||||
}
|
||||
filterDataType(deviceType, deviceInfoParam.getServerName());
|
||||
|
||||
List<DeptDTO> directDeptInfos = deptInfos.stream()
|
||||
.filter(deptDTO -> deptDTO.getPid().equals(deviceInfoParam.getDeptIndex()))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtil.isEmpty(directDeptInfos)) {
|
||||
//没有直接子部门,获取当前部门所有信息
|
||||
List<DeptDTO> dept = deptInfos.stream()
|
||||
.filter(deptDTO -> deptDTO.getId().equals(deviceInfoParam.getDeptIndex()))
|
||||
.collect(Collectors.toList());
|
||||
deviceInfos.add(getGeneralDeviceInfoAsDept(dept.get(0), deviceType, Collections.singletonList(deviceInfoParam.getDeptIndex()), deviceInfoParam));
|
||||
} else {
|
||||
for (DeptDTO deptDTO : directDeptInfos) {
|
||||
//筛选上级部门pids包含该id的所有部门
|
||||
List<DeptDTO> descendantDeptDTO = deptInfos.stream()
|
||||
.filter(d -> d.getPids().contains(deptDTO.getId()))
|
||||
.collect(Collectors.toList());
|
||||
//形成需要查询监测点的部门索引
|
||||
List<String> indexes = descendantDeptDTO.stream()
|
||||
.map(DeptDTO::getId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
indexes.add(deptDTO.getId());
|
||||
deviceInfos.add(getGeneralDeviceInfoAsDept(deptDTO, deviceType, indexes, deviceInfoParam));
|
||||
}
|
||||
}
|
||||
return deviceInfos;
|
||||
|
||||
}
|
||||
|
||||
private GeneralDeviceDTO getGeneralDeviceInfoAsDept(DeptDTO deptDTO, DeviceType deviceType, List<String> ids, DeviceInfoParam deviceInfoParam) {
|
||||
GeneralDeviceDTO generalDeviceDTO = new GeneralDeviceDTO();
|
||||
generalDeviceDTO.setIndex(deptDTO.getId());
|
||||
if (deptDTO.getType() == 0) {
|
||||
generalDeviceDTO.setName(deptDTO.getArea());
|
||||
} else {
|
||||
generalDeviceDTO.setName(deptDTO.getName());
|
||||
}
|
||||
List<DeptLine> deptLines = deptLineService.selectDeptBindLines(ids);
|
||||
//返回空数据
|
||||
if (CollectionUtil.isEmpty(deptLines)) {
|
||||
return generalDeviceDTO;
|
||||
}
|
||||
//获取line详细数据
|
||||
List<Line> lines = terminalBaseService.getLineByCondition(deptLines.stream().map(DeptLine::getLineId).collect(Collectors.toList()), deviceInfoParam);
|
||||
//返回空数据
|
||||
if (CollectionUtil.isEmpty(lines)) {
|
||||
return generalDeviceDTO;
|
||||
}
|
||||
//筛选出终端id,理论上监测点的pids中第五个id为终端id
|
||||
List<String> devIds = lines.stream().map(line -> {
|
||||
String[] idsArray = line.getPids().split(",");
|
||||
return idsArray[4];
|
||||
}).collect(Collectors.toList());
|
||||
//再根据终端条件筛选合法终端信息
|
||||
List<Line> devices = terminalBaseService.getDeviceById(devIds, deviceType);
|
||||
//筛选最终的数据
|
||||
dealDeviceData(generalDeviceDTO, lines, devices);
|
||||
return generalDeviceDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理各节点索引集合
|
||||
*
|
||||
* @param generalDeviceDTO 终端信息综合体
|
||||
* @param lines 监测点信息
|
||||
* @param devices 终端信息
|
||||
*/
|
||||
private void dealDeviceData(GeneralDeviceDTO generalDeviceDTO, List<Line> lines, List<Line> devices) {
|
||||
List<String> gdIndexes = new ArrayList<>(), subIndexes = new ArrayList<>(), deviceIndexes = new ArrayList<>(), voltageIndexes = new ArrayList<>(), lineIndexes = new ArrayList<>();
|
||||
//筛选出供电公司、变电站、终端索引集合
|
||||
for (Line device : devices) {
|
||||
String[] ids = device.getPids().split(",");
|
||||
gdIndexes.add(ids[2]);
|
||||
subIndexes.add(ids[3]);
|
||||
deviceIndexes.add(device.getId());
|
||||
}
|
||||
//筛选出母线、监测点集合
|
||||
for (Line line : lines) {
|
||||
String[] ids = line.getPids().split(",");
|
||||
if (deviceIndexes.contains(ids[4])) {
|
||||
lineIndexes.add(line.getId());
|
||||
voltageIndexes.add(ids[5]);
|
||||
}
|
||||
}
|
||||
//排重,入参到终端综合体
|
||||
generalDeviceDTO.setGdIndexes(gdIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setSubIndexes(subIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setDeviceIndexes(deviceIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setVoltageIndexes(voltageIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setLineIndexes(lineIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件获取按变电站分类的终端信息
|
||||
*
|
||||
* @param deviceInfoParam 终端查询条件
|
||||
* @param runFlag 终端状态
|
||||
* @param devModel 终端模型
|
||||
* @return 终端信息
|
||||
*/
|
||||
public List<GeneralDeviceDTO> getDeviceInfoAsSubstation(DeviceInfoParam deviceInfoParam, List<Integer> runFlag, List<Integer> devModel) {
|
||||
List<GeneralDeviceDTO> deviceInfoAsSubstation = new ArrayList<>();
|
||||
List<String> scale = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(deviceInfoParam.getScale())) {
|
||||
scale = deviceInfoParam.getScale().stream().map(SimpleDTO::getId).collect(Collectors.toList());
|
||||
deviceInfoParam.setScale(new ArrayList<>());
|
||||
}
|
||||
|
||||
List<GeneralDeviceDTO> deviceInfoAsDept = getDeviceInfo(deviceInfoParam, runFlag, devModel);
|
||||
List<String> substationIds = new ArrayList<>();
|
||||
List<String> lineIds = new ArrayList<>();
|
||||
if (!CollectionUtil.isEmpty(deviceInfoAsDept)) {
|
||||
for (GeneralDeviceDTO generalDeviceDTO : deviceInfoAsDept) {
|
||||
substationIds.addAll(generalDeviceDTO.getSubIndexes());
|
||||
lineIds.addAll(generalDeviceDTO.getLineIndexes());
|
||||
}
|
||||
} else {
|
||||
return deviceInfoAsSubstation;
|
||||
}
|
||||
substationIds = substationIds.stream().distinct().collect(Collectors.toList());
|
||||
lineIds = lineIds.stream().distinct().collect(Collectors.toList());
|
||||
if (!CollectionUtil.isEmpty(substationIds)) {
|
||||
List<Line> substations = terminalBaseService.getSubstationByIds(substationIds, scale);
|
||||
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
||||
for (Line substation : substations) {
|
||||
deviceInfoAsSubstation.add(mergeDeviceInfoAsSubstation(substation, lines));
|
||||
}
|
||||
}
|
||||
return deviceInfoAsSubstation;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据变电站筛选数据
|
||||
*
|
||||
* @param substation 变电站
|
||||
* @param lines 监测点信息
|
||||
* @return 按变电站分类的终端信息
|
||||
*/
|
||||
private GeneralDeviceDTO mergeDeviceInfoAsSubstation(Line substation, List<Line> lines) {
|
||||
List<String> gdIndexes = new ArrayList<>(), subIndexes = new ArrayList<>(), deviceIndexes = new ArrayList<>(), voltageIndexes = new ArrayList<>(), lineIndexes = new ArrayList<>();
|
||||
GeneralDeviceDTO generalDeviceDTO = new GeneralDeviceDTO();
|
||||
generalDeviceDTO.setName(substation.getName());
|
||||
generalDeviceDTO.setIndex(substation.getId());
|
||||
gdIndexes.add(substation.getPid());
|
||||
subIndexes.add(substation.getId());
|
||||
generalDeviceDTO.setGdIndexes(gdIndexes);
|
||||
generalDeviceDTO.setSubIndexes(subIndexes);
|
||||
//筛选终端、母线、监测点索引
|
||||
for (Line line : lines) {
|
||||
String[] ids = line.getPids().split(",");
|
||||
if (ids[3].equals(substation.getId())) {
|
||||
deviceIndexes.add(ids[4]);
|
||||
voltageIndexes.add(ids[5]);
|
||||
lineIndexes.add(line.getId());
|
||||
}
|
||||
}
|
||||
generalDeviceDTO.setDeviceIndexes(deviceIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setVoltageIndexes(voltageIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setLineIndexes(lineIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
return generalDeviceDTO;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 筛选数据类型
|
||||
*/
|
||||
private void filterDataType(DeviceType deviceType, String serverName) {
|
||||
ServerEnum serverEnum = EnumUtils.getServerEnumByName(serverName);
|
||||
List<Integer> dataType = new ArrayList<>();
|
||||
dataType.add(2);
|
||||
switch (serverEnum) {
|
||||
case EVENT:
|
||||
dataType.add(0);
|
||||
break;
|
||||
case HARMONIC:
|
||||
dataType.add(1);
|
||||
break;
|
||||
default:
|
||||
dataType.add(0);
|
||||
dataType.add(1);
|
||||
break;
|
||||
}
|
||||
/**
|
||||
* 数据类型(0:暂态系统;1:稳态系统;2:两个系统)
|
||||
*/
|
||||
deviceType.setDataType(dataType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门id、远程服务名、远程客户端类型,以部门的方式
|
||||
*
|
||||
* @param deviceInfoParam 终端查询条件
|
||||
* @param runFlag 终端状态
|
||||
* @param devModel 终端模型
|
||||
* @return 部门分类终端信息
|
||||
*/
|
||||
public List<GeneralDeviceDTO> getDeviceInfo(DeviceInfoParam deviceInfoParam,
|
||||
List<Integer> runFlag,
|
||||
List<Integer> devModel) {
|
||||
//定义待返回终端信息
|
||||
List<GeneralDeviceDTO> deviceInfos = new ArrayList<>();
|
||||
//初始化终端查询条件
|
||||
DeviceType deviceType = new DeviceType();
|
||||
if (CollectionUtil.isEmpty(devModel)) {
|
||||
/**
|
||||
* 终端模型(0:虚拟设备;1:实际设备;2:离线设备;)默认是实际设备
|
||||
*/
|
||||
deviceType.setDevModel(null);
|
||||
} else {
|
||||
deviceType.setDevModel(devModel);
|
||||
}
|
||||
if (CollectionUtil.isEmpty(runFlag)) {
|
||||
/**
|
||||
* 终端状态(0:投运;1:热备用;2:停运)
|
||||
*/
|
||||
deviceType.setRunFlag(null);
|
||||
} else {
|
||||
deviceType.setRunFlag(runFlag);
|
||||
}
|
||||
if(ObjectUtil.isNotNull(deviceInfoParam.getComFlagStatus())){
|
||||
deviceType.setComFlag(Arrays.asList(deviceInfoParam.getComFlagStatus()));
|
||||
}
|
||||
filterDataType(deviceType, deviceInfoParam.getServerName());
|
||||
|
||||
// 初始化部门筛选条件
|
||||
List<Integer> deptType = WebUtil.filterDeptType();
|
||||
// 获取包括当前部门的后代所有部门信息
|
||||
List<DeptDTO> deptInfos = deptFeignClient.getDeptDescendantIndexes(deviceInfoParam.getDeptIndex(), deptType).getData();
|
||||
// 过滤非直接后代部门,集合直接子部门
|
||||
List<DeptDTO> directDeptInfos = deptInfos.stream()
|
||||
.filter(deptDTO -> deptDTO.getPid().equals(deviceInfoParam.getDeptIndex())).sorted(Comparator.comparing(DeptDTO::getSort))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtil.isEmpty(directDeptInfos)) {
|
||||
// 没有直接子部门(树的最底层),获取当前部门所有信息
|
||||
List<DeptDTO> dept = deptInfos.stream()
|
||||
.filter(deptDTO -> deptDTO.getId().equals(deviceInfoParam.getDeptIndex()))
|
||||
.collect(Collectors.toList());
|
||||
deviceInfos.add(getGeneralDeviceInfo(
|
||||
dept.get(0),
|
||||
deviceType,
|
||||
Collections.singletonList(deviceInfoParam.getDeptIndex()),
|
||||
deviceInfoParam));
|
||||
} else {
|
||||
for (DeptDTO directDeptDTO : directDeptInfos) {
|
||||
//筛选pids包含该id的所有部门 直接子部门下属所有部门
|
||||
List<DeptDTO> descendantDeptDTO = deptInfos.stream()
|
||||
.filter(d -> d.getPids().contains(directDeptDTO.getId()))
|
||||
.collect(Collectors.toList());
|
||||
//形成需要查询监测点的部门索引
|
||||
List<String> indexes = descendantDeptDTO.stream()
|
||||
.map(DeptDTO::getId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
indexes.add(directDeptDTO.getId());
|
||||
GeneralDeviceDTO generalDeviceInfo = getGeneralDeviceInfo(directDeptDTO, deviceType, indexes, deviceInfoParam);
|
||||
deviceInfos.add(generalDeviceInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//判断统计类型
|
||||
if (deviceInfoParam.getStatisticalType() == null) {
|
||||
deviceInfoParam.setStatisticalType(new SimpleDTO());
|
||||
}
|
||||
StatisticsEnum statisticsEnum = StatisticsEnum.getStatisticsEnumByCode(deviceInfoParam.getStatisticalType().getCode());
|
||||
switch (statisticsEnum) {
|
||||
case VOLTAGE_LEVEL:
|
||||
return filterDataByScale(deviceInfos, deviceInfoParam.getScale());
|
||||
case LOAD_TYPE:
|
||||
return filterDataByLoadType(deviceInfos, deviceInfoParam.getLoadType());
|
||||
case MANUFACTURER:
|
||||
return filterDataByManufacturer(deviceInfos, deviceInfoParam.getManufacturer());
|
||||
case POWER_FLAG:
|
||||
return filterDataByPowerFlag(deviceInfos, deviceInfoParam.getManufacturer());
|
||||
default:
|
||||
return deviceInfos;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门id集合获取监测点信息
|
||||
*
|
||||
* @param directDeptDTO 入参deptIndex的直接子部门
|
||||
* @param deviceType
|
||||
* @param ids 直接子部门以及后代部门id集合
|
||||
* @param deviceInfoParam
|
||||
* @return
|
||||
*/
|
||||
private GeneralDeviceDTO getGeneralDeviceInfo(DeptDTO directDeptDTO,
|
||||
DeviceType deviceType,
|
||||
List<String> ids,
|
||||
DeviceInfoParam deviceInfoParam) {
|
||||
GeneralDeviceDTO generalDeviceDTO = new GeneralDeviceDTO();
|
||||
generalDeviceDTO.setIndex(directDeptDTO.getId());
|
||||
// type:部门类型 0-非自定义;1-web自定义;2-App自定义;3-web测试
|
||||
if (directDeptDTO.getType() == 0) {
|
||||
generalDeviceDTO.setName(directDeptDTO.getArea());
|
||||
} else {
|
||||
generalDeviceDTO.setName(directDeptDTO.getName());
|
||||
}
|
||||
// 根据部门ids集合查询是否绑定监测点 部门和监测点关联关系中间表:pq_dept_line 可以一对多
|
||||
List<DeptLine> deptLines = deptLineService.selectDeptBindLines(ids);
|
||||
// 返回空数据
|
||||
if (CollectionUtil.isEmpty(deptLines)) {
|
||||
return generalDeviceDTO;
|
||||
}
|
||||
// 提取该部门及其子部门所有监测点id
|
||||
List<String> lineIds = deptLines.stream().map(DeptLine::getLineId).collect(Collectors.toList());
|
||||
// 获取line详细数据 :根据监测点id,获取所有监测点 联查 pq_line、pq_line_detail
|
||||
List<Line> lines = terminalBaseService.getLineByCondition(lineIds, deviceInfoParam);
|
||||
// 返回空数据
|
||||
if (CollectionUtil.isEmpty(lines)) {
|
||||
return generalDeviceDTO;
|
||||
}
|
||||
|
||||
//1.筛选出母线id,理论上监测点的pids中第六个id为母线id 联查: pq_line t1 ,pq_voltage t2
|
||||
List<String> voltageIds=lines.stream().map(Line::getPid).collect(Collectors.toList());
|
||||
//再根据电压等级筛选合法母线信息
|
||||
List<Line> voltages = terminalBaseService.getVoltageByCondition(voltageIds, deviceInfoParam.getScale());
|
||||
|
||||
//2.筛选出终端id,理论上监测点的pids中第五个id为终端id
|
||||
List<String> devIds=voltages.stream().map(Line::getPid).collect(Collectors.toList());
|
||||
// 再根据终端条件筛选合法终端信息 联查:pq_line t1,pq_device t2
|
||||
List<Line> devices = terminalBaseService.getDeviceByCondition(devIds, deviceType, deviceInfoParam.getManufacturer());
|
||||
|
||||
//3.筛选出变电站id,理论上监测点的pids中第四个id为变电站id 联查: pq_line t1 ,pq_substation t2
|
||||
List<String> subIds=devices.stream().map(Line::getPid).collect(Collectors.toList());
|
||||
List<Line> sub = terminalBaseService.getSubByCondition(subIds, new ArrayList<>());
|
||||
|
||||
//筛选最终的数据
|
||||
dealDeviceData(generalDeviceDTO, lines, devices, voltages, sub);
|
||||
return generalDeviceDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取多条件筛选后的交集索引,填充到部门统计中
|
||||
*
|
||||
* @param generalDeviceDTO 部门信息
|
||||
* @param lines 筛选后的监测点信息
|
||||
* @param devices 筛选后的终端信息
|
||||
* @param voltages 筛选后的母线信息
|
||||
*/
|
||||
private void dealDeviceData(GeneralDeviceDTO generalDeviceDTO, List<Line> lines, List<Line> devices, List<Line> voltages, List<Line> sub) {
|
||||
List<String> gdIndexes = new ArrayList<>(), subIndexes = new ArrayList<>(), deviceIndexes = new ArrayList<>(), voltageIndexes = new ArrayList<>(), lineIndexes = new ArrayList<>();
|
||||
List<String> devIds = devices.stream().map(Line::getId).distinct().collect(Collectors.toList());
|
||||
List<String> volIds = voltages.stream().map(Line::getId).distinct().collect(Collectors.toList());
|
||||
List<String> subIds = sub.stream().map(Line::getId).distinct().collect(Collectors.toList());
|
||||
for (Line line : lines) {
|
||||
String[] idsArray = line.getPids().split(",");
|
||||
//监测点同时满足条件筛选后的终端、母线信息,才是最终的结果
|
||||
if (devIds.contains(idsArray[LineBaseEnum.DEVICE_LEVEL.getCode()]) &&
|
||||
volIds.contains(idsArray[LineBaseEnum.SUB_V_LEVEL.getCode()])&&
|
||||
subIds.contains(idsArray[LineBaseEnum.SUB_LEVEL.getCode()])
|
||||
) {
|
||||
gdIndexes.add(idsArray[LineBaseEnum.GD_LEVEL.getCode()]);
|
||||
subIndexes.add(idsArray[LineBaseEnum.SUB_LEVEL.getCode()]);
|
||||
deviceIndexes.add(idsArray[LineBaseEnum.DEVICE_LEVEL.getCode()]);
|
||||
voltageIndexes.add(idsArray[LineBaseEnum.SUB_V_LEVEL.getCode()]);
|
||||
lineIndexes.add(line.getId());
|
||||
}
|
||||
}
|
||||
//排重,入参到终端综合体
|
||||
generalDeviceDTO.setGdIndexes(gdIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setSubIndexes(subIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setDeviceIndexes(deviceIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setVoltageIndexes(voltageIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setLineIndexes(lineIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
private List<GeneralDeviceDTO> filterDataByScale(List<GeneralDeviceDTO> deviceInfos, List<SimpleDTO> scales) {
|
||||
List<GeneralDeviceDTO> generalDeviceDTOS = new ArrayList<>();
|
||||
List<String> subIds = new ArrayList<>(), lineIds = new ArrayList<>();
|
||||
for (GeneralDeviceDTO generalDeviceDTO : deviceInfos) {
|
||||
subIds.addAll(generalDeviceDTO.getSubIndexes());
|
||||
lineIds.addAll(generalDeviceDTO.getLineIndexes());
|
||||
}
|
||||
//如果电压等级集合为空,则查询所有的电压等级
|
||||
if (CollectionUtil.isEmpty(scales)) {
|
||||
List<DictData> scaleDictData = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_VOLTAGE_STAND.getName()).getData();
|
||||
scales = scaleDictData.stream().map(dictData -> {
|
||||
SimpleDTO simpleDTO = new SimpleDTO();
|
||||
BeanUtil.copyProperties(dictData, simpleDTO);
|
||||
return simpleDTO;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
//监测点为空,则返回空的分类数据
|
||||
if (CollectionUtil.isEmpty(lineIds)) {
|
||||
return assembleCommonData(scales);
|
||||
}
|
||||
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
||||
for (SimpleDTO simpleDTO : scales) {
|
||||
List<String> voltageScaleIds = terminalBaseService.getSubIdByScale(subIds, simpleDTO.getId());
|
||||
generalDeviceDTOS.add(assembleDataByLine(simpleDTO, lines, voltageScaleIds, LineBaseEnum.SUB_LEVEL.getCode()));
|
||||
}
|
||||
return generalDeviceDTOS;
|
||||
}
|
||||
|
||||
|
||||
private List<GeneralDeviceDTO> filterDataByLoadType(List<GeneralDeviceDTO> deviceInfos, List<SimpleDTO> loadType) {
|
||||
List<GeneralDeviceDTO> generalDeviceDTOS = new ArrayList<>();
|
||||
List<String> lineIds = new ArrayList<>();
|
||||
for (GeneralDeviceDTO generalDeviceDTO : deviceInfos) {
|
||||
lineIds.addAll(generalDeviceDTO.getLineIndexes());
|
||||
}
|
||||
//如果干扰源集合为空,则查询所有的电压等级
|
||||
if (CollectionUtil.isEmpty(loadType)) {
|
||||
List<DictData> scaleDictData = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName()).getData();
|
||||
loadType = scaleDictData.stream().map(dictData -> {
|
||||
SimpleDTO simpleDTO = new SimpleDTO();
|
||||
BeanUtil.copyProperties(dictData, simpleDTO);
|
||||
return simpleDTO;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
//监测点为空,则返回空的分类数据
|
||||
if (CollectionUtil.isEmpty(lineIds)) {
|
||||
return assembleCommonData(loadType);
|
||||
}
|
||||
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
||||
for (SimpleDTO simpleDTO : loadType) {
|
||||
List<String> lineLoadTypeIds = terminalBaseService.getLineIdByLoadType(lineIds, simpleDTO.getId());
|
||||
generalDeviceDTOS.add(assembleDataByLine(simpleDTO, lines, lineLoadTypeIds, LineBaseEnum.LINE_LEVEL.getCode()));
|
||||
}
|
||||
return generalDeviceDTOS;
|
||||
}
|
||||
|
||||
private List<GeneralDeviceDTO> filterDataByManufacturer(List<GeneralDeviceDTO> deviceInfos, List<SimpleDTO> manufacturer) {
|
||||
List<GeneralDeviceDTO> generalDeviceDTOS = new ArrayList<>();
|
||||
List<String> deviceIds = new ArrayList<>(), lineIds = new ArrayList<>();
|
||||
for (GeneralDeviceDTO generalDeviceDTO : deviceInfos) {
|
||||
deviceIds.addAll(generalDeviceDTO.getDeviceIndexes());
|
||||
lineIds.addAll(generalDeviceDTO.getLineIndexes());
|
||||
}
|
||||
//如果终端厂家集合为空,则查询所有的电压等级
|
||||
if (CollectionUtil.isEmpty(manufacturer)) {
|
||||
List<DictData> scaleDictData = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName()).getData();
|
||||
manufacturer = scaleDictData.stream().map(dictData -> {
|
||||
SimpleDTO simpleDTO = new SimpleDTO();
|
||||
BeanUtil.copyProperties(dictData, simpleDTO);
|
||||
return simpleDTO;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
//监测点为空,则返回空的分类数据
|
||||
if (CollectionUtil.isEmpty(lineIds)) {
|
||||
return assembleCommonData(manufacturer);
|
||||
}
|
||||
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
||||
for (SimpleDTO simpleDTO : manufacturer) {
|
||||
List<String> voltageScaleIds = terminalBaseService.getDeviceIdByManufacturer(deviceIds, simpleDTO.getId());
|
||||
generalDeviceDTOS.add(assembleDataByLine(simpleDTO, lines, voltageScaleIds, LineBaseEnum.DEVICE_LEVEL.getCode()));
|
||||
}
|
||||
return generalDeviceDTOS;
|
||||
}
|
||||
|
||||
private List<GeneralDeviceDTO> filterDataByPowerFlag(List<GeneralDeviceDTO> deviceInfos, List<SimpleDTO> manufacturer) {
|
||||
List<GeneralDeviceDTO> generalDeviceDTOS = new ArrayList<>();
|
||||
List<String> deviceIds = deviceInfos.stream().flatMap(x->x.getLineIndexes().stream()).collect(Collectors.toList());
|
||||
List<String> lineIds = deviceInfos.stream().flatMap(x->x.getLineIndexes().stream()).collect(Collectors.toList());
|
||||
//监测点为空,则返回空的分类数据
|
||||
if (CollectionUtil.isEmpty(lineIds)) {
|
||||
return assembleCommonData(manufacturer);
|
||||
}
|
||||
SimpleDTO dto;
|
||||
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
||||
for (int i = 0; i < 6; i++) {
|
||||
List<String> powerFlagIds = terminalBaseService.getDeviceIdByPowerFlag(deviceIds, i);
|
||||
dto=new SimpleDTO();
|
||||
PowerFlagEnum enumByCode = PowerFlagEnum.getPowerFlagEnumByCode(i);
|
||||
dto.setId(enumByCode.getCode().toString());
|
||||
dto.setName(enumByCode.getMessage());
|
||||
generalDeviceDTOS.add(assembleDataByLine(dto, lines, powerFlagIds, LineBaseEnum.LINE_LEVEL.getCode()));
|
||||
}
|
||||
|
||||
return generalDeviceDTOS;
|
||||
}
|
||||
/**
|
||||
* 当该部门不存在监测点时,返回空的分类数据
|
||||
*
|
||||
* @param simpleDTOS 分类类别
|
||||
* @return .
|
||||
*/
|
||||
private List<GeneralDeviceDTO> assembleCommonData(List<SimpleDTO> simpleDTOS) {
|
||||
return simpleDTOS.stream().map(this::assembleData).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 当该部门不存在监测点时,返回空的分类数据
|
||||
*
|
||||
* @param simpleDTO 基础数据
|
||||
* @return .
|
||||
*/
|
||||
private GeneralDeviceDTO assembleData(SimpleDTO simpleDTO) {
|
||||
GeneralDeviceDTO generalDeviceDTO = new GeneralDeviceDTO();
|
||||
generalDeviceDTO.setName(simpleDTO.getName());
|
||||
generalDeviceDTO.setIndex(simpleDTO.getId());
|
||||
return generalDeviceDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 筛选对应等级的id
|
||||
*
|
||||
* @param simpleDTO 分类信息
|
||||
* @param lines 所有监测点
|
||||
* @param keyIds 待筛选的id
|
||||
* @param level 待筛选的层级
|
||||
*/
|
||||
private GeneralDeviceDTO assembleDataByLine(SimpleDTO simpleDTO, List<Line> lines, List<String> keyIds, Integer level) {
|
||||
GeneralDeviceDTO generalDeviceDTO = assembleData(simpleDTO);
|
||||
if (CollectionUtil.isNotEmpty(keyIds)) {
|
||||
List<Line> tempLines = lines.stream().filter(line -> {
|
||||
String[] idsArray = line.getPids().split(",");
|
||||
if (level.equals(LineBaseEnum.LINE_LEVEL.getCode())) {
|
||||
return keyIds.contains(line.getId());
|
||||
} else {
|
||||
return keyIds.contains(idsArray[level]);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
List<String> gdIndexes = new ArrayList<>(), subIndexes = new ArrayList<>(), deviceIndexes = new ArrayList<>(), voltageIndexes = new ArrayList<>(), lineIndexes = new ArrayList<>();
|
||||
for (Line line : tempLines) {
|
||||
String[] idsArray = line.getPids().split(",");
|
||||
gdIndexes.add(idsArray[LineBaseEnum.GD_LEVEL.getCode()]);
|
||||
subIndexes.add(idsArray[LineBaseEnum.SUB_LEVEL.getCode()]);
|
||||
deviceIndexes.add(idsArray[LineBaseEnum.DEVICE_LEVEL.getCode()]);
|
||||
voltageIndexes.add(idsArray[LineBaseEnum.SUB_V_LEVEL.getCode()]);
|
||||
lineIndexes.add(line.getId());
|
||||
}
|
||||
//排重,入参到终端综合体
|
||||
generalDeviceDTO.setGdIndexes(gdIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setSubIndexes(subIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setDeviceIndexes(deviceIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setVoltageIndexes(voltageIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
generalDeviceDTO.setLineIndexes(lineIndexes.stream().distinct().collect(Collectors.toList()));
|
||||
}
|
||||
return generalDeviceDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 按部门分类获取通讯异常设备警告
|
||||
* @Param: [deviceInfoParam]
|
||||
* @return: java.util.List<com.njcn.device.pq.pojo.vo.ExceptionDeviceInfoVO>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/14
|
||||
*/
|
||||
public List<ExceptionDeviceInfoVO> getExceptionDeviceInfoAsDept(DeviceInfoParam deviceInfoParam) {
|
||||
|
||||
List<ExceptionDeviceInfoVO> exceptionDeviceInfoVOS = new ArrayList<>();
|
||||
List<GeneralDeviceDTO> deviceInfoAsSubstation = getDeviceInfoAsDept(deviceInfoParam, null, Stream.of(1).collect(Collectors.toList()));
|
||||
/*获取所有设备*/
|
||||
final List<String> deviceIndexes = deviceInfoAsSubstation.stream().map(GeneralDeviceDTO::getDeviceIndexes).flatMap(Collection::stream).distinct().collect(Collectors.toList());
|
||||
|
||||
QueryWrapper<Device> wrapper = new QueryWrapper<>();
|
||||
|
||||
|
||||
wrapper.in("Id", deviceIndexes).
|
||||
eq("Com_Flag", 0).
|
||||
eq("Dev_Model", 1).
|
||||
eq("Dev_Data_Type", 2).
|
||||
eq("Run_Flag", 0);
|
||||
|
||||
List<Device> deviceList = deviceMapper.selectList(wrapper);
|
||||
|
||||
List<String> filterDevIndexs = deviceList.stream().map(Device::getId).collect(Collectors.toList());
|
||||
|
||||
QueryWrapper<Line> lineQueryWrapper = new QueryWrapper<>();
|
||||
lineQueryWrapper.in("Id", filterDevIndexs).
|
||||
eq("Level", 4);
|
||||
/*终端*/
|
||||
List<Line> tempDevices = lineMapper.selectList(lineQueryWrapper);
|
||||
|
||||
|
||||
List<String> subIndexList = tempDevices.stream().map(Line::getPid).distinct().collect(Collectors.toList());
|
||||
/*变电站*/
|
||||
QueryWrapper<Line> substationQueryWrapper = new QueryWrapper<>();
|
||||
substationQueryWrapper.in("Id", subIndexList).
|
||||
eq("Level", 3);
|
||||
List<Line> tempSubstations = lineMapper.selectList(substationQueryWrapper);
|
||||
/* todo 设置警告类型*/
|
||||
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.COMM_ERR.getCode()).getData();
|
||||
deviceList.forEach(device -> {
|
||||
|
||||
ExceptionDeviceInfoVO exceptionDeviceInfoVO = new ExceptionDeviceInfoVO();
|
||||
|
||||
exceptionDeviceInfoVO.setIp(device.getIp());
|
||||
exceptionDeviceInfoVO.setUpdateTime(device.getUpdateTime());
|
||||
exceptionDeviceInfoVO.setDevIndex(device.getId());
|
||||
|
||||
Line tempdevice = tempDevices.stream().filter(temp -> Objects.equals(temp.getId(), device.getId())).collect(Collectors.toList()).get(0);
|
||||
|
||||
exceptionDeviceInfoVO.setDevName(tempdevice.getName());
|
||||
exceptionDeviceInfoVO.setSubIndex(tempdevice.getPid());
|
||||
Line substation = tempSubstations.stream().filter(temp -> Objects.equals(temp.getId(), tempdevice.getPid())).collect(Collectors.toList()).get(0);
|
||||
exceptionDeviceInfoVO.setSubName(substation.getName());
|
||||
|
||||
|
||||
exceptionDeviceInfoVO.setWarningId(data.getId());
|
||||
exceptionDeviceInfoVO.setWarningType(data.getName());
|
||||
String exceptionDescription = String.format("%s变电站,%s终端于%s通讯中断", substation.getName(), tempdevice.getName(), device.getUpdateTime());
|
||||
exceptionDeviceInfoVO.setExceptionDescription(exceptionDescription);
|
||||
exceptionDeviceInfoVOS.add(exceptionDeviceInfoVO);
|
||||
});
|
||||
|
||||
|
||||
return exceptionDeviceInfoVOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: getDeptDeviceDetail
|
||||
* @Param: [deviceInfoParam]
|
||||
* @return: com.njcn.device.pq.pojo.vo.DeptDeviceDetailVO
|
||||
* @Author: clam
|
||||
* @Date: 2022/11/4
|
||||
*/
|
||||
public DeptDeviceDetailVO getDeptDeviceDetail(DeviceInfoParam deviceInfoParam) {
|
||||
|
||||
|
||||
DeptDeviceDetailVO deptDeviceDetailVO = new DeptDeviceDetailVO();
|
||||
/*总数*/
|
||||
List<GeneralDeviceDTO> deptDeviceInfos = this.getDeviceInfoAsDept(deviceInfoParam, Stream.of(0, 1).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||
List<String> DeviceIds = deptDeviceInfos.stream().map(GeneralDeviceDTO::getDeviceIndexes).flatMap(Collection::stream).collect(Collectors.toList());
|
||||
Integer deviceCount = DeviceIds.size();
|
||||
|
||||
/*实际运行*/
|
||||
QueryWrapper<Device> query = new QueryWrapper<>();
|
||||
query.in("Id", DeviceIds).
|
||||
eq("Run_Flag", 0).eq("Com_Flag",1);
|
||||
Integer runDeviceCount = deviceMapper.selectCount(query);
|
||||
BigDecimal rate = BigDecimal.valueOf(runDeviceCount).divide(BigDecimal.valueOf(deviceCount), 4, BigDecimal.ROUND_HALF_UP);
|
||||
deptDeviceDetailVO.setDeviceCount(deviceCount);
|
||||
deptDeviceDetailVO.setRunDeviceCount(runDeviceCount);
|
||||
deptDeviceDetailVO.setOnLineRate(rate);
|
||||
return deptDeviceDetailVO;
|
||||
|
||||
}
|
||||
|
||||
public DeptSubstationDetailVO getDeptSubstationDetail(DeviceInfoParam deviceInfoParam) {
|
||||
|
||||
DeptSubstationDetailVO deptSubstationDetailVO = new DeptSubstationDetailVO();
|
||||
|
||||
List<GeneralDeviceDTO> deptDeviceInfos = this.getDeviceInfoAsDept(deviceInfoParam, Stream.of(0, 1).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||
|
||||
List<String> subIds = deptDeviceInfos.stream().map(GeneralDeviceDTO::getSubIndexes).flatMap(Collection::stream).collect(Collectors.toList());
|
||||
Integer substationCount = subIds.size();
|
||||
|
||||
Integer count = lineMapper.queryOnlineSubstaion(subIds);
|
||||
deptSubstationDetailVO.setSubstationCount(substationCount);
|
||||
deptSubstationDetailVO.setRunsubstationCount(count);
|
||||
BigDecimal rate = BigDecimal.valueOf(count).divide(BigDecimal.valueOf(substationCount), 4, BigDecimal.ROUND_HALF_UP);
|
||||
deptSubstationDetailVO.setOnLineRate(rate);
|
||||
|
||||
return deptSubstationDetailVO;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param deptId 部门id
|
||||
* @param runFlag 设备运行状态 0:投运 1.热备用 2.停运
|
||||
* @param dataType 系统 0:暂态系统;1:稳态系统;2:两个系统
|
||||
* @author cdf
|
||||
* @date 2023/7/20
|
||||
*/
|
||||
public List<String> deptGetRunLine(String deptId,List<Integer> runFlag,List<Integer> dataType) {
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(deptId, Stream.of(0, 1).collect(Collectors.toList())).getData();
|
||||
if (CollUtil.isNotEmpty(deptDTOList)) {
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList());
|
||||
return deptLineService.getLineByDeptIds(deptIds,null,runFlag,dataType,null);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param deptId 部门id
|
||||
* @author cdf
|
||||
* @date 2023/7/20
|
||||
*/
|
||||
public List<String> deptGetRunDev(String deptId) {
|
||||
List<String> runLineIds = this.deptGetRunLine(deptId,Stream.of(0).collect(Collectors.toList()),Stream.of(0,2).collect(Collectors.toList()));
|
||||
List<Line> lines = lineMapper.selectList(new LambdaQueryWrapper<Line>()
|
||||
.select(Line::getPids)
|
||||
.in(Line::getId,runLineIds)
|
||||
);
|
||||
if(CollUtil.isNotEmpty(lines)){
|
||||
return lines.stream().map(line -> {
|
||||
String[] idsArray = line.getPids().split(",");
|
||||
return idsArray[4];
|
||||
}).distinct().collect(Collectors.toList());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public List<DevDetail> getDevInfoByIds(List<String> devIds) {
|
||||
List<DictData> gradeType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_GRADE.getCode()).getData();
|
||||
Map<String, Integer> gradeMap = gradeType.stream().collect(Collectors.toMap(DictData::getId, DictData::getAlgoDescribe));
|
||||
|
||||
List<DevDetail> devDetails = deviceMapper.selectDevByIds(devIds);
|
||||
for (DevDetail devDetail : devDetails) {
|
||||
//终端等级
|
||||
if(gradeMap.containsKey(devDetail.getLineGrade())){
|
||||
devDetail.setLineGrade(String.valueOf(gradeMap.get(devDetail.getLineGrade())));
|
||||
}
|
||||
}
|
||||
return devDetails;
|
||||
}
|
||||
|
||||
public List<TopMsgPO> getTopMsgInfoByIds(OnlineRateParam param) {
|
||||
return topMsgMapper.selectByIds(param);
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -14,8 +13,11 @@ import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.device.service.IDeviceService;
|
||||
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.GridDiagramParam;
|
||||
@@ -25,12 +27,12 @@ import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.GridDiagramProVO;
|
||||
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
|
||||
import com.njcn.device.pq.service.*;
|
||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
|
||||
import java.time.ZoneId;
|
||||
@@ -39,7 +41,6 @@ import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.pq.mapper.LargeScreenMapper;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.pq.pojo.po.LineBak;
|
||||
import com.njcn.device.pq.mapper.LineBakMapper;
|
||||
import com.njcn.device.pq.service.LineBakService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* 监测点类
|
||||
*
|
||||
* @author denghuajun
|
||||
* @date 2022/2/23
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class LineBakServiceImpl extends ServiceImpl<LineBakMapper, LineBak> implements LineBakService {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.pq.api.AlarmClient;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
@@ -15,7 +16,6 @@ import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.enums.PowerFlagEnum;
|
||||
import com.njcn.device.pq.enums.RunFlagEnum;
|
||||
import com.njcn.device.pq.mapper.LineIntegrityDataMapper;
|
||||
import com.njcn.device.pq.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PublicDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
@@ -27,6 +27,7 @@ import com.njcn.device.pq.pojo.vo.LineIntegrityDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatIntegrityVO;
|
||||
import com.njcn.device.pq.service.LineIntegrityDataService;
|
||||
import com.njcn.device.pq.utils.DataStatisticsUtil;
|
||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.harmonic.pojo.vo.IntegrityIconVO;
|
||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user