变压器策略,bug修改
This commit is contained in:
@@ -20,9 +20,11 @@ public class PqsTransformerParam implements Serializable {
|
||||
private String tfIndex;
|
||||
|
||||
@ApiModelProperty(name ="upNode",value = "上节点",required = true)
|
||||
@NotBlank(message = "变压器台账上节点不能为空")
|
||||
private String upNode;
|
||||
|
||||
@ApiModelProperty(name ="downNode",value = "下节点",required = true)
|
||||
@NotBlank(message = "变压器台下节点不能为空")
|
||||
private String downNode;
|
||||
|
||||
@Data
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.njcn.device.pq.pojo.param.PqsTransformerParam;
|
||||
import com.njcn.device.pq.pojo.vo.PqsTflgassVO;
|
||||
import com.njcn.device.pq.pojo.vo.PqsTransformerVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalTree;
|
||||
import com.njcn.device.pq.pojo.vo.TransformerVO;
|
||||
import com.njcn.device.pq.service.IPqsTransformerService;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -90,7 +89,7 @@ public class PqsTransformerController extends BaseController {
|
||||
@PostMapping("/nodeMaintenance")
|
||||
@ApiOperation(value = "变电站节点维护")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
public HttpResult<Boolean> nodeMaintenance(@RequestBody PqsTransformerParam param) {
|
||||
public HttpResult<Boolean> nodeMaintenance(@RequestBody @Validated PqsTransformerParam param) {
|
||||
String methodDescribe = getMethodDescribe("nodeMaintenance");
|
||||
Boolean flag = iPqsTransformerService.nodeMaintenance(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
@@ -99,9 +98,9 @@ public class PqsTransformerController extends BaseController {
|
||||
@GetMapping("/getGeneratrix")
|
||||
@ApiOperation(value = "获取上下节点信息")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
public HttpResult<Map<String, List<TerminalTree>>> getGeneratrix(String id) {
|
||||
public HttpResult<Map<String, Object>> getGeneratrix(String subId,String id) {
|
||||
String methodDescribe = getMethodDescribe("getGeneratrix");
|
||||
Map<String, List<TerminalTree>> generatrix = iPqsTransformerService.getGeneratrix(id);
|
||||
Map<String, Object> generatrix = iPqsTransformerService.getGeneratrix(subId,id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, generatrix, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -446,10 +446,10 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
|
||||
|
||||
/**
|
||||
* 获取变电站下母线(变电站策略专用)
|
||||
* 根据变电站获取母线信息(变电站策略专用)
|
||||
* @param subId
|
||||
* @param type (0是跨 1是本)
|
||||
* @param type (0是除了本变电站所有变电站母线信息 1是获取本变电站所有母线信息 2是根据母线获取信息)
|
||||
* @return
|
||||
*/
|
||||
List<TerminalTree> getvoltage(@Param("subId") String subId,@Param("type") Integer type);
|
||||
List<TerminalTree> getvoltage(@Param("id") String subId,@Param("type") Integer type);
|
||||
}
|
||||
|
||||
@@ -1164,13 +1164,15 @@
|
||||
INNER JOIN pq_line sub ON dev.pid = sub.id
|
||||
<where>
|
||||
voltage.state = 1
|
||||
<if test="subId != null and subId !='' and type == 1">
|
||||
and sub.id = #{subId}
|
||||
<if test="id != null and id !='' and type == 0">
|
||||
and sub.id != #{id}
|
||||
</if>
|
||||
<if test="subId != null and subId !='' and type == 0">
|
||||
and sub.id != #{subId}
|
||||
<if test="id != null and id !='' and type == 1">
|
||||
and sub.id = #{id}
|
||||
</if>
|
||||
<if test="id != null and id !='' and type == 2">
|
||||
and voltage.id = #{id}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
INNER JOIN pqs_transformer pf on pf.Tf_Index=pt.Tf_Index
|
||||
<where>
|
||||
pf.Sub_Index = #{id}
|
||||
and Logic_Before IN
|
||||
and ( Logic_Before IN
|
||||
<foreach item="item" collection="ids" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and Logic_Next IN
|
||||
or Logic_Next IN
|
||||
<foreach item="item" collection="ids" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
)
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.njcn.device.pq.pojo.po.PqsTransformer;
|
||||
import com.njcn.device.pq.pojo.vo.PqsTflgassVO;
|
||||
import com.njcn.device.pq.pojo.vo.PqsTransformerVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalTree;
|
||||
import com.njcn.device.pq.pojo.vo.TransformerVO;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
|
||||
import java.util.List;
|
||||
@@ -72,11 +71,11 @@ public interface IPqsTransformerService extends IService<PqsTransformer> {
|
||||
|
||||
/**
|
||||
* 获取上下节点信息
|
||||
* @param subId
|
||||
* @param id
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
Map<String,List<TerminalTree>> getGeneratrix(String id);
|
||||
Map<String,Object> getGeneratrix(String subId,String id);
|
||||
|
||||
/**
|
||||
* 获取母线设备树层级/变压器/市/
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.njcn.device.pq.pojo.po.PqsTransformer;
|
||||
import com.njcn.device.pq.pojo.vo.PqsTflgassVO;
|
||||
import com.njcn.device.pq.pojo.vo.PqsTransformerVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalTree;
|
||||
import com.njcn.device.pq.pojo.vo.TransformerVO;
|
||||
import com.njcn.device.pq.service.IPqsTflgassService;
|
||||
import com.njcn.device.pq.service.IPqsTransformerService;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
@@ -137,7 +136,9 @@ public class PqsTransformerServiceImpl extends ServiceImpl<PqsTransformerMapper,
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean delTransformer(List<String> ids) {
|
||||
boolean b = this.removeByIds(ids);
|
||||
return b;
|
||||
LambdaQueryWrapper<PqsTflgass> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(PqsTflgass::getTfIndex, ids);
|
||||
return iPqsTflgassService.remove(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -177,51 +178,186 @@ public class PqsTransformerServiceImpl extends ServiceImpl<PqsTransformerMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<TerminalTree>> getGeneratrix(String id) {
|
||||
Map<String, List<TerminalTree>> voltage = new HashMap<>();
|
||||
|
||||
public Map<String, Object> getGeneratrix(String subId, String id) {
|
||||
Map<String, Object> voltage = new HashMap<>();
|
||||
//先判断当前,变电站是否已添加了节点
|
||||
PqsTflgass one = iPqsTflgassService.getOne(new LambdaQueryWrapper<PqsTflgass>()
|
||||
.eq(PqsTflgass::getTfIndex, id));
|
||||
|
||||
//1.获取当前变电站下,所拥有的母线条数
|
||||
List<TerminalTree> downVoltage = lineMapper.getvoltage(id, 1);
|
||||
List<TerminalTree> downVoltage = lineMapper.getvoltage(subId, 1);
|
||||
//获取母线id
|
||||
List<String> ids = downVoltage.stream().map(TerminalTree::getId).collect(Collectors.toList());
|
||||
//查询节点是否绑定
|
||||
List<PqsTflgass> pqsTflgasses = pqsTflgassMapper.selectFlgass(id, ids);
|
||||
List<PqsTflgass> pqsTflgasses = pqsTflgassMapper.selectFlgass(subId, ids);
|
||||
|
||||
|
||||
String dadadw = mostBefore(pqsTflgasses);
|
||||
// List<PqsTflgass> pqsTflgasses = pqsTflgassMapper.selectList(null);
|
||||
String[][] arr = new String[pqsTflgasses.size()][2];
|
||||
if (CollUtil.isNotEmpty(pqsTflgasses) && ids.size() > 2) {
|
||||
for (int i = 0; i < pqsTflgasses.size(); i++) {
|
||||
arr[i][0] = pqsTflgasses.get(i).getLogicBefore();
|
||||
arr[i][1] = pqsTflgasses.get(i).getLogicNext();
|
||||
}
|
||||
|
||||
}
|
||||
voltage.put("bind", arr);
|
||||
|
||||
Stream<String> beforeStream = pqsTflgasses.stream().map(PqsTflgass::getLogicBefore);
|
||||
Stream<String> nextStream = pqsTflgasses.stream().map(PqsTflgass::getLogicNext);
|
||||
//合并节点,要是母线都存在,说明是跨变电站,反之是本变电站
|
||||
List<String> merge = Stream.concat(beforeStream, nextStream)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
//跨变电站
|
||||
if (downVoltage.size() < 2 || merge.size() == ids.size()) {
|
||||
List<TerminalTree> upVoltage;
|
||||
if (downVoltage.size() < 2) {
|
||||
upVoltage = lineMapper.getvoltage(id, 0);
|
||||
} else {
|
||||
List<PqsTflgass> ad = iPqsTflgassService.list();
|
||||
String s = recursionSelectList(ad);
|
||||
upVoltage = downVoltage.stream().filter(x -> x.getId().equals(s)).collect(Collectors.toList());
|
||||
//查看已经绑定的母线
|
||||
List<String> bindList = merge.stream().filter(x -> ids.contains(x)).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
List<TerminalTree> upList = TreedChildren(upVoltage, "变压器上节点设备树", null);
|
||||
voltage.put("upNode", upList);
|
||||
List<TerminalTree> downList = TreedChildren(downVoltage, "变压器下节点设备树", id);
|
||||
voltage.put("downNode", downList);
|
||||
//绑定母线,如有绑定的母线下不存在这个母线,说明是有跨变电站数据,则新增母线节点,为最底层节点往后,拼接
|
||||
List<String> straddleList = merge.stream().filter(x -> !ids.contains(x)).collect(Collectors.toList());
|
||||
//判断当前母线下是否还存在,没绑定节点
|
||||
List<String> not = ids.stream().filter(x -> !bindList.contains(x)).collect(Collectors.toList());
|
||||
|
||||
|
||||
/**
|
||||
* 当母线节点+1等于去重之后的绑定节点说明,节点已经全部绑定了
|
||||
*
|
||||
* 跨变电站
|
||||
* 1.1当母线小于俩条时为跨
|
||||
* 1.2当都所有节点都绑定时,只有最起始节点为跨
|
||||
* 本变电站
|
||||
* 1.1当有俩条时或者大于俩条时时为本
|
||||
* 1.2当已绑定有跨变电站时,则上节点为最底层节点母线,下节点为没绑定的母线信息
|
||||
*/
|
||||
|
||||
|
||||
if (ObjectUtil.isNotNull(one)) {
|
||||
List<String> collect = ids.stream().filter(x -> x.equals(one.getLogicBefore())).collect(Collectors.toList());
|
||||
/**
|
||||
* 本
|
||||
* 1.当母线大于俩条
|
||||
* 2.当所有母线没有绑定是
|
||||
*/
|
||||
if (collect.size() > 0) {
|
||||
List<TerminalTree> upVOList;
|
||||
if (straddleList.size() > 0 && not.size() > 0) {
|
||||
String s = mostNext(pqsTflgasses);
|
||||
upVOList = downVoltage.stream().filter(x -> s.equals(x.getId())).collect(Collectors.toList());
|
||||
} else {
|
||||
//上节点id
|
||||
List<String> upIDs = pqsTflgasses.stream().map(PqsTflgass::getLogicBefore).collect(Collectors.toList());
|
||||
List<TerminalTree> upVOList = downVoltage.stream().filter(x -> !upIDs.contains(x.getId())).collect(Collectors.toList());
|
||||
upVOList = downVoltage.stream().filter(x -> !upIDs.contains(x.getId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
//下节点id
|
||||
List<String> downIDs = pqsTflgasses.stream().map(PqsTflgass::getLogicBefore).collect(Collectors.toList());
|
||||
List<String> downIDs = pqsTflgasses.stream().map(PqsTflgass::getLogicNext).collect(Collectors.toList());
|
||||
List<TerminalTree> downVOList = downVoltage.stream().filter(x -> !downIDs.contains(x.getId())).collect(Collectors.toList());
|
||||
|
||||
List<TerminalTree> upList = TreedChildren(upVOList, "变压器上节点设备树", id);
|
||||
if (ObjectUtil.isNotNull(one)) {
|
||||
TerminalTree beforeTree = addTree(one.getLogicBefore());
|
||||
TerminalTree nextTree = addTree(one.getLogicNext());
|
||||
upVOList.add(beforeTree);
|
||||
downVOList.add(nextTree);
|
||||
}
|
||||
List<TerminalTree> upList = TreedChildren(upVOList, "变压器上节点设备树", subId);
|
||||
voltage.put("upNode", upList);
|
||||
List<TerminalTree> downList = TreedChildren(downVOList, "变压器下节点设备树", id);
|
||||
List<TerminalTree> downList = TreedChildren(downVOList, "变压器下节点设备树", subId);
|
||||
voltage.put("downNode", downList);
|
||||
return voltage;
|
||||
} else {
|
||||
//查询所有变电站下母线信息
|
||||
List<TerminalTree> upVoltage = lineMapper.getvoltage(subId, 0);
|
||||
if (merge.size() == ids.size()) {
|
||||
String s = mostBefore(pqsTflgasses);
|
||||
downVoltage = downVoltage.stream().filter(x -> x.getId().equals(s)).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
if (ObjectUtil.isNotNull(one)) {
|
||||
TerminalTree beforeTree = addTree(one.getLogicBefore());
|
||||
TerminalTree nextTree = addTree(one.getLogicNext());
|
||||
upVoltage = upVoltage.stream().filter(x -> !x.getId().equals(beforeTree.getId())).collect(Collectors.toList());
|
||||
upVoltage.add(beforeTree);
|
||||
|
||||
downVoltage.clear();
|
||||
downVoltage.add(nextTree);
|
||||
}
|
||||
List<TerminalTree> upList = TreedChildren(upVoltage, "变压器上节点设备树", null);
|
||||
voltage.put("upNode", upList);
|
||||
List<TerminalTree> downList = TreedChildren(downVoltage, "变压器下节点设备树", subId);
|
||||
voltage.put("downNode", downList);
|
||||
return voltage;
|
||||
}
|
||||
|
||||
} else {
|
||||
//判断是否已经全部绑定
|
||||
String chain = chain(pqsTflgasses);
|
||||
String chain2 = chain2(pqsTflgasses);
|
||||
if (StrUtil.isNotBlank(chain) && not.size() == 0&& pqsTflgasses.size()+1!=ids.size()&&straddleList.size()==0
|
||||
|| StrUtil.isNotBlank(chain2) && not.size() == 0&& pqsTflgasses.size()+1!=ids.size()&&straddleList.size()==0) {
|
||||
List<String> logicBefore = pqsTflgasses.stream().map(PqsTflgass::getLogicBefore).collect(Collectors.toList());
|
||||
List<String> logicNext = pqsTflgasses.stream().map(PqsTflgass::getLogicNext).collect(Collectors.toList());
|
||||
List<TerminalTree> up = downVoltage.stream().filter(x -> !logicBefore.contains(x.getId())).collect(Collectors.toList());
|
||||
List<TerminalTree> upList = TreedChildren(up, "变压器上节点设备树", subId);
|
||||
voltage.put("upNode", upList);
|
||||
|
||||
List<TerminalTree> down = downVoltage.stream().filter(x -> !logicNext.contains(x.getId())).collect(Collectors.toList());
|
||||
List<TerminalTree> downList = TreedChildren(down, "变压器下节点设备树", subId);
|
||||
voltage.put("downNode", downList);
|
||||
return voltage;
|
||||
} else {
|
||||
if (downVoltage.size() > 1 && straddleList.size() == 0 && bindList.size() != ids.size()
|
||||
|| straddleList.size() > 0 && not.size() > 0
|
||||
|
||||
) {
|
||||
List<TerminalTree> upVOList;
|
||||
if (straddleList.size() > 0 && not.size() > 0) {
|
||||
String s = mostNext(pqsTflgasses);
|
||||
upVOList = downVoltage.stream().filter(x -> s.equals(x.getId())).collect(Collectors.toList());
|
||||
} else {
|
||||
//上节点id
|
||||
List<String> upIDs = pqsTflgasses.stream().map(PqsTflgass::getLogicBefore).collect(Collectors.toList());
|
||||
upVOList = downVoltage.stream().filter(x -> !upIDs.contains(x.getId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
//下节点id
|
||||
List<String> downIDs = pqsTflgasses.stream().map(PqsTflgass::getLogicNext).collect(Collectors.toList());
|
||||
|
||||
List<TerminalTree> downVOList = downVoltage.stream().filter(x -> !downIDs.contains(x.getId())).collect(Collectors.toList());
|
||||
if(not.size() ==1){
|
||||
List<String> logicBefore = pqsTflgasses.stream().map(PqsTflgass::getLogicBefore).collect(Collectors.toList());
|
||||
downVOList = downVOList.stream().filter(x -> !logicBefore.contains(x.getId())).collect(Collectors.toList());
|
||||
}
|
||||
List<TerminalTree> upList = TreedChildren(upVOList, "变压器上节点设备树", subId);
|
||||
voltage.put("upNode", upList);
|
||||
List<TerminalTree> downList = TreedChildren(downVOList, "变压器下节点设备树", subId);
|
||||
voltage.put("downNode", downList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 跨
|
||||
* 1.当母线小于2条跨
|
||||
* 2.当所有母线都绑定为跨
|
||||
*/
|
||||
else {
|
||||
//查询所有变电站下母线信息
|
||||
List<TerminalTree> upVoltage = lineMapper.getvoltage(subId, 0);
|
||||
if (merge.size() == ids.size()) {
|
||||
String s = mostBefore(pqsTflgasses);
|
||||
downVoltage = downVoltage.stream().filter(x -> x.getId().equals(s)).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
//下节点id
|
||||
List<String> downIDs = pqsTflgasses.stream().map(PqsTflgass::getLogicNext).collect(Collectors.toList());
|
||||
List<TerminalTree> downVOList = downVoltage.stream().filter(x -> !downIDs.contains(x.getId())).collect(Collectors.toList());
|
||||
|
||||
List<TerminalTree> upList = TreedChildren(upVoltage, "变压器上节点设备树", null);
|
||||
voltage.put("upNode", upList);
|
||||
List<TerminalTree> downList = TreedChildren(downVOList, "变压器下节点设备树", subId);
|
||||
voltage.put("downNode", downList);
|
||||
return voltage;
|
||||
}
|
||||
}
|
||||
}
|
||||
return voltage;
|
||||
}
|
||||
|
||||
@@ -244,8 +380,9 @@ public class PqsTransformerServiceImpl extends ServiceImpl<PqsTransformerMapper,
|
||||
/**
|
||||
* 初始化设备树
|
||||
*
|
||||
* @param children
|
||||
* @param name
|
||||
* @param children 子节点
|
||||
* @param name 节点名称
|
||||
* @param subId 不为空则只展示,当前变电站节点的信息,为空则展示所有信息
|
||||
* @return
|
||||
*/
|
||||
public List<TerminalTree> TreedChildren(List<TerminalTree> children, String name, String subId) {
|
||||
@@ -288,26 +425,145 @@ public class PqsTransformerServiceImpl extends ServiceImpl<PqsTransformerMapper,
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找节点信息
|
||||
* 查找最顶层节点信息
|
||||
*
|
||||
* @param pqsTflgasses
|
||||
* @return
|
||||
*/
|
||||
private static String recursionSelectList(List<PqsTflgass> pqsTflgasses) {
|
||||
private static String mostBefore(List<PqsTflgass> pqsTflgasses) {
|
||||
String logicBefore = null;
|
||||
for (PqsTflgass pqsTflgass : pqsTflgasses) {
|
||||
//根据获取的的上节点判断是否存在,这上节点是否是尾节点
|
||||
if (ObjectUtil.isNull(logicBefore)) {
|
||||
logicBefore = pqsTflgass.getLogicBefore();
|
||||
} else {
|
||||
String logicNext = pqsTflgass.getLogicNext();
|
||||
while (true) {
|
||||
for (int i1 = 0; i1 < pqsTflgasses.size(); i1++) {
|
||||
String logicNext = pqsTflgasses.get(i1).getLogicNext();
|
||||
if (logicBefore.equals(logicNext)) {
|
||||
logicBefore = pqsTflgass.getLogicBefore();
|
||||
logicBefore = pqsTflgasses.get(i1).getLogicBefore();
|
||||
break;
|
||||
} else {
|
||||
if (i1 == pqsTflgasses.size()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return logicBefore;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找最底层节点信息
|
||||
*
|
||||
* @param pqsTflgasses
|
||||
* @return
|
||||
*/
|
||||
private static String mostNext(List<PqsTflgass> pqsTflgasses) {
|
||||
String logicNext = null;
|
||||
for (PqsTflgass pqsTflgass : pqsTflgasses) {
|
||||
//根据获取的的上节点判断是否存在,这上节点是否是尾节点
|
||||
if (ObjectUtil.isNull(logicNext)) {
|
||||
logicNext = pqsTflgass.getLogicNext();
|
||||
} else {
|
||||
while (true) {
|
||||
for (int i1 = 0; i1 < pqsTflgasses.size(); i1++) {
|
||||
String logicBefore = pqsTflgasses.get(i1).getLogicBefore();
|
||||
if (logicNext.equals(logicBefore)) {
|
||||
logicNext = pqsTflgasses.get(i1).getLogicNext();
|
||||
break;
|
||||
} else {
|
||||
if (i1 == pqsTflgasses.size()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return logicNext;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否已经成为链行
|
||||
*
|
||||
* @param pqsTflgasses
|
||||
* @return
|
||||
*/
|
||||
private static String chain(List<PqsTflgass> pqsTflgasses) {
|
||||
if(pqsTflgasses.size()<2){
|
||||
return null;
|
||||
}
|
||||
String logicNext = null;
|
||||
for (PqsTflgass pqsTflgass : pqsTflgasses) {
|
||||
//根据获取的的下节点判断是否存在,这下节点是否是首节点
|
||||
if (ObjectUtil.isNull(logicNext)) {
|
||||
logicNext = pqsTflgass.getLogicNext();
|
||||
} else {
|
||||
while (true) {
|
||||
for (int i1 = 0; i1 < pqsTflgasses.size(); i1++) {
|
||||
String logicBefore = pqsTflgasses.get(i1).getLogicBefore();
|
||||
if (logicNext.equals(logicBefore)) {
|
||||
logicNext = pqsTflgasses.get(i1).getLogicNext();
|
||||
break;
|
||||
} else {
|
||||
if (i1 == pqsTflgasses.size() - 1) {
|
||||
return logicNext;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return logicNext;
|
||||
}
|
||||
|
||||
private static String chain2(List<PqsTflgass> pqsTflgasses) {
|
||||
if(pqsTflgasses.size()<2){
|
||||
return null;
|
||||
}
|
||||
String logicBefore = null;
|
||||
for (PqsTflgass pqsTflgass : pqsTflgasses) {
|
||||
//根据获取的的下节点判断是否存在,这下节点是否是首节点
|
||||
if (ObjectUtil.isNull(logicBefore)) {
|
||||
logicBefore = pqsTflgass.getLogicBefore();
|
||||
} else {
|
||||
while (true) {
|
||||
for (int i1 = 0; i1 < pqsTflgasses.size(); i1++) {
|
||||
String logicNext = pqsTflgasses.get(i1).getLogicNext();
|
||||
if (logicBefore.equals(logicNext)) {
|
||||
logicBefore = pqsTflgasses.get(i1).getLogicBefore();
|
||||
break;
|
||||
} else {
|
||||
if (i1 == pqsTflgasses.size() - 1) {
|
||||
return logicBefore;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return logicBefore;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据母线获取信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public TerminalTree addTree(String id) {
|
||||
List<TerminalTree> getvoltage = lineMapper.getvoltage(id, 2);
|
||||
getvoltage.get(0).setLevel(5);
|
||||
return getvoltage.get(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -227,6 +227,9 @@ public enum DicDataEnum {
|
||||
DY_10KV("交流10kV", "10kV"),
|
||||
DY_35KV("交流35kV", "35kV"),
|
||||
DY_110KV("交流110kV", "110kV"),
|
||||
DY_220KV("交流220kV", "220kV"),
|
||||
DY_500KV("交流500kV", "500kV"),
|
||||
DY_DC_500kV("直流500kV", "DC_500kV"),
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user