| | |
| | | return this.getBaseMapper().getCuredNcProgram(drwaingNo,machine.getMachineGroupCode()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上传程序文件到指定节点 |
| | | * @param uploadVO 上传文件表单数据 |
| | | */ |
| | | public void uploadProgramFile(NcProgramUploadVO uploadVO) { |
| | | |
| | | MultipartFile file = uploadVO.getFile(); |
| | | BladeFile bfile = ossTemplate.putFile(uploadVO.getFile()); |
| | | String link = bfile.getLink(); |
| | | //保存profame |
| | | NcProgram prog = new NcProgram(); |
| | | prog.setCode(generageCode()); |
| | | prog.setName(file.getOriginalFilename()); |
| | | prog.setNcNodeId(uploadVO.getNodeId()); |
| | | prog.setOssName(bfile.getName()); |
| | | prog.setDrawingNo(uploadVO.getDrawingNo()); |
| | | prog.setProcessEdition(uploadVO.getProcessEdition()); |
| | | prog.setIsLastEdition(1); |
| | | boolean isTextFile = false; |
| | | try { |
| | | isTextFile = FileContentUtil.isTextFile(file.getInputStream()); |
| | | } catch (IOException e) { |
| | | log.warn("判断是否文本文件异常",e); |
| | | } |
| | | prog.setIsTextFile(isTextFile); |
| | | prog.setUrl(link); |
| | | prog.setCategory(uploadVO.getCategory()); |
| | | |
| | | this.save(prog); |
| | | } |
| | | |
| | | /** |
| | | * 上传程序文件到指定节点 |
| | | * @param uploadVO 上传文件表单数据 |