联调有功功率,解决部分bug
This commit is contained in:
@@ -83,5 +83,5 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
|
||||
|
||||
List<SubGetBase> selectSubStationList(@Param("param") SubstationParam substationParam);
|
||||
|
||||
List<String> getLineByDeptIdAndNewStation(@Param("id") String id,@Param("dictTree")List<String> dictTree);
|
||||
List<String> getLineByDeptIdAndNewStation(@Param("ids") List<String> id,@Param("dictTree")List<String> dictTree);
|
||||
}
|
||||
|
||||
@@ -206,8 +206,11 @@
|
||||
INNER JOIN pq_line_detail pld ON pdl.Line_Id = pld.Id
|
||||
<where>
|
||||
pld.Obj_Id IS NOT NULL and pld.Obj_Id !=''
|
||||
<if test="id !=null and id !='' ">
|
||||
and pdl.Id = #{id}
|
||||
<if test="ids!=null and ids.size!=0">
|
||||
and pdl.Id in
|
||||
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="dictTree!=null and dictTree.size!=0">
|
||||
and pld.Big_Obj_Type in
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -35,7 +36,6 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/12 17:32
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@@ -80,8 +80,8 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLineByDeptIds(List<String> ids,List<Integer> runFlag,List<Integer> dataType,String objType) {
|
||||
return this.baseMapper.getLineIdByDeptIds(ids,runFlag,dataType,objType);
|
||||
public List<String> getLineByDeptIds(List<String> ids, List<Integer> runFlag, List<Integer> dataType, String objType) {
|
||||
return this.baseMapper.getLineIdByDeptIds(ids, runFlag, dataType, objType);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -100,15 +100,19 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
public List<String> getLineByDeptIdAndNewStation(String id) {
|
||||
List<String> dictTree = new ArrayList<>();
|
||||
DictTreeVO powerStation = dictTreeFeignClient.queryByCode(DicTreeEnum.Power_Station.getCode()).getData();
|
||||
if(ObjectUtil.isNotNull(powerStation)){
|
||||
if (ObjectUtil.isNotNull(powerStation)) {
|
||||
dictTree.add(powerStation.getId());
|
||||
}
|
||||
DictTreeVO windFarms = dictTreeFeignClient.queryByCode(DicTreeEnum.Wind_Farms.getCode()).getData();
|
||||
if(ObjectUtil.isNotNull(windFarms)){
|
||||
if (ObjectUtil.isNotNull(windFarms)) {
|
||||
dictTree.add(windFarms.getId());
|
||||
}
|
||||
if(CollUtil.isNotEmpty(dictTree)){
|
||||
return this.baseMapper.getLineByDeptIdAndNewStation(id,dictTree);
|
||||
if (CollUtil.isNotEmpty(dictTree)) {
|
||||
List<String> ids = new ArrayList<>();
|
||||
if (StrUtil.isNotBlank(id)) {
|
||||
ids.addAll(deptFeignClient.getDepSonIdtByDeptId(id).getData());
|
||||
}
|
||||
return this.baseMapper.getLineByDeptIdAndNewStation(ids, dictTree);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
@@ -134,24 +138,24 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
@Override
|
||||
public Map<String, List<String>> getLineByDeptRelation(Integer devDataType) {
|
||||
List<DeptLine> deptLines = deptLineMapper.getLineByDeptRelation(devDataType);
|
||||
return deptLines.stream ( ).collect (Collectors.groupingBy (DeptLine::getId, Collectors.mapping (DeptLine::getLineId,Collectors.toList ())));
|
||||
return deptLines.stream().collect(Collectors.groupingBy(DeptLine::getId, Collectors.mapping(DeptLine::getLineId, Collectors.toList())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<LineDevGetDTO>> lineDevGet(List<Integer> devDataType,Integer type,Integer lineRunFlag) {
|
||||
List<LineDevGetDTO> deptLines = deptLineMapper.lineDevGet(devDataType,type, lineRunFlag);
|
||||
return deptLines.stream ().collect (Collectors.groupingBy (LineDevGetDTO::getUnitId));
|
||||
public Map<String, List<LineDevGetDTO>> lineDevGet(List<Integer> devDataType, Integer type, Integer lineRunFlag) {
|
||||
List<LineDevGetDTO> deptLines = deptLineMapper.lineDevGet(devDataType, type, lineRunFlag);
|
||||
return deptLines.stream().collect(Collectors.groupingBy(LineDevGetDTO::getUnitId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<TerminalGetBase>> orgSubStationGet(List<Integer> devDataType) {
|
||||
List<TerminalGetBase> deptLines = deptLineMapper.orgSubStationGet(devDataType);
|
||||
return deptLines.stream ().collect (Collectors.groupingBy (TerminalGetBase::getUnitId));
|
||||
return deptLines.stream().collect(Collectors.groupingBy(TerminalGetBase::getUnitId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType,Integer powerFlag,Integer lineRunFlag) {
|
||||
return deptLineMapper.orgSubStationInfoGet(devType, powerFlag,lineRunFlag);
|
||||
public List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType, Integer powerFlag, Integer lineRunFlag) {
|
||||
return deptLineMapper.orgSubStationInfoGet(devType, powerFlag, lineRunFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -162,7 +166,7 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
||||
@Override
|
||||
public DeptLine getLineByLineIds(String ids) {
|
||||
return this.getOne(new LambdaQueryWrapper<DeptLine>()
|
||||
.eq(DeptLine::getLineId,ids)
|
||||
.eq(DeptLine::getLineId, ids)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user