终端模块新增对外接口

This commit is contained in:
2022-08-12 16:00:41 +08:00
parent a178d230e9
commit 7e631b088d
16 changed files with 171 additions and 25 deletions

View File

@@ -25,5 +25,5 @@ public interface DeptLineFeignClient {
HttpResult<Boolean> selectDeptBindLines(@RequestParam("ids") List<String> ids);
@PostMapping("removeBind")
Integer removeBind(@RequestParam("id") String id);
HttpResult<Integer> removeBind(@RequestParam("id") String id);
}

View File

@@ -4,6 +4,7 @@ import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.api.fallback.LineFeignClientFallbackFactory;
import com.njcn.device.pojo.dto.*;
import com.njcn.device.pojo.param.LineBaseQueryParam;
import com.njcn.device.pojo.po.Line;
import com.njcn.device.pojo.po.LineDetail;
import com.njcn.device.pojo.po.Overlimit;
@@ -178,15 +179,23 @@ public interface LineFeignClient {
/**
* 区域监测点以及上级一些信息
* @param list 监测点id集合
* @return
* @return AreaLineInfoVO
*/
@PostMapping("getBaseLineAreaInfo")
HttpResult<List<AreaLineInfoVO>> getBaseLineAreaInfo(@RequestBody List<String> list);
/**
* 获取丰富的监测点信息(扩展模糊查询)
* @param lineBaseQueryParam 监测点参数
* @return AreaLineInfoVO
*/
@PostMapping("getRichLineInfo")
HttpResult<List<AreaLineInfoVO>> getRichLineInfo(@RequestBody LineBaseQueryParam lineBaseQueryParam);
/**
* 获取监测点基本信息
* @param list 监测点id集合
* @return
* @return Line
*/
@PostMapping("getBaseLineList")
HttpResult<List<Line>> getBaseLineList(@RequestBody List<String> list);
@@ -220,4 +229,14 @@ public interface LineFeignClient {
@PostMapping("getOnLineCount")
HttpResult<Integer> getOnLineCount(@RequestBody List<String> lineIds);
/**
* 获取当前状态在线和离线的监测点
* @param lineBaseQueryParam 监测点查询参数
* @return 在线的监测点id集
* @author cdf
* @date 2022/8/1
*/
@PostMapping("getOnOrUnLine")
HttpResult<List<String>> getOnOrUnLine(@RequestBody LineBaseQueryParam lineBaseQueryParam);
}

View File

@@ -45,7 +45,7 @@ public class DeptLineFeignClientFallbackFactory implements FallbackFactory<DeptL
}
@Override
public Integer removeBind(String id) {
public HttpResult<Integer> removeBind(String id) {
log.error("{}异常,降级处理,异常为:{}", "部门解除绑定", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}

View File

@@ -5,6 +5,7 @@ import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.api.LineFeignClient;
import com.njcn.device.pojo.dto.*;
import com.njcn.device.pojo.param.LineBaseQueryParam;
import com.njcn.device.pojo.po.Line;
import com.njcn.device.pojo.po.LineDetail;
import com.njcn.device.pojo.po.Overlimit;
@@ -139,7 +140,13 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
@Override
public HttpResult<List<AreaLineInfoVO>> getBaseLineAreaInfo(List<String> list) {
log.error("{}异常,降级处理,异常为:{}", "获取监测点详情 ", throwable.toString());
log.error("{}异常,降级处理,异常为:{}", "获取监测点详情异常 ", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<AreaLineInfoVO>> getRichLineInfo(LineBaseQueryParam lineBaseQueryParam) {
log.error("{}异常,降级处理,异常为:{}", "获取监测点详情异常 ", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
@@ -163,7 +170,13 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
@Override
public HttpResult<Integer> getOnLineCount(List<String> lineIds) {
log.error("{}异常,降级处理,异常为:{}", "取在线监测点数量异常: ", throwable.toString());
log.error("{}异常,降级处理,异常为:{}", "取在线监测点数量异常: ", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<String>> getOnOrUnLine( LineBaseQueryParam lineBaseQueryParam) {
log.error("{}异常,降级处理,异常为:{}", "获取当前状态在线和离线的监测点异常: ", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}

View File

@@ -74,8 +74,8 @@ public enum DeviceResponseEnum {
FLOW_FLAG("A0351","默认类型已存在"),
FLOW_ERROR("A0352","占比参数异常"),
IMPORT_ORACLE_EXCEPTION("A0353","导入旧库台账异常")
IMPORT_ORACLE_EXCEPTION("A0353","导入旧库台账异常"),
PARAM_VAL_ERR("A0354","参数校验异常")

View File

@@ -30,11 +30,11 @@ public class DeviceInfoParam implements Serializable {
/**
* 统计类型
*/
@ApiModelProperty(name = "statisticalType", value = "统计类型")
@ApiModelProperty(name = "statisticalType", value = "统计类型",required = true)
@NotNull(message = "统计类型不可为空")
private SimpleDTO statisticalType;
@ApiModelProperty(name = "deptIndex", value = "部门索引")
@ApiModelProperty(name = "deptIndex", value = "部门索引",required = true)
@NotBlank(message = "部门索引不可为空")
private String deptIndex;
@@ -69,7 +69,7 @@ public class DeviceInfoParam implements Serializable {
*/
@ApiModelProperty("网公司标识")
@Range(min = 0, max = 2, message = "网公司标识" + ValidMessage.PARAM_FORMAT_ERROR)
private int monitorFlag;
private Integer monitorFlag;
/**
* 0-电网侧
@@ -77,7 +77,7 @@ public class DeviceInfoParam implements Serializable {
*/
@ApiModelProperty("电网侧标识")
@Range(min = 0, max = 2, message = "电网侧标识" + ValidMessage.PARAM_FORMAT_ERROR)
private int powerFlag;
private Integer powerFlag;

View File

@@ -0,0 +1,29 @@
package com.njcn.device.pojo.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* pqs
*
* @author cdf
* @date 2022/8/9
*/
@Data
public class LineBaseQueryParam {
@NotEmpty(message = "监测点索引集合不可为空")
@ApiModelProperty(name = "lineIds",value = "监测点索引集合")
private List<String> lineIds;
@ApiModelProperty(name = "comFlag",value = "通讯状态 0.离线 1.在线")
private Integer comFlag;
@ApiModelProperty(name = "searchValue",value = "关键字搜索值")
private String searchValue;
}

View File

@@ -56,6 +56,9 @@ public class AreaLineInfoVO implements Serializable {
@ApiModelProperty(name = "pt2",value = "pt2")
private Integer pt2;
@ApiModelProperty(name = "objName",value = "对象名称")
private String objName;
@ApiModelProperty(name = "runFlag",value = "运行状态")
private Integer runFlag;
@@ -73,4 +76,7 @@ public class AreaLineInfoVO implements Serializable {
@ApiModelProperty(name = "manufacturer",value = "供应商名称")
private String manufacturer;
@ApiModelProperty(name = "loadType",value = "干扰源类型")
private String loadType;
}