From 286adacbe154f984b500cd7df16e332e255f2010 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期四, 04 七月 2024 22:40:07 +0800
Subject: [PATCH] fix

---
 models/operation.go |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/models/operation.go b/models/operation.go
index 12ea942..8fdf2a2 100644
--- a/models/operation.go
+++ b/models/operation.go
@@ -19,10 +19,6 @@
 		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
-		//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"`    //鐩爣浣嶇疆
 		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:鑱旂郴浜哄鍚�"`
@@ -61,11 +57,10 @@
 		CheckedBy    string `json:"checkedBy" gorm:"type:varchar(255);comment:楠岃瘉鑰匲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"` //鏄惁璋冩嫧浜х敓鐨勫嚭搴�
-		InventoryDealerType int       `json:"inventoryDealerType" gorm:"type:varchar(255);comment:璋冩嫧鍑哄叆搴撳垎绫�(瀵瑰簲dict瀛楀吀琛ㄧ殑ID)"`
-		InventoryDealer     MiniDict  `json:"inventoryDealer" gorm:"foreignKey:InventoryDealerType;"`
+		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:璋冩嫧鍑哄叆搴撶被鍨�"`
 	}
 
 	OperationSearch struct {
@@ -98,6 +93,7 @@
 func (slf *OperationSearch) BeforeCreate(tx *gorm.DB) {
 	for k := range slf.Details {
 		slf.Details[k].BaseOperationType = slf.BaseOperationType
+		slf.Details[k].DealerType = slf.DealerType
 	}
 }
 
@@ -244,8 +240,7 @@
 			Preload("Location").
 			Preload("ToLocation").
 			Preload("Details.FromLocation").
-			Preload("Details.ToLocation").
-			Preload("InventoryDealer").Preload("Warehouse")
+			Preload("Details.ToLocation").Preload("Warehouse")
 	}
 
 	if slf.Disuse {

--
Gitblit v1.8.0