package org.springblade.mdm.program.entity;
|
|
import com.alibaba.excel.util.StringUtils;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
import lombok.Getter;
|
import lombok.Setter;
|
import org.springblade.core.mp.base.BizEntity;
|
import org.springblade.mdm.flow.entity.FlowProgramFile;
|
|
import java.util.Date;
|
|
|
@Setter
|
@Getter
|
@TableName("mdm_nc_node_his")
|
public class NcNodeHis extends BizEntity {
|
|
private String name;
|
private Long parentId;
|
|
/**
|
* 上级父id集合
|
*/
|
private String parentIds;
|
/**
|
* 设备编号
|
*/
|
private String machineCode;
|
/**
|
* 机床组字典吗
|
*/
|
private String machineGroupCode;
|
/**
|
* 工序,如“精铣”
|
*/
|
private String processName;
|
|
/**
|
* 工序版次
|
*/
|
private String processEdition;
|
|
/**
|
* 工艺版次
|
*/
|
private String craftEdition;
|
/**
|
* 是否最新版次,1:最新版次;0:历史版次
|
*/
|
private Integer isLastEdition = 1;
|
/**
|
* 零组件号/图号
|
*/
|
private String drawingNo;
|
/**
|
* 图号版次
|
*/
|
private String drawingNoEdition;
|
|
/**
|
* 是否固化
|
*/
|
private Integer isCured = 0;
|
/**
|
* 过期日期
|
*/
|
private Date expireDate;
|
/**
|
* 是否锁定
|
*/
|
private Integer isLocked = 0;
|
/**
|
* 节点类型:字典
|
*/
|
private String nodeType;
|
|
/**
|
* 程序文件节点的数据
|
*/
|
private String processNo;
|
/**
|
* 产品型号
|
*/
|
private String productModel;
|
/**
|
* 程序编号(程序包名节点需要)
|
*/
|
private String programNo;
|
/**
|
* 历史序列号
|
*/
|
private Long hisSerial;
|
/**
|
* 流程程序文件id,只有程序文件(70)类型的节点有此值
|
*/
|
private Long flowProgramFileId;
|
|
/**
|
* 审批时的流程实例id,只有程序包节点有这个字段值
|
*/
|
private String processInstanceId;
|
/**
|
* 偏离单号
|
*/
|
private String deviation;
|
/**
|
* 版本号,更新一次(入升版,dnc导入),就会+1
|
*/
|
private Integer versionNumber = 1;
|
|
transient FlowProgramFile flowProgramFile;
|
|
/**
|
* 是否是偏离程序
|
* @return 是否偏离
|
*/
|
public boolean isDeviationProgram(){
|
return StringUtils.isNotBlank(this.deviation);
|
}
|
|
/**
|
* 是否在有效期内
|
* @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;
|
}
|
|
|
/**
|
* 是否已锁定
|
* @return 是否
|
*/
|
public boolean hasLocked() {
|
return this.isLocked != null && this.isLocked == NcNode.LOCKED;
|
}
|
|
public String programName() {
|
return this.getDrawingNo()+"-"+this.getProcessNo()+"-"+this.getProcessEdition();
|
}
|
}
|