생산관리>data-sync — production_plan 신설 + 운영 sample 2행 이관
PR-A2 단건 상세의 TOTAL_PROD_QTY 서브쿼리(`SELECT NULLIF(PP.TOTAL_PROD_QTY,'')::numeric FROM PRODUCTION_PLAN PP WHERE PP.PROJECT_OBJID=PM.OBJID AND UPPER(PP.STATUS)='ACTIVE'`) 의존 테이블을 운영판 11133.waceplm에서 1:1 추출해 RPS 11134.vexplor_rps에 신설. - 402_production_plan.sql: 19 컬럼 / 4 인덱스 (objid, project_objid, total_prod_qty 포함) - 04_production_plan_sync.sql: 운영 sample 2행 - 1058002488 / W/M ASSY (-1752090174, total=4) - 1439133152 / O-RING ( 1157387151, total=5) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
-- ============================================================
|
||||
-- 운영판 wace 211.115.91.141:11133.production_plan → RPS 11134.production_plan
|
||||
-- 2건 1:1 이관 (PR-A2 단건 상세 TOTAL_PROD_QTY 검증용)
|
||||
-- ============================================================
|
||||
|
||||
-- 운영판 sample 1: W/M ASSY (project_objid=-1752090174, total_prod_qty=4)
|
||||
-- 운영판 sample 2: O-RING (project_objid=1157387151, total_prod_qty=5)
|
||||
|
||||
INSERT INTO production_plan
|
||||
(objid, project_objid, product_code, category_code, production_type, customer_objid,
|
||||
req_del_date, part_no, part_name, serial_no,
|
||||
order_qty, extra_prod_qty, total_prod_qty,
|
||||
customer_request, status, regdate, writer, moddate, modifier)
|
||||
VALUES
|
||||
('1058002488', '-1752090174', '0001807', '0001792', '0001833', '0000007555',
|
||||
'2026-04-06', '11030-0059', 'W/M ASSY (RWMR1070-NO07 LH)', NULL,
|
||||
'2', '2', '4',
|
||||
'납기 준수 必', 'active', '2026-03-19 06:36:13.087597', 'jsm1014', NULL, NULL),
|
||||
('1439133152', '1157387151', '0001539', '0001791', '0001833', '0000010054',
|
||||
'2026-03-24', '000AN033000', 'O-RING',
|
||||
'item-001001, item-001002, item-001003, item-001004, item-001005, item-001006, item-001007, item-001008, item-001009, item-001010',
|
||||
'1', '4', '5',
|
||||
NULL, 'active', '2026-03-24 01:52:10.332136', 'plm_admin',
|
||||
'2026-03-24 01:53:47.912482', 'plm_admin')
|
||||
ON CONFLICT (objid) DO NOTHING;
|
||||
@@ -0,0 +1,40 @@
|
||||
-- ============================================================
|
||||
-- 운영판 wace 211.115.91.141:11133 production_plan 1:1 추출
|
||||
-- 추출일: 2026-05-13
|
||||
-- 추출 명령: psql ... -c "\d production_plan"
|
||||
--
|
||||
-- 용도: 생산관리>M-BOM 관리 PR-A2 의 getProjectMgmtDetail.TOTAL_PROD_QTY 서브쿼리 의존
|
||||
-- COALESCE((SELECT NULLIF(PP.TOTAL_PROD_QTY,'')::numeric
|
||||
-- FROM PRODUCTION_PLAN PP
|
||||
-- WHERE PP.PROJECT_OBJID = PM.OBJID
|
||||
-- AND UPPER(PP.STATUS) = 'ACTIVE' LIMIT 1),
|
||||
-- COALESCE(NULLIF(PM.QUANTITY,'')::numeric, 0)) AS TOTAL_PROD_QTY
|
||||
-- ============================================================
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.production_plan (
|
||||
objid character varying(50) NOT NULL,
|
||||
project_objid character varying(50),
|
||||
product_code character varying(50),
|
||||
category_code character varying(50),
|
||||
production_type character varying(50),
|
||||
customer_objid character varying(50),
|
||||
req_del_date character varying(20),
|
||||
part_no character varying(100),
|
||||
part_name character varying(200),
|
||||
serial_no character varying(500),
|
||||
order_qty character varying(20) DEFAULT '0',
|
||||
extra_prod_qty character varying(20) DEFAULT '0',
|
||||
total_prod_qty character varying(20) DEFAULT '0',
|
||||
customer_request character varying(500),
|
||||
status character varying(20) DEFAULT 'active',
|
||||
regdate timestamp without time zone DEFAULT now(),
|
||||
writer character varying(50),
|
||||
moddate timestamp without time zone,
|
||||
modifier character varying(50),
|
||||
CONSTRAINT production_plan_pkey PRIMARY KEY (objid)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_production_plan_customer ON public.production_plan USING btree (customer_objid);
|
||||
CREATE INDEX IF NOT EXISTS idx_production_plan_project ON public.production_plan USING btree (project_objid);
|
||||
CREATE INDEX IF NOT EXISTS idx_production_plan_regdate ON public.production_plan USING btree (regdate);
|
||||
CREATE INDEX IF NOT EXISTS idx_production_plan_status ON public.production_plan USING btree (status);
|
||||
Reference in New Issue
Block a user