预处理兼容pq/pms处理

This commit is contained in:
2023-09-21 15:34:38 +08:00
parent 511924fd75
commit 4e7da3a056
29 changed files with 280 additions and 55 deletions

View File

@@ -3,15 +3,11 @@ 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.LineIntegrityClientFallbackFactory;
import com.njcn.device.pq.pojo.po.PqsDeviceUnit;
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 监测点数据完整性
* @author cdf
@@ -26,7 +22,7 @@ public interface DeviceUnitClient {
/**
* @Description: 根据监测点id获取数据单位
* @param lineID
* @return: com.njcn.common.pojo.response.HttpResult<com.njcn.device.pq.pojo.po.PqsDeviceUnit>
* @return: com.njcn.common.pojo.response.HttpResult<com.njcn.device.biz.pojo.po.PqsDeviceUnit>
* @Author: wr
* @Date: 2023/8/22 16:21
*/

View File

@@ -5,7 +5,7 @@ import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.biz.utils.DeviceEnumUtil;
import com.njcn.device.pq.api.DeviceUnitClient;
import com.njcn.device.pq.pojo.po.PqsDeviceUnit;
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

View File

@@ -1,120 +0,0 @@
package com.njcn.device.pq.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Description: 数据单位管理表
* @Author: wr
* @Date: 2023/8/21 9:56
*/
@Data
@TableName("pqs_device_unit")
public class PqsDeviceUnit {
private static final long serialVersionUID = 1L;
@TableId(value = "DEV_INDEX")
@ApiModelProperty(value = "终端编号")
private String devIndex;
@TableField("UNIT_FREQUENCY")
@ApiModelProperty(value = "频率")
private String unitFrequency = "Hz";
@TableField("UNIT_FREQUENCY_DEV")
@ApiModelProperty(value = "频率偏差")
private String unitFrequencyDev = "Hz";
@TableField("PHASE_VOLTAGE")
@ApiModelProperty(value = "相电压有效值")
private String phaseVoltage = "kV";
@TableField("LINE_VOLTAGE")
@ApiModelProperty(value = "线电压有效值")
private String lineVoltage = "kV";
@TableField("VOLTAGE_DEV")
@ApiModelProperty(value = "电压上偏差")
private String voltageDev = "%";
@TableField("UVOLTAGE_DEV")
@ApiModelProperty(value = "电压下偏差")
private String uvoltageDev = "%";
@TableField("I_EFFECTIVE")
@ApiModelProperty(value = "电流有效值")
private String ieffective = "A";
@TableField("SINGLE_P")
@ApiModelProperty(value = "单相有功功率")
private String singleP = "kW";
@TableField("SINGLE_VIEW_P")
@ApiModelProperty(value = "单相视在功率")
private String singleViewP = "kVA";
@TableField("SINGLE_NO_P")
@ApiModelProperty(value = "单相无功功率")
private String singleNoP = "kVar";
@TableField("TOTAL_ACTIVE_P")
@ApiModelProperty(value = "总有功功率")
private String totalActiveP = "kW";
@TableField("TOTAL_VIEW_P")
@ApiModelProperty(value = "总视在功率")
private String totalViewP = "kVA";
@TableField("TOTAL_NO_P")
@ApiModelProperty(value = "总无功功率")
private String totalNoP = "kVar";
@TableField("V_FUND_EFFECTIVE")
@ApiModelProperty(value = "相(线)电压基波有效值")
private String vfundEffective = "kV";
@TableField("I_FUND")
@ApiModelProperty(value = "基波电流")
private String ifund = "A";
@TableField("FUND_ACTIVE_P")
@ApiModelProperty(value = "基波有功功率")
private String fundActiveP = "kW";
@TableField("FUND_NO_P")
@ApiModelProperty(value = "基波无功功率")
private String fundNoP = "kVar";
@TableField("V_DISTORTION")
@ApiModelProperty(value = "电压总谐波畸变率")
private String vdistortion = "%";
@TableField("V_HARMONIC_RATE")
@ApiModelProperty(value = "250次谐波电压含有率")
private String vharmonicRate = "%";
@TableField("I_HARMONIC")
@ApiModelProperty(value = "250次谐波电流有效值")
private String iharmonic = "A";
@TableField("P_HARMONIC")
@ApiModelProperty(value = "250次谐波有功功率")
private String pharmonic = "kW";
@TableField("I_IHARMONIC")
@ApiModelProperty(value = "0.549.5次间谐波电流有效值")
private String iiharmonic = "A";
@TableField("POSITIVE_V")
@ApiModelProperty(value = "正序电压")
private String positiveV = "kV";
@TableField("NO_POSITIVE_V")
@ApiModelProperty(value = "零序负序电压")
private String noPositiveV = "V";
}

View File

@@ -1,7 +1,6 @@
package com.njcn.device.pq.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.njcn.device.pq.pojo.po.PqsDeviceUnit;
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@@ -5,16 +5,20 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.common.utils.LogUtil;
import com.njcn.device.biz.pojo.dto.*;
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
import com.njcn.device.biz.pojo.po.Overlimit;
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
import com.njcn.device.pq.mapper.LineDetailMapper;
import com.njcn.device.pq.mapper.LineMapper;
import com.njcn.device.pq.pojo.po.Line;
import com.njcn.device.pq.pojo.po.LineDetail;
import com.njcn.device.pq.service.CommTerminalService;
import com.njcn.device.pq.service.IPqsDeviceUnitService;
import com.njcn.device.pq.service.LineService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
@@ -27,6 +31,7 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Objects;
/**
* pqs
@@ -47,6 +52,10 @@ public class CommTerminalController extends BaseController {
private final LineMapper lineMapper;
private final LineDetailMapper lineDetailMapper;
private final IPqsDeviceUnitService iPqsDeviceUnitService;
/**
@@ -260,4 +269,33 @@ public class CommTerminalController extends BaseController {
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@GetMapping("/lineUnitDetail")
@ApiOperation("根据监测点id获取数据单位")
@ApiImplicitParam(name = "lineID", value = "实体", required = true)
public HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineID") String lineId) {
String methodDescribe = getMethodDescribe("lineUnitDetail");
PqsDeviceUnit pqsDeviceUnit = iPqsDeviceUnitService.lineUnitDetail(lineId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe);
}
/**
* 通过监测点获取监测点数据单位
* @author cdf
* @date 2023/9/21
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@GetMapping("/getMonitorDetail")
@ApiOperation("根据监测点id获取数据单位")
@ApiImplicitParam(name = "lineID", value = "实体", required = true)
public HttpResult<LineDevGetDTO> getMonitorDetail(@RequestParam("lineId") String lineId) {
String methodDescribe = getMethodDescribe("getMonitorDetail");
LineDevGetDTO monitor = lineDetailMapper.getMonitorDetail(lineId);
if(Objects.isNull(monitor)){
throw new BusinessException("未查询到监测点信息");
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
}
}

View File

@@ -6,7 +6,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pq.pojo.po.PqsDeviceUnit;
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
import com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo;
import com.njcn.device.pq.service.IPqsDeviceUnitService;
import io.swagger.annotations.Api;

View File

@@ -2,6 +2,7 @@ package com.njcn.device.pq.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
import com.njcn.device.pq.pojo.po.LineDetail;
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
import org.apache.ibatis.annotations.Param;
@@ -47,4 +48,7 @@ public interface LineDetailMapper extends BaseMapper<LineDetail> {
@Select ("select count(1) from pq_line a where a.`Level`=6 and SUBSTRING_INDEX(SUBSTRING_INDEX(a.Pids, ',', 4),',',-1)=#{subIndex}")
Integer getLineCountBySubstation(@Param("subIndex")String subIndex);
LineDevGetDTO getMonitorDetail(@Param("monitorId")String monitorId);
}

View File

@@ -1,12 +1,11 @@
package com.njcn.device.pq.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pq.pojo.po.PqsDeviceUnit;
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
import com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* <p>
@@ -30,7 +29,7 @@ public interface PqsDeviceUnitMapper extends BaseMapper<PqsDeviceUnit> {
/**
* @Description: 根据监测点信息查询
* @param ids
* @return: java.util.List<com.njcn.device.pq.pojo.po.PqsDeviceUnit>
* @return: java.util.List<com.njcn.device.biz.pojo.po.PqsDeviceUnit>
* @Author: wr
* @Date: 2023/8/21 14:17
*/

View File

@@ -52,4 +52,12 @@
#{item}
</foreach>
</select>
<select id="getMonitorDetail" resultType="LineDevGetDTO">
select a.id pointId,a.name pointName,b.Time_Interval interval
from pq_line a
inner join pq_line_detail b on a.id=b.id
where a.id = #{monitorId}
</select>
</mapper>

View File

@@ -19,7 +19,7 @@
</if>
</where>
</select>
<select id="deviceUnitByID" resultType="com.njcn.device.pq.pojo.po.PqsDeviceUnit">
<select id="deviceUnitByID" resultType="com.njcn.device.biz.pojo.po.PqsDeviceUnit">
SELECT
unit.*
FROM

View File

@@ -1,7 +1,7 @@
package com.njcn.device.pq.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pq.pojo.po.PqsDeviceUnit;
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
import com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo;
import java.util.List;
@@ -37,7 +37,7 @@ public interface IPqsDeviceUnitService extends IService<PqsDeviceUnit> {
/**
* @param lineID
* @Description: 根据监测点id查询数据单位
* @return: com.njcn.device.pq.pojo.po.PqsDeviceUnit
* @return: com.njcn.device.biz.pojo.po.PqsDeviceUnit
* @Author: wr
* @Date: 2023/8/21 14:02
*/
@@ -46,7 +46,7 @@ public interface IPqsDeviceUnitService extends IService<PqsDeviceUnit> {
/**
* @param devID
* @Description: 根据终端id查询数据单位
* @return: com.njcn.device.pq.pojo.po.PqsDeviceUnit
* @return: com.njcn.device.biz.pojo.po.PqsDeviceUnit
* @Author: wr
* @Date: 2023/8/21 14:02
*/

View File

@@ -6,7 +6,7 @@ import com.njcn.device.pq.enums.LineBaseEnum;
import com.njcn.device.pq.mapper.LineMapper;
import com.njcn.device.pq.mapper.PqsDeviceUnitMapper;
import com.njcn.device.pq.pojo.po.Line;
import com.njcn.device.pq.pojo.po.PqsDeviceUnit;
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
import com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo;
import com.njcn.device.pq.pojo.vo.TerminalTree;
import com.njcn.device.pq.service.IPqsDeviceUnitService;