From 2ec42065712b96ac32ea706869949bf88f04770f Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期五, 14 六月 2024 09:52:58 +0800 Subject: [PATCH] 修复报错 --- response/report_forms_response.go | 25 ++++++++++++------------- service/history_forms.go | 4 ++-- request/operation_type.go | 3 ++- conf/config.yaml | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/conf/config.yaml b/conf/config.yaml index ffb9178..4664ec9 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -11,7 +11,7 @@ companyName: jialian db: # dsn: root:c++java123@tcp(192.168.20.119:3306)/wms?charset=utf8&parseTime=True&loc=Local - dsn: root:c++java123@tcp(127.0.0.1:3306)/aps_server2?charset=utf8&parseTime=True&loc=Local + dsn: root:c++java123@tcp(192.168.20.119:3306)/aps_server2?charset=utf8&parseTime=True&loc=Local logMode: true maxIdleCon: 20 maxOpenCon: 100 diff --git a/request/operation_type.go b/request/operation_type.go index 573eb4d..be30ae5 100644 --- a/request/operation_type.go +++ b/request/operation_type.go @@ -4,7 +4,8 @@ type GetOperationTypeList struct { PageInfo - Keyword string `json:"keyword"` + Keyword string `json:"keyword"` + WarehouseId int `json:"warehouseId" gorm:"type:int;not null;comment:浠撳簱id"` //浠撳簱id } type AddOperationType struct { diff --git a/response/report_forms_response.go b/response/report_forms_response.go index a302424..cfa6570 100644 --- a/response/report_forms_response.go +++ b/response/report_forms_response.go @@ -2,7 +2,6 @@ import ( "github.com/shopspring/decimal" - "time" "wms/constvar" "wms/models" ) @@ -25,18 +24,18 @@ } type InventoryHistory struct { - Number string `json:"number"` //鍗曞彿 - Date time.Time `json:"date"` //鏃ユ湡 - ProductName string `json:"productName"` //浜у搧鍚嶇О - FromLocation string `json:"fromLocation"` //婧愪綅缃� - ToLocation string `json:"toLocation"` //鐩爣浣嶇疆 - Amount decimal.Decimal `json:"amount"` //鏁伴噺 - AmountMoreUnits []models.UnitItems `json:"amountMoreUnits"` //鏁伴噺澶氬崟浣� - Unit string `json:"unit"` //鍗曚綅 - ContactedName string `json:"contactedName"` //瀹屾垚鑰� - Status string `json:"status"` //鐘舵�� - BaseOperationType constvar.BaseOperationType `json:"baseOperationType"` //鍩虹浣滀笟绫诲瀷 - Weight decimal.Decimal `json:"weight"` //閲嶉噺 + Number string `json:"number"` //鍗曞彿 + Date string `json:"date"` //鏃ユ湡 + ProductName string `json:"productName"` //浜у搧鍚嶇О + FromLocation string `json:"fromLocation"` //婧愪綅缃� + ToLocation string `json:"toLocation"` //鐩爣浣嶇疆 + Amount decimal.Decimal `json:"amount"` //鏁伴噺 + AmountMoreUnits []models.UnitItems `json:"amountMoreUnits" gorm:"-"` //鏁伴噺澶氬崟浣� + Unit string `json:"unit"` //鍗曚綅 + ContactedName string `json:"contactedName"` //瀹屾垚鑰� + Status string `json:"status"` //鐘舵�� + BaseOperationType constvar.BaseOperationType `json:"baseOperationType"` //鍩虹浣滀笟绫诲瀷 + Weight decimal.Decimal `json:"weight"` //閲嶉噺 ProductId string `json:"productId"` FromLocationId int `json:"fromLocationId"` ToLocationId int `json:"toLocationId"` diff --git a/service/history_forms.go b/service/history_forms.go index 02b27bf..afed856 100644 --- a/service/history_forms.go +++ b/service/history_forms.go @@ -33,7 +33,7 @@ for _, v := range list { data := &response.InventoryHistory{ Number: v.Number, - Date: v.UpdatedAt, + Date: v.UpdatedAt.Format("2006-01-02"), ProductName: v.ProductName, FromLocation: v.FromLocation, ToLocation: v.ToLocation, @@ -143,7 +143,7 @@ for i, v := range dataList { column := strconv.Itoa(i + 3) - f.SetCellValue("Sheet1", "A"+column, v.Date.Format("2006-01-02")) + f.SetCellValue("Sheet1", "A"+column, v.Date) f.SetCellValue("Sheet1", "B"+column, v.Number) f.SetCellValue("Sheet1", "C"+column, v.ProductName) f.SetCellValue("Sheet1", "D"+column, v.ProductId) -- Gitblit v1.8.0