新能源专项分析功能优化

This commit is contained in:
wr
2025-04-01 20:38:43 +08:00
parent cd8c31ccd6
commit ede8c5c7af
9 changed files with 103 additions and 108 deletions

View File

@@ -21,7 +21,7 @@ public interface DeptLineFeignClient {
HttpResult<List<String>> getLineByDeptId(@RequestParam("id")String id);
@PostMapping("/getLineByDeptIdAndNewStation")
HttpResult<List<String>> getLineByDeptIdAndNewStation(@RequestParam("id")String id);
HttpResult<List<String>> getLineByDeptIdAndNewStation(@RequestParam(value = "id",required = false)String id);
@PostMapping("/selectDeptBindLines")
HttpResult<Boolean> selectDeptBindLines(@RequestParam("ids") List<String> ids);

View File

@@ -115,7 +115,7 @@ public class DeptLineController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("/getLineByDeptIdAndNewStation")
@ApiOperation("根据部门id获取绑定的监测点且再根据监测点详情进行过滤")
public HttpResult<List<String>> getLineByDeptIdAndNewStation(@RequestParam("id") String id) {
public HttpResult<List<String>> getLineByDeptIdAndNewStation(@RequestParam(value = "id",required = false) String id) {
String methodDescribe = getMethodDescribe("getLineByDeptIdAndNewStation");
List<String> list = deptLineService.getLineByDeptIdAndNewStation(id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);

View File

@@ -43,6 +43,8 @@ public interface LineDetailMapper extends BaseMapper<LineDetail> {
* @return 结果
*/
List<LineDetailDataVO> getLineDetailInfo(@Param("lineIds") List<String> lineIds);
@Select ("select count(1) from pq_line a where a.Level=4 and SUBSTRING_INDEX(SUBSTRING_INDEX(a.Pids, ',', 4),',',-1)=#{subIndex}")
Integer getDeviceCountBySubstation(@Param("subIndex")String subIndex);

View File

@@ -204,9 +204,10 @@
FROM
pq_dept_line pdl
INNER JOIN pq_line_detail pld ON pdl.Line_Id = pld.Id
WHERE
<where>
pld.Obj_Id IS NOT NULL and pld.Obj_Id !=''
<if test="id !=null and id !='' ">
pdl.Id = #{id}
and pdl.Id = #{id}
</if>
<if test="dictTree!=null and dictTree.size!=0">
and pld.Big_Obj_Type in
@@ -214,6 +215,6 @@
#{item}
</foreach>
</if>
and pld.Obj_Id IS NOT NULL and pld.Obj_Id !=''
</where>
</select>
</mapper>

View File

@@ -42,10 +42,9 @@
c.id lineId,
a.name lineName,
c.Time_Interval,
e.name scale,
d.Scale AS scale,
c.Obj_Id obyId,
c.Big_Obj_Type bigObjType,
d.Scale AS scale
c.Big_Obj_Type bigObjType
from pq_line a
inner join pq_line b on a.pid = b.id
inner join pq_line_detail c on a.id = c.id

View File

@@ -1466,7 +1466,8 @@
pqd.Run_Flag as runFlag,
detail.PT_Type AS ptType,
detail.PT_Phase_Type AS ptPhaseType,
detail.Obj_Id AS objId
detail.Obj_Id AS objId,
detail.Big_Obj_Type AS bigObjType
FROM
pq_line line,
pq_line_detail detail,

View File

@@ -903,7 +903,6 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
}
});
return lineDetailInfo;
}
/**

View File

@@ -54,7 +54,6 @@ public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThro
private final EventDetailFeignClient eventDetailFeignClient;
private final TransientFeignClient transientFeignClient;
private final DeptLineFeignClient deptLineFeignClient;
private final UserLedgerFeignClient userLedgerFeignClient;
private final LineFeignClient lineFeignClient;
private final DictTreeFeignClient dictTreeFeignClient;
private final DicDataFeignClient dicDataFeignClient;
@@ -72,15 +71,14 @@ public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThro
List<String> lineIds = deptLineFeignClient.getLineByDeptIdAndNewStation(null).getData();
if (CollUtil.isNotEmpty(lineIds)) {
List<LineDetailDataVO> lineDetailDataVOS = lineFeignClient.getLineDetailList(lineIds).getData();
if (CollUtil.isNotEmpty(lineDetailDataVOS)) {
Map<String, LineDetailDataVO> lineDetailDataMap = lineDetailDataVOS.stream().collect(Collectors.toMap(LineDetailDataVO::getLineId, Function.identity()));
List<String> objIds = lineDetailDataVOS.stream().map(LineDetailDataVO::getObyId).distinct().collect(Collectors.toList());
List<NewUserReportVO> userReportVOS = userLedgerFeignClient.getUserReportByIds(objIds).getData();
Map<String, Double> userReportMap = userReportVOS.stream().collect(Collectors.toMap(NewUserReportVO::getId, NewUserReportVO::getRatePower));
EventCountParam param = new EventCountParam();
param.setIds(lineIds);
param.setStartTime(getLastTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
param.setIds(new ArrayList<>(lineDetailDataMap.keySet()));
LocalDateTime lastTime = getLastTime();
if (ObjectUtil.isNotNull(getLastTime())) {
param.setStartTime(lastTime.format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
}
param.setEndTime(currentTime.format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
List<RmpEventDetailPO> evenStDetailPOS = eventDetailFeignClient.getNewEventDetailByTime(param).getData();
MonitorTerminalParam monitorTerminalParam = new MonitorTerminalParam();
@@ -167,6 +165,7 @@ public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThro
}
}
}
}
private boolean isThrough(int start, int end, int ms, float voltageLevel, List<List<Float>> newListRmsData) {
boolean isThrough = false;
@@ -233,7 +232,7 @@ public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThro
List<Integer> indexs = new ArrayList<>();
//根据channelNames取出电压对应listRmsData数据中的数据索引
for (int i = 0; i < waveDataDTO.getChannelNames().size(); i++) {
if (waveDataDTO.getChannelNames().get(i).indexOf("电压") != -1) {
if (waveDataDTO.getChannelNames().get(i).indexOf("U") != -1) {
indexs.add(i);
}
}

View File

@@ -16,12 +16,6 @@ public class NewUserReportVO {
@ApiModelProperty(value = "id")
private String id;
/**
* 监测点id
*/
@ApiModelProperty(value = "lineId")
private String lineId;
/**
* 工程名称
*/