From 690dd891f8ee47b6036eb87c239275490ee02b7f Mon Sep 17 00:00:00 2001 From: wanjianli <1061428287@qq.com> Date: 星期一, 18 九月 2023 19:52:58 +0800 Subject: [PATCH] 出入库一部分代码 --- models/operation.go | 34 +++++++++++++++++++++------------- 1 files changed, 21 insertions(+), 13 deletions(-) diff --git a/models/operation.go b/models/operation.go index b1b3355..450bd27 100644 --- a/models/operation.go +++ b/models/operation.go @@ -4,6 +4,7 @@ "fmt" "gorm.io/gorm" "wms/constvar" + "wms/extend/util" "wms/pkg/mysqlx" ) @@ -11,19 +12,26 @@ // Operation 鎿嶄綔琛� Operation struct { WmsModel - Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` - Number string `json:"number" gorm:"column:number;type:varchar(255)"` //鍗曞彿 - SourceNumber string `json:"sourceNumber" gorm:"type:varchar(255)"` //婧愬崟鍙� - - BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"type:tinyint;not null;comment:鍩虹浣滀笟绫诲瀷"` //鍩虹浣滀笟绫诲瀷 - OperationTypeId int `json:"operationTypeId" gorm:"type:int;not null;comment:浣滀笟绫诲瀷id"` //浣滀笟绫诲瀷id - Status int `json:"status" gorm:"type:tinyint;not null;comment:鐘舵��"` //鐘舵�� - - FromLocationId int `json:"fromLocationId" gorm:"type:int;not null;comment:婧愪綅缃甶d"` //婧愪綅缃甶d - FromLocation Location `json:"fromLocation" gorm:"foreignKey:FromLocationId"` //婧愪綅缃� - ToLocationId int `json:"toLocationId" gorm:"type:int;not null;comment:鐩爣浣嶇疆id"` //鐩爣浣嶇疆id - ToLocation Location `json:"toLocation" gorm:"foreignKey:ToLocationId"` //鐩爣浣嶇疆 - + Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` + Number string `json:"number" gorm:"column:number;type:varchar(255)"` //鍗曞彿 + SourceNumber string `json:"sourceNumber" gorm:"type:varchar(255)"` //婧愬崟鍙� + OperationTypeId int `json:"operationTypeId" gorm:"type:int;not null;comment:浣滀笟绫诲瀷id"` //浣滀笟绫诲瀷id + Status constvar.OperationStatus `json:"status" gorm:"type:int(11);not null;comment:鐘舵��"` //鐘舵�� + FromLocationId int `json:"fromLocationId" gorm:"type:int;not null;comment:婧愪綅缃甶d"` //婧愪綅缃甶d + FromLocation Location `json:"fromLocation" gorm:"foreignKey:FromLocationId"` //婧愪綅缃� + ToLocationId int `json:"toLocationId" gorm:"type:int;not null;comment:鐩爣浣嶇疆id"` //鐩爣浣嶇疆id + ToLocation Location `json:"toLocation" gorm:"foreignKey:ToLocationId"` //鐩爣浣嶇疆 + OperationDate util.JSONTime `json:"operationDate" gorm:"comment:瀹夋帓鏃ユ湡"` + CarrierID int `json:"carrierID" gorm:"type:int;comment:鎵胯繍鍟咺D"` + CarrierName string `json:"carrierName" gorm:"type:varchar(63);comment:鎵胯繍鍟嗗悕绉�"` + Tracking string `json:"tracking" gorm:"type:varchar(127);comment:杩借釜鍙傝��"` + ContacterID int `json:"contacterID" gorm:"type:int;comment:鑱旂郴浜篒D"` + ContacterName string `json:"contacterName" gorm:"type:varchar(63);comment:鑱旂郴浜哄鍚�"` + Weight float64 `json:"weight" gorm:"type:decimal;comment:閲嶉噺(kg)"` + TransferWeight float64 `json:"transferWeight" gorm:"type:decimal;comment:鐗╂祦閲嶉噺(kg)"` + CompanyID int `json:"companyID" gorm:"type:int;comment:鍏徃ID"` + CompanyName string `json:"companyName" gorm:"type:varchar(127);comment:鍏徃鍚嶇О(kg)"` + Details []*OperationDetails `json:"details"` } OperationSearch struct { -- Gitblit v1.8.0