| | |
| | | public R<Boolean> upload(NcProgramUploadVO uploadVO) { |
| | | //@Parameter(description="文件") @RequestPart("file") MultipartFile file, @Parameter(description="所属节点ID")@RequestParam Long nodeId, |
| | | // @Parameter(description="文件分类,使用字典(node_file_type)") @RequestParam String category |
| | | ncProgramService.uploadProgramFile(uploadVO); |
| | | ncProgramService.uploadProgramFileNew(uploadVO); |
| | | return R.<Boolean>status(true); |
| | | } |
| | | |
| | |
| | | |
| | | @GetMapping("/content") |
| | | @Operation(summary = "获取文件内容", description = "仅限文本格式的内容,二进制文件将返回空串") |
| | | public R<String> fileContent(Long id) { |
| | | public R<String> fileContent(@Parameter(description = "程序文件id") Long id) { |
| | | try { |
| | | return R.data(ncProgramService.getFileContent(id)); |
| | | }catch(Exception e) { |
| | | log.error("删除文件失败",e); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | @GetMapping("/content-by-nodeid") |
| | | @Operation(summary = "根据节点获取文件内容", description = "仅限文本格式的内容,二进制文件将返回空串") |
| | | public R<String> fileContentByNodeId(@Parameter(description = "节点id") Long nodeId) { |
| | | try { |
| | | return R.data(ncProgramService.getFileContentByNodeId(nodeId)); |
| | | }catch(Exception e) { |
| | | log.error("删除文件失败",e); |
| | | return R.fail(e.getMessage()); |
| | |
| | | |
| | | @PostMapping("/upgrade-process-edition") |
| | | @Operation(summary = "升版", description = "升级工序版次") |
| | | public R<Boolean> upgradeProcessEdition(Long id,String newProcessEdition ) { |
| | | ncProgramService.upgradeProcessEdition(id,newProcessEdition); |
| | | public R<Boolean> upgradeProcessEdition(Long bindNcNodeId,String newProcessEdition ) { |
| | | ncProgramService.upgradeProcessEdition(bindNcNodeId,newProcessEdition); |
| | | return R.<Boolean>status(true); |
| | | } |
| | | |
| | |
| | | |
| | | return R.data(approveRecordService.listByNcProgramId(ncProgramId)); |
| | | } |
| | | |
| | | @PostMapping("/send") |
| | | @Operation(summary = "程序下发", description = "工控网数控程序下发(发送到机床配置的下发目录)") |
| | | public R<List<NcProgramVO>> send(@Parameter(description="所属节点ID")@RequestParam Long id) { |
| | | return null;//R.data(ncProcessProgRefService.listByProcess(processInstanceId)); |
| | | } |
| | | |
| | | @GetMapping("/send-to-machine-by-nodeid") |
| | | @Operation(summary = "下发", description = "下发给机床设定的目录") |
| | | public R<Void> sendToMachineByNodeId(@Parameter(description = "节点id") Long nodeId) { |
| | | try { |
| | | ncProgramService.sendByBindNodeId(nodeId); |
| | | return R.success(); |
| | | }catch(Exception e) { |
| | | log.error("删除文件失败",e); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | } |