合并代码
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package com.njcn.device.pms.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pms.api.fallback.PwMonitorClientFallbackFactory;
|
||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.device.pms.pojo.po.PmsTerminal;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author clam
|
||||
* @date 2022/10/28
|
||||
*/
|
||||
|
||||
@FeignClient(
|
||||
value = ServerInfo.DEVICE,
|
||||
path = "/pms/terminal",
|
||||
fallbackFactory = PwMonitorClientFallbackFactory.class)
|
||||
public interface PmsTerminalClient {
|
||||
|
||||
/**
|
||||
* @Description: 查询监测终端台账所有信息
|
||||
* @Param: []
|
||||
* @return: com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.po.PmsTerminal>>
|
||||
* @Author: clam
|
||||
* @Date: 2022/12/1
|
||||
*/
|
||||
@PostMapping("/getTerminalSelectList")
|
||||
HttpResult<List<PmsTerminal>> getTerminalSelectList();
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.device.pms.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.pms.api.PmsTerminalClient;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.device.pms.pojo.po.PmsTerminal;
|
||||
import com.njcn.device.pms.utils.PmsDeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yzh
|
||||
* @date 2022/10/28
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PmsTerminalClientFallbackFactory implements FallbackFactory<PmsTerminalClient> {
|
||||
@Override
|
||||
public PmsTerminalClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = PmsDeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new PmsTerminalClient() {
|
||||
@Override
|
||||
public HttpResult<List<PmsTerminal>> getTerminalSelectList() {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取主网所有终端", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.njcn.device.pms.pojo.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/12/6 11:12【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class GeneratrixAndPowerStationSonDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(name = "orgid", value = "部门id")
|
||||
private String orgid;
|
||||
|
||||
@ApiModelProperty(name = "orgName", value = "部门Name")
|
||||
private String orgName;
|
||||
|
||||
|
||||
/**
|
||||
* 母线id
|
||||
*/
|
||||
@ApiModelProperty(name = "busbarId", value = "母线id")
|
||||
private String busbarId;
|
||||
|
||||
/**
|
||||
* 母线名称
|
||||
*/
|
||||
@ApiModelProperty(name = "busbarName", value = "母线名称")
|
||||
private String busbarName;
|
||||
|
||||
/**
|
||||
* 母线电压等级
|
||||
*/
|
||||
@ApiModelProperty(name = "generatrixVoltageLevel", value = "母线电压等级")
|
||||
private String generatrixVoltageLevel;
|
||||
|
||||
/**
|
||||
* 变电站id
|
||||
*/
|
||||
@ApiModelProperty(name = "subId", value = "变电站id")
|
||||
private String subId;
|
||||
|
||||
/**
|
||||
* 变电站名称
|
||||
*/
|
||||
@ApiModelProperty(name = "subName", value = "变电站名称")
|
||||
private String subName;
|
||||
|
||||
/**
|
||||
* 变电站电压等级
|
||||
*/
|
||||
@ApiModelProperty(name = "voltageLevel", value = "变电站电压等级")
|
||||
private String voltageLevel;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.njcn.device.pms.pojo.param;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/12/5 11:15【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("母线查询条件")
|
||||
public class ConditionParam {
|
||||
|
||||
@ApiModelProperty(value = "部门id",required = true)
|
||||
@NotBlank(message = "部门id不可为空")
|
||||
private String deptId;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 变电站电压等级
|
||||
*/
|
||||
@ApiModelProperty(name = "powerStationVoltageLevel", value = "变电站电压等级")
|
||||
private String powerStationVoltageLevel;
|
||||
|
||||
/**
|
||||
* 变电站名称
|
||||
*/
|
||||
@ApiModelProperty(name = "powerStationId", value = "变电站id")
|
||||
private String powerStationId;
|
||||
|
||||
/**
|
||||
* 变电站名称
|
||||
*/
|
||||
@ApiModelProperty(name = "powerStationName", value = "变电站名称")
|
||||
private String powerStationName;
|
||||
|
||||
|
||||
}
|
||||
@@ -40,4 +40,10 @@ public class PmsMonitorParam {
|
||||
|
||||
@ApiModelProperty(name = "powerrName",value = "变电站名称")
|
||||
private String powerrName;
|
||||
|
||||
@ApiModelProperty(name = "monitorTag", value = "监测点标签")
|
||||
private String monitorTag;
|
||||
|
||||
@ApiModelProperty(name = "isSpecialMonitor", value = "是否专项分析监测点 0-否 1-是")
|
||||
private Integer isSpecialMonitor;
|
||||
}
|
||||
|
||||
@@ -182,6 +182,11 @@ public class Monitor extends BaseEntity {
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 是否专项分析监测点 0-否 1-是
|
||||
*/
|
||||
private Integer isSpecialMonitor;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user