yangys
2025-07-10 806d2ed9cb284aae1df7a723e34117b82afdf365
blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/service/NcProgramService.java
@@ -244,15 +244,15 @@
   /**
    * 升版(升级工序版次),升级工序版本(包括程序和其他附件)
    * @param bindNodeid 程序文件绑定的节点id
    * @param bindNcNodeId 程序文件绑定的节点id
    * @param newProcessEdition 新版次
    */
   public void upgradeProcessEdition(long bindNcNodeid,String newProcessEdition) {
   public void upgradeProcessEdition(Long bindNcNodeId,String newProcessEdition) {
      //NcProgram prog = this.getById(id);
      NcProgram prog = getByBindNodeId(bindNcNodeid);
      NcProgram prog = getByBindNodeId(bindNcNodeId);
      //将现有程序更新为非最新版本
      this.update(Wrappers.lambdaUpdate(NcProgram.class).eq(NcProgram::getBindNcNodeId,bindNcNodeid).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);
@@ -282,7 +282,8 @@
      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);