V2025121808 #109
@@ -3039,6 +3039,53 @@
|
||||
WHERE 1=1
|
||||
AND PM.PROJECT_NO IS NOT NULL
|
||||
AND PM.PROJECT_NO != ''
|
||||
<!-- 주문유형 검색 -->
|
||||
<if test="search_category_cd != null and search_category_cd != ''">
|
||||
AND CM.CATEGORY_CD = #{search_category_cd}
|
||||
</if>
|
||||
<!-- 제품구분 검색 -->
|
||||
<if test="search_product_cd != null and search_product_cd != ''">
|
||||
AND CM.PRODUCT = #{search_product_cd}
|
||||
</if>
|
||||
<!-- 국내/해외 검색 -->
|
||||
<if test="search_area_cd != null and search_area_cd != ''">
|
||||
AND CODE_NAME(CM.AREA_CD) = #{search_area_cd}
|
||||
</if>
|
||||
<!-- 접수일 검색 -->
|
||||
<if test="search_receipt_date_from != null and search_receipt_date_from != ''">
|
||||
<![CDATA[AND PM.REGDATE >= TO_DATE(#{search_receipt_date_from}, 'YYYY-MM-DD')]]>
|
||||
</if>
|
||||
<if test="search_receipt_date_to != null and search_receipt_date_to != ''">
|
||||
<![CDATA[AND PM.REGDATE < TO_DATE(#{search_receipt_date_to}, 'YYYY-MM-DD') + INTERVAL '1 day']]>
|
||||
</if>
|
||||
<!-- 고객사 검색 -->
|
||||
<if test="search_customer_objid != null and search_customer_objid != ''">
|
||||
AND (
|
||||
CM.CUSTOMER_OBJID = #{search_customer_objid}
|
||||
OR CM.CUSTOMER_OBJID = REPLACE(#{search_customer_objid}, 'C_', '')
|
||||
OR 'C_' || CM.CUSTOMER_OBJID = #{search_customer_objid}
|
||||
)
|
||||
</if>
|
||||
<!-- 유/무상 검색 -->
|
||||
<if test="search_paid_type != null and search_paid_type != ''">
|
||||
AND CM.PAID_TYPE = #{search_paid_type}
|
||||
</if>
|
||||
<!-- S/N 검색 -->
|
||||
<if test="search_serial_no != null and search_serial_no != ''">
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM CONTRACT_ITEM_SERIAL CIS
|
||||
WHERE CIS.ITEM_OBJID = CI.OBJID
|
||||
AND UPPER(CIS.STATUS) = 'ACTIVE'
|
||||
AND UPPER(CIS.SERIAL_NO) LIKE '%' || UPPER(#{search_serial_no}) || '%'
|
||||
)
|
||||
</if>
|
||||
<!-- 요청납기 검색 -->
|
||||
<if test="search_req_del_date_from != null and search_req_del_date_from != ''">
|
||||
<![CDATA[AND COALESCE(CI.DUE_DATE, PM.DUE_DATE, CM.REQ_DEL_DATE) >= #{search_req_del_date_from}]]>
|
||||
</if>
|
||||
<if test="search_req_del_date_to != null and search_req_del_date_to != ''">
|
||||
<![CDATA[AND COALESCE(CI.DUE_DATE, PM.DUE_DATE, CM.REQ_DEL_DATE) <= #{search_req_del_date_to}]]>
|
||||
</if>
|
||||
<!-- 품번 검색 (대소문자 구분 없음) -->
|
||||
<if test="search_part_no != null and search_part_no != ''">
|
||||
AND (
|
||||
@@ -4406,7 +4453,8 @@
|
||||
|
||||
<!-- 생산계획&실적관리 그리드 목록 조회 -->
|
||||
<select id="prodPlanResultMgmtGridList" parameterType="map" resultType="com.pms.common.UpperKeyMap">
|
||||
|
||||
SELECT * FROM (
|
||||
-- 1. 프로젝트 기반 데이터 (기존)
|
||||
SELECT
|
||||
PM.OBJID,
|
||||
PM.PROJECT_NO,
|
||||
@@ -4420,9 +4468,11 @@
|
||||
(SELECT CODE_NAME FROM COMM_CODE WHERE CODE_ID = CM.CATEGORY_CD LIMIT 1),
|
||||
CM.CATEGORY_CD
|
||||
) AS CATEGORY_CODE_NAME,
|
||||
-- 생산유형 (TODO: 실제 컬럼명 확인 필요)
|
||||
'' AS PRODUCTION_TYPE,
|
||||
'' AS PRODUCTION_TYPE_NAME,
|
||||
COALESCE(PP.PRODUCTION_TYPE, '') AS PRODUCTION_TYPE,
|
||||
COALESCE(
|
||||
(SELECT CODE_NAME FROM COMM_CODE WHERE CODE_ID = PP.PRODUCTION_TYPE LIMIT 1),
|
||||
''
|
||||
) AS PRODUCTION_TYPE_NAME,
|
||||
CM.CUSTOMER_OBJID,
|
||||
COALESCE(
|
||||
CASE
|
||||
@@ -4433,14 +4483,10 @@
|
||||
END,
|
||||
''
|
||||
) AS CUSTOMER_NAME,
|
||||
-- 요청납기
|
||||
COALESCE(CI.DUE_DATE, PM.DUE_DATE, CM.REQ_DEL_DATE) AS REQ_DEL_DATE,
|
||||
-- 고객사요청사항
|
||||
COALESCE(CI.CUSTOMER_REQUEST, '') AS CUSTOMER_REQUEST,
|
||||
-- 품번/품명
|
||||
COALESCE(CI.PART_NO, PM.PART_NO, '') AS PART_NO,
|
||||
COALESCE(CI.PART_NAME, PM.PART_NAME, '') AS PART_NAME,
|
||||
-- S/N
|
||||
(SELECT
|
||||
CASE
|
||||
WHEN COUNT(*) = 0 THEN ''
|
||||
@@ -4451,89 +4497,117 @@
|
||||
WHERE CIS.ITEM_OBJID = CI.OBJID
|
||||
AND UPPER(CIS.STATUS) = 'ACTIVE'
|
||||
AND CIS.SERIAL_NO IS NOT NULL) AS SERIAL_NO,
|
||||
-- 수주수량
|
||||
COALESCE(PM.QUANTITY::numeric, CI.ORDER_QUANTITY::numeric, 0) AS QUANTITY,
|
||||
-- 추가생산수량 (TODO: 실제 테이블/컬럼 확인 필요)
|
||||
0 AS EXTRA_PROD_QTY,
|
||||
-- 총생산수량 (수주수량 + 추가생산수량)
|
||||
COALESCE(PM.QUANTITY::numeric, CI.ORDER_QUANTITY::numeric, 0) AS TOTAL_PROD_QTY,
|
||||
-- 완조립 수량 (TODO: 실제 테이블/컬럼 확인 필요)
|
||||
COALESCE(NULLIF(PM.QUANTITY, '')::numeric, NULLIF(CI.ORDER_QUANTITY, '')::numeric, 0) AS QUANTITY,
|
||||
COALESCE(NULLIF(PP.EXTRA_PROD_QTY, '')::numeric, 0) AS EXTRA_PROD_QTY,
|
||||
COALESCE(NULLIF(PM.QUANTITY, '')::numeric, NULLIF(CI.ORDER_QUANTITY, '')::numeric, 0) + COALESCE(NULLIF(PP.EXTRA_PROD_QTY, '')::numeric, 0) AS TOTAL_PROD_QTY,
|
||||
0 AS ASSEMBLY_QTY,
|
||||
-- 검사 수량 (TODO: 실제 테이블/컬럼 확인 필요)
|
||||
0 AS INSPECTION_QTY,
|
||||
-- 출하대기 수량 (TODO: 실제 테이블/컬럼 확인 필요)
|
||||
0 AS SHIP_WAIT_QTY,
|
||||
-- 장비조립WBS (TODO: 실제 테이블/컬럼 확인 필요)
|
||||
'' AS EQUIPMENT_WBS,
|
||||
-- 생산계획 OBJID (있으면 수정, 없으면 신규)
|
||||
NULL AS PROD_PLAN_OBJID
|
||||
PP.OBJID AS PROD_PLAN_OBJID,
|
||||
PM.REGDATE AS SORT_DATE
|
||||
FROM
|
||||
PROJECT_MGMT PM
|
||||
LEFT JOIN CONTRACT_MGMT CM ON PM.CONTRACT_OBJID = CM.OBJID
|
||||
LEFT OUTER JOIN CONTRACT_ITEM CI ON PM.CONTRACT_OBJID = CI.CONTRACT_OBJID
|
||||
AND PM.PART_OBJID = CI.PART_OBJID
|
||||
AND CI.STATUS = 'ACTIVE'
|
||||
LEFT OUTER JOIN PRODUCTION_PLAN PP ON PP.PROJECT_OBJID = PM.OBJID
|
||||
AND PP.STATUS = 'active'
|
||||
WHERE PM.PROJECT_NO IS NOT NULL AND PM.PROJECT_NO != ''
|
||||
|
||||
UNION ALL
|
||||
|
||||
-- 2. 프로젝트 없이 등록한 생산계획
|
||||
SELECT
|
||||
PP.OBJID AS OBJID,
|
||||
'' AS PROJECT_NO,
|
||||
PP.PRODUCT_CODE AS PRODUCT,
|
||||
COALESCE(
|
||||
(SELECT CODE_NAME FROM COMM_CODE WHERE CODE_ID = PP.PRODUCT_CODE LIMIT 1),
|
||||
''
|
||||
) AS PRODUCT_NAME,
|
||||
PP.CATEGORY_CODE AS CATEGORY_CODE,
|
||||
COALESCE(
|
||||
(SELECT CODE_NAME FROM COMM_CODE WHERE CODE_ID = PP.CATEGORY_CODE LIMIT 1),
|
||||
''
|
||||
) AS CATEGORY_CODE_NAME,
|
||||
COALESCE(PP.PRODUCTION_TYPE, '') AS PRODUCTION_TYPE,
|
||||
COALESCE(
|
||||
(SELECT CODE_NAME FROM COMM_CODE WHERE CODE_ID = PP.PRODUCTION_TYPE LIMIT 1),
|
||||
''
|
||||
) AS PRODUCTION_TYPE_NAME,
|
||||
PP.CUSTOMER_OBJID,
|
||||
COALESCE(
|
||||
(SELECT CLIENT_NM FROM CLIENT_MNG WHERE OBJID::VARCHAR = PP.CUSTOMER_OBJID LIMIT 1),
|
||||
''
|
||||
) AS CUSTOMER_NAME,
|
||||
PP.REQ_DEL_DATE,
|
||||
COALESCE(PP.CUSTOMER_REQUEST, '') AS CUSTOMER_REQUEST,
|
||||
COALESCE(PP.PART_NO, '') AS PART_NO,
|
||||
COALESCE(PP.PART_NAME, '') AS PART_NAME,
|
||||
COALESCE(PP.SERIAL_NO, '') AS SERIAL_NO,
|
||||
COALESCE(NULLIF(PP.ORDER_QTY, '')::numeric, 0) AS QUANTITY,
|
||||
COALESCE(NULLIF(PP.EXTRA_PROD_QTY, '')::numeric, 0) AS EXTRA_PROD_QTY,
|
||||
COALESCE(NULLIF(PP.TOTAL_PROD_QTY, '')::numeric, 0) AS TOTAL_PROD_QTY,
|
||||
0 AS ASSEMBLY_QTY,
|
||||
0 AS INSPECTION_QTY,
|
||||
0 AS SHIP_WAIT_QTY,
|
||||
'' AS EQUIPMENT_WBS,
|
||||
PP.OBJID AS PROD_PLAN_OBJID,
|
||||
PP.REGDATE AS SORT_DATE
|
||||
FROM PRODUCTION_PLAN PP
|
||||
WHERE PP.STATUS = 'active'
|
||||
AND (PP.PROJECT_OBJID IS NULL OR PP.PROJECT_OBJID = '')
|
||||
) T
|
||||
WHERE 1=1
|
||||
AND PM.PROJECT_NO IS NOT NULL
|
||||
AND PM.PROJECT_NO != ''
|
||||
<!-- 프로젝트번호 검색 (multiple select) -->
|
||||
<if test="search_project_nos != null and search_project_nos != ''">
|
||||
AND PM.OBJID::VARCHAR IN
|
||||
AND T.OBJID::VARCHAR IN
|
||||
<foreach item="projNo" collection="search_project_nos.split(',')" open="(" separator="," close=")">
|
||||
#{projNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 제품구분 검색 -->
|
||||
<if test="search_product_code != null and search_product_code != ''">
|
||||
AND CM.PRODUCT = #{search_product_code}
|
||||
AND T.PRODUCT = #{search_product_code}
|
||||
</if>
|
||||
<!-- 주문유형 검색 -->
|
||||
<if test="search_category_code != null and search_category_code != ''">
|
||||
AND CM.CATEGORY_CD = #{search_category_code}
|
||||
AND T.CATEGORY_CODE = #{search_category_code}
|
||||
</if>
|
||||
<!-- 생산유형 검색 -->
|
||||
<if test="search_production_type != null and search_production_type != ''">
|
||||
AND 1=1 <!-- TODO: 생산유형 컬럼 확인 후 조건 추가 -->
|
||||
AND T.PRODUCTION_TYPE = #{search_production_type}
|
||||
</if>
|
||||
<!-- 고객사 검색 (C_ 접두사 처리) -->
|
||||
<!-- 고객사 검색 -->
|
||||
<if test="search_customer_objid != null and search_customer_objid != ''">
|
||||
AND (
|
||||
CM.CUSTOMER_OBJID = #{search_customer_objid}
|
||||
OR CM.CUSTOMER_OBJID = REPLACE(#{search_customer_objid}, 'C_', '')
|
||||
OR REPLACE(CM.CUSTOMER_OBJID, 'C_', '') = REPLACE(#{search_customer_objid}, 'C_', '')
|
||||
T.CUSTOMER_OBJID = #{search_customer_objid}
|
||||
OR T.CUSTOMER_OBJID = REPLACE(#{search_customer_objid}, 'C_', '')
|
||||
OR REPLACE(T.CUSTOMER_OBJID, 'C_', '') = REPLACE(#{search_customer_objid}, 'C_', '')
|
||||
)
|
||||
</if>
|
||||
<!-- 요청납기 검색 -->
|
||||
<if test="search_req_del_date_from != null and search_req_del_date_from != ''">
|
||||
AND COALESCE(CI.DUE_DATE, PM.DUE_DATE, CM.REQ_DEL_DATE) >= #{search_req_del_date_from}
|
||||
AND T.REQ_DEL_DATE >= #{search_req_del_date_from}
|
||||
</if>
|
||||
<if test="search_req_del_date_to != null and search_req_del_date_to != ''">
|
||||
AND COALESCE(CI.DUE_DATE, PM.DUE_DATE, CM.REQ_DEL_DATE) <= #{search_req_del_date_to}
|
||||
AND T.REQ_DEL_DATE <= #{search_req_del_date_to}
|
||||
</if>
|
||||
<!-- 품번 검색 -->
|
||||
<if test="search_part_no != null and search_part_no != ''">
|
||||
AND (
|
||||
UPPER(PM.PART_NO) LIKE '%' || UPPER(#{search_part_no}) || '%'
|
||||
OR UPPER(CI.PART_NO) LIKE '%' || UPPER(#{search_part_no}) || '%'
|
||||
)
|
||||
AND UPPER(T.PART_NO) LIKE '%' || UPPER(#{search_part_no}) || '%'
|
||||
</if>
|
||||
<!-- 품명 검색 -->
|
||||
<if test="search_part_name != null and search_part_name != ''">
|
||||
AND (
|
||||
UPPER(PM.PART_NAME) LIKE '%' || UPPER(#{search_part_name}) || '%'
|
||||
OR UPPER(CI.PART_NAME) LIKE '%' || UPPER(#{search_part_name}) || '%'
|
||||
)
|
||||
AND UPPER(T.PART_NAME) LIKE '%' || UPPER(#{search_part_name}) || '%'
|
||||
</if>
|
||||
<!-- S/N 검색 -->
|
||||
<if test="search_serial_no != null and search_serial_no != ''">
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM CONTRACT_ITEM_SERIAL CIS
|
||||
WHERE CIS.ITEM_OBJID = CI.OBJID
|
||||
AND UPPER(CIS.STATUS) = 'ACTIVE'
|
||||
AND UPPER(CIS.SERIAL_NO) LIKE '%' || UPPER(#{search_serial_no}) || '%'
|
||||
)
|
||||
AND UPPER(T.SERIAL_NO) LIKE '%' || UPPER(#{search_serial_no}) || '%'
|
||||
</if>
|
||||
ORDER BY PM.REGDATE DESC, PM.PROJECT_NO DESC
|
||||
ORDER BY T.SORT_DATE DESC, T.PROJECT_NO DESC
|
||||
</select>
|
||||
|
||||
<!-- 프로젝트 정보 조회 (생산계획 폼용) -->
|
||||
@@ -4650,4 +4724,71 @@
|
||||
WHERE OBJID = #{OBJID}
|
||||
</update>
|
||||
|
||||
<!-- 생산실적 목록 조회 -->
|
||||
<select id="getProdResultList" parameterType="map" resultType="com.pms.common.UpperKeyMap">
|
||||
SELECT
|
||||
OBJID,
|
||||
PROJECT_OBJID,
|
||||
RESULT_TYPE,
|
||||
TO_CHAR(RESULT_DATE::DATE, 'YYYY-MM-DD') AS RESULT_DATE,
|
||||
RESULT_QTY,
|
||||
SERIAL_NO,
|
||||
WORKER_ID,
|
||||
WORKER_NAME,
|
||||
REMARK,
|
||||
STATUS
|
||||
FROM PRODUCTION_RESULT
|
||||
WHERE PROJECT_OBJID = #{projectObjid}
|
||||
AND STATUS = 'active'
|
||||
<if test="resultType != null and resultType != ''">
|
||||
AND RESULT_TYPE = #{resultType}
|
||||
</if>
|
||||
ORDER BY RESULT_DATE DESC, REGDATE DESC
|
||||
</select>
|
||||
|
||||
<!-- 생산실적 등록 -->
|
||||
<insert id="insertProdResult" parameterType="map">
|
||||
INSERT INTO PRODUCTION_RESULT (
|
||||
OBJID,
|
||||
PROJECT_OBJID,
|
||||
RESULT_TYPE,
|
||||
RESULT_DATE,
|
||||
RESULT_QTY,
|
||||
SERIAL_NO,
|
||||
WORKER_ID,
|
||||
WORKER_NAME,
|
||||
REMARK,
|
||||
STATUS,
|
||||
REGDATE,
|
||||
WRITER
|
||||
) VALUES (
|
||||
#{OBJID},
|
||||
#{PROJECT_OBJID},
|
||||
#{RESULT_TYPE},
|
||||
#{RESULT_DATE},
|
||||
#{RESULT_QTY},
|
||||
#{SERIAL_NO},
|
||||
#{userId},
|
||||
#{WORKER_NAME},
|
||||
#{REMARK},
|
||||
'active',
|
||||
NOW(),
|
||||
#{userId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 생산실적 수정 -->
|
||||
<update id="updateProdResult" parameterType="map">
|
||||
UPDATE PRODUCTION_RESULT SET
|
||||
RESULT_TYPE = #{RESULT_TYPE},
|
||||
RESULT_DATE = #{RESULT_DATE},
|
||||
RESULT_QTY = #{RESULT_QTY},
|
||||
SERIAL_NO = #{SERIAL_NO},
|
||||
WORKER_NAME = #{WORKER_NAME},
|
||||
REMARK = #{REMARK},
|
||||
MODDATE = NOW(),
|
||||
MODIFIER = #{userId}
|
||||
WHERE OBJID = #{OBJID}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -711,10 +711,9 @@
|
||||
,DEFECT.INSPECTOR_NAME_DISPLAY AS INSPECTOR_NAME
|
||||
/* 검사일: YYYY-MM-DD 외 N건 형태 */
|
||||
,DEFECT.INSPECTION_DATE_DISPLAY AS INSPECTION_DATE
|
||||
/* 검사결과: 하나라도 NG면 NG, 검사 대상(스킵 제외) 모두 검사완료면 OK, 일부만 검사면 검사중 */
|
||||
,(CASE WHEN DEFECT.NG_COUNT > 0 THEN 'NG'
|
||||
WHEN DEFECT.INSPECTION_TARGET_COUNT > 0 AND DEFECT.INSPECTION_TARGET_COUNT = DEFECT.INSPECTED_COUNT THEN 'OK'
|
||||
WHEN DEFECT.INSPECTED_COUNT > 0 THEN '검사중'
|
||||
/* 검사현황: 불량상세 처리결과(ACTION_RESULT)가 전부 있으면 완료, 일부만 있으면 진행중 */
|
||||
,(CASE WHEN DEFECT.DEFECT_TOTAL_COUNT > 0 AND DEFECT.DEFECT_TOTAL_COUNT = DEFECT.ACTION_RESULT_COUNT THEN '완료'
|
||||
WHEN DEFECT.ACTION_RESULT_COUNT > 0 THEN '진행중'
|
||||
ELSE '' END) AS INSPECTION_RESULT
|
||||
|
||||
/* 검사여부: 검사가 하나라도 있으면 '검사', 모두 스킵이면 '스킵', 아무것도 없으면 빈값 */
|
||||
@@ -764,6 +763,10 @@
|
||||
END AS INSPECTION_DATE_DISPLAY
|
||||
/* 검사 대상 건수 (스킵 제외, 검사인 항목만) */
|
||||
,COUNT(CASE WHEN IID2.INSPECTION_YN = '검사' THEN 1 END) AS INSPECTION_TARGET_COUNT
|
||||
/* 불량상세 테이블 전체 건수 (검사인 항목 기준) */
|
||||
,COUNT(CASE WHEN IID2.INSPECTION_YN = '검사' THEN IDF.OBJID END) AS DEFECT_TOTAL_COUNT
|
||||
/* 처리결과(ACTION_RESULT) 입력된 건수 */
|
||||
,COUNT(CASE WHEN IID2.INSPECTION_YN = '검사' AND IDF.ACTION_RESULT IS NOT NULL AND IDF.ACTION_RESULT != '' THEN 1 END) AS ACTION_RESULT_COUNT
|
||||
/* 검사결과 입력된 건수 */
|
||||
,COUNT(CASE WHEN IDF.INSPECTION_RESULT IS NOT NULL AND IDF.INSPECTION_RESULT != '' THEN 1 END) AS INSPECTED_COUNT
|
||||
,COUNT(CASE WHEN IDF.INSPECTION_RESULT = 'NG' THEN 1 END) AS NG_COUNT
|
||||
@@ -885,6 +888,40 @@
|
||||
AND REQ.DELIVERY_TOTAL_COUNT = REQ.SELECTED_COUNT
|
||||
AND REQ.SELECTED_COUNT > 0
|
||||
</if>
|
||||
<!-- 제품구분 검색 -->
|
||||
<if test="search_product_cd != null and search_product_cd != ''">
|
||||
AND CM.PRODUCT = #{search_product_cd}
|
||||
</if>
|
||||
<!-- 검사여부 검색 -->
|
||||
<if test="search_inspection_yn != null and search_inspection_yn != ''">
|
||||
<if test="search_inspection_yn == '검사'">
|
||||
AND IID.INSPECTION_YN_COUNT > 0
|
||||
</if>
|
||||
<if test="search_inspection_yn == '스킵'">
|
||||
AND IID.SKIP_YN_COUNT > 0 AND IID.INSPECTION_YN_COUNT = 0
|
||||
</if>
|
||||
</if>
|
||||
<!-- 요청현황 검색 -->
|
||||
<if test="search_request_status != null and search_request_status != ''">
|
||||
<if test="search_request_status == '미요청'">
|
||||
AND REQ.DELIVERY_TOTAL_COUNT > 0 AND REQ.SELECTED_COUNT = 0
|
||||
</if>
|
||||
<if test="search_request_status == '요청중'">
|
||||
AND REQ.SELECTED_COUNT > 0 AND REQ.SELECTED_COUNT <![CDATA[ < ]]> REQ.DELIVERY_TOTAL_COUNT
|
||||
</if>
|
||||
<if test="search_request_status == '요청완료'">
|
||||
AND REQ.DELIVERY_TOTAL_COUNT > 0 AND REQ.SELECTED_COUNT = REQ.DELIVERY_TOTAL_COUNT
|
||||
</if>
|
||||
</if>
|
||||
<!-- 검사현황 검색 -->
|
||||
<if test="search_inspection_status != null and search_inspection_status != ''">
|
||||
<if test="search_inspection_status == '완료'">
|
||||
AND DEFECT.DEFECT_TOTAL_COUNT > 0 AND DEFECT.DEFECT_TOTAL_COUNT = DEFECT.ACTION_RESULT_COUNT
|
||||
</if>
|
||||
<if test="search_inspection_status == '진행중'">
|
||||
AND DEFECT.ACTION_RESULT_COUNT > 0 AND DEFECT.DEFECT_TOTAL_COUNT != DEFECT.ACTION_RESULT_COUNT
|
||||
</if>
|
||||
</if>
|
||||
ORDER BY POM.REGDATE DESC
|
||||
</select>
|
||||
|
||||
@@ -1108,6 +1145,7 @@
|
||||
FROM PROCESS_INSPECTION_DETAIL PID WHERE PID.MASTER_OBJID = PIM.OBJID
|
||||
) AS INSPECTION_RESULT
|
||||
, PIM.REMARK
|
||||
, (SELECT COUNT(*) FROM ATTACH_FILE_INFO F WHERE F.TARGET_OBJID = PIM.OBJID AND F.DOC_TYPE = 'PROCESS_INSPECTION_FILE' AND UPPER(F.STATUS) = 'ACTIVE') AS PROCESS_INSPECTION_FILE_CNT
|
||||
FROM PROCESS_INSPECTION_MASTER PIM
|
||||
WHERE 1=1
|
||||
/* 프로젝트번호 */
|
||||
@@ -2317,6 +2355,14 @@
|
||||
, IID.REMARK
|
||||
, IMI.PURCHASE_ORDER_MASTER_OBJID
|
||||
, POM.PURCHASE_ORDER_NO
|
||||
/* 불량수량 합계 (INCOMING_INSPECTION_DETAIL.DEFECT_QTY에 저장된 값 사용) */
|
||||
, COALESCE(NULLIF(IID.DEFECT_QTY, '')::NUMERIC, 0) AS DEFECT_QTY_SUM
|
||||
/* 불량율 (불량수량합계 / 입고수량 * 100) */
|
||||
, CASE WHEN IMI.RECEIPT_QTY::NUMERIC > 0
|
||||
THEN ROUND(COALESCE(NULLIF(IID.DEFECT_QTY, '')::NUMERIC, 0) / IMI.RECEIPT_QTY::NUMERIC * 100, 2)
|
||||
ELSE NULL END AS LEFT_DEFECT_RATE
|
||||
/* 검사성적서 파일 수 */
|
||||
, (SELECT COUNT(*) FROM ATTACH_FILE_INFO AFI WHERE AFI.TARGET_OBJID = IID.OBJID AND AFI.DOC_TYPE = 'INSPECTION_REPORT' AND UPPER(AFI.STATUS) = 'ACTIVE') AS INSPECTION_FILE_CNT
|
||||
FROM INVENTORY_MGMT_IN IMI
|
||||
INNER JOIN INVENTORY_MGMT IM ON IM.OBJID = IMI.PARENT_OBJID
|
||||
INNER JOIN PART_MNG PM ON PM.OBJID::VARCHAR = IM.PART_OBJID
|
||||
|
||||
@@ -660,24 +660,86 @@ function fn_openPurchaseListPopup() {
|
||||
|
||||
<!-- 검색 영역 -->
|
||||
<div id="plmSearchZon">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="label"><label for="search_part_no">품번</label></td>
|
||||
<td><input type="text" name="search_part_no" id="search_part_no" value=""></td>
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 10px 15px; align-items: center;">
|
||||
<!-- 주문유형 -->
|
||||
<div style="display: flex; align-items: center; gap: 5px;">
|
||||
<label for="search_category_cd">주문유형</label>
|
||||
<select name="search_category_cd" id="search_category_cd" style="width:120px" class="select2">
|
||||
<option value="">선택</option>
|
||||
${code_map.category_cd}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<td class="label"><label for="search_part_name">품명</label></td>
|
||||
<td><input type="text" name="search_part_name" id="search_part_name" value=""></td>
|
||||
</tr>
|
||||
<%--
|
||||
<tr>
|
||||
<td class="label"><label for="search_mbom_part_no">M-BOM 품번</label></td>
|
||||
<td><input type="text" name="search_mbom_part_no" id="search_mbom_part_no" value="${param.search_mbom_part_no}"></td>
|
||||
<!-- 제품구분 -->
|
||||
<div style="display: flex; align-items: center; gap: 5px;">
|
||||
<label for="search_product_cd">제품구분</label>
|
||||
<select name="search_product_cd" id="search_product_cd" style="width:120px" class="select2">
|
||||
<option value="">선택</option>
|
||||
${code_map.product_cd}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<td class="label"><label for="search_save_date">저장일</label></td>
|
||||
<td><input type="date" name="search_save_date" id="search_save_date" value="${param.search_save_date}"></td>
|
||||
</tr>
|
||||
--%>
|
||||
</table>
|
||||
<!-- 국내/해외 -->
|
||||
<div style="display: flex; align-items: center; gap: 5px;">
|
||||
<label for="search_area_cd">국내/해외</label>
|
||||
<select name="search_area_cd" id="search_area_cd" style="width:100px" class="select2">
|
||||
<option value="">선택</option>
|
||||
<option value="국내">국내</option>
|
||||
<option value="해외">해외</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- 고객사 -->
|
||||
<div style="display: flex; align-items: center; gap: 5px;">
|
||||
<label for="search_customer_objid">고객사</label>
|
||||
<select name="search_customer_objid" id="search_customer_objid" style="width:150px" class="select2">
|
||||
<option value="">선택</option>
|
||||
${code_map.customer_cd}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- 유/무상 -->
|
||||
<div style="display: flex; align-items: center; gap: 5px;">
|
||||
<label for="search_paid_type">유/무상</label>
|
||||
<select name="search_paid_type" id="search_paid_type" style="width:80px" class="select2">
|
||||
<option value="">선택</option>
|
||||
<option value="paid">유상</option>
|
||||
<option value="free">무상</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- S/N -->
|
||||
<div style="display: flex; align-items: center; gap: 5px;">
|
||||
<label for="search_serial_no">S/N</label>
|
||||
<input type="text" name="search_serial_no" id="search_serial_no" value="" style="width:100px;">
|
||||
</div>
|
||||
|
||||
<!-- 품번 -->
|
||||
<div style="display: flex; align-items: center; gap: 5px;">
|
||||
<label for="search_part_no">품번</label>
|
||||
<input type="text" name="search_part_no" id="search_part_no" value="" style="width:150px;">
|
||||
</div>
|
||||
|
||||
<!-- 품명 -->
|
||||
<div style="display: flex; align-items: center; gap: 5px;">
|
||||
<label for="search_part_name">품명</label>
|
||||
<input type="text" name="search_part_name" id="search_part_name" value="" style="width:150px;">
|
||||
</div>
|
||||
|
||||
<!-- 접수일 -->
|
||||
<div style="display: flex; align-items: center; gap: 5px;">
|
||||
<label>접수일</label>
|
||||
<input type="text" name="search_receipt_date_from" id="search_receipt_date_from" autocomplete="off" value="" class="date_icon" style="width:90px;"> ~
|
||||
<input type="text" name="search_receipt_date_to" id="search_receipt_date_to" autocomplete="off" value="" class="date_icon" style="width:90px;">
|
||||
</div>
|
||||
|
||||
<!-- 요청납기 -->
|
||||
<div style="display: flex; align-items: center; gap: 5px;">
|
||||
<label>요청납기</label>
|
||||
<input type="text" name="search_req_del_date_from" id="search_req_del_date_from" autocomplete="off" value="" class="date_icon" style="width:90px;"> ~
|
||||
<input type="text" name="search_req_del_date_to" id="search_req_del_date_to" autocomplete="off" value="" class="date_icon" style="width:90px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 그리드 영역 -->
|
||||
|
||||
@@ -259,6 +259,33 @@ function fn_deliveryAcceptanceViewPopUp(objId,DELIVERY_STATUS){
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label for="">제품구분</label></td>
|
||||
<td>
|
||||
<select name="search_product_cd" id="search_product_cd" class="select2" autocomplete="off" style="width:120px;">
|
||||
<option value="">전체</option>
|
||||
${code_map.product_cd}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label for="">검사여부</label></td>
|
||||
<td>
|
||||
<select name="search_inspection_yn" id="search_inspection_yn" class="select2" autocomplete="off" style="width:120px;">
|
||||
<option value="">전체</option>
|
||||
<option value="검사">검사</option>
|
||||
<option value="스킵">스킵</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label for="">요청현황</label></td>
|
||||
<td>
|
||||
<select name="search_request_status" id="search_request_status" class="select2" autocomplete="off" style="width:120px;">
|
||||
<option value="">전체</option>
|
||||
<option value="미요청">미요청</option>
|
||||
<option value="요청중">요청중</option>
|
||||
<option value="요청완료">요청완료</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label for="">요청자</label></td>
|
||||
<td><select name="request_user_id" id="request_user_id" class="select2" autocomplete="off" style="width:120px;"><option value="">선택</option>${code_map.request_user_id}</select></td>
|
||||
|
||||
|
||||
@@ -320,6 +320,14 @@ function fn_deliveryAcceptanceViewPopUp(objId,DELIVERY_STATUS){
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label for="">제품구분</label></td>
|
||||
<td>
|
||||
<select name="search_product_cd" id="search_product_cd" class="select2" autocomplete="off" style="width:120px;">
|
||||
<option value="">전체</option>
|
||||
${code_map.product_cd}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label for="">검사자</label></td>
|
||||
<td><select name="inspector_id" id="inspector_id" class="select2" autocomplete="off" style="width:120px;"><option value="">선택</option>${code_map.inspector_id}</select></td>
|
||||
|
||||
@@ -329,12 +337,12 @@ function fn_deliveryAcceptanceViewPopUp(objId,DELIVERY_STATUS){
|
||||
<input type="text" name="inspection_end_date" id="inspection_end_date" style="width:100px;" autocomplete="off" value="${param.inspection_end_date }" class="date_icon">
|
||||
</td>
|
||||
|
||||
<td><label for="">검사결과</label></td>
|
||||
<td><label for="">검사현황</label></td>
|
||||
<td>
|
||||
<select name="search_inspection_result" id="search_inspection_result" class="select2" autocomplete="off" style="width:120px;">
|
||||
<select name="search_inspection_status" id="search_inspection_status" class="select2" autocomplete="off" style="width:120px;">
|
||||
<option value="">전체</option>
|
||||
<option value="OK">OK</option>
|
||||
<option value="NG">NG</option>
|
||||
<option value="완료">완료</option>
|
||||
<option value="진행중">진행중</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -889,6 +889,15 @@ public class ProductionPlanningController extends BaseService {
|
||||
public String mBomMgmt(HttpServletRequest request, @RequestParam Map paramMap){
|
||||
Map code_map = new HashMap();
|
||||
try{
|
||||
// 주문유형 (0000167)
|
||||
code_map.put("category_cd", commonService.bizMakeOptionList("0000167", (String)paramMap.get("search_category_cd"), "common.getCodeselect"));
|
||||
// 제품구분 (0000001)
|
||||
code_map.put("product_cd", commonService.bizMakeOptionList("0000001", (String)paramMap.get("search_product_cd"), "common.getCodeselect"));
|
||||
// 국내/해외 (0000172)
|
||||
code_map.put("area_cd", commonService.bizMakeOptionList("0000172", (String)paramMap.get("search_area_cd"), "common.getCodeselect"));
|
||||
// 고객사 (SUPPLY_MNG + CLIENT_MNG)
|
||||
code_map.put("customer_cd", commonService.bizMakeOptionList("", (String)paramMap.get("search_customer_objid"), "common.getAllSupplySelect"));
|
||||
|
||||
request.setAttribute("code_map", code_map);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -276,6 +276,8 @@ public class QualityController {
|
||||
code_map.put("partner_objid", commonService.bizMakeOptionList("", (String)paramMap.get("partner_objid"), "common.getClientMngSupplySelect"));
|
||||
// 요청자
|
||||
code_map.put("request_user_id", commonService.bizMakeOptionList("", (String)paramMap.get("request_user_id"), "common.getUserselect"));
|
||||
// 제품구분
|
||||
code_map.put("product_cd", commonService.bizMakeOptionList("0000001", (String)paramMap.get("search_product_cd"), "common.getCodeselect"));
|
||||
|
||||
list = commonService.selectListPaging("quality.getIncomingInspectionList", request, paramMap);
|
||||
} catch(Exception e) {
|
||||
@@ -306,6 +308,8 @@ public class QualityController {
|
||||
code_map.put("partner_objid", commonService.bizMakeOptionList("", (String)paramMap.get("partner_objid"), "common.getClientMngSupplySelect"));
|
||||
// 검사자
|
||||
code_map.put("inspector_id", commonService.bizMakeOptionList("", (String)paramMap.get("inspector_id"), "common.getUserselect"));
|
||||
// 제품구분
|
||||
code_map.put("product_cd", commonService.bizMakeOptionList("0000001", (String)paramMap.get("search_product_cd"), "common.getCodeselect"));
|
||||
|
||||
list = commonService.selectListPaging("quality.getIncomingInspectionList", request, paramMap);
|
||||
} catch(Exception e) {
|
||||
|
||||
@@ -3039,6 +3039,53 @@
|
||||
WHERE 1=1
|
||||
AND PM.PROJECT_NO IS NOT NULL
|
||||
AND PM.PROJECT_NO != ''
|
||||
<!-- 주문유형 검색 -->
|
||||
<if test="search_category_cd != null and search_category_cd != ''">
|
||||
AND CM.CATEGORY_CD = #{search_category_cd}
|
||||
</if>
|
||||
<!-- 제품구분 검색 -->
|
||||
<if test="search_product_cd != null and search_product_cd != ''">
|
||||
AND CM.PRODUCT = #{search_product_cd}
|
||||
</if>
|
||||
<!-- 국내/해외 검색 -->
|
||||
<if test="search_area_cd != null and search_area_cd != ''">
|
||||
AND CODE_NAME(CM.AREA_CD) = #{search_area_cd}
|
||||
</if>
|
||||
<!-- 접수일 검색 -->
|
||||
<if test="search_receipt_date_from != null and search_receipt_date_from != ''">
|
||||
<![CDATA[AND PM.REGDATE >= TO_DATE(#{search_receipt_date_from}, 'YYYY-MM-DD')]]>
|
||||
</if>
|
||||
<if test="search_receipt_date_to != null and search_receipt_date_to != ''">
|
||||
<![CDATA[AND PM.REGDATE < TO_DATE(#{search_receipt_date_to}, 'YYYY-MM-DD') + INTERVAL '1 day']]>
|
||||
</if>
|
||||
<!-- 고객사 검색 -->
|
||||
<if test="search_customer_objid != null and search_customer_objid != ''">
|
||||
AND (
|
||||
CM.CUSTOMER_OBJID = #{search_customer_objid}
|
||||
OR CM.CUSTOMER_OBJID = REPLACE(#{search_customer_objid}, 'C_', '')
|
||||
OR 'C_' || CM.CUSTOMER_OBJID = #{search_customer_objid}
|
||||
)
|
||||
</if>
|
||||
<!-- 유/무상 검색 -->
|
||||
<if test="search_paid_type != null and search_paid_type != ''">
|
||||
AND CM.PAID_TYPE = #{search_paid_type}
|
||||
</if>
|
||||
<!-- S/N 검색 -->
|
||||
<if test="search_serial_no != null and search_serial_no != ''">
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM CONTRACT_ITEM_SERIAL CIS
|
||||
WHERE CIS.ITEM_OBJID = CI.OBJID
|
||||
AND UPPER(CIS.STATUS) = 'ACTIVE'
|
||||
AND UPPER(CIS.SERIAL_NO) LIKE '%' || UPPER(#{search_serial_no}) || '%'
|
||||
)
|
||||
</if>
|
||||
<!-- 요청납기 검색 -->
|
||||
<if test="search_req_del_date_from != null and search_req_del_date_from != ''">
|
||||
<![CDATA[AND COALESCE(CI.DUE_DATE, PM.DUE_DATE, CM.REQ_DEL_DATE) >= #{search_req_del_date_from}]]>
|
||||
</if>
|
||||
<if test="search_req_del_date_to != null and search_req_del_date_to != ''">
|
||||
<![CDATA[AND COALESCE(CI.DUE_DATE, PM.DUE_DATE, CM.REQ_DEL_DATE) <= #{search_req_del_date_to}]]>
|
||||
</if>
|
||||
<!-- 품번 검색 (대소문자 구분 없음) -->
|
||||
<if test="search_part_no != null and search_part_no != ''">
|
||||
AND (
|
||||
|
||||
@@ -888,6 +888,40 @@
|
||||
AND REQ.DELIVERY_TOTAL_COUNT = REQ.SELECTED_COUNT
|
||||
AND REQ.SELECTED_COUNT > 0
|
||||
</if>
|
||||
<!-- 제품구분 검색 -->
|
||||
<if test="search_product_cd != null and search_product_cd != ''">
|
||||
AND CM.PRODUCT = #{search_product_cd}
|
||||
</if>
|
||||
<!-- 검사여부 검색 -->
|
||||
<if test="search_inspection_yn != null and search_inspection_yn != ''">
|
||||
<if test="search_inspection_yn == '검사'">
|
||||
AND IID.INSPECTION_YN_COUNT > 0
|
||||
</if>
|
||||
<if test="search_inspection_yn == '스킵'">
|
||||
AND IID.SKIP_YN_COUNT > 0 AND IID.INSPECTION_YN_COUNT = 0
|
||||
</if>
|
||||
</if>
|
||||
<!-- 요청현황 검색 -->
|
||||
<if test="search_request_status != null and search_request_status != ''">
|
||||
<if test="search_request_status == '미요청'">
|
||||
AND REQ.DELIVERY_TOTAL_COUNT > 0 AND REQ.SELECTED_COUNT = 0
|
||||
</if>
|
||||
<if test="search_request_status == '요청중'">
|
||||
AND REQ.SELECTED_COUNT > 0 AND REQ.SELECTED_COUNT <![CDATA[ < ]]> REQ.DELIVERY_TOTAL_COUNT
|
||||
</if>
|
||||
<if test="search_request_status == '요청완료'">
|
||||
AND REQ.DELIVERY_TOTAL_COUNT > 0 AND REQ.SELECTED_COUNT = REQ.DELIVERY_TOTAL_COUNT
|
||||
</if>
|
||||
</if>
|
||||
<!-- 검사현황 검색 -->
|
||||
<if test="search_inspection_status != null and search_inspection_status != ''">
|
||||
<if test="search_inspection_status == '완료'">
|
||||
AND DEFECT.DEFECT_TOTAL_COUNT > 0 AND DEFECT.DEFECT_TOTAL_COUNT = DEFECT.ACTION_RESULT_COUNT
|
||||
</if>
|
||||
<if test="search_inspection_status == '진행중'">
|
||||
AND DEFECT.ACTION_RESULT_COUNT > 0 AND DEFECT.DEFECT_TOTAL_COUNT != DEFECT.ACTION_RESULT_COUNT
|
||||
</if>
|
||||
</if>
|
||||
ORDER BY POM.REGDATE DESC
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user