yangys
2025-07-10 c9d8a42aedf6462611d38a40d34e6c2c5ebfabb2
blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/service/NcProgramService.java
@@ -244,13 +244,15 @@
   /**
    * 升版(升级工序版次),升级工序版本(包括程序和其他附件)
    * @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);