From 96844c22ef3fba86a55e0af1b51bc1009d6fa950 Mon Sep 17 00:00:00 2001
From: jiangshuai <291802688@qq.com>
Date: 星期五, 20 十月 2023 11:57:48 +0800
Subject: [PATCH] 1.库存盘点bug修改

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

diff --git a/controllers/location_product.go b/controllers/location_product.go
index 3ebb6ef..ca86491 100644
--- a/controllers/location_product.go
+++ b/controllers/location_product.go
@@ -2,7 +2,9 @@
 
 import (
 	"github.com/gin-gonic/gin"
+	"github.com/shopspring/decimal"
 	"strconv"
+	"time"
 	"wms/extend/code"
 	"wms/extend/util"
 	"wms/models"
@@ -48,11 +50,22 @@
 	//	util.ResponseFormat(c, code.RequestParamError, "璇烽�夋嫨浜у搧绫诲埆")
 	//	return
 	//}
+
 	if err := models.NewLocationProductSearch().Create(&params); err != nil {
 		logx.Errorf("Operation create err: %v", err)
 		util.ResponseFormat(c, code.SaveFail, "娣诲姞澶辫触锛�"+err.Error())
 		return
 	}
+	locationProductAmount := &models.LocationProductAmount{
+		LocationProductId: params.Id,
+		Amount:            decimal.NewFromFloat(0),
+		CreateDate:        time.Now().Format("2006-01-02 15:04:05"),
+	}
+	if err := models.NewLocationProductAmountSearch().Create(locationProductAmount); err != nil {
+		logx.Errorf("Operation create err: %v", err)
+		util.ResponseFormat(c, code.SaveFail, "娣诲姞澶辫触锛�"+err.Error())
+		return
+	}
 	util.ResponseFormat(c, code.Success, "娣诲姞鎴愬姛")
 }
 

--
Gitblit v1.8.0