| | |
| | | return |
| | | } |
| | | |
| | | if len(result) == 0 { |
| | | util.ResponseFormatList(c, code.Success, result, int(total)) |
| | | return |
| | | } |
| | | |
| | | nowMonth := time.Now().Local().Format("2006-01") |
| | | if nowMonth == params.Date { |
| | | productIds := make([]string, 0, len(result)) |
| | | for _, item := range result { |
| | | productIds = append(productIds, item.ProductId) |
| | | } |
| | | statsRecords, err := service.GetCurrentWarehouseStats(params.Date, params.WarehouseID, productIds) |
| | | statsRecords, err := service.GetCurrentWarehouseStats(params.Date, params.WarehouseID, productIds, true) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.InternalError, "内部错误") |
| | | return |
| | |
| | | } |
| | | |
| | | util.ResponseFormatList(c, code.Success, result, int(total)) |
| | | |
| | | } |
| | | |
| | | // DoWareHouseMonthStats |