feat: 수주기관별 성과 현황에 '미입력', '입력중', '검수대기'를 추가

main
thkim 2025-11-24 10:44:27 +09:00
parent acce2ef9eb
commit d2af9d9d6a
2 changed files with 61 additions and 51 deletions

View File

@ -81,12 +81,14 @@
<select id="selectCompanyPerformanceStats" parameterType="java.util.HashMap" resultType="java.util.HashMap">
SELECT
NVL(T_PI.PROJECT_CONST_COMPANY, '미지정') AS "COMPANY_NAME",
COUNT(T_CSI.CID) AS "TOTAL_PROJECTS",
COUNT(T_CSI.CID) AS "TOTAL_PROJECTS",/* 추가된 컬럼 시작 */
SUM(CASE WHEN T_CSI.PROJECT_STATE_CODE = '0' THEN 1 ELSE 0 END) AS "NOT_ENTERED",
SUM(CASE WHEN T_CSI.PROJECT_STATE_CODE = '1' THEN 1 ELSE 0 END) AS "ENTERING",
SUM(CASE WHEN T_CSI.PROJECT_STATE_CODE = '2' THEN 1 ELSE 0 END) AS "AWAITING_INSPECTION",
SUM(CASE WHEN T_CSI.PROJECT_STATE_CODE = '3' THEN 1 ELSE 0 END) AS "IN_INSPECTION",
SUM(CASE WHEN T_CSI.PROJECT_STATE_CODE = '4' THEN 1 ELSE 0 END) AS "FIX_REQUEST",
SUM(CASE WHEN T_CSI.PROJECT_STATE_CODE = '5' THEN 1 ELSE 0 END) AS "COMPLETED_INSPECTION",
SUM(CASE WHEN T_CSI.PROJECT_STATE_CODE = '6' THEN 1 ELSE 0 END) AS "COMPLETED_REGISTRATION"
FROM
SUM(CASE WHEN T_CSI.PROJECT_STATE_CODE = '6' THEN 1 ELSE 0 END) AS "COMPLETED_REGISTRATION"FROM
TEMP_CONSTRUCT_SITE_INFO T_CSI
LEFT JOIN
TEMP_PROJECT_INFO T_PI ON T_CSI.PROJECT_CODE = T_PI.PROJECT_CODE

View File

