ShiftRuleModel.java
1.78 KB
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
69
70
71
72
73
74
75
76
77
package com.pipihelper.project.rostering.model;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* 班次规则
* @description:
* @author: zsw
* @create: 2022-10-14 16:52
**/
@Data
public class ShiftRuleModel {
/**
* 班次名称
*/
private String name;
/**
* 每天每班次出现的人数
*/
private Integer everyDay;
/**
* 班次前允许
*/
private List<String> frontAllow;
/**
* 班次前不允许
*/
private List<String> frontDenied;
/**
* 班次后允许
*/
private List<String> backAllow;
/**
* 班次后不允许
*/
private List<String> backDenied;
/**
* 班次最大连续次数
*/
private Integer maxContinuity;
/**
* 班次最大次数后指定班次
*/
private String maxContinuityFollow;
//{"backAllow":["早班"],"backDenied":["晚班"],"everyDay":5,"frontAllow":["早班"],"frontDenied":["晚班"],"maxContinuity":5,"maxContinuityFollow":"休息","name":"早班"}
public static void main(String[] args) {
ShiftRuleModel shiftRuleModel = new ShiftRuleModel();
shiftRuleModel.setName("早班");
shiftRuleModel.setEveryDay(5);
shiftRuleModel.setFrontAllow(Lists.newArrayList("早班"));
shiftRuleModel.setFrontDenied(Lists.newArrayList("晚班"));
shiftRuleModel.setBackAllow(Lists.newArrayList("早班"));
shiftRuleModel.setBackDenied(Lists.newArrayList("晚班"));
shiftRuleModel.setMaxContinuity(5);
shiftRuleModel.setMaxContinuityFollow("休息");
String s = JSONObject.toJSONString(shiftRuleModel);
System.out.println(s);
}
}