package org.springblade.mdm.program.entity;
|
|
import com.baomidou.mybatisplus.annotation.TableName;
|
import lombok.Getter;
|
import lombok.Setter;
|
import org.springblade.core.mp.base.BizEntity;
|
|
import java.time.LocalDate;
|
import java.time.LocalDateTime;
|
|
@Setter
|
@Getter
|
@TableName("mdm_nc_program")
|
public class NcProgram extends BizEntity {
|
/**
|
* 文件名
|
*/
|
private String name;
|
/**
|
* 对象存储中的名称
|
*/
|
private String ossName;
|
private String code;
|
/**
|
* 所属节点id,必须未“程序包名"的节点
|
*/
|
private long ncNodeId;
|
/**
|
* 同名绑定节点id
|
*/
|
private Long bindNcNodeId;
|
/**
|
* 文件地址
|
*/
|
private String url;
|
/**
|
* 文件类型
|
*/
|
private String category;
|
|
/**
|
* 是否为文本类型
|
*/
|
private Boolean isTextFile;
|
|
/**
|
* 工序,如“精铣”
|
*/
|
//private String processName;
|
/**
|
* 备注
|
*/
|
//private String remark;
|
/**
|
* 设备(机床)编码
|
*/
|
private String machineCode;
|
/**
|
* 零组件号/图号
|
*/
|
private String partNo;
|
|
/**
|
* 描述
|
*/
|
private String description;
|
/**
|
* 是否固化
|
*/
|
private Integer isCured;
|
/**
|
* 过期日期
|
*/
|
//private LocalDate expireDate;
|
/**
|
* 工序版次
|
*/
|
private String processEdition;
|
/**
|
* 是否最新版次,1:最新版次;0:历史版次
|
*/
|
private Integer isLastEdition = 1;
|
/**
|
* 是否锁定
|
*/
|
private Integer isLocked = 0;
|
/**
|
* 是否测试程序
|
*/
|
private Integer isTest = 0;
|
/**
|
* 任务分派时间
|
*/
|
private LocalDateTime taskAssignTime;
|
|
/**
|
* 是否在有效期内
|
* @param effectiveMonths 有效时长(月数),在系统参数中配置
|
* @return
|
*/
|
public boolean withinValidity(int effectiveMonths){
|
//有效期按照什么时间计算推算?暂时按照任务分配时间, 任务分配时间 + 有效月份 < 当前时间为有效
|
if(taskAssignTime == null ){
|
return false;
|
}
|
//
|
return taskAssignTime.plusMonths(effectiveMonths).isBefore(LocalDateTime.now());
|
}
|
|
|
}
|