| | |
| | | "errors" |
| | | "fmt" |
| | | "github.com/gin-gonic/gin" |
| | | "github.com/mitchellh/mapstructure" |
| | | "github.com/shopspring/decimal" |
| | | "gorm.io/gorm" |
| | | "strconv" |
| | |
| | | // @Produce application/json |
| | | // @Param object body request.GetLocationProductList true "查询参数" |
| | | // @Param Authorization header string true "token" |
| | | // @Success 200 {object} util.Response "成功" |
| | | // @Success 200 {object} util.ResponseList(data=[]*response.LocationProductAmount) "成功" |
| | | // @Router /api-wms/v1/locationProductAmount/locationProductList [post] |
| | | func (slf LocationProductAmountController) LocationProductList(c *gin.Context) { |
| | | var params request.GetLocationProductList |
| | |
| | | return |
| | | } |
| | | |
| | | util.ResponseFormatList(c, code.Success, records, int(total)) |
| | | dataList := make([]*response.LocationProductAmount, 0, len(records)) |
| | | |
| | | for _, v := range records { |
| | | data := new(response.LocationProductAmount) |
| | | mapstructure.Decode(v.Product, &data) |
| | | data.ID = v.ProductId |
| | | data.LocationId = v.LocationId |
| | | data.Location = v.Location |
| | | data.Amount = v.Amount |
| | | data.ProductId = v.ProductId |
| | | dataList = append(dataList, data) |
| | | } |
| | | |
| | | util.ResponseFormatList(c, code.Success, dataList, int(total)) |
| | | } |
| | | |
| | | // Add |