yangys
2025-09-19 b0d0191a88912b352385349461b500a4964d693b
blade-service/blade-mdm/src/main/java/org/springblade/mdm/machinefile/entity/MachineFile.java
@@ -61,6 +61,28 @@
    * temp目录
    */
   public static final String DIR_TYPE_TEMP = "TEMP";
   /**
    * 文件异常类型:正常
    */
   public static final int EXCEPTION_OK = 0;
   /**
    * 文件异常类型:非文本文件
    */
   public static final int EXCEPTION_NOT_TEXT = 1;
   /**
    * 文件异常类型:文件名格式不合法
    */
   public static final int EXCEPTION_BAD_FILENAME = 2;
   /**
    * 文件异常类型:文件确失(段数不够)
    */
   public static final int EXCEPTION_LOST_FILES = 3;
   /**
    * 文件异常类型:文件段数与下发记录不匹配(车床/现场编制除外)
    */
   public static final int EXCEPTION_NOT_MATCH_SEND = 3;
   /**
    * 文件名
@@ -106,6 +128,13 @@
    * 程序状态(1试切;2固化;3偏离;4未知)
    */
   private Integer programStatus;
   /**
    * REC目录文件异常类型(0/null:正常; 1非文本格式;2:文件名格式不合法;3:文件确失(段数不够);4:文件段数与下发记录不匹配(车床/现场编制除外)
    */
   private Integer exceptionType;
   /**
    * 生成文件大小的显示文本
    * @return 显示文本
@@ -133,4 +162,21 @@
      setStatus(STATUS_REJECTED);
      this.determineTime = new Date();
   }
   /**
    * 异常详细描述
    * @return 描述文本
    */
   public String getExceptionMsg(){
      if(exceptionType == null){
         return "正常";
      }
      return switch (exceptionType) {
         case 1 -> "非文本";
         case 2 -> "文件名格式错误";
         case 3 -> "文件确失";
         case 4 -> "段数与下发记录不匹配";
         default -> "正常";
      };
   }
}