fix(device): 修复设备服务中的循环次数和排序设置问题
- 将等待设备上线的循环次数从3次增加到10次 - 为负载侧和电源侧拓扑图参数添加正确的排序值设置 - 移除重复的排序设置逻辑,避免数据冲突 - 确保设备数据集按正确顺序进行初始化配置
This commit is contained in:
@@ -191,7 +191,7 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
|
|||||||
Object model = null;
|
Object model = null;
|
||||||
try {
|
try {
|
||||||
String key = AppRedisKey.LINE + nDid;
|
String key = AppRedisKey.LINE + nDid;
|
||||||
for (int i = 0; i < 3 ; i++) {
|
for (int i = 0; i < 10 ; i++) {
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
model = redisUtil.getObjectByKey(key);
|
model = redisUtil.getObjectByKey(key);
|
||||||
if (!Objects.isNull(model)){
|
if (!Objects.isNull(model)){
|
||||||
@@ -277,6 +277,7 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
|
|||||||
param.setId(uuid);
|
param.setId(uuid);
|
||||||
appLineTopologyDiagramPo.setLineId(uuid);
|
appLineTopologyDiagramPo.setLineId(uuid);
|
||||||
po.setClDid(1);
|
po.setClDid(1);
|
||||||
|
param.setSort(1);
|
||||||
} else if (Objects.equals(DicDataEnum.LOAD_SIDE.getCode(),location)){
|
} else if (Objects.equals(DicDataEnum.LOAD_SIDE.getCode(),location)){
|
||||||
if (!Objects.isNull(clDidToIdMap.get(2))) {
|
if (!Objects.isNull(clDidToIdMap.get(2))) {
|
||||||
uuid = clDidToIdMap.get(2);
|
uuid = clDidToIdMap.get(2);
|
||||||
@@ -291,6 +292,7 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
|
|||||||
param.setId(uuid);
|
param.setId(uuid);
|
||||||
appLineTopologyDiagramPo.setLineId(uuid);
|
appLineTopologyDiagramPo.setLineId(uuid);
|
||||||
po.setClDid(2);
|
po.setClDid(2);
|
||||||
|
param.setSort(2);
|
||||||
} else {
|
} else {
|
||||||
if (!Objects.isNull(clDidToIdMap.get(0))) {
|
if (!Objects.isNull(clDidToIdMap.get(0))) {
|
||||||
uuid = clDidToIdMap.get(0);
|
uuid = clDidToIdMap.get(0);
|
||||||
@@ -303,6 +305,7 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
|
|||||||
String dataSetId = Objects.requireNonNull(dataSets.stream().filter(it -> Objects.equals(it.getClDev(), 0)&&Objects.equals(it.getType(), 0)).findFirst().orElse(null)).getId();
|
String dataSetId = Objects.requireNonNull(dataSets.stream().filter(it -> Objects.equals(it.getClDev(), 0)&&Objects.equals(it.getType(), 0)).findFirst().orElse(null)).getId();
|
||||||
po.setDataSetId(dataSetId);
|
po.setDataSetId(dataSetId);
|
||||||
param.setId(uuid);
|
param.setId(uuid);
|
||||||
|
param.setSort(0);
|
||||||
appLineTopologyDiagramPo.setLineId(uuid);
|
appLineTopologyDiagramPo.setLineId(uuid);
|
||||||
}
|
}
|
||||||
po.setStatus(1);
|
po.setStatus(1);
|
||||||
@@ -310,7 +313,6 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
|
|||||||
param.setPid(vo.getId());
|
param.setPid(vo.getId());
|
||||||
param.setName(item.getName());
|
param.setName(item.getName());
|
||||||
param.setLevel(3);
|
param.setLevel(3);
|
||||||
param.setSort(po.getClDid());
|
|
||||||
csLedgerService.addLedgerTree(param);
|
csLedgerService.addLedgerTree(param);
|
||||||
appLineTopologyDiagramPo.setId(devAccessParam.getTopologyDiagram());
|
appLineTopologyDiagramPo.setId(devAccessParam.getTopologyDiagram());
|
||||||
appLineTopologyDiagramPo.setLat(item.getLat());
|
appLineTopologyDiagramPo.setLat(item.getLat());
|
||||||
|
|||||||
Reference in New Issue
Block a user