1.解决device模块Swagger无法显示bug
2.修改监测点评价,数据异常,指标数据质量算法兼容修改
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
package com.njcn.device.biz.commApi;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.commApi.fallback.CommTerminalGeneralClientFallbackFactory;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
@@ -12,11 +16,17 @@ import org.springframework.cloud.openfeign.FeignClient;
|
||||
*/
|
||||
@FeignClient(
|
||||
value = ServerInfo.DEVICE,
|
||||
path = "CommLineClient",
|
||||
contextId = "CommLineClient",
|
||||
path = "commLine",
|
||||
contextId = "commLine",
|
||||
fallbackFactory = CommTerminalGeneralClientFallbackFactory.class)
|
||||
public interface CommLineClient {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 获取监测点信息
|
||||
* @param id
|
||||
* @Author: wr
|
||||
* @Date: 2023/9/22 11:11
|
||||
*/
|
||||
@GetMapping("/getLineDetail")
|
||||
HttpResult<LineDTO> getLineDetail(@RequestParam("id") String id);
|
||||
}
|
||||
|
||||
@@ -142,7 +142,6 @@ public interface CommTerminalGeneralClient {
|
||||
HttpResult<List<LineDevGetDTO>> getMonitorDetailList(@RequestBody List<String> list);
|
||||
|
||||
|
||||
|
||||
@GetMapping("/lineUnitDetail")
|
||||
HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId);
|
||||
|
||||
|
||||
@@ -3,10 +3,9 @@ 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.pojo.dto.LineDTO;
|
||||
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;
|
||||
@@ -30,8 +29,11 @@ public class CommLineClientFallbackFactory implements FallbackFactory<CommLineCl
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
|
||||
return new CommLineClient() {
|
||||
|
||||
|
||||
@Override
|
||||
public HttpResult<LineDTO> getLineDetail(String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.njcn.device.biz.pojo.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2023/9/22 10:09
|
||||
*/
|
||||
@Data
|
||||
public class LineDTO {
|
||||
|
||||
@ApiModelProperty(name = "lineId",value = "监测点id")
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty(name = "devId",value = "终端id")
|
||||
private String devId;
|
||||
|
||||
@ApiModelProperty(name = "timeInterval",value = "测量间隔(1-10分钟)")
|
||||
private Integer timeInterval;
|
||||
|
||||
@ApiModelProperty(name = "voltageLevel",value = "电压等级")
|
||||
private String voltageLevel;
|
||||
|
||||
@ApiModelProperty(name = "ptType",value = "接线方式")
|
||||
private String ptType;
|
||||
|
||||
@ApiModelProperty(name = "runFlag",value = "终端运行状态")
|
||||
private String runFlag;
|
||||
|
||||
@ApiModelProperty(name = "ptPhaseType",value = "监测点接线相别(0,单相,1,三相,默认三相)")
|
||||
private String ptPhaseType;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.device.pms.controller.ledgerManger;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
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.biz.commApi.fallback.CommTerminalGeneralClientFallbackFactory;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/9/14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/commLine")
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@Api(tags = "通用台账查询")
|
||||
public class CommLineController extends BaseController {
|
||||
|
||||
private final IMonitorService monitorService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getLineDetail")
|
||||
@ApiOperation("获取监测点id取监测点信息")
|
||||
public HttpResult<LineDTO> getLineDetail(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineDetail");
|
||||
LineDTO result = monitorService.getLineDetail(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -300,7 +300,7 @@ public class CommTerminalController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/lineUnitDetail")
|
||||
@ApiOperation("根据监测点id获取数据单位")
|
||||
@ApiImplicitParam(name = "lineID", value = "实体", required = true)
|
||||
@ApiImplicitParam(name = "lineId", value = "实体", required = true)
|
||||
public HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId) {
|
||||
String methodDescribe = getMethodDescribe("lineUnitDetail");
|
||||
PqsDeviceUnit pqsDeviceUnit = new PqsDeviceUnit();
|
||||
@@ -316,7 +316,7 @@ public class CommTerminalController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getMonitorDetail")
|
||||
@ApiOperation("根据监测点id获取数据单位")
|
||||
@ApiImplicitParam(name = "lineID", value = "实体", required = true)
|
||||
@ApiImplicitParam(name = "lineId", value = "实体", required = true)
|
||||
public HttpResult<LineDevGetDTO> getMonitorDetail(@RequestParam("lineId") String lineId) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorDetail");
|
||||
Monitor monitor = monitorService.getById(lineId);
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pms.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
@@ -76,10 +77,12 @@ public interface MonitorMapper extends BaseMapper<Monitor> {
|
||||
*/
|
||||
MonitorVO getPwMonitorTerminal(@Param("id")String id);
|
||||
|
||||
|
||||
/**
|
||||
* 获取主网监测点装置信息
|
||||
* @author cdf
|
||||
* @date 2023/7/10
|
||||
* @Description: 根据监测点id获取监测点信息
|
||||
* @param id
|
||||
* @return: com.njcn.device.biz.pojo.dto.LineDTO
|
||||
* @Author: wr
|
||||
* @Date: 2023/9/22 10:20
|
||||
*/
|
||||
LineDTO selectLineDetail(@Param("id")String id);
|
||||
}
|
||||
|
||||
@@ -162,5 +162,19 @@
|
||||
INNER JOIN pms_terminal pt ON pt.Id = pm.Terminal_Id
|
||||
where pm.Monitor_Id = #{id}
|
||||
</select>
|
||||
<select id="selectLineDetail" resultType="com.njcn.device.biz.pojo.dto.LineDTO">
|
||||
SELECT
|
||||
pm.Id as lineId,
|
||||
pm.Terminal_Id as devId,
|
||||
pm.Statistical_Interval as timeInterval,
|
||||
pm.Voltage_Level as voltageLevel,
|
||||
pm.Monitor_State as runFlag,
|
||||
pm.Terminal_Wiring_Method as ptType,
|
||||
pm.PT_Phase_Type as ptPhaseType
|
||||
FROM
|
||||
pms_monitor pm
|
||||
WHERE
|
||||
pm.id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
|
||||
@@ -172,4 +173,11 @@ public interface IMonitorService extends IService<Monitor> {
|
||||
* @Date: 2023/9/21 13:19
|
||||
*/
|
||||
Map<String, List<String>> getLineBySubstationRelation(Integer devDataType);
|
||||
|
||||
/**
|
||||
* 根据监测点id获取监测点信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LineDTO getLineDetail(String id);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.po.DeviceBak;
|
||||
import com.njcn.device.biz.utils.COverlimit;
|
||||
@@ -436,6 +437,21 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LineDTO getLineDetail(String id) {
|
||||
List<DictData> voltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
Map<String, String> voltageMap = voltage.stream().collect(Collectors.toMap(DictData::getId, DictData::getValue));
|
||||
List<DictData> connect = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
|
||||
Map<String, String> connectMap = connect.stream().collect(Collectors.toMap(DictData::getId, DictData::getValue));
|
||||
LineDTO lineDTO = this.baseMapper.selectLineDetail(id);
|
||||
if(voltageMap.containsKey(lineDTO.getVoltageLevel())&&connectMap.containsKey(lineDTO.getPtType())){
|
||||
lineDTO.setVoltageLevel(voltageMap.get(lineDTO.getVoltageLevel()));
|
||||
lineDTO.setPtType(connectMap.get(lineDTO.getPtType()));
|
||||
return lineDTO;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取主配网监测点id集合
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
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.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/9/14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/commLine")
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@Api(tags = "通用台账查询")
|
||||
public class CommLineController extends BaseController {
|
||||
|
||||
private final LineService lineService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getLineDetail")
|
||||
@ApiOperation("获取监测点id取监测点信息")
|
||||
public HttpResult<LineDTO> getLineDetail(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineDetail");
|
||||
LineDTO result = lineService.getLineDetail(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.advanced.UpDevVO;
|
||||
@@ -513,4 +514,13 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
* @Date: 2023/8/29 12:50
|
||||
*/
|
||||
Page<HalfReportVO> selectHalfReport(Page page,@Param("param") TerminalMainQueryParam param);
|
||||
|
||||
/**
|
||||
* @Description: 根据监测点id获取监测点信息
|
||||
* @param id
|
||||
* @return: com.njcn.device.biz.pojo.dto.LineDTO
|
||||
* @Author: wr
|
||||
* @Date: 2023/9/22 10:20
|
||||
*/
|
||||
LineDTO selectLineDetail(@Param("id") String id);
|
||||
}
|
||||
|
||||
@@ -1340,5 +1340,29 @@
|
||||
devName,
|
||||
lineName
|
||||
</select>
|
||||
<select id="selectLineDetail" resultType="com.njcn.device.biz.pojo.dto.LineDTO">
|
||||
SELECT
|
||||
line.id AS lineId,
|
||||
dev.id AS devId,
|
||||
detail.Time_Interval AS timeInterval,
|
||||
vg.Scale AS voltageLevel,
|
||||
pqd.Run_Flag as runFlag,
|
||||
detail.PT_Type AS ptType,
|
||||
detail.PT_Phase_Type AS ptPhaseType
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line_detail detail,
|
||||
pq_line vo,
|
||||
pq_voltage vg,
|
||||
pq_line dev,
|
||||
pq_device pqd
|
||||
WHERE
|
||||
line.id = detail.id
|
||||
AND vo.id = line.pid
|
||||
AND dev.id = vo.pid
|
||||
AND vo.id = vg.id
|
||||
AND pqd.id = dev.id
|
||||
AND line.id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionParamDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
@@ -181,4 +182,13 @@ public interface LineService {
|
||||
List<TopMsgPO> dailyDeviceAbnormal(DeviceInfoParam.BusinessParam conditionBusinessParam);
|
||||
|
||||
Page<HalfReportVO> halfReport(TerminalMainQueryParam param);
|
||||
|
||||
/**
|
||||
* @Description: 根据监测点获取监测点信息
|
||||
* @param id
|
||||
* @return: com.njcn.device.biz.pojo.dto.LineDTO
|
||||
* @Author: wr
|
||||
* @Date: 2023/9/22 10:46
|
||||
*/
|
||||
LineDTO getLineDetail(String id);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
@@ -35,6 +36,8 @@ import com.njcn.influx.pojo.po.PqsCommunicate;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import com.njcn.system.api.AreaFeignClient;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.web.pojo.vo.LineDataVO;
|
||||
import com.njcn.web.utils.GeneralUtil;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
@@ -469,6 +472,18 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
return this.baseMapper.selectHalfReport(page,param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LineDTO getLineDetail(String id) {
|
||||
List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
||||
Map<String, String> dicMap = data.stream().collect(Collectors.toMap(DictData::getId, DictData::getValue));
|
||||
LineDTO lineDTO = this.baseMapper.selectLineDetail(id);
|
||||
if(dicMap.containsKey(lineDTO.getVoltageLevel())){
|
||||
lineDTO.setVoltageLevel(dicMap.get(lineDTO.getVoltageLevel()));
|
||||
return lineDTO;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Overlimit> getOverLimitByList(PollutionParamDTO pollutionParamDTO) {
|
||||
return overlimitMapper.selectBatchIds(pollutionParamDTO.getLineList());
|
||||
|
||||
Reference in New Issue
Block a user