yangys
2025-09-20 675d66f1cbc7e92cc0fb4897664ee3a851072334
blade-service/blade-mdm/src/main/java/org/springblade/mdm/basesetting/machine/service/MachineService.java
@@ -355,14 +355,25 @@
      if(StringUtils.isBlank(sendPathLine)){
         return null;
      }
      //去掉首位括号,排除发那科机床注释
      String sendPath = escapeSqlWildcard(StringUtils.trim(StringUtils.removeEnd(StringUtils.removeStart(sendPathLine,"("),")")));
      //去掉末尾括号(发那科) ,末尾路径分隔符
      String tempPath = StringUtils.removeEnd(StringUtils.removeEnd(StringUtils.removeEnd(sendPathLine,")"),"/"),"\\");
      //去掉前2位可能的注释(*-)。
      String sendPath = escapeSqlWildcard(StringUtils.trim(StringUtils.substring(tempPath,2)));
      List<Machine> machines = lambdaQuery().eq(Machine::getStatus,Machine.STATUS_ENABLE).likeLeft(Machine::getProgSendDir,sendPath).list();
      List<Machine> machines = lambdaQuery().eq(Machine::getStatus,Machine.STATUS_ENABLE).like(Machine::getProgSendDir,sendPath).list();
      if(machines.isEmpty()){
         return null;
      }else{
         return machines.get(0);
      }
    }
   /**
    * 根据设备编号查询机床
    * @param equipmentCode 设备编号
    * @return 机床对象
    */
   public Machine getByEquipmentCode(String equipmentCode) {
      return this.lambdaQuery().eq(Machine::getEquipmentCode, equipmentCode).one();
   }
}