From 1e1eff926a1a331f29b225a41343fd9ecb01fe66 Mon Sep 17 00:00:00 2001
From: yinbentan <yinbentan@live.com>
Date: 星期二, 16 七月 2024 20:19:50 +0800
Subject: [PATCH] 添加字段,嘉联仓储添加 SilkMarket(庄口)、SilkMarketClose(庄口是否关闭)字段
---
controllers/operation.go | 19 ++-
models/location_product_amount.go | 17 +-
models/operation.go | 85 +++++++------
request/operation.go | 182 +++++++++++++++--------------
models/operation_details.go | 29 ++--
controllers/location_product_amount.go | 9 +
6 files changed, 180 insertions(+), 161 deletions(-)
diff --git a/controllers/location_product_amount.go b/controllers/location_product_amount.go
index abd668c..12807dd 100644
--- a/controllers/location_product_amount.go
+++ b/controllers/location_product_amount.go
@@ -207,6 +207,7 @@
// @Tags 搴撳瓨鐩樼偣
// @Summary 娣诲姞搴撳瓨鐩樼偣淇℃伅
// @Produce application/json
+// @Param Authorization header string true "token"
// @Param object body request.UpdateLocationProductAmount true "鍏ュ簱/鍑哄簱淇℃伅"
// @Success 200 {object} util.Response "鎴愬姛"
// @Router /api-wms/v1/locationProductAmount/add [post]
@@ -332,6 +333,7 @@
// @Tags 搴撳瓨鐩樼偣
// @Summary 淇敼搴撳瓨鐩樼偣淇℃伅
// @Produce application/json
+// @Param Authorization header string true "token"
// @Param object body request.UpdateLocationProductAmount true "鍏ュ簱/鍑哄簱淇℃伅"
// @Success 200 {object} util.Response "鎴愬姛"
// @Router /api-wms/v1/locationProductAmount/update [post]
@@ -370,12 +372,13 @@
// Finish
//
-// @Tags 搴撳瓨鐩樼偣
+// @Tags 搴撳瓨鐩樼偣
// @Summary 搴旂敤銆侀獙璇�
// @Produce application/json
-// @Param object body request.FinishLocationProductAmount true "鍏ュ弬"
+// @Param Authorization header string true "token"
+// @Param object body request.FinishLocationProductAmount true "鍏ュ弬"
// @Success 200 {object} util.Response "鎴愬姛"
-// @Router /api-wms/v1/locationProductAmount/finish [post]
+// @Router /api-wms/v1/locationProductAmount/finish [post]
func (slf LocationProductAmountController) Finish(c *gin.Context) {
var reqParams request.FinishLocationProductAmount
if err := c.BindJSON(&reqParams); err != nil {
diff --git a/controllers/operation.go b/controllers/operation.go
index 0cb7a5f..ae06b4b 100644
--- a/controllers/operation.go
+++ b/controllers/operation.go
@@ -41,6 +41,7 @@
// @Tags 鍏ュ簱/鍑哄簱
// @Summary 娣诲姞鍏ュ簱/鍑哄簱
// @Produce application/json
+// @Param Authorization header string true "token"
// @Param object body request.AddOperation true "鍏ュ簱/鍑哄簱淇℃伅"
// @Success 200 {object} util.Response "鎴愬姛"
// @Router /api-wms/v1/operation/operation [post]
@@ -146,6 +147,7 @@
util.ResponseFormat(c, code.Success, "娣诲姞鎴愬姛")
}
+// CheckInventoryDealerType 妫�鏌ュ熀纭�绫诲瀷锛岄槻姝㈢被鍨嬩负绌烘坊鍔犲叾瀹冪被鍨�
func CheckInventoryDealerType(params *models.Operation) {
var dictType constvar.MiniDictType
dictName := "鍏朵粬"
@@ -331,6 +333,7 @@
// @Tags 鍏ュ簱/鍑哄簱
// @Summary 鍏ュ簱/鍑哄簱鍒楄〃
// @Produce application/json
+// @Param Authorization header string true "token"
// @Param object body request.OperationList true "鏌ヨ鍙傛暟"
// @Success 200 {object} util.ResponseList{data=[]models.Operation} "鎴愬姛"
// @Router /api-wms/v1/operation/list [post]
@@ -485,6 +488,7 @@
// @Tags 鍏ュ簱/鍑哄簱
// @Summary 鍒犻櫎鍏ュ簱/鍑哄簱淇℃伅
// @Produce application/json
+// @Param Authorization header string true "token"
// @Param id path int true "id"
// @Success 200 {object} util.Response "鎴愬姛"
// @Router /api-wms/v1/operation/operation/{id} [delete]
@@ -532,9 +536,10 @@
// @Tags 鍏ュ簱/鍑哄簱
// @Summary 鏇存敼璁板綍鐘舵��
// @Produce application/json
-// @Param id path int true "id"
+// @Param Authorization header string true "token"
+// @Param id path int true "id"
// @Success 200 {object} util.Response "鎴愬姛"
-// @Router /api-wms/v1/operation/finish/{id} [put]
+// @Router /api-wms/v1/operation/finish/{id} [put]
func (slf OperationController) Finish(c *gin.Context) {
id, err := strconv.Atoi(c.Param("id"))
if err != nil {
@@ -585,25 +590,26 @@
return err
}
- if operation.BaseOperationType == constvar.BaseOperationTypeIncoming {
+ if operation.BaseOperationType == constvar.BaseOperationTypeIncoming { // 鍏ュ簱
if err := service.FinishOperationInput(c, tx, operation, listDetails, mapLocAmount); err != nil {
return err
}
}
- if operation.BaseOperationType == constvar.BaseOperationTypeOutgoing || operation.BaseOperationType == constvar.BaseOperationTypeDisuse {
+ if operation.BaseOperationType == constvar.BaseOperationTypeOutgoing || // 鍑哄簱
+ operation.BaseOperationType == constvar.BaseOperationTypeDisuse { // 鎶ュ簾
if err := service.FinishOperationOutput(tx, listDetails, mapLocAmount, operation); err != nil {
return err
}
}
- if operation.BaseOperationType == constvar.BaseOperationTypeInternal {
+ if operation.BaseOperationType == constvar.BaseOperationTypeInternal { // 鍐呴儴璋冩嫧
if err := service.FinishOperationInternal(tx, listDetails, operation); err != nil {
return err
}
}
- if operation.BaseOperationType == constvar.BaseOperationTypeAdjust {
+ if operation.BaseOperationType == constvar.BaseOperationTypeAdjust { // 搴撳瓨鐩樼偣
if err := service.FinishOperationAdjust(tx, listDetails, mapLocAmount, operation); err != nil {
return err
}
@@ -626,7 +632,6 @@
go UpdateOutStatus(operation.Source, operation.SourceNumber, 4)
}
}
-
util.ResponseFormat(c, code.Success, "鎿嶄綔鎴愬姛")
}
diff --git a/models/location_product_amount.go b/models/location_product_amount.go
index 6b82f7c..2c59969 100644
--- a/models/location_product_amount.go
+++ b/models/location_product_amount.go
@@ -9,11 +9,12 @@
)
type (
+ // LocationProductAmount 搴撳瓨浜у搧鏁伴噺
LocationProductAmount struct {
WmsModel
Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
- LocationId int `json:"locationId" gorm:"type:int;not null;comment:浣嶇疆id"` //浣嶇疆id
- WarehouseId int `json:"warehouseId" gorm:"type:int;not null;default:0;comment:浠撳簱id"`
+ LocationId int `json:"locationId" gorm:"type:int;not null;comment:浣嶇疆id"` //浣嶇疆id
+ WarehouseId int `json:"warehouseId" gorm:"type:int;not null;default:0;comment:浠撳簱id"` // 浠撳簱id
Location Location `json:"location" gorm:"foreignKey:LocationId;references:id"`
ProductCategoryID int `json:"productCategoryId" gorm:"type:int;not null;comment:浜у搧绉嶇被id"` //浜у搧绉嶇被id
ProductCategory ProductCategory `json:"productCategory" gorm:"foreignKey:ProductCategoryID;references:Id"`
@@ -48,14 +49,14 @@
ProductName string `json:"productName" gorm:"column:product_name"`
Amount decimal.Decimal `json:"amount" gorm:"column:amount"`
AmountMoreUnits []UnitItems `json:"amountMoreUnits" gorm:"-"` //鍦ㄥ簱鏁伴噺澶氬崟浣�
- Unit string `json:"unit" gorm:"column:unit"`
- CreateDate string `json:"createDate" gorm:"column:create_date"`
+ Unit string `json:"unit" gorm:"column:unit;size:50;comment:鐗╁搧鍗曚綅"`
+ CreateDate string `json:"createDate" gorm:"column:create_date;size:50;comment:鍒涘缓鏃堕棿"`
AdjustAmount decimal.Decimal `json:"adjustAmount" gorm:"column:adjust_amount"` //宸��
DifferenceAmount decimal.Decimal `json:"differenceAmount" gorm:"-"` //璁℃暟鏁伴噺
- OperationId int `json:"operationId" gorm:"column:operation_id"`
- Status constvar.OperationStatus `json:"status" gorm:"status"`
- BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"base_operation_type"`
- Weight decimal.Decimal `gorm:"type:decimal(20,3);comment:閲嶉噺" json:"weight"` //閲嶉噺
+ OperationId int `json:"operationId" gorm:"column:operation_id;comment:搴撳瓨鎿嶄綔璁板綍"`
+ Status constvar.OperationStatus `json:"status" gorm:";comment:鎿嶄綔鐘舵��(3灏辩华銆�4瀹屾垚銆�5鍙栨秷)"` // 鎿嶄綔鐘舵��
+ BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"base_operation_type;comment:鍩虹浣滀笟绫诲瀷"` // 鍩虹浣滀笟绫诲瀷
+ Weight decimal.Decimal `gorm:"type:decimal(20,3);comment:閲嶉噺" json:"weight"` //閲嶉噺
}
)
diff --git a/models/operation.go b/models/operation.go
index 8fdf2a2..66a33be 100644
--- a/models/operation.go
+++ b/models/operation.go
@@ -10,57 +10,60 @@
)
type (
- // Operation 鎿嶄綔琛�
+ // Operation 搴撳瓨鎿嶄綔琛�
Operation struct {
WmsModel
Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
- Number string `json:"number" gorm:"type:varchar(255)"` //鍗曞彿
- SourceNumber string `json:"sourceNumber" gorm:"index;type:varchar(255)"` //婧愬崟鍙�
- OperationTypeId int `json:"operationTypeId" gorm:"type:int;not null;comment:浣滀笟绫诲瀷id"` //浣滀笟绫诲瀷id
- OperationTypeName string `json:"operationTypeName" gorm:"type:varchar(127);comment:浣滀笟绫诲瀷鍚嶇О"` //浣滀笟绫诲瀷鍚嶇О
- Status constvar.OperationStatus `json:"status" gorm:"type:int(11);not null;comment:鐘舵��"` //鐘舵��
- OperationDate string `json:"operationDate" gorm:"type:varchar(31);comment:瀹夋帓鏃ユ湡"`
- ContacterID int `json:"contacterID" gorm:"type:int;comment:鑱旂郴浜篒D"`
- ContacterName string `json:"contacterName" gorm:"type:varchar(63);comment:鑱旂郴浜哄鍚�"`
- CompanyID string `json:"companyID" gorm:"type:varchar(255);comment:鍏徃ID-瀹㈡埛"`
- CompanyName string `json:"companyName" gorm:"type:varchar(127);comment:鍏徃鍚嶇О-瀹㈡埛"`
- Comment string `json:"comment" gorm:"type:text;comment:澶囨敞"`
- LogisticCompanyId string `json:"logisticCompanyId" gorm:"type:varchar(191);comment:鐗╂祦鍏徃id"`
- LogisticCompany LogisticCompany `json:"logisticCompany" gorm:"foreignKey:LogisticCompanyId"`
- WaybillNumber string `json:"waybillNumber" gorm:"type:varchar(255);comment:杩愬崟鍙�"` //杩愬崟鍙�
- Weight decimal.Decimal `gorm:"type:decimal(20,2);comment:閲嶉噺" json:"weight"` //閲嶉噺
- LogisticWeight decimal.Decimal `gorm:"type:decimal(20,2);comment:鐗╂祦閲嶉噺" json:"logisticWeight"` //鐗╂祦閲嶉噺
- Source string `json:"source" gorm:"type:varchar(255);comment:鏉ユ簮绯荤粺,鐢ㄤ簬杩斿洖淇敼鐘舵��"`
+ Number string `json:"number" gorm:"type:varchar(255);comment:鍗曞彿"` //鍗曞彿
+ SourceNumber string `json:"sourceNumber" gorm:"index;type:varchar(255);comment:婧愬崟鍙�"` //婧愬崟鍙�
+ OperationTypeId int `json:"operationTypeId" gorm:"type:int;not null;comment:浣滀笟绫诲瀷id"` //浣滀笟绫诲瀷id
+ OperationTypeName string `json:"operationTypeName" gorm:"type:varchar(127);comment:浣滀笟绫诲瀷鍚嶇О"` //浣滀笟绫诲瀷鍚嶇О
+ Status constvar.OperationStatus `json:"status" gorm:"type:int(11);not null;comment:鐘舵��"` //鐘舵��
+ OperationDate string `json:"operationDate" gorm:"type:varchar(31);comment:瀹夋帓鏃ユ湡"` // 瀹夋帓鏃ユ湡
+ ContacterID int `json:"contacterID" gorm:"type:int;comment:鑱旂郴浜篒D"` // 鑱旂郴浜篒D
+ ContacterName string `json:"contacterName" gorm:"type:varchar(63);comment:鑱旂郴浜哄鍚�"` // 鑱旂郴浜哄鍚�
+ CompanyID string `json:"companyID" gorm:"type:varchar(255);comment:鍏徃ID-瀹㈡埛"` // 鍏徃ID-瀹㈡埛
+ CompanyName string `json:"companyName" gorm:"type:varchar(127);comment:鍏徃鍚嶇О-瀹㈡埛"` // 鍏徃鍚嶇О-瀹㈡埛
+ Comment string `json:"comment" gorm:"type:text;comment:澶囨敞"` // 澶囨敞
+ LogisticCompanyId string `json:"logisticCompanyId" gorm:"type:varchar(191);comment:鐗╂祦鍏徃id"` // 鐗╂祦鍏徃id
+ LogisticCompany LogisticCompany `json:"logisticCompany" gorm:"foreignKey:LogisticCompanyId"` // 鐗╂祦鍏徃淇℃伅
+ WaybillNumber string `json:"waybillNumber" gorm:"type:varchar(255);comment:杩愬崟鍙�"` //杩愬崟鍙�
+ Weight decimal.Decimal `json:"weight" gorm:"type:decimal(20,2);comment:閲嶉噺" ` //閲嶉噺
+ LogisticWeight decimal.Decimal `json:"logisticWeight" gorm:"type:decimal(20,2);comment:鐗╂祦閲嶉噺" ` //鐗╂祦閲嶉噺
+ Source string `json:"source" gorm:"type:varchar(255);comment:鏉ユ簮绯荤粺,鐢ㄤ簬杩斿洖淇敼鐘舵��"` // 鏉ユ簮绯荤粺
OperationSource constvar.OperationSource `json:"operationSource" gorm:"type:tinyint(3);not null;default:0;comment:鎿嶄綔鏉ユ簮"` //鎿嶄綔鏉ユ簮
- Details []*OperationDetails `json:"details" gorm:"foreignKey:OperationID;references:Id"`
+ Details []*OperationDetails `json:"details" gorm:"foreignKey:OperationID;references:Id"` // 鎿嶄綔鏄庣粏
BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"type:tinyint;not null;comment:鍩虹浣滀笟绫诲瀷"` //鍩虹浣滀笟绫诲瀷
- AuditDate string `json:"auditDate" gorm:"type:varchar(31);comment:瀹℃壒鏃堕棿"`
- ReceiverName string `json:"receiverName" gorm:"type:varchar(31);comment:鏀惰揣浜哄鍚�"`
- ReceiverPhone string `json:"receiverPhone" gorm:"type:varchar(31);comment:鑱旂郴鐢佃瘽"`
- ReceiverAddr string `json:"receiverAddr" gorm:"type:varchar(255);comment:鏀惰揣鍦板潃"`
+ AuditDate string `json:"auditDate" gorm:"type:varchar(31);comment:瀹℃壒鏃堕棿"` // 瀹℃壒鏃堕棿
+ ReceiverName string `json:"receiverName" gorm:"type:varchar(31);comment:鏀惰揣浜哄鍚�"` // 鏀惰揣浜哄鍚�
+ ReceiverPhone string `json:"receiverPhone" gorm:"type:varchar(31);comment:鑱旂郴鐢佃瘽"` // 鑱旂郴鐢佃瘽
+ ReceiverAddr string `json:"receiverAddr" gorm:"type:varchar(255);comment:鏀惰揣鍦板潃"` // 鏀惰揣鍦板潃
- LocationID int `json:"locationID" gorm:"type:int;not null;comment:婧愪綅缃甶d"` //婧愪綅缃甶d
- Location Location `json:"location" gorm:"foreignkey:LocationID;references:Id"` //婧愪綅缃�
- ToLocationID int `json:"toLocationId" gorm:"type:int;not null;comment:浠撳簱浣嶇疆id"` //鐩爣浣嶇疆id
- ToLocation Location `json:"toLocation" gorm:"foreignKey:ToLocationID;references:Id"` //鐩爣浣嶇疆
- SalesDetailsNumber string `gorm:"type:varchar(191);comment:閿�鍞槑缁嗙紪鐮�" json:"salesDetailsNumber"`
+ LocationID int `json:"locationID" gorm:"type:int;not null;comment:婧愪綅缃甶d"` //婧愪綅缃甶d
+ Location Location `json:"location" gorm:"foreignkey:LocationID;references:Id"` //婧愪綅缃�
+ ToLocationID int `json:"toLocationId" gorm:"type:int;not null;comment:浠撳簱浣嶇疆id"` //鐩爣浣嶇疆id
+ ToLocation Location `json:"toLocation" gorm:"foreignKey:ToLocationID;references:Id"` //鐩爣浣嶇疆
+ SalesDetailsNumber string `json:"salesDetailsNumber" gorm:"type:varchar(191);comment:閿�鍞槑缁嗙紪鐮�"` // 閿�鍞槑缁嗙紪鐮�
- ManagerId string `json:"managerId" gorm:"type:varchar(255);comment:涓荤id"`
- Manager string `json:"manager" gorm:"type:varchar(255);comment:涓荤鍚嶇О"`
- AccountantId string `json:"accountantId" gorm:"type:varchar(255);comment:浼氳id"`
- Accountant string `json:"accountant" gorm:"type:varchar(255);comment:浼氳鍚嶇О"`
- CustodianId string `json:"custodianId" gorm:"type:varchar(255);comment:淇濈鍛榠d"`
- Custodian string `json:"custodian" gorm:"type:varchar(255);comment:淇濈鍛樺悕绉�"`
- CreatedBy string `json:"createBy" gorm:"type:varchar(255);comment:鍒涘缓鑰匲serId"`
- CheckedBy string `json:"checkedBy" gorm:"type:varchar(255);comment:楠岃瘉鑰匲serId"`
- Remark string `json:"remark"`
+ ManagerId string `json:"managerId" gorm:"type:varchar(255);comment:涓荤id"` // 涓荤id
+ Manager string `json:"manager" gorm:"type:varchar(255);comment:涓荤鍚嶇О"` // 涓荤鍚嶇О
+ AccountantId string `json:"accountantId" gorm:"type:varchar(255);comment:浼氳id"` // 浼氳id
+ Accountant string `json:"accountant" gorm:"type:varchar(255);comment:浼氳鍚嶇О"` // 浼氳鍚嶇О
+ CustodianId string `json:"custodianId" gorm:"type:varchar(255);comment:淇濈鍛榠d"` // 淇濈鍛榠d
+ Custodian string `json:"custodian" gorm:"type:varchar(255);comment:淇濈鍛樺悕绉�"` // 淇濈鍛樺悕绉�
+ CreatedBy string `json:"createBy" gorm:"type:varchar(255);comment:鍒涘缓鑰匲serId"` // 鍒涘缓鑰匲serId
+ CheckedBy string `json:"checkedBy" gorm:"type:varchar(255);comment:楠岃瘉鑰匲serId"` // 楠岃瘉鑰匲serId
+ Remark string `json:"remark"` // 澶囨敞
- WarehouseId int `json:"warehouseId" gorm:"type:int;not null;default:0;comment:浠撳簱id"`
- Warehouse Warehouse `json:"warehouse" gorm:"foreignKey:WarehouseId"`
- IsInternalOutput bool `json:"isInternalOutput"` //鏄惁璋冩嫧浜х敓鐨勫嚭搴�
- DealerType string `json:"dealerType" gorm:"type:varchar(255);comment:璋冩嫧鍑哄叆搴撶被鍨�"`
+ WarehouseId int `json:"warehouseId" gorm:"type:int;not null;default:0;comment:浠撳簱id"` // 浠撳簱id
+ Warehouse Warehouse `json:"warehouse" gorm:"foreignKey:WarehouseId"` // 浠撳簱淇℃伅
+ IsInternalOutput bool `json:"isInternalOutput" gorm:"type:tinyint(1);comment:鏄惁璋冩嫧浜х敓鐨勫嚭搴�"` //鏄惁璋冩嫧浜х敓鐨勫嚭搴�
+ DealerType string `json:"dealerType" gorm:"type:varchar(255);comment:璋冩嫧鍑哄叆搴撶被鍨�"` // 璋冩嫧鍑哄叆搴撶被鍨�
+
+ // 鍢夎仈浠撳偍娣诲姞 SilkMarket
+ SilkMarket string `json:"silkMarket" gorm:"type:varchar(255);comment:搴勫彛"` // 搴勫彛
}
OperationSearch struct {
diff --git a/models/operation_details.go b/models/operation_details.go
index f51f399..a00b670 100644
--- a/models/operation_details.go
+++ b/models/operation_details.go
@@ -9,33 +9,36 @@
)
type (
- // OperationDetails 鎿嶄綔鏄庣粏琛�
+ // OperationDetails 搴撳瓨鎿嶄綔鏄庣粏琛�
OperationDetails struct {
WmsModel
Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
- OperationID int `json:"operationId" gorm:"index;type:int;not null;comment:鎿嶄綔璁板綍id"` //鎿嶄綔id
+ OperationID int `json:"operationId" gorm:"index;type:int;not null;comment:鎿嶄綔璁板綍id"` //鎿嶄綔璁板綍id
BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"type:tinyint;not null;comment:鍩虹浣滀笟绫诲瀷"` //鍩虹浣滀笟绫诲瀷
ProductId string `json:"productId" gorm:"type:varchar(191);not null;comment:浜у搧id"` //浜у搧id
//ProductName string `json:"productName" gorm:"type:varchar(255);not null;comment:浜у搧鍚嶇О"` //浜у搧鍚嶇О
Amount decimal.Decimal `json:"amount" gorm:"type:decimal(30,10);not null;comment:鏁伴噺"` //鏁伴噺
- StockAmount decimal.Decimal `json:"stockAmount" gorm:"type:decimal(30,10);"` //搴撳瓨鏁伴噺锛岀洏鐐规椂鐢�
+ StockAmount decimal.Decimal `json:"stockAmount" gorm:"type:decimal(30,10);comment:搴撳瓨鏁伴噺"` //搴撳瓨鏁伴噺锛岀洏鐐规椂鐢�
//Unit string `json:"unit" gorm:"type:varchar(31);comment:鍗曚綅"` //鍗曚綅
- Product Material `json:"product" gorm:"foreignKey:ProductId;references:ID"`
+ Product Material `json:"product" gorm:"foreignKey:ProductId;references:ID"` // 鐗╂枡淇℃伅
FromLocationID int `json:"fromLocationId" gorm:"type:int;not null;comment:婧愪綅缃甶d"` //婧愪綅缃甶d
FromLocation Location `json:"fromLocation" gorm:"foreignKey:FromLocationID;references:Id"` //婧愪綅缃�
ToLocationID int `json:"toLocationId" gorm:"type:int;not null;comment:鐩爣浣嶇疆id"` //鐩爣浣嶇疆id
ToLocation Location `json:"toLocation" gorm:"foreignKey:ToLocationID;references:Id"` //鐩爣浣嶇疆
- TotalGrossWeight decimal.Decimal `json:"totalGrossWeight" gorm:"type:decimal(20,3);comment:鎬绘瘺閲�"`
- TotalNetWeight decimal.Decimal `json:"totalNetWeight" gorm:"type:decimal(20,3);comment:鎬诲噣閲�"`
- AuxiliaryAmount decimal.Decimal `json:"auxiliaryAmount" gorm:"type:decimal(20,3);comment:杈呭姪鏁伴噺"`
- AuxiliaryUnit string `json:"auxiliaryUnit" gorm:"type:varchar(191);comment:杈呭姪鍗曚綅"`
- Remark string `gorm:"type:varchar(1024);comment:澶囨敞" json:"remark"`
- IsInternalOutput bool `json:"isInternalOutput"` //鏄惁璋冩嫧浜х敓鐨勫嚭搴�
- DealerType string `json:"dealerType"` //鍑哄叆搴撶被鍨�
+ TotalGrossWeight decimal.Decimal `json:"totalGrossWeight" gorm:"type:decimal(20,3);comment:鎬绘瘺閲�"` // 鎬绘瘺閲�
+ TotalNetWeight decimal.Decimal `json:"totalNetWeight" gorm:"type:decimal(20,3);comment:鎬诲噣閲�"` // 鎬诲噣閲�
+ AuxiliaryAmount decimal.Decimal `json:"auxiliaryAmount" gorm:"type:decimal(20,3);comment:杈呭姪鏁伴噺"` // 杈呭姪鏁伴噺
+ AuxiliaryUnit string `json:"auxiliaryUnit" gorm:"type:varchar(191);comment:杈呭姪鍗曚綅"` // 杈呭姪鍗曚綅
+ Remark string `json:"remark" gorm:"type:varchar(1024);comment:澶囨敞"` // 澶囨敞
+ IsInternalOutput bool `json:"isInternalOutput" gorm:"type:tinyint(1);comment:鏄惁璋冩嫧浜х敓鐨勫嚭搴�"` //鏄惁璋冩嫧浜х敓鐨勫嚭搴�
+ DealerType string `json:"dealerType" gorm:"type:varchar(255);comment:鍑哄叆搴撶被鍨�"` //鍑哄叆搴撶被鍨�
- Cost decimal.Decimal `json:"cost" ` //鎴愭湰鍗曚环
- SalePrice decimal.Decimal `json:"salePrice" ` //閿�鍞崟浠�
+ Cost decimal.Decimal `json:"cost" gorm:"type:decimal(20,4);comment:鎴愭湰鍗曚环"` //鎴愭湰鍗曚环
+ SalePrice decimal.Decimal `json:"salePrice" gorm:"type:decimal(20,4);comment:閿�鍞崟浠�"` //閿�鍞崟浠�
+ // 鍢夎仈浠撳偍娣诲姞 SilkMarket銆丼ilkMarketClose
+ SilkMarket string `json:"silkMarket" gorm:"type:varchar(255);comment:搴勫彛"` // 搴勫彛
+ SilkMarketClose string `json:"silkMarketClose" gorm:"type:varchar(10);comment:搴勫彛鍏抽棴"` // 搴勫彛鍏抽棴
}
OperationDetailsSearch struct {
diff --git a/request/operation.go b/request/operation.go
index c44df6d..f01efd0 100644
--- a/request/operation.go
+++ b/request/operation.go
@@ -6,114 +6,118 @@
)
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
- OperationTypeName string `json:"operationTypeName" gorm:"type:varchar(127);comment:浣滀笟绫诲瀷鍚嶇О"` //浣滀笟绫诲瀷鍚嶇О
- 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"`
- ContacterID int `json:"contacterID" gorm:"type:int;comment:鑱旂郴浜篒D"` //鑱旂郴浜篒D-闈炲繀濉�
- ContacterName string `json:"contacterName" gorm:"type:varchar(63);comment:鑱旂郴浜哄鍚�"` //鑱旂郴浜哄鍚�-闈炲繀濉�
- CompanyID string `json:"companyID"` //鍏徃ID-瀹㈡埛
- CompanyName string `json:"companyName" gorm:"type:varchar(127);comment:鍏徃鍚嶇О"` //鍏徃鍚嶇О-瀹㈡埛鍚嶇О
- Comment string `json:"comment" gorm:"type:text;comment:澶囨敞"` //澶囨敞
- LogisticCompanyId string `json:"logisticCompanyId" gorm:"type:varchar(191);comment:鐗╂祦鍏徃id"`
- WaybillNumber string `json:"waybillNumber" gorm:"type:varchar(255);comment:杩愬崟鍙�"` //杩愬崟鍙�
- Weight decimal.Decimal `gorm:"type:decimal(20,2);comment:閲嶉噺" json:"weight"` //閲嶉噺
- LogisticWeight decimal.Decimal `gorm:"type:decimal(20,2);comment:鐗╂祦閲嶉噺" json:"logisticWeight"` //鐗╂祦閲嶉噺
- ReceiverName string `json:"receiverName" gorm:"type:varchar(31);comment:鏀惰揣浜哄鍚�"`
- ReceiverPhone string `json:"receiverPhone" gorm:"type:varchar(31);comment:鑱旂郴鐢佃瘽"`
- ReceiverAddr string `json:"receiverAddr" gorm:"type:varchar(255);comment:鏀惰揣鍦板潃"`
- LocationId int `json:"locationId" gorm:"type:int;not null;comment:婧愪綅缃甶d"` //婧愪綅缃甶d
- ToLocationId int `json:"toLocationId" gorm:"type:int;not null;comment:浠撳簱浣嶇疆id"` //鐩爣浣嶇疆id
- ManagerId string `json:"managerId" gorm:"type:varchar(255);comment:涓荤id"`
- Manager string `json:"manager" gorm:"type:varchar(255);comment:涓荤鍚嶇О"`
- AccountantId string `json:"accountantId" gorm:"type:varchar(255);comment:浼氳id"`
- Accountant string `json:"accountant" gorm:"type:varchar(255);comment:浼氳鍚嶇О"`
- CustodianId string `json:"custodianId" gorm:"type:varchar(255);comment:淇濈鍛榠d"`
- Custodian string `json:"custodian" gorm:"type:varchar(255);comment:淇濈鍛樺悕绉�"`
- BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"type:tinyint;not null;comment:鍩虹浣滀笟绫诲瀷"` //鍩虹浣滀笟绫诲瀷 5搴撳瓨鐩樼偣
- WarehouseId int `json:"warehouseId" gorm:"type:int;not null;comment:浠撳簱id"` //浠撳簱id
- DealerType string `json:"dealerType" gorm:"type:varchar(255);comment:璋冩嫧鍑哄叆搴撶被鍨�"`
+ 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 {
- OperationId int `json:"OperationId" gorm:"type:int;not null;comment:鎿嶄綔璁板綍id"` //鎿嶄綔id
- ProductId string `json:"productId" gorm:"type:varchar(191);not null;comment:浜у搧id"` //浜у搧id
- //ProductName string `json:"productName" gorm:"type:varchar(255);not null;comment:浜у搧鍚嶇О"` //浜у搧鍚嶇О
- Amount decimal.Decimal `json:"amount" gorm:"type:decimal(20,2);not null;comment:鏁伴噺"` //鏁伴噺
- StockAmount decimal.Decimal `json:"stockAmount" gorm:"type:decimal(30,10);"` //搴撳瓨鏁伴噺锛岀洏鐐规椂鐢�
- //Unit string `json:"unit" gorm:"type:varchar(31);comment:鍗曚綅"` //鍗曚綅
- //Product models.Material `json:"product" gorm:"foreignKey:ProductId;references:ID"`
- FromLocationId int `json:"fromLocationId" gorm:"type:int;not null;comment:婧愪綅缃甶d"` //婧愪綅缃甶d
- ToLocationId int `json:"toLocationId" gorm:"type:int;not null;comment:鐩爣浣嶇疆id"` //鐩爣浣嶇疆id
- TotalGrossWeight decimal.Decimal `json:"totalGrossWeight" gorm:"type:decimal(20,3);comment:鎬绘瘺閲�"` //鎬绘瘺閲�
- TotalNetWeight decimal.Decimal `json:"totalNetWeight" gorm:"type:decimal(20,3);comment:鎬诲噣閲�"` //鎬诲噣閲�
- AuxiliaryAmount decimal.Decimal `json:"auxiliaryAmount" gorm:"type:decimal(20,3);comment:杈呭姪鏁伴噺"` //杈呭姪鏁伴噺
- AuxiliaryUnit string `json:"auxiliaryUnit" gorm:"type:varchar(191);comment:杈呭姪鍗曚綅"` //杈呭姪鍗曚綅
- Remark string `gorm:"type:varchar(1024);comment:澶囨敞" json:"remark"`
+ 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"` //閿�鍞崟浠�
+ 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"`
- BaseOperationType constvar.BaseOperationType `json:"baseOperationType"` // 1 鍏ュ簱 2 鍑哄簱 3 鍐呴儴璋冩嫧 4 鎶ュ簾 5 搴撳瓨鐩樼偣
- Number string `json:"number"`
- Status constvar.OperationStatus `json:"status"`
+ 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
- OperationTypeName string `json:"operationTypeName" gorm:"type:varchar(127);comment:浣滀笟绫诲瀷鍚嶇О"` //浣滀笟绫诲瀷鍚嶇О
- 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"`
- ContacterID int `json:"contacterID" gorm:"type:int;comment:鑱旂郴浜篒D"` //鑱旂郴浜篒D-闈炲繀濉�
- ContacterName string `json:"contacterName" gorm:"type:varchar(63);comment:鑱旂郴浜哄鍚�"` //鑱旂郴浜哄鍚�-闈炲繀濉�
- CompanyID string `json:"companyID"` //鍏徃ID-瀹㈡埛
- CompanyName string `json:"companyName" gorm:"type:varchar(127);comment:鍏徃鍚嶇О"` //鍏徃鍚嶇О-瀹㈡埛鍚嶇О
- Comment string `json:"comment" gorm:"type:text;comment:澶囨敞"` //澶囨敞
- BaseOperationType constvar.BaseOperationType `json:"baseOperationType"` //鍩虹浣滀笟绫诲瀷
- LogisticCompanyId string `json:"logisticCompanyId" gorm:"type:varchar(191);comment:鐗╂祦鍏徃id"`
- WaybillNumber string `json:"waybillNumber" gorm:"type:varchar(255);comment:杩愬崟鍙�"` //杩愬崟鍙�
- Weight decimal.Decimal `gorm:"type:decimal(20,2);comment:閲嶉噺" json:"weight"` //閲嶉噺
- LogisticWeight decimal.Decimal `gorm:"type:decimal(20,2);comment:鐗╂祦閲嶉噺" json:"logisticWeight"` //鐗╂祦閲嶉噺
- ReceiverName string `json:"receiverName" gorm:"type:varchar(31);comment:鏀惰揣浜哄鍚�"`
- ReceiverPhone string `json:"receiverPhone" gorm:"type:varchar(31);comment:鑱旂郴鐢佃瘽"`
- ReceiverAddr string `json:"receiverAddr" gorm:"type:varchar(255);comment:鏀惰揣鍦板潃"`
- LocationId int `json:"locationId" gorm:"type:int;not null;comment:婧愪綅缃甶d"` //婧愪綅缃甶d
- ToLocationId int `json:"toLocationId" gorm:"type:int;not null;comment:浠撳簱浣嶇疆id"` //鐩爣浣嶇疆id
- ManagerId string `json:"managerId" gorm:"type:varchar(255);comment:涓荤id"`
- Manager string `json:"manager" gorm:"type:varchar(255);comment:涓荤鍚嶇О"`
- AccountantId string `json:"accountantId" gorm:"type:varchar(255);comment:浼氳id"`
- Accountant string `json:"accountant" gorm:"type:varchar(255);comment:浼氳鍚嶇О"`
- CustodianId string `json:"custodianId" gorm:"type:varchar(255);comment:淇濈鍛榠d"`
- Custodian string `json:"custodian" gorm:"type:varchar(255);comment:淇濈鍛樺悕绉�"`
- WarehouseId int `json:"warehouseId" gorm:"type:int;not null;comment:浠撳簱id"` //浠撳簱id
- InventoryDealerType int `json:"inventoryDealerType" gorm:"type:varchar(255);comment:璋冩嫧鍑哄叆搴撳垎绫�(瀵瑰簲dict瀛楀吀琛ㄧ殑ID)"`
+ 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"`
+ Number string `json:"number"` // 鍗曞彿
+ SourceNumber string `json:"sourceNumber"` // 婧愬崟鍙�
}
type OperationCondition struct {
PageInfo
- Condition string `json:"condition"`
+ 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