预处理兼容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

@@ -9,6 +9,7 @@ import com.njcn.device.biz.commApi.fallback.CommTerminalGeneralClientFallbackFac
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 io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
@@ -119,6 +120,14 @@ public interface CommTerminalGeneralClient {
@PostMapping("/getMonitorDetailList")
HttpResult<List<LineDevGetDTO>> getMonitorDetailList(@RequestBody List<String> list);
@GetMapping("/lineUnitDetail")
HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId);
@GetMapping("/getMonitorDetail")
HttpResult<LineDevGetDTO> getMonitorDetail(@RequestParam("lineId") String lineId);
/**
* 用于返回pq 还是pms系统
* @author cdf

View File

@@ -0,0 +1,39 @@
package com.njcn.device.biz.commApi.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.biz.commApi.CommLedgerDeptClient;
import com.njcn.device.biz.commApi.CommLineClient;
import com.njcn.device.biz.utils.DeviceEnumUtil;
import com.njcn.user.pojo.po.Dept;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 公共
* @author cdf
* @date 2023/5/17
*/
@Slf4j
@Component
public class CommLineClientFallbackFactory implements FallbackFactory<CommLineClient> {
@Override
public CommLineClient 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 CommLineClient() {
};
}
}

View File

@@ -7,6 +7,7 @@ import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
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.biz.utils.DeviceEnumUtil;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
@@ -98,6 +99,18 @@ public class CommTerminalGeneralClientFallbackFactory implements FallbackFactory
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<PqsDeviceUnit> lineUnitDetail(String lineId) {
log.error("{}异常,降级处理,异常为:{}", "获取监测点详细信息集合", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<LineDevGetDTO> getMonitorDetail(String lineId) {
log.error("{}异常,降级处理,异常为:{}", "获取监测点详细信息集合", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<String> isPqOrPms() {
log.error("{}异常,降级处理,异常为:{}", "返回pq还是pms系统", throwable.toString());

View File

@@ -23,6 +23,8 @@ public class LineDevGetDTO {
*/
private String pointId;
private String pointName;
/**
* 装置监测点索引集合
*/

View File

@@ -0,0 +1,120 @@
package com.njcn.device.biz.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";
}