From c46808111057ae1acaaab3e030e7aad7193f28ee Mon Sep 17 00:00:00 2001 From: jiangshuai <291802688@qq.com> Date: 星期四, 28 九月 2023 10:25:16 +0800 Subject: [PATCH] 1.库存盘点修改、验证 --- controllers/location_product_amount.go | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/controllers/location_product_amount.go b/controllers/location_product_amount.go index 2d76187..0e909f3 100644 --- a/controllers/location_product_amount.go +++ b/controllers/location_product_amount.go @@ -12,6 +12,7 @@ "wms/extend/util" "wms/models" "wms/request" + "wms/response" ) type LocationProductAmountController struct { @@ -172,6 +173,32 @@ util.ResponseFormat(c, code.Success, "娣诲姞鎴愬姛") } +// GetRuleList +// @Tags 搴撳瓨鐩樼偣 +// @Summary 鑾峰彇涓婃灦瑙勫垯 +// @Produce application/json +// @Param object body request.GetRuleList true "鏌ヨ淇℃伅" +// @Success 200 {object} util.ResponseList{data=[]response.RuleList} "鎴愬姛" +// @Router /api-wms/v1/locationProductAmount/getRuleList [post] +func (slf LocationProductAmountController) GetRuleList(c *gin.Context) { + var params request.GetRuleList + if err := c.BindJSON(¶ms); err != nil { + util.ResponseFormat(c, code.RequestParamError, "鍙傛暟瑙f瀽澶辫触锛屾暟鎹被鍨嬮敊璇�") + return + } + list, err := models.NewLocationProductSearch().SetProductId(params.ProductId).SetLocationId(params.LocationId).Find() + if err != nil { + util.ResponseFormat(c, code.RequestParamError, err.Error()) + return + } + var ruleList response.RuleList + for _, l := range list { + ruleList.LocationList = append(ruleList.LocationList, l.Location) + ruleList.ProductList = append(ruleList.ProductList, l.Product) + } + util.ResponseFormat(c, code.Success, ruleList) +} + // Add // @Tags 搴撳瓨鐩樼偣 // @Summary 淇敼搴撳瓨鐩樼偣淇℃伅 -- Gitblit v1.8.0