zhangqian
2023-09-12 ccc4c924d81c3f8201e7a6c783a9a7148b21670d
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
package constvar
 
type BaseJobType int
 
const (
    BaseJobTypeIncoming BaseJobType = iota + 1 //收货
    BaseJobTypeOutgoing                        //交货
    BaseJobTypeInternal                        //内部调拨
)
 
func (slf BaseJobType) IsValid() bool {
    return slf == BaseJobTypeIncoming ||
        slf == BaseJobTypeOutgoing ||
        slf == BaseJobTypeInternal
}
 
type ReservationMethod int
 
const (
    ReservationMethodAtConfirm ReservationMethod = iota + 1 //在确认时
    ReservationMethodManual                                 //手动
    ReservationMethodByDate                                 //在预定日期之前
)
 
func (slf ReservationMethod) IsValid() bool {
    return slf == ReservationMethodAtConfirm ||
        slf == ReservationMethodManual ||
        slf == ReservationMethodByDate
}
 
type WhetherType int
 
const (
    WhetherTypeAsk    WhetherType = iota + 1 //询问
    WhetherTypeAlways                        //总是
    ReservationNever                         //从不
)
 
func (slf WhetherType) IsValid() bool {
    return slf == WhetherTypeAsk ||
        slf == WhetherTypeAlways ||
        slf == ReservationNever
}