diff --git a/WebContent/WEB-INF/classes/com/pms/mapper/productionplanning.xml b/WebContent/WEB-INF/classes/com/pms/mapper/productionplanning.xml
index cb0e8d0..fbadf53 100644
--- a/WebContent/WEB-INF/classes/com/pms/mapper/productionplanning.xml
+++ b/WebContent/WEB-INF/classes/com/pms/mapper/productionplanning.xml
@@ -3039,6 +3039,53 @@
WHERE 1=1
AND PM.PROJECT_NO IS NOT NULL
AND PM.PROJECT_NO != ''
+
+
+ AND CM.CATEGORY_CD = #{search_category_cd}
+
+
+
+ AND CM.PRODUCT = #{search_product_cd}
+
+
+
+ AND CODE_NAME(CM.AREA_CD) = #{search_area_cd}
+
+
+
+ = TO_DATE(#{search_receipt_date_from}, 'YYYY-MM-DD')]]>
+
+
+
+
+
+
+ AND (
+ CM.CUSTOMER_OBJID = #{search_customer_objid}
+ OR CM.CUSTOMER_OBJID = REPLACE(#{search_customer_objid}, 'C_', '')
+ OR 'C_' || CM.CUSTOMER_OBJID = #{search_customer_objid}
+ )
+
+
+
+ AND CM.PAID_TYPE = #{search_paid_type}
+
+
+
+ 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}) || '%'
+ )
+
+
+
+ = #{search_req_del_date_from}]]>
+
+
+
+
AND (
@@ -4406,134 +4453,161 @@
@@ -4650,4 +4724,71 @@
WHERE OBJID = #{OBJID}
+
+
+
+
+
+ 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}
+ )
+
+
+
+
+ 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}
+
+
diff --git a/WebContent/WEB-INF/classes/com/pms/mapper/quality.xml b/WebContent/WEB-INF/classes/com/pms/mapper/quality.xml
index 993b93d..d1f2eaa 100644
--- a/WebContent/WEB-INF/classes/com/pms/mapper/quality.xml
+++ b/WebContent/WEB-INF/classes/com/pms/mapper/quality.xml
@@ -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
+
+
+ AND CM.PRODUCT = #{search_product_cd}
+
+
+
+
+ AND IID.INSPECTION_YN_COUNT > 0
+
+
+ AND IID.SKIP_YN_COUNT > 0 AND IID.INSPECTION_YN_COUNT = 0
+
+
+
+
+
+ AND REQ.DELIVERY_TOTAL_COUNT > 0 AND REQ.SELECTED_COUNT = 0
+
+
+ AND REQ.SELECTED_COUNT > 0 AND REQ.SELECTED_COUNT REQ.DELIVERY_TOTAL_COUNT
+
+
+ AND REQ.DELIVERY_TOTAL_COUNT > 0 AND REQ.SELECTED_COUNT = REQ.DELIVERY_TOTAL_COUNT
+
+
+
+
+
+ AND DEFECT.DEFECT_TOTAL_COUNT > 0 AND DEFECT.DEFECT_TOTAL_COUNT = DEFECT.ACTION_RESULT_COUNT
+
+
+ AND DEFECT.ACTION_RESULT_COUNT > 0 AND DEFECT.DEFECT_TOTAL_COUNT != DEFECT.ACTION_RESULT_COUNT
+
+
ORDER BY POM.REGDATE DESC
@@ -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
diff --git a/WebContent/WEB-INF/view/productionplanning/mBomMgmtList.jsp b/WebContent/WEB-INF/view/productionplanning/mBomMgmtList.jsp
index 0e559fb..58bd93e 100644
--- a/WebContent/WEB-INF/view/productionplanning/mBomMgmtList.jsp
+++ b/WebContent/WEB-INF/view/productionplanning/mBomMgmtList.jsp
@@ -660,25 +660,87 @@ function fn_openPurchaseListPopup() {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ~
+
+
+
+
+
+
+ ~
+
+
+
+
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
diff --git a/WebContent/WEB-INF/view/quality/incomingInspectionList.jsp b/WebContent/WEB-INF/view/quality/incomingInspectionList.jsp
index 4e3716d..f2a1933 100644
--- a/WebContent/WEB-INF/view/quality/incomingInspectionList.jsp
+++ b/WebContent/WEB-INF/view/quality/incomingInspectionList.jsp
@@ -259,6 +259,33 @@ function fn_deliveryAcceptanceViewPopUp(objId,DELIVERY_STATUS){
+ |
+
+
+ |
+
+ |
+
+
+ |
+
+ |
+
+
+ |
+
|
|
diff --git a/WebContent/WEB-INF/view/quality/incomingInspectionProgressList.jsp b/WebContent/WEB-INF/view/quality/incomingInspectionProgressList.jsp
index fe593b9..d754792 100644
--- a/WebContent/WEB-INF/view/quality/incomingInspectionProgressList.jsp
+++ b/WebContent/WEB-INF/view/quality/incomingInspectionProgressList.jsp
@@ -320,6 +320,14 @@ function fn_deliveryAcceptanceViewPopUp(objId,DELIVERY_STATUS){
+ |
+
+
+ |
+
|
|
@@ -329,12 +337,12 @@ function fn_deliveryAcceptanceViewPopUp(objId,DELIVERY_STATUS){
- |
+ |
- |
diff --git a/src/com/pms/controller/ProductionPlanningController.java b/src/com/pms/controller/ProductionPlanningController.java
index 41b40c5..c9280c9 100644
--- a/src/com/pms/controller/ProductionPlanningController.java
+++ b/src/com/pms/controller/ProductionPlanningController.java
@@ -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();
diff --git a/src/com/pms/controller/QualityController.java b/src/com/pms/controller/QualityController.java
index 56bb747..0b1b72f 100644
--- a/src/com/pms/controller/QualityController.java
+++ b/src/com/pms/controller/QualityController.java
@@ -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) {
diff --git a/src/com/pms/mapper/productionplanning.xml b/src/com/pms/mapper/productionplanning.xml
index 33ea7d3..fbadf53 100644
--- a/src/com/pms/mapper/productionplanning.xml
+++ b/src/com/pms/mapper/productionplanning.xml
@@ -3039,6 +3039,53 @@
WHERE 1=1
AND PM.PROJECT_NO IS NOT NULL
AND PM.PROJECT_NO != ''
+
+
+ AND CM.CATEGORY_CD = #{search_category_cd}
+
+
+
+ AND CM.PRODUCT = #{search_product_cd}
+
+
+
+ AND CODE_NAME(CM.AREA_CD) = #{search_area_cd}
+
+
+
+ = TO_DATE(#{search_receipt_date_from}, 'YYYY-MM-DD')]]>
+
+
+
+
+
+
+ AND (
+ CM.CUSTOMER_OBJID = #{search_customer_objid}
+ OR CM.CUSTOMER_OBJID = REPLACE(#{search_customer_objid}, 'C_', '')
+ OR 'C_' || CM.CUSTOMER_OBJID = #{search_customer_objid}
+ )
+
+
+
+ AND CM.PAID_TYPE = #{search_paid_type}
+
+
+
+ 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}) || '%'
+ )
+
+
+
+ = #{search_req_del_date_from}]]>
+
+
+
+
AND (
diff --git a/src/com/pms/mapper/quality.xml b/src/com/pms/mapper/quality.xml
index 4bbcb55..d1f2eaa 100644
--- a/src/com/pms/mapper/quality.xml
+++ b/src/com/pms/mapper/quality.xml
@@ -888,6 +888,40 @@
AND REQ.DELIVERY_TOTAL_COUNT = REQ.SELECTED_COUNT
AND REQ.SELECTED_COUNT > 0
+
+
+ AND CM.PRODUCT = #{search_product_cd}
+
+
+
+
+ AND IID.INSPECTION_YN_COUNT > 0
+
+
+ AND IID.SKIP_YN_COUNT > 0 AND IID.INSPECTION_YN_COUNT = 0
+
+
+
+
+
+ AND REQ.DELIVERY_TOTAL_COUNT > 0 AND REQ.SELECTED_COUNT = 0
+
+
+ AND REQ.SELECTED_COUNT > 0 AND REQ.SELECTED_COUNT REQ.DELIVERY_TOTAL_COUNT
+
+
+ AND REQ.DELIVERY_TOTAL_COUNT > 0 AND REQ.SELECTED_COUNT = REQ.DELIVERY_TOTAL_COUNT
+
+
+
+
+
+ AND DEFECT.DEFECT_TOTAL_COUNT > 0 AND DEFECT.DEFECT_TOTAL_COUNT = DEFECT.ACTION_RESULT_COUNT
+
+
+ AND DEFECT.ACTION_RESULT_COUNT > 0 AND DEFECT.DEFECT_TOTAL_COUNT != DEFECT.ACTION_RESULT_COUNT
+
+
ORDER BY POM.REGDATE DESC