|
|
@@ -11,6 +11,7 @@ export interface SearchProdSchedule { |
|
|
|
scheduleAt?: string; |
|
|
|
schedulePeriod?: string; |
|
|
|
schedulePeriodTo?: string; |
|
|
|
produceAt?: string; |
|
|
|
totalEstProdCount?: number; |
|
|
|
types?: ScheduleType[]; |
|
|
|
pageSize?: number; |
|
|
@@ -20,8 +21,9 @@ export interface SearchProdSchedule { |
|
|
|
export interface ProdScheduleResult { |
|
|
|
id: number; |
|
|
|
scheduleAt: number[]; |
|
|
|
schedulePeriod: number[]; |
|
|
|
schedulePeriodTo: number[]; |
|
|
|
schedulePeriod?: number[]; |
|
|
|
schedulePeriodTo?: number[]; |
|
|
|
produceAt: string; |
|
|
|
totalEstProdCount: number; |
|
|
|
totalFGType: number; |
|
|
|
type: string; |
|
|
@@ -72,6 +74,40 @@ export const fetchProdSchedules = cache( |
|
|
|
}, |
|
|
|
); |
|
|
|
|
|
|
|
export const fetchRoughProdSchedules = cache( |
|
|
|
async (data: SearchProdSchedule | null) => { |
|
|
|
const params = convertObjToURLSearchParams<SearchProdSchedule>(data); |
|
|
|
// console.log(params) |
|
|
|
return serverFetchJson<ProdScheduleResultByPage>( |
|
|
|
`${BASE_API_URL}/productionSchedule/getRecordByPage/rough?${params}`, |
|
|
|
{ |
|
|
|
method: "GET", |
|
|
|
headers: { "Content-Type": "application/json" }, |
|
|
|
next: { |
|
|
|
tags: ["roughProdSchedules"], |
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
|
}, |
|
|
|
); |
|
|
|
|
|
|
|
export const fetchDetailedProdSchedules = cache( |
|
|
|
async (data: SearchProdSchedule | null) => { |
|
|
|
const params = convertObjToURLSearchParams<SearchProdSchedule>(data); |
|
|
|
// console.log(params) |
|
|
|
return serverFetchJson<ProdScheduleResultByPage>( |
|
|
|
`${BASE_API_URL}/productionSchedule/getRecordByPage/detailed?${params}`, |
|
|
|
{ |
|
|
|
method: "GET", |
|
|
|
headers: { "Content-Type": "application/json" }, |
|
|
|
next: { |
|
|
|
tags: ["detailedProdSchedules"], |
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
|
}, |
|
|
|
); |
|
|
|
|
|
|
|
export const testRoughSchedule = cache(async () => { |
|
|
|
return serverFetchJson( |
|
|
|
`${BASE_API_URL}/productionSchedule/testRoughSchedule`, |
|
|
@@ -79,7 +115,7 @@ export const testRoughSchedule = cache(async () => { |
|
|
|
method: "GET", |
|
|
|
headers: { "Content-Type": "application/json" }, |
|
|
|
next: { |
|
|
|
tags: ["prodSchedules"], |
|
|
|
tags: ["roughProdSchedules"], |
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
@@ -93,7 +129,7 @@ export const testDetailedSchedule = cache(async (date?: string) => { |
|
|
|
method: "GET", |
|
|
|
headers: { "Content-Type": "application/json" }, |
|
|
|
next: { |
|
|
|
tags: ["prodSchedules"], |
|
|
|
tags: ["detailedProdSchedules"], |
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
@@ -109,7 +145,8 @@ export const releaseProdScheduleLine = cache(async (data: ReleaseProdScheduleInp |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
revalidateTag("prodSchedules"); |
|
|
|
revalidateTag("detailedProdSchedules"); |
|
|
|
revalidateTag("prodSchedule"); |
|
|
|
|
|
|
|
return response; |
|
|
|
}) |
|
|
@@ -124,7 +161,8 @@ export const saveProdScheduleLine = cache(async (data: ReleaseProdScheduleInputs |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
revalidateTag("prodSchedules"); |
|
|
|
revalidateTag("detailedProdSchedules"); |
|
|
|
revalidateTag("prodSchedule"); |
|
|
|
|
|
|
|
return response; |
|
|
|
}) |