| | |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springblade.core.mp.base.BizEntity; |
| | | import org.springblade.mdm.flow.entity.FlowProgramFile; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | |
| | | @Setter |
| | | @Getter |
| | | @TableName("mdm_nc_node") |
| | | public class NcNode extends BizEntity { |
| | | /** |
| | | * 节点类型: 程序状态 10 |
| | | */ |
| | | public static final String TYPE_PROGRAM_STATUS = "10"; |
| | | /* |
| | | 产品型号 |
| | | */ |
| | | public static final String TYPE_PRODUCT_MODEL = "15"; |
| | | /** |
| | | * 节点类型: 零组件号/图号 10 |
| | | */ |
| | | public static final String TYPE_DRAWING_NO = "20"; |
| | | /** |
| | | * 工艺版次 |
| | | * |
| | | */ |
| | | public static final String TYPE_CRAFT_EDITION = "30"; |
| | | /** |
| | | * 工序号 |
| | | * |
| | | */ |
| | | public static final String TYPE_PROCESS_NO = "40"; |
| | | /** |
| | | * 工序版次 |
| | | */ |
| | | public static final String TYPE_PROCESS_EDITION = "45"; |
| | | /** |
| | | * 加工机床 |
| | | */ |
| | | public static final String TYPE_MACHINE_CODE = "50"; |
| | | /** |
| | | * 程序包名 |
| | | */ |
| | | public static final String TYPE_PROGRAM_PACKAGE = "60"; |
| | | |
| | | /** |
| | | * 程序文件 |
| | | */ |
| | | public static final String TYPE_PROGRAM_FILE = "70"; |
| | | |
| | | /** |
| | | * 文件节点文件类型:程序 |
| | | */ |
| | | public static final String FILE_CATEGOAY_PROGRAM = "program"; |
| | | /** |
| | | * 文件节点文件类型:其他 |
| | | */ |
| | | public static final String FILE_CATEGORY_OTHER = "other"; |
| | | /** |
| | | * 文件节点文件类型:子程序 |
| | | */ |
| | | public static final String FILE_CATEGORY_SUBPROGRAM = "subprogram"; |
| | | |
| | | private String name; |
| | | private Long parentId; |
| | | |
| | |
| | | */ |
| | | private String machineCode; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 文件类型,只有 |
| | | */ |
| | | //private String fileCategory; |
| | | /** |
| | | * 工序,如“精铣” |
| | | */ |
| | |
| | | /** |
| | | * 工序版次 |
| | | */ |
| | | //private String processEdition; |
| | | private String processEdition; |
| | | |
| | | /** |
| | | * 工艺版次 |
| | | */ |
| | | //private String craftEdition; |
| | | private String craftEdition; |
| | | /** |
| | | * 是否最新版次,1:最新版次;0:历史版次 |
| | | */ |
| | | private Integer isLastEdition = 1; |
| | | /** |
| | | * 零组件号/图号 |
| | | */ |
| | | private String partNo; |
| | | private String drawingNo; |
| | | /** |
| | | * 图号版次 |
| | | */ |
| | | //private String partNoEdition; |
| | | private String drawingNoEdition; |
| | | |
| | | /** |
| | | * 是否固化 |
| | | */ |
| | | private Integer isCured; |
| | | private Integer isCured = 0; |
| | | /** |
| | | * 过期日期 |
| | | */ |
| | | //private LocalDate expireDate; |
| | | private Date expireDate; |
| | | /** |
| | | * 是否锁定 |
| | | */ |
| | | //private Integer isLocked; |
| | | private Integer isLocked = 0; |
| | | /** |
| | | * 节点类型:字典 |
| | | */ |
| | |
| | | |
| | | private String description; |
| | | private String remark; |
| | | //0808新增 |
| | | /** |
| | | * 程序文件节点的数据 |
| | | */ |
| | | private String processNo; |
| | | /** |
| | | * 产品型号 |
| | | */ |
| | | private String productModel; |
| | | |
| | | /** |
| | | * 程序编号(程序包名节点需要) |
| | | */ |
| | | private String programNo; |
| | | |
| | | /** |
| | | * 流程程序文件id,只有程序文件(70)类型的节点有此值 |
| | | */ |
| | | private Long flowProgramFileId; |
| | | |
| | | /** |
| | | * 审批时的流程实例id,只有程序包节点有这个字段值 |
| | | */ |
| | | private String processInstanceId; |
| | | |
| | | /** |
| | | * 版本号,更新一次(入升版,dnc导入),就会+1 |
| | | */ |
| | | private Integer versionNumber = 1; |
| | | |
| | | transient FlowProgramFile flowProgramFile; |
| | | |
| | | /** |
| | | * 根据当前版本号,获取新增版本号 |
| | | * @return 升级后的版本号 |
| | | */ |
| | | public int genNewVersionNumber(){ |
| | | if(this.versionNumber == null){ |
| | | return 1; |
| | | }else{ |
| | | return this.versionNumber + 1; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 是否在有效期内 |
| | | * @return 是否 |
| | | */ |
| | | public boolean withinValidityPeriod() { |
| | | if(expireDate == null){ |
| | | return true; |
| | | } |
| | | return expireDate.getTime() > System.currentTimeMillis(); |
| | | } |
| | | |
| | | /** |
| | | * 是否已经固化 |
| | | * @return 是否 |
| | | */ |
| | | public boolean hasCured() { |
| | | return this.isCured != null && this.isCured == 1; |
| | | } |
| | | } |