zhangqian
2023-09-12 61f1ad8d1fe79ada641a650609d275e2a5d0e0fb
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 BaseOperationType int
 
const (
    BaseOperationTypeIncoming BaseOperationType = iota + 1 //收货
    BaseOperationTypeOutgoing                              //交货
    BaseOperationTypeInternal                              //内部调拨
)
 
func (slf BaseOperationType) IsValid() bool {
    return slf == BaseOperationTypeIncoming ||
        slf == BaseOperationTypeOutgoing ||
        slf == BaseOperationTypeInternal
}
 
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
}