| | |
| | | return |
| | | } |
| | | |
| | | now := time.Now().Local() |
| | | today := now.Day() |
| | | nowMonth := now.Format("2006-01") |
| | | if len(result) == 0 { |
| | | util.ResponseFormatList(c, code.Success, result, int(total)) |
| | | return |
| | | } |
| | | |
| | | day, dateStr, _ := service.NewSystemConfigService().GetInventoryCutOffPoint() |
| | | if nowMonth == params.Date && today < day || today == day && now.Format("15:04") < dateStr { //本月未至结算时间点 |
| | | 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 |
| | |
| | | return |
| | | } |
| | | |
| | | params.Preload = true |
| | | monthFormsService := service.NewWarehouseMonthFormsService() |
| | | list, err := monthFormsService.FetchAll(params) |
| | | if err != nil { |