| | |
| | | "wms/extend/util" |
| | | "wms/models" |
| | | "wms/request" |
| | | "wms/response" |
| | | ) |
| | | |
| | | type LocationProductAmountController struct { |
| | |
| | | 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, "参数解析失败,数据类型错误") |
| | | 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 修改库存盘点信息 |