| | |
| | | |
| | | /** |
| | | * 升版(升级工序版次),升级工序版本(包括程序和其他附件) |
| | | * @param id 程序文件id |
| | | * @param bindNcNodeId 程序文件绑定的节点id |
| | | * @param newProcessEdition 新版次 |
| | | */ |
| | | public void upgradeProcessEdition(long id,String newProcessEdition) { |
| | | NcProgram prog = this.getById(id); |
| | | public void upgradeProcessEdition(Long bindNcNodeId,String newProcessEdition) { |
| | | //NcProgram prog = this.getById(id); |
| | | NcProgram prog = getByBindNodeId(bindNcNodeId); |
| | | |
| | | //将现有程序更新为非最新版本 |
| | | this.update(Wrappers.lambdaUpdate(NcProgram.class).eq(NcProgram::getId,id).set(NcProgram::getIsLastEdition,0)); |
| | | this.update(Wrappers.lambdaUpdate(NcProgram.class).eq(NcProgram::getBindNcNodeId,bindNcNodeId).set(NcProgram::getIsLastEdition,0)); |
| | | |
| | | NcProgram newVerProg = new NcProgram(); |
| | | BeanUtils.copyProperties(prog, newVerProg); |
| | |
| | | wrapper.eq(NcProgram::getBindNcNodeId, bindNcNodeId); |
| | | wrapper.eq(NcProgram::getIsLastEdition,1); |
| | | NcProgram prog = this.getOne(wrapper); |
| | | String filePath = prog.getName(); |
| | | |
| | | String filePath = getFilePath(prog); |
| | | try(InputStream ins = ossTemplate.statFileStream(prog.getOssName());){ |
| | | File targetFile = new File(filePath); |
| | | FileUtils.copyInputStreamToFile(ins, targetFile); |