From 313617ceb05dd5194d2091c717a25cbf33ef39b9 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 24 十一月 2023 14:39:25 +0800
Subject: [PATCH] 新增history加入索引

---
 controllers/operation.go |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/controllers/operation.go b/controllers/operation.go
index 143c959..c0b34f4 100644
--- a/controllers/operation.go
+++ b/controllers/operation.go
@@ -29,6 +29,7 @@
 	"wms/proto/purchase_wms"
 	"wms/proto/supplier"
 	"wms/request"
+	"wms/service"
 	"wms/utils/http"
 	"wms/utils/upload"
 )
@@ -716,6 +717,7 @@
 				OperationTypeId:   operation.OperationTypeId,
 				OperationTypeName: operation.OperationTypeName,
 				OperationId:       operation.Id,
+				ProductId:         v.ProductId,
 				ProductName:       v.Product.Name,
 				Amount:            v.Amount,
 				Unit:              v.Product.Unit,
@@ -731,6 +733,9 @@
 	if err := db.Model(&models.MoveHistory{}).Create(&histories).Error; err != nil {
 		return err
 	}
+	for _, history := range histories {
+		service.AddNewHistoryReportRecord(history.Id)
+	}
 	return nil
 }
 

--
Gitblit v1.8.0