Commit 515da94d authored by linruibiao's avatar linruibiao

接口编写

parent 199f3dbc
......@@ -103,7 +103,15 @@ public class InstrumentPanelInitServiceImpl extends ServiceImpl<InstrumentPanelM
e.printStackTrace();
throw new SysException("仪表板配置详情解密异常");
}
configService.publish(appId,setConfig(one,appId,initPanelName1,config));
InstrumentPanelTree tree = treeService.getById(panelConfig.getPanelId());
LambdaQueryWrapper<InstrumentPanelTree> where = new LambdaQueryWrapper<>();
where.eq(BaseEntity::getRecordStatus, SlmConstants.DATA_VALID);
where.likeRight(InstrumentPanelTree::getFullId, tree.getFullId() + ".");
where.orderByAsc(InstrumentPanelTree::getAssemblyKey);
List<InstrumentPanelTree> panelTrees = treeService.list(where);
configService.publish(appId,setConfig(one,appId,initPanelName1,config,panelTrees));
}
......@@ -122,13 +130,19 @@ public class InstrumentPanelInitServiceImpl extends ServiceImpl<InstrumentPanelM
e.printStackTrace();
throw new SysException("仪表板配置详情解密异常");
}
configService.publish(appId,setConfig(one,appId,initPanelName2,config));
InstrumentPanelTree tree = treeService.getById(panelConfig.getPanelId());
LambdaQueryWrapper<InstrumentPanelTree> where = new LambdaQueryWrapper<>();
where.eq(BaseEntity::getRecordStatus, SlmConstants.DATA_VALID);
where.likeRight(InstrumentPanelTree::getFullId, tree.getFullId() + ".");
where.orderByAsc(InstrumentPanelTree::getAssemblyKey);
List<InstrumentPanelTree> panelTrees = treeService.list(where);
configService.publish(appId,setConfig(one,appId,initPanelName2,config,panelTrees));
}
return null;
}
private InstrumentPanelConfigDTO setConfig(InstrumentPanelGroup one , String appId, String panelName, String panelConfig){
private InstrumentPanelConfigDTO setConfig(InstrumentPanelGroup one , String appId, String panelName, String panelConfig, List<InstrumentPanelTree> panelTrees){
SaveInstrumentPanelDTO panelDto = new SaveInstrumentPanelDTO();
panelDto.setName(panelName);
panelDto.setGroupId(one.getId());
......@@ -136,12 +150,6 @@ public class InstrumentPanelInitServiceImpl extends ServiceImpl<InstrumentPanelM
InstrumentPanel instrumentPanel = baseMapper.selectById(panelId);
InstrumentPanelConfigDTO config = new InstrumentPanelConfigDTO();
List<InstrumentPanelAssemblyDTO> assemblys = Lists.newArrayList();
InstrumentPanelTree tree = treeService.getById(panelId);
LambdaQueryWrapper<InstrumentPanelTree> where = new LambdaQueryWrapper<>();
where.eq(BaseEntity::getRecordStatus, SlmConstants.DATA_VALID);
where.likeRight(InstrumentPanelTree::getFullId, tree.getFullId() + ".");
where.orderByAsc(InstrumentPanelTree::getAssemblyKey);
List<InstrumentPanelTree> panelTrees = treeService.list(where);
panelTrees.forEach(x->{
InstrumentPanelAssemblyDTO dto = new InstrumentPanelAssemblyDTO();
dto.setName(x.getName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment