From 528c5a54a9445e53607f5dbe1354c312db9f1fa4 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 29 十一月 2023 18:03:00 +0800 Subject: [PATCH] 出入库报表搜索增加几个字段 --- controllers/operation.go | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/operation.go b/controllers/operation.go index f42fe69..e75abc4 100644 --- a/controllers/operation.go +++ b/controllers/operation.go @@ -733,7 +733,7 @@ func AddMoveHistory(operationList []*models.Operation, db *gorm.DB) error { var histories []*models.MoveHistory - operationMap := make(map[string]*models.Operation, len(operationList)) + operationMap := make(map[int]*models.Operation, len(operationList)) for _, operation := range operationList { for _, v := range operation.Details { history := &models.MoveHistory{ @@ -754,13 +754,13 @@ } histories = append(histories, history) } - operationMap[operation.Number] = operation + operationMap[operation.Id] = operation } if err := db.Model(&models.MoveHistory{}).Create(&histories).Error; err != nil { return err } for _, history := range histories { - service.AddNewHistoryReportRecord(history, operationMap[history.Number]) + service.AddNewHistoryReportRecord(history, operationMap[history.OperationId]) } return nil } -- Gitblit v1.8.0