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 code;
|
/**
|
* 程序包名
|
*/
|
private String packageName;
|
/**
|
* 设备(机床)编码
|
*/
|
private String machineCode;
|
/**
|
* 零组件号
|
*/
|
private String partNo;
|
|
/**
|
* 是否固化
|
*/
|
private Integer isCured;
|
/**
|
* 过期日期
|
*/
|
private LocalDate expireDate;
|
/**
|
* 工序版次
|
*/
|
private String processEdition;
|
/**
|
* 是否最新版次,1:最新版次;0:历史版次
|
*/
|
private Integer isLastEdition;
|
/**
|
* 是否锁定
|
*/
|
private Integer isLocked;
|
/**
|
* 任务分派时间
|
*/
|
private LocalDateTime taskAssignTime;
|
|
/**
|
* 是否在有效期内
|
* @param effectiveMonths 有效时长(月数),在系统参数中配置
|
* @return
|
*/
|
public boolean withinValidity(int effectiveMonths){
|
//有效期按照什么时间计算推算?暂时按照任务分配时间, 任务分配时间 + 有效月份 < 当前时间为有效
|
if(taskAssignTime == null ){
|
return false;
|
}
|
//
|
return taskAssignTime.plusMonths(effectiveMonths).isBefore(LocalDateTime.now());
|
}
|
}
|