@ -279,52 +279,60 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
}
// ▼▼▼ 발주기관별 성과 로드 함수 ▼▼▼
function loadCompanyPerformance() {
var listContainer = document.getElementById('company-performance-list');
listContainer.innerHTML = '<div class="p-4 text-center text-gray-500">성과 현황을 불러오는 중입니다...</div>';
fetch('/drilling/statistics/company-performance.do')
.then(response => response.json())
.then(response => {
if (response && response.resultCode === 200 && response.datas) {
var datas = response.datas;
if (datas.length === 0) {
listContainer.innerHTML = '<div class="p-4 text-center text-gray-500">집계된 용역사 성과 현황이 없습니다.</div>';
return;
}
var contentHtml = '<table class="w-full text-left border-collapse text-2xl">';
contentHtml += '<thead>' +
'<tr class="border-b border-gray-300">' +
'<th class="p-2 font-semibold text-gray-700">용역사명</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">총 프로젝트</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">검수중</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">수정 요청</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">검수 완료</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">등록 완료</th>' +
'</tr>' +
'</thead><tbody>';
datas.forEach(item => {
contentHtml += '<tr class="border-b border-gray-200">' +
'<td class="p-2 font-medium text-gray-800">' + (item.COMPANY_NAME || '미지정') + '</td>' +
'<td class="p-2 text-center text-gray-600">' + item.TOTAL_PROJECTS + '</td>' +
'<td class="p-2 text-center text-yellow-600">' + item.IN_INSPECTION + '</td>' +
'<td class="p-2 text-center text-red-600 font-bold">' + item.FIX_REQUEST + '</td>' +
'<td class="p-2 text-center text-green-600">' + item.COMPLETED_INSPECTION + '</td>' +
'<td class="p-2 text-center text-teal-600">' + item.COMPLETED_REGISTRATION + '</td>' +
'</tr>';
});
contentHtml += '</tbody></table>';
listContainer.innerHTML = contentHtml;
} else {
listContainer.innerHTML = '<div class="p-4 text-center text-gray-500">성과 현황 로드에 실패했습니다.</div>';
console.error("Error fetching company performance:", response.resultMessage);
}
})
.catch(error => {
listContainer.innerHTML = '<div class="p-4 text-center text-gray-500">성과 현황 로드 중 오류 발생.</div>';
console.error("Fetch error for company performance:", error);
});
}
// ▼▼▼ 발주기관별 성과 로드 함수 ▼▼▼
function loadCompanyPerformance() {
var listContainer = document.getElementById('company-performance-list');
listContainer.innerHTML = '<div class="p-4 text-center text-gray-500">성과 현황을 불러오는 중입니다...</div>';
fetch('/drilling/statistics/company-performance.do')
.then(response => response.json())
.then(response => {
if (response && response.resultCode === 200 && response.datas) {
var datas = response.datas;
if (datas.length === 0) {
listContainer.innerHTML = '<div class="p-4 text-center text-gray-500">집계된 수주기관 성과 현황이 없습니다.</div>';
return;
}
var contentHtml = '<table class="w-full text-left border-collapse text-2xl">';
contentHtml += '<thead>' +
'<tr class="border-b border-gray-300">' +
'<th class="p-2 font-semibold text-gray-700">수주기관명</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">총 프로젝트</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">미입력</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">입력중</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">검수대기</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">검수중</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">수정 요청</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">검수 완료</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">등록 완료</th>' +
'</tr>' +
'</thead><tbody>';
datas.forEach(item => {
contentHtml += '<tr class="border-b border-gray-200">' +
'<td class="p-2 font-medium text-gray-800">' + (item.COMPANY_NAME || '미지정') + '</td>' +
'<td class="p-2 text-center text-gray-600">' + item.TOTAL_PROJECTS + '</td>' +
'<td class="p-2 text-center text-gray-500">' + item.NOT_ENTERED + '</td>' +
'<td class="p-2 text-center text-blue-500">' + item.ENTERING + '</td>' +
'<td class="p-2 text-center text-orange-500">' + item.AWAITING_INSPECTION + '</td>' +
'<td class="p-2 text-center text-yellow-600">' + item.IN_INSPECTION + '</td>' +
'<td class="p-2 text-center text-red-600 font-bold">' + item.FIX_REQUEST + '</td>' +
'<td class="p-2 text-center text-green-600">' + item.COMPLETED_INSPECTION + '</td>' +
'<td class="p-2 text-center text-teal-600">' + item.COMPLETED_REGISTRATION + '</td>' +
'</tr>';
});
contentHtml += '</tbody></table>';
listContainer.innerHTML = contentHtml;
} else {
listContainer.innerHTML = '<div class="p-4 text-center text-gray-500">성과 현황 로드에 실패했습니다.</div>';
console.error("Error fetching company performance:", response.resultMessage);
}
})
.catch(error => {
listContainer.innerHTML = '<div class="p-4 text-center text-gray-500">성과 현황 로드 중 오류 발생.</div>';
console.error("Fetch error for company performance:", error);
});
}
// ▼▼▼ 데이터 품질 (수정 요청) 통계 로드 함수 ▼▼▼
function loadDataQualityStats() {
@ -381,7 +389,7 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
var contentHtml = '<table class="w-full text-left border-collapse text-2xl">';
contentHtml += '<thead>' +
'<tr class="border-b border-gray-300">' +
'<th class="p-2 font-semibold text-gray-700">용역사명</th>' +
'<th class="p-2 font-semibold text-gray-700">수주기관 명</th>' +
'<th class="p-2 font-semibold text-gray-700 text-center">누적 수정 요청 횟수</th>' +
'</tr>' +
'</thead><tbody>';
@ -487,7 +495,7 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
// (1단계에서 <div ...>에 id="project-status-section"을 추가해야 합니다)
yPos = await addHtmlElementAsImage(doc, 'project-status-section', yPos);
// --- 2. 용역사별 성과 현황 ---
// --- 2. 수주기관별 성과 현황 ---
showPdfLoading('성과 현황 캡처 중... (2/3)');
yPos = await addHtmlElementAsImage(doc, 'company-performance-section', yPos);