From dcf9d1324c4ecc23bc0b120ee9af9f0f74cde034 Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期一, 08 一月 2024 19:04:50 +0800
Subject: [PATCH] swagger提交

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

diff --git a/controllers/operation.go b/controllers/operation.go
index 2a2b48f..8549e48 100644
--- a/controllers/operation.go
+++ b/controllers/operation.go
@@ -408,6 +408,7 @@
 		return
 	}
 	if len(locAmountList) > 0 {
+		mapLocAmount = make(map[string]*models.LocationProductAmount)
 		for _, v := range locAmountList {
 			mapLocAmount[strconv.Itoa(v.LocationId)+v.ProductId] = v
 		}
@@ -859,11 +860,11 @@
 }
 
 func ExportInputSelfmade(category constvar.FileTemplateCategory, operation *models.Operation) (string, error) {
-	template, err := models.NewFileTemplateAttachmentSearch().SetPreload(true).SetCategory(category).First()
+	template, err := models.NewFileTemplateAttachmentSearch().SetCategory(category).First()
 	if err != nil {
 		return "", errors.New("鑾峰彇妯$増璁板綍澶辫触:" + err.Error())
 	}
-	readerCloser, err := http.HttpGetWithReadCloser(template.Attachment.FileUrl)
+	readerCloser, err := http.HttpGetWithReadCloser(template.FileUrl)
 	if err != nil {
 		return "", errors.New("鑾峰彇妯$増澶辫触:" + err.Error())
 	}
@@ -940,11 +941,11 @@
 
 func ExportOutputOperation(category constvar.FileTemplateCategory, operation *models.Operation) (string, error) {
 	repositoryLevels := strings.Split(operation.Location.JointName, "/")
-	template, err := models.NewFileTemplateAttachmentSearch().SetPreload(true).SetCategory(category).First()
+	template, err := models.NewFileTemplateAttachmentSearch().SetCategory(category).First()
 	if err != nil {
 		return "", errors.New("鑾峰彇妯$増璁板綍澶辫触:" + err.Error())
 	}
-	readerCloser, err := http.HttpGetWithReadCloser(template.Attachment.FileUrl)
+	readerCloser, err := http.HttpGetWithReadCloser(template.FileUrl)
 	if err != nil {
 		return "", errors.New("鑾峰彇妯$増澶辫触:" + err.Error())
 	}

--
Gitblit v1.8.0