Files
wace_rps/frontend/lib/api/prodPlanResult.ts
T
hjjeong b38f5957f2 구매관리 7메뉴 신규 + M-BOM PR-B3·B5 + 발주관리 DataGrid 통일 + 생산계획&실적 라우트
구매관리 (wace 1:1)
- backend: services/purchaseService.ts (7 list + 옵션 3종) + controllers/purchaseController.ts + routes/purchaseRoutes.ts (/api/purchase 마운트)
- frontend: lib/api/purchase.ts + 7 page.tsx (list/quote-request/proposal/inbound/inbound-by-item/inbound-by-date/project-status)
- 영업관리 4메뉴 DataGrid 패턴 통일 — pageSizeOptions=[10,15,20,50,100], emptyMessage, showColumnSettings/summaryStats/onRefresh/onDownload/showChart
- 마스터단독 데이터(sales_request_master, project_mgmt+mbom_detail) 노출, detail/part 누락 테이블 의존은 빈 그리드 + UI

발주관리 (purchase/order/page.tsx)
- EDataTable → DataGrid 교체 + logicstudio 6종 props + 날짜/숫자 pre-format

M-BOM PR-B3 — 구매리스트 생성 (wace createPurchaseListFromMBom.do 1:1)
- mbomService.createSalesRequest + controller + route POST /api/production/mbom/sales-request
- 단건 체크 + 1:1 강제 + R-YYYYMMDD-NNN 채번 + sales_request_master 단건 INSERT
- production/mbom/page.tsx 에 [구매리스트 생성] 버튼

M-BOM PR-B5 — BOM 할당 (mBomEbomSelectPopup.do)
- mbomService.searchAssignableEboms/assignBom + controller + routes
- MbomAssignDialog 신규, MbomDetailDialog 통합

생산관리 4메뉴 라우트 (생산계획&실적, 소요량)
- prodPlanResultService/Controller + productionPlanResultRoutes (planResult/mbomReq)
- mbomRequirementService + 4 page.tsx (prod-plan-result, prod-plan-result-equip, raw-material-requirement, semi-product-requirement)
- lib/api/prodPlanResult.ts

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 17:31:12 +09:00

167 lines
5.3 KiB
TypeScript

import { apiClient } from "./client";
// ============================================================
// 생산관리 4개 메뉴 — wace productionplanning.xml 1:1
// 1) 생산계획&실적관리 (일반) GET /api/production/plan-result/list
// 2) 생산계획&실적관리 (장비) GET /api/production/plan-result/list-equip
// 3) 반제품 소요량 POST /api/production/mbom-requirement/semi
// 4) 원자재 소요량 POST /api/production/mbom-requirement/raw
// ============================================================
export interface ProdPlanResultFilter {
search_project_nos?: string; // multiple — "OBJID,OBJID,..."
search_product_code?: string;
search_category_code?: string;
search_production_type?: string;
search_customer_objid?: string;
search_req_del_date_from?: string;
search_req_del_date_to?: string;
search_part_no?: string;
search_part_name?: string;
search_serial_no?: string;
search_writer?: string;
search_regdate_from?: string;
search_regdate_to?: string;
page?: number;
page_size?: number;
}
export interface ProdPlanResultRow {
objid: string;
project_no: string | null;
product: string | null;
product_name: string | null;
category_code: string | null;
category_code_name: string | null;
production_type: string | null;
production_type_name: string | null;
customer_objid: string | null;
customer_name: string | null;
req_del_date: string | null;
customer_request: string | null;
part_no: string | null;
part_name: string | null;
serial_no: string | null;
serial_no_list: string | null;
quantity: number | string | null;
extra_prod_qty: number | string | null;
total_prod_qty: number | string | null;
assembly_qty: number | string | null;
inspection_qty: number | string | null;
ship_wait_qty: number | string | null;
prod_plan_objid: string | null;
writer: string | null;
writer_name: string | null;
regdate_title: string | null;
}
export interface ProdPlanResultEquipRow {
objid: string;
project_no: string | null;
product: string | null;
product_name: string | null;
category_code: string | null;
category_code_name: string | null;
production_type: string | null;
production_type_name: string | null;
customer_objid: string | null;
customer_name: string | null;
req_del_date: string | null;
customer_request: string | null;
part_no: string | null;
part_name: string | null;
serial_no: string | null;
prod_wbs_cnt: number | null;
prod_progress_rate: number | string | null;
delv_wbs_cnt: number | null;
delv_progress_rate: number | string | null;
}
export interface ProdPlanResultListResponse<T> {
rows: T[];
totalCount: number;
page: number;
pageSize: number;
}
export interface ProjectOption {
code: string;
label: string;
}
export interface WriterOption {
code: string;
label: string;
}
export const prodPlanResultApi = {
async list(filter: ProdPlanResultFilter = {}): Promise<ProdPlanResultListResponse<ProdPlanResultRow>> {
const res = await apiClient.get("/production/plan-result/list", { params: filter });
return res.data?.data as ProdPlanResultListResponse<ProdPlanResultRow>;
},
async listEquip(filter: ProdPlanResultFilter = {}): Promise<ProdPlanResultListResponse<ProdPlanResultEquipRow>> {
const res = await apiClient.get("/production/plan-result/list-equip", { params: filter });
return res.data?.data as ProdPlanResultListResponse<ProdPlanResultEquipRow>;
},
async getProjectOptions(): Promise<ProjectOption[]> {
const res = await apiClient.get("/production/plan-result/project-options");
return (res.data?.data ?? []) as ProjectOption[];
},
async getWriterOptions(): Promise<WriterOption[]> {
const res = await apiClient.get("/production/plan-result/writer-options");
return (res.data?.data ?? []) as WriterOption[];
},
};
// ─── 반제품/원자재 소요량 ───────────────────────────────────
export interface MbomOption {
objid: string;
mbom_no: string;
part_name: string;
}
export interface MbomRequirementInputItem {
mbomObjid: string;
qty: number;
}
export interface SemiRequirementRow {
PART_NO: string;
PART_NAME: string;
CATEGORY_NAME: string;
UNIT: string;
MATERIAL: string;
SPEC: string;
REQUIRED_QTY: number;
}
export interface RawRequirementRow {
PART_NO: string;
PART_NAME: string;
CATEGORY_NAME: string;
UNIT: string;
MATERIAL: string;
SPEC: string;
REQUIRED_QTY: number | string;
RAW_MATERIAL: string;
RAW_MATERIAL_SIZE: string;
MATERIAL_PART_NO: string;
MATERIAL_REQUIRED_QTY: number | string;
}
export const mbomRequirementApi = {
async getOptions(): Promise<MbomOption[]> {
const res = await apiClient.get("/production/mbom-requirement/options");
return (res.data?.data ?? []) as MbomOption[];
},
async getSemi(items: MbomRequirementInputItem[]): Promise<SemiRequirementRow[]> {
const res = await apiClient.post("/production/mbom-requirement/semi", { mbomItems: items });
return (res.data?.data ?? []) as SemiRequirementRow[];
},
async getRaw(items: MbomRequirementInputItem[]): Promise<RawRequirementRow[]> {
const res = await apiClient.post("/production/mbom-requirement/raw", { mbomItems: items });
return (res.data?.data ?? []) as RawRequirementRow[];
},
};