zhangqian
2023-09-14 5aeb61e49e9e518108fec4aeb6fdd460f21cdbfe
constvar/const.go
@@ -1,17 +1,17 @@
package constvar
type BaseJobType int
type BaseOperationType int
const (
   BaseJobTypeIncoming BaseJobType = iota + 1 //收货
   BaseJobTypeOutgoing                        //交货
   BaseJobTypeInternal                        //内部调拨
   BaseOperationTypeIncoming BaseOperationType = iota + 1 //收货
   BaseOperationTypeOutgoing                              //交货
   BaseOperationTypeInternal                              //内部调拨
)
func (slf BaseJobType) IsValid() bool {
   return slf == BaseJobTypeIncoming ||
      slf == BaseJobTypeOutgoing ||
      slf == BaseJobTypeInternal
func (slf BaseOperationType) IsValid() bool {
   return slf == BaseOperationTypeIncoming ||
      slf == BaseOperationTypeOutgoing ||
      slf == BaseOperationTypeInternal
}
type ReservationMethod int
@@ -41,3 +41,89 @@
      slf == WhetherTypeAlways ||
      slf == ReservationNever
}
// ProductType 产品类型
type ProductType int
const (
   ProductTypeRaw      = iota + 1 // 原材料
   ProductTypeSemi                // 半成品
   ProductTypeFinished            // 成品
)
type ProductStatus int
const (
   ProductStatusCreate   ProductStatus = iota // 新建
   ProductStatusActive                        // 启用
   ProductStatusInactive = -1                 // 停用
)
// PurchaseType 采购类型
type PurchaseType int
const (
   PurchaseTypeOutSource PurchaseType = iota + 1 // 采购
   PurchaseTypeSelf                              // 自制
   PurchaseTypeEntrust                           // 委外
)
func (t PurchaseType) Valid() bool {
   if t < PurchaseTypeOutSource ||
      t > PurchaseTypeEntrust {
      return false
   }
   return true
}
// LocationType 位置类型
type LocationType int
const (
   LocationTypeVendor        LocationType = iota + 1 // 供应商位置
   LocationTypeView                                  // 视图
   LocationTypeInternal                              // 内部位置
   LocationTypeCustomer                              // 客户位置
   LocationTypeInventoryLoss                         // 库存损失
   LocationTypeProduction                            // 生产
   LocationTypeTransit                               // 中转位置
)
func (t LocationType) Valid() bool {
   return t >= LocationTypeVendor && t <= LocationTypeTransit
}
type ForceRemovalStrategy int
const (
   ForceRemovalStrategyFIFO ForceRemovalStrategy = iota + 1
   ForceRemovalStrategyLIFO
   ForceRemovalStrategyClosestLocation
)
func (t ForceRemovalStrategy) Valid() bool {
   return t >= ForceRemovalStrategyFIFO && t <= ForceRemovalStrategyClosestLocation
}
type CostingMethod int
const (
   CostingMethodStandardPrice CostingMethod = iota + 1 //标准价格
   CostingMethodFIFO                                   //先进先出
   CostingMethodAverageCost                            //
)
func (t CostingMethod) Valid() bool {
   return t >= CostingMethodStandardPrice && t <= CostingMethodAverageCost
}
type InventoryValuation int
const (
   InventoryValuationManual InventoryValuation = iota + 1 //手动
   InventoryValuationAuto                                 //自动
)
func (t InventoryValuation) Valid() bool {
   return t >= InventoryValuationManual && t <= InventoryValuationAuto
}