合并代码
This commit is contained in:
@@ -6,6 +6,7 @@ import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.influxdb.param.InfluxDBSqlConstant;
|
||||
import com.njcn.influxdb.param.InfluxDBTableConstant;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -143,7 +144,16 @@ public class AssembleSqlUtil {
|
||||
List<String> ia = new ArrayList<>();
|
||||
ia.add("1");
|
||||
ia.add("2");
|
||||
System.out.println(assembleSqlUtil.select("data_a").where(map,orField,ia).groupBy(orField,null).orderBy("time","desc").over());
|
||||
System.out.println(assembleSqlUtil.selectField(Stream.of("a", "d", "c", "b").collect(Collectors.toList()), "test").over());
|
||||
System.out.println(assembleSqlUtil.
|
||||
select(InfluxDBTableConstant.DAY_V)
|
||||
.where(map,orField,ia)
|
||||
.groupBy(orField,null)
|
||||
.orderBy(InfluxDBTableConstant.TIME,InfluxDBSqlConstant.DESC)
|
||||
.over()
|
||||
);
|
||||
System.out.println(assembleSqlUtil.
|
||||
selectField(Stream.of(InfluxDBTableConstant.DUE, InfluxDBTableConstant.REAL)
|
||||
.collect(Collectors.toList()), InfluxDBTableConstant.DAY_V)
|
||||
.over());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pms-device-boot</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.njcn</groupId>-->
|
||||
<!-- <artifactId>pms-device-boot</artifactId>-->
|
||||
<!-- <version>${project.version}</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.njcn.device.pq.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pq.api.fallback.SubstationFeignClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.dto.SubstationDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年10月13日 19:54
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.DEVICE, path = "/substation", fallbackFactory = SubstationFeignClientFallbackFactory.class)
|
||||
public interface SubstationFeignClient {
|
||||
|
||||
|
||||
/**
|
||||
* 根据变电站ID获取变电站信息
|
||||
*
|
||||
* @param subId 变电站ID集合
|
||||
* @return 变电站信息
|
||||
*/
|
||||
@PostMapping("getSubstationById")
|
||||
HttpResult<List<SubstationDTO>> getSubstationById(@RequestParam("subId") List<String> subId);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.njcn.device.pq.api.fallback;
|
||||
|
||||
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.device.pq.api.SubstationFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.SubstationDTO;
|
||||
import com.njcn.device.pq.pojo.po.Substation;
|
||||
import com.njcn.device.pq.utils.DeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年10月13日 19:55
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class SubstationFeignClientFallbackFactory implements FallbackFactory<SubstationFeignClient> {
|
||||
@Override
|
||||
public SubstationFeignClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = DeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new SubstationFeignClient(){
|
||||
@Override
|
||||
public HttpResult<List<SubstationDTO>> getSubstationById(List<String> id) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据变电站ID获取变电站信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.device.pq.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年10月13日 20:03
|
||||
*/
|
||||
@Data
|
||||
public class SubstationDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 索引
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 电压等级Id,字典表
|
||||
*/
|
||||
private String scale;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private BigDecimal lng;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private BigDecimal lat;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/10/9 15:59【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "DeptLineCountVO" ,description = "部门监测点统计信息")
|
||||
public class DeptLineCountVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("部门索引")
|
||||
private String index;
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("监测点数量")
|
||||
private Integer number=0;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* Description:通讯异常设备
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/10/14 10:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "ExceptionDeviceInfoVO" ,description = "通讯异常设备")
|
||||
public class ExceptionDeviceInfoVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(name ="subIndex",value = "变电站索引")
|
||||
private String subIndex;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(name ="subName",value = "变电站名称")
|
||||
private String subName;
|
||||
|
||||
@ApiModelProperty("设备索引")
|
||||
private String devIndex;
|
||||
|
||||
|
||||
@ApiModelProperty("设备名称")
|
||||
private String devName;
|
||||
|
||||
|
||||
@ApiModelProperty("网络参数")
|
||||
private String ip;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("发生时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty("警告类型id")
|
||||
private String warningId;
|
||||
|
||||
@ApiModelProperty("警告类型")
|
||||
private String warningType;
|
||||
|
||||
@ApiModelProperty("异常描述")
|
||||
private String exceptionDescription;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.vo.ExceptionDeviceInfoVO;
|
||||
import com.njcn.device.pq.service.TerminalBaseService;
|
||||
import com.njcn.device.pq.service.impl.GeneralDeviceService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -208,5 +209,24 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 按部门分类获取通讯异常设备警告
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getExceptionDeviceInfoAsDept")
|
||||
@ApiOperation("按部门分类获取通讯异常设备警告")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceInfoParam", value = "查询终端条件", required = true)
|
||||
})
|
||||
@Deprecated
|
||||
public HttpResult<List<ExceptionDeviceInfoVO>> getExceptionDeviceInfoAsDept(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
|
||||
String methodDescribe = getMethodDescribe("getExceptionDeviceInfoAsDept");
|
||||
List<ExceptionDeviceInfoVO> exceptionDeviceInfoAsDept = generalDeviceService.getExceptionDeviceInfoAsDept(deviceInfoParam);
|
||||
if (CollectionUtil.isEmpty(exceptionDeviceInfoAsDept)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, exceptionDeviceInfoAsDept, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
@@ -8,7 +9,9 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.pq.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.dto.*;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
@@ -19,6 +22,8 @@ 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.service.LineService;
|
||||
import com.njcn.device.pq.service.impl.GeneralDeviceService;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -27,8 +32,11 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
@@ -44,12 +52,16 @@ public class LineController extends BaseController {
|
||||
|
||||
private final LineService lineService;
|
||||
|
||||
private final GeneralDeviceService generalDeviceService;
|
||||
|
||||
private final DeviceMapper deviceMapper;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineDetailData")
|
||||
@@ -345,4 +357,22 @@ public class LineController extends BaseController {
|
||||
|
||||
|
||||
|
||||
|
||||
@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 = new ArrayList<> ();
|
||||
deptLineCountVOS = lineService.getDeptLineCount(deviceInfoParam);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptLineCountVOS, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
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.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.dto.SubstationDTO;
|
||||
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.ISubstationService;
|
||||
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.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年10月13日 19:54
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/substation")
|
||||
@Api(tags = "变电站管理")
|
||||
@AllArgsConstructor
|
||||
public class SubstationController extends BaseController {
|
||||
|
||||
private final ISubstationService substationService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("获取变电站详情")
|
||||
@PostMapping("getSubstationById")
|
||||
HttpResult<List<SubstationDTO>> getSubstationById(@RequestParam("subId") List<String> subId){
|
||||
String methodDescribe = getMethodDescribe("getSubstationById");
|
||||
List<SubstationDTO> substationDTOList = substationService.getSubstationById(subId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, substationDTOList, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ 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;
|
||||
@@ -23,4 +24,12 @@ public interface SubstationMapper extends BaseMapper<Substation> {
|
||||
* @return 结果
|
||||
*/
|
||||
List<SubstationDetailVO> getSubstationData(@Param("id") List<String> id);
|
||||
|
||||
/**
|
||||
* 根据变电站ID获取变电站信息
|
||||
*
|
||||
* @param subId 变电站ID
|
||||
* @return 变电站信息
|
||||
*/
|
||||
List<SubstationDTO> getSubstationById(@Param("id")List<String> subId);
|
||||
}
|
||||
|
||||
@@ -184,19 +184,19 @@
|
||||
pq_device t2
|
||||
WHERE
|
||||
t1.id = t2.id
|
||||
<if test="deviceType.devModel!=null">
|
||||
<if test="deviceType.devModel!=null and deviceType.devModel.size()!=0">
|
||||
AND t2.Dev_Model in
|
||||
<foreach collection="deviceType.devModel" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.runFlag!=null">
|
||||
<if test="deviceType.runFlag!=null and deviceType.runFlag.size()!=0">
|
||||
AND t2.Run_Flag in
|
||||
<foreach collection="deviceType.runFlag" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.dataType!=null">
|
||||
<if test="deviceType.dataType!=null and deviceType.dataType.size()!=0">
|
||||
AND t2.Dev_Data_Type in
|
||||
<foreach collection="deviceType.dataType" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
@@ -221,19 +221,19 @@
|
||||
t1.id = t2.id
|
||||
and t1.pid = sub.id
|
||||
and sub.pid = gd.id
|
||||
<if test="deviceType.devModel!=null">
|
||||
<if test="deviceType.devModel!=null and deviceType.devModel.size()!=0">
|
||||
AND t2.Dev_Model in
|
||||
<foreach collection="deviceType.devModel" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.runFlag!=null">
|
||||
<if test="deviceType.runFlag!=null and deviceType.runFlag.size()!=0">
|
||||
AND t2.Run_Flag in
|
||||
<foreach collection="deviceType.runFlag" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.dataType!=null">
|
||||
<if test="deviceType.dataType!=null and deviceType.dataType.size()!=0">
|
||||
AND t2.Dev_Data_Type in
|
||||
<foreach collection="deviceType.dataType" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
@@ -280,7 +280,7 @@
|
||||
<if test="deviceInfoParam.powerFlag!=2">
|
||||
and t2.Power_Flag = #{deviceInfoParam.powerFlag}
|
||||
</if>
|
||||
<if test="deviceInfoParam.loadType!=null">
|
||||
<if test="deviceInfoParam.loadType!=null and deviceInfoParam.loadType.size()!=0">
|
||||
AND t2.Load_Type in
|
||||
<foreach collection="deviceInfoParam.loadType" open="(" close=")" item="item" separator=",">
|
||||
#{item.id}
|
||||
@@ -303,25 +303,25 @@
|
||||
pq_device t2
|
||||
WHERE
|
||||
t1.id = t2.id
|
||||
<if test="deviceType.devModel!=null">
|
||||
<if test="deviceType.devModel!=null and deviceType.devModel.size()!=0">
|
||||
AND t2.Dev_Model in
|
||||
<foreach collection="deviceType.devModel" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.runFlag!=null">
|
||||
<if test="deviceType.runFlag!=null and deviceType.runFlag.size()!=0">
|
||||
AND t2.Run_Flag in
|
||||
<foreach collection="deviceType.runFlag" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.dataType!=null">
|
||||
<if test="deviceType.dataType!=null and deviceType.dataType.size()!=0">
|
||||
AND t2.Dev_Data_Type in
|
||||
<foreach collection="deviceType.dataType" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="manufacturer!=null">
|
||||
<if test="manufacturer!=null and manufacturer.size()!=0">
|
||||
AND t2.manufacturer in
|
||||
<foreach collection="manufacturer" open="(" close=")" item="item" separator=",">
|
||||
#{item.id}
|
||||
@@ -347,7 +347,7 @@
|
||||
<foreach collection="voltageIds" separator="," open="(" close=")" item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="scale!=null">
|
||||
<if test="scale!=null and scale.size()!=0">
|
||||
AND t2.scale in
|
||||
<foreach collection="scale" open="(" close=")" item="item" separator=",">
|
||||
#{item.id}
|
||||
@@ -851,7 +851,7 @@
|
||||
de.Stat_Flag,
|
||||
dic3.name lineGrade,
|
||||
de.Remark
|
||||
FROM
|
||||
FROM
|
||||
pq_line line
|
||||
INNER JOIN pq_line vol ON line.pid = vol.id
|
||||
INNER JOIN pq_line dev ON vol.pid = dev.id
|
||||
@@ -890,7 +890,7 @@ FROM
|
||||
inner join pq_line sub on dev.pid = sub.id
|
||||
where sub.id = #{subId}
|
||||
and voltage.state = 1
|
||||
<if test="voltageName!=null">
|
||||
<if test="voltageName!=null and voltageName.size()!=0">
|
||||
and voltage.name in
|
||||
<foreach collection="voltageName" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
|
||||
@@ -23,4 +23,24 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getSubstationById" resultType="com.njcn.device.pq.pojo.dto.SubstationDTO">
|
||||
SELECT
|
||||
line.id ,
|
||||
line.NAME ,
|
||||
line.sort ,
|
||||
sub.Lng 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>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.dto.SubstationDTO;
|
||||
import com.njcn.device.pq.pojo.po.Substation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年10月13日 20:10
|
||||
*/
|
||||
public interface ISubstationService extends IService<Substation> {
|
||||
|
||||
/**
|
||||
* 根据变电站ID获取变电站信息
|
||||
*
|
||||
* @param subId 变电站ID
|
||||
* @return 变电站信息
|
||||
*/
|
||||
List<SubstationDTO> getSubstationById(List<String> subId);
|
||||
}
|
||||
@@ -147,5 +147,12 @@ public interface LineService {
|
||||
* @return 结果
|
||||
*/
|
||||
DeviceAbnormalVO getComunicateStatics(DeviceInfoParam.BusinessParam deviceInfoParam);
|
||||
|
||||
/**
|
||||
* @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);
|
||||
}
|
||||
|
||||
@@ -2,19 +2,26 @@ package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
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.mapper.DeviceMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
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.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
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;
|
||||
@@ -25,14 +32,13 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 终端信息处理器,根据需求返回笼统的台账信息。
|
||||
* 包括:类别名称、类别索引、监测点索引集合、终端索引集合、变电站索引集合、供电公司索引集合。
|
||||
ii * 包括:类别名称、类别索引、监测点索引集合、终端索引集合、变电站索引集bb合、供电公司索引集合。
|
||||
* PS:若后期需要比如:省会、项目时再动态添加。
|
||||
*
|
||||
* @author hongawen
|
||||
@@ -54,6 +60,10 @@ public class GeneralDeviceService {
|
||||
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
private final DeviceMapper deviceMapper;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门id、远程服务名、远程客户端类型,以部门的方式
|
||||
@@ -62,6 +72,7 @@ public class GeneralDeviceService {
|
||||
* @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();
|
||||
@@ -547,5 +558,73 @@ public class GeneralDeviceService {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,15 +22,20 @@ import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.mapper.*;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.device.pq.service.TerminalBaseService;
|
||||
import com.njcn.device.pq.utils.PublicDateUtil;
|
||||
import com.njcn.influxdb.param.InfluxDBPublicParam;
|
||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||
import com.njcn.system.api.AreaFeignClient;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.pojo.vo.LineDataVO;
|
||||
import com.njcn.web.utils.GeneralUtil;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -78,6 +83,13 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
|
||||
private final InfluxDbUtils influxDbUtils;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
private final DeptLineService deptLineService;
|
||||
|
||||
private final TerminalBaseService terminalBaseService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public LineDetailDataVO getLineDetailData(String id) {
|
||||
@@ -730,6 +742,40 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
return deviceAbnormalVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 通过部门索引查询其下监测点数
|
||||
* @Param: [deviceInfoParam] 监测点查询条件
|
||||
* @return: java.util.List<com.njcn.device.pq.pojo.vo.DeptLineCountVO>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/10
|
||||
*/
|
||||
@Override
|
||||
public List<DeptLineCountVO> getDeptLineCount(DeviceInfoParam deviceInfoParam) {
|
||||
List<DeptLineCountVO> deptLineCountVOList = new ArrayList<> ();
|
||||
//获取所有监测点
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfoAsDept(deviceInfoParam, null, Stream.of(1).collect(Collectors.toList()));
|
||||
for (GeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) {
|
||||
//根据部门id去获取省份信息
|
||||
DeptLineCountVO deptLineCountVO = new DeptLineCountVO();
|
||||
deptLineCountVO.setIndex (generalDeviceDTO.getIndex ());
|
||||
deptLineCountVO.setName(generalDeviceDTO.getName());
|
||||
deptLineCountVO.setNumber (generalDeviceDTO.getLineIndexes().size());
|
||||
deptLineCountVOList.add(deptLineCountVO);
|
||||
}
|
||||
|
||||
/* Map<String, Integer> collect = deptLineCountVOList.stream ( ).collect (Collectors.groupingBy (DeptLineCountVO::getName, Collectors.summingInt (DeptLineCountVO::getNumber)));
|
||||
List<DeptLineCountVO> result = new ArrayList<DeptLineCountVO>();
|
||||
|
||||
for (Map.Entry<String, Integer> entry : collect.entrySet()) {
|
||||
DeptLineCountVO deptLineCountVO = new DeptLineCountVO();
|
||||
deptLineCountVO.setName (entry.getKey());
|
||||
deptLineCountVO.setNumber (entry.getValue());
|
||||
result.add(deptLineCountVO);
|
||||
}*/
|
||||
deptLineCountVOList = deptLineCountVOList.stream ().sorted (Comparator.comparing (DeptLineCountVO::getNumber,Comparator.reverseOrder())).collect(Collectors.toList());
|
||||
return deptLineCountVOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户选择的时间区间返回月份日期
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.pq.mapper.SubstationMapper;
|
||||
import com.njcn.device.pq.pojo.dto.SubstationDTO;
|
||||
import com.njcn.device.pq.pojo.po.Substation;
|
||||
import com.njcn.device.pq.service.ISubstationService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年10月13日 20:11
|
||||
*/
|
||||
@Service
|
||||
public class SubstationServiceImpl extends ServiceImpl<SubstationMapper, Substation> implements ISubstationService {
|
||||
|
||||
@Override
|
||||
public List<SubstationDTO> getSubstationById(List<String> subId) {
|
||||
return this.baseMapper.getSubstationById(subId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.njcn.event.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 拓展前端参数
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/10/8
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UniversalFrontEndParam extends StatisticsBizBaseParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
@ApiModelProperty(name = "voltageLevel", value = "电压等级", required = true)
|
||||
private List<String> voltageLevel;
|
||||
|
||||
/**
|
||||
* 监测点名称
|
||||
*/
|
||||
@ApiModelProperty(name = "measurementPointId", value = "监测点名称")
|
||||
private String measurementPointId;
|
||||
|
||||
/**
|
||||
* 暂态指标类型
|
||||
*/
|
||||
@ApiModelProperty(name = "typeOfTransientIndicators", value = "暂态指标类型")
|
||||
private String typeOfTransientIndicators;
|
||||
|
||||
/**
|
||||
* 监测点类别
|
||||
*/
|
||||
@ApiModelProperty(name = "measurementPointCategory", value = "监测点类别")
|
||||
private String measurementPointCategory;
|
||||
|
||||
/**
|
||||
* 变电站名称
|
||||
*/
|
||||
@ApiModelProperty(name = "subName", value = "变电站名称")
|
||||
private String subName;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
package com.njcn.event.pojo.po;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 监测点(PmsMonitor)实体类
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-10-17 20:19:26
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PmsMonitorPO implements Serializable {
|
||||
private static final long serialVersionUID = 910688608662493948L;
|
||||
/**
|
||||
* 监测点ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 监测点名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 组织机构名称
|
||||
*/
|
||||
private String orgName;
|
||||
/**
|
||||
* 组织机构ID(外键)
|
||||
*/
|
||||
private String orgId;
|
||||
/**
|
||||
* 运维单位名称
|
||||
*/
|
||||
private String operationName;
|
||||
/**
|
||||
* 运维单位ID(外键)
|
||||
*/
|
||||
private String operationId;
|
||||
/**
|
||||
* 变电站名称
|
||||
*/
|
||||
private String powerrName;
|
||||
/**
|
||||
* 电站ID(外键)
|
||||
*/
|
||||
private String powerrId;
|
||||
/**
|
||||
* 母线名称
|
||||
*/
|
||||
private String generatrixName;
|
||||
/**
|
||||
* 母线ID(外键)
|
||||
*/
|
||||
private String generatrixId;
|
||||
/**
|
||||
* 监测线路名称
|
||||
*/
|
||||
private String lineName;
|
||||
/**
|
||||
* 监测线路ID
|
||||
*/
|
||||
private String lineId;
|
||||
/**
|
||||
* 电压等级(字典)
|
||||
*/
|
||||
private String voltageLevel;
|
||||
/**
|
||||
* 监测点状态(字典)
|
||||
*/
|
||||
private String monitorState;
|
||||
/**
|
||||
* 监测点类型
|
||||
*/
|
||||
private String monitorType;
|
||||
/**
|
||||
* 最小短路容量
|
||||
*/
|
||||
private Double minShortCircuitCapacity;
|
||||
/**
|
||||
* 供电设备容量
|
||||
*/
|
||||
private Double powerSupplyEqCapacity;
|
||||
/**
|
||||
* 用户协议容量
|
||||
*/
|
||||
private Double userAgreementCapacity;
|
||||
/**
|
||||
* 电压偏差限值(上)
|
||||
*/
|
||||
private Double voltageDeviationUpperLimit;
|
||||
/**
|
||||
* 电压偏差限值(下)
|
||||
*/
|
||||
private Double voltageDeviationLowerLimit;
|
||||
/**
|
||||
* 电压互感器类型(字典)
|
||||
*/
|
||||
private String potentialTransFormerType;
|
||||
/**
|
||||
* 中性点接地方式(字典)
|
||||
*/
|
||||
private String neutralGroundingMode;
|
||||
/**
|
||||
* 是否用户专线(字典)
|
||||
*/
|
||||
private String isSpecialSupplyElectricity;
|
||||
/**
|
||||
* 监测点标签
|
||||
*/
|
||||
private String monitorTag;
|
||||
/**
|
||||
* 监测对象类型(字典)
|
||||
*/
|
||||
private String monitorObjectType;
|
||||
/**
|
||||
* 监测对象编号
|
||||
*/
|
||||
private String monitorObjectId;
|
||||
/**
|
||||
* 监测对象名称
|
||||
*/
|
||||
private String monitorObjectName;
|
||||
/**
|
||||
* 统计间隔
|
||||
*/
|
||||
private Integer statisticalInterval;
|
||||
/**
|
||||
* 关联的监测终端编号(外键)
|
||||
*/
|
||||
private String terminalId;
|
||||
/**
|
||||
* 监测终端接线方式(字典)
|
||||
*/
|
||||
private String terminalWiringMethod;
|
||||
/**
|
||||
* 是否是上送国网监测点,0-否 1-是
|
||||
*/
|
||||
private Integer isUpToGrid;
|
||||
/**
|
||||
* 数据状态:0-删除;1-正常;
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 创建用户
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新用户
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.njcn.event.pojo.po;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (RStatBusbarHarmonicY)实体类
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-10-12 18:38:16
|
||||
*/
|
||||
@Data
|
||||
public class RStatBusbarHarmonicPO implements Serializable {
|
||||
private static final long serialVersionUID = 398744755685851294L;
|
||||
/**
|
||||
* 母线ID
|
||||
*/
|
||||
private String busbarId;
|
||||
/**
|
||||
* 生成数据的时间,每年统计一次
|
||||
*/
|
||||
private Date dataDate;
|
||||
/**
|
||||
* 电压有效值最大
|
||||
*/
|
||||
private Double vEffectiveMax;
|
||||
/**
|
||||
* 电压有效值最小
|
||||
*/
|
||||
private Double vEffectiveMin;
|
||||
/**
|
||||
* 电压有效值平均
|
||||
*/
|
||||
private Double vEffectiveAvg;
|
||||
/**
|
||||
* 电压有效值95概率大值
|
||||
*/
|
||||
private Double vEffective95;
|
||||
/**
|
||||
* 电压总谐波畸变率最大
|
||||
*/
|
||||
private Double vThdMax;
|
||||
/**
|
||||
* 电压总谐波畸变率最小
|
||||
*/
|
||||
private Double vThdMin;
|
||||
/**
|
||||
* 电压总谐波畸变率平均
|
||||
*/
|
||||
private Double vThdAvg;
|
||||
/**
|
||||
* 电压总谐波畸变率95概率大值
|
||||
*/
|
||||
private Double vThd95;
|
||||
/**
|
||||
* 三相电压不平衡最大
|
||||
*/
|
||||
private Double unbalanceMax;
|
||||
/**
|
||||
* 三相电压不平衡最小
|
||||
*/
|
||||
private Double unbalanceMin;
|
||||
/**
|
||||
* 三相电压不平衡平均
|
||||
*/
|
||||
private Double unbalanceAvg;
|
||||
/**
|
||||
* 三相电压不平衡95概率大值
|
||||
*/
|
||||
private Double unbalance95;
|
||||
/**
|
||||
* 闪变最大
|
||||
*/
|
||||
private Double flickerMax;
|
||||
/**
|
||||
* 闪变最小
|
||||
*/
|
||||
private Double flickerMin;
|
||||
/**
|
||||
* 闪变平均
|
||||
*/
|
||||
private Double flickerAvg;
|
||||
/**
|
||||
* 闪变95概率大值
|
||||
*/
|
||||
private Double flicker95;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.njcn.event.pojo.po;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 监测点暂态指标数据统计表(RStatEventOrg)实体类
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-10-12 18:15:26
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel("监测点暂态指标数据统计表")
|
||||
public class RStatEventOrgPO implements Serializable {
|
||||
private static final long serialVersionUID = -15971491825708754L;
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
@ApiModelProperty(name = "orgNo",value = "单位ID")
|
||||
private String orgNo;
|
||||
|
||||
/**
|
||||
* 生成数据的时间,每年统计一次
|
||||
*/
|
||||
@ApiModelProperty(name = "dataDate",value = "生成数据的时间,每年统计一次")
|
||||
private Date dataDate;
|
||||
|
||||
/**
|
||||
* 稳态指标类型Id,字典表ID
|
||||
*/
|
||||
@ApiModelProperty(name = "eventType",value = "稳态指标类型Id,字典表ID")
|
||||
private String eventType;
|
||||
|
||||
/**
|
||||
* 日均发生暂态监测点数(根据 发生暂态监测点数 取平均值)
|
||||
*/
|
||||
@ApiModelProperty(name = "eventMeasurementAverage",value = "日均发生暂态监测点数(根据 发生暂态监测点数 取平均值)")
|
||||
private Integer eventMeasurementAverage;
|
||||
|
||||
/**
|
||||
* 累计发生暂态监测点数(监测点暂态指标超标明细日表
|
||||
*/
|
||||
@ApiModelProperty(name = "eventMeasurementAccrued",value = "累计发生暂态监测点数(监测点暂态指标超标明细日表)")
|
||||
private Integer eventMeasurementAccrued;
|
||||
|
||||
/**
|
||||
* 暂态指标发生频次(日表的暂态指标发生次数之和/日表的发生暂态监测点数之和)
|
||||
*/
|
||||
@ApiModelProperty(name = "eventFreq",value = "暂态指标发生频次(日表的暂态指标发生次数之和/日表的发生暂态监测点数之和)")
|
||||
private Double eventFreq;
|
||||
|
||||
/**
|
||||
* 暂态指标发生次数(日表的暂态指标发生次数之和)
|
||||
*/
|
||||
@ApiModelProperty(name = "eventCount",value = "暂态指标发生次数(日表的暂态指标发生次数之和)")
|
||||
private Integer eventCount;
|
||||
|
||||
/**
|
||||
* 日均发生暂态监测点数占比(根据 日均发生暂态监测点数占比 取平均值)
|
||||
*/
|
||||
@ApiModelProperty(name = "eventMeasurementRatioAverage",value = "日均发生暂态监测点数占比(根据 日均发生暂态监测点数占比 取平均值)")
|
||||
private Double eventMeasurementRatioAverage;
|
||||
|
||||
/**
|
||||
* 累计发生暂态监测点数占比(此表的累计发生暂态监测点数/区域统计表中的区域分类统计月表中的发生暂态的监测点数)
|
||||
*/
|
||||
@ApiModelProperty(name = "eventMeasurementRatioAccrued",value = "累计发生暂态监测点数占比(此表的累计发生暂态监测点数/区域统计表中的区域分类统计月表中的发生暂态的监测点数)")
|
||||
private Double eventMeasurementRatioAccrued;
|
||||
|
||||
/**
|
||||
* 数据类型,字典表(01:主网测点 02:配网测点)
|
||||
*/
|
||||
@ApiModelProperty(name = "dataType",value = "数据类型,字典表(01:主网测点 02:配网测点)")
|
||||
private String dataType;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.njcn.event.pojo.po;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 区域分类统计年表(RStatOrgY)实体类
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-10-12 18:37:24
|
||||
*/
|
||||
@Data
|
||||
public class RStatOrgPO implements Serializable {
|
||||
private static final long serialVersionUID = -49993470994002009L;
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
private String orgNo;
|
||||
/**
|
||||
* 生成数据的时间,每年统计一次
|
||||
*/
|
||||
private Date dataDate;
|
||||
/**
|
||||
* 监测点类别ID、监测对象类型ID
|
||||
*/
|
||||
private String measurementTypeClass;
|
||||
/**
|
||||
* 总监测点数
|
||||
*/
|
||||
private Integer allCount;
|
||||
/**
|
||||
* 日均有效接入监测点数
|
||||
*/
|
||||
private Integer effectiveMeasurementAverage;
|
||||
/**
|
||||
* 累计有效接入监测点数
|
||||
*/
|
||||
private Integer effectiveMeasurementAccrued;
|
||||
/**
|
||||
* 日均稳态超标监测点数
|
||||
*/
|
||||
private Integer overLimitMeasurementAverage;
|
||||
/**
|
||||
* 累计稳态超标监测点数
|
||||
*/
|
||||
private Integer overLimitMeasurementAccrued;
|
||||
/**
|
||||
* 日均稳态超标监测点数占比
|
||||
*/
|
||||
private Integer harmonicMeasurementRatioAverage;
|
||||
/**
|
||||
* 稳态指标平均超标天数
|
||||
*/
|
||||
private Double averageOverDay;
|
||||
/**
|
||||
* 频率偏差合格率
|
||||
*/
|
||||
private Double freqPassRate;
|
||||
/**
|
||||
* 电压偏差合格率
|
||||
*/
|
||||
private Double vDevPassRate;
|
||||
/**
|
||||
* 闪变合格率
|
||||
*/
|
||||
private Double flickerPassRate;
|
||||
/**
|
||||
* 日均监测到暂态指标的监测点数
|
||||
*/
|
||||
private Integer eventMeasurementAverage;
|
||||
/**
|
||||
* 累计监测到暂态指标的监测点数
|
||||
*/
|
||||
private Integer eventMeasurementAccrued;
|
||||
/**
|
||||
* 日均暂态超标监测点数占比
|
||||
*/
|
||||
private Integer eventMeasurementRatioAverage;
|
||||
/**
|
||||
* 暂态指标发生频次
|
||||
*/
|
||||
private Double eventFreq;
|
||||
/**
|
||||
* 暂态指标发生次数
|
||||
*/
|
||||
private Integer eventCount;
|
||||
/**
|
||||
* 应设点数
|
||||
*/
|
||||
private Integer shouldCount;
|
||||
/**
|
||||
* 告警监测点数
|
||||
*/
|
||||
private Integer warnCount;
|
||||
/**
|
||||
* 数据类型,字典表(01:主网测点 02:配网测点)
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.njcn.event.pojo.po;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (RStatSubstationY)实体类
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-10-12 18:39:03
|
||||
*/
|
||||
@Data
|
||||
public class RStatSubstationPO implements Serializable {
|
||||
private static final long serialVersionUID = -98896978437277100L;
|
||||
/**
|
||||
* 生成数据的时间,每年统计一次
|
||||
*/
|
||||
private Date dataDate;
|
||||
/**
|
||||
* 变电站id
|
||||
*/
|
||||
private Integer substationId;
|
||||
/**
|
||||
* 日均有效接入监测点数
|
||||
*/
|
||||
private Integer effectiveMeasurementAverage;
|
||||
/**
|
||||
* 累计有效接入监测点数
|
||||
*/
|
||||
private Integer effectiveMeasurementAccrued;
|
||||
/**
|
||||
* 稳态平均超标天数
|
||||
*/
|
||||
private Double harmonicOverDay;
|
||||
/**
|
||||
* 频率偏差平均超标天数
|
||||
*/
|
||||
private Double freqAverageOverDay;
|
||||
/**
|
||||
* 电压偏差平均超标天数
|
||||
*/
|
||||
private Double vDevAverageOverDay;
|
||||
/**
|
||||
* 谐波电压平均超标天数
|
||||
*/
|
||||
private Double vAverageOverDay;
|
||||
/**
|
||||
* 谐波电流平均超标天数
|
||||
*/
|
||||
private Double iAverageOverDay;
|
||||
/**
|
||||
* 三相电压不平衡平均超标天数
|
||||
*/
|
||||
private Double unbalanceAverageOverDay;
|
||||
/**
|
||||
* 负序电流平均超标天数
|
||||
*/
|
||||
private Double iNegAverageOverDay;
|
||||
/**
|
||||
* 闪变平均超标天数
|
||||
*/
|
||||
private Double flickerAverageOverDay;
|
||||
/**
|
||||
* 间谐波电压平均超标天数
|
||||
*/
|
||||
private Double inuharmAverageOverDay;
|
||||
/**
|
||||
* 暂态指标发生次数
|
||||
*/
|
||||
private Integer eventCount;
|
||||
/**
|
||||
* 暂态指标发生频次
|
||||
*/
|
||||
private Double eventFreq;
|
||||
/**
|
||||
* 电压暂降发生次数
|
||||
*/
|
||||
private Integer sagCount;
|
||||
/**
|
||||
* 电压暂降发生频次
|
||||
*/
|
||||
private Double sagFreq;
|
||||
/**
|
||||
* 电压暂升发生次数
|
||||
*/
|
||||
private Integer swellCount;
|
||||
/**
|
||||
* 电压暂升发生频次
|
||||
*/
|
||||
private Double swellFreq;
|
||||
/**
|
||||
* 短时中断发生次数
|
||||
*/
|
||||
private Integer interruptCount;
|
||||
/**
|
||||
* 短时中断发生频次
|
||||
*/
|
||||
private Double interruptFreq;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.njcn.device.pms.pojo.po;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (RMpEventDetail)实体类
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-10-12 18:34:55
|
||||
*/
|
||||
@Data
|
||||
public class RmpEventDetailPO implements Serializable {
|
||||
private static final long serialVersionUID = 717547299960041571L;
|
||||
/**
|
||||
* 暂时事件ID
|
||||
*/
|
||||
@ApiModelProperty(name = "eventId",value = "暂时事件ID")
|
||||
private String eventId;
|
||||
/**
|
||||
* 监测点ID
|
||||
*/
|
||||
@ApiModelProperty(name = "measurementPointId",value = "监测点ID")
|
||||
private String measurementPointId;
|
||||
/**
|
||||
* 事件类型
|
||||
*/
|
||||
@ApiModelProperty(name = "eventType",value = "事件类型")
|
||||
private String eventType;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ApiModelProperty(name = "startTime",value = "开始时间")
|
||||
private Long startTime;
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
@ApiModelProperty(name = "duration",value = "持续时间")
|
||||
private Double duration;
|
||||
/**
|
||||
* 特征幅值
|
||||
*/
|
||||
@ApiModelProperty(name = "featureAmplitude",value = "特征幅值")
|
||||
private Double featureAmplitude;
|
||||
/**
|
||||
* 相别
|
||||
*/
|
||||
@ApiModelProperty(name = "phase",value = "相别")
|
||||
private String phase;
|
||||
|
||||
/**
|
||||
* 事件描述
|
||||
*/
|
||||
@ApiModelProperty(name = "eventDescribe",value = "事件描述")
|
||||
private String eventDescribe;
|
||||
|
||||
/**
|
||||
* 波形路径
|
||||
*/
|
||||
@ApiModelProperty(name = "wavePath",value = "波形路径")
|
||||
private String wavePath;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
package com.njcn.event.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 变电站母线电压指标年报返回前端实体类
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/10/8
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "变电站母线电压指标年报返回前端实体类")
|
||||
public class RStatBusbarHarmonicVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 835979721790264805L;
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty(name = "deptId", value = "部门id")
|
||||
private String deptId;
|
||||
|
||||
/**
|
||||
* 所属单位
|
||||
*/
|
||||
@ApiModelProperty(name = "company", value = "单位")
|
||||
private String company;
|
||||
|
||||
/**
|
||||
* 变电站id
|
||||
*/
|
||||
@ApiModelProperty(name = "subId", value = "变电站id")
|
||||
private String subId;
|
||||
|
||||
/**
|
||||
* 变电站名称
|
||||
*/
|
||||
@ApiModelProperty(name = "subName", value = "变电站名称")
|
||||
private String subName;
|
||||
|
||||
/**
|
||||
* 变电站电压等级
|
||||
*/
|
||||
@ApiModelProperty(name = "subVoltageLevel", value = "变电站电压等级")
|
||||
private String subVoltageLevel;
|
||||
|
||||
/**
|
||||
* 母线名称
|
||||
*/
|
||||
@ApiModelProperty(name = "busbarName", value = "母线名称")
|
||||
private String busbarName;
|
||||
|
||||
/**
|
||||
* 母线id
|
||||
*/
|
||||
@ApiModelProperty(name = "busbarId", value = "母线id")
|
||||
@TableField(value = "busbar_id")
|
||||
private String busbarId;
|
||||
|
||||
|
||||
/**
|
||||
* 生成数据的时间,每年统计一次
|
||||
*/
|
||||
@ApiModelProperty(name = "dataDate", value = "生成数据的时间,每年统计一次")
|
||||
@TableField(value = "data_date")
|
||||
private String dataDate;
|
||||
|
||||
/**
|
||||
* 电压有效最大值
|
||||
*/
|
||||
@ApiModelProperty(name = "vEffectiveMax", value = "电压有效最大值")
|
||||
@TableField(value = "v_effective_max")
|
||||
private Double vEffectiveMax;
|
||||
|
||||
/**
|
||||
* 电压有效最小值
|
||||
*/
|
||||
@ApiModelProperty(name = "vEffectiveMin", value = "电压有效最小值")
|
||||
@TableField(value = "v_effective_min")
|
||||
private Double vEffectiveMin;
|
||||
|
||||
/**
|
||||
* 电压有效平均值
|
||||
*/
|
||||
@ApiModelProperty(name = "vEffectiveAvg", value = "电压有效平均值")
|
||||
@TableField(value = "v_effective_avg")
|
||||
private Double vEffectiveAvg;
|
||||
|
||||
/**
|
||||
* 电压有效值95概率大值
|
||||
*/
|
||||
@ApiModelProperty(name = "vEffective95", value = "电压有效值95概率大值")
|
||||
@TableField(value = "v_effective_95")
|
||||
private Double vEffective95;
|
||||
|
||||
/**
|
||||
* 电压总谐波畸变率最大值
|
||||
*/
|
||||
@ApiModelProperty(name = "vThdMax", value = "电压总谐波畸变率最大值")
|
||||
@TableField(value = "v_thd_max")
|
||||
private Double vThdMax;
|
||||
|
||||
/**
|
||||
* 电压总谐波畸变率最小值
|
||||
*/
|
||||
@ApiModelProperty(name = "vThdMin", value = "电压总谐波畸变率最小值")
|
||||
@TableField(value = "v_thd_min")
|
||||
private Double vThdMin;
|
||||
|
||||
/**
|
||||
* 电压总谐波畸变率平均值
|
||||
*/
|
||||
@ApiModelProperty(name = "vThdAvg", value = "电压总谐波畸变率平均值")
|
||||
@TableField(value = "v_thd_avg")
|
||||
private Double vThdAvg;
|
||||
|
||||
/**
|
||||
* 电压总谐波畸变率95概率大值
|
||||
*/
|
||||
@ApiModelProperty(name = "vThd95", value = "电压总谐波畸变率95概率大值")
|
||||
@TableField(value = "v_thd_95")
|
||||
private Double vThd95;
|
||||
|
||||
/**
|
||||
* 三相电压不平衡最大值
|
||||
*/
|
||||
@ApiModelProperty(name = "unbalanceMax", value = "三相电压不平衡最大值")
|
||||
@TableField(value = "unbalance_max")
|
||||
private Double unbalanceMax;
|
||||
|
||||
/**
|
||||
* 三相电压不平衡最小值
|
||||
*/
|
||||
@ApiModelProperty(name = "unbalanceMin", value = "三相电压不平衡最小值")
|
||||
@TableField(value = "unbalance_min")
|
||||
private Double unbalanceMin;
|
||||
|
||||
/**
|
||||
* 三相电压不平衡平均值
|
||||
*/
|
||||
@ApiModelProperty(name = "unbalanceAvg", value = "三相电压不平衡平均值")
|
||||
@TableField(value = "unbalance_avg")
|
||||
private Double unbalanceAvg;
|
||||
|
||||
/**
|
||||
* 三相电压不平衡95概率大值
|
||||
*/
|
||||
@ApiModelProperty(name = "unbalance95", value = "三相电压不平衡95概率大值")
|
||||
@TableField(value = "unbalance_95")
|
||||
private Double unbalance95;
|
||||
|
||||
/**
|
||||
* 闪变最大值
|
||||
*/
|
||||
@ApiModelProperty(name = "flickerMax", value = "闪变最大值")
|
||||
@TableField(value = "flicker_max")
|
||||
private Double flickerMax;
|
||||
|
||||
/**
|
||||
* 闪变最小值
|
||||
*/
|
||||
@ApiModelProperty(name = "flickerMin", value = "闪变最小值")
|
||||
@TableField(value = "flicker_min")
|
||||
private Double flickerMin;
|
||||
|
||||
/**
|
||||
* 闪变平均值
|
||||
*/
|
||||
@ApiModelProperty(name = "flickerAvg", value = "闪变平均值")
|
||||
@TableField(value = "flicker_avg")
|
||||
private Double flickerAvg;
|
||||
|
||||
/**
|
||||
* 闪变95概率大值
|
||||
*/
|
||||
@ApiModelProperty(name = "flicker95", value = "闪变95概率大值")
|
||||
@TableField(value = "flicker_95")
|
||||
private Double flicker95;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
package com.njcn.event.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监测点暂态指标数据统计表(RStatEventOrg)实体类
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-10-12 18:15:26
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel("监测点暂态指标数据统计表")
|
||||
public class RStatEventOrgVO implements Serializable {
|
||||
private static final long serialVersionUID = -15971491825708754L;
|
||||
|
||||
public static final String SHORT_INTERRUPTIONS = "Short_Interruptions";
|
||||
public static final String VOLTAGE_DIP = "Voltage_Dip";
|
||||
public static final String VOLTAGE_RISE = "Voltage_Rise";
|
||||
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
@ApiModelProperty(name = "orgNo", value = "单位ID")
|
||||
private String orgNo;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@ApiModelProperty(name = "orgName", value = "单位名称")
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 生成数据的时间,每年统计一次
|
||||
*/
|
||||
@ApiModelProperty(name = "dataDate", value = "生成数据的时间,每年统计一次")
|
||||
private Date dataDate;
|
||||
|
||||
/**
|
||||
* 日均有效接入监测点数
|
||||
*/
|
||||
@ApiModelProperty(name = "effectiveMeasurementAverage", value = "日均有效接入监测点数")
|
||||
private Integer effectiveMeasurementAverage;
|
||||
|
||||
/**
|
||||
* 累计有效接入监测点数
|
||||
*/
|
||||
@ApiModelProperty(name = "effectiveMeasurementAccrued", value = "累计有效接入监测点数")
|
||||
private Integer effectiveMeasurementAccrued;
|
||||
|
||||
/**
|
||||
* 日均监测到暂态指标的监测点数
|
||||
*/
|
||||
@ApiModelProperty(name = "eventMeasurementAverage", value = "日均监测到暂态指标的监测点数")
|
||||
private Integer eventMeasurementAverage;
|
||||
|
||||
/**
|
||||
* 累计监测到暂态指标的监测点数
|
||||
*/
|
||||
@ApiModelProperty(name = "eventMeasurementAccrued", value = "累计监测到暂态指标的监测点数")
|
||||
private Integer eventMeasurementAccrued;
|
||||
|
||||
/**
|
||||
* 日均暂态超标监测点数占比
|
||||
*/
|
||||
@ApiModelProperty(name = "eventMeasurementRatioAverage", value = "日均暂态超标监测点数占比")
|
||||
private Integer eventMeasurementRatioAverage;
|
||||
|
||||
/**
|
||||
* 累计暂态超标监测点数占比
|
||||
*/
|
||||
@ApiModelProperty(name = "eventMeasurementRatioAccrued", value = "累计暂态超标监测点数占比")
|
||||
private Integer eventMeasurementRatioAccrued;
|
||||
|
||||
/**
|
||||
* 暂态指标类型Id,字典表ID
|
||||
*/
|
||||
@ApiModelProperty(name = "eventType", value = "暂态指标类型Id,字典表ID")
|
||||
private String eventType;
|
||||
|
||||
/**
|
||||
* 日均发生暂态监测点数(根据 发生暂态监测点数 取平均值)
|
||||
*/
|
||||
@ApiModelProperty(name = "eEventMeasurementAverage",value = "日均发生暂态监测点数(根据 发生暂态监测点数 取平均值)")
|
||||
private Integer eEventMeasurementAverage;
|
||||
|
||||
/**
|
||||
* 累计发生暂态监测点数(监测点暂态指标超标明细日表
|
||||
*/
|
||||
@ApiModelProperty(name = "eEventMeasurementAccrued",value = "累计发生暂态监测点数(监测点暂态指标超标明细日表)")
|
||||
private Integer eEventMeasurementAccrued;
|
||||
/**
|
||||
* 日均发生暂态监测点数占比(根据 日均发生暂态监测点数占比 取平均值)
|
||||
*/
|
||||
@ApiModelProperty(name = "eEventMeasurementRatioAverage",value = "日均发生暂态监测点数占比(根据 日均发生暂态监测点数占比 取平均值)")
|
||||
private Double eEventMeasurementRatioAverage;
|
||||
|
||||
/**
|
||||
* 累计发生暂态监测点数占比(此表的累计发生暂态监测点数/区域统计表中的区域分类统计月表中的发生暂态的监测点数)
|
||||
*/
|
||||
@ApiModelProperty(name = "eEventMeasurementRatioAccrued",value = "累计发生暂态监测点数占比(此表的累计发生暂态监测点数/区域统计表中的区域分类统计月表中的发生暂态的监测点数)")
|
||||
private Double eEventMeasurementRatioAccrued;
|
||||
|
||||
/**
|
||||
* 暂态指标发生频次(日表的暂态指标发生次数之和/日表的发生暂态监测点数之和)
|
||||
*/
|
||||
@ApiModelProperty(name = "eEventFreq",value = "暂态指标发生频次(日表的暂态指标发生次数之和/日表的发生暂态监测点数之和)")
|
||||
private Double eEventFreq;
|
||||
|
||||
/**
|
||||
* 暂态指标发生次数(日表的暂态指标发生次数之和)
|
||||
*/
|
||||
@ApiModelProperty(name = "eEventCount",value = "暂态指标发生次数(日表的暂态指标发生次数之和)")
|
||||
private Integer eEventCount;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 日均短时中断
|
||||
*/
|
||||
@ApiModelProperty(name = "dayShortInterruptions", value = "日均短时中断")
|
||||
private Integer dayShortInterruptions;
|
||||
|
||||
/**
|
||||
* 累计短时中断
|
||||
*/
|
||||
@ApiModelProperty(name = "cumulativeShortInterruptions", value = "累计短时中断")
|
||||
private Integer cumulativeShortInterruptions;
|
||||
|
||||
/**
|
||||
* 日均短时中断占比
|
||||
*/
|
||||
@ApiModelProperty(name = "dayShortInterruptionsProportion", value = "日均短时中断占比")
|
||||
private Double dayShortInterruptionsProportion;
|
||||
|
||||
/**
|
||||
* 累计短时中断占比
|
||||
*/
|
||||
@ApiModelProperty(name = "cumulativeShortInterruptionsProportion", value = "累计暂态指标占比")
|
||||
private Double cumulativeShortInterruptionsProportion;
|
||||
|
||||
/**
|
||||
* 短时中断监测点数
|
||||
*/
|
||||
@ApiModelProperty(name = "shortInterruptionsMonitor", value = "短时中断监测点数")
|
||||
private Integer shortInterruptionsMonitor;
|
||||
|
||||
/**
|
||||
* 短时中断占比
|
||||
*/
|
||||
@ApiModelProperty(name = "shortInterruptionsProportion",value = "短时中断占比")
|
||||
private Double shortInterruptionsProportion;
|
||||
|
||||
/**
|
||||
* 短时中断次数
|
||||
*/
|
||||
@ApiModelProperty(name = "shortInterruptionsCount", value = "短时中断次数")
|
||||
private Integer shortInterruptionsCount;
|
||||
|
||||
/**
|
||||
* 短时中断频次
|
||||
*/
|
||||
@ApiModelProperty(name = "shortInterruptionsFrequency", value = "短时中断频次")
|
||||
private Double shortInterruptionsFrequency;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 日均电压暂升
|
||||
*/
|
||||
@ApiModelProperty(name = "dayVoltageRise", value = "日均电压暂升")
|
||||
private Integer dayVoltageRise;
|
||||
|
||||
/**
|
||||
* 累计电压暂升
|
||||
*/
|
||||
@ApiModelProperty(name = "cumulativeVoltageRise", value = "累计电压暂升")
|
||||
private Integer cumulativeVoltageRise;
|
||||
|
||||
/**
|
||||
* 日均电压暂升占比
|
||||
*/
|
||||
@ApiModelProperty(name = "dayVoltageRiseProportion", value = "日均电压暂升占比")
|
||||
private Double dayVoltageRiseProportion;
|
||||
|
||||
/**
|
||||
* 累计电压暂升占比
|
||||
*/
|
||||
@ApiModelProperty(name = "cumulativeVoltageRiseProportion", value = "累计电压暂升占比")
|
||||
private Double cumulativeVoltageRiseProportion;
|
||||
|
||||
/**
|
||||
* 电压暂升占比
|
||||
*/
|
||||
@ApiModelProperty(name = "voltageRiseProportion",value = "电压暂升占比")
|
||||
private Double voltageRiseProportion;
|
||||
|
||||
/**
|
||||
* 电压暂升次数
|
||||
*/
|
||||
@ApiModelProperty(name = "voltageRiseCount", value = "电压暂升次数")
|
||||
private Integer voltageRiseCount;
|
||||
|
||||
/**
|
||||
* 电压暂升频次
|
||||
*/
|
||||
@ApiModelProperty(name = "voltageRiseFrequency", value = "电压暂升频次")
|
||||
private Double voltageRiseFrequency;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 日均电压暂降
|
||||
*/
|
||||
@ApiModelProperty(name = "dayVoltageDip", value = "日均电压暂降")
|
||||
private Integer dayVoltageDip;
|
||||
|
||||
/**
|
||||
* 累计电压暂降
|
||||
*/
|
||||
@ApiModelProperty(name = "cumulativeVoltageDip", value = "累计电压暂降")
|
||||
private Integer cumulativeVoltageDip;
|
||||
|
||||
/**
|
||||
* 日均电压暂降占比
|
||||
*/
|
||||
@ApiModelProperty(name = "dayVoltageDipProportion", value = "日均电压暂降占比")
|
||||
private Double dayVoltageDipProportion;
|
||||
|
||||
/**
|
||||
* 累计电压暂降占比
|
||||
*/
|
||||
@ApiModelProperty(name = "cumulativeVoltageDipProportion", value = "累计电压暂降占比")
|
||||
private Double cumulativeVoltageDipProportion;
|
||||
|
||||
/**
|
||||
* 电压暂降占比
|
||||
*/
|
||||
@ApiModelProperty(name = "voltageDipProportion",value = "电压暂降占比")
|
||||
private Double voltageDipProportion;
|
||||
|
||||
/**
|
||||
* 电压暂降次数
|
||||
*/
|
||||
@ApiModelProperty(name = "voltageDipCount", value = "电压暂降次数")
|
||||
private Integer voltageDipCount;
|
||||
|
||||
|
||||
/**
|
||||
* 电压暂降频次
|
||||
*/
|
||||
@ApiModelProperty(name = "voltageDipFrequency", value = "电压暂降频次")
|
||||
private Double voltageDipFrequency;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.njcn.event.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 区域分类统计表(RStatOrgY)实体类
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/10/10
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "区域分类统计表(RStatOrgY)实体类")
|
||||
public class RStatOrgVO implements Serializable {
|
||||
private static final long serialVersionUID = 642166320324597986L;
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
@ApiModelProperty(name = "orgNo", value = "单位ID")
|
||||
private String orgNo;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@ApiModelProperty(name = "orgName", value = "单位名称")
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 生成数据的时间
|
||||
*/
|
||||
@ApiModelProperty(name = "dataDate", value = "生成数据的时间")
|
||||
private String dataDate;
|
||||
|
||||
/**
|
||||
* 日均有效接入监测点数
|
||||
*/
|
||||
@ApiModelProperty(name = "effectiveMeasurementAverage", value = "日均有效接入监测点数")
|
||||
private Integer effectiveMeasurementAverage;
|
||||
|
||||
/**
|
||||
* 累计有效接入监测点数
|
||||
*/
|
||||
@ApiModelProperty(name = "effectiveMeasurementAccrued", value = "累计有效接入监测点数")
|
||||
private Integer effectiveMeasurementAccrued;
|
||||
|
||||
/**
|
||||
* 日均监测到暂态指标的监测点数
|
||||
*/
|
||||
@ApiModelProperty(name = "eventMeasurementAverage", value = "日均监测到暂态指标的监测点数")
|
||||
private Integer eventMeasurementAverage;
|
||||
|
||||
/**
|
||||
* 累计监测到暂态指标的监测点数
|
||||
*/
|
||||
@ApiModelProperty(name = "eventMeasurementAccrued", value = "累计监测到暂态指标的监测点数")
|
||||
private Integer eventMeasurementAccrued;
|
||||
|
||||
/**
|
||||
* 日均暂态超标监测点数占比
|
||||
*/
|
||||
@ApiModelProperty(name = "eventMeasurementRatioAverage", value = "日均暂态超标监测点数占比")
|
||||
private Integer eventMeasurementRatioAverage;
|
||||
|
||||
/**
|
||||
* 累计暂态超标监测点数占比
|
||||
*/
|
||||
@ApiModelProperty(name = "eventMeasurementRatioAccrued", value = "累计暂态超标监测点数占比")
|
||||
private Integer eventMeasurementRatioAccrued;
|
||||
|
||||
/**
|
||||
* 暂态指标发生频次
|
||||
*/
|
||||
@ApiModelProperty(name = "eventFreq", value = "暂态指标发生频次")
|
||||
private Double eventFreq;
|
||||
|
||||
/**
|
||||
* 暂态指标发生次数
|
||||
*/
|
||||
@ApiModelProperty(name = "eventCount", value = "暂态指标发生次数")
|
||||
private Integer eventCount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.njcn.event.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 变电站指标统计表实体类
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-10-11 16:15:48
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "变电站指标统计表实体类")
|
||||
public class RStatSubstationVO implements Serializable {
|
||||
private static final long serialVersionUID = 117875946877905400L;
|
||||
|
||||
/**
|
||||
* 单位id
|
||||
*/
|
||||
@ApiModelProperty(name = "deptId",value = "单位id")
|
||||
private String deptId;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@ApiModelProperty(name = "deptName",value = "单位名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 变电站id
|
||||
*/
|
||||
@ApiModelProperty(name = "substationId",value = "变电站id")
|
||||
private String substationId;
|
||||
|
||||
/**
|
||||
* 变电站名称
|
||||
*/
|
||||
@ApiModelProperty(name = "substationName",value = "变电站名称")
|
||||
private String substationName;
|
||||
|
||||
/**
|
||||
* 生成数据的时间
|
||||
*/
|
||||
@ApiModelProperty(name = "dataDate",value = "生成数据的时间")
|
||||
private String dataDate;
|
||||
|
||||
/**
|
||||
* 日均有效接入监测点数
|
||||
*/
|
||||
@ApiModelProperty(name = "effectiveMeasurementAverage",value = "日均有效接入监测点数")
|
||||
private Integer effectiveMeasurementAverage;
|
||||
|
||||
/**
|
||||
* 累计有效接入监测点数
|
||||
*/
|
||||
@ApiModelProperty(name = "effectiveMeasurementAccrued",value = "累计有效接入监测点数")
|
||||
private Integer effectiveMeasurementAccrued;
|
||||
|
||||
|
||||
/**
|
||||
* 暂态指标发生次数
|
||||
*/
|
||||
@ApiModelProperty(name = "eventCount",value = "暂态指标发生次数")
|
||||
private Integer eventCount;
|
||||
|
||||
/**
|
||||
* 暂态指标发生频次
|
||||
*/
|
||||
@ApiModelProperty(name = "eventFreq",value = "暂态指标发生频次")
|
||||
private Double eventFreq;
|
||||
|
||||
/**
|
||||
* 短时中断发生次数
|
||||
*/
|
||||
@ApiModelProperty(name = "interruptCount",value = "短时中断发生次数")
|
||||
private Integer interruptCount;
|
||||
|
||||
/**
|
||||
* 短时中断发生频次
|
||||
*/
|
||||
@ApiModelProperty(name = "interruptFreq",value = "短时中断发生频次")
|
||||
private Double interruptFreq;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 电压暂升发生次数
|
||||
*/
|
||||
@ApiModelProperty(name = "swellCount",value = "电压暂升发生次数")
|
||||
private Integer swellCount;
|
||||
|
||||
/**
|
||||
* 电压暂升发生频次
|
||||
*/
|
||||
@ApiModelProperty(name = "swellFreq",value = "电压暂升发生频次")
|
||||
private Double swellFreq;
|
||||
|
||||
/**
|
||||
* 电压暂降发生次数
|
||||
*/
|
||||
@ApiModelProperty(name = "sagCount",value = "电压暂降发生次数")
|
||||
private Integer sagCount;
|
||||
|
||||
/**
|
||||
* 电压暂降发生频次
|
||||
*/
|
||||
@ApiModelProperty(name = "sagFreq",value = "电压暂降发生频次")
|
||||
private Double sagFreq;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.njcn.event.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 监测点暂态事件明细数据(RMpEventDetail)实体类
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-10-12 10:30:03
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel("监测点暂态事件明细数据")
|
||||
public class RmpEventDetailVO implements Serializable {
|
||||
private static final long serialVersionUID = 544141879378917668L;
|
||||
|
||||
/**
|
||||
* 单位id
|
||||
*/
|
||||
@ApiModelProperty(name = "deptId",value = "单位id")
|
||||
private String deptId;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@ApiModelProperty(name = "deptName",value = "单位名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 暂时事件ID
|
||||
*/
|
||||
@ApiModelProperty(name = "eventId",value = "暂时事件ID")
|
||||
private String eventId;
|
||||
|
||||
/**
|
||||
* 监测点ID
|
||||
*/
|
||||
@ApiModelProperty(name = "measurementPointId",value = "监测点ID")
|
||||
private String measurementPointId;
|
||||
|
||||
/**
|
||||
* 监测点名称
|
||||
*/
|
||||
@ApiModelProperty(name = "measurementPointName",value = "监测点名称")
|
||||
private String measurementPointName;
|
||||
|
||||
/**
|
||||
* 事件类型
|
||||
*/
|
||||
@ApiModelProperty(name = "eventType",value = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
/**
|
||||
* 相别
|
||||
*/
|
||||
@ApiModelProperty(name = "phase",value = "相别")
|
||||
private String phase;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ApiModelProperty(name = "startTime",value = "开始时间")
|
||||
private Long startTime;
|
||||
|
||||
/**
|
||||
* 持续时间
|
||||
*/
|
||||
@ApiModelProperty(name = "duration",value = "持续时间")
|
||||
private Double duration;
|
||||
/**
|
||||
* 特征幅值
|
||||
*/
|
||||
@ApiModelProperty(name = "featureAmplitude",value = "特征幅值")
|
||||
private Double featureAmplitude;
|
||||
|
||||
/**
|
||||
* 波形路径
|
||||
*/
|
||||
@ApiModelProperty(name = "wavePath",value = "波形路径")
|
||||
private String wavePath;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.njcn.event.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.event.pojo.param.UniversalFrontEndParam;
|
||||
import com.njcn.event.pojo.vo.RmpEventDetailVO;
|
||||
import com.njcn.event.service.RmpEventDetailService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* 暂态事件明细
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/10/12
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/rmpEventDetail")
|
||||
@Api(tags = "暂态事件明细")
|
||||
@RequiredArgsConstructor
|
||||
public class RmpEventDetailController extends BaseController {
|
||||
|
||||
private final RmpEventDetailService rmpEventDetailService;
|
||||
|
||||
/**
|
||||
* 获取暂态事件明细
|
||||
*
|
||||
* @param param 前端传入参数
|
||||
* @return 暂态事件明细
|
||||
*/
|
||||
@PostMapping("/getDetailsOfTransientEvents")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@ApiOperation("获取区域暂态指标统计")
|
||||
// @ApiImplicitParam(name = "UniversalFrontEndParam", value = "前端参数", required = true)
|
||||
public HttpResult<List<RmpEventDetailVO>> getRmpEventDetail(@RequestBody UniversalFrontEndParam param) {
|
||||
String methodDescribe = getMethodDescribe("getRmpEventDetail");
|
||||
List<RmpEventDetailVO> list = rmpEventDetailService.getRmpEventDetail(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.njcn.event.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.event.pojo.param.UniversalFrontEndParam;
|
||||
import com.njcn.event.pojo.vo.RStatEventOrgVO;
|
||||
import com.njcn.event.pojo.vo.RStatOrgVO;
|
||||
import com.njcn.event.pojo.vo.RStatSubstationVO;
|
||||
import com.njcn.event.service.StatisticsOfTransientIndicatorssService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* 暂态指标统计
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/10/10
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/statisticsOfTransientIndicators")
|
||||
@Api(tags = "暂态指标统计")
|
||||
@RequiredArgsConstructor
|
||||
public class StatisticsOfTransientIndicatorsController extends BaseController {
|
||||
|
||||
private final StatisticsOfTransientIndicatorssService statisticsOfTransientIndicatorssService;
|
||||
|
||||
/**
|
||||
* 获取区域暂态指标统计
|
||||
*
|
||||
* @param param 前端传入参数
|
||||
* @return 区域暂态指标统计
|
||||
*/
|
||||
@PostMapping("/getRStatOrg")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@ApiOperation("获取区域暂态指标统计")
|
||||
// @ApiImplicitParam(name = "UniversalFrontEndParam", value = "前端参数", required = true)
|
||||
public HttpResult<List<RStatOrgVO>> getRStatOrg(@RequestBody UniversalFrontEndParam param) {
|
||||
String methodDescribe = getMethodDescribe("getRStatOrg");
|
||||
List<RStatOrgVO> list = statisticsOfTransientIndicatorssService.getRStatOrg(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取区域暂态指标分类统计表
|
||||
*
|
||||
* @param param 前端传入参数
|
||||
* @return 区域暂态指标分类统计表
|
||||
*/
|
||||
@PostMapping("/getRStatEventOrg")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@ApiOperation("获取区域暂态指标分类统计表")
|
||||
// @ApiImplicitParam(name = "UniversalFrontEndParam", value = "前端参数", required = true)
|
||||
public HttpResult<List<RStatEventOrgVO>> getRStatEventOrg(@RequestBody UniversalFrontEndParam param) {
|
||||
String methodDescribe = getMethodDescribe("getRStatEventOrg");
|
||||
List<RStatEventOrgVO> list = statisticsOfTransientIndicatorssService.getRStatEventOrg(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取变电站暂态指标分类统计表
|
||||
*
|
||||
* @param param 前端传入参数
|
||||
* @return 变电站暂态指标分类统计表
|
||||
*/
|
||||
@PostMapping("/getRStatSubstation")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@ApiOperation("获取变电站暂态指标分类统计表")
|
||||
// @ApiImplicitParam(name = "UniversalFrontEndParam", value = "前端参数", required = true)
|
||||
public HttpResult<List<RStatSubstationVO>> getRStatSubstation(@RequestBody UniversalFrontEndParam param) {
|
||||
String methodDescribe = getMethodDescribe("getRStatSubstation");
|
||||
List<RStatSubstationVO> list = statisticsOfTransientIndicatorssService.getRStatSubstation(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.event.mapper;
|
||||
|
||||
import com.njcn.event.pojo.po.PmsMonitorPO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yzh
|
||||
* @date 2022/10/17
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface PmsMonitorMapper {
|
||||
|
||||
/**
|
||||
* 根据部门id查询监测点id
|
||||
*
|
||||
* @param deptIds 部门id
|
||||
* @return 监测点id
|
||||
*/
|
||||
List<PmsMonitorPO> getMonitorInfo(@Param("deptIds") List<String> deptIds);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.njcn.event.mapper;
|
||||
|
||||
|
||||
import com.njcn.event.pojo.vo.RStatEventOrgVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 区域暂态指标分类统计表
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/10/13
|
||||
*/
|
||||
@Mapper
|
||||
public interface RStatEventOrgMapper {
|
||||
|
||||
/**
|
||||
* 获取年区域暂态指标分类统计表
|
||||
*
|
||||
* @param deptIds 部门id
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 年区域暂态指标分类统计表
|
||||
*/
|
||||
List<RStatEventOrgVO> getYearRStatEventOrgInfo(@Param("deptIds") List<String> deptIds,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 获取季区域暂态指标分类统计表
|
||||
*
|
||||
* @param deptIds 部门id
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 季区域暂态指标分类统计表
|
||||
*/
|
||||
List<RStatEventOrgVO> getQuarterRStatEventOrgInfo(@Param("deptIds") List<String> deptIds,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 获取月区域暂态指标分类统计表
|
||||
*
|
||||
* @param deptIds 部门id
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 月区域暂态指标分类统计表
|
||||
*/
|
||||
List<RStatEventOrgVO> getMonthRStatEventOrgInfoInfo(@Param("deptIds") List<String> deptIds,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.njcn.event.mapper;
|
||||
|
||||
|
||||
import com.njcn.event.pojo.vo.RStatOrgVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 暂态指标统计
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/10/10
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface RStatOrgMapper {
|
||||
|
||||
/**
|
||||
* 获取年区域暂态指标统计
|
||||
*
|
||||
* @param deptIds 单位id
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 年区域暂态指标统计
|
||||
*/
|
||||
List<RStatOrgVO> getYearRStatOrgInfo(@Param("deptIds") List<String> deptIds,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 获取季区域暂态指标统计
|
||||
*
|
||||
* @param deptIds 单位id
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 季区域暂态指标统计
|
||||
*/
|
||||
List<RStatOrgVO> getQuarterRStatOrgInfo(@Param("deptIds") List<String> deptIds,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 获取月区域暂态指标统计
|
||||
*
|
||||
* @param deptIds 单位id
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 月区域暂态指标统计
|
||||
*/
|
||||
List<RStatOrgVO> getMonthRStatOrgInfo(@Param("deptIds") List<String> deptIds,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.njcn.event.mapper;
|
||||
|
||||
|
||||
import com.njcn.event.pojo.po.PmsMonitorPO;
|
||||
import com.njcn.event.pojo.vo.RStatSubstationVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 变电站暂态指标分类统计
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/10/14
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface RStatSubstationMapper {
|
||||
|
||||
/**
|
||||
* 获取年变电站暂态指标分类统计表
|
||||
*
|
||||
* @param powerrIds 变电站id
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 年变电站暂态指标分类统计表
|
||||
*/
|
||||
List<RStatSubstationVO> getYearInfo(@Param("powerrIds") List<String> powerrIds,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 获取季变电站暂态指标分类统计表
|
||||
*
|
||||
* @param powerrIds 变电站id
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 季变电站暂态指标分类统计表
|
||||
*/
|
||||
List<RStatSubstationVO> getQuarterInfo(@Param("powerrIds") List<String> powerrIds,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 获取月变电站暂态指标分类统计表
|
||||
*
|
||||
* @param powerrIds 变电站id
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 月变电站暂态指标分类统计表
|
||||
*/
|
||||
List<RStatSubstationVO> getMonthInfo(@Param("powerrIds") List<String> powerrIds,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.event.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.event.pojo.vo.RmpEventDetailVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 暂态事件明细
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/10/12
|
||||
*/
|
||||
@Mapper
|
||||
public interface RmpEventDetailMapper extends BaseMapper<RmpEventDetailVO> {
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?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.event.mapper.PmsMonitorMapper">
|
||||
|
||||
<!--根据部门id查询监测点id-->
|
||||
<select id="getMonitorInfo" resultType="com.njcn.event.pojo.po.PmsMonitorPO">
|
||||
SELECT
|
||||
id,
|
||||
`Name`,
|
||||
Org_Name AS orgName,
|
||||
Org_Id AS orgId,
|
||||
Operation_Name AS operationName,
|
||||
Operation_Id AS operationId,
|
||||
Powerr_Name AS powerrName,
|
||||
Powerr_Id AS powerrId,
|
||||
Generatrix_Name AS generatrixName,
|
||||
Generatrix_Id AS generatrixId
|
||||
FROM
|
||||
pms_monitor
|
||||
WHERE
|
||||
Org_Id IN
|
||||
<foreach collection="deptIds" item="item" open="(" close=")" separator="," >
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?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.event.mapper.RStatEventOrgMapper">
|
||||
|
||||
|
||||
<sql id="query_rStatEventOrg_field">
|
||||
rso.org_no AS orgNo,
|
||||
rso.data_date AS dataDate,
|
||||
rso.effective_measurement_average AS effectiveMeasurementAverage,
|
||||
rso.effective_measurement_accrued AS effectiveMeasurementAccrued,
|
||||
rso.event_measurement_average AS eventMeasurementAverage,
|
||||
rso.event_measurement_accrued AS eventMeasurementAccrued,
|
||||
rseo.event_type,
|
||||
rseo.event_measurement_average AS eEventMeasurementAverage,
|
||||
rseo.event_measurement_accrued AS eEventMeasurementAccrued,
|
||||
rseo.event_measurement_ratio_average AS eEventMeasurementRatioAverage,
|
||||
rseo.event_measurement_ratio_accrued AS eEventMeasurementRatioAccrued,
|
||||
rseo.event_freq AS eventFreq,
|
||||
rseo.event_count as eventCount
|
||||
</sql>
|
||||
<sql id="query_rStatEventOrg_where">
|
||||
rso.org_no IN
|
||||
<foreach collection="deptIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND DATE_FORMAT(rso.data_date, '%Y-%m-%d') >= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT(rso.data_date, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<!--指标分类统计表-->
|
||||
<select id="getYearRStatEventOrgInfo" resultType="com.njcn.event.pojo.vo.RStatEventOrgVO">
|
||||
SELECT
|
||||
<include refid="query_rStatEventOrg_field"></include>
|
||||
FROM
|
||||
r_stat_org_y AS rso
|
||||
LEFT JOIN r_stat_event_org_y AS rseo ON rso.org_no = rseo.org_no
|
||||
WHERE
|
||||
<include refid="query_rStatEventOrg_where"></include>
|
||||
</select>
|
||||
|
||||
|
||||
<!--获取季区域暂态指标分类统计表-->
|
||||
<select id="getQuarterRStatEventOrgInfo" resultType="com.njcn.event.pojo.vo.RStatEventOrgVO">
|
||||
SELECT
|
||||
<include refid="query_rStatEventOrg_field"></include>
|
||||
FROM
|
||||
r_stat_org_q AS rso
|
||||
LEFT JOIN r_stat_event_org_q AS rseo ON rso.org_no = rseo.org_no
|
||||
WHERE
|
||||
<include refid="query_rStatEventOrg_where"></include>
|
||||
</select>
|
||||
|
||||
|
||||
<!--获取月区域暂态指标分类统计表-->
|
||||
<select id="getMonthRStatEventOrgInfoInfo" resultType="com.njcn.event.pojo.vo.RStatEventOrgVO">
|
||||
SELECT
|
||||
<include refid="query_rStatEventOrg_field"></include>
|
||||
FROM
|
||||
r_stat_org_m AS rso
|
||||
LEFT JOIN r_stat_event_org_m AS rseo ON rso.org_no = rseo.org_no
|
||||
WHERE
|
||||
<include refid="query_rStatEventOrg_where"></include>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?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.event.mapper.RStatOrgMapper">
|
||||
|
||||
<sql id="query_where">
|
||||
org_no IN
|
||||
<foreach collection="deptIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND DATE_FORMAT(data_date, '%Y-%m-%d') >= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT(data_date, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<sql id="query_field">
|
||||
org_no AS orgNo,
|
||||
data_date AS dataDate,
|
||||
effective_measurement_average AS effectiveMeasurementAverage,
|
||||
effective_measurement_accrued AS effectiveMeasurementAccrued,
|
||||
event_measurement_average AS eventMeasurementAverage,
|
||||
event_measurement_accrued AS eventMeasurementAccrued,
|
||||
event_count AS eventCount,
|
||||
event_freq AS eventFreq
|
||||
</sql>
|
||||
|
||||
|
||||
<!--获取年区域暂态指标统计-->
|
||||
<select id="getYearRStatOrgInfo" resultType="com.njcn.event.pojo.vo.RStatOrgVO">
|
||||
SELECT
|
||||
<include refid="query_field"></include>
|
||||
FROM
|
||||
r_stat_org_y
|
||||
WHERE
|
||||
<include refid="query_where"></include>
|
||||
</select>
|
||||
|
||||
<!--获取季区域暂态指标统计-->
|
||||
<select id="getQuarterRStatOrgInfo" resultType="com.njcn.event.pojo.vo.RStatOrgVO">
|
||||
SELECT
|
||||
<include refid="query_field"></include>
|
||||
FROM
|
||||
r_stat_org_q
|
||||
WHERE
|
||||
<include refid="query_where"></include>
|
||||
</select>
|
||||
|
||||
<!--获取月区域暂态指标统计-->
|
||||
<select id="getMonthRStatOrgInfo" resultType="com.njcn.event.pojo.vo.RStatOrgVO">
|
||||
SELECT
|
||||
<include refid="query_field"></include>
|
||||
FROM
|
||||
r_stat_org_m
|
||||
WHERE
|
||||
<include refid="query_where"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?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.event.mapper.RStatSubstationMapper">
|
||||
|
||||
<sql id="query_field">
|
||||
substation_id AS substationId,
|
||||
data_date AS dataDate,
|
||||
effective_measurement_average AS effectiveMeasurementAverage,
|
||||
effective_measurement_accrued AS effectiveMeasurementAccrued,
|
||||
event_count AS eventCount,
|
||||
event_freq AS eventFreq,
|
||||
interrupt_count AS interruptCount,
|
||||
interrupt_freq AS interruptFreq,
|
||||
swell_count AS swellCount,
|
||||
swell_freq AS swellFreq,
|
||||
sag_count AS sagCount,
|
||||
sag_freq AS sagFreq
|
||||
</sql>
|
||||
<sql id="query_where">
|
||||
substation_id IN
|
||||
<foreach collection="powerrIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND DATE_FORMAT( data_date,'%Y-%m-%d') >= DATE_FORMAT(#{startTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT( data_date,'%Y-%m-%d') <= DATE_FORMAT(#{endTime},'%Y-%m-%d')
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<!--获取年变电站暂态指标分类统计表-->
|
||||
<select id="getYearInfo" resultType="com.njcn.event.pojo.vo.RStatSubstationVO">
|
||||
SELECT
|
||||
<include refid="query_field"></include>
|
||||
FROM
|
||||
r_stat_substation_y
|
||||
WHERE
|
||||
<include refid="query_where"></include>
|
||||
</select>
|
||||
|
||||
<!--获取季变电站暂态指标分类统计表-->
|
||||
<select id="getQuarterInfo" resultType="com.njcn.event.pojo.vo.RStatSubstationVO">
|
||||
SELECT
|
||||
<include refid="query_field"></include>
|
||||
FROM
|
||||
r_stat_substation_q
|
||||
WHERE
|
||||
<include refid="query_where"></include>
|
||||
</select>
|
||||
|
||||
<!--获取月变电站暂态指标分类统计表-->
|
||||
<select id="getMonthInfo" resultType="com.njcn.event.pojo.vo.RStatSubstationVO">
|
||||
SELECT
|
||||
<include refid="query_field"></include>
|
||||
FROM
|
||||
r_stat_substation_m
|
||||
WHERE
|
||||
<include refid="query_where"></include>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,4 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.event.mapper.RmpEventDetailMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.abel533.echarts.code.X;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.dto.wave.WaveDataDTO;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.njcn.event.service.Impl;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.event.mapper.PmsMonitorMapper;
|
||||
import com.njcn.event.mapper.RmpEventDetailMapper;
|
||||
import com.njcn.event.pojo.param.UniversalFrontEndParam;
|
||||
import com.njcn.event.pojo.po.PmsMonitorPO;
|
||||
import com.njcn.event.pojo.vo.RStatOrgVO;
|
||||
import com.njcn.event.pojo.vo.RStatSubstationVO;
|
||||
import com.njcn.event.pojo.vo.RmpEventDetailVO;
|
||||
import com.njcn.event.service.RmpEventDetailService;
|
||||
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.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 暂态事件明细
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/10/12
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper, RmpEventDetailVO> implements RmpEventDetailService {
|
||||
|
||||
private final RmpEventDetailMapper rmpEventDetailMapper;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
private final PmsMonitorMapper pmsMonitorMapper;
|
||||
|
||||
/**
|
||||
* 获取暂态事件明细
|
||||
*
|
||||
* @param param 前端参数
|
||||
* @return 暂态事件明细
|
||||
*/
|
||||
@Override
|
||||
public List<RmpEventDetailVO> getRmpEventDetail(UniversalFrontEndParam param) {
|
||||
|
||||
// 获取当前用户的部门的子部门信息
|
||||
List<DeptDTO> data = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
|
||||
if (CollectionUtil.isNotEmpty(data)) {
|
||||
//创建返回集合
|
||||
List<RmpEventDetailVO> info = new ArrayList<>();
|
||||
|
||||
// 过滤出部门id
|
||||
List<String> deptIds = data.stream().map(DeptDTO::getId).collect(Collectors.toList());
|
||||
|
||||
// 根据部门id查询监测点id
|
||||
List<PmsMonitorPO> monitorInfo = pmsMonitorMapper.getMonitorInfo(deptIds);
|
||||
|
||||
|
||||
|
||||
return info;
|
||||
} else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,334 @@
|
||||
package com.njcn.event.service.Impl;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.event.mapper.PmsMonitorMapper;
|
||||
import com.njcn.event.mapper.RStatEventOrgMapper;
|
||||
import com.njcn.event.mapper.RStatOrgMapper;
|
||||
import com.njcn.event.mapper.RStatSubstationMapper;
|
||||
import com.njcn.event.pojo.param.UniversalFrontEndParam;
|
||||
import com.njcn.event.pojo.po.PmsMonitorPO;
|
||||
import com.njcn.event.pojo.vo.RStatEventOrgVO;
|
||||
import com.njcn.event.pojo.vo.RStatOrgVO;
|
||||
import com.njcn.event.pojo.vo.RStatSubstationVO;
|
||||
import com.njcn.event.service.StatisticsOfTransientIndicatorssService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
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.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 暂态指标统计
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/10/10
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class StatisticsOfTransientIndicatorssServiceImpl implements StatisticsOfTransientIndicatorssService {
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final RStatOrgMapper rStatOrgMapper;
|
||||
|
||||
private final RStatEventOrgMapper rStatEventOrgMapper;
|
||||
|
||||
private final RStatSubstationMapper rStatSubstationMapper;
|
||||
|
||||
private final PmsMonitorMapper pmsMonitorMapper;
|
||||
|
||||
/**
|
||||
* 获取区域暂态指标统计
|
||||
*
|
||||
* @param param 前端参数
|
||||
* @return 区域暂态指标统计
|
||||
*/
|
||||
@Override
|
||||
public List<RStatOrgVO> getRStatOrg(UniversalFrontEndParam param) {
|
||||
|
||||
// 获取当前用户的部门的子部门信息
|
||||
List<DeptDTO> data = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
|
||||
|
||||
if (CollectionUtil.isNotEmpty(data)) {
|
||||
// 创建返回集合
|
||||
List<RStatOrgVO> info = new ArrayList<>();
|
||||
|
||||
// 过滤出部门id
|
||||
List<String> deptIds = data.stream().map(DeptDTO::getId).collect(Collectors.toList());
|
||||
|
||||
// 类型(1年 2季度 3月份 4日
|
||||
switch (param.getType()) {
|
||||
case 1:
|
||||
// 获取年区域暂态指标统计
|
||||
info = rStatOrgMapper.getYearRStatOrgInfo(deptIds, param.getStartTime(), param.getEndTime());
|
||||
break;
|
||||
case 2:
|
||||
// 获取季区域暂态指标统计
|
||||
info = rStatOrgMapper.getQuarterRStatOrgInfo(deptIds, param.getStartTime(), param.getEndTime());
|
||||
break;
|
||||
case 3:
|
||||
// 获取月区域暂态指标统计
|
||||
info = rStatOrgMapper.getMonthRStatOrgInfo(deptIds, param.getStartTime(), param.getEndTime());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
for (RStatOrgVO rStatOrgVO : info) {
|
||||
rStatOrgVO.setEventMeasurementRatioAverage(rStatOrgVO.getEventMeasurementAverage() / rStatOrgVO.getEffectiveMeasurementAverage());
|
||||
rStatOrgVO.setEventMeasurementRatioAccrued(rStatOrgVO.getEventMeasurementAccrued() / rStatOrgVO.getEffectiveMeasurementAccrued());
|
||||
}
|
||||
|
||||
// 匹配单位名称
|
||||
for (DeptDTO dto : data) {
|
||||
for (RStatOrgVO vo : info) {
|
||||
if (dto.getId().equals(vo.getOrgNo())) {
|
||||
vo.setOrgName(dto.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return info;
|
||||
} else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取区域暂态指标分类统计表
|
||||
*
|
||||
* @param param 前端参数
|
||||
* @return 区域暂态指标分类统计表
|
||||
*/
|
||||
@Override
|
||||
public List<RStatEventOrgVO> getRStatEventOrg(UniversalFrontEndParam param) {
|
||||
|
||||
// 获取当前用户的部门的子部门信息
|
||||
List<DeptDTO> data = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
|
||||
if (CollectionUtil.isNotEmpty(data)) {
|
||||
|
||||
//创建返回集合
|
||||
List<RStatEventOrgVO> info = new ArrayList<>();
|
||||
|
||||
// 根据暂态指标枚举查询暂态指标
|
||||
List<DictData> eventStatis = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
|
||||
|
||||
List<RStatEventOrgVO> temp = new ArrayList<>();
|
||||
|
||||
// 过滤出部门id
|
||||
List<String> deptIds = data.stream().map(DeptDTO::getId).collect(Collectors.toList());
|
||||
|
||||
// 类型(1年 2季度 3月份 4日
|
||||
switch (param.getType()) {
|
||||
case 1:
|
||||
// 获取年区域暂态指标分类统计表
|
||||
temp = rStatEventOrgMapper.getYearRStatEventOrgInfo(deptIds, param.getStartTime(), param.getEndTime());
|
||||
break;
|
||||
case 2:
|
||||
// 获取季区域暂态指标分类统计表
|
||||
temp = rStatEventOrgMapper.getQuarterRStatEventOrgInfo(deptIds, param.getStartTime(), param.getEndTime());
|
||||
break;
|
||||
case 3:
|
||||
// 获取月区域暂态指标分类统计表
|
||||
temp = rStatEventOrgMapper.getMonthRStatEventOrgInfoInfo(deptIds, param.getStartTime(), param.getEndTime());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Map<String, List<RStatEventOrgVO>> map = temp
|
||||
.stream().collect(Collectors.groupingBy(RStatEventOrgVO::getOrgNo));
|
||||
|
||||
map.forEach((orgOn, rStatEventOrgVOs) -> {
|
||||
RStatEventOrgVO rStatEventOrgVO = new RStatEventOrgVO();
|
||||
// 基础属性赋值
|
||||
for (RStatEventOrgVO tmp : rStatEventOrgVOs) {
|
||||
if (rStatEventOrgVO.getOrgNo() == null) {
|
||||
rStatEventOrgVO.setOrgNo(tmp.getOrgNo());
|
||||
rStatEventOrgVO.setDataDate(tmp.getDataDate());
|
||||
rStatEventOrgVO.setEffectiveMeasurementAverage(tmp.getEffectiveMeasurementAverage());
|
||||
rStatEventOrgVO.setEffectiveMeasurementAccrued(tmp.getEffectiveMeasurementAccrued());
|
||||
rStatEventOrgVO.setEventMeasurementAverage(tmp.getEventMeasurementAverage());
|
||||
rStatEventOrgVO.setEventMeasurementAccrued(tmp.getEventMeasurementAccrued());
|
||||
rStatEventOrgVO.setEventMeasurementRatioAverage(tmp.getEventMeasurementAverage() / tmp.getEffectiveMeasurementAverage());
|
||||
rStatEventOrgVO.setEventMeasurementRatioAccrued(tmp.getEventMeasurementAccrued() / tmp.getEffectiveMeasurementAccrued());
|
||||
}
|
||||
|
||||
}
|
||||
for (RStatEventOrgVO tmp : rStatEventOrgVOs) {
|
||||
// 暂态指标赋值
|
||||
for (DictData eventStati : eventStatis) {
|
||||
if (eventStati.getId().equals(tmp.getEventType())) {
|
||||
if (eventStati.getCode().equals(RStatEventOrgVO.SHORT_INTERRUPTIONS)) {
|
||||
// 日均短时中断
|
||||
rStatEventOrgVO.setDayShortInterruptions(tmp.getEEventMeasurementAverage());
|
||||
// 累计短时中断
|
||||
rStatEventOrgVO.setCumulativeShortInterruptions(tmp.getEventMeasurementAccrued());
|
||||
// 日均短时中断占比
|
||||
rStatEventOrgVO.setDayShortInterruptionsProportion(tmp.getEEventMeasurementRatioAverage());
|
||||
// 累计短时中断占比
|
||||
rStatEventOrgVO.setCumulativeShortInterruptionsProportion(tmp.getEEventMeasurementRatioAccrued());
|
||||
// 短时中断监测点数
|
||||
rStatEventOrgVO.setShortInterruptionsMonitor(314159);
|
||||
// 短时中断占比
|
||||
rStatEventOrgVO.setShortInterruptionsProportion(3.14159);
|
||||
// 短时中断次数
|
||||
rStatEventOrgVO.setShortInterruptionsCount(tmp.getEEventCount());
|
||||
// 短时中断频次
|
||||
rStatEventOrgVO.setShortInterruptionsFrequency(tmp.getEEventFreq());
|
||||
} else if (eventStati.getCode().equals(RStatEventOrgVO.VOLTAGE_RISE)) {
|
||||
// 日均电压暂升
|
||||
rStatEventOrgVO.setDayVoltageRise(tmp.getEEventMeasurementAverage());
|
||||
// 累计电压暂升
|
||||
rStatEventOrgVO.setCumulativeVoltageRise(tmp.getEventMeasurementAccrued());
|
||||
// 日均电压暂升占比
|
||||
rStatEventOrgVO.setDayVoltageRiseProportion(tmp.getEEventMeasurementRatioAverage());
|
||||
// 累计电压暂升占比
|
||||
rStatEventOrgVO.setCumulativeVoltageRiseProportion(tmp.getEEventMeasurementRatioAccrued());
|
||||
// 电压暂升占比
|
||||
rStatEventOrgVO.setVoltageRiseProportion(3.14159);
|
||||
// 电压暂升次数
|
||||
rStatEventOrgVO.setVoltageRiseCount(tmp.getEEventCount());
|
||||
// 电压暂升频次
|
||||
rStatEventOrgVO.setVoltageRiseFrequency(tmp.getEEventFreq());
|
||||
} else if (eventStati.getCode().equals(RStatEventOrgVO.VOLTAGE_DIP)) {
|
||||
// 日均电压暂降
|
||||
rStatEventOrgVO.setDayVoltageDip(tmp.getEEventMeasurementAverage());
|
||||
// 累计电压暂降
|
||||
rStatEventOrgVO.setCumulativeVoltageDip(tmp.getEventMeasurementAccrued());
|
||||
// 日均电压暂降占比
|
||||
rStatEventOrgVO.setDayVoltageDipProportion(tmp.getEEventMeasurementRatioAverage());
|
||||
// 累计电压暂降占比
|
||||
rStatEventOrgVO.setCumulativeVoltageDipProportion(tmp.getEEventMeasurementRatioAccrued());
|
||||
// 电压暂升占比
|
||||
rStatEventOrgVO.setVoltageDipProportion(3.14159);
|
||||
// 电压暂降次数
|
||||
rStatEventOrgVO.setVoltageDipCount(tmp.getEEventCount());
|
||||
// 电压暂降频次
|
||||
rStatEventOrgVO.setVoltageDipFrequency(tmp.getEEventFreq());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
info.add(rStatEventOrgVO);
|
||||
});
|
||||
|
||||
// 匹配单位名称
|
||||
for (DeptDTO dto : data) {
|
||||
for (RStatEventOrgVO vo : info) {
|
||||
if (dto.getId().equals(vo.getOrgNo())) {
|
||||
vo.setOrgName(dto.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return info;
|
||||
} else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取变电站暂态指标分类统计表
|
||||
*
|
||||
* @param param 前端传入参数
|
||||
* @return 变电站暂态指标分类统计表
|
||||
*/
|
||||
@Override
|
||||
public List<RStatSubstationVO> getRStatSubstation
|
||||
(UniversalFrontEndParam param) {
|
||||
|
||||
// 获取当前用户的部门的子部门信息
|
||||
List<DeptDTO> data = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
|
||||
|
||||
if (CollectionUtil.isNotEmpty(data)) {
|
||||
//创建返回集合
|
||||
List<RStatSubstationVO> info = new ArrayList<>();
|
||||
|
||||
// 过滤出部门id
|
||||
List<String> deptIds = data.stream().map(DeptDTO::getId).collect(Collectors.toList());
|
||||
|
||||
// 创建集合用于封装查询出的监测点信息
|
||||
List<PmsMonitorPO> mInfo = new ArrayList<>();
|
||||
|
||||
|
||||
// 根据部门id查询监测点id
|
||||
List<PmsMonitorPO> monitorInfo = pmsMonitorMapper.getMonitorInfo(deptIds);
|
||||
|
||||
// 过滤出变电站id
|
||||
List<String> powerrIds = new ArrayList<>();
|
||||
|
||||
// 判断前端参数是否传入的变电站名称
|
||||
if (param.getSubName() != null) {
|
||||
for (PmsMonitorPO po : monitorInfo) {
|
||||
if (po.getPowerrName().contains(param.getSubName())) {
|
||||
PmsMonitorPO pmsMonitor = new PmsMonitorPO();
|
||||
BeanUtils.copyProperties(po,pmsMonitor);
|
||||
mInfo.add(pmsMonitor);
|
||||
}
|
||||
}
|
||||
powerrIds = mInfo.stream().map(PmsMonitorPO::getPowerrId).collect(Collectors.toList());
|
||||
}else {
|
||||
powerrIds = monitorInfo.stream().map(PmsMonitorPO::getPowerrId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
// 类型(1年 2季度 3月份 4日
|
||||
switch (param.getType()) {
|
||||
case 1:
|
||||
// 获取年变电站暂态指标分类统计表
|
||||
info = rStatSubstationMapper.getYearInfo(powerrIds, param.getStartTime(), param.getEndTime());
|
||||
break;
|
||||
case 2:
|
||||
// 获取季变电站暂态指标分类统计表
|
||||
info = rStatSubstationMapper.getQuarterInfo(powerrIds, param.getStartTime(), param.getEndTime());
|
||||
break;
|
||||
case 3:
|
||||
// 获取月变电站暂态指标分类统计表
|
||||
info = rStatSubstationMapper.getMonthInfo(powerrIds, param.getStartTime(), param.getEndTime());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// 匹配单位名称
|
||||
for (RStatSubstationVO vo : info) {
|
||||
for (PmsMonitorPO pmsMonitor : monitorInfo) {
|
||||
if (vo.getSubstationId().equals(pmsMonitor.getPowerrId())) {
|
||||
vo.setDeptId(pmsMonitor.getOrgId());
|
||||
vo.setDeptName(pmsMonitor.getOrgName());
|
||||
vo.setSubstationName(pmsMonitor.getPowerrName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return info;
|
||||
} else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.event.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.event.pojo.param.UniversalFrontEndParam;
|
||||
import com.njcn.event.pojo.vo.RmpEventDetailVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 暂态事件明细
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/10/12
|
||||
*/
|
||||
|
||||
public interface RmpEventDetailService extends IService<RmpEventDetailVO> {
|
||||
|
||||
/**
|
||||
* 获取暂态事件明细
|
||||
* @param param 前端参数
|
||||
* @return 暂态事件明细
|
||||
*/
|
||||
List<RmpEventDetailVO> getRmpEventDetail(UniversalFrontEndParam param);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.njcn.event.service;
|
||||
|
||||
import com.njcn.event.pojo.param.UniversalFrontEndParam;
|
||||
import com.njcn.event.pojo.vo.RStatEventOrgVO;
|
||||
import com.njcn.event.pojo.vo.RStatOrgVO;
|
||||
import com.njcn.event.pojo.vo.RStatSubstationVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 暂态指标统计
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/10/10
|
||||
*/
|
||||
|
||||
public interface StatisticsOfTransientIndicatorssService{
|
||||
|
||||
/**
|
||||
* 获取区域暂态指标统计
|
||||
*
|
||||
* @param param 前端参数
|
||||
* @return 获取区域暂态指标统计
|
||||
*/
|
||||
List<RStatOrgVO> getRStatOrg(UniversalFrontEndParam param);
|
||||
|
||||
/**
|
||||
* 获取区域暂态指标分类统计表
|
||||
* @param param 前端参数
|
||||
* @return 区域暂态指标分类统计表
|
||||
*/
|
||||
List<RStatEventOrgVO> getRStatEventOrg(UniversalFrontEndParam param);
|
||||
|
||||
/**
|
||||
* 获取变电站暂态指标分类统计表
|
||||
*
|
||||
* @param param 前端传入参数
|
||||
* @return 变电站暂态指标分类统计表
|
||||
*/
|
||||
List<RStatSubstationVO> getRStatSubstation(UniversalFrontEndParam param);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.njcn.harmonic.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.harmonic.constant.HarmonicValidMessage;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/10/13 9:46【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@ApiModel(value="com-njcn-harmonic-pojo-po-PollutionSubstationQuryParam",description = "污染指标查询参数")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PollutionSubstationQuryParam extends DeviceInfoParam {
|
||||
|
||||
@ApiModelProperty("污区图统计类型,根据Pollution_Statis查询码表接口获取所有类型选择一个即可")
|
||||
@NotNull(message = HarmonicValidMessage.DATA_NOT_BLANK)
|
||||
private SimpleDTO pollutionStatis;
|
||||
|
||||
@ApiModelProperty("时间 格式:(yyyy-MM)")
|
||||
@NotNull(message = HarmonicValidMessage.DATA_NOT_BLANK)
|
||||
private String localDate;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.njcn.harmonic.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/10/10 19:59【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
/**
|
||||
* 谐波畸变率排名
|
||||
*/
|
||||
@ApiModel(value="com-njcn-harmonic-pojo-po-RMpVThd")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "r_mp_v_thd")
|
||||
public class RMpVThd implements Serializable {
|
||||
/**
|
||||
* 监测点ID
|
||||
*/
|
||||
@TableField(value = "measurement_point_id")
|
||||
@ApiModelProperty(value="监测点ID")
|
||||
private String measurementPointId;
|
||||
|
||||
/**
|
||||
* 排名类型,字典表(1年 2季度 3月份 4周 5日)
|
||||
*/
|
||||
@TableField(value = "data_type")
|
||||
@ApiModelProperty(value="排名类型,字典表(1年 2季度 3月份 4周 5日)")
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
@TableField(value = "data_date")
|
||||
@ApiModelProperty(value="时间")
|
||||
private Date dataDate;
|
||||
|
||||
/**
|
||||
* 谐波畸变率
|
||||
*/
|
||||
@TableField(value = "v_thd")
|
||||
@ApiModelProperty(value="谐波畸变率")
|
||||
private Double vThd;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.njcn.harmonic.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (RStatHarmonicOrgD)实体类
|
||||
*
|
||||
* @author qijian
|
||||
* @since 2022-10-09 11:00:09
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "r_stat_harmonic_org_d")
|
||||
public class RStatHarmonicOrgD implements Serializable {
|
||||
private static final long serialVersionUID = -42929641369158167L;
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
private String orgNo;
|
||||
/**
|
||||
* 生成数据的时间,每日统计一次
|
||||
*/
|
||||
private Date dataDate;
|
||||
/**
|
||||
* 稳态指标类型Id,字典表ID
|
||||
*/
|
||||
private String harmonicType;
|
||||
/**
|
||||
* 超标监测点数(监测点指标统计明细日表 统计)
|
||||
*/
|
||||
private Integer overLimitMeasurementAverage;
|
||||
/**
|
||||
* 超标监测点数(监测点指标统计明细日表 统计)
|
||||
*/
|
||||
private Float overLimitMeasurementRatioAverage;
|
||||
/**
|
||||
* 数据类型,字典表(01:主网测点 02:配网测点)
|
||||
*/
|
||||
private String dataType;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.njcn.harmonic.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (RStatHarmonicOrgM)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2022-10-09 11:38:21
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "r_stat_harmonic_org_m")
|
||||
public class RStatHarmonicOrgM implements Serializable {
|
||||
private static final long serialVersionUID = -57834557125584612L;
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
private String orgNo;
|
||||
/**
|
||||
* 生成数据的时间,每月统计一次
|
||||
*/
|
||||
private Date dataDate;
|
||||
/**
|
||||
* 稳态指标类型Id,字典表ID
|
||||
*/
|
||||
private String harmonicType;
|
||||
/**
|
||||
* 日均超标监测点数(根据 日表的超标监测点数 取平均值)
|
||||
*/
|
||||
private Integer overLimitMeasurementAverage;
|
||||
/**
|
||||
* 累计超标监测点数(监测点指标统计明细日表 统计)
|
||||
*/
|
||||
private Integer overLimitMeasurementAccrued;
|
||||
/**
|
||||
* 累计超标天数(根据 日表的超标监测点数 求和)
|
||||
*/
|
||||
private Integer overDay;
|
||||
/**
|
||||
* 日均超标监测点数占比(根据 日表的超标监测点数占比 取平均值)
|
||||
*/
|
||||
private Float overLimitMeasurementRatioAverage;
|
||||
/**
|
||||
* 累计超标监测点数占比(此表的累计超标监测点数/区域统计表中的区域分类统计月表中的累计有效接入监测点数)
|
||||
*/
|
||||
private Float overLimitMeasurementRatioAccrued;
|
||||
/**
|
||||
* 数据类型,字典表(01:主网测点 02:配网测点)
|
||||
*/
|
||||
private String dataType;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.njcn.harmonic.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (RStatHarmonicOrgQ)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2022-10-09 11:38:30
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "r_stat_harmonic_org_q")
|
||||
public class RStatHarmonicOrgQ implements Serializable {
|
||||
private static final long serialVersionUID = -43036071975463523L;
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
private String orgNo;
|
||||
/**
|
||||
* 生成数据的时间,每季度统计一次
|
||||
*/
|
||||
private Date dataDate;
|
||||
/**
|
||||
* 稳态指标类型Id,字典表ID
|
||||
*/
|
||||
private String harmonicType;
|
||||
/**
|
||||
* 日均超标监测点数(根据 日表的超标监测点数 取平均值)
|
||||
*/
|
||||
private Integer overLimitMeasurementAverage;
|
||||
/**
|
||||
* 累计超标监测点数(监测点指标统计明细日表 统计)
|
||||
*/
|
||||
private Integer overLimitMeasurementAccrued;
|
||||
/**
|
||||
* 平均超标天数(月表的累计超标天数之和/月表的累计超标监测点数之和)
|
||||
*/
|
||||
private Float averageOverDay;
|
||||
/**
|
||||
* 日均超标监测点数占比(根据 日表的超标监测点数占比 取平均值)
|
||||
*/
|
||||
private Float overLimitMeasurementRatioAverage;
|
||||
/**
|
||||
* 累计超标监测点数占比(此表的累计超标监测点数/区域统计表中的区域分类统计季表中的累计有效接入监测点数)
|
||||
*/
|
||||
private Float overLimitMeasurementRatioAccrued;
|
||||
/**
|
||||
* 数据类型,字典表(01:主网测点 02:配网测点)
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.njcn.harmonic.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (RStatHarmonicOrgY)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2022-10-09 11:38:46
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "r_stat_harmonic_org_y")
|
||||
public class RStatHarmonicOrgY implements Serializable {
|
||||
private static final long serialVersionUID = 562563173347880887L;
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
private String orgNo;
|
||||
/**
|
||||
* 生成数据的时间,每季度统计一次
|
||||
*/
|
||||
private Date dataDate;
|
||||
/**
|
||||
* 稳态指标类型Id,字典表ID
|
||||
*/
|
||||
private String harmonicType;
|
||||
/**
|
||||
* 日均超标监测点数(根据 日表的超标监测点数 取平均值)
|
||||
*/
|
||||
private Integer overLimitMeasurementAverage;
|
||||
/**
|
||||
* 累计超标监测点数(监测点指标统计明细日表 统计)
|
||||
*/
|
||||
private Integer overLimitMeasurementAccrued;
|
||||
/**
|
||||
* 平均超标天数(月表的累计超标天数之和/月表的累计超标监测点数之和)
|
||||
*/
|
||||
private Float averageOverDay;
|
||||
/**
|
||||
* 日均超标监测点数占比(根据 日表的超标监测点数占比 取平均值)
|
||||
*/
|
||||
private Float overLimitMeasurementRatioAverage;
|
||||
/**
|
||||
* 累计超标监测点数占比(此表的累计超标监测点数/区域统计表中的区域分类统计季表中的累计有效接入监测点数)
|
||||
*/
|
||||
private Float overLimitMeasurementRatioAccrued;
|
||||
/**
|
||||
* 数据类型,字典表(01:主网测点 02:配网测点)
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.njcn.harmonic.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/10/13 13:58【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 变电站污区图统计月表
|
||||
*/
|
||||
@ApiModel(value = "com-njcn-harmonic-pojo-po-RStatPollutionSubstationM")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "r_stat_pollution_substation_m")
|
||||
public class RStatPollutionSubstationM implements Serializable {
|
||||
/**
|
||||
* 变电站id
|
||||
*/
|
||||
@TableField(value = "substation_id")
|
||||
@ApiModelProperty(value = "变电站id")
|
||||
private String substationId;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
@TableField(value = "data_date")
|
||||
@ApiModelProperty(value = "时间")
|
||||
private Date dataDate;
|
||||
|
||||
/**
|
||||
* 污区图统计类型
|
||||
*/
|
||||
@TableField(value = "pollution_type")
|
||||
@ApiModelProperty(value = "污区图统计类型")
|
||||
private String pollutionType;
|
||||
|
||||
/**
|
||||
* 统计值
|
||||
*/
|
||||
@TableField(value = "value")
|
||||
@ApiModelProperty(value = "统计值")
|
||||
private Double value;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class HistoryHarmOverLimitVO implements Serializable {
|
||||
@ApiModelProperty("指标名称")
|
||||
private String targetName;
|
||||
|
||||
@ApiModelProperty("指标类型")
|
||||
@ApiModelProperty("指标类型:12-电压偏差;13-三相电压不平衡度;15-电压总谐波畸变率;22-负序电流;30-频率;40-谐波电压含有率;43-谐波电流幅值;46-间谐波电压含有率;61-长时闪变")
|
||||
private String targetCode;
|
||||
|
||||
@ApiModelProperty("统计方式")
|
||||
@@ -43,22 +43,22 @@ public class HistoryHarmOverLimitVO implements Serializable {
|
||||
private String scale;
|
||||
|
||||
@ApiModelProperty("时间")
|
||||
private String time;
|
||||
private String timeId;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("最大值")
|
||||
private Float maxValue;
|
||||
private Float maxData;
|
||||
|
||||
@ApiModelProperty("最小值")
|
||||
private Float minValue;
|
||||
private Float minData;
|
||||
|
||||
@ApiModelProperty("平均值")
|
||||
private Float avgValue;
|
||||
private Float avgData;
|
||||
|
||||
@ApiModelProperty("95概率值")
|
||||
private Float cp95Value;
|
||||
private Float cp95Data;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/10/13 9:46【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@ApiModel(value="com-njcn-harmonic-pojo-vo-PollutionSubstationVO",description = "污染指标查询参数")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PollutionSubstationVO {
|
||||
|
||||
|
||||
@ApiModelProperty("变电站id")
|
||||
private String substationId;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String substationName;
|
||||
|
||||
@ApiModelProperty("变电站经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@ApiModelProperty("变电站纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@ApiModelProperty("污区图统计类型")
|
||||
private String pollutionStatis;
|
||||
|
||||
@ApiModelProperty("污染指标值")
|
||||
private Double pollutionData = -1.0;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/10/10 20:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@ApiModel(value="com-njcn-harmonic-pojo-vo-RMpVThdVO")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class RMpVThdVO {
|
||||
|
||||
|
||||
@ApiModelProperty(value="监测点ID")
|
||||
private String measurementPointId;
|
||||
|
||||
@ApiModelProperty(value="监测点名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排名类型,字典表(0日,1月,2季,3年)
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value="排名类型,字典表(1年 2季度 3月份 4周 5日)")
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value="时间")
|
||||
private Date dataDate;
|
||||
|
||||
/**
|
||||
* 谐波畸变率
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value="谐波畸变率")
|
||||
private Double vThd;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author qijian
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/10/9 - 11:09
|
||||
*/
|
||||
@Data
|
||||
public class StatHarmonicOrgVO {
|
||||
|
||||
@ApiModelProperty(name = "id", value = "id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(name = "name", value = "单位名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(name = "ratio", value = "监测点占比")
|
||||
private Float ratio;
|
||||
|
||||
@ApiModelProperty(name = "count", value = "监测点数")
|
||||
private Integer count;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,11 +3,13 @@ package com.njcn.harmonic.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.param.StatisticsBizBaseParam;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.harmonic.pojo.param.HistoryParam;
|
||||
import com.njcn.harmonic.pojo.param.NormHistoryParam;
|
||||
import com.njcn.harmonic.pojo.vo.HistoryDataResultVO;
|
||||
import com.njcn.harmonic.pojo.vo.StatHarmonicOrgVO;
|
||||
import com.njcn.harmonic.service.HistoryResultService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -16,9 +18,11 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
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 java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -55,4 +59,15 @@ public class HistoryResultController extends BaseController {
|
||||
List<HistoryDataResultVO> list = historyResultService.getHistoryLineData(normHistoryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getHarmonicProportion")
|
||||
@ApiOperation("获取谐波越限监测点占比")
|
||||
@ApiImplicitParam(name = "statisticsBizBaseParam", value = "谐波越限监测点参数", required = true)
|
||||
public HttpResult<List<StatHarmonicOrgVO>> getHistoryLineData(@RequestBody @Validated StatisticsBizBaseParam statisticsBizBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("getHarmonicProportion");
|
||||
List<StatHarmonicOrgVO> list = historyResultService.getHarmonicProportion(statisticsBizBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,17 @@ public class NormLimitController extends BaseController {
|
||||
@ApiImplicitParam(name = "historyHarmOverLimitParam", value = "异常数据统计参数", required = true)
|
||||
public HttpResult<List<HistoryHarmOverLimitVO>> getHistoryTableData(@RequestBody @Validated HistoryHarmOverLimitParam historyHarmOverLimitParam) {
|
||||
String methodDescribe = getMethodDescribe("getHistoryTableData");
|
||||
List<HistoryHarmOverLimitVO> list = normLimitService.getHistoryTableData(historyHarmOverLimitParam);
|
||||
List<HistoryHarmOverLimitVO> list = normLimitService.getHistoryData(historyHarmOverLimitParam,0);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getHistoryData")
|
||||
@ApiOperation("告警数据统计")
|
||||
@ApiImplicitParam(name = "historyHarmOverLimitParam", value = "异常数据统计参数", required = true)
|
||||
public HttpResult<List<HistoryHarmOverLimitVO>> getHistoryData(@RequestBody @Validated HistoryHarmOverLimitParam historyHarmOverLimitParam) {
|
||||
String methodDescribe = getMethodDescribe("getHistoryTableData");
|
||||
List<HistoryHarmOverLimitVO> list = normLimitService.getHistoryData(historyHarmOverLimitParam,1);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.njcn.harmonic.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.common.utils.LogUtil;
|
||||
import com.njcn.harmonic.pojo.param.PollutionSubstationQuryParam;
|
||||
import com.njcn.harmonic.pojo.vo.PollutionSubstationVO;
|
||||
import com.njcn.harmonic.service.PollutionSubstationService;
|
||||
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.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 java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/10/13 9:39【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/PollutionSubstation")
|
||||
@Api(tags = "变电站污染统计")
|
||||
@AllArgsConstructor
|
||||
public class PollutionSubstationController extends BaseController {
|
||||
|
||||
private final PollutionSubstationService pollutionSubstationService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getPollutionSubstationData")
|
||||
@ApiOperation("按变电站及指标类型展示污染")
|
||||
@ApiImplicitParam(name = "pollutionSubstationQuryParam", value = "污染指标查询参数", required = true)
|
||||
public HttpResult<List<PollutionSubstationVO>> getPollutionSubstationData(@RequestBody @Validated PollutionSubstationQuryParam pollutionSubstationQuryParam) {
|
||||
String methodDescribe = getMethodDescribe ("getPollutionSubstationData");
|
||||
LogUtil.njcnDebug(log, "{},实体参数:{}", methodDescribe, pollutionSubstationQuryParam);
|
||||
List<PollutionSubstationVO> list = pollutionSubstationService.getPollutionSubstationData (pollutionSubstationQuryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult (CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,9 +3,11 @@ package com.njcn.harmonic.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.param.StatisticsBizBaseParam;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.harmonic.pojo.vo.RMpVThdVO;
|
||||
import com.njcn.harmonic.pojo.vo.THDistortionCensusVO;
|
||||
import com.njcn.harmonic.pojo.vo.THDistortionVO;
|
||||
import com.njcn.harmonic.service.THDistortionService;
|
||||
@@ -58,5 +60,15 @@ public class THDController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, censusVO, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getTHDTopTenData")
|
||||
@ApiOperation("谐波总畸变率前十列表")
|
||||
@ApiImplicitParam(name = "statisticsBizBaseParam", value = "业务参数", required = true)
|
||||
public HttpResult<List<RMpVThdVO>> getTHDTopTenData(@RequestBody @Validated StatisticsBizBaseParam statisticsBizBaseParam){
|
||||
String methodDescribe = getMethodDescribe("getTHDTopTenData");
|
||||
List<RMpVThdVO> list = thDistortionService.getTHDTopTenData(statisticsBizBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.vo.HistoryHarmOverLimitVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年10月13日 10:05
|
||||
*/
|
||||
public interface NormLimitMapper extends BaseMapper<HistoryHarmOverLimitVO> {
|
||||
/**
|
||||
* 电压偏差
|
||||
* @param lineIndex 监测点
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 结果
|
||||
*/
|
||||
List<HistoryHarmOverLimitVO> getDyPc(@Param("lineIndex")List<String> lineIndex, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
/**
|
||||
* 三相电压不平衡度
|
||||
* @param lineIndex 监测点
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 结果
|
||||
*/
|
||||
List<HistoryHarmOverLimitVO> getSxBpHd(@Param("lineIndex")List<String> lineIndex, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
/**
|
||||
* 电压总畸变率
|
||||
* @param lineIndex 监测点
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 结果
|
||||
*/
|
||||
List<HistoryHarmOverLimitVO> getDyZjBl(@Param("lineIndex")List<String> lineIndex, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
/**
|
||||
* 负序电流
|
||||
* @param lineIndex 监测点
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 结果
|
||||
*/
|
||||
List<HistoryHarmOverLimitVO> getFxDl(@Param("lineIndex")List<String> lineIndex, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
/**
|
||||
* 频率
|
||||
* @param lineIndex 监测点
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 结果
|
||||
*/
|
||||
List<HistoryHarmOverLimitVO> getPl(@Param("lineIndex")List<String> lineIndex, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
/**
|
||||
* 谐波电压含有率
|
||||
* @param lineIndex 监测点
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间
|
||||
* @param number 次数
|
||||
* @return 结果
|
||||
*/
|
||||
List<HistoryHarmOverLimitVO> getXbDyHyl(@Param("lineIndex")List<String> lineIndex, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime,@Param("number")Integer number);
|
||||
|
||||
/**
|
||||
* 谐波电流幅值
|
||||
* @param lineIndex 监测点
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间
|
||||
* @param number 次数
|
||||
* @return 结果
|
||||
*/
|
||||
List<HistoryHarmOverLimitVO> getXbDlFz(@Param("lineIndex")List<String> lineIndex, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime,@Param("number")Integer number);
|
||||
/**
|
||||
* 间谐波电压含有率
|
||||
* @param lineIndex 监测点
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间
|
||||
* @param number 次数
|
||||
* @return 结果
|
||||
*/
|
||||
List<HistoryHarmOverLimitVO> getJxbHyl(@Param("lineIndex")List<String> lineIndex, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime,@Param("number")Integer number);
|
||||
/**
|
||||
* 长时闪变
|
||||
* @param lineIndex 监测点
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 结果
|
||||
*/
|
||||
List<HistoryHarmOverLimitVO> getCsSb(@Param("lineIndex")List<String> lineIndex, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RMpVThd;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/10/10 19:59【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface RMpVThdMapper extends BaseMapper<RMpVThd> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatPollutionSubstationM;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/10/13 13:58【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface RStatPollutionSubstationMMapper extends BaseMapper<RStatPollutionSubstationM> {
|
||||
int updateBatch(List<RStatPollutionSubstationM> list);
|
||||
|
||||
int batchInsert(@Param("list") List<RStatPollutionSubstationM> list);
|
||||
|
||||
int insertOrUpdate(RStatPollutionSubstationM record);
|
||||
|
||||
int insertOrUpdateSelective(RStatPollutionSubstationM record);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgD;
|
||||
import com.njcn.harmonic.pojo.vo.StatHarmonicOrgVO;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qijian
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/10/9 - 11:09
|
||||
*/
|
||||
public interface StatHarmonicOrgDMapper extends BaseMapper<RStatHarmonicOrgD> {
|
||||
|
||||
/**
|
||||
* 查询谐波越限 日占比
|
||||
* @param list,startTime,endTime 参数
|
||||
* @return 结果
|
||||
*/
|
||||
List<StatHarmonicOrgVO> listDayRatio(@Param("list") List<DeptDTO> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgM;
|
||||
import com.njcn.harmonic.pojo.vo.StatHarmonicOrgVO;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qijian
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/10/9 - 11:09
|
||||
*/
|
||||
public interface StatHarmonicOrgMMapper extends BaseMapper<RStatHarmonicOrgM> {
|
||||
|
||||
/**
|
||||
* 查询谐波越限 月占比
|
||||
* @param list,startTime,endTime 参数
|
||||
* @return 结果
|
||||
*/
|
||||
List<StatHarmonicOrgVO> listMonthRatio(@Param("list") List<DeptDTO> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgQ;
|
||||
import com.njcn.harmonic.pojo.vo.StatHarmonicOrgVO;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qijian
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/10/9 - 11:09
|
||||
*/
|
||||
public interface StatHarmonicOrgQMapper extends BaseMapper<RStatHarmonicOrgQ> {
|
||||
|
||||
/**
|
||||
* 查询谐波越限 季占比
|
||||
* @param list,startTime,endTime 参数
|
||||
* @return 结果
|
||||
*/
|
||||
List<StatHarmonicOrgVO> listQuarterRatio(@Param("list") List<DeptDTO> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgY;
|
||||
import com.njcn.harmonic.pojo.vo.StatHarmonicOrgVO;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qijian
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/10/9 - 11:09
|
||||
*/
|
||||
public interface StatHarmonicOrgYMapper extends BaseMapper<RStatHarmonicOrgY> {
|
||||
|
||||
/**
|
||||
* 查询谐波越限 年占比
|
||||
* @param list,startTime,endTime 参数
|
||||
* @return 结果
|
||||
*/
|
||||
List<StatHarmonicOrgVO> listYearRatio(@Param("list") List<DeptDTO> list, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
}
|
||||
@@ -0,0 +1,348 @@
|
||||
<?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.harmonic.mapper.NormLimitMapper">
|
||||
<select id="getDyPc" resultType="HistoryHarmOverLimitVO">
|
||||
SELECT
|
||||
ab.Id lineId,
|
||||
sub.NAME subName,
|
||||
line.NAME lineName,
|
||||
date_format( ab.Time_Id, '%Y-%m-%d' ) timeId,
|
||||
IF
|
||||
(
|
||||
detail.PT_Type IN ( 1, 2 ),
|
||||
IF (ab.Phasic_Type = 'A','AB',IF(ab.Phasic_Type = 'B','BC','CA')),ab.Phasic_Type
|
||||
) phaseType,
|
||||
dic.NAME scale,
|
||||
sum( CASE WHEN Value_Type = 'AVG' THEN Voltage_Dev ELSE 0 END ) avgData,
|
||||
sum( CASE WHEN Value_Type = 'MAX' THEN Voltage_Dev ELSE 0 END ) maxData,
|
||||
sum( CASE WHEN Value_Type = 'MIN' THEN Voltage_Dev ELSE 0 END ) minData,
|
||||
sum( CASE WHEN Value_Type = 'CP95' THEN Voltage_Dev ELSE 0 END ) cp95Data
|
||||
FROM
|
||||
( SELECT * FROM r_mp_surplus_abnormal_d WHERE Id IN
|
||||
<foreach collection="lineIndex" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
) ab
|
||||
LEFT JOIN pq_line line ON line.Id = ab.Id
|
||||
LEFT JOIN pq_voltage vo ON vo.Id = line.Pid
|
||||
LEFT JOIN sys_dict_data dic ON dic.Id = vo.scale
|
||||
LEFT JOIN pq_line subv ON subv.Id = vo.Id
|
||||
LEFT JOIN pq_line dev ON dev.Id = subv.Pid
|
||||
LEFT JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
LEFT JOIN pq_line_detail detail ON detail.Id = line.Id
|
||||
WHERE
|
||||
ab.phasic_type!='T'
|
||||
AND ab.Time_Id between #{startTime} and #{endTime}
|
||||
GROUP BY
|
||||
lineId,
|
||||
timeid,
|
||||
phaseType
|
||||
ORDER BY
|
||||
timeid
|
||||
</select>
|
||||
|
||||
<select id="getSxBpHd" resultType="HistoryHarmOverLimitVO">
|
||||
SELECT
|
||||
ab.Id lineId,
|
||||
sub.NAME subName,
|
||||
line.NAME lineName,
|
||||
date_format( ab.Time_Id, '%Y-%m-%d' ) timeId,
|
||||
"/" phaseType,
|
||||
dic.NAME scale,
|
||||
sum( CASE WHEN Value_Type = 'AVG' THEN Ubalance ELSE 0 END ) avgData,
|
||||
sum( CASE WHEN Value_Type = 'MAX' THEN Ubalance ELSE 0 END ) maxData,
|
||||
sum( CASE WHEN Value_Type = 'MIN' THEN Ubalance ELSE 0 END ) minData,
|
||||
sum( CASE WHEN Value_Type = 'CP95' THEN Ubalance ELSE 0 END ) cp95Data
|
||||
FROM
|
||||
( SELECT * FROM r_mp_surplus_abnormal_d WHERE Id IN
|
||||
<foreach collection="lineIndex" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
) ab
|
||||
LEFT JOIN pq_line line ON line.Id = ab.Id
|
||||
LEFT JOIN pq_voltage vo ON vo.Id = line.Pid
|
||||
LEFT JOIN sys_dict_data dic ON dic.Id = vo.scale
|
||||
LEFT JOIN pq_line subv ON subv.Id = vo.Id
|
||||
LEFT JOIN pq_line dev ON dev.Id = subv.Pid
|
||||
LEFT JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
LEFT JOIN pq_line_detail detail ON detail.Id = line.Id
|
||||
WHERE
|
||||
ab.phasic_type ='T'
|
||||
AND ab.Time_Id between #{startTime} and #{endTime}
|
||||
GROUP BY
|
||||
lineId,
|
||||
timeid,
|
||||
phaseType
|
||||
ORDER BY
|
||||
timeid
|
||||
</select>
|
||||
|
||||
<select id="getDyZjBl" resultType="HistoryHarmOverLimitVO">
|
||||
SELECT
|
||||
ab.Id lineId,
|
||||
sub.NAME subName,
|
||||
line.NAME lineName,
|
||||
date_format( ab.Time_Id, '%Y-%m-%d' ) timeId,
|
||||
IF
|
||||
(
|
||||
detail.PT_Type IN ( 1, 2 ),
|
||||
IF (ab.Phasic_Type = 'A','AB',IF(ab.Phasic_Type = 'B','BC','CA')),ab.Phasic_Type
|
||||
) phaseType,
|
||||
dic.NAME scale,
|
||||
sum( CASE WHEN Value_Type = 'AVG' THEN Uaberrance ELSE 0 END ) avgData,
|
||||
sum( CASE WHEN Value_Type = 'MAX' THEN Uaberrance ELSE 0 END ) maxData,
|
||||
sum( CASE WHEN Value_Type = 'MIN' THEN Uaberrance ELSE 0 END ) minData,
|
||||
sum( CASE WHEN Value_Type = 'CP95' THEN Uaberrance ELSE 0 END ) cp95Data
|
||||
FROM
|
||||
( SELECT * FROM r_mp_surplus_abnormal_d WHERE Id IN
|
||||
<foreach collection="lineIndex" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
) ab
|
||||
LEFT JOIN pq_line line ON line.Id = ab.Id
|
||||
LEFT JOIN pq_voltage vo ON vo.Id = line.Pid
|
||||
LEFT JOIN sys_dict_data dic ON dic.Id = vo.scale
|
||||
LEFT JOIN pq_line subv ON subv.Id = vo.Id
|
||||
LEFT JOIN pq_line dev ON dev.Id = subv.Pid
|
||||
LEFT JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
LEFT JOIN pq_line_detail detail ON detail.Id = line.Id
|
||||
WHERE
|
||||
ab.phasic_type!='T'
|
||||
AND ab.Time_Id between #{startTime} and #{endTime}
|
||||
GROUP BY
|
||||
lineId,
|
||||
timeid,
|
||||
phaseType
|
||||
ORDER BY
|
||||
timeid
|
||||
</select>
|
||||
|
||||
<select id="getFxDl" resultType="HistoryHarmOverLimitVO">
|
||||
SELECT
|
||||
ab.Id lineId,
|
||||
sub.NAME subName,
|
||||
line.NAME lineName,
|
||||
date_format( ab.Time_Id, '%Y-%m-%d' ) timeId,
|
||||
"/" phaseType,
|
||||
dic.NAME scale,
|
||||
sum( CASE WHEN Value_Type = 'AVG' THEN I_Neg ELSE 0 END ) avgData,
|
||||
sum( CASE WHEN Value_Type = 'MAX' THEN I_Neg ELSE 0 END ) maxData,
|
||||
sum( CASE WHEN Value_Type = 'MIN' THEN I_Neg ELSE 0 END ) minData,
|
||||
sum( CASE WHEN Value_Type = 'CP95' THEN I_Neg ELSE 0 END ) cp95Data
|
||||
FROM
|
||||
( SELECT * FROM r_mp_surplus_abnormal_d WHERE Id IN
|
||||
<foreach collection="lineIndex" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
) ab
|
||||
LEFT JOIN pq_line line ON line.Id = ab.Id
|
||||
LEFT JOIN pq_voltage vo ON vo.Id = line.Pid
|
||||
LEFT JOIN sys_dict_data dic ON dic.Id = vo.scale
|
||||
LEFT JOIN pq_line subv ON subv.Id = vo.Id
|
||||
LEFT JOIN pq_line dev ON dev.Id = subv.Pid
|
||||
LEFT JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
LEFT JOIN pq_line_detail detail ON detail.Id = line.Id
|
||||
WHERE
|
||||
ab.phasic_type='T'
|
||||
AND ab.Time_Id between #{startTime} and #{endTime}
|
||||
GROUP BY
|
||||
lineId,
|
||||
timeid,
|
||||
phaseType
|
||||
ORDER BY
|
||||
timeid
|
||||
</select>
|
||||
|
||||
<select id="getPl" resultType="HistoryHarmOverLimitVO">
|
||||
SELECT
|
||||
ab.Id lineId,
|
||||
sub.NAME subName,
|
||||
line.NAME lineName,
|
||||
date_format( ab.Time_Id, '%Y-%m-%d' ) timeId,
|
||||
"/" phaseType,
|
||||
dic.NAME scale,
|
||||
sum( CASE WHEN Value_Type = 'AVG' THEN Freq ELSE 0 END ) avgData,
|
||||
sum( CASE WHEN Value_Type = 'MAX' THEN Freq ELSE 0 END ) maxData,
|
||||
sum( CASE WHEN Value_Type = 'MIN' THEN Freq ELSE 0 END ) minData,
|
||||
sum( CASE WHEN Value_Type = 'CP95' THEN Freq ELSE 0 END ) cp95Data
|
||||
FROM
|
||||
( SELECT * FROM r_mp_surplus_abnormal_d WHERE Id IN
|
||||
<foreach collection="lineIndex" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
) ab
|
||||
LEFT JOIN pq_line line ON line.Id = ab.Id
|
||||
LEFT JOIN pq_voltage vo ON vo.Id = line.Pid
|
||||
LEFT JOIN sys_dict_data dic ON dic.Id = vo.scale
|
||||
LEFT JOIN pq_line subv ON subv.Id = vo.Id
|
||||
LEFT JOIN pq_line dev ON dev.Id = subv.Pid
|
||||
LEFT JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
LEFT JOIN pq_line_detail detail ON detail.Id = line.Id
|
||||
WHERE
|
||||
ab.phasic_type='T'
|
||||
AND ab.Time_Id between #{startTime} and #{endTime}
|
||||
GROUP BY
|
||||
lineId,
|
||||
timeid,
|
||||
phaseType
|
||||
ORDER BY
|
||||
timeid
|
||||
</select>
|
||||
|
||||
<select id="getXbDyHyl" resultType="HistoryHarmOverLimitVO">
|
||||
SELECT
|
||||
ab.Id lineId,
|
||||
sub.NAME subName,
|
||||
line.NAME lineName,
|
||||
date_format( ab.Time_Id, '%Y-%m-%d' ) timeId,
|
||||
IF
|
||||
(
|
||||
detail.PT_Type IN ( 1, 2 ),
|
||||
IF (ab.Phasic_Type = 'A','AB',IF(ab.Phasic_Type = 'B','BC','CA')),ab.Phasic_Type
|
||||
) phaseType,
|
||||
dic.NAME scale,
|
||||
sum( CASE WHEN Value_Type = 'AVG' THEN Uharm_${number} ELSE 0 END ) avgData,
|
||||
sum( CASE WHEN Value_Type = 'MAX' THEN Uharm_${number} ELSE 0 END ) maxData,
|
||||
sum( CASE WHEN Value_Type = 'MIN' THEN Uharm_${number} ELSE 0 END ) minData,
|
||||
sum( CASE WHEN Value_Type = 'CP95' THEN Uharm_${number} ELSE 0 END ) cp95Data
|
||||
FROM
|
||||
( SELECT * FROM r_mp_surplus_abnormal_d WHERE Id IN
|
||||
<foreach collection="lineIndex" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
) ab
|
||||
LEFT JOIN pq_line line ON line.Id = ab.Id
|
||||
LEFT JOIN pq_voltage vo ON vo.Id = line.Pid
|
||||
LEFT JOIN sys_dict_data dic ON dic.Id = vo.scale
|
||||
LEFT JOIN pq_line subv ON subv.Id = vo.Id
|
||||
LEFT JOIN pq_line dev ON dev.Id = subv.Pid
|
||||
LEFT JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
LEFT JOIN pq_line_detail detail ON detail.Id = line.Id
|
||||
WHERE
|
||||
ab.phasic_type!='T'
|
||||
AND ab.Time_Id between #{startTime} and #{endTime}
|
||||
GROUP BY
|
||||
lineId,
|
||||
timeid,
|
||||
phaseType
|
||||
ORDER BY
|
||||
timeid
|
||||
</select>
|
||||
|
||||
<select id="getXbDlFz" resultType="HistoryHarmOverLimitVO">
|
||||
SELECT
|
||||
ab.Id lineId,
|
||||
sub.NAME subName,
|
||||
line.NAME lineName,
|
||||
date_format( ab.Time_Id, '%Y-%m-%d' ) timeId,
|
||||
IF
|
||||
(
|
||||
detail.PT_Type IN ( 1, 2 ),
|
||||
IF (ab.Phasic_Type = 'A','AB',IF(ab.Phasic_Type = 'B','BC','CA')),ab.Phasic_Type
|
||||
) phaseType,
|
||||
dic.NAME scale,
|
||||
sum( CASE WHEN Value_Type = 'AVG' THEN Iharm_${number} ELSE 0 END ) avgData,
|
||||
sum( CASE WHEN Value_Type = 'MAX' THEN Iharm_${number} ELSE 0 END ) maxData,
|
||||
sum( CASE WHEN Value_Type = 'MIN' THEN Iharm_${number} ELSE 0 END ) minData,
|
||||
sum( CASE WHEN Value_Type = 'CP95' THEN Iharm_${number} ELSE 0 END ) cp95Data
|
||||
FROM
|
||||
( SELECT * FROM r_mp_surplus_abnormal_d WHERE Id IN
|
||||
<foreach collection="lineIndex" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
) ab
|
||||
LEFT JOIN pq_line line ON line.Id = ab.Id
|
||||
LEFT JOIN pq_voltage vo ON vo.Id = line.Pid
|
||||
LEFT JOIN sys_dict_data dic ON dic.Id = vo.scale
|
||||
LEFT JOIN pq_line subv ON subv.Id = vo.Id
|
||||
LEFT JOIN pq_line dev ON dev.Id = subv.Pid
|
||||
LEFT JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
LEFT JOIN pq_line_detail detail ON detail.Id = line.Id
|
||||
WHERE
|
||||
ab.phasic_type!='T'
|
||||
AND ab.Time_Id between #{startTime} and #{endTime}
|
||||
GROUP BY
|
||||
lineId,
|
||||
timeid,
|
||||
phaseType
|
||||
ORDER BY
|
||||
timeid
|
||||
</select>
|
||||
|
||||
<select id="getJxbHyl" resultType="HistoryHarmOverLimitVO">
|
||||
SELECT
|
||||
ab.Id lineId,
|
||||
sub.NAME subName,
|
||||
line.NAME lineName,
|
||||
date_format( ab.Time_Id, '%Y-%m-%d' ) timeId,
|
||||
IF
|
||||
(
|
||||
detail.PT_Type IN ( 1, 2 ),
|
||||
IF (ab.Phasic_Type = 'A','AB',IF(ab.Phasic_Type = 'B','BC','CA')),ab.Phasic_Type
|
||||
) phaseType,
|
||||
dic.NAME scale,
|
||||
sum( CASE WHEN Value_Type = 'AVG' THEN Inuharm_${number} ELSE 0 END ) avgData,
|
||||
sum( CASE WHEN Value_Type = 'MAX' THEN Inuharm_${number} ELSE 0 END ) maxData,
|
||||
sum( CASE WHEN Value_Type = 'MIN' THEN Inuharm_${number} ELSE 0 END ) minData,
|
||||
sum( CASE WHEN Value_Type = 'CP95' THEN Inuharm_${number} ELSE 0 END ) cp95Data
|
||||
FROM
|
||||
( SELECT * FROM r_mp_surplus_abnormal_d WHERE Id IN
|
||||
<foreach collection="lineIndex" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
) ab
|
||||
LEFT JOIN pq_line line ON line.Id = ab.Id
|
||||
LEFT JOIN pq_voltage vo ON vo.Id = line.Pid
|
||||
LEFT JOIN sys_dict_data dic ON dic.Id = vo.scale
|
||||
LEFT JOIN pq_line subv ON subv.Id = vo.Id
|
||||
LEFT JOIN pq_line dev ON dev.Id = subv.Pid
|
||||
LEFT JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
LEFT JOIN pq_line_detail detail ON detail.Id = line.Id
|
||||
WHERE
|
||||
ab.phasic_type!='T'
|
||||
AND ab.Time_Id between #{startTime} and #{endTime}
|
||||
GROUP BY
|
||||
lineId,
|
||||
timeid,
|
||||
phaseType
|
||||
ORDER BY
|
||||
timeid
|
||||
</select>
|
||||
|
||||
<select id="getCsSb" resultType="HistoryHarmOverLimitVO">
|
||||
SELECT
|
||||
ab.Id lineId,
|
||||
sub.NAME subName,
|
||||
line.NAME lineName,
|
||||
date_format( ab.Time_Id, '%Y-%m-%d' ) timeId,
|
||||
IF
|
||||
(
|
||||
detail.PT_Type IN ( 1, 2 ),
|
||||
IF (ab.Phasic_Type = 'A','AB',IF(ab.Phasic_Type = 'B','BC','CA')),ab.Phasic_Type
|
||||
) phaseType,
|
||||
dic.NAME scale,
|
||||
sum( CASE WHEN Value_Type = 'AVG' THEN Flicker ELSE 0 END ) avgData
|
||||
FROM
|
||||
( SELECT * FROM r_mp_surplus_abnormal_d WHERE Id IN
|
||||
<foreach collection="lineIndex" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
) ab
|
||||
LEFT JOIN pq_line line ON line.Id = ab.Id
|
||||
LEFT JOIN pq_voltage vo ON vo.Id = line.Pid
|
||||
LEFT JOIN sys_dict_data dic ON dic.Id = vo.scale
|
||||
LEFT JOIN pq_line subv ON subv.Id = vo.Id
|
||||
LEFT JOIN pq_line dev ON dev.Id = subv.Pid
|
||||
LEFT JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
LEFT JOIN pq_line_detail detail ON detail.Id = line.Id
|
||||
WHERE
|
||||
ab.phasic_type!='T'
|
||||
AND ab.Time_Id between #{startTime} and #{endTime}
|
||||
GROUP BY
|
||||
lineId,
|
||||
timeid,
|
||||
phaseType
|
||||
ORDER BY
|
||||
timeid
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?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.harmonic.mapper.RMpVThdMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RMpVThd">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table r_mp_v_thd-->
|
||||
<id column="measurement_point_id" jdbcType="VARCHAR" property="measurementPointId" />
|
||||
<id column="data_type" jdbcType="VARCHAR" property="dataType" />
|
||||
<id column="data_date" jdbcType="TIMESTAMP" property="dataDate" />
|
||||
<result column="v_thd" jdbcType="FLOAT" property="vThd" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
measurement_point_id, data_type, data_date, v_thd
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,107 @@
|
||||
<?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.harmonic.mapper.RStatPollutionSubstationMMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RStatPollutionSubstationM">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table r_stat_pollution_substation_m-->
|
||||
<id column="substation_id" jdbcType="VARCHAR" property="substationId" />
|
||||
<id column="data_date" jdbcType="TIMESTAMP" property="dataDate" />
|
||||
<result column="pollution_type" jdbcType="VARCHAR" property="pollutionType" />
|
||||
<result column="value" jdbcType="FLOAT" property="value" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
substation_id, data_date, pollution_type, `value`
|
||||
</sql>
|
||||
<update id="updateBatch" parameterType="java.util.List">
|
||||
<!--@mbg.generated-->
|
||||
update r_stat_pollution_substation_m
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="pollution_type = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when substation_id = #{item.substationId,jdbcType=VARCHAR} then #{item.pollutionType,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="`value` = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when substation_id = #{item.substationId,jdbcType=VARCHAR} then #{item.value,jdbcType=FLOAT}
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
where substation_id in
|
||||
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
||||
#{item.substationId,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</update>
|
||||
<insert id="batchInsert" parameterType="map">
|
||||
<!--@mbg.generated-->
|
||||
insert into r_stat_pollution_substation_m
|
||||
(substation_id, data_date, pollution_type, `value`)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.substationId,jdbcType=VARCHAR}, #{item.dataDate,jdbcType=TIMESTAMP}, #{item.pollutionType,jdbcType=VARCHAR},
|
||||
#{item.value,jdbcType=FLOAT})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertOrUpdate" parameterType="com.njcn.harmonic.pojo.po.RStatPollutionSubstationM">
|
||||
<!--@mbg.generated-->
|
||||
insert into r_stat_pollution_substation_m
|
||||
(substation_id, data_date, pollution_type, `value`)
|
||||
values
|
||||
(#{substationId,jdbcType=VARCHAR}, #{dataDate,jdbcType=TIMESTAMP}, #{pollutionType,jdbcType=VARCHAR},
|
||||
#{value,jdbcType=FLOAT})
|
||||
on duplicate key update
|
||||
substation_id = #{substationId,jdbcType=VARCHAR},
|
||||
data_date = #{dataDate,jdbcType=TIMESTAMP},
|
||||
pollution_type = #{pollutionType,jdbcType=VARCHAR},
|
||||
`value` = #{value,jdbcType=FLOAT}
|
||||
</insert>
|
||||
<insert id="insertOrUpdateSelective" parameterType="com.njcn.harmonic.pojo.po.RStatPollutionSubstationM">
|
||||
<!--@mbg.generated-->
|
||||
insert into r_stat_pollution_substation_m
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="substationId != null">
|
||||
substation_id,
|
||||
</if>
|
||||
<if test="dataDate != null">
|
||||
data_date,
|
||||
</if>
|
||||
<if test="pollutionType != null">
|
||||
pollution_type,
|
||||
</if>
|
||||
<if test="value != null">
|
||||
`value`,
|
||||
</if>
|
||||
</trim>
|
||||
values
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="substationId != null">
|
||||
#{substationId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dataDate != null">
|
||||
#{dataDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="pollutionType != null">
|
||||
#{pollutionType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="value != null">
|
||||
#{value,jdbcType=FLOAT},
|
||||
</if>
|
||||
</trim>
|
||||
on duplicate key update
|
||||
<trim suffixOverrides=",">
|
||||
<if test="substationId != null">
|
||||
substation_id = #{substationId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dataDate != null">
|
||||
data_date = #{dataDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="pollutionType != null">
|
||||
pollution_type = #{pollutionType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="value != null">
|
||||
`value` = #{value,jdbcType=FLOAT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?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.harmonic.mapper.StatHarmonicOrgDMapper">
|
||||
|
||||
<select id="listDayRatio" resultType="StatHarmonicOrgVO">
|
||||
SELECT
|
||||
r.`org_no` `id`,
|
||||
r.over_limit_measurement_ratio_average `ratio`,
|
||||
r.over_limit_measurement_average `count`
|
||||
FROM
|
||||
r_stat_harmonic_org_d r
|
||||
where 1=1
|
||||
and org_no in
|
||||
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
<if test="startTime!=null and endTime!=null">
|
||||
and DATE_FORMAT(data_date,'%Y-%m-%d') between #{startTime} and #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?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.harmonic.mapper.StatHarmonicOrgMMapper">
|
||||
|
||||
<select id="listMonthRatio" resultType="StatHarmonicOrgVO">
|
||||
SELECT
|
||||
r.`org_no` `id`,
|
||||
r.over_limit_measurement_ratio_average `ratio`,
|
||||
r.over_limit_measurement_average `count`
|
||||
FROM
|
||||
r_stat_harmonic_org_m r
|
||||
where 1=1
|
||||
and org_no in
|
||||
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
<if test="startTime!=null and endTime!=null">
|
||||
and DATE_FORMAT(data_date,'%Y-%m-%d') between #{startTime} and #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?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.harmonic.mapper.StatHarmonicOrgQMapper">
|
||||
|
||||
<select id="listQuarterRatio" resultType="StatHarmonicOrgVO">
|
||||
SELECT
|
||||
r.`org_no` `id`,
|
||||
r.over_limit_measurement_ratio_average `ratio`,
|
||||
r.over_limit_measurement_average `count`
|
||||
FROM
|
||||
r_stat_harmonic_org_q r
|
||||
where 1=1
|
||||
and org_no in
|
||||
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
<if test="startTime!=null and endTime!=null">
|
||||
and DATE_FORMAT(data_date,'%Y-%m-%d') between #{startTime} and #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?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.harmonic.mapper.StatHarmonicOrgYMapper">
|
||||
|
||||
<select id="listYearRatio" resultType="StatHarmonicOrgVO">
|
||||
SELECT
|
||||
r.`org_no` `id`,
|
||||
r.over_limit_measurement_ratio_average `ratio`,
|
||||
r.over_limit_measurement_average `count`
|
||||
FROM
|
||||
r_stat_harmonic_org_y r
|
||||
where 1=1
|
||||
and org_no in
|
||||
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
<if test="startTime!=null and endTime!=null">
|
||||
and DATE_FORMAT(data_date,'%Y-%m-%d') between #{startTime} and #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.njcn.harmonic.service;
|
||||
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.param.HistoryParam;
|
||||
import com.njcn.harmonic.pojo.param.NormHistoryParam;
|
||||
import com.njcn.harmonic.pojo.vo.HistoryDataResultVO;
|
||||
import com.njcn.harmonic.pojo.vo.StatHarmonicOrgVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -27,4 +29,11 @@ public interface HistoryResultService {
|
||||
* @return 结果
|
||||
*/
|
||||
List<HistoryDataResultVO> getHistoryLineData(NormHistoryParam normHistoryParam);
|
||||
|
||||
/**
|
||||
* 获取谐波越限监测点占比
|
||||
* @param statisticsBizBaseParam 参数
|
||||
* @return 结果
|
||||
*/
|
||||
List<StatHarmonicOrgVO> getHarmonicProportion(StatisticsBizBaseParam statisticsBizBaseParam);
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ public interface NormLimitService {
|
||||
* @param historyHarmOverLimitParam 参数
|
||||
* @return 返回值
|
||||
*/
|
||||
List<HistoryHarmOverLimitVO> getHistoryTableData(HistoryHarmOverLimitParam historyHarmOverLimitParam);
|
||||
List<HistoryHarmOverLimitVO> getHistoryData(HistoryHarmOverLimitParam historyHarmOverLimitParam,int type);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.harmonic.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.param.PollutionSubstationQuryParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatPollutionSubstationM;
|
||||
import com.njcn.harmonic.pojo.vo.PollutionSubstationVO;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/10/13 8:56【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PollutionSubstationService extends IService<RStatPollutionSubstationM>{
|
||||
|
||||
|
||||
/**
|
||||
* @Description: getPollutionSubstationData
|
||||
* @Param: [pollutionSubstationQuryParam]
|
||||
* @return: java.util.List<com.njcn.harmonic.pojo.vo.PollutionSubstationVO>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/13
|
||||
*/
|
||||
List<PollutionSubstationVO> getPollutionSubstationData(PollutionSubstationQuryParam pollutionSubstationQuryParam);
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.njcn.harmonic.service;
|
||||
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.harmonic.pojo.vo.RMpVThdVO;
|
||||
import com.njcn.harmonic.pojo.vo.THDistortionCensusVO;
|
||||
import com.njcn.harmonic.pojo.vo.THDistortionVO;
|
||||
|
||||
@@ -27,4 +29,12 @@ public interface THDistortionService {
|
||||
* @return
|
||||
*/
|
||||
THDistortionCensusVO getTHDistortionCensus(DeviceInfoParam.BusinessParam thDistortionCensusParam);
|
||||
/**
|
||||
* @Description: 谐波总畸变率前十列表
|
||||
* @Param: [statisticsBizBaseParam]
|
||||
* @return: java.util.List<com.njcn.harmonic.pojo.vo.RMpVThdVO>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/10
|
||||
*/
|
||||
List<RMpVThdVO> getTHDTopTenData(StatisticsBizBaseParam statisticsBizBaseParam);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.njcn.harmonic.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.po.Overlimit;
|
||||
@@ -9,14 +11,22 @@ import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.event.api.EventDetailFeignClient;
|
||||
import com.njcn.event.pojo.po.EventDetail;
|
||||
import com.njcn.harmonic.constant.Param;
|
||||
import com.njcn.harmonic.mapper.StatHarmonicOrgDMapper;
|
||||
import com.njcn.harmonic.mapper.StatHarmonicOrgMMapper;
|
||||
import com.njcn.harmonic.mapper.StatHarmonicOrgQMapper;
|
||||
import com.njcn.harmonic.mapper.StatHarmonicOrgYMapper;
|
||||
import com.njcn.harmonic.pojo.param.HistoryParam;
|
||||
import com.njcn.harmonic.pojo.param.NormHistoryParam;
|
||||
import com.njcn.harmonic.pojo.vo.EventDetailVO;
|
||||
import com.njcn.harmonic.pojo.vo.HistoryDataResultVO;
|
||||
import com.njcn.harmonic.pojo.vo.QueryResultLimitVO;
|
||||
import com.njcn.harmonic.pojo.vo.StatHarmonicOrgVO;
|
||||
import com.njcn.harmonic.service.HistoryResultService;
|
||||
import com.njcn.influxdb.param.InfluxDBPublicParam;
|
||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.influxdb.dto.QueryResult;
|
||||
@@ -27,9 +37,9 @@ import java.math.BigDecimal;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
@@ -45,6 +55,16 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
|
||||
private final EventDetailFeignClient eventDetailFeignClient;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
private final StatHarmonicOrgYMapper statHarmonicOrgYMapper;
|
||||
|
||||
private final StatHarmonicOrgQMapper statHarmonicOrgQMapper;
|
||||
|
||||
private final StatHarmonicOrgMMapper statHarmonicOrgMMapper;
|
||||
|
||||
private final StatHarmonicOrgDMapper statHarmonicOrgDMapper;
|
||||
|
||||
@Override
|
||||
public List<HistoryDataResultVO> getHistoryResult(HistoryParam historyParam) {
|
||||
List<HistoryDataResultVO> historyDataResultVOList = new ArrayList<>();
|
||||
@@ -859,4 +879,119 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
}
|
||||
return historyDataResultVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StatHarmonicOrgVO> getHarmonicProportion(StatisticsBizBaseParam statisticsBizBaseParam){
|
||||
|
||||
List<StatHarmonicOrgVO> statHarmonicOrgVOS = new ArrayList<>();
|
||||
//获取子部门
|
||||
List<DeptDTO> depts = deptFeignClient.getDeptDescendantIndexes(statisticsBizBaseParam.getId(), WebUtil.filterDeptType()).getData();
|
||||
|
||||
if (depts.size() != 0) {
|
||||
//根据上层id,查询子数据并返回一个顺序流
|
||||
depts = depts.stream().filter(allItem -> allItem.getPid().equals(statisticsBizBaseParam.getId())).collect(Collectors.toList());
|
||||
//根据时间区分表查询
|
||||
//年 季 月 日
|
||||
switch (statisticsBizBaseParam.getType().toString()) {
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
statHarmonicOrgVOS = statHarmonicOrgYMapper.listYearRatio(depts, statisticsBizBaseParam.getStartTime(),statisticsBizBaseParam.getEndTime());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
statHarmonicOrgVOS = statHarmonicOrgQMapper.listQuarterRatio(depts, statisticsBizBaseParam.getStartTime(),statisticsBizBaseParam.getEndTime());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
statHarmonicOrgVOS = statHarmonicOrgMMapper.listMonthRatio(depts, statisticsBizBaseParam.getStartTime(),statisticsBizBaseParam.getEndTime());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_DAY:
|
||||
statHarmonicOrgVOS = statHarmonicOrgDMapper.listDayRatio(depts, statisticsBizBaseParam.getStartTime(),statisticsBizBaseParam.getEndTime());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//使用流对象的方法插入name值
|
||||
if (statHarmonicOrgVOS.size() != 0){
|
||||
statHarmonicOrgVOS = transName(statHarmonicOrgVOS, depts);
|
||||
}
|
||||
|
||||
return statHarmonicOrgVOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用流对象的方法插入数据
|
||||
*/
|
||||
private static List<StatHarmonicOrgVO> transName(List<StatHarmonicOrgVO> statHarmonicOrgVOS, List<DeptDTO> deptDTOS) {
|
||||
List<StatHarmonicOrgVO> list = statHarmonicOrgVOS.stream().map(e1 -> {
|
||||
return deptDTOS.stream().filter(e2 -> {//条件判断
|
||||
return e1.getId().equals(e2.getId());
|
||||
}).map(e2 -> {
|
||||
if (e2.getType() == 0) {
|
||||
e1.setName(e2.getArea());
|
||||
} else {
|
||||
e1.setName(e2.getName());
|
||||
}
|
||||
return e1;//返回的结果
|
||||
}).collect(Collectors.toList());
|
||||
}).flatMap(List::stream).collect(Collectors.toList());//设置返回结果类型
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 获取季度时间段
|
||||
// * @param date
|
||||
// * @return 结果
|
||||
// */
|
||||
// private static Map<String, Date> getSeasonDate(Date date) {
|
||||
// Map<String, Date> result = new HashMap<>();
|
||||
// //根据当前时间初始化
|
||||
// Calendar start = Calendar.getInstance();
|
||||
// Calendar end = Calendar.getInstance();
|
||||
// start.setTime(date);
|
||||
// end.setTime(date);
|
||||
// //根据月份计算出季度时间段
|
||||
// int month = start.get(Calendar.MONTH);
|
||||
// switch (month) {
|
||||
// case Calendar.JANUARY:
|
||||
// case Calendar.FEBRUARY:
|
||||
// case Calendar.MARCH:
|
||||
// start.set(Calendar.MONTH, 0);
|
||||
// start.set(Calendar.DATE,1);
|
||||
// end.set(Calendar.MONTH, 2);
|
||||
// end.set(Calendar.DATE, 31);
|
||||
// break;
|
||||
// case Calendar.APRIL:
|
||||
// case Calendar.MAY:
|
||||
// case Calendar.JUNE:
|
||||
// start.set(Calendar.MONTH, 3);
|
||||
// start.set(Calendar.DATE,1);
|
||||
// end.set(Calendar.MONTH, 5);
|
||||
// end.set(Calendar.DATE, 30);
|
||||
// break;
|
||||
// case Calendar.JULY:
|
||||
// case Calendar.AUGUST:
|
||||
// case Calendar.SEPTEMBER:
|
||||
// start.set(Calendar.MONTH, 6);
|
||||
// start.set(Calendar.DATE,1);
|
||||
// end.set(Calendar.MONTH, 8);
|
||||
// end.set(Calendar.DATE, 30);
|
||||
// break;
|
||||
// case Calendar.OCTOBER:
|
||||
// case Calendar.NOVEMBER:
|
||||
// case Calendar.DECEMBER:
|
||||
// start.set(Calendar.MONTH, 9);
|
||||
// start.set(Calendar.DATE,1);
|
||||
// end.set(Calendar.MONTH, 11);
|
||||
// end.set(Calendar.DATE, 31);
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// //转换成date组装返回
|
||||
// result.put("startTime",start.getTime());
|
||||
// result.put("endTime",end.getTime());
|
||||
// return result;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,31 +1,22 @@
|
||||
package com.njcn.harmonic.service.impl;
|
||||
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.harmonic.constant.Param;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.harmonic.mapper.NormLimitMapper;
|
||||
import com.njcn.harmonic.pojo.param.HistoryHarmOverLimitParam;
|
||||
import com.njcn.harmonic.pojo.vo.HistoryHarmOverLimitVO;
|
||||
import com.njcn.harmonic.service.NormLimitService;
|
||||
import com.njcn.influxdb.param.InfluxDBPublicParam;
|
||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.influxdb.dto.QueryResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 类介绍
|
||||
@@ -38,23 +29,38 @@ import java.util.concurrent.TimeUnit;
|
||||
@AllArgsConstructor
|
||||
public class NormLimitServiceImpl implements NormLimitService {
|
||||
|
||||
private final InfluxDbUtils influxDbUtils;
|
||||
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
||||
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final NormLimitMapper normLimitMapper;
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public List<HistoryHarmOverLimitVO> getHistoryTableData(HistoryHarmOverLimitParam historyHarmOverLimitParam) {
|
||||
public List<HistoryHarmOverLimitVO> getHistoryData(HistoryHarmOverLimitParam historyHarmOverLimitParam, int type) {
|
||||
List<HistoryHarmOverLimitVO> historyHarmOverLimitVOList = new ArrayList<>();
|
||||
List<HistoryHarmOverLimitVO> historyHarmOverLimitVO;
|
||||
List<String> lineIds = new ArrayList<>();
|
||||
if (type == 0) {
|
||||
//处理接口数据
|
||||
String[] lineIds = new String[historyHarmOverLimitParam.getLineId().length];
|
||||
System.arraycopy(historyHarmOverLimitParam.getLineId(), 0, lineIds, 0, historyHarmOverLimitParam.getLineId().length);
|
||||
} else {
|
||||
DeviceInfoParam deviceInfoParam = new DeviceInfoParam();
|
||||
deviceInfoParam.setDeptIndex(RequestUtil.getDeptIndex());
|
||||
deviceInfoParam.setPowerFlag(2);
|
||||
deviceInfoParam.setMonitorFlag(2);
|
||||
deviceInfoParam.setServerName(ServerEnum.HARMONIC.getName());
|
||||
SimpleDTO simpleDTO = new SimpleDTO();
|
||||
simpleDTO.setName("电网拓扑");
|
||||
simpleDTO.setSort(0);
|
||||
simpleDTO.setCode("Power_Network");
|
||||
deviceInfoParam.setStatisticalType(simpleDTO);
|
||||
//处理监测点
|
||||
List<GeneralDeviceDTO> deviceDataList = generalDeviceInfoClient.getPracticalAllDeviceInfo(deviceInfoParam).getData();
|
||||
for (GeneralDeviceDTO generalDeviceDTO : deviceDataList) {
|
||||
lineIds.addAll(generalDeviceDTO.getLineIndexes());
|
||||
}
|
||||
}
|
||||
int[] types = new int[historyHarmOverLimitParam.getCondition().length];
|
||||
int[] inde = new int[0];
|
||||
int[] inharm = new int[0];
|
||||
for (int i = 0; i < historyHarmOverLimitParam.getLineId().length; i++) {
|
||||
lineIds[i] = historyHarmOverLimitParam.getLineId()[i];
|
||||
}
|
||||
|
||||
for (int i = 0; i < historyHarmOverLimitParam.getCondition().length; i++) {
|
||||
types[i] = Integer.parseInt(historyHarmOverLimitParam.getCondition()[i]);
|
||||
@@ -73,124 +79,172 @@ public class NormLimitServiceImpl implements NormLimitService {
|
||||
inharm[i] = Integer.parseInt(historyHarmOverLimitParam.getInHarmonics()[i]);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < lineIds.length; i++) {
|
||||
//查询数据
|
||||
for (int j = 0; j < types.length; j++) {
|
||||
historyHarmOverLimitVO = getCondition(historyHarmOverLimitParam.getSearchBeginTime(), historyHarmOverLimitParam.getSearchEndTime(), String.valueOf(lineIds[i]), String.valueOf(types[j]), inde, inharm);
|
||||
for (int i : types) {
|
||||
historyHarmOverLimitVO = getMyCondition(historyHarmOverLimitParam.getSearchBeginTime(), historyHarmOverLimitParam.getSearchEndTime(), lineIds, String.valueOf(i), inde, inharm);
|
||||
historyHarmOverLimitVOList.addAll(historyHarmOverLimitVO);
|
||||
}
|
||||
}
|
||||
//获取值
|
||||
//处理数据
|
||||
return historyHarmOverLimitVOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* influxDB相关操作
|
||||
* mysql相关操作
|
||||
* 查询稳态数据分析
|
||||
*/
|
||||
@SneakyThrows
|
||||
private List<HistoryHarmOverLimitVO> getCondition(String startTime, String endTime, String lineId, String contion, int[] number, int[] valueType) {
|
||||
private List<HistoryHarmOverLimitVO> getMyCondition(String startTime, String endTime, List<String> lineId, String contion, int[] number, int[] inharm) {
|
||||
List<HistoryHarmOverLimitVO> historyHarmOverLimitVOList = new ArrayList<>();
|
||||
//数据的转化
|
||||
historyHarmOverLimitVOList = getQueryResult(startTime, endTime, lineId, contion, number, valueType);
|
||||
return historyHarmOverLimitVOList;
|
||||
}
|
||||
|
||||
private List<HistoryHarmOverLimitVO> getQueryResult(String startTime, String endTime, String lineList, String contion, int[] number, int[] inHarmNum) {
|
||||
List<HistoryHarmOverLimitVO> historyHarmOverLimitVOList = new ArrayList<>();
|
||||
QueryResult queryResult = null;
|
||||
if (!lineList.isEmpty()) {
|
||||
//组装sql语句
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append(InfluxDBPublicParam.START_TIME).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append(InfluxDBPublicParam.END_TIME).append("' and (");
|
||||
//sql语句
|
||||
stringBuilder.append(InfluxDBPublicParam.LINE_ID).append("='").append(lineList).append("')");
|
||||
String sql;
|
||||
String targetName;//指标名称
|
||||
String unit;//单位
|
||||
if (!lineId.isEmpty()) {
|
||||
switch (Integer.parseInt(contion)) {
|
||||
case 12:
|
||||
//电压偏差
|
||||
sql = "SELECT time as time, voltage_dev as aValue,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') " +
|
||||
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
queryResult = influxDbUtils.query(sql);
|
||||
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "电压偏差", "%");
|
||||
targetName = "电压偏差";
|
||||
unit = "%";
|
||||
historyHarmOverLimitVOList = normLimitMapper.getDyPc(lineId, DateUtil.beginOfDay(DateUtil.parse(startTime)), DateUtil.endOfDay(DateUtil.parse(endTime)));
|
||||
for (HistoryHarmOverLimitVO historyHarmOverLimitVO : historyHarmOverLimitVOList) {
|
||||
if (historyHarmOverLimitVO.getAvgData() == -3.14159 && historyHarmOverLimitVO.getMaxData() == -3.14159 && historyHarmOverLimitVO.getMinData() == -3.14159 && historyHarmOverLimitVO.getCp95Data() == -3.14159) {
|
||||
historyHarmOverLimitVOList.remove(historyHarmOverLimitVO);
|
||||
} else {
|
||||
historyHarmOverLimitVO.setTargetName(targetName);
|
||||
historyHarmOverLimitVO.setUnit(unit);
|
||||
historyHarmOverLimitVO.setTargetCode(contion);
|
||||
historyHarmOverLimitVO.setStatisticalType(Math.abs(historyHarmOverLimitVO.getMaxData()) > Math.abs(historyHarmOverLimitVO.getMinData()) ? 3 : 2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
//三相电压不平衡度
|
||||
sql = "SELECT time as time, ubalance as aValue,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||
" and (phasic_type ='T') " +
|
||||
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
queryResult = influxDbUtils.query(sql);
|
||||
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "三相电压不平衡度", "/");
|
||||
targetName = "三相电压不平衡度";
|
||||
unit = "/";
|
||||
historyHarmOverLimitVOList = normLimitMapper.getSxBpHd(lineId, DateUtil.beginOfDay(DateUtil.parse(startTime)), DateUtil.endOfDay(DateUtil.parse(endTime)));
|
||||
for (HistoryHarmOverLimitVO historyHarmOverLimitVO : historyHarmOverLimitVOList) {
|
||||
if (historyHarmOverLimitVO.getAvgData() == -3.14159 && historyHarmOverLimitVO.getMaxData() == -3.14159 && historyHarmOverLimitVO.getMinData() == -3.14159 && historyHarmOverLimitVO.getCp95Data() == -3.14159) {
|
||||
historyHarmOverLimitVOList.remove(historyHarmOverLimitVO);
|
||||
} else {
|
||||
historyHarmOverLimitVO.setTargetName(targetName);
|
||||
historyHarmOverLimitVO.setUnit(unit);
|
||||
historyHarmOverLimitVO.setTargetCode(contion);
|
||||
historyHarmOverLimitVO.setStatisticalType(Math.abs(historyHarmOverLimitVO.getMaxData()) > Math.abs(historyHarmOverLimitVO.getCp95Data()) ? 3 : 4);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
//电压总谐波畸变率
|
||||
sql = "SELECT time as time, uaberrance as aValue,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') " +
|
||||
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
queryResult = influxDbUtils.query(sql);
|
||||
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "电压总谐波畸变率", "%");
|
||||
targetName = "电压总谐波畸变率";
|
||||
unit = "%";
|
||||
historyHarmOverLimitVOList = normLimitMapper.getDyZjBl(lineId, DateUtil.beginOfDay(DateUtil.parse(startTime)), DateUtil.endOfDay(DateUtil.parse(endTime)));
|
||||
for (HistoryHarmOverLimitVO historyHarmOverLimitVO : historyHarmOverLimitVOList) {
|
||||
if (historyHarmOverLimitVO.getAvgData() == -3.14159 && historyHarmOverLimitVO.getMaxData() == -3.14159 && historyHarmOverLimitVO.getMinData() == -3.14159 && historyHarmOverLimitVO.getCp95Data() == -3.14159) {
|
||||
historyHarmOverLimitVOList.remove(historyHarmOverLimitVO);
|
||||
} else {
|
||||
historyHarmOverLimitVO.setTargetName(targetName);
|
||||
historyHarmOverLimitVO.setUnit(unit);
|
||||
historyHarmOverLimitVO.setTargetCode(contion);
|
||||
historyHarmOverLimitVO.setStatisticalType(4);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 22:
|
||||
//负序电流
|
||||
sql = "SELECT time as time, i_neg as aValue ,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||
" and (phasic_type ='T') " +
|
||||
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
queryResult = influxDbUtils.query(sql);
|
||||
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "负序电流", "/");
|
||||
targetName = "负序电流";
|
||||
unit = "/";
|
||||
historyHarmOverLimitVOList = normLimitMapper.getFxDl(lineId, DateUtil.beginOfDay(DateUtil.parse(startTime)), DateUtil.endOfDay(DateUtil.parse(endTime)));
|
||||
for (HistoryHarmOverLimitVO historyHarmOverLimitVO : historyHarmOverLimitVOList) {
|
||||
if (historyHarmOverLimitVO.getAvgData() == -3.14159 && historyHarmOverLimitVO.getMaxData() == -3.14159 && historyHarmOverLimitVO.getMinData() == -3.14159 && historyHarmOverLimitVO.getCp95Data() == -3.14159) {
|
||||
historyHarmOverLimitVOList.remove(historyHarmOverLimitVO);
|
||||
} else {
|
||||
historyHarmOverLimitVO.setTargetName(targetName);
|
||||
historyHarmOverLimitVO.setUnit(unit);
|
||||
historyHarmOverLimitVO.setTargetCode(contion);
|
||||
historyHarmOverLimitVO.setStatisticalType(Math.abs(historyHarmOverLimitVO.getMaxData()) > Math.abs(historyHarmOverLimitVO.getCp95Data()) ? 3 : 4);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 30:
|
||||
//频率 V9暂时代表Freq
|
||||
sql = "SELECT time as time, freq_dev as aValue ,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||
" and (phasic_type ='T') " +
|
||||
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
queryResult = influxDbUtils.query(sql);
|
||||
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "频率", "Hz");
|
||||
targetName = "频率";
|
||||
unit = "Hz";
|
||||
historyHarmOverLimitVOList = normLimitMapper.getPl(lineId, DateUtil.beginOfDay(DateUtil.parse(startTime)), DateUtil.endOfDay(DateUtil.parse(endTime)));
|
||||
for (HistoryHarmOverLimitVO historyHarmOverLimitVO : historyHarmOverLimitVOList) {
|
||||
if (historyHarmOverLimitVO.getAvgData() == -3.14159 && historyHarmOverLimitVO.getMaxData() == -3.14159 && historyHarmOverLimitVO.getMinData() == -3.14159 && historyHarmOverLimitVO.getCp95Data() == -3.14159) {
|
||||
historyHarmOverLimitVOList.remove(historyHarmOverLimitVO);
|
||||
} else {
|
||||
historyHarmOverLimitVO.setTargetName(targetName);
|
||||
historyHarmOverLimitVO.setUnit(unit);
|
||||
historyHarmOverLimitVO.setTargetCode(contion);
|
||||
historyHarmOverLimitVO.setStatisticalType(Math.abs(historyHarmOverLimitVO.getMaxData()) > Math.abs(historyHarmOverLimitVO.getMinData()) ? 3 : 2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 40:
|
||||
for (int i = 0; i < number.length; i++) {
|
||||
List<HistoryHarmOverLimitVO> harmOverLimitVOList;
|
||||
//谐波电压含有率
|
||||
sql = "SELECT time as time, uharm_" + number[i] + " as aValue ,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') " +
|
||||
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
queryResult = influxDbUtils.query(sql);
|
||||
harmOverLimitVOList = getNormData(queryResult, contion, lineList, "谐波电压含有率", "%", number[i]);
|
||||
historyHarmOverLimitVOList.addAll(harmOverLimitVOList);
|
||||
targetName = "谐波电压含有率";
|
||||
unit = "%";
|
||||
for (int i : number) {
|
||||
historyHarmOverLimitVOList = normLimitMapper.getXbDyHyl(lineId, DateUtil.beginOfDay(DateUtil.parse(startTime)), DateUtil.endOfDay(DateUtil.parse(endTime)), i);
|
||||
for (HistoryHarmOverLimitVO historyHarmOverLimitVO : historyHarmOverLimitVOList) {
|
||||
if (historyHarmOverLimitVO.getAvgData() == -3.14159 && historyHarmOverLimitVO.getMaxData() == -3.14159 && historyHarmOverLimitVO.getMinData() == -3.14159 && historyHarmOverLimitVO.getCp95Data() == -3.14159) {
|
||||
historyHarmOverLimitVOList.remove(historyHarmOverLimitVO);
|
||||
} else {
|
||||
historyHarmOverLimitVO.setTargetName(targetName);
|
||||
historyHarmOverLimitVO.setUnit(unit);
|
||||
historyHarmOverLimitVO.setNumber(i);
|
||||
historyHarmOverLimitVO.setTargetCode(contion);
|
||||
historyHarmOverLimitVO.setStatisticalType(4);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 43:
|
||||
for (int i = 0; i < number.length; i++) {
|
||||
List<HistoryHarmOverLimitVO> harmOverLimitVOList;
|
||||
//谐波电流幅值
|
||||
sql = "SELECT time as time, iharm_" + number[i] + " as aValue ,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') " +
|
||||
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
queryResult = influxDbUtils.query(sql);
|
||||
harmOverLimitVOList = getNormData(queryResult, contion, lineList, "谐波电流幅值", "A", number[i]);
|
||||
historyHarmOverLimitVOList.addAll(harmOverLimitVOList);
|
||||
targetName = "谐波电流幅值";
|
||||
unit = "A";
|
||||
for (int i : number) {
|
||||
historyHarmOverLimitVOList = normLimitMapper.getXbDlFz(lineId, DateUtil.beginOfDay(DateUtil.parse(startTime)), DateUtil.endOfDay(DateUtil.parse(endTime)), i);
|
||||
for (HistoryHarmOverLimitVO historyHarmOverLimitVO : historyHarmOverLimitVOList) {
|
||||
if (historyHarmOverLimitVO.getAvgData() == -3.14159 && historyHarmOverLimitVO.getMaxData() == -3.14159 && historyHarmOverLimitVO.getMinData() == -3.14159 && historyHarmOverLimitVO.getCp95Data() == -3.14159) {
|
||||
historyHarmOverLimitVOList.remove(historyHarmOverLimitVO);
|
||||
} else {
|
||||
historyHarmOverLimitVO.setTargetName(targetName);
|
||||
historyHarmOverLimitVO.setUnit(unit);
|
||||
historyHarmOverLimitVO.setNumber(i);
|
||||
historyHarmOverLimitVO.setTargetCode(contion);
|
||||
historyHarmOverLimitVO.setStatisticalType(4);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 46:
|
||||
for (int i = 0; i < inHarmNum.length; i++) {
|
||||
List<HistoryHarmOverLimitVO> harmOverLimitVOList;
|
||||
//间谐波电压含有率
|
||||
sql = "SELECT time as time, inuharm_" + inHarmNum[i] + " as aValue ,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') " +
|
||||
" and (value_type = 'MAX' or value_type = 'MIN' or value_type = 'AVG' or value_type = 'CP95') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
queryResult = influxDbUtils.query(sql);
|
||||
harmOverLimitVOList = getNormData(queryResult, contion, lineList, "间谐波电压含有率", "%", inHarmNum[i]);
|
||||
historyHarmOverLimitVOList.addAll(harmOverLimitVOList);
|
||||
targetName = "间谐波电压含有率";
|
||||
unit = "%";
|
||||
for (int i : inharm) {
|
||||
historyHarmOverLimitVOList = normLimitMapper.getJxbHyl(lineId, DateUtil.beginOfDay(DateUtil.parse(startTime)), DateUtil.endOfDay(DateUtil.parse(endTime)), i);
|
||||
for (HistoryHarmOverLimitVO historyHarmOverLimitVO : historyHarmOverLimitVOList) {
|
||||
if (historyHarmOverLimitVO.getAvgData() == -3.14159 && historyHarmOverLimitVO.getMaxData() == -3.14159 && historyHarmOverLimitVO.getMinData() == -3.14159 && historyHarmOverLimitVO.getCp95Data() == -3.14159) {
|
||||
historyHarmOverLimitVOList.remove(historyHarmOverLimitVO);
|
||||
} else {
|
||||
historyHarmOverLimitVO.setTargetName(targetName);
|
||||
historyHarmOverLimitVO.setUnit(unit);
|
||||
historyHarmOverLimitVO.setNumber(i);
|
||||
historyHarmOverLimitVO.setTargetCode(contion);
|
||||
historyHarmOverLimitVO.setStatisticalType(4);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 61:
|
||||
//长时闪变
|
||||
sql = "SELECT time as time, flicker as aValue ,phasic_type , value_type FROM pqs_abnormaldata WHERE " + stringBuilder.toString() +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') " +
|
||||
" and (value_type = 'AVG') group by phasic_type order by time asc tz('Asia/Shanghai');";
|
||||
queryResult = influxDbUtils.query(sql);
|
||||
historyHarmOverLimitVOList = getNormData(queryResult, contion, lineList, "长时闪变", "/");
|
||||
targetName = "长时闪变";
|
||||
unit = "/";
|
||||
historyHarmOverLimitVOList = normLimitMapper.getCsSb(lineId, DateUtil.beginOfDay(DateUtil.parse(startTime)), DateUtil.endOfDay(DateUtil.parse(endTime)));
|
||||
for (HistoryHarmOverLimitVO historyHarmOverLimitVO : historyHarmOverLimitVOList) {
|
||||
if (historyHarmOverLimitVO.getAvgData() == -3.14159) {
|
||||
historyHarmOverLimitVOList.remove(historyHarmOverLimitVO);
|
||||
} else {
|
||||
historyHarmOverLimitVO.setTargetName(targetName);
|
||||
historyHarmOverLimitVO.setUnit(unit);
|
||||
historyHarmOverLimitVO.setMaxData(3.14159f);
|
||||
historyHarmOverLimitVO.setMinData(3.14159f);
|
||||
historyHarmOverLimitVO.setCp95Data(3.14159f);
|
||||
historyHarmOverLimitVO.setTargetCode(contion);
|
||||
historyHarmOverLimitVO.setStatisticalType(1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -200,328 +254,4 @@ public class NormLimitServiceImpl implements NormLimitService {
|
||||
}
|
||||
return historyHarmOverLimitVOList;
|
||||
}
|
||||
|
||||
|
||||
//数据组装
|
||||
@SneakyThrows
|
||||
private List<HistoryHarmOverLimitVO> getNormData(QueryResult queryResult, String contion, String lineList, String phaseName, String unit) {
|
||||
List<HistoryHarmOverLimitVO> historyHarmOverLimitVOList = new ArrayList<>();
|
||||
List<QueryResult.Result> qusery = queryResult.getResults();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS'Z'");
|
||||
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
//获取监测点详情
|
||||
LineDetailDataVO lineDetailDataVO = lineFeignClient.getLineDetailData(lineList).getData();
|
||||
if (!CollectionUtils.isEmpty(qusery.get(0).getSeries())) {
|
||||
String time = "";
|
||||
Float aMax = 0.0f, aMin = 0.0f, aAvg = 0.0f, aCp95 = 0.0f, bMax = 0.0f, bMin = 0.0f, bAvg = 0.0f, bCp95 = 0.0f, cMax = 0.0f, cMin = 0.0f, cAvg = 0.0f, cCp95 = 0.0f;
|
||||
for (int i = 0; i < qusery.get(0).getSeries().size(); i++) {
|
||||
if (qusery.get(0).getSeries().get(i).getTags().get("phasic_type").equals("A")) {
|
||||
HistoryHarmOverLimitVO historyDataResultVO = new HistoryHarmOverLimitVO();
|
||||
if (!CollectionUtils.isEmpty(qusery.get(0).getSeries().get(i).getValues())) {
|
||||
for (int j = 0; j < qusery.get(0).getSeries().get(i).getValues().size(); j++) {
|
||||
List<Object> objectList = qusery.get(0).getSeries().get(i).getValues().get(j);
|
||||
String aa = String.valueOf(objectList.get(0));
|
||||
Date sd = dateFormat.parse(aa);
|
||||
time = dateFormat.format(sd);
|
||||
if (Integer.parseInt(contion) == 61) {
|
||||
historyDataResultVO.setMaxValue((float) 3.14159);
|
||||
historyDataResultVO.setMinValue((float) 3.14159);
|
||||
historyDataResultVO.setCp95Value((float) 3.14159);
|
||||
aAvg = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setAvgValue(aAvg);
|
||||
} else {
|
||||
if (objectList.get(3).equals("MAX")) {
|
||||
aMax = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setMaxValue(aMax);
|
||||
} else if (objectList.get(3).equals("MIN")) {
|
||||
aMin = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setMinValue(aMin);
|
||||
} else if (objectList.get(3).equals("AVG")) {
|
||||
aAvg = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setAvgValue(aAvg);
|
||||
} else if (objectList.get(3).equals("CP95")) {
|
||||
aCp95 = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setCp95Value(aCp95);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
historyDataResultVO.setTime(time);
|
||||
historyDataResultVO.setLineName(lineDetailDataVO.getLineName());
|
||||
historyDataResultVO.setLineId(lineList);
|
||||
historyDataResultVO.setNumber(0);
|
||||
historyDataResultVO.setSubName(lineDetailDataVO.getBdName());
|
||||
historyDataResultVO.setTargetCode(contion);
|
||||
historyDataResultVO.setTargetName(phaseName);
|
||||
if (Integer.parseInt(contion) == 12 || Integer.parseInt(contion) == 15) {
|
||||
if (PubUtils.ptTypeName(lineDetailDataVO.getPtType()) != 0) {
|
||||
historyDataResultVO.setPhaseType("AB");
|
||||
} else {
|
||||
historyDataResultVO.setPhaseType("A");
|
||||
}
|
||||
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aMin) ? 3 : 2);
|
||||
} else if (Integer.parseInt(contion) == 13 || Integer.parseInt(contion) == 22) {
|
||||
historyDataResultVO.setPhaseType("/");
|
||||
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aCp95) ? 3 : 4);
|
||||
} else {
|
||||
if (PubUtils.ptTypeName(lineDetailDataVO.getPtType()) != 0) {
|
||||
historyDataResultVO.setPhaseType("AB");
|
||||
} else {
|
||||
historyDataResultVO.setPhaseType("A");
|
||||
}
|
||||
historyDataResultVO.setStatisticalType(3);
|
||||
}
|
||||
historyDataResultVO.setScale(lineDetailDataVO.getScale());
|
||||
historyDataResultVO.setUnit(unit);
|
||||
historyHarmOverLimitVOList.add(historyDataResultVO);
|
||||
}
|
||||
if ("12".equals(contion) || "15".equals(contion) || "40".equals(contion) || "61".equals(contion)) {
|
||||
if (qusery.get(0).getSeries().get(i).getTags().get("phasic_type").equals("B")) {
|
||||
HistoryHarmOverLimitVO historyDataResultVO = new HistoryHarmOverLimitVO();
|
||||
if (!CollectionUtils.isEmpty(qusery.get(0).getSeries().get(i).getValues())) {
|
||||
for (int j = 0; j < qusery.get(0).getSeries().get(i).getValues().size(); j++) {
|
||||
List<Object> objectList = qusery.get(0).getSeries().get(i).getValues().get(j);
|
||||
String aa = String.valueOf(objectList.get(0));
|
||||
Date sd = dateFormat.parse(aa);
|
||||
time = dateFormat.format(sd);
|
||||
if (Integer.parseInt(contion) == 61) {
|
||||
historyDataResultVO.setMaxValue((float) 3.14159);
|
||||
historyDataResultVO.setMinValue((float) 3.14159);
|
||||
historyDataResultVO.setCp95Value((float) 3.14159);
|
||||
aAvg = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setAvgValue(aAvg);
|
||||
} else {
|
||||
if (objectList.get(3).equals("MAX")) {
|
||||
bMax = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setMaxValue(bMax);
|
||||
} else if (objectList.get(3).equals("MIN")) {
|
||||
bMin = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setMinValue(bMin);
|
||||
} else if (objectList.get(3).equals("AVG")) {
|
||||
bAvg = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setAvgValue(bAvg);
|
||||
} else if (objectList.get(3).equals("CP95")) {
|
||||
bCp95 = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setCp95Value(bCp95);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
historyDataResultVO.setTime(time);
|
||||
historyDataResultVO.setLineName(lineDetailDataVO.getLineName());
|
||||
historyDataResultVO.setLineId(lineList);
|
||||
historyDataResultVO.setNumber(0);
|
||||
historyDataResultVO.setSubName(lineDetailDataVO.getBdName());
|
||||
historyDataResultVO.setTargetCode(contion);
|
||||
historyDataResultVO.setTargetName(phaseName);
|
||||
if (Integer.parseInt(contion) == 12 || Integer.parseInt(contion) == 15) {
|
||||
if (PubUtils.ptTypeName(lineDetailDataVO.getPtType()) != 0) {
|
||||
historyDataResultVO.setPhaseType("BC");
|
||||
} else {
|
||||
historyDataResultVO.setPhaseType("B");
|
||||
}
|
||||
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aMin) ? 3 : 2);
|
||||
} else if (Integer.parseInt(contion) == 13 || Integer.parseInt(contion) == 22) {
|
||||
historyDataResultVO.setPhaseType("/");
|
||||
historyDataResultVO.setStatisticalType(Math.abs(aMax) > Math.abs(aCp95) ? 3 : 4);
|
||||
} else {
|
||||
if (PubUtils.ptTypeName(lineDetailDataVO.getPtType()) != 0) {
|
||||
historyDataResultVO.setPhaseType("BC");
|
||||
} else {
|
||||
historyDataResultVO.setPhaseType("B");
|
||||
}
|
||||
historyDataResultVO.setStatisticalType(3);
|
||||
}
|
||||
historyDataResultVO.setScale(lineDetailDataVO.getScale());
|
||||
historyDataResultVO.setUnit(unit);
|
||||
historyHarmOverLimitVOList.add(historyDataResultVO);
|
||||
} else if (qusery.get(0).getSeries().get(i).getTags().get("phasic_type").equals("C")) {
|
||||
if (!CollectionUtils.isEmpty(qusery.get(0).getSeries().get(i).getValues())) {
|
||||
HistoryHarmOverLimitVO historyDataResultVO = new HistoryHarmOverLimitVO();
|
||||
for (int j = 0; j < qusery.get(0).getSeries().get(i).getValues().size(); j++) {
|
||||
List<Object> objectList = qusery.get(0).getSeries().get(i).getValues().get(j);
|
||||
String aa = String.valueOf(objectList.get(0));
|
||||
Date sd = dateFormat.parse(aa);
|
||||
time = dateFormat.format(sd);
|
||||
if (Integer.parseInt(contion) == 61) {
|
||||
historyDataResultVO.setMaxValue((float) 3.14159);
|
||||
historyDataResultVO.setMinValue((float) 3.14159);
|
||||
historyDataResultVO.setCp95Value((float) 3.14159);
|
||||
aAvg = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setAvgValue(aAvg);
|
||||
} else {
|
||||
if (objectList.get(3).equals("MAX")) {
|
||||
cMax = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setMaxValue(cMax);
|
||||
} else if (objectList.get(3).equals("MIN")) {
|
||||
cMin = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setMinValue(cMin);
|
||||
} else if (objectList.get(3).equals("AVG")) {
|
||||
cAvg = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setAvgValue(cAvg);
|
||||
} else if (objectList.get(3).equals("CP95")) {
|
||||
cCp95 = Float.parseFloat(String.valueOf(objectList.get(1)));
|
||||
historyDataResultVO.setCp95Value(cCp95);
|
||||
}
|
||||
}
|
||||
}
|
||||
historyDataResultVO.setTime(time);
|
||||
historyDataResultVO.setLineName(lineDetailDataVO.getLineName());
|
||||
historyDataResultVO.setLineId(lineList);
|
||||
historyDataResultVO.setNumber(0);
|
||||
historyDataResultVO.setSubName(lineDetailDataVO.getBdName());
|
||||
historyDataResultVO.setTargetCode(contion);
|
||||
historyDataResultVO.setTargetName(phaseName);
|
||||
if (Integer.parseInt(contion) == 12 || Integer.parseInt(contion) == 15) {
|
||||
if (PubUtils.ptTypeName(lineDetailDataVO.getPtType()) != 0) {
|
||||
historyDataResultVO.setPhaseType("CA");
|
||||
} else {
|
||||
historyDataResultVO.setPhaseType("C");
|
||||
}
|
||||
historyDataResultVO.setStatisticalType(Math.abs(cMax) > Math.abs(cMin) ? 3 : 2);
|
||||
} else if (Integer.parseInt(contion) == 13 || Integer.parseInt(contion) == 22) {
|
||||
historyDataResultVO.setPhaseType("/");
|
||||
historyDataResultVO.setStatisticalType(Math.abs(cMax) > Math.abs(cCp95) ? 3 : 4);
|
||||
} else {
|
||||
if (PubUtils.ptTypeName(lineDetailDataVO.getPtType()) != 0) {
|
||||
historyDataResultVO.setPhaseType("CA");
|
||||
} else {
|
||||
historyDataResultVO.setPhaseType("C");
|
||||
}
|
||||
historyDataResultVO.setStatisticalType(3);
|
||||
}
|
||||
historyDataResultVO.setScale(lineDetailDataVO.getScale());
|
||||
historyDataResultVO.setUnit(unit);
|
||||
historyHarmOverLimitVOList.add(historyDataResultVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return historyHarmOverLimitVOList;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
private List<HistoryHarmOverLimitVO> getNormData(QueryResult queryResult, String contion, String lineList, String phaseName, String unit, int number) {
|
||||
List<HistoryHarmOverLimitVO> historyHarmOverLimitVOList = new ArrayList<>();
|
||||
List<QueryResult.Result> qusery = queryResult.getResults();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS'Z'");
|
||||
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
//获取监测点详情
|
||||
LineDetailDataVO lineDetailDataVO = lineFeignClient.getLineDetailData(lineList).getData();
|
||||
if (!CollectionUtils.isEmpty(qusery.get(0).getSeries())) {
|
||||
String time = "";
|
||||
Float aMax = 0.0f, aMin = 0.0f, aAvg = 0.0f, aCp95 = 0.0f, bMax = 0.0f, bMin = 0.0f, bAvg = 0.0f, bCp95 = 0.0f, cMax = 0.0f, cMin = 0.0f, cAvg = 0.0f, cCp95 = 0.0f;
|
||||
HistoryHarmOverLimitVO historyDataResultVO = new HistoryHarmOverLimitVO();
|
||||
for (int i = 0; i < qusery.get(0).getSeries().get(0).getValues().size(); i++) {
|
||||
//A相的最大值
|
||||
if (!CollectionUtils.isEmpty(qusery.get(0).getSeries())) {
|
||||
aMax = Float.parseFloat(qusery.get(0).getSeries().get(0).getValues().get(i).get(1).toString());
|
||||
historyDataResultVO.setMaxValue(aMax);
|
||||
}
|
||||
//A相的最小值
|
||||
if (!CollectionUtils.isEmpty(qusery.get(1).getSeries())) {
|
||||
aMin = Float.parseFloat(qusery.get(1).getSeries().get(0).getValues().get(i).get(1).toString());
|
||||
historyDataResultVO.setMinValue(aMin);
|
||||
}
|
||||
//A相的评价值
|
||||
if (!CollectionUtils.isEmpty(qusery.get(2).getSeries())) {
|
||||
aAvg = Float.parseFloat(qusery.get(2).getSeries().get(0).getValues().get(i).get(1).toString());
|
||||
historyDataResultVO.setAvgValue(aAvg);
|
||||
}
|
||||
//A相的CP95
|
||||
if (!CollectionUtils.isEmpty(qusery.get(3).getSeries())) {
|
||||
time = String.valueOf(qusery.get(3).getSeries().get(0).getValues().get(i).get(0));
|
||||
aCp95 = Float.parseFloat(qusery.get(3).getSeries().get(0).getValues().get(i).get(1).toString());
|
||||
historyDataResultVO.setTime(dateFormat.format(sdf.parse(time)));
|
||||
historyDataResultVO.setCp95Value(aCp95);
|
||||
}
|
||||
historyDataResultVO.setLineName(lineDetailDataVO.getLineName());
|
||||
historyDataResultVO.setLineId(lineList);
|
||||
historyDataResultVO.setNumber(number);
|
||||
historyDataResultVO.setSubName(lineDetailDataVO.getBdName());
|
||||
historyDataResultVO.setTargetCode(contion);
|
||||
historyDataResultVO.setTargetName(number + "次" + phaseName);
|
||||
historyDataResultVO.setPhaseType("A");
|
||||
historyDataResultVO.setStatisticalType(4);
|
||||
historyDataResultVO.setScale(lineDetailDataVO.getScale());
|
||||
historyDataResultVO.setUnit(unit);
|
||||
historyHarmOverLimitVOList.add(historyDataResultVO);
|
||||
}
|
||||
for (int i = 0; i < qusery.get(4).getSeries().get(0).getValues().size(); i++) {
|
||||
HistoryHarmOverLimitVO historyDataResultVOB = new HistoryHarmOverLimitVO();
|
||||
//B相的最大值
|
||||
if (!CollectionUtils.isEmpty(qusery.get(4).getSeries())) {
|
||||
bMax = Float.parseFloat(qusery.get(4).getSeries().get(0).getValues().get(i).get(1).toString());
|
||||
historyDataResultVOB.setMaxValue(bMax);
|
||||
}
|
||||
//B相的最小值
|
||||
if (!CollectionUtils.isEmpty(qusery.get(5).getSeries())) {
|
||||
bMin = Float.parseFloat(qusery.get(5).getSeries().get(0).getValues().get(i).get(1).toString());
|
||||
historyDataResultVOB.setMinValue(bMin);
|
||||
}
|
||||
//B相的平均值
|
||||
if (!CollectionUtils.isEmpty(qusery.get(6).getSeries())) {
|
||||
bAvg = Float.parseFloat(qusery.get(6).getSeries().get(0).getValues().get(i).get(1).toString());
|
||||
historyDataResultVOB.setAvgValue(bAvg);
|
||||
}
|
||||
//B相的CP95
|
||||
if (!CollectionUtils.isEmpty(qusery.get(7).getSeries())) {
|
||||
time = String.valueOf(qusery.get(7).getSeries().get(0).getValues().get(i).get(0));
|
||||
bCp95 = Float.parseFloat(qusery.get(7).getSeries().get(0).getValues().get(i).get(1).toString());
|
||||
historyDataResultVOB.setTime(dateFormat.format(sdf.parse(time)));
|
||||
historyDataResultVOB.setCp95Value(bCp95);
|
||||
}
|
||||
historyDataResultVOB.setLineName(lineDetailDataVO.getLineName());
|
||||
historyDataResultVOB.setLineId(lineList);
|
||||
historyDataResultVOB.setNumber(number);
|
||||
historyDataResultVOB.setSubName(lineDetailDataVO.getBdName());
|
||||
historyDataResultVOB.setTargetCode(contion);
|
||||
historyDataResultVOB.setTargetName(number + "次" + phaseName);
|
||||
historyDataResultVOB.setPhaseType("B");
|
||||
historyDataResultVOB.setScale(lineDetailDataVO.getScale());
|
||||
historyDataResultVOB.setUnit(unit);
|
||||
historyHarmOverLimitVOList.add(historyDataResultVOB);
|
||||
}
|
||||
for (int i = 0; i < qusery.get(8).getSeries().get(0).getValues().size(); i++) {
|
||||
HistoryHarmOverLimitVO historyDataResultVOC = new HistoryHarmOverLimitVO();
|
||||
//C相的最大值
|
||||
if (!CollectionUtils.isEmpty(qusery.get(8).getSeries())) {
|
||||
cMax = Float.parseFloat(qusery.get(8).getSeries().get(0).getValues().get(i).get(1).toString());
|
||||
historyDataResultVOC.setMaxValue(cMax);
|
||||
}
|
||||
//C相的最小值
|
||||
if (!CollectionUtils.isEmpty(qusery.get(9).getSeries())) {
|
||||
cMin = Float.parseFloat(qusery.get(9).getSeries().get(0).getValues().get(i).get(1).toString());
|
||||
historyDataResultVOC.setMinValue(cMin);
|
||||
}
|
||||
//C相的平均值
|
||||
if (!CollectionUtils.isEmpty(qusery.get(10).getSeries())) {
|
||||
cAvg = Float.parseFloat(qusery.get(10).getSeries().get(0).getValues().get(i).get(1).toString());
|
||||
historyDataResultVOC.setAvgValue(cAvg);
|
||||
}
|
||||
//C相的CP95
|
||||
if (!CollectionUtils.isEmpty(qusery.get(11).getSeries())) {
|
||||
time = String.valueOf(qusery.get(11).getSeries().get(0).getValues().get(i).get(0));
|
||||
cCp95 = Float.parseFloat(qusery.get(11).getSeries().get(0).getValues().get(i).get(1).toString());
|
||||
historyDataResultVOC.setTime(dateFormat.format(sdf.parse(time)));
|
||||
historyDataResultVOC.setCp95Value(cCp95);
|
||||
}
|
||||
historyDataResultVOC.setLineName(lineDetailDataVO.getLineName());
|
||||
historyDataResultVOC.setLineId(lineList);
|
||||
historyDataResultVOC.setNumber(number);
|
||||
historyDataResultVOC.setSubName(lineDetailDataVO.getBdName());
|
||||
historyDataResultVOC.setTargetCode(contion);
|
||||
historyDataResultVOC.setTargetName(number + "次" + phaseName);
|
||||
historyDataResultVOC.setPhaseType("C");
|
||||
historyDataResultVOC.setScale(lineDetailDataVO.getScale());
|
||||
historyDataResultVOC.setUnit(unit);
|
||||
historyHarmOverLimitVOList.add(historyDataResultVOC);
|
||||
}
|
||||
}
|
||||
return historyHarmOverLimitVOList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.njcn.harmonic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.api.SubstationFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.device.pq.pojo.dto.SubstationDTO;
|
||||
import com.njcn.harmonic.mapper.RStatPollutionSubstationMMapper;
|
||||
import com.njcn.harmonic.pojo.param.HarmonicPublicParam;
|
||||
import com.njcn.harmonic.pojo.param.PollutionSubstationQuryParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatPollutionSubstationM;
|
||||
import com.njcn.harmonic.pojo.vo.PollutionSubstationVO;
|
||||
import com.njcn.harmonic.service.PollutionSubstationService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/10/13 8:56【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSubstationMMapper, RStatPollutionSubstationM> implements PollutionSubstationService {
|
||||
|
||||
|
||||
private final SubstationFeignClient substationFeignClient;
|
||||
|
||||
private final RStatPollutionSubstationMMapper pollutionSubstationMMapper;
|
||||
|
||||
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
||||
|
||||
private final LineFeignClient lineFeignClient;
|
||||
|
||||
private final GeneralInfo generalInfo;
|
||||
|
||||
|
||||
/**
|
||||
* @param pollutionSubstationQuryParam
|
||||
* @Description: getPollutionSubstationData
|
||||
* @Param: [pollutionSubstationQuryParam]
|
||||
* @return: java.util.List<com.njcn.harmonic.pojo.vo.PollutionSubstationVO>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/13
|
||||
*/
|
||||
@Override
|
||||
public List<PollutionSubstationVO> getPollutionSubstationData(PollutionSubstationQuryParam pollutionSubstationQuryParam) {
|
||||
|
||||
List<PollutionSubstationVO> pollutionSubstationVOList = new ArrayList<> ();
|
||||
/*根据部门获取变电站详情*/
|
||||
HarmonicPublicParam harmonicPublicParam = new HarmonicPublicParam();
|
||||
BeanUtils.copyProperties (pollutionSubstationQuryParam, harmonicPublicParam);
|
||||
harmonicPublicParam.setServerName(generalInfo.getMicroServiceName());
|
||||
List<PollutionSubstationDTO> pollutionSubstationDTOList = new ArrayList<>();
|
||||
List<GeneralDeviceDTO> sub = generalDeviceInfoClient.getPracticalRunDeviceInfoAsSubstation(harmonicPublicParam).getData();
|
||||
|
||||
sub.forEach(item->{
|
||||
PollutionSubstationDTO pollutionSubstationDTO = lineFeignClient.getSubstationInfo(item.getIndex()).getData();
|
||||
|
||||
pollutionSubstationDTOList.add(pollutionSubstationDTO);
|
||||
});
|
||||
List<String> collect = pollutionSubstationDTOList.stream ( ).map (PollutionSubstationDTO::getId).collect (Collectors.toList ( ));
|
||||
List<SubstationDTO> locationData = substationFeignClient.getSubstationById (collect).getData ( );
|
||||
/*todo 后期可以把locationData存入redis*/
|
||||
/*把所有的变电站的污染指数查出来*/
|
||||
QueryWrapper<RStatPollutionSubstationM> wrapper = new QueryWrapper<> ();
|
||||
wrapper.in ("substation_id",collect).
|
||||
eq ("pollution_type", pollutionSubstationQuryParam.getPollutionStatis ().getId ()).
|
||||
apply("DATE_FORMAT( data_date ,'%Y-%m') = '"+pollutionSubstationQuryParam.getLocalDate ()+"'");
|
||||
List<RStatPollutionSubstationM> rStatPollutionSubstationMList = pollutionSubstationMMapper.selectList (wrapper);
|
||||
|
||||
pollutionSubstationDTOList.forEach (substationInfo ->{
|
||||
|
||||
PollutionSubstationVO pollutionSubstationVO =new PollutionSubstationVO ();
|
||||
pollutionSubstationVO.setSubstationId (substationInfo.getId ());
|
||||
pollutionSubstationVO.setSubstationName (substationInfo.getName ());
|
||||
/*todo 添加经纬度接口返回数据暂时没有*/
|
||||
SubstationDTO substationDTO = locationData.stream ().filter (temp -> Objects.equals (substationInfo.getId ( ), temp.getId ())).
|
||||
collect (Collectors.toList ( )).get (0);
|
||||
|
||||
pollutionSubstationVO.setLatitude (substationDTO.getLat ());
|
||||
pollutionSubstationVO.setLongitude (substationDTO.getLng ());
|
||||
|
||||
|
||||
Double value = Optional.ofNullable (
|
||||
rStatPollutionSubstationMList.stream ( ).filter (temp -> Objects.equals (substationInfo.getId ( ), temp.getSubstationId ( ))).
|
||||
collect (Collectors.toList ( )).get (0).getValue ( )
|
||||
).orElse (new Double ("0.00"));
|
||||
pollutionSubstationVO.setPollutionData (value);
|
||||
pollutionSubstationVO.setPollutionStatis ( pollutionSubstationQuryParam.getStatisticalType ().getName ());
|
||||
pollutionSubstationVOList.add (pollutionSubstationVO);
|
||||
});
|
||||
List<PollutionSubstationVO> result = pollutionSubstationVOList.stream ( ).sorted (Comparator.comparing (PollutionSubstationVO::getPollutionData).reversed ( )).collect (Collectors.toList ( ));
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,33 @@
|
||||
package com.njcn.harmonic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.harmonic.constant.Param;
|
||||
import com.njcn.harmonic.mapper.RMpVThdMapper;
|
||||
import com.njcn.harmonic.mapper.THDistortionMapper;
|
||||
import com.njcn.harmonic.pojo.dto.PublicDTO;
|
||||
import com.njcn.harmonic.pojo.po.RMpVThd;
|
||||
import com.njcn.harmonic.pojo.vo.RMpVThdVO;
|
||||
import com.njcn.harmonic.pojo.vo.THDistortionCensusVO;
|
||||
import com.njcn.harmonic.pojo.vo.THDistortionVO;
|
||||
import com.njcn.harmonic.service.THDistortionService;
|
||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.influxdb.dto.QueryResult;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -41,6 +47,9 @@ public class THDistortionServiceImpl implements THDistortionService {
|
||||
|
||||
private final InfluxDbUtils influxDbUtils;
|
||||
|
||||
private final RMpVThdMapper rMpVThdMapper;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
|
||||
@Override
|
||||
public List<THDistortionVO> getTHDistortionData(DeviceInfoParam.BusinessParam thDistortionParam) {
|
||||
List<THDistortionVO> thDistortionVOS = new ArrayList<>();
|
||||
@@ -96,6 +105,47 @@ public class THDistortionServiceImpl implements THDistortionService {
|
||||
return distortionCensusVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param statisticsBizBaseParam
|
||||
* @Description: 谐波总畸变率前十列表
|
||||
* @Param: [statisticsBizBaseParam]
|
||||
* @return: java.util.List<com.njcn.harmonic.pojo.vo.RMpVThdVO>
|
||||
* @Author: clam
|
||||
* @Date: 2022/10/10
|
||||
*/
|
||||
@Override
|
||||
public List<RMpVThdVO> getTHDTopTenData(StatisticsBizBaseParam statisticsBizBaseParam) {
|
||||
|
||||
List<RMpVThdVO> rMpVThdVOList = new ArrayList<> ();
|
||||
DeviceInfoParam deviceInfoParam = new DeviceInfoParam ();
|
||||
deviceInfoParam.setDeptIndex (statisticsBizBaseParam.getId ());
|
||||
deviceInfoParam.setStatisticalType (new SimpleDTO ());
|
||||
deviceInfoParam.setServerName (generalInfo.getMicroServiceName());
|
||||
deviceInfoParam.setPowerFlag (0);
|
||||
deviceInfoParam.setMonitorFlag (0);
|
||||
/*获取按部门分类的实际所有终端综合信息*/
|
||||
List<GeneralDeviceDTO> deviceList = generalDeviceInfoClient.getPracticalAllDeviceInfoAsDept (deviceInfoParam).getData ();
|
||||
/*监测点ID扁平化*/
|
||||
List<String> collect = deviceList.stream ( ).map (GeneralDeviceDTO::getLineIndexes).flatMap (Collection::stream).distinct ( ).collect (Collectors.toList ( ));
|
||||
QueryWrapper<RMpVThd> wrapper = new QueryWrapper<>();
|
||||
wrapper.in ("measurement_point_id",collect).
|
||||
eq ("data_type", statisticsBizBaseParam.getType ()).
|
||||
between ("data_date", statisticsBizBaseParam.getStartTime (), statisticsBizBaseParam.getEndTime ()).
|
||||
orderByDesc ("v_thd").
|
||||
last (" limit 10");
|
||||
List<RMpVThd> rMpVThdList = rMpVThdMapper.selectList (wrapper);
|
||||
rMpVThdVOList = rMpVThdList.stream ( ).map (rMpVThd -> {
|
||||
RMpVThdVO rMpVThdVO = new RMpVThdVO ( );
|
||||
BeanUtils.copyProperties (rMpVThd, rMpVThdVO);
|
||||
/*查询监测点详情获取名称*/
|
||||
LineDetailDataVO data = lineFeignClient.getLineDetailData (rMpVThd.getMeasurementPointId ( )).getData ( );
|
||||
rMpVThdVO.setName (data.getLineName ());
|
||||
return rMpVThdVO;
|
||||
}).collect (Collectors.toList ( ));
|
||||
|
||||
return rMpVThdVOList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 计算父级畸变率
|
||||
|
||||
@@ -28,15 +28,12 @@ public interface DicDataFeignClient {
|
||||
@GetMapping("/getDicDataById")
|
||||
HttpResult<DictData> getDicDataById(@RequestParam("dicIndex") String dicIndex);
|
||||
|
||||
@GetMapping("/getDicDataByTypeName")
|
||||
HttpResult<List<DictData>> getDicDataByTypeName(@RequestParam("dictTypeName") String dictTypeName);
|
||||
|
||||
@GetMapping("/getDicDataByTypeCode")
|
||||
HttpResult<List<DictData>> getDicDataByTypeCode(@RequestParam("dictTypeCode") String dictTypeCode);
|
||||
|
||||
@GetMapping("/getDicDataByName")
|
||||
HttpResult<DictData> getDicDataByName(@RequestParam("dicName") String dicName);
|
||||
|
||||
@GetMapping("/getDicDataByCode")
|
||||
HttpResult<DictData> getDicDataByCode(@RequestParam("code") String code);
|
||||
|
||||
@GetMapping("/getLoadTypeBySys")
|
||||
HttpResult<List<DictData>> getLoadTypeBySys();
|
||||
|
||||
@@ -59,4 +56,15 @@ public interface DicDataFeignClient {
|
||||
*/
|
||||
@GetMapping("/getDicDataByNameAndTypeName")
|
||||
HttpResult<DictData> getDicDataByNameAndTypeName(@RequestParam("dicTypeName") String dicTypeName, @RequestParam("dicDataName") String dicDataName);
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* 字典类型
|
||||
*/
|
||||
@GetMapping("/getDicDataByTypeName")
|
||||
HttpResult<List<DictData>> getDicDataByTypeName(@RequestParam("dictTypeName") String dictTypeName);
|
||||
|
||||
@GetMapping("/getDicDataByTypeCode")
|
||||
HttpResult<List<DictData>> getDicDataByTypeCode(@RequestParam("dictTypeCode") String dictTypeCode);
|
||||
}
|
||||
|
||||
@@ -55,6 +55,12 @@ public class DicDataFeignClientFallbackFactory implements FallbackFactory<DicDat
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<DictData> getDicDataByCode(String code) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据字典code获取字典数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DictData>> getLoadTypeBySys() {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据系统类型获取不同指标参数",cause.toString());
|
||||
|
||||
@@ -39,6 +39,11 @@ public enum DicDataEnum {
|
||||
DEV_QUALITY("电能质量监测终端","Dev_Quality"),
|
||||
DEV_SMART("智能电表","Dev_Smart"),
|
||||
DEV_MIX("智能融合终端","Dev_Mix"),
|
||||
|
||||
/***
|
||||
* 告警类型
|
||||
*/
|
||||
COMM_ERR("通讯异常","Comm_Err")
|
||||
;
|
||||
|
||||
private final String name;
|
||||
|
||||
@@ -162,6 +162,16 @@ public class DictDataController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getDicDataByCode")
|
||||
@ApiOperation("根据字典code查询字典数据")
|
||||
@ApiImplicitParam(name = "code", value = "查询参数", required = true)
|
||||
public HttpResult<DictData> getDicDataByCode(@RequestParam("code") String code) {
|
||||
String methodDescribe = getMethodDescribe("getDicDataByCode");
|
||||
DictData result = dictDataService.getDicDataByCode(code);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据系统类型获取不同指标参数
|
||||
*/
|
||||
|
||||
@@ -36,6 +36,7 @@ public interface DictDataMapper extends BaseMapper<DictData> {
|
||||
|
||||
DictData getDicDataByName(@Param("dicName")String dicName);
|
||||
|
||||
DictData getDicDataByCode(@Param("code")String code);
|
||||
/**
|
||||
* 根据字典类型名称&数据名称获取字典数据
|
||||
*
|
||||
@@ -50,4 +51,5 @@ public interface DictDataMapper extends BaseMapper<DictData> {
|
||||
* @return 根据字典类型名称查询字典数据
|
||||
*/
|
||||
List<DictData> getDicDataByTypeCode(@Param("dictTypeCode")String dictTypeCode);
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,13 @@
|
||||
WHERE sys_dict_data.name = #{dicName}
|
||||
</select>
|
||||
|
||||
<!-- 根据字典名称查询字典数据-->
|
||||
<select id="getDicDataByCode" resultType="DictData">
|
||||
SELECT sys_dict_data.*
|
||||
FROM sys_dict_data sys_dict_data
|
||||
WHERE sys_dict_data.code = #{code}
|
||||
</select>
|
||||
|
||||
<select id="getDicDataByNameAndTypeName" resultType="DictData">
|
||||
SELECT
|
||||
T2.*
|
||||
|
||||
@@ -83,6 +83,13 @@ public interface IDictDataService extends IService<DictData> {
|
||||
*/
|
||||
DictData getDicDataByName(String dicName);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param cpde 字典code
|
||||
* @return 根据字典code查询字典数据
|
||||
*/
|
||||
DictData getDicDataByCode(String code);
|
||||
|
||||
/**
|
||||
* 根据系统获取指标参数
|
||||
* @return 操作结果
|
||||
@@ -107,4 +114,5 @@ public interface IDictDataService extends IService<DictData> {
|
||||
DictData addDictData(String dicTypeName, String dicDataName);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -144,6 +144,11 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
|
||||
return this.baseMapper.getDicDataByName(dicName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DictData getDicDataByCode(String code) {
|
||||
return this.baseMapper.getDicDataByCode(code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictData> getLoadTypeBySys() {
|
||||
List<DictData> list = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user