yangys
2025-06-16 bba9d9bd7bbebbdfda231c2edb1d339cec54cd03
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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());
    }
}