From dec0da77e3537bcd71bb31067258194327da9bfa Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 05 七月 2024 10:21:53 +0800
Subject: [PATCH] 操作明细增加当时库存数量供盘点操作用
---
docs/swagger.yaml | 21 +++---
request/operation.go | 59 ++++++++++---------
docs/docs.go | 27 +++++---
models/operation_details.go | 3
docs/swagger.json | 24 ++++---
5 files changed, 72 insertions(+), 62 deletions(-)
diff --git a/docs/docs.go b/docs/docs.go
index 659232c..da9fa40 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -1,4 +1,5 @@
-// Package docs Code generated by swaggo/swag. DO NOT EDIT
+// Code generated by swaggo/swag. DO NOT EDIT.
+
package docs
import "github.com/swaggo/swag"
@@ -5213,6 +5214,9 @@
"custodianId": {
"type": "string"
},
+ "dealerType": {
+ "type": "string"
+ },
"details": {
"type": "array",
"items": {
@@ -5220,12 +5224,6 @@
}
},
"id": {
- "type": "integer"
- },
- "inventoryDealer": {
- "$ref": "#/definitions/models.MiniDict"
- },
- "inventoryDealerType": {
"type": "integer"
},
"isInternalOutput": {
@@ -5265,7 +5263,6 @@
"type": "string"
},
"operationDate": {
- "description": "FromLocationID int ` + "`" + `json:\"fromLocationId\" gorm:\"type:int;not null;comment:婧愪綅缃甶d\"` + "`" + ` //婧愪綅缃甶d\nFromLocation Location ` + "`" + `json:\"fromLocation\" gorm:\"foreignKey:FromLocationID;references:Id\"` + "`" + ` //婧愪綅缃甛nToLocationID int ` + "`" + `json:\"toLocationId\" gorm:\"type:int;not null;comment:鐩爣浣嶇疆id\"` + "`" + ` //鐩爣浣嶇疆id\nToLocation Location ` + "`" + `json:\"toLocation\" gorm:\"foreignKey:ToLocationID;references:Id\"` + "`" + ` //鐩爣浣嶇疆",
"type": "string"
},
"operationSource": {
@@ -5417,6 +5414,10 @@
},
"salePrice": {
"description": "閿�鍞崟浠�",
+ "type": "number"
+ },
+ "stockAmount": {
+ "description": "搴撳瓨鏁伴噺锛岀洏鐐规椂鐢�",
"type": "number"
},
"toLocation": {
@@ -5983,6 +5984,9 @@
"custodianId": {
"type": "string"
},
+ "dealerType": {
+ "type": "string"
+ },
"details": {
"type": "array",
"items": {
@@ -5990,9 +5994,6 @@
}
},
"id": {
- "type": "integer"
- },
- "inventoryDealerType": {
"type": "integer"
},
"locationId": {
@@ -6655,6 +6656,10 @@
"description": "閿�鍞崟浠�",
"type": "number"
},
+ "stockAmount": {
+ "description": "搴撳瓨鏁伴噺锛岀洏鐐规椂鐢�",
+ "type": "number"
+ },
"toLocationId": {
"description": "鐩爣浣嶇疆id",
"type": "integer"
diff --git a/docs/swagger.json b/docs/swagger.json
index b4e0835..6d4985c 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -5202,6 +5202,9 @@
"custodianId": {
"type": "string"
},
+ "dealerType": {
+ "type": "string"
+ },
"details": {
"type": "array",
"items": {
@@ -5209,12 +5212,6 @@
}
},
"id": {
- "type": "integer"
- },
- "inventoryDealer": {
- "$ref": "#/definitions/models.MiniDict"
- },
- "inventoryDealerType": {
"type": "integer"
},
"isInternalOutput": {
@@ -5254,7 +5251,6 @@
"type": "string"
},
"operationDate": {
- "description": "FromLocationID int `json:\"fromLocationId\" gorm:\"type:int;not null;comment:婧愪綅缃甶d\"` //婧愪綅缃甶d\nFromLocation Location `json:\"fromLocation\" gorm:\"foreignKey:FromLocationID;references:Id\"` //婧愪綅缃甛nToLocationID int `json:\"toLocationId\" gorm:\"type:int;not null;comment:鐩爣浣嶇疆id\"` //鐩爣浣嶇疆id\nToLocation Location `json:\"toLocation\" gorm:\"foreignKey:ToLocationID;references:Id\"` //鐩爣浣嶇疆",
"type": "string"
},
"operationSource": {
@@ -5406,6 +5402,10 @@
},
"salePrice": {
"description": "閿�鍞崟浠�",
+ "type": "number"
+ },
+ "stockAmount": {
+ "description": "搴撳瓨鏁伴噺锛岀洏鐐规椂鐢�",
"type": "number"
},
"toLocation": {
@@ -5972,6 +5972,9 @@
"custodianId": {
"type": "string"
},
+ "dealerType": {
+ "type": "string"
+ },
"details": {
"type": "array",
"items": {
@@ -5979,9 +5982,6 @@
}
},
"id": {
- "type": "integer"
- },
- "inventoryDealerType": {
"type": "integer"
},
"locationId": {
@@ -6644,6 +6644,10 @@
"description": "閿�鍞崟浠�",
"type": "number"
},
+ "stockAmount": {
+ "description": "搴撳瓨鏁伴噺锛岀洏鐐规椂鐢�",
+ "type": "number"
+ },
"toLocationId": {
"description": "鐩爣浣嶇疆id",
"type": "integer"
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index 830ad06..ff40eef 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -948,15 +948,13 @@
type: string
custodianId:
type: string
+ dealerType:
+ type: string
details:
items:
$ref: '#/definitions/models.OperationDetails'
type: array
id:
- type: integer
- inventoryDealer:
- $ref: '#/definitions/models.MiniDict'
- inventoryDealerType:
type: integer
isInternalOutput:
description: 鏄惁璋冩嫧浜х敓鐨勫嚭搴�
@@ -983,11 +981,6 @@
description: 鍗曞彿
type: string
operationDate:
- description: |-
- 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"` //鐩爣浣嶇疆
type: string
operationSource:
allOf:
@@ -1086,6 +1079,9 @@
type: string
salePrice:
description: 閿�鍞崟浠�
+ type: number
+ stockAmount:
+ description: 搴撳瓨鏁伴噺锛岀洏鐐规椂鐢�
type: number
toLocation:
allOf:
@@ -1468,13 +1464,13 @@
type: string
custodianId:
type: string
+ dealerType:
+ type: string
details:
items:
$ref: '#/definitions/request.OperationDetails'
type: array
id:
- type: integer
- inventoryDealerType:
type: integer
locationId:
description: 婧愪綅缃甶d
@@ -1935,6 +1931,9 @@
salePrice:
description: 閿�鍞崟浠�
type: number
+ stockAmount:
+ description: 搴撳瓨鏁伴噺锛岀洏鐐规椂鐢�
+ type: number
toLocationId:
description: 鐩爣浣嶇疆id
type: integer
diff --git a/models/operation_details.go b/models/operation_details.go
index c596a44..f51f399 100644
--- a/models/operation_details.go
+++ b/models/operation_details.go
@@ -17,7 +17,8 @@
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(20,2);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);"` //搴撳瓨鏁伴噺锛岀洏鐐规椂鐢�
//Unit string `json:"unit" gorm:"type:varchar(31);comment:鍗曚綅"` //鍗曚綅
Product Material `json:"product" gorm:"foreignKey:ProductId;references:ID"`
diff --git a/request/operation.go b/request/operation.go
index f73dd24..c44df6d 100644
--- a/request/operation.go
+++ b/request/operation.go
@@ -7,28 +7,28 @@
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
+ 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:鐘舵��"` //鐘舵��
+ 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-闈炲繀濉�
+ 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:澶囨敞"` //澶囨敞
+ 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"` //閲嶉噺
+ 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
+ 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:涓荤鍚嶇О"`
@@ -37,21 +37,22 @@
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
+ WarehouseId int `json:"warehouseId" gorm:"type:int;not null;comment:浠撳簱id"` //浠撳簱id
DealerType string `json:"dealerType" gorm:"type:varchar(255);comment:璋冩嫧鍑哄叆搴撶被鍨�"`
}
type OperationDetails struct {
- OperationId int `json:"OperationId" gorm:"type:int;not null;comment:鎿嶄綔璁板綍id"` //鎿嶄綔id
+ 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:鏁伴噺"` //鏁伴噺
+ 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
+ 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:鎬诲噣閲�"` //鎬诲噣閲�
+ 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"`
@@ -70,29 +71,29 @@
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
+ 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:鐘舵��"` //鐘舵��
+ 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-闈炲繀濉�
+ 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"` //鍩虹浣滀笟绫诲瀷
+ 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"` //閲嶉噺
+ 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
+ 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:涓荤鍚嶇О"`
--
Gitblit v1.8.0