高低电压穿越功能优化
This commit is contained in:
@@ -114,7 +114,7 @@ public class DeptLineController extends BaseController {
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getLineByDeptIdAndNewStation")
|
||||
@ApiOperation("根据部门id获取绑定的监测点且再根据NewStation进行过滤")
|
||||
@ApiOperation("根据部门id获取绑定的监测点且再根据(监测点详情进行过滤)")
|
||||
public HttpResult<List<String>> getLineByDeptIdAndNewStation(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineByDeptIdAndNewStation");
|
||||
List<String> list = deptLineService.getLineByDeptIdAndNewStation(id);
|
||||
|
||||
@@ -83,5 +83,5 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
|
||||
|
||||
List<SubGetBase> selectSubStationList(@Param("param") SubstationParam substationParam);
|
||||
|
||||
List<String> getLineByDeptIdAndNewStation(@Param("id") String id);
|
||||
List<String> getLineByDeptIdAndNewStation(@Param("id") String id,@Param("dictTree")List<String> dictTree);
|
||||
}
|
||||
|
||||
@@ -196,9 +196,21 @@
|
||||
</select>
|
||||
|
||||
<select id="getLineByDeptIdAndNewStation" resultType="string">
|
||||
select pdl.Line_Id from pq_dept_line pdl
|
||||
inner join pq_line_detail pld on pdl.Line_Id = pld.Id
|
||||
where pdl.Id = #{id}
|
||||
and exists (select 1 from pq_new_station pns where pns.id = pld.New_Station_Id and pns.state = 1)
|
||||
SELECT
|
||||
pld.id
|
||||
FROM
|
||||
pq_dept_line pdl
|
||||
INNER JOIN pq_line_detail pld ON pdl.Line_Id = pld.Id
|
||||
WHERE
|
||||
<if test="id !=null and id !='' ">
|
||||
pdl.Id = #{id}
|
||||
</if>
|
||||
<if test="dictTree!=null and dictTree.size!=0">
|
||||
and pld.Big_Obj_Type in
|
||||
<foreach collection="dictTree" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
and pld.Obj_Id IS NOT NULL and pld.Obj_Id !=''
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -43,7 +43,9 @@
|
||||
a.name lineName,
|
||||
c.Time_Interval,
|
||||
e.name scale,
|
||||
c.New_Station_Id newStationId
|
||||
c.Obj_Id obyId,
|
||||
c.Big_Obj_Type bigObjType,
|
||||
d.Scale AS scale
|
||||
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
|
||||
|
||||
@@ -1435,7 +1435,7 @@
|
||||
pqd.Run_Flag as runFlag,
|
||||
detail.PT_Type AS ptType,
|
||||
detail.PT_Phase_Type AS ptPhaseType,
|
||||
detail.New_Station_Id AS newStationId
|
||||
detail.Obj_Id AS objId
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line_detail detail,
|
||||
@@ -1460,7 +1460,8 @@
|
||||
vg.Scale AS voltageLevel,
|
||||
pqd.Run_Flag as runFlag,
|
||||
detail.PT_Type AS ptType,
|
||||
detail.PT_Phase_Type AS ptPhaseType
|
||||
detail.PT_Phase_Type AS ptPhaseType,
|
||||
detail.Obj_Id AS objId
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line_detail detail,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -13,6 +15,9 @@ import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
import com.njcn.device.pq.constant.Param;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import com.njcn.system.enums.DicTreeEnum;
|
||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.pojo.param.DeptLineParam;
|
||||
@@ -22,6 +27,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -37,9 +43,10 @@ import java.util.stream.Collectors;
|
||||
public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> implements DeptLineService {
|
||||
|
||||
private final DeptLineMapper deptLineMapper;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final LineMapper lineMapper;
|
||||
private final DictTreeFeignClient dictTreeFeignClient;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -91,7 +98,19 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
|
||||
@Override
|
||||
public List<String> getLineByDeptIdAndNewStation(String id) {
|
||||
return this.baseMapper.getLineByDeptIdAndNewStation(id);
|
||||
List<String> dictTree = new ArrayList<>();
|
||||
DictTreeVO powerStation = dictTreeFeignClient.queryByCode(DicTreeEnum.Power_Station.getCode()).getData();
|
||||
if(ObjectUtil.isNotNull(powerStation)){
|
||||
dictTree.add(powerStation.getId());
|
||||
}
|
||||
DictTreeVO windFarms = dictTreeFeignClient.queryByCode(DicTreeEnum.Wind_Farms.getCode()).getData();
|
||||
if(ObjectUtil.isNotNull(windFarms)){
|
||||
dictTree.add(windFarms.getId());
|
||||
}
|
||||
if(CollUtil.isNotEmpty(dictTree)){
|
||||
return this.baseMapper.getLineByDeptIdAndNewStation(id,dictTree);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -894,8 +894,16 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
|
||||
@Override
|
||||
public List<LineDetailDataVO> getLineDetailList(List<String> lineIds){
|
||||
List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
||||
Map<String, String> dicMap = data.stream().collect(Collectors.toMap(DictData::getId, DictData::getValue));
|
||||
List<LineDetailDataVO> lineDetailInfo = lineDetailMapper.getLineDetailInfo(lineIds);
|
||||
lineDetailInfo.forEach(item->{
|
||||
if(dicMap.containsKey(item.getScale())){
|
||||
item.setScale(dicMap.get(item.getScale()));
|
||||
}
|
||||
});
|
||||
return lineDetailInfo;
|
||||
|
||||
return lineDetailMapper.getLineDetailInfo(lineIds);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user