From 137441e2396cf231f9d41e5c399038dbfe01433f Mon Sep 17 00:00:00 2001
From: yinbentan <yinbentan@live.com>
Date: 星期二, 16 七月 2024 20:24:55 +0800
Subject: [PATCH] 添加字段,库存报表统计返回结果添加productType(产品类别)、productSpecs(产品规格),产品类别由原来的productType改为productCategory

---
 request/operation.go |  146 +++++++++++++++++++++++++++++++++++-------------
 1 files changed, 105 insertions(+), 41 deletions(-)

diff --git a/request/operation.go b/request/operation.go
index 3df3d69..f01efd0 100644
--- a/request/operation.go
+++ b/request/operation.go
@@ -6,55 +6,119 @@
 )
 
 type AddOperation struct {
-	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
-	ToLocationId    int                      `json:"toLocationId"    gorm:"type:int;not null;comment:鐩爣浣嶇疆id"` //鐩爣浣嶇疆id
-	OperationDate   string                   `json:"operationDate" gorm:"type:varchar(31);comment:瀹夋帓鏃ユ湡"`
-	Details         []*OperationDetails      `json:"details"`
-	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          decimal.Decimal          `json:"weight" gorm:"type:decimal(20,2);comment:閲嶉噺(kg)"`
-	TransferWeight  decimal.Decimal          `json:"transferWeight" gorm:"type:decimal(20,2);comment:鐗╂祦閲嶉噺(kg)"`
-	CompanyID       int                      `json:"companyID" gorm:"type:int;comment:鍏徃ID"`
-	CompanyName     string                   `json:"companyName" gorm:"type:varchar(127);comment:鍏徃鍚嶇О(kg)"`
+	ID                int                      `json:"id" `
+	Number            string                   `json:"number" `            //鍗曞彿
+	SourceNumber      string                   `json:"sourceNumber" `      //婧愬崟鍙�
+	OperationTypeId   int                      `json:"operationTypeId" `   //浣滀笟绫诲瀷id
+	OperationTypeName string                   `json:"operationTypeName" ` //浣滀笟绫诲瀷鍚嶇О
+	Status            constvar.OperationStatus `json:"status" `            //鐘舵��
+	//FromLocationId    int                      `json:"fromLocationId" `   //婧愪綅缃甶d
+	//ToLocationId      int                      `json:"toLocationId" `   //鐩爣浣嶇疆id
+	OperationDate     string                     `json:"operationDate" `     //瀹夋帓鏃ユ湡
+	Details           []*OperationDetails        `json:"details"`            // 璇︽儏
+	ContacterID       int                        `json:"contacterID" `       //鑱旂郴浜篒D-闈炲繀濉�
+	ContacterName     string                     `json:"contacterName" `     //鑱旂郴浜哄鍚�-闈炲繀濉�
+	CompanyID         string                     `json:"companyID"`          //鍏徃ID-瀹㈡埛
+	CompanyName       string                     `json:"companyName" `       //鍏徃鍚嶇О-瀹㈡埛鍚嶇О
+	Comment           string                     `json:"comment" `           //澶囨敞
+	LogisticCompanyId string                     `json:"logisticCompanyId" ` // 鐗╂祦鍏徃id
+	WaybillNumber     string                     `json:"waybillNumber" `     //杩愬崟鍙�
+	Weight            decimal.Decimal            `json:"weight"`             //閲嶉噺
+	LogisticWeight    decimal.Decimal            `json:"logisticWeight"`     //鐗╂祦閲嶉噺
+	ReceiverName      string                     `json:"receiverName" `      // 鏀惰揣浜哄鍚�
+	ReceiverPhone     string                     `json:"receiverPhone" `     // 鑱旂郴鐢佃瘽
+	ReceiverAddr      string                     `json:"receiverAddr" `      // 鏀惰揣鍦板潃
+	LocationId        int                        `json:"locationId" `        //婧愪綅缃甶d
+	ToLocationId      int                        `json:"toLocationId" `      //鐩爣浣嶇疆id
+	ManagerId         string                     `json:"managerId" `         // 涓荤id
+	Manager           string                     `json:"manager" `           // 涓荤鍚嶇О
+	AccountantId      string                     `json:"accountantId" `      // 浼氳id
+	Accountant        string                     `json:"accountant" `        // 浼氳鍚嶇О
+	CustodianId       string                     `json:"custodianId" `       // 淇濈鍛榠d
+	Custodian         string                     `json:"custodian" `         // 淇濈鍛樺悕绉�
+	BaseOperationType constvar.BaseOperationType `json:"baseOperationType" ` //鍩虹浣滀笟绫诲瀷 1 鍏ュ簱 2 鍑哄簱 3 鍐呴儴璋冩嫧 4 鎶ュ簾 5 搴撳瓨鐩樼偣
+	WarehouseId       int                        `json:"warehouseId" `       //浠撳簱id
+	DealerType        string                     `json:"dealerType" `        // 璋冩嫧鍑哄叆搴撶被鍨�
+	SilkMarket        string                     `json:"silkMarket"`         // 搴勫彛
 }
 
 type OperationDetails struct {
-	ProductId      int             `json:"productId" gorm:"type:int;not null;comment:浜у搧id"`              //浜у搧id
-	ProductName    string          `json:"productName" gorm:"type:varchar(255);not null;comment:浜у搧鍚嶇О"`   //浜у搧鍚嶇О
-	Quantity       decimal.Decimal `json:"quantity" gorm:"type:decimal(20,2);not null;comment:鏁伴噺"`       //鏁伴噺
-	FinishQuantity decimal.Decimal `json:"finishQuantity" gorm:"type:decimal(20,2);not null;comment:鏁伴噺"` //瀹屾垚鏁伴噺
+	OperationId int    `json:"OperationId" ` //鎿嶄綔id
+	ProductId   string `json:"productId" `   //浜у搧id
+	//ProductName string          `json:"productName" ` //浜у搧鍚嶇О
+	Amount      decimal.Decimal `json:"amount" `     //鏁伴噺
+	StockAmount decimal.Decimal `json:"stockAmount"` //搴撳瓨鏁伴噺锛岀洏鐐规椂鐢�
+	//Unit        string          `json:"unit"`                    //鍗曚綅
+	//Product models.Material `json:"product" ` // 浜у搧
+	FromLocationId   int             `json:"fromLocationId"`   //婧愪綅缃甶d
+	ToLocationId     int             `json:"toLocationId"`     //鐩爣浣嶇疆id
+	TotalGrossWeight decimal.Decimal `json:"totalGrossWeight"` //鎬绘瘺閲�
+	TotalNetWeight   decimal.Decimal `json:"totalNetWeight"`   //鎬诲噣閲�
+	AuxiliaryAmount  decimal.Decimal `json:"auxiliaryAmount"`  //杈呭姪鏁伴噺
+	AuxiliaryUnit    string          `json:"auxiliaryUnit"`    //杈呭姪鍗曚綅
+	Remark           string          `json:"remark"`           // 澶囨敞
+
+	Cost            decimal.Decimal `json:"cost"`            //鎴愭湰鍗曚环
+	SalePrice       decimal.Decimal `json:"salePrice"`       //閿�鍞崟浠�
+	SilkMarket      string          `json:"silkMarket"`      // 搴勫彛
+	SilkMarketClose string          `json:"silkMarketClose"` // 搴勫彛鍏抽棴
 }
 
 type OperationList struct {
 	PageInfo
-	OperationTypeId int `json:"operationTypeId" form:"operationTypeId"`
+	OperationTypeId   int                        `json:"operationTypeId" form:"operationTypeId"` // 浣滀笟绫诲瀷id
+	BaseOperationType constvar.BaseOperationType `json:"baseOperationType"`                      //鍩虹浣滀笟绫诲瀷 1 鍏ュ簱 2 鍑哄簱 3 鍐呴儴璋冩嫧 4 鎶ュ簾 5 搴撳瓨鐩樼偣
+	Number            string                     `json:"number"`                                 // 鍗曞彿
+	Status            constvar.OperationStatus   `json:"status"`                                 // 鐘舵��
 }
 
 type UpdateOperation struct {
-	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
-	ToLocationId    int                      `json:"toLocationId"    gorm:"type:int;not null;comment:鐩爣浣嶇疆id"` //鐩爣浣嶇疆id
-	OperationDate   string                   `json:"operationDate" gorm:"type:varchar(31);comment:瀹夋帓鏃ユ湡"`
-	Details         []*OperationDetails      `json:"details"`
-	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          decimal.Decimal          `json:"weight" gorm:"type:decimal(20,2);comment:閲嶉噺(kg)"`
-	TransferWeight  decimal.Decimal          `json:"transferWeight" gorm:"type:decimal(20,2);comment:鐗╂祦閲嶉噺(kg)"`
-	CompanyID       int                      `json:"companyID" gorm:"type:int;comment:鍏徃ID"`
-	CompanyName     string                   `json:"companyName" gorm:"type:varchar(127);comment:鍏徃鍚嶇О(kg)"`
+	ID                int                      `json:"id"`
+	Number            string                   `json:"number" `            //鍗曞彿
+	SourceNumber      string                   `json:"sourceNumber" `      //婧愬崟鍙�
+	OperationTypeId   int                      `json:"operationTypeId" `   //浣滀笟绫诲瀷id
+	OperationTypeName string                   `json:"operationTypeName" ` //浣滀笟绫诲瀷鍚嶇О
+	Status            constvar.OperationStatus `json:"status" `            //鐘舵��
+	//FromLocationId    int                        `json:"fromLocationId"  `   //婧愪綅缃甶d
+	//ToLocationId      int                        `json:"toLocationId" `   //鐩爣浣嶇疆id
+	OperationDate       string                     `json:"operationDate" `    //瀹夋帓鏃ユ湡
+	Details             []*OperationDetails        `json:"details"`           // 璇︽儏
+	ContacterID         int                        `json:"contacterID" `      //鑱旂郴浜篒D-闈炲繀濉�
+	ContacterName       string                     `json:"contacterName"`     //鑱旂郴浜哄鍚�-闈炲繀濉�
+	CompanyID           string                     `json:"companyID"`         //鍏徃ID-瀹㈡埛
+	CompanyName         string                     `json:"companyName" `      //鍏徃鍚嶇О-瀹㈡埛鍚嶇О
+	Comment             string                     `json:"comment"`           //澶囨敞
+	BaseOperationType   constvar.BaseOperationType `json:"baseOperationType"` //鍩虹浣滀笟绫诲瀷
+	LogisticCompanyId   string                     `json:"logisticCompanyId" `
+	WaybillNumber       string                     `json:"waybillNumber" `       //杩愬崟鍙�
+	Weight              decimal.Decimal            `json:"weight"`               //閲嶉噺
+	LogisticWeight      decimal.Decimal            `json:"logisticWeight"`       //鐗╂祦閲嶉噺
+	ReceiverName        string                     `json:"receiverName" `        // 鏀惰揣浜哄鍚�
+	ReceiverPhone       string                     `json:"receiverPhone" `       // 鑱旂郴鐢佃瘽
+	ReceiverAddr        string                     `json:"receiverAddr" `        // 鏀惰揣鍦板潃
+	LocationId          int                        `json:"locationId" `          //婧愪綅缃甶d
+	ToLocationId        int                        `json:"toLocationId"  `       //鐩爣浣嶇疆id
+	ManagerId           string                     `json:"managerId" `           // 涓荤id
+	Manager             string                     `json:"manager" `             // 涓荤鍚嶇О
+	AccountantId        string                     `json:"accountantId" `        // 浼氳id
+	Accountant          string                     `json:"accountant" `          // 浼氳鍚嶇О
+	CustodianId         string                     `json:"custodianId" `         // 淇濈鍛榠d
+	Custodian           string                     `json:"custodian" `           // 淇濈鍛樺悕绉�
+	WarehouseId         int                        `json:"warehouseId" `         //浠撳簱id
+	InventoryDealerType int                        `json:"inventoryDealerType" ` // 璋冩嫧鍑哄叆搴撳垎绫�(瀵瑰簲dict瀛楀吀琛ㄧ殑ID)
+	SilkMarket          string                     `json:"silkMarket"`           // 搴勫彛
+}
+
+type OperationAllList struct {
+	PageInfo
+	Number       string `json:"number"`       // 鍗曞彿
+	SourceNumber string `json:"sourceNumber"` // 婧愬崟鍙�
+}
+
+type OperationCondition struct {
+	PageInfo
+	Condition   string `json:"condition"`                      // 妯$硦鏌ヨ鏉′欢
+	Keyword     string `json:"keyword" form:"keyword"`         //鍏抽敭瀛楁悳绱�
+	WarehouseId int    `json:"warehouseId" form:"warehouseId"` //浠撳簱ID
+	LocationId  int    `json:"locationId" form:"locationId"`   //浣嶇疆ID
 }

--
Gitblit v1.8.0