稳态报告接口迁移(后续需要合并代码)
This commit is contained in:
@@ -9,6 +9,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.api.fallback.CsLineClientFallbackFactory;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
@@ -71,4 +72,7 @@ public interface CsLineFeignClient {
|
||||
@PostMapping("/list")
|
||||
HttpResult<List<CsLinePO>> list(@RequestBody CsLinePO param);
|
||||
|
||||
@PostMapping("/getLineDetailData")
|
||||
HttpResult<LineDetailDataVO> getLineDetailData(@RequestParam("id") String id);
|
||||
|
||||
}
|
||||
|
||||
@@ -6,10 +6,12 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -116,6 +118,12 @@ public class CsLineClientFallbackFactory implements FallbackFactory<CsLineFeignC
|
||||
log.error("{}异常,降级处理,异常为:{}","查询监测点列表异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<LineDetailDataVO> getLineDetailData(@RequestParam("id") String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}","查询监测点详情异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/2/23
|
||||
* 监测点信息
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class LineDetailDataVO {
|
||||
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty(name = "id",value = "监测点序号")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(name = "lineName",value = "监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty(name = "areaName",value = "工程名称")
|
||||
private String areaName;
|
||||
|
||||
@ApiModelProperty(name = "gdName",value = "单位")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty(name = "bdName",value = "部门")
|
||||
private String bdName;
|
||||
|
||||
@ApiModelProperty(name = "scale",value = "电压等级")
|
||||
private String scale;
|
||||
|
||||
@ApiModelProperty(name = "manufacturer",value = "厂家")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty(name = "devId",value = "终端Id")
|
||||
private String devId;
|
||||
|
||||
@ApiModelProperty(name = "devName",value = "终端名称")
|
||||
private String devName;
|
||||
|
||||
@ApiModelProperty(name = "ip",value = "网络参数")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty(name = "runFlag",value = "终端运行状态")
|
||||
private String runFlag;
|
||||
|
||||
@ApiModelProperty(name = "comFlag",value = "通讯状态")
|
||||
private String comFlag;
|
||||
|
||||
@ApiModelProperty(name = "loadType",value = "干扰源类型")
|
||||
private String loadType;
|
||||
|
||||
@ApiModelProperty(name = "businessType",value = "行业类型")
|
||||
private String businessType;
|
||||
|
||||
@ApiModelProperty(name = "objName",value = "监测点对象名称")
|
||||
private String objName;
|
||||
|
||||
@ApiModelProperty(name = "ptType",value = "接线方式")
|
||||
private String ptType;
|
||||
|
||||
@ApiModelProperty(name = "pt",value = "PT变比")
|
||||
private String pt;
|
||||
|
||||
@ApiModelProperty(name = "ct",value = "CT变比")
|
||||
private String ct;
|
||||
|
||||
@ApiModelProperty(name = "standardCapacity",value = "基准容量(MVA)")
|
||||
private Float standardCapacity;
|
||||
|
||||
@ApiModelProperty(name = "shortCapacity",value = "最小短路容量(MVA)")
|
||||
private Float shortCapacity;
|
||||
|
||||
@ApiModelProperty(name = "devCapacity",value = "供电设备容量(MVA)")
|
||||
private Float devCapacity;
|
||||
|
||||
@ApiModelProperty(name = "dealCapacity",value = "用户协议容量(MVA)")
|
||||
private Float dealCapacity;
|
||||
|
||||
@ApiModelProperty(name = "powerFlag",value = "电网标志(0-电网侧;1-非电网侧)")
|
||||
private Integer powerFlag;
|
||||
|
||||
/**
|
||||
* 测量间隔(1-10分钟)
|
||||
*/
|
||||
@ApiModelProperty(name = "timeInterval",value = "测量间隔(1-10分钟)")
|
||||
private Integer timeInterval;
|
||||
|
||||
/**
|
||||
* 监测点拥有者
|
||||
*/
|
||||
@ApiModelProperty(name = "owner",value = "监测点拥有者")
|
||||
private String owner;
|
||||
|
||||
/**
|
||||
* 拥有者职务
|
||||
*/
|
||||
@ApiModelProperty(name = "ownerDuty",value = "拥有者职务")
|
||||
private String ownerDuty;
|
||||
|
||||
/**
|
||||
* 拥有者联系方式
|
||||
*/
|
||||
@ApiModelProperty(name = "ownerTel",value = "拥有者联系方式")
|
||||
private String ownerTel;
|
||||
|
||||
/**
|
||||
* 接线图
|
||||
*/
|
||||
@ApiModelProperty(name = "wiringDiagram",value = "接线图")
|
||||
private String wiringDiagram;
|
||||
@ApiModelProperty(name = "ptPhaseType",value = "监测点接线相别(0,单相,1,三相,默认三相)")
|
||||
private Integer ptPhaseType;
|
||||
|
||||
@ApiModelProperty(name = "投运日期")
|
||||
private LocalDate loginTime;
|
||||
|
||||
@ApiModelProperty(name = "最新数据时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty(name = "监测对象信息ID")
|
||||
private String objId;
|
||||
|
||||
@ApiModelProperty(name = "对象类型大类")
|
||||
private String bigObjType;
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.mapper.OverlimitMapper;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.csdevice.pojo.vo.PqSensitiveUserLineVO;
|
||||
import com.njcn.csdevice.service.CsLinePOService;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
@@ -302,4 +303,14 @@ public class CslineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, url, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineDetailData")
|
||||
@ApiOperation("根据监测点id获取监测点详情")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<LineDetailDataVO> getLineDetailData(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineDetailData");
|
||||
LineDetailDataVO result = csLinePOService.getLineDetailData(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.csdevice.pojo.vo.PqSensitiveUserLineVO;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -11,7 +12,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/18 14:01【需求编号】
|
||||
*
|
||||
@@ -83,4 +84,11 @@ public interface CsLinePOService extends IService<CsLinePO>{
|
||||
Page<PqSensitiveUserLineVO> getSensitiveUserLineList(BaseParam param);
|
||||
boolean uploadReport(MultipartFile file, String lineId);
|
||||
String getReportUrl(String lineId);
|
||||
|
||||
/**
|
||||
* 获取监测点详情
|
||||
* @param id 监测点id
|
||||
* @return 结果
|
||||
*/
|
||||
LineDetailDataVO getLineDetailData(String id);
|
||||
}
|
||||
|
||||
@@ -14,9 +14,11 @@ import com.njcn.access.api.CsLineLatestDataFeignClient;
|
||||
import com.njcn.access.pojo.po.CsLineLatestData;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.csdevice.mapper.*;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.*;
|
||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.csdevice.pojo.vo.PqSensitiveUserLineVO;
|
||||
import com.njcn.csdevice.service.CsDevModelService;
|
||||
import com.njcn.csdevice.service.CsLinePOService;
|
||||
@@ -32,22 +34,21 @@ import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.constant.UserType;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import com.njcn.web.pojo.vo.LineDataVO;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/18 14:01【需求编号】
|
||||
*
|
||||
@@ -386,6 +387,40 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LineDetailDataVO getLineDetailData(String id) {
|
||||
if (StringUtils.isEmpty(id)) {
|
||||
return new LineDetailDataVO();
|
||||
} else {
|
||||
CsLinePO csLinePO = this.baseMapper.selectOne(new LambdaQueryWrapper<CsLinePO>().eq(CsLinePO::getLineId,id));
|
||||
LineDetailDataVO lineDetailDataVO = new LineDetailDataVO();
|
||||
|
||||
//lineDetailDataVO.setScale(dicDataFeignClient.getDicDataById(voltageMapper.selectById(voId).getScale()).getData().getName());
|
||||
//Device device = deviceMapper.selectById(devId);
|
||||
//lineDetailDataVO.setComFlag(PubUtils.comFlag(device.getComFlag()));
|
||||
//lineDetailDataVO.setRunFlag(PubUtils.lineRunFlag(lineDetail.getRunFlag()));
|
||||
//lineDetailDataVO.setIp(device.getIp());
|
||||
//lineDetailDataVO.setLoginTime(device.getLoginTime());
|
||||
//lineDetailDataVO.setDevId(device.getId());
|
||||
//lineDetailDataVO.setBusinessType(dicDataFeignClient.getDicDataById(lineDetail.getBusinessType()).getData().getName());
|
||||
//lineDetailDataVO.setLoadType(dicDataFeignClient.getDicDataById(lineDetail.getLoadType()).getData().getName());
|
||||
lineDetailDataVO.setObjName(csLinePO.getMonitorUser());
|
||||
lineDetailDataVO.setLineId(csLinePO.getLineId());
|
||||
lineDetailDataVO.setPtType(PubUtils.ptType(csLinePO.getConType()));
|
||||
//lineDetailDataVO.setPt(lineDetail.getPt1() + "/" + lineDetail.getPt2());
|
||||
//lineDetailDataVO.setCt(lineDetail.getCt1() + "/" + lineDetail.getCt2());
|
||||
lineDetailDataVO.setDealCapacity(csLinePO.getProtocolCapacity().floatValue());
|
||||
lineDetailDataVO.setDevCapacity(csLinePO.getDevCapacity().floatValue());
|
||||
lineDetailDataVO.setShortCapacity(csLinePO.getShortCircuitCapacity().floatValue());
|
||||
lineDetailDataVO.setStandardCapacity(csLinePO.getBasicCapacity().floatValue());
|
||||
lineDetailDataVO.setTimeInterval(csLinePO.getLineInterval());
|
||||
|
||||
return lineDetailDataVO;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private String getRunStatusDescription(Integer runStatus) {
|
||||
// 0:运行;1:检修;2:停运;3:调试;4:退运
|
||||
switch (runStatus) {
|
||||
|
||||
Reference in New Issue
Block a user