xiaoyi
4 天以前 27c8277d717b34b55f3ea967027b53b067f77df3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { requestClient } from '#/api/request';
 
export namespace DecisionForecastApi {
  export interface ForecastItem {
    id: number;
    forecastCode: string;
    forecastName: string;
    pointTime: string;
    forecastValue: number;
    actualValue?: number;
    lowerBound?: number;
    upperBound?: number;
    confidenceLevel?: number;
    modelVersion?: string;
    dimension?: string;
    dimensionValue?: string;
  }
}
 
export function getForecastList(forecastCode: string, params?: Record<string, unknown>) {
  return requestClient.get<DecisionForecastApi.ForecastItem[]>('/bi/decision/forecast/list', {
    params: { forecastCode, ...params },
  });
}
 
export function generateForecast(forecastCode: string) {
  return requestClient.post('/bi/decision/forecast/generate', null, {
    params: { forecastCode },
  });
}
 
export function generateForecastWorkOrder(data: {
  forecastId: number;
  workOrderName?: string;
  workOrderType: number;
  requestDate?: string;
  quantity: number;
  remark?: string;
}) {
  return requestClient.post<number>('/bi/decision/forecast/generate-work-order', data);
}