zhangqian
2023-09-12 ccc4c924d81c3f8201e7a6c783a9a7148b21670d
constvar/const.go
@@ -1 +1,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
}