1.公共方法新增变电站信息查询
2.调整技术监督变电站查询方法
This commit is contained in:
@@ -9,6 +9,7 @@ import com.njcn.device.biz.commApi.fallback.CommTerminalGeneralClientFallbackFac
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.MonitorGetParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -193,6 +194,16 @@ public interface CommTerminalGeneralClient {
|
||||
|
||||
@PostMapping("/tagOrIdGetMonitorList")
|
||||
HttpResult<List<CommMonitorInfoDTO>> tagOrIdGetMonitorList(@RequestBody MonitorGetParam monitorGetParam);
|
||||
|
||||
|
||||
/**
|
||||
* 获取变电站信息
|
||||
* @param substationParam
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/tagOrIdGetSub")
|
||||
HttpResult<List<SubGetBase>> tagOrIdGetSub(@RequestBody SubstationParam substationParam);
|
||||
|
||||
/**
|
||||
* 用于返回pq 还是pms系统
|
||||
*
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.MonitorGetParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
@@ -162,6 +163,12 @@ public class CommTerminalGeneralClientFallbackFactory implements FallbackFactory
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<SubGetBase>> tagOrIdGetSub(SubstationParam substationParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据获取变电站信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> isPqOrPms() {
|
||||
log.error("{}异常,降级处理,异常为:{}", "返回pq还是pms系统", throwable.toString());
|
||||
|
||||
@@ -30,6 +30,16 @@ public class SubGetBase implements Serializable {
|
||||
*/
|
||||
private String voltageLevel;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private String orgId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 所有子级监测点信息
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.njcn.device.biz.pojo.dto.StatisticsMonitor;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.MonitorGetParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
@@ -407,6 +408,16 @@ public class CommTerminalController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, busBarAndHisMonitorDTOList, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/tagOrIdGetSub")
|
||||
@ApiOperation("获取变电站信息")
|
||||
public HttpResult<List<SubGetBase>> tagOrIdGetSub(@RequestBody SubstationParam substationParam) {
|
||||
String methodDescribe = getMethodDescribe("tagOrIdGetSub");
|
||||
List<SubGetBase> subGetBases = commTerminalService.tagOrIdGetSub(substationParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, subGetBases, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于返回pq 还是pms系统
|
||||
* @author cdf
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.njcn.device.pms.mapper.majornetwork;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pms.pojo.dto.PmsStatationStatInfoDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsStatationStatInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.TerminalQueryParam;
|
||||
@@ -41,4 +45,5 @@ public interface StatationStatMapper extends BaseMapper<StatationStat> {
|
||||
Page<StatationStatVO> getStatationStatPageList(Page<StatationStatVO> page, @Param("baseParam") TerminalQueryParam baseParam, @Param("orgIds")List<String> orgIds);
|
||||
|
||||
|
||||
List<SubGetBase> selectStatationStatList(@Param("param") SubstationParam param);
|
||||
}
|
||||
|
||||
@@ -68,5 +68,39 @@
|
||||
|
||||
order by a.org_name,a.Power_Name asc
|
||||
</select>
|
||||
<select id="selectStatationStatList" resultType="com.njcn.device.biz.pojo.dto.SubGetBase">
|
||||
SELECT
|
||||
Power_Id AS id,
|
||||
Power_Name AS name,
|
||||
Org_Id AS orgId,
|
||||
Org_Name AS orgName,
|
||||
Voltage_Level AS voltageLevel
|
||||
FROM
|
||||
pms_statation_stat
|
||||
<where>
|
||||
<if test="param.orgIds!=null and param.orgIds.size!=0">
|
||||
and pms_statation_stat.Org_Id in
|
||||
<foreach collection="param.orgIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.powerIds!=null and param.powerIds.size!=0">
|
||||
and pms_statation_stat.Power_Id in
|
||||
<foreach collection="param.powerIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.powerName !=null and param.powerName!='' ">
|
||||
and pms_statation_stat.Power_Name like CONCAT(CONCAT('%', #{param.powerName}), '%')
|
||||
</if>
|
||||
<if test="param.powerVoltageLevel!=null and param.powerVoltageLevel.size!=0">
|
||||
and pms_statation_stat.Voltage_Level in
|
||||
<foreach collection="param.powerVoltageLevel" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -598,39 +598,66 @@ public class MonitorSendServiceImpl implements MonitorSendService {
|
||||
public void exportSend(HttpServletResponse response) throws IOException {
|
||||
ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), WindSourceDto.class).build();
|
||||
|
||||
List<WindSourceDto> wind = this.windSend(getMonitors(dictTreeFeignClient.queryByCode("1401").getData().getId()));
|
||||
List<WindSourceDto> wind = this.windSend(getMonitors(dictTreeFeignClient.queryByCode(DicTreeEnum.Wind_Farms.getCode()).getData().getId()));
|
||||
WriteSheet writeSheet = EasyExcel.writerSheet(0, "风电场" ).head(WindSourceDto.class).build();
|
||||
excelWriter.write(wind, writeSheet);
|
||||
|
||||
List<PhotovoltaicDto> photovoltaic = this.photovoltaicSend(getMonitors(dictTreeFeignClient.queryByCode("1402").getData().getId()));
|
||||
List<PhotovoltaicDto> photovoltaic = this.photovoltaicSend(getMonitors(dictTreeFeignClient.queryByCode(DicTreeEnum.Power_Station.getCode()).getData().getId()));
|
||||
WriteSheet writeSheet2 = EasyExcel.writerSheet(1, "光伏电站" ).head(PhotovoltaicDto.class).build();
|
||||
excelWriter.write(photovoltaic, writeSheet2);
|
||||
|
||||
List<SensitiveUserDto> sensitive = this.sensitiveUserSend(getMonitors(dictTreeFeignClient.queryByCode("2400").getData().getId()));
|
||||
List<SensitiveUserDto> sensitive = this.sensitiveUserSend(getMonitors(dictTreeFeignClient.queryByCode(DicTreeEnum.Imp_Users.getCode()).getData().getId()));
|
||||
WriteSheet writeSheet3 = EasyExcel.writerSheet(2, "重要或敏感用户" ).head(SensitiveUserDto.class).build();
|
||||
excelWriter.write(sensitive, writeSheet3);
|
||||
|
||||
List<TractionStationDTO> traction = this.tractionStationSend(getMonitors(dictTreeFeignClient.queryByCode("1300").getData().getId()));
|
||||
List<TractionStationDTO> traction = this.tractionStationSend(getMonitors(dictTreeFeignClient.queryByCode(DicTreeEnum.Ele_Railways.getCode()).getData().getId()));
|
||||
WriteSheet writeSheet4 = EasyExcel.writerSheet(3, "牵引站" ).head(TractionStationDTO.class).build();
|
||||
excelWriter.write(traction, writeSheet4);
|
||||
|
||||
List<OtherUserDto> other = this.otherUserSend(getMonitors(dictTreeFeignClient.queryByCode("2300").getData().getId()));
|
||||
List<OtherUserDto> other = this.otherUserSend(getMonitors("987654321"));
|
||||
WriteSheet writeSheet5 = EasyExcel.writerSheet(4, "干扰用户" ).head(OtherUserDto.class).build();
|
||||
excelWriter.write(other, writeSheet5);
|
||||
excelWriter.finish();
|
||||
}
|
||||
|
||||
private List<Monitor> getMonitors(String id) {
|
||||
List<DictTreeVO> objType = dictTreeFeignClient.query(id).getData();
|
||||
SysDicTreePO dicTree;
|
||||
List<String> objTypeIds=new ArrayList<>();
|
||||
objTypeIds.add(id);
|
||||
if(CollUtil.isNotEmpty(objType)){
|
||||
objTypeIds.addAll(objType.stream().map(DictTreeVO::getId).collect(Collectors.toList()));
|
||||
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if(id.equals("987654321")){
|
||||
dicTree = new SysDicTreePO();
|
||||
dicTree.setCode("987654321");
|
||||
dicTree.setName("其他");
|
||||
|
||||
//特殊处理
|
||||
List<SysDicTreePO> sysDicTreePOList = dictTreeFeignClient.queryAll().getData();
|
||||
List<SysDicTreePO> typicDic =sysDicTreePOList.stream().filter(item-> Objects.equals(DicTreeEnum.Power_Station.getCode(),item.getCode())||Objects.equals(DicTreeEnum.Ele_Railways.getCode(),item.getCode())||
|
||||
Objects.equals(DicTreeEnum.Wind_Farms.getCode(),item.getCode())||Objects.equals(DicTreeEnum.Imp_Users.getCode(),item.getCode())).collect(Collectors.toList());
|
||||
|
||||
for(SysDicTreePO sysDicTreePO : typicDic){
|
||||
List<DictTreeVO> temList = dictTreeFeignClient.query(sysDicTreePO.getId()).getData();
|
||||
List<String> ids = temList.stream().map(DictTreeVO::getId).collect(Collectors.toList());
|
||||
objTypeIds.addAll(ids);
|
||||
objTypeIds.add(sysDicTreePO.getId());
|
||||
}
|
||||
lambdaQueryWrapper.notIn(Monitor::getObjType, objTypeIds);
|
||||
}else {
|
||||
dicTree = dictTreeFeignClient.queryById(id).getData();
|
||||
if(ObjectUtil.isNull(dicTree)){
|
||||
throw new BusinessException("请检查监测对象类型是否存在");
|
||||
}
|
||||
List<DictTreeVO> objType = dictTreeFeignClient.query(id).getData();
|
||||
objTypeIds.add(id);
|
||||
if(CollUtil.isNotEmpty(objType)){
|
||||
objTypeIds.addAll(objType.stream().map(DictTreeVO::getId).collect(Collectors.toList()));
|
||||
}
|
||||
lambdaQueryWrapper.in(Monitor::getObjType, objTypeIds);
|
||||
}
|
||||
//获取监测点信息
|
||||
List<Monitor> monitorList = monitorService.list(new LambdaQueryWrapper<Monitor>()
|
||||
.in(Monitor::getObjType, objTypeIds)
|
||||
);
|
||||
lambdaQueryWrapper
|
||||
.eq(Monitor::getIsUpToGrid,1);
|
||||
|
||||
List<Monitor> monitorList = monitorService.list(lambdaQueryWrapper);
|
||||
List<String> powerIds= monitorList.stream().map(Monitor::getPowerrId).distinct().collect(Collectors.toList());
|
||||
List<StatationStat> statationStats = statationStatService.listByIds(powerIds);
|
||||
Map<String, StatationStat> powerMap = statationStats.stream().collect(Collectors
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.pojo.dto.StatisticsMonitor;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@@ -119,4 +120,13 @@ public interface CommTerminalService {
|
||||
* @return
|
||||
*/
|
||||
List<DeptGetSubStationDTO.Info> deptSubStationInfo(DeptGetLineParam deptGetLineParam);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 变电站信息
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<SubGetBase> tagOrIdGetSub(SubstationParam substationParam);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.device.pms.service.ledgerManger.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
@@ -15,6 +16,7 @@ import com.njcn.device.biz.pojo.dto.StatisticsMonitor;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.utils.COverlimitUtil;
|
||||
import com.njcn.device.pms.mapper.majornetwork.*;
|
||||
@@ -876,4 +878,9 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SubGetBase> tagOrIdGetSub(SubstationParam param) {
|
||||
return statationStatMapper.selectStatationStatList(param);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -160,7 +160,9 @@ implements RStatZwAlarmCountWService {
|
||||
.le(StringUtils.isNotBlank(endTime), RMpTargetWarnD::getDataDate, endTime)
|
||||
.eq(RMpTargetWarnD::getIsEffective,1);
|
||||
List<RMpTargetWarnD> measurementPointIdList = rMpTargetWarnDService.list(targetWarnWrapper);
|
||||
|
||||
if (CollUtil.isEmpty(measurementPointIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//获取大于四次的监测点集合
|
||||
List<String> MonitorIdsQuartic = measurementPointIdList.stream()
|
||||
.filter(obj -> obj.getIsWarn() == 1)
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
@@ -336,6 +337,14 @@ public class CommTerminalController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, new ArrayList<>(), methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/tagOrIdGetSub")
|
||||
@ApiOperation("获取变电站信息")
|
||||
public HttpResult<List<SubGetBase>> tagOrIdGetSub(@RequestBody SubstationParam substationParam) {
|
||||
String methodDescribe = getMethodDescribe("tagOrIdGetSub");
|
||||
List<SubGetBase> subGetBases = commTerminalService.tagOrIdGetSub(substationParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, subGetBases, methodDescribe);
|
||||
}
|
||||
/**
|
||||
* 获取监测点的台账详细信息
|
||||
* @author cdf
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.dto.TerminalGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@@ -77,4 +79,7 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
|
||||
List<TerminalGetBase.Extend> orgSubStationInfoGet(@Param("list")List<Integer> devType);
|
||||
|
||||
List<String> getLineIdByDeptIds(@Param("deptIds")List<String> deptIds,@Param("runFlag")List<Integer> runFlag,@Param("dataType")List<Integer> dataType);
|
||||
|
||||
|
||||
List<SubGetBase> selectSubStationList(@Param("param") SubstationParam substationParam);
|
||||
}
|
||||
|
||||
@@ -137,4 +137,46 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectSubStationList" resultType="com.njcn.device.biz.pojo.dto.SubGetBase">
|
||||
select
|
||||
DISTINCT
|
||||
substation.id id,
|
||||
substation.name name,
|
||||
pq_dept_line.id orgId,
|
||||
sub.Scale voltageLevel
|
||||
from pq_dept_line pq_dept_line
|
||||
inner join pq_line point on pq_dept_line.line_id = point.id
|
||||
inner join pq_line_detail lineDetail on point.id = lineDetail.id
|
||||
inner join pq_line voltage on point.pid = voltage.id
|
||||
inner join pq_line dev on voltage.pid = dev.id
|
||||
inner join pq_device device on dev.id = device.id
|
||||
inner join pq_line substation on dev.pid = substation.id
|
||||
inner join pq_substation sub on sub.id = substation.id
|
||||
<where>
|
||||
device.Dev_Model = 1
|
||||
and point.state = 1
|
||||
<if test="param.orgIds!=null and param.orgIds.size!=0">
|
||||
and pq_dept_line.id in
|
||||
<foreach collection="param.orgIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.powerIds!=null and param.powerIds.size!=0">
|
||||
and substation.id in
|
||||
<foreach collection="param.powerIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.powerName !=null and param.powerName!='' ">
|
||||
and substation.name like CONCAT(CONCAT('%', #{param.powerName}), '%')
|
||||
</if>
|
||||
<if test="param.powerVoltageLevel!=null and param.powerVoltageLevel.size!=0">
|
||||
and sub.Scale in
|
||||
<foreach collection="param.powerVoltageLevel" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.service;
|
||||
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
@@ -83,4 +84,6 @@ public interface CommTerminalService {
|
||||
|
||||
|
||||
List<DeptGetSubStationDTO.Info> deptSubStationInfo(DeptGetLineParam deptGetLineParam);
|
||||
|
||||
List<SubGetBase> tagOrIdGetSub(SubstationParam substationParam);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.dto.TerminalGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.web.pojo.param.DeptLineParam;
|
||||
|
||||
@@ -107,6 +109,10 @@ public interface DeptLineService extends IService<DeptLine> {
|
||||
|
||||
List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType);
|
||||
|
||||
List<SubGetBase> getSubStationList(SubstationParam substationParam);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据监测点id集合查询部门信息id
|
||||
* @param ids 部门ids
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
@@ -7,12 +8,14 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -250,6 +253,22 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SubGetBase> tagOrIdGetSub(SubstationParam substationParam) {
|
||||
List<SubGetBase> subStationList = deptLineService.getSubStationList(substationParam);
|
||||
if(CollUtil.isNotEmpty(subStationList)){
|
||||
List<String> ids = subStationList.stream().map(SubGetBase::getOrgId).collect(Collectors.toList());
|
||||
List<Dept> data = deptFeignClient.getDeptInfoListByIds(ids).getData();
|
||||
Map<String, String> deptMap = data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
|
||||
subStationList.stream().forEach(x->{
|
||||
if(deptMap.containsKey(x.getOrgId())){
|
||||
x.setOrgName(deptMap.get(x.getOrgId()));
|
||||
}
|
||||
});
|
||||
}
|
||||
return subStationList;
|
||||
}
|
||||
|
||||
|
||||
private List<Integer> filterDataTypeNew(String serverName) {
|
||||
List<Integer> devType = new ArrayList<>();
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.njcn.device.pq.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.dto.TerminalGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.mapper.DeptLineMapper;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
@@ -124,6 +126,11 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
return deptLineMapper.orgSubStationInfoGet(devType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SubGetBase> getSubStationList(SubstationParam substationParam) {
|
||||
return deptLineMapper.selectSubStationList(substationParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeptLine getLineByLineIds(String ids) {
|
||||
return this.getOne(new LambdaQueryWrapper<DeptLine>()
|
||||
|
||||
Reference in New Issue
Block a user