package warehousesrv import ( "Cold_Logistic/internal/pkg/common/constant" "Cold_Logistic/internal/pkg/common/global" "Cold_Logistic/internal/server/infra/models" validation "github.com/go-ozzo/ozzo-validation/v4" "gogs.baozhida.cn/Cold_Logistic_libs/pkg/contrib/core" ) type WarehouseInfoRespVO struct { Name string `json:"name"` SnCode string `json:"snCode"` SnIds []global.SnIdVO `json:"snIds"` } type WarehouseOrderReqVO struct { Page core.Page `json:"page"` Search struct { OrderNo string `json:"orderNo"` TimeStart models.MyTime `json:"timeStart"` TimeEnd models.MyTime `json:"timeEnd"` } } type OrderIntoHouseReqVO struct { OrderId int `json:"orderId"` } func (r *OrderIntoHouseReqVO) Validate() error { return validation.ValidateStruct(r, validation.Field(&r.OrderId, validation.Required)) } type OrderIntoHouseRespVO struct { OrderId int `json:"orderId"` OrderNo string `json:"orderNo"` IntoTime models.MyTime `json:"intoTime"` } type OrderOutHouseReqVO struct { OrderId int `json:"orderId"` } func (r *OrderOutHouseReqVO) Validate() error { return validation.ValidateStruct(r, validation.Field(&r.OrderId, validation.Required)) } type OrderOutHouseRespVO struct { OrderId int `json:"orderId"` OrderNo string `json:"orderNo"` OutTime models.MyTime `json:"outTime"` } type WarehousePageReqVO struct { Page core.Page `json:"page"` Search struct { Name string `json:"name"` SnCode string `json:"snCode"` } } type WarehousePageVO struct { WarehouseId int `json:"warehouseId"` // Name string `json:"name"` //仓库名称 SnCode string `json:"snCode"` //sn编码 Address string `json:"address"` //地址 OrderCount int64 `json:"orderCount"` //订单数量 AccountList []WarehouseManageVO `json:"accountList"` // 仓管 } type WarehouseManageVO struct { AccountId int `json:"accountId"` AccountUuid string `json:"accountUuid"` AccountName string `json:"accountName"` } type AddWarehouseReqVO struct { Name string `json:"name"` //仓库名称 SnCode string `json:"snCode"` //sn编码 Address string `json:"address"` //地址 Manage []global.ClodAccount `json:"manage"` Enable int `json:"enable"` } func (r *AddWarehouseReqVO) Validate() error { return validation.ValidateStruct(r, validation.Field(&r.Name, validation.Required, validation.RuneLength(1, 50)), validation.Field(&r.SnCode, validation.Required, validation.RuneLength(1, 100)), validation.Field(&r.Address, validation.Required, validation.RuneLength(1, 200)), validation.Field(&r.Enable, validation.In(constant.YES, constant.NO)), ) } type WarehouseIdRespVO struct { WarehouseId int `json:"warehouseId"` } type UpdateWarehouseReqVO struct { WarehouseId int `json:"warehouseId"` AddWarehouseReqVO } func (r *UpdateWarehouseReqVO) Validate() error { return validation.ValidateStruct(r, validation.Field(&r.WarehouseId, validation.Required), validation.Field(&r.AddWarehouseReqVO), ) }