| | |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.mdm.basesetting.machine.vo.MachineQueryVO; |
| | | import org.springblade.mdm.basesetting.machine.vo.MachineVO; |
| | | import org.springblade.mdm.basesetting.producedivision.service.QinzheFgbService; |
| | | import org.springblade.mdm.flow.service.FlowProgramFileService; |
| | | import org.springblade.mdm.program.entity.NcNode; |
| | | import org.springblade.mdm.program.entity.NcProgram; |
| | |
| | | private final NcNodeService ncNodeService; |
| | | private final ProgramFlowStatusQueryService programFlowStatusQueryService; |
| | | private final FlowProgramFileService flowProgramFileService; |
| | | private final QinzheFgbService qinzheFgbService; |
| | | /** |
| | | * 新增 |
| | | */ |
| | |
| | | return R.<Boolean>status(true); |
| | | } |
| | | |
| | | @PostMapping("/lock") |
| | | @Operation(summary = "锁定节点(程序包名)") |
| | | public R<Boolean> lock(@Parameter(description="程序包名节点id)")Long id) { |
| | | ncNodeService.lock(id); |
| | | return R.<Boolean>status(true); |
| | | } |
| | | |
| | | @GetMapping("/lazy-list") |
| | | @Operation(summary = "懒加载列表", description = "程序目录树形结构") |
| | | public R<List<NcNodeVO>> lazyList(Long parentId) { |
| | | List<NcNodeVO> list = ncNodeService.lazyList(parentId); |
| | | if(list != null && !list.isEmpty()) { |
| | | for(NcNodeVO ncNodeVO : list) { |
| | | if(!NcNode.TYPE_PROGRAM_PACKAGE.equals(ncNodeVO.getNodeType())){ |
| | | break; |
| | | if(NcNode.TYPE_PROGRAM_PACKAGE.equals(ncNodeVO.getNodeType())){ |
| | | ncNodeVO.setFlowStatus(programFlowStatusQueryService.queryFlowStatus(ncNodeVO.getProcessInstanceId())); |
| | | } |
| | | ncNodeVO.setFlowStatus(programFlowStatusQueryService.queryFlowStatus(ncNodeVO.getProcessInstanceId())); |
| | | } |
| | | |
| | | } |
| | | return R.data(list); |
| | | } |
| | | |
| | | @GetMapping("/search-list") |
| | | @Operation(summary = "查询树状列表", description = "程序目录树形结构(查询专用)") |
| | | public R<List<NcNodeVO>> searchList(NcNodeQueryVO queryVO) { |
| | | public R<List<NcNodeVO>> searchList(NcNodeOldQueryVO queryVO) { |
| | | if(Func.isEmpty(queryVO.getName())){ |
| | | return R.fail("请输入名称"); |
| | | } |
| | | List<NcNodeVO> list = ncNodeService.searchList(queryVO); |
| | | /* |
| | | if(list != null && !list.isEmpty()) { |
| | | for(NcNodeVO ncNodeVO : list) { |
| | | if(!"70".equals(ncNodeVO.getNodeType())){ |
| | | break; |
| | | } |
| | | NcProgram program = ncProgramService.getByBindNodeId(ncNodeVO.getId()); |
| | | if(program != null) { |
| | | ncNodeVO.setProcessEdition(program.getProcessEdition()); |
| | | ncNodeVO.setDrawingNo(program.getDrawingNo()); |
| | | ncNodeVO.setMachineCode(program.getMachineCode()); |
| | | ncNodeVO.setProcessName(program.getProcessName()); |
| | | ncNodeVO.setVersionNumber(program.getVersionNumber()); |
| | | |
| | | //record中找不到时未启动0;找到了需要查询流程实例id,是否运行中 |
| | | ncNodeVO.setFlowStatus(programFlowStatusQueryService.queryFlowStatus(program.getId())); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | */ |
| | | return R.data(list); |
| | | } |
| | | @GetMapping("/search-list2") |
| | | @Operation(summary = "涉密网首页搜索", description = "搜索指定零组件号") |
| | | public R<List<NcNodeVO>> search(NcNodeQueryVO queryVO) { |
| | | if(Func.isEmpty(queryVO.getDrawingNo())){ |
| | | return R.fail("请输入零组件号"); |
| | | } |
| | | List<NcNodeVO> list = ncNodeService.searchList2(queryVO); |
| | | |
| | | return R.data(list); |
| | | } |
| | | |
| | | @GetMapping("/drawing-no-pick") |
| | | @Operation(summary = "首页搜索零组件下拉数据", description = "搜索指定零组件号") |
| | | public R<List<String>> drawingNoPick(String drawingNo) { |
| | | return R.data(qinzheFgbService.seletDropList(drawingNo)); |
| | | } |
| | | |
| | | @GetMapping("/history-by-nodeid") |
| | | @Operation(summary = "根据绑定节点id获取历史列表", description = "程序历史列表,仅‘程序包’字典值70的数据。用于显示程序的‘历史版本’") |