Compare commits

...
Author SHA1 Message Date
jcchoi a04910befe Merge branch 'main' of https://www.onasys.co.kr:3000/ONAANDALL/frontend 2026-11-27 20:46:21 +09:00
jcchoi d5577ff820 Merge remote-tracking branch 'origin/iipbs/st/dev' 2026-11-27 19:58:30 +09:00
rsone001 84525b7e87 [ST] - refactor: 전남광주통합특별시 본청 데이터 관련 저장&제출 alert 추가 2026-11-27 17:19:46 +09:00
mind-one005 7cb3548e5d Merge branch 'main' of https://www.onasys.co.kr:3000/ONAANDALL/frontend 2026-11-27 16:27:10 +09:00
mind-one005 e6b012dc29 Merge branch 'main' of https://www.onasys.co.kr:3000/ONAANDALL/frontend 2026-11-27 16:17:35 +09:00
mind-one005 2071ffa264 Merge branch 'iipbs/sn/dev' 2026-11-27 16:16:55 +09:00
jcchoi b8d8076510 Merge remote-tracking branch 'origin/iipbs/st/dev' 2026-11-27 16:06:50 +09:00
rsone001 687de61668 [ST] - refactor: 9번지표,12-1, 12-2 지표 본청 데이터 처리를 위해 로직 수정 2026-11-27 16:02:08 +09:00
mind-one005 3a4e581a93 sn: wtrUsgYears try catch 2026-11-24 23:45:59 +09:00
mind-one005 9c9a40714d sn: 기존 침수예방사업 노후관로정비사업 삭제 2026-11-20 12:59:28 +09:00
mind-one005 5aeff42489 Merge branch 'iipbs/sn/dev' into iipbs/wr/dev 2026-11-18 10:04:20 +09:00
mind-one005 e7a32905cb wr: 수요처 등록 수정 - selectBox 2026-11-16 11:09:55 +09:00
rsone001 a730db95dd [ST] - fix: 입력관리 기간 연도 입력 오류 수정 2026-11-13 15:01:49 +09:00
rsone001 f2999f60f2 [ST] - fix: 2-6 시설별 설치 현황관리 다이얼로그 레이아웃 복구 2026-11-13 10:45:49 +09:00
jcchoi 6e626c547d Merge remote-tracking branch 'origin/iipbs/st/dev' 2026-11-12 15:05:37 +09:00
jcchoi 7a0d3919d3 Merge remote-tracking branch 'origin/feature/1007_forkjoin' 2026-11-12 14:22:14 +09:00
rsone001 0307ee9fd6 [ST] - refactor: 입력 11-1 운영데이터 가져오기 기능 추가 2026-11-11 16:37:28 +09:00
rsone001 8087ed343c [ST] - fix: 사내 배포용 라이센스 수정 2026-11-10 17:14:36 +09:00
rsone001 eaf0a618a0 [ST] - fix: st dockerfile update 2026-11-10 16:58:01 +09:00
rsone001 4329eafa9b [ST] - fix: 시군구 드롭다운 컬럼 수정, rsone-dockerfile 추가 2026-11-10 16:26:00 +09:00
jcchoi 1e2be153fa Merge remote-tracking branch 'origin/iipbs/st/dev' 2026-11-09 13:48:01 +09:00
jcchoi b90ff150e8 README.md 업데이트
FSD 관련
2026-11-05 17:41:21 +09:00
rsone001 411e490b5d [ST] - retactor: 지표 변경으로 인한 컬럼 수정 2026-11-04 10:59:48 +09:00
mind-one005 aae176ff08 Merge branch 'main' of https://www.onasys.co.kr:3000/ONAANDALL/frontend 2026-11-03 11:13:36 +09:00
mind-one005 d76bdea702 sn : 침수예측 관측소중심으로 로직 변경 2026-11-02 15:51:53 +09:00
mind-one005 45c8d021cc sn: 확률강우량 엑셀다운로드 2026-10-30 13:34:44 +09:00
rsone001 b5f5938e51 [ST] - fix: excel 가져오기 시 코드값이 숫자로 인식되어 저장이 이루어지지 않던 문제 수정 2026-10-29 10:27:42 +09:00
mind-one005 0336226562 Merge branch 'iipbs/sn/dev' of https://www.onasys.co.kr:3000/ONAANDALL/frontend into iipbs/sn/dev 2026-10-28 17:33:23 +09:00
mind-one005 e9fb1e3a88 sn: login 2026-10-28 17:33:09 +09:00
rsone001 038b2d441e [ST] - refactor: 처리내역 컬럼 제거 및 표준화 누락 부분 수정 2026-10-28 17:24:12 +09:00
mind-one005 a4412001b3 refresh-token의 도메인 설정 2026-10-28 16:24:48 +09:00
jcchoi 766de07c04 Merge branch 'iipbs/st/dev'
Deploy Frontend / deploy (push) Successful in 4m16s
2026-10-28 15:07:16 +09:00
kiminchan 2c901bd32d 관로조사 지도 표시 색상을 짙은 남색으로 변경 2026-10-28 11:24:04 +09:00
rsone001 2ec58f1f5b [ST] - 기본 페이지에서 대시보드 도움말을 불러오기 위해 메뉴코드 전달 2026-10-27 15:52:00 +09:00
rsone001 3cf3617513 [ST] - 검토 & 집계 2-5 컬럼 추가 2026-10-23 14:45:14 +09:00
rsone001 b611538180 [ST] - input 2-5 맨홀 컬럼 추가 2026-10-23 13:48:17 +09:00
rsone001 1cffe06cf9 [ST] - input : 시계열 검증 오류 시 진행상황 코드 롤백 api 추가, 일반 검증 관리 interface 수정 2026-10-22 18:02:48 +09:00
rsone001 9a24e4aa23 [ST] - 입력 verificationResult - cmprCn, nowCn 값 null 일시 치환 2026-10-22 16:48:34 +09:00
rsone001 3732c9380b [ST] - doList 누락 수정 2026-10-22 11:44:35 +09:00
rsone001 9e15b23eda [ST] - fix: input 2-3 저장, 제출 request 수정 2026-10-21 17:17:54 +09:00
rsone001 6f300918cd [ST] - fix: 그리드 여러행 복사 붙여넣기 시 초과된 행 수 많큼 빈행이 추가되지 않도록 수정 2026-10-21 16:04:41 +09:00
rsone001 619878bc03 Merge branch 'iipbs/st/dev' of https://www.onasys.co.kr:3000/ONAANDALL/frontend into iipbs/st/dev 2026-10-21 16:01:05 +09:00
108 changed files with 2492 additions and 4701 deletions
+2
View File
@@ -202,3 +202,5 @@ http://dev.onasys.co.kr:8000/webjars/swagger-ui/index.html?urls.primaryName=atta
- 쿠키명 : menu-code-key - 쿠키명 : menu-code-key
- 해당 메뉴 쿠키 데이터 가져와 페이지 권한 및 상당 Breadcrumb 데이터 전달 처리 - 해당 메뉴 쿠키 데이터 가져와 페이지 권한 및 상당 Breadcrumb 데이터 전달 처리
## FSD 관련
https://fsd.how/kr/docs/get-started/overview/
+15 -8
View File
@@ -1,3 +1,14 @@
/**
* 📄 Proxy Route
* API 프록시 라우트
*
* - 서버 API로의 요청 프록시 처리
* - 쿠키 기반 인증 토큰 및 리프레시 토큰 관리
* - POST 및 PUT 요청 핸들링
* - 사용자 인증 정보 검증 및 응답 처리
* - 에러 핸들링 및 상태 코드 반환
* - 사이트 ID 및 헤더 설정
*/
import { import {
ACCESS_TOKEN, ACCESS_TOKEN,
AUTH_USER_ID, AUTH_USER_ID,
@@ -113,12 +124,8 @@ export async function PUT(
} }
function getCookieDomain(): string | undefined { function getCookieDomain(): string | undefined {
if (typeof window === "undefined") return undefined; // 개발에서는 현재 사이트 전용, 운영에서는 환경변수의 공용 도메인을 사용한다.
return process.env.NODE_ENV === "production"
if (COOKIE_DOMAIN) return COOKIE_DOMAIN; ? COOKIE_DOMAIN || undefined
: undefined;
const { hostname } = window.location;
if (hostname === "localhost" || hostname === "127.0.0.1") return undefined;
return hostname;
} }
+449 -419
View File
@@ -1326,13 +1326,18 @@ type wtrUsgYearsResponse = {
const searchWaterUsage = async (searchYear: string, fcltyCd: string) => { const searchWaterUsage = async (searchYear: string, fcltyCd: string) => {
const waterUsage = [0, 0, 0]; // searchYear, searchYear-1, searchYear-2 const waterUsage = [0, 0, 0]; // searchYear, searchYear-1, searchYear-2
const res = await getFetch('fo', '/dashBoard/wtrUsgYears/' + searchYear + '/' + fcltyCd) as wtrUsgYearsResponse; try {
let i = 0; const res = await getFetch('fo', '/dashBoard/wtrUsgYears/' + searchYear + '/' + fcltyCd) as wtrUsgYearsResponse;
if (res && res.data && Array.isArray(res.data)) { let i = 0;
res.data.forEach((item: wtrUsgYearsType) => { if (res && res.data && Array.isArray(res.data)) {
waterUsage[i] = item.WTR_USG; res.data.forEach((item: wtrUsgYearsType) => {
i++; waterUsage[i] = item.WTR_USG;
}); i++;
});
}
} catch (error) {
// 물사용량 조회 실패 시 0으로 두고 계획정보 조회는 계속 진행한다.
console.error('연도별 물사용량 데이터를 가져오는데 실패했습니다:', error);
} }
return waterUsage; return waterUsage;
@@ -1362,108 +1367,103 @@ export const dashBoardReducer = (
isLoadingPlanFclty: true, isLoadingPlanFclty: true,
}, },
})); }));
let waterUsage = [0, 0, 0]; try {
waterUsage = await searchWaterUsage(targetYear, fcltyCd); // /fclt/flow/{fcltyCd}/{year} let waterUsage = [0, 0, 0];
waterUsage = await searchWaterUsage(targetYear, fcltyCd); // /fclt/flow/{fcltyCd}/{year}
set((state: DashBoardType) => ({
...state,
PlanFclty: {
...state.PlanFclty,
waterUsage1: waterUsage[0] || 0,
waterUsage2: waterUsage[1] || 0,
waterUsage3: waterUsage[2] || 0,
},
}));
const res = await fetchFacilityPlan(targetYear, fcltyCd, set); // /dc-service/api/v1/nowDmgMtncGnsvy
let minDiff = 9999999;
let minIndex;
res.forEach((el: any, idx) => {
if (minDiff > Math.abs(Number(targetYear) - Number(el.planYr))) {
minDiff = Math.abs(Number(targetYear) - Number(el.planYr));
minIndex = idx;
}
});
const rtnPlanData = res[minIndex];
planFcltyList.map((el, index) => {
planYearList = [];
planYearList.push(rtnPlanData ? rtnPlanData.planYrDt4.toString() : "");
planYearList.push(rtnPlanData ? rtnPlanData.planYr.toString() : "");
planYearList.push(rtnPlanData ? rtnPlanData.planYrDc1.toString() : "");
planYearList.push(rtnPlanData ? rtnPlanData.planYrDc2.toString() : "");
planYearList.push(rtnPlanData ? rtnPlanData.planYrDc3.toString() : "");
planYearList.push(rtnPlanData ? rtnPlanData.planYrDc4.toString() : "");
if (index === 0) { // 증설계획(㎥/일)
el.provisionalApproval = rtnPlanData ? rtnPlanData.planSwageQntSumDt4 : ''; // 기승인4단계
el.now = rtnPlanData ? rtnPlanData.planSwageQntSum : ''; // 현재
el.stepOne = rtnPlanData ? rtnPlanData.planSwageQntSumDc1 : ''; // 1단계
el.stepTwo = rtnPlanData ? rtnPlanData.planSwageQntSumDc2 : ''; // 2단계
el.stepThree = rtnPlanData ? rtnPlanData.planSwageQntSumDc3 : ''; // 3단계
el.stepFour = rtnPlanData ? rtnPlanData.planSwageQntSumDc4 : ''; // 4단계
}
if (index === 1) { // 처리인구(인)
el.provisionalApproval = rtnPlanData ? rtnPlanData.swtrmtPpltnCntDt4 : '';
el.now = rtnPlanData ? rtnPlanData.swtrmtPpltnCnt : '';
el.stepOne = rtnPlanData ? rtnPlanData.swtrmtPpltnCntDc1 : '';
el.stepTwo = rtnPlanData ? rtnPlanData.swtrmtPpltnCntDc2 : '';
el.stepThree = rtnPlanData ? rtnPlanData.swtrmtPpltnCntDc3 : '';
el.stepFour = rtnPlanData ? rtnPlanData.swtrmtPpltnCntDc4 : '';
}
if (index === 2) { // 처리구역(km²)
el.provisionalApproval = rtnPlanData ? rtnPlanData.swtrmtZoneAreaDt4 : '';
el.now = rtnPlanData ? rtnPlanData.swtrmtZoneArea : '';
el.stepOne = rtnPlanData ? rtnPlanData.swtrmtZoneAreaDc1 : '';
el.stepTwo = rtnPlanData ? rtnPlanData.swtrmtZoneAreaDc2 : '';
el.stepThree = rtnPlanData ? rtnPlanData.swtrmtZoneAreaDc3 : '';
el.stepFour = rtnPlanData ? rtnPlanData.swtrmtZoneAreaDc4 : '';
}
if (index === 4) { // 물사용량
el.provisionalApproval = rtnPlanData ? rtnPlanData.ugwtUseSum : '';
}
if (index === 2) { // 처리구역(km²)
dataFormSettingPlan(el, 1);
} else if (index == 4) { // 물사용량
} else {
dataFormSettingPlan(el, 0);
}
set((state: DashBoardType) => ({ set((state: DashBoardType) => ({
...state, ...state,
PlanFclty: { PlanFclty: {
...state.PlanFclty, ...state.PlanFclty,
planFcltyList: planFcltyList, waterUsage1: waterUsage[0] || 0,
isLoadingPlanFclty: false, waterUsage2: waterUsage[1] || 0,
planYearList: planYearList, waterUsage3: waterUsage[2] || 0,
}, },
})); }));
});
const res = await fetchFacilityPlan(targetYear, fcltyCd, set); // /dc-service/api/v1/nowDmgMtncGnsvy
// 조회 실패 시 { data: [], count: 0 } 이 올 수 있으므로 배열일 때만 사용한다.
const planList: any[] = Array.isArray(res) ? res : [];
let minDiff = 9999999;
let minIndex;
planList.forEach((el: any, idx) => {
if (minDiff > Math.abs(Number(targetYear) - Number(el.planYr))) {
minDiff = Math.abs(Number(targetYear) - Number(el.planYr));
minIndex = idx;
}
});
const rtnPlanData = minIndex !== undefined ? planList[minIndex] : undefined;
planFcltyList.map((el, index) => {
planYearList = [];
planYearList.push(rtnPlanData ? rtnPlanData.planYrDt4.toString() : "");
planYearList.push(rtnPlanData ? rtnPlanData.planYr.toString() : "");
planYearList.push(rtnPlanData ? rtnPlanData.planYrDc1.toString() : "");
planYearList.push(rtnPlanData ? rtnPlanData.planYrDc2.toString() : "");
planYearList.push(rtnPlanData ? rtnPlanData.planYrDc3.toString() : "");
planYearList.push(rtnPlanData ? rtnPlanData.planYrDc4.toString() : "");
if (index === 0) { // 증설계획(㎥/일)
el.provisionalApproval = rtnPlanData ? rtnPlanData.planSwageQntSumDt4 : ''; // 기승인4단계
el.now = rtnPlanData ? rtnPlanData.planSwageQntSum : ''; // 현재
el.stepOne = rtnPlanData ? rtnPlanData.planSwageQntSumDc1 : ''; // 1단계
el.stepTwo = rtnPlanData ? rtnPlanData.planSwageQntSumDc2 : ''; // 2단계
el.stepThree = rtnPlanData ? rtnPlanData.planSwageQntSumDc3 : ''; // 3단계
el.stepFour = rtnPlanData ? rtnPlanData.planSwageQntSumDc4 : ''; // 4단계
}
if (index === 1) { // 처리인구(인)
el.provisionalApproval = rtnPlanData ? rtnPlanData.swtrmtPpltnCntDt4 : '';
el.now = rtnPlanData ? rtnPlanData.swtrmtPpltnCnt : '';
el.stepOne = rtnPlanData ? rtnPlanData.swtrmtPpltnCntDc1 : '';
el.stepTwo = rtnPlanData ? rtnPlanData.swtrmtPpltnCntDc2 : '';
el.stepThree = rtnPlanData ? rtnPlanData.swtrmtPpltnCntDc3 : '';
el.stepFour = rtnPlanData ? rtnPlanData.swtrmtPpltnCntDc4 : '';
}
if (index === 2) { // 처리구역(km²)
el.provisionalApproval = rtnPlanData ? rtnPlanData.swtrmtZoneAreaDt4 : '';
el.now = rtnPlanData ? rtnPlanData.swtrmtZoneArea : '';
el.stepOne = rtnPlanData ? rtnPlanData.swtrmtZoneAreaDc1 : '';
el.stepTwo = rtnPlanData ? rtnPlanData.swtrmtZoneAreaDc2 : '';
el.stepThree = rtnPlanData ? rtnPlanData.swtrmtZoneAreaDc3 : '';
el.stepFour = rtnPlanData ? rtnPlanData.swtrmtZoneAreaDc4 : '';
}
if (index === 4) { // 물사용량
el.provisionalApproval = rtnPlanData ? rtnPlanData.ugwtUseSum : '';
}
if (index === 2) { // 처리구역(km²)
dataFormSettingPlan(el, 1);
} else if (index == 4) { // 물사용량
} else {
dataFormSettingPlan(el, 0);
}
set((state: DashBoardType) => ({
...state,
PlanFclty: {
...state.PlanFclty,
planFcltyList: planFcltyList,
planYearList: planYearList,
},
}));
});
} catch (error) {
console.error('시설정보 계획정보 처리 중 오류가 발생했습니다:', error);
} finally {
// 성공/실패와 관계없이 로딩 오버레이를 해제한다.
set((state: DashBoardType) => ({
...state,
PlanFclty: {
...state.PlanFclty,
isLoadingPlanFclty: false,
},
}));
}
}, },
/** 시설정보 및 운영현황 - 운영실태 */ /** 시설정보 및 운영현황 - 운영실태 */
searchOperationStatus: async (isExcel: boolean, searchYear: string, fcltyCd: string) => { searchOperationStatus: async (isExcel: boolean, searchYear: string, fcltyCd: string) => {
const state = get(); const state = get();
let mainGraphData: ApiRes = { data: [], count: 0 };
// 이미 조회된 데이터가 있는지 확인 (연도와 시설코드가 같을 때만)
if (state.RainManage.mainGraphYear === searchYear && state.RainManage.mainGraphFcltyCd === fcltyCd && state.RainManage.mainGraphData) {
mainGraphData = state.RainManage.mainGraphData;
} else {
mainGraphData = await fetchMainGraph(searchYear, fcltyCd);
// 조회된 데이터 저장
set((state: DashBoardType) => ({
...state,
RainManage: {
...state.RainManage,
mainGraphData: mainGraphData,
mainGraphYear: searchYear,
mainGraphFcltyCd: fcltyCd,
}
}));
}
set((state: DashBoardType) => ({ set((state: DashBoardType) => ({
...state, ...state,
OperationStatus: { OperationStatus: {
@@ -1471,356 +1471,386 @@ export const dashBoardReducer = (
isLoadingOperationStatus: true, isLoadingOperationStatus: true,
}, },
})); }));
try {
let mainGraphData: ApiRes = { data: [], count: 0 };
// const fcltCdList = [fcltyCd]; // 이미 조회된 데이터가 있는지 확인 (연도와 시설코드가 같을 때만)
//const wtrUsgRes: any = await fetchWtrUsgYmList(searchYear, fcltCdList); // 수용가의 실제 물사용량 if (state.RainManage.mainGraphYear === searchYear && state.RainManage.mainGraphFcltyCd === fcltyCd && state.RainManage.mainGraphData) {
mainGraphData = state.RainManage.mainGraphData;
} else {
mainGraphData = await fetchMainGraph(searchYear, fcltyCd);
// 조회된 데이터 저장
set((state: DashBoardType) => ({
...state,
RainManage: {
...state.RainManage,
mainGraphData: mainGraphData,
mainGraphYear: searchYear,
mainGraphFcltyCd: fcltyCd,
}
}));
}
const operList = { // const fcltCdList = [fcltyCd];
inFlow: { //const wtrUsgRes: any = await fetchWtrUsgYmList(searchYear, fcltCdList); // 수용가의 실제 물사용량
yearTot: 0, yearAvg: 0, yearMax: 0, yearMin: 9999999
, summerTot: 0, summerAvg: 0, summerRainy: 0, summerSunny: 0
, winterTot: 0, winterAvg: 0, winterSunny: 0, winterSunnyMax: 0, winterSunnyMin: 9999999
, groundTot: 0, groundSummer: 0, groundWinter: 0, rdii: 0, rdiiRainAmt: 0
},
inflAmt: {
yearTot: 0, yearAvg: 0, yearMax: 0, yearMin: 9999999, yearSunny: 0
, summerTot: 0, summerAvg: 0, summerRainy: 0, summerSunny: 0
, winterTot: 0, winterAvg: 0, winterSunny: 0, winterSunnyMax: 0, winterSunnyMin: 9999999
, groundTot: 0, groundSummer: 0, groundWinter: 0, rdii: 0, rdiiRainAmt: 0
},
sumFlow: {
yearTot: 0, yearAvg: 0, yearMax: 0, yearMin: 9999999
, summerTot: 0, summerAvg: 0, summerRainy: 0, summerSunny: 0
, winterTot: 0, winterAvg: 0, winterSunny: 0, winterSunnyMax: 0, winterSunnyMin: 9999999
, groundTot: 0, groundSummer: 0, groundWinter: 0, rdii: 0, rdiiRainAmt: 0
},
returnFlow: {
yearTot: 0, yearAvg: 0, yearMax: 0, yearMin: 9999999
, summerTot: 0, summerAvg: 0, summerRainy: 0, summerSunny: 0
, winterTot: 0, winterAvg: 0, winterSunny: 0, winterSunnyMax: 0, winterSunnyMin: 9999999
, groundTot: 0, groundSummer: 0, groundWinter: 0, rdii: 0, rdiiRainAmt: 0
},
efflFlow: {
yearTot: 0, yearAvg: 0, yearMax: 0, yearMin: 9999999
, summerTot: 0, summerAvg: 0, summerRainy: 0, summerSunny: 0
, winterTot: 0, winterAvg: 0, winterSunny: 0, winterSunnyMax: 0, winterSunnyMin: 9999999
, groundTot: 0, groundSummer: 0, groundWinter: 0, rdii: 0, rdiiRainAmt: 0
},
};
const clone = (arr: any[]) => arr?.map(v => ({ ...v })) ?? [];
let rdiPercent = 0; const operList = {
let operationalStatusList = clone(operationalStatusListOrg); inFlow: {
if (operationalStatusList) { yearTot: 0, yearAvg: 0, yearMax: 0, yearMin: 9999999
// 유량 - 유입 , summerTot: 0, summerAvg: 0, summerRainy: 0, summerSunny: 0
if (operationalStatusList?.[0]) { , winterTot: 0, winterAvg: 0, winterSunny: 0, winterSunnyMax: 0, winterSunnyMin: 9999999
, groundTot: 0, groundSummer: 0, groundWinter: 0, rdii: 0, rdiiRainAmt: 0
},
inflAmt: {
yearTot: 0, yearAvg: 0, yearMax: 0, yearMin: 9999999, yearSunny: 0
, summerTot: 0, summerAvg: 0, summerRainy: 0, summerSunny: 0
, winterTot: 0, winterAvg: 0, winterSunny: 0, winterSunnyMax: 0, winterSunnyMin: 9999999
, groundTot: 0, groundSummer: 0, groundWinter: 0, rdii: 0, rdiiRainAmt: 0
},
sumFlow: {
yearTot: 0, yearAvg: 0, yearMax: 0, yearMin: 9999999
, summerTot: 0, summerAvg: 0, summerRainy: 0, summerSunny: 0
, winterTot: 0, winterAvg: 0, winterSunny: 0, winterSunnyMax: 0, winterSunnyMin: 9999999
, groundTot: 0, groundSummer: 0, groundWinter: 0, rdii: 0, rdiiRainAmt: 0
},
returnFlow: {
yearTot: 0, yearAvg: 0, yearMax: 0, yearMin: 9999999
, summerTot: 0, summerAvg: 0, summerRainy: 0, summerSunny: 0
, winterTot: 0, winterAvg: 0, winterSunny: 0, winterSunnyMax: 0, winterSunnyMin: 9999999
, groundTot: 0, groundSummer: 0, groundWinter: 0, rdii: 0, rdiiRainAmt: 0
},
efflFlow: {
yearTot: 0, yearAvg: 0, yearMax: 0, yearMin: 9999999
, summerTot: 0, summerAvg: 0, summerRainy: 0, summerSunny: 0
, winterTot: 0, winterAvg: 0, winterSunny: 0, winterSunnyMax: 0, winterSunnyMin: 9999999
, groundTot: 0, groundSummer: 0, groundWinter: 0, rdii: 0, rdiiRainAmt: 0
},
};
const clone = (arr: any[]) => arr?.map(v => ({ ...v })) ?? [];
// 연계처리수 let rdiPercent = 0;
let yearDay = 0, summerDay = 0, winterDay = 0; // 연간 일수, 하절기 일수, 동절기 일수 let operationalStatusList = clone(operationalStatusListOrg);
let summerRainDay = 0, summerChungchunDay = 0, winterChungchuDay = 0; // 하절기 강우 일수, 하절기 청천 일수, 동절기 청천 일수 if (operationalStatusList) {
// 유량 - 유입
if (operationalStatusList?.[0]) {
// 연계처리수,지하수유입량 // 연계처리수
const bscFctCd = fcltyCd; let yearDay = 0, summerDay = 0, winterDay = 0; // 연간 일수, 하절기 일수, 동절기 일수
let res2: any = { data: [] }; let summerRainDay = 0, summerChungchunDay = 0, winterChungchuDay = 0; // 하절기 강우 일수, 하절기 청천 일수, 동절기 청천 일수
// 이미 조회된 데이터가 있는지 확인 (연도와 시설코드가 같을 때만) // 연계처리수,지하수유입량
if (state.RainManage.flowRateYear === searchYear && state.RainManage.flowRateFcltyCd === fcltyCd && state.RainManage.flowRateData) { const bscFctCd = fcltyCd;
res2 = state.RainManage.flowRateData; let res2: any = { data: [] };
} else {
res2 = await fetchFlowRateModalList(bscFctCd, searchYear); // /fclt/flow/ - 일별 유량 조회
// 조회된 데이터 저장
set((state: DashBoardType) => ({
...state,
RainManage: {
...state.RainManage,
flowRateData: res2,
flowRateYear: searchYear,
flowRateFcltyCd: fcltyCd,
}
}));
}
//const calData = CalcRainEffect(clone(res2.data), 'SUNNY'); // 이미 조회된 데이터가 있는지 확인 (연도와 시설코드가 같을 때만)
//const calRainData = CalcRainEffect(clone(res2.data), 'RAIN'); if (state.RainManage.flowRateYear === searchYear && state.RainManage.flowRateFcltyCd === fcltyCd && state.RainManage.flowRateData) {
res2 = state.RainManage.flowRateData;
let cntSunnyDay = 0; // 청천일 수
// let chungcunSumFlow = 0; // 연간 청천 순수하수
let rainEffectDay = 0;
yearDay = res2.data ? res2.data.length : 1;
res2.data.forEach((item: any) => { // --일별 유량 start
const month = item.msrDt.substring(4, 6); // 월 추출
const sumFlow = item.sumFlow && item.sumFlow !== 'x' ? Number(item.sumFlow.toString().trim()) : 0;
const inflAmnt = item.inflAmnt && item.inflAmnt !== 'x' ? Number(item.inflAmnt.toString().trim()) : 0;
const returnAmnt = item.returnAmnt && item.returnAmnt !== 'x' ? Number(item.returnAmnt.toString().trim()) : 0;
const efflAmnt = item.efflAmnt && item.efflAmnt !== 'x' ? Number(item.efflAmnt.toString().trim()) : 0;
if (item.infoRnDay == null) item.infoRnDay = 0;
if (item.infoRnDay >= 3) {
rainEffectDay = 2;
// 강우시
} else { } else {
rainEffectDay--; res2 = await fetchFlowRateModalList(bscFctCd, searchYear); // /fclt/flow/ - 일별 유량 조회
// 조회된 데이터 저장
set((state: DashBoardType) => ({
...state,
RainManage: {
...state.RainManage,
flowRateData: res2,
flowRateYear: searchYear,
flowRateFcltyCd: fcltyCd,
}
}));
} }
if (rainEffectDay >= 0) { //const calData = CalcRainEffect(clone(res2.data), 'SUNNY');
// 강우영향일 //const calRainData = CalcRainEffect(clone(res2.data), 'RAIN');
if (month === '06' || month === '07' || month === '08') { // 하절기 강우영향일
summerRainDay += 1; let cntSunnyDay = 0; // 청천일 수
operList.inFlow.summerRainy += inflAmnt + sumFlow + returnAmnt; // let chungcunSumFlow = 0; // 연간 청천 순수하수
operList.inflAmt.summerRainy += inflAmnt;
operList.sumFlow.summerRainy += sumFlow; let rainEffectDay = 0;
operList.returnFlow.summerRainy += returnAmnt; yearDay = res2.data ? res2.data.length : 1;
operList.efflFlow.summerRainy += efflAmnt; res2.data.forEach((item: any) => { // --일별 유량 start
const month = item.msrDt.substring(4, 6); // 월 추출
const sumFlow = item.sumFlow && item.sumFlow !== 'x' ? Number(item.sumFlow.toString().trim()) : 0;
const inflAmnt = item.inflAmnt && item.inflAmnt !== 'x' ? Number(item.inflAmnt.toString().trim()) : 0;
const returnAmnt = item.returnAmnt && item.returnAmnt !== 'x' ? Number(item.returnAmnt.toString().trim()) : 0;
const efflAmnt = item.efflAmnt && item.efflAmnt !== 'x' ? Number(item.efflAmnt.toString().trim()) : 0;
if (item.infoRnDay == null) item.infoRnDay = 0;
if (item.infoRnDay >= 3) {
rainEffectDay = 2;
// 강우시
} else {
rainEffectDay--;
} }
} else if (rainEffectDay < 0) {
cntSunnyDay += 1; // 청천일수
// 청천시
// chungcunSumFlow += inflAmnt; // 연간 청천 순수하수
operList.inflAmt.yearSunny += inflAmnt; // 연간 청천 순수하수
if (month === '06' || month === '07' || month === '08') { // 하절기 청천 if (rainEffectDay >= 0) {
summerChungchunDay += 1; // 강우영향일
operList.inFlow.summerSunny += inflAmnt + sumFlow + returnAmnt; if (month === '06' || month === '07' || month === '08') { // 하절기 강우영향일
operList.inflAmt.summerSunny += inflAmnt; summerRainDay += 1;
operList.sumFlow.summerSunny += sumFlow; operList.inFlow.summerRainy += inflAmnt + sumFlow + returnAmnt;
operList.returnFlow.summerSunny += returnAmnt; operList.inflAmt.summerRainy += inflAmnt;
operList.efflFlow.summerSunny += efflAmnt; operList.sumFlow.summerRainy += sumFlow;
} else if (month === '01' || month === '02') { // 동절기 청천 operList.returnFlow.summerRainy += returnAmnt;
winterChungchuDay += 1; operList.efflFlow.summerRainy += efflAmnt;
const inflowOne = inflAmnt + sumFlow + returnAmnt; }
operList.inFlow.winterSunny += inflAmnt + sumFlow + returnAmnt; } else if (rainEffectDay < 0) {
operList.inflAmt.winterSunny += inflAmnt; cntSunnyDay += 1; // 청천일수
operList.sumFlow.winterSunny += sumFlow; // 청천시
operList.returnFlow.winterSunny += returnAmnt; // chungcunSumFlow += inflAmnt; // 연간 청천 순수하수
operList.efflFlow.winterSunny += efflAmnt; operList.inflAmt.yearSunny += inflAmnt; // 연간 청천 순수하수
if (operList.inFlow.winterSunnyMax < inflowOne) operList.inFlow.winterSunnyMax = inflowOne; if (month === '06' || month === '07' || month === '08') { // 하절기 청천
if (operList.inflAmt.winterSunnyMax < inflAmnt) operList.inflAmt.winterSunnyMax = inflAmnt; summerChungchunDay += 1;
if (operList.sumFlow.winterSunnyMax < sumFlow) operList.sumFlow.winterSunnyMax = sumFlow; operList.inFlow.summerSunny += inflAmnt + sumFlow + returnAmnt;
if (operList.returnFlow.winterSunnyMax < returnAmnt) operList.returnFlow.winterSunnyMax = returnAmnt; operList.inflAmt.summerSunny += inflAmnt;
if (operList.efflFlow.winterSunnyMax < efflAmnt) operList.efflFlow.winterSunnyMax = efflAmnt; operList.sumFlow.summerSunny += sumFlow;
operList.returnFlow.summerSunny += returnAmnt;
operList.efflFlow.summerSunny += efflAmnt;
} else if (month === '01' || month === '02') { // 동절기 청천
winterChungchuDay += 1;
const inflowOne = inflAmnt + sumFlow + returnAmnt;
operList.inFlow.winterSunny += inflAmnt + sumFlow + returnAmnt;
operList.inflAmt.winterSunny += inflAmnt;
operList.sumFlow.winterSunny += sumFlow;
operList.returnFlow.winterSunny += returnAmnt;
operList.efflFlow.winterSunny += efflAmnt;
if (operList.inFlow.winterSunnyMin > inflowOne) operList.inFlow.winterSunnyMin = inflowOne; if (operList.inFlow.winterSunnyMax < inflowOne) operList.inFlow.winterSunnyMax = inflowOne;
if (operList.inflAmt.winterSunnyMin > inflAmnt) operList.inflAmt.winterSunnyMin = inflAmnt; if (operList.inflAmt.winterSunnyMax < inflAmnt) operList.inflAmt.winterSunnyMax = inflAmnt;
if (operList.sumFlow.winterSunnyMin > sumFlow) operList.sumFlow.winterSunnyMin = sumFlow; if (operList.sumFlow.winterSunnyMax < sumFlow) operList.sumFlow.winterSunnyMax = sumFlow;
if (operList.returnFlow.winterSunnyMin > returnAmnt) operList.returnFlow.winterSunnyMin = returnAmnt; if (operList.returnFlow.winterSunnyMax < returnAmnt) operList.returnFlow.winterSunnyMax = returnAmnt;
if (operList.efflFlow.winterSunnyMin > efflAmnt) operList.efflFlow.winterSunnyMin = efflAmnt; if (operList.efflFlow.winterSunnyMax < efflAmnt) operList.efflFlow.winterSunnyMax = efflAmnt;
}
}
const inflowOne = inflAmnt + sumFlow + returnAmnt; if (operList.inFlow.winterSunnyMin > inflowOne) operList.inFlow.winterSunnyMin = inflowOne;
operList.inFlow.yearTot += inflAmnt + sumFlow + returnAmnt; if (operList.inflAmt.winterSunnyMin > inflAmnt) operList.inflAmt.winterSunnyMin = inflAmnt;
operList.inflAmt.yearTot += inflAmnt; if (operList.sumFlow.winterSunnyMin > sumFlow) operList.sumFlow.winterSunnyMin = sumFlow;
operList.sumFlow.yearTot += sumFlow; if (operList.returnFlow.winterSunnyMin > returnAmnt) operList.returnFlow.winterSunnyMin = returnAmnt;
operList.returnFlow.yearTot += returnAmnt; if (operList.efflFlow.winterSunnyMin > efflAmnt) operList.efflFlow.winterSunnyMin = efflAmnt;
operList.efflFlow.yearTot += efflAmnt;
if (operList.inFlow.yearMax < inflowOne) operList.inFlow.yearMax = inflowOne;
if (operList.inflAmt.yearMax < inflAmnt) operList.inflAmt.yearMax = inflAmnt;
if (operList.sumFlow.yearMax < sumFlow) operList.sumFlow.yearMax = sumFlow;
if (operList.returnFlow.yearMax < returnAmnt) operList.returnFlow.yearMax = returnAmnt;
if (operList.efflFlow.yearMax < efflAmnt) operList.efflFlow.yearMax = efflAmnt;
if (operList.inFlow.yearMin > inflowOne) operList.inFlow.yearMin = inflowOne;
if (operList.inflAmt.yearMin > inflAmnt) operList.inflAmt.yearMin = inflAmnt;
if (operList.sumFlow.yearMin > sumFlow) operList.sumFlow.yearMin = sumFlow;
if (operList.returnFlow.yearMin > returnAmnt) operList.returnFlow.yearMin = returnAmnt;
if (operList.efflFlow.yearMin > efflAmnt) operList.efflFlow.yearMin = efflAmnt;
if (month === '06' || month === '07' || month === '08') {
summerDay += 1;
operList.inFlow.summerTot += inflAmnt + sumFlow + returnAmnt;
operList.inflAmt.summerTot += inflAmnt;
operList.sumFlow.summerTot += sumFlow;
operList.returnFlow.summerTot += returnAmnt;
operList.efflFlow.summerTot += efflAmnt;
} else if (month === '01' || month === '02') {
winterDay += 1;
operList.inFlow.winterTot += inflAmnt + sumFlow + returnAmnt;
operList.inflAmt.winterTot += inflAmnt;
operList.sumFlow.winterTot += sumFlow;
operList.returnFlow.winterTot += returnAmnt;
operList.efflFlow.winterTot += efflAmnt;
}
}); // --일별 유량 end
// 연간 평균
operList.inFlow.yearAvg = (yearDay > 0) ? operList.inFlow.yearTot / yearDay : 0;
operList.inflAmt.yearAvg = (yearDay > 0) ? operList.inflAmt.yearTot / yearDay : 0;
operList.sumFlow.yearAvg = (yearDay > 0) ? operList.sumFlow.yearTot / yearDay : 0;
operList.returnFlow.yearAvg = (yearDay > 0) ? operList.returnFlow.yearTot / yearDay : 0;
operList.efflFlow.yearAvg = (yearDay > 0) ? operList.efflFlow.yearTot / yearDay : 0;
// 하절기 전기간 평균
operList.inFlow.summerAvg = (summerDay > 0) ? operList.inFlow.summerTot / summerDay : 0;
operList.inflAmt.summerAvg = (summerDay > 0) ? operList.inflAmt.summerTot / summerDay : 0;
operList.sumFlow.summerAvg = (summerDay > 0) ? operList.sumFlow.summerTot / summerDay : 0;
operList.returnFlow.summerAvg = (summerDay > 0) ? operList.returnFlow.summerTot / summerDay : 0;
operList.efflFlow.summerAvg = (summerDay > 0) ? operList.efflFlow.summerTot / summerDay : 0;
// 하절기 강우시 평균
operList.inFlow.summerRainy = (summerRainDay > 0) ? operList.inFlow.summerRainy / summerRainDay : 0;
operList.inflAmt.summerRainy = (summerRainDay > 0) ? operList.inflAmt.summerRainy / summerRainDay : 0;
operList.sumFlow.summerRainy = (summerRainDay > 0) ? operList.sumFlow.summerRainy / summerRainDay : 0;
operList.returnFlow.summerRainy = (summerRainDay > 0) ? operList.returnFlow.summerRainy / summerRainDay : 0;
operList.efflFlow.summerRainy = (summerRainDay > 0) ? operList.efflFlow.summerRainy / summerRainDay : 0;
// 하절기 청천시 평균
operList.inFlow.summerSunny = (summerChungchunDay > 0) ? operList.inFlow.summerSunny / summerChungchunDay : 0;
operList.inflAmt.summerSunny = (summerChungchunDay > 0) ? operList.inflAmt.summerSunny / summerChungchunDay : 0;
operList.sumFlow.summerSunny = (summerChungchunDay > 0) ? operList.sumFlow.summerSunny / summerChungchunDay : 0;
operList.returnFlow.summerSunny = (summerChungchunDay > 0) ? operList.returnFlow.summerSunny / summerChungchunDay : 0;
operList.efflFlow.summerSunny = (summerChungchunDay > 0) ? operList.efflFlow.summerSunny / summerChungchunDay : 0;
// 동절기 전기간 평균
operList.inFlow.winterAvg = (winterDay > 0) ? operList.inFlow.winterTot / winterDay : 0;
operList.inflAmt.winterAvg = (winterDay > 0) ? operList.inflAmt.winterTot / winterDay : 0;
operList.sumFlow.winterAvg = (winterDay > 0) ? operList.sumFlow.winterTot / winterDay : 0;
operList.returnFlow.winterAvg = (winterDay > 0) ? operList.returnFlow.winterTot / winterDay : 0;
operList.efflFlow.winterAvg = (winterDay > 0) ? operList.efflFlow.winterTot / winterDay : 0;
// 동절기 청천시 평균
operList.inFlow.winterSunny = (winterChungchuDay > 0) ? operList.inFlow.winterSunny / winterChungchuDay : 0;
operList.inflAmt.winterSunny = (winterChungchuDay > 0) ? operList.inflAmt.winterSunny / winterChungchuDay : 0;
operList.sumFlow.winterSunny = (winterChungchuDay > 0) ? operList.sumFlow.winterSunny / winterChungchuDay : 0;
operList.returnFlow.winterSunny = (winterChungchuDay > 0) ? operList.returnFlow.winterSunny / winterChungchuDay : 0;
operList.efflFlow.winterSunny = (winterChungchuDay > 0) ? operList.efflFlow.winterSunny / winterChungchuDay : 0;
// 연간 유입 평균 = 하수유입량(순수하수유입량) + 연계처리량 + 반류수유량(m³/일)
operationalStatusList[0].yearAvg = roundUp(operList.inFlow.yearAvg, 0); // 연간 유입 평균 = 하수유입량(순수하수유입량) + 연계처리량 + 반류수유량(m³/일)
operationalStatusList[0].yearMax = roundUp(operList.inFlow.yearMax, 0); // 연간 유입 최대
operationalStatusList[0].yearMin = roundUp(operList.inFlow.yearMin, 0); // 연간 유입 최소
operationalStatusList[0].summerAll = roundUp(operList.inFlow.summerAvg, 0); // 하절기 유입 전기간
operationalStatusList[0].summerThree = roundUp(operList.inFlow.summerRainy, 0); // 하절기 유입 강우시(강우영향일)
operationalStatusList[0].summerRain = roundUp(operList.inFlow.summerSunny, 0); // 하절기 유입 청천시
operationalStatusList[0].winterAll = roundUp(operList.inFlow.winterAvg, 0); // 동절기 유입 전기간
operationalStatusList[0].winterSunnyMin = roundUp(operList.inFlow.winterSunnyMin, 0); // 동절기 유입 최소
operationalStatusList[0].winterSunnyMax = roundUp(operList.inFlow.winterSunnyMax, 0); // 동절기 유입 최대
operationalStatusList[0].winterSunnyAvg = roundUp(operList.inFlow.winterAvg, 0); // 동절기 유입 평균
// 청천시 유입(순수하수) 평균
const usage = operList.inflAmt.yearSunny / cntSunnyDay; // 연간 청천 순수하수 평균
const summerUsage = operList.inflAmt.summerSunny; // 하절기 청천 순수하수 평균
const winterUsage = operList.inflAmt.winterSunny; // 동절기 청천 순수하수 평균
// 물사용량 = 유입평균 * 0.65
const wtrUsg = operList.inflAmt.yearAvg * 0.65; // 연간 물사용량 평균
const wtrUsgSummer = operList.inflAmt.summerAvg * 0.65; // 하절기 물사용량 평균
const wtrUsgWinter = operList.inflAmt.winterAvg * 0.65; // 동절기 물사용량 평균
// 지하수유입량
operationalStatusList[0].groundWaterAvg = Math.round((usage - (wtrUsg * OSU_PERCENT)) * 100) / 100;
operationalStatusList[0].groundWaterSummer = Math.round((summerUsage - (wtrUsgSummer * OSU_PERCENT)) * 100) / 100;
operationalStatusList[0].groundWaterWinter = Math.round((winterUsage - (wtrUsgWinter * OSU_PERCENT)) * 100) / 100;
// 오염물질
// RDII 추정 = 하절기(6~8월) 중 최저 유입 BOD일때 유입유량 x ((동절기 청천시 유입BOD - 하절기(6~8월) 중 최저 유입BOD) / (동절기 청천시 유입BOD))
// const resp = await fetchMainGraph(searchYear, fcltyCd);
const resp = mainGraphData;
if (resp && resp.data && resp.data.wqltObjs && resp.data.wqltObjs.length > 0) {
const wqltData = resp.data.wqltObjs;
const wqltDataTot = CalcRainEffect(clone(wqltData));
const wqltDataSunny = CalcRainEffect(clone(wqltData), 'SUNNY');
let minSummerBod = 99999999;
let minSummerBodInfl = 99999999;
let winterCnt = 0;
let winterBodSunny = 0;
let rdiRain = 0;
const summerMonth = ['06', '07', '08'];
const winterMonth = ['01', '02'];
wqltDataTot.filter(item => summerMonth.includes(item.msrDt.toString().replaceAll('-', '').substring(4, 6))).forEach(item2 => {
if (Number(item2.infoRnDay) >= 3) { // 3mm 이상 강우일
const inflBod = Number(item2.inflAssctBfrWqltBod); //유입연계전수질_BOD(mg/L)
const infl = Number(item2.inflAmnt); //실제유입량(반류수제거)(m³/일)
const rain = Number(item2.infoRnDay); //강우량
if (inflBod < minSummerBod) {
minSummerBodInfl = infl;
minSummerBod = inflBod;
rdiRain = rain; // 하절기 최소 bod일때의 일강수량
} }
} }
});
wqltDataSunny.filter(item => winterMonth.includes(item.msrDt.toString().replaceAll('-', '').substring(4, 6))).forEach(item2 => { const inflowOne = inflAmnt + sumFlow + returnAmnt;
winterBodSunny += Number(item2.inflAssctBfrWqltBod); // 동절기 청천시 유입BOD(mg/L) operList.inFlow.yearTot += inflAmnt + sumFlow + returnAmnt;
winterCnt += 1; operList.inflAmt.yearTot += inflAmnt;
}); operList.sumFlow.yearTot += sumFlow;
operList.returnFlow.yearTot += returnAmnt;
operList.efflFlow.yearTot += efflAmnt;
const roundMinSummerBodInfl = Number(roundNumber(minSummerBodInfl, 0).toString().replaceAll(',', '')); if (operList.inFlow.yearMax < inflowOne) operList.inFlow.yearMax = inflowOne;
const roundMinSummerBod = Number(roundNumber(minSummerBod, 1).toString().replaceAll(',', '')); if (operList.inflAmt.yearMax < inflAmnt) operList.inflAmt.yearMax = inflAmnt;
const roundWinterBodSunny = Number(roundNumber(winterBodSunny, 1).toString().replaceAll(',', '')); if (operList.sumFlow.yearMax < sumFlow) operList.sumFlow.yearMax = sumFlow;
if (operList.returnFlow.yearMax < returnAmnt) operList.returnFlow.yearMax = returnAmnt;
if (operList.efflFlow.yearMax < efflAmnt) operList.efflFlow.yearMax = efflAmnt;
const winterBodAvg = Number(roundNumber((roundWinterBodSunny / winterCnt), 1).toString().replaceAll(',', '')); if (operList.inFlow.yearMin > inflowOne) operList.inFlow.yearMin = inflowOne;
// 하절기(6~8월) 중 최저 유입 BOD일때 유입유량 x ((동절기 청천시 유입BOD - 하절기(6~8월) 중 최저 유입BOD) / (동절기 청천시 유입BOD)) if (operList.inflAmt.yearMin > inflAmnt) operList.inflAmt.yearMin = inflAmnt;
const winMinusSum = winterBodAvg - roundMinSummerBod; if (operList.sumFlow.yearMin > sumFlow) operList.sumFlow.yearMin = sumFlow;
if (operList.returnFlow.yearMin > returnAmnt) operList.returnFlow.yearMin = returnAmnt;
if (operList.efflFlow.yearMin > efflAmnt) operList.efflFlow.yearMin = efflAmnt;
const rdiValue = winMinusSum === 0 ? 0 : roundMinSummerBodInfl * (winMinusSum / winterBodAvg); if (month === '06' || month === '07' || month === '08') {
summerDay += 1;
operList.inFlow.summerTot += inflAmnt + sumFlow + returnAmnt;
operList.inflAmt.summerTot += inflAmnt;
operList.sumFlow.summerTot += sumFlow;
operList.returnFlow.summerTot += returnAmnt;
operList.efflFlow.summerTot += efflAmnt;
} else if (month === '01' || month === '02') {
winterDay += 1;
operList.inFlow.winterTot += inflAmnt + sumFlow + returnAmnt;
operList.inflAmt.winterTot += inflAmnt;
operList.sumFlow.winterTot += sumFlow;
operList.returnFlow.winterTot += returnAmnt;
operList.efflFlow.winterTot += efflAmnt;
}
}); // --일별 유량 end
rdiPercent = (rdiValue / minSummerBodInfl) * 100; // 연간 평균
operList.inFlow.yearAvg = (yearDay > 0) ? operList.inFlow.yearTot / yearDay : 0;
operList.inflAmt.yearAvg = (yearDay > 0) ? operList.inflAmt.yearTot / yearDay : 0;
operList.sumFlow.yearAvg = (yearDay > 0) ? operList.sumFlow.yearTot / yearDay : 0;
operList.returnFlow.yearAvg = (yearDay > 0) ? operList.returnFlow.yearTot / yearDay : 0;
operList.efflFlow.yearAvg = (yearDay > 0) ? operList.efflFlow.yearTot / yearDay : 0;
// 하절기 전기간 평균
operList.inFlow.summerAvg = (summerDay > 0) ? operList.inFlow.summerTot / summerDay : 0;
operList.inflAmt.summerAvg = (summerDay > 0) ? operList.inflAmt.summerTot / summerDay : 0;
operList.sumFlow.summerAvg = (summerDay > 0) ? operList.sumFlow.summerTot / summerDay : 0;
operList.returnFlow.summerAvg = (summerDay > 0) ? operList.returnFlow.summerTot / summerDay : 0;
operList.efflFlow.summerAvg = (summerDay > 0) ? operList.efflFlow.summerTot / summerDay : 0;
// 하절기 강우시 평균
operList.inFlow.summerRainy = (summerRainDay > 0) ? operList.inFlow.summerRainy / summerRainDay : 0;
operList.inflAmt.summerRainy = (summerRainDay > 0) ? operList.inflAmt.summerRainy / summerRainDay : 0;
operList.sumFlow.summerRainy = (summerRainDay > 0) ? operList.sumFlow.summerRainy / summerRainDay : 0;
operList.returnFlow.summerRainy = (summerRainDay > 0) ? operList.returnFlow.summerRainy / summerRainDay : 0;
operList.efflFlow.summerRainy = (summerRainDay > 0) ? operList.efflFlow.summerRainy / summerRainDay : 0;
// 하절기 청천시 평균
operList.inFlow.summerSunny = (summerChungchunDay > 0) ? operList.inFlow.summerSunny / summerChungchunDay : 0;
operList.inflAmt.summerSunny = (summerChungchunDay > 0) ? operList.inflAmt.summerSunny / summerChungchunDay : 0;
operList.sumFlow.summerSunny = (summerChungchunDay > 0) ? operList.sumFlow.summerSunny / summerChungchunDay : 0;
operList.returnFlow.summerSunny = (summerChungchunDay > 0) ? operList.returnFlow.summerSunny / summerChungchunDay : 0;
operList.efflFlow.summerSunny = (summerChungchunDay > 0) ? operList.efflFlow.summerSunny / summerChungchunDay : 0;
// 동절기 전기간 평균
operList.inFlow.winterAvg = (winterDay > 0) ? operList.inFlow.winterTot / winterDay : 0;
operList.inflAmt.winterAvg = (winterDay > 0) ? operList.inflAmt.winterTot / winterDay : 0;
operList.sumFlow.winterAvg = (winterDay > 0) ? operList.sumFlow.winterTot / winterDay : 0;
operList.returnFlow.winterAvg = (winterDay > 0) ? operList.returnFlow.winterTot / winterDay : 0;
operList.efflFlow.winterAvg = (winterDay > 0) ? operList.efflFlow.winterTot / winterDay : 0;
// 동절기 청천시 평균
operList.inFlow.winterSunny = (winterChungchuDay > 0) ? operList.inFlow.winterSunny / winterChungchuDay : 0;
operList.inflAmt.winterSunny = (winterChungchuDay > 0) ? operList.inflAmt.winterSunny / winterChungchuDay : 0;
operList.sumFlow.winterSunny = (winterChungchuDay > 0) ? operList.sumFlow.winterSunny / winterChungchuDay : 0;
operList.returnFlow.winterSunny = (winterChungchuDay > 0) ? operList.returnFlow.winterSunny / winterChungchuDay : 0;
operList.efflFlow.winterSunny = (winterChungchuDay > 0) ? operList.efflFlow.winterSunny / winterChungchuDay : 0;
operationalStatusList[0].rdi = rdiValue; // RDII 추정 // 연간 유입 평균 = 하수유입량(순수하수유입량) + 연계처리량 + 반류수유량(m³/일)
operationalStatusList[0].rdiRain = rdiRain; // RDII 추정시 일강수량(mm) operationalStatusList[0].yearAvg = roundUp(operList.inFlow.yearAvg, 0); // 연간 유입 평균 = 하수유입량(순수하수유입량) + 연계처리량 + 반류수유량(m³/일)
operationalStatusList[0].yearMax = roundUp(operList.inFlow.yearMax, 0); // 연간 유입 최대
operationalStatusList[0].yearMin = roundUp(operList.inFlow.yearMin, 0); // 연간 유입 최소
operationalStatusList[0].summerAll = roundUp(operList.inFlow.summerAvg, 0); // 하절기 유입 전기간
operationalStatusList[0].summerThree = roundUp(operList.inFlow.summerRainy, 0); // 하절기 유입 강우시(강우영향일)
operationalStatusList[0].summerRain = roundUp(operList.inFlow.summerSunny, 0); // 하절기 유입 청천시
operationalStatusList[0].winterAll = roundUp(operList.inFlow.winterAvg, 0); // 동절기 유입 전기간
operationalStatusList[0].winterSunnyMin = roundUp(operList.inFlow.winterSunnyMin, 0); // 동절기 유입 최소
operationalStatusList[0].winterSunnyMax = roundUp(operList.inFlow.winterSunnyMax, 0); // 동절기 유입 최대
operationalStatusList[0].winterSunnyAvg = roundUp(operList.inFlow.winterAvg, 0); // 동절기 유입 평균
// 청천시 유입(순수하수) 평균
const usage = operList.inflAmt.yearSunny / cntSunnyDay; // 연간 청천 순수하수 평균
const summerUsage = operList.inflAmt.summerSunny; // 하절기 청천 순수하수 평균
const winterUsage = operList.inflAmt.winterSunny; // 동절기 청천 순수하수 평균
// 물사용량 = 유입평균 * 0.65
const wtrUsg = operList.inflAmt.yearAvg * 0.65; // 연간 물사용량 평균
const wtrUsgSummer = operList.inflAmt.summerAvg * 0.65; // 하절기 물사용량 평균
const wtrUsgWinter = operList.inflAmt.winterAvg * 0.65; // 동절기 물사용량 평균
// 지하수유입량
operationalStatusList[0].groundWaterAvg = Math.round((usage - (wtrUsg * OSU_PERCENT)) * 100) / 100;
operationalStatusList[0].groundWaterSummer = Math.round((summerUsage - (wtrUsgSummer * OSU_PERCENT)) * 100) / 100;
operationalStatusList[0].groundWaterWinter = Math.round((winterUsage - (wtrUsgWinter * OSU_PERCENT)) * 100) / 100;
// 오염물질
// RDII 추정 = 하절기(6~8월) 중 최저 유입 BOD일때 유입유량 x ((동절기 청천시 유입BOD - 하절기(6~8월) 중 최저 유입BOD) / (동절기 청천시 유입BOD))
// const resp = await fetchMainGraph(searchYear, fcltyCd);
const resp = mainGraphData;
if (resp && resp.data && resp.data.wqltObjs && resp.data.wqltObjs.length > 0) {
const wqltData = resp.data.wqltObjs;
const wqltDataTot = CalcRainEffect(clone(wqltData));
const wqltDataSunny = CalcRainEffect(clone(wqltData), 'SUNNY');
let minSummerBod = 99999999;
let minSummerBodInfl = 99999999;
let winterCnt = 0;
let winterBodSunny = 0;
let rdiRain = 0;
const summerMonth = ['06', '07', '08'];
const winterMonth = ['01', '02'];
wqltDataTot.filter(item => summerMonth.includes(item.msrDt.toString().replaceAll('-', '').substring(4, 6))).forEach(item2 => {
if (Number(item2.infoRnDay) >= 3) { // 3mm 이상 강우일
const inflBod = Number(item2.inflAssctBfrWqltBod); //유입연계전수질_BOD(mg/L)
const infl = Number(item2.inflAmnt); //실제유입량(반류수제거)(m³/일)
const rain = Number(item2.infoRnDay); //강우량
if (inflBod < minSummerBod) {
minSummerBodInfl = infl;
minSummerBod = inflBod;
rdiRain = rain; // 하절기 최소 bod일때의 일강수량
}
}
});
wqltDataSunny.filter(item => winterMonth.includes(item.msrDt.toString().replaceAll('-', '').substring(4, 6))).forEach(item2 => {
winterBodSunny += Number(item2.inflAssctBfrWqltBod); // 동절기 청천시 유입BOD(mg/L)
winterCnt += 1;
});
const roundMinSummerBodInfl = Number(roundNumber(minSummerBodInfl, 0).toString().replaceAll(',', ''));
const roundMinSummerBod = Number(roundNumber(minSummerBod, 1).toString().replaceAll(',', ''));
const roundWinterBodSunny = Number(roundNumber(winterBodSunny, 1).toString().replaceAll(',', ''));
const winterBodAvg = Number(roundNumber((roundWinterBodSunny / winterCnt), 1).toString().replaceAll(',', ''));
// 하절기(6~8월) 중 최저 유입 BOD일때 유입유량 x ((동절기 청천시 유입BOD - 하절기(6~8월) 중 최저 유입BOD) / (동절기 청천시 유입BOD))
const winMinusSum = winterBodAvg - roundMinSummerBod;
const rdiValue = winMinusSum === 0 ? 0 : roundMinSummerBodInfl * (winMinusSum / winterBodAvg);
rdiPercent = (rdiValue / minSummerBodInfl) * 100;
operationalStatusList[0].rdi = rdiValue; // RDII 추정
operationalStatusList[0].rdiRain = rdiRain; // RDII 추정시 일강수량(mm)
}
} }
if (operationalStatusList[0] && operationalStatusList[7]) {
// operationalStatusList[7].groundWaterAvg = operationalStatusList[0].groundWaterAvg === null ? '' : operList.inFlow.yearTot && data.yearData.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterAvg.toString().replaceAll(',', '')) / (data.yearData && data.yearData.AVG_INFL_AMNT ? Number(data.yearData.AVG_INFL_AMNT.toString().replaceAll(',', '')) : 0) * 100) * 10) / 10 + '%';
// operationalStatusList[7].groundWaterSummer = operationalStatusList[0].groundWaterSummer === null ? '' : data.summer && data.summer.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterSummer.toString().replaceAll(',', '')) / (data.summer && data.summer.AVG_INFL_AMNT ? Number(data.summer.AVG_INFL_AMNT.toString().replaceAll(',', '')) : 0) * 100) * 10) / 10 + '%';
// operationalStatusList[7].groundWaterWinter = operationalStatusList[0].groundWaterWinter === null ? '' : data.winter && data.winter.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterWinter.toString().replaceAll(',', '')) / (data.winter && data.winter.AVG_INFL_AMNT ? Number(data.winter.AVG_INFL_AMNT.toString().replaceAll(',', '')) : 0) * 100) * 10) / 10 + '%';
operationalStatusList[7].groundWaterAvg = operList.inflAmt.yearAvg === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterAvg.toString().replaceAll(',', '')) / operList.inflAmt.yearAvg * 100) * 10) / 10 + '%';
operationalStatusList[7].groundWaterSummer = operList.inflAmt.summerAvg === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterSummer.toString().replaceAll(',', '')) / operList.inflAmt.summerAvg * 100) * 10) / 10 + '%';
operationalStatusList[7].groundWaterWinter = operList.inflAmt.winterAvg === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterWinter.toString().replaceAll(',', '')) / operList.inflAmt.winterAvg * 100) * 10) / 10 + '%';
operationalStatusList[7].rdi = roundNumber(rdiPercent, 1) + '%';
}
// 순수하수량(1), 연계처리수(2), 총인설비방류수(3), 방류수(4) 데이터 매핑
const flowMappings = [
{ index: 0, source: operList.inFlow },
{ index: 1, source: operList.inflAmt },
{ index: 2, source: operList.sumFlow },
{ index: 3, source: operList.returnFlow },
{ index: 4, source: operList.efflFlow },
];
flowMappings.forEach(({ index, source }) => {
const item = operationalStatusList[index];
if (item) {
item.yearAvg = source.yearAvg;
item.yearMax = source.yearMax;
item.yearMin = source.yearMin;
item.summerAll = source.summerAvg;
item.summerThree = source.summerRainy;
item.summerRain = source.summerSunny;
item.winterSunnyAvg = source.winterSunny;
item.winterSunnyMax = source.winterSunnyMax;
item.winterSunnyMin = source.winterSunnyMin;
item.winterAll = source.winterAvg;
dataFormSetting(item);
}
});
} }
if (operationalStatusList[0] && operationalStatusList[7]) { const rtnData = await calcWaterQltyData(operationalStatusList, searchYear, fcltyCd, mainGraphData); // 수질 데이터 청천시, 강우시 재계산
// operationalStatusList[7].groundWaterAvg = operationalStatusList[0].groundWaterAvg === null ? '' : operList.inFlow.yearTot && data.yearData.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterAvg.toString().replaceAll(',', '')) / (data.yearData && data.yearData.AVG_INFL_AMNT ? Number(data.yearData.AVG_INFL_AMNT.toString().replaceAll(',', '')) : 0) * 100) * 10) / 10 + '%';
// operationalStatusList[7].groundWaterSummer = operationalStatusList[0].groundWaterSummer === null ? '' : data.summer && data.summer.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterSummer.toString().replaceAll(',', '')) / (data.summer && data.summer.AVG_INFL_AMNT ? Number(data.summer.AVG_INFL_AMNT.toString().replaceAll(',', '')) : 0) * 100) * 10) / 10 + '%'; let tpFctYn = 'N';
// operationalStatusList[7].groundWaterWinter = operationalStatusList[0].groundWaterWinter === null ? '' : data.winter && data.winter.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterWinter.toString().replaceAll(',', '')) / (data.winter && data.winter.AVG_INFL_AMNT ? Number(data.winter.AVG_INFL_AMNT.toString().replaceAll(',', '')) : 0) * 100) * 10) / 10 + '%'; if (mainGraphData.data.wqltObjs && mainGraphData.data.wqltObjs.length > 0)
operationalStatusList[7].groundWaterAvg = operList.inflAmt.yearAvg === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterAvg.toString().replaceAll(',', '')) / operList.inflAmt.yearAvg * 100) * 10) / 10 + '%'; tpFctYn = mainGraphData.data.wqltObjs?.[0].tpFctYn;
operationalStatusList[7].groundWaterSummer = operList.inflAmt.summerAvg === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterSummer.toString().replaceAll(',', '')) / operList.inflAmt.summerAvg * 100) * 10) / 10 + '%'; // 총인설비가 없을 경우 제외
operationalStatusList[7].groundWaterWinter = operList.inflAmt.winterAvg === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterWinter.toString().replaceAll(',', '')) / operList.inflAmt.winterAvg * 100) * 10) / 10 + '%'; console.log('총인시설 여부 : ', tpFctYn);
operationalStatusList[7].rdi = roundNumber(rdiPercent, 1) + '%';
// console.log('rtnData : ', rtnData);
if (tpFctYn !== 'Y') {
operationalStatusList = rtnData.slice(0, 11);
} else {
operationalStatusList = rtnData;
} }
set((state: DashBoardType) => ({
// 순수하수량(1), 연계처리수(2), 총인설비방류수(3), 방류수(4) 데이터 매핑 ...state,
const flowMappings = [ OperationStatus: {
{ index: 0, source: operList.inFlow }, ...state.OperationStatus,
{ index: 1, source: operList.inflAmt }, operationalStatusList: operationalStatusList,
{ index: 2, source: operList.sumFlow }, operationalStatusCount: 0,
{ index: 3, source: operList.returnFlow }, },
{ index: 4, source: operList.efflFlow }, }))
]; } catch (error) {
flowMappings.forEach(({ index, source }) => { console.error('시설정보 운영실태 처리 중 오류가 발생했습니다:', error);
const item = operationalStatusList[index]; } finally {
if (item) { // 성공/실패와 관계없이 로딩 오버레이를 해제한다.
item.yearAvg = source.yearAvg; set((state: DashBoardType) => ({
item.yearMax = source.yearMax; ...state,
item.yearMin = source.yearMin; OperationStatus: {
item.summerAll = source.summerAvg; ...state.OperationStatus,
item.summerThree = source.summerRainy; isLoadingOperationStatus: false,
item.summerRain = source.summerSunny; },
item.winterSunnyAvg = source.winterSunny; }));
item.winterSunnyMax = source.winterSunnyMax;
item.winterSunnyMin = source.winterSunnyMin;
item.winterAll = source.winterAvg;
dataFormSetting(item);
}
});
} }
const rtnData = await calcWaterQltyData(operationalStatusList, searchYear, fcltyCd, mainGraphData); // 수질 데이터 청천시, 강우시 재계산
let tpFctYn = 'N';
if (mainGraphData.data.wqltObjs && mainGraphData.data.wqltObjs.length > 0)
tpFctYn = mainGraphData.data.wqltObjs?.[0].tpFctYn;
// 총인설비가 없을 경우 제외
console.log('총인시설 여부 : ', tpFctYn);
// console.log('rtnData : ', rtnData);
if (tpFctYn !== 'Y') {
operationalStatusList = rtnData.slice(0, 11);
} else {
operationalStatusList = rtnData;
}
set((state: DashBoardType) => ({
...state,
OperationStatus: {
...state.OperationStatus,
operationalStatusList: operationalStatusList,
operationalStatusCount: 0,
isLoadingOperationStatus: false,
},
}))
}, },
searchMainGraph: async (searchYear: string, fcltyCd: string) => { searchMainGraph: async (searchYear: string, fcltyCd: string) => {
@@ -5,6 +5,7 @@
"use client"; "use client";
import type { ExmnMapFilters, ExmnMapJobType } from "./exmn-map-types"; import type { ExmnMapFilters, ExmnMapJobType } from "./exmn-map-types";
import { EXMN_RESULT_PPL_LEGEND_COLOR } from "./exmn-map-types";
import LayerSettingCard from "../layer-setting/layer-setting-card"; import LayerSettingCard from "../layer-setting/layer-setting-card";
type Props = { type Props = {
@@ -52,7 +53,8 @@ export default function ExmnLayerSettingPanel({
<label className="flex min-h-[24px] flex-col items-stretch gap-1"> <label className="flex min-h-[24px] flex-col items-stretch gap-1">
<span className={`flex items-center gap-1 ${labelClass}`}> <span className={`flex items-center gap-1 ${labelClass}`}>
<span <span
className={`h-2 w-2 rounded-full ${jobType === "PPL" ? "bg-[#facc15]" : "bg-[#8b5cf6]"}`} className="h-2 w-2 rounded-full"
style={{ backgroundColor: jobType === "PPL" ? EXMN_RESULT_PPL_LEGEND_COLOR : "#8b5cf6" }}
/> />
사업차수 사업차수
</span> </span>
@@ -8,7 +8,7 @@ export const EXMN_RESULT_ROOT_LAYER_TYPE = "sn_exmn_result_group";
export const EXMN_RESULT_PPL_LAYER_TYPE = "sn_exmn_result_ppl"; export const EXMN_RESULT_PPL_LAYER_TYPE = "sn_exmn_result_ppl";
export const EXMN_RESULT_MNHL_LAYER_TYPE = "sn_exmn_result_mnhl"; export const EXMN_RESULT_MNHL_LAYER_TYPE = "sn_exmn_result_mnhl";
// 레이어 트리에서 조사 관로와 기존 맨홀 분류 심볼을 즉시 구분하기 위한 전용 범례 스타일이다. // 레이어 트리에서 조사 관로와 기존 맨홀 분류 심볼을 즉시 구분하기 위한 전용 범례 스타일이다.
export const EXMN_RESULT_PPL_LEGEND_COLOR = "#facc15"; export const EXMN_RESULT_PPL_LEGEND_COLOR = "#000080";
export const EXMN_RESULT_MNHL_LEGEND_ICON = "SN_EXMN_MANHOLE_PURPLE.png?v=3"; export const EXMN_RESULT_MNHL_LEGEND_ICON = "SN_EXMN_MANHOLE_PURPLE.png?v=3";
export type ExmnMapJobType = "PPL" | "MNHL"; export type ExmnMapJobType = "PPL" | "MNHL";
@@ -4,6 +4,7 @@ import Icon from "ol/style/Icon.js";
import Stroke from "ol/style/Stroke.js"; import Stroke from "ol/style/Stroke.js";
import Style from "ol/style/Style.js"; import Style from "ol/style/Style.js";
import Text from "ol/style/Text.js"; import Text from "ol/style/Text.js";
import { EXMN_RESULT_PPL_LEGEND_COLOR } from "../components/exmn/exmn-map-types";
import { import {
EXMN_GRADE_COLORS, EXMN_GRADE_COLORS,
EXMN_RESULT_MANHOLE_ICON_SRC, EXMN_RESULT_MANHOLE_ICON_SRC,
@@ -14,10 +15,11 @@ export const getExmnGradeColor = (feature: any) => {
return EXMN_GRADE_COLORS[grade] ?? "#2563eb"; return EXMN_GRADE_COLORS[grade] ?? "#2563eb";
}; };
export const createExmnPipeStyle = (feature: any) => // 조사 관로는 상태등급과 관계없이 범례와 같은 짙은 남색으로 표시한다.
export const createExmnPipeStyle = () =>
new Style({ new Style({
stroke: new Stroke({ stroke: new Stroke({
color: getExmnGradeColor(feature), color: EXMN_RESULT_PPL_LEGEND_COLOR,
width: 4, width: 4,
}), }),
}); });
@@ -1,73 +0,0 @@
"use client";
import { CalendarIcon } from "lucide-react";
import { useState, type ComponentProps } from "react";
import { Button, Calendar, Popover, PopoverContent, PopoverTrigger } from "@common/components/ui";
type CalendarProps = ComponentProps<typeof Calendar>;
type SearchDatePickerProps = {
selected?: Date;
onSelect: (date: Date | undefined) => void;
placeholder?: string;
className?: string;
disabled?: CalendarProps["disabled"];
defaultMonth?: CalendarProps["defaultMonth"];
};
const formatDateLabel = (date: Date) => {
const year = date.getFullYear();
const month = `${date.getMonth() + 1}`.padStart(2, "0");
const day = `${date.getDate()}`.padStart(2, "0");
return `${year}-${month}-${day}`;
};
export function SearchDatePicker({
selected,
onSelect,
placeholder = "날짜 선택",
className,
disabled,
defaultMonth,
}: SearchDatePickerProps) {
// 검색조건 달력은 날짜 선택과 동시에 Popover를 닫아야 하므로 open 상태를 화면 전용으로 제어한다.
const [open, setOpen] = useState(false);
const handleSelect = (date: Date | undefined) => {
onSelect(date);
if (date) {
setOpen(false);
}
};
return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>
<Button
variant="outline"
className={[
"h-[3rem] w-[12rem] justify-start border-input !bg-background px-4 py-2 text-left text-[1.3rem] font-normal text-muted-foreground hover:!bg-accent",
className,
]
.filter(Boolean)
.join(" ")}
disabled={disabled === true}
>
<CalendarIcon className="!size-[1.6rem]" />
{selected ? formatDateLabel(selected) : <span>{placeholder}</span>}
</Button>
</PopoverTrigger>
<PopoverContent className="w-auto p-0">
<Calendar
classNames={{ cell: "rounded-md" }}
mode="single"
selected={selected}
onSelect={handleSelect}
disabled={disabled}
defaultMonth={defaultMonth}
/>
</PopoverContent>
</Popover>
);
}
@@ -1,359 +0,0 @@
/**
* ➡️ 경로 : 유지관리 정보 - 도시침수예방사업
*
* 📄 FloodPre Page
* 침수예방 사업 정보 등록 및 조회 페이지 컴포넌트
*
* - 사업 정보 등록 현황 조회 및 테이블 표시
* - 페이징 및 검색 기능 (등록기간/등록자/파일명 기반)
* - 파일 업로드 및 등록 기능
* - 파일 다운로드 및 삭제 기능
* - 엑셀 데이터 테이블 모달 표시
* - 로딩 오버레이 및 에러 핸들링 지원
*
* 🔗 사용 API
* - 도시침수예방사업 목록 조회: GET /api/v1/sbmrgPrevnt (sewerage-service)
* - 도시침수예방사업 등록: POST /api/v1/sbmrgPrevnt (sewerage-service)
* - 첨부파일 삭제및 Soft Delete 삭제: DELETE /api/v1/atfl/attachments/{atflId} (attach-service)
*/
"use client";
import { getSnRowNumber } from "@/shared/lib/row-number";
import { deleteData } from "@/shared/api/sewerage-api";
import { useCookieAuth } from "@/entities/auth/lib/use-cookie-auth";
import { searchData } from "@/shared/api/search-page";
import { formatDate, handleDownload } from "@/components/lib/utils";
import LoadingOverlay from "@/components/ui/loading-bar";
import {
StandardDataTable,
} from "@common/business_components";
import { Button, Input, Label } from "@common/components";
import { useEffect, useMemo, useState } from "react";
import {
getCoreRowModel,
useReactTable,
type ColumnDef,
type PaginationState,
} from "@tanstack/react-table";
import { openWindowPopup } from "@/features/window-popup/lib/open-window-popup";
import { WINDOW_POPUP_MESSAGE_TYPE } from "@/features/window-popup/model/types";
import { SearchDatePicker } from "../components/search-date-picker";
import { useConfirm } from "@frontend-opensource/use-react-hooks";
import { useAlertStore } from "@/shared/lib";
const PAGE_SIZE = 10;
type FloodPreRow = Record<string, unknown> & {
rowNumber: number;
sbmrgPrevntBizSn: string;
sbmrgPrevntBizNm?: string;
atflId?: string;
};
type FloodPreSearch = {
fromDate: Date;
toDate: Date;
projectName: string;
};
const FLOOD_PRE_COLUMNS: Array<{
id: keyof FloodPreRow;
title: string;
width: number;
}> = [
{ id: "rowNumber", title: "순번", width: 70 },
{ id: "sbmrgPrevntBizNm", title: "파일명", width: 260 },
{ id: "mngYr", title: "년도", width: 90 },
{ id: "mngQu", title: "분기", width: 90 },
{ id: "regDt", title: "등록 일자", width: 120 },
{ id: "rgtrNm", title: "등록자", width: 120 },
];
const Page = () => {
const AUTH = useCookieAuth();
const { confirm } = useConfirm();
const alert = useAlertStore((state) => state.setMessage);
// 조회조건
const [fromDate, setFromDate] = useState(() => {
const date = new Date();
date.setDate(date.getDate() - 7);
return date;
});
const [toDate, setToDate] = useState(new Date());
const [usr, setUsr] = useState("");
const [pjNm, setpjNm] = useState("");
// 파일업로드 관련 상태
const [fileNm, setFileNm] = useState(""); //파일명
const [atflId, setAtflId] = useState(""); //파일 ID
const [sbmrgPrevntBizSn, setSbmrgPrevntBizSn] = useState(""); //파일 일련번호
const [tableData, setTableData] = useState<FloodPreRow[]>([]); //테이블 데이터
const [curPage, setCurPage] = useState(1); //현재 페이지
const [totalData, setTotalData] = useState(0); //총 데이터 수
const [isLoading, setIsLoading] = useState(true); //로딩 상태
const columns = useMemo<ColumnDef<FloodPreRow>[]>(
() =>
FLOOD_PRE_COLUMNS.map((column) => ({
id: String(column.id),
accessorFn: (row) => row[column.id],
header: column.title,
cell: ({ getValue }) => String(getValue() ?? ""),
meta: { width: column.width, align: "center" },
})),
[],
);
const pagination: PaginationState = {
pageIndex: curPage - 1,
pageSize: PAGE_SIZE,
};
const table = useReactTable({
data: tableData,
columns,
state: { pagination },
rowCount: totalData,
manualPagination: true,
getCoreRowModel: getCoreRowModel(),
getRowId: (row) => String(row.sbmrgPrevntBizSn),
onPaginationChange: (updater) => {
const next =
typeof updater === "function" ? updater(pagination) : updater;
setCurPage(next.pageIndex + 1);
},
});
useEffect(() => {
const handleMessage = (event: MessageEvent) => {
if (event.origin !== window.location.origin) return;
if (
event.data?.type !==
WINDOW_POPUP_MESSAGE_TYPE.FLOOD_PRE_UPLOAD_COMPLETED
)
return;
handleSearch();
};
window.addEventListener("message", handleMessage);
return () => window.removeEventListener("message", handleMessage);
}, [fromDate, toDate, pjNm, curPage]);
// 페이지 변경 시마다 데이터 fetch
useEffect(() => {
fetchData();
}, [curPage]);
// 조회 버튼 클릭 시 1페이지로 이동 및 데이터 초기화
const handleSearch: () => Promise<void> = async () => {
if (curPage === 1) {
await fetchData(1);
return;
}
setCurPage(1); // 페이지 변경 effect에서 한 번만 조회
};
// 검색조건을 초기값으로 되돌리고 첫 페이지부터 다시 조회한다.
const handleReset = async () => {
const nextFromDate = new Date();
nextFromDate.setDate(nextFromDate.getDate() - 7);
const nextToDate = new Date();
setFromDate(nextFromDate);
setToDate(nextToDate);
setUsr("");
setpjNm("");
if (curPage !== 1) {
setCurPage(1);
return;
}
await fetchData(1, {
fromDate: nextFromDate,
toDate: nextToDate,
projectName: "",
});
};
// 조회
const fetchData = async (
page = curPage,
condition: FloodPreSearch = {
fromDate,
toDate,
projectName: pjNm,
},
) => {
setIsLoading(true);
// searchCmmnCd('SITEKNDCD')
try {
const { data, total } = await searchData("v1/sbmrgPrevnt", {
fromRegDt: formatDate(condition.fromDate),
toRegDt: formatDate(condition.toDate),
sbmrgPrevntBizNm: condition.projectName,
auth: AUTH,
page: page - 1,
size: String(PAGE_SIZE),
sort: "sbmrgPrevntBizSn,desc",
});
// 일련번호를 추가한 데이터로 변환 (전체 데이터 기준으로 일련번호 계산)
const dataWithRowNumber = (data || []).map(
(item: any, index: number) => ({
...item,
rowNumber: getSnRowNumber({
total,
rowIndex: index,
pageIndex: page - 1,
pageSize: PAGE_SIZE,
}),
}),
);
setTableData(dataWithRowNumber);
setTotalData(total);
} catch (error) {
console.error("Error fetching data:", error);
} finally {
setFileNm("");
setAtflId("");
setSbmrgPrevntBizSn("");
setIsLoading(false);
}
};
// 파일 다운로드
const isChckFile = () => {
if (fileNm === "" || fileNm === undefined) {
alert("파일을 선택해주세요");
return false;
}
handleDownload(`/attach-service/api/v1/download/${atflId}`, fileNm);
};
// 선택 파일 삭제
// 첨부·업무 삭제 중 어느 하나라도 실패하면 성공 안내와 목록 갱신을 실행하지 않는다.
const isDeleteFile = async () => {
if (sbmrgPrevntBizSn === "" || sbmrgPrevntBizSn === undefined) {
alert("삭제할 파일을 선택해주세요");
return false;
}
if (!(await confirm("삭제하시겠습니까?"))) return false;
try {
await deleteData(`/attach-service/api/v1/atfl/attachments/${atflId}`);
await deleteData(`v1/sbmrgPrevnt/${sbmrgPrevntBizSn}`);
alert("삭제되었습니다.", () => void fetchData());
} catch {
alert("삭제에 실패했습니다.");
}
};
// 등록 버튼 클릭 핸들러
const handleRegisterClick = () => {
const popupWindow = openWindowPopup("floodPreUpload");
if (!popupWindow) {
alert("팝업이 차단되었습니다. 브라우저 팝업 허용 설정을 확인해주세요.");
}
};
const handleTablePopupOpen = (fileName: string, id: string) => {
const popupWindow = openWindowPopup("floodPreTable", {
fileNm: fileName,
atflId: id,
sourcePath: window.location.pathname,
});
if (!popupWindow) {
alert("팝업이 차단되었습니다. 브라우저 팝업 허용 설정을 확인해주세요.");
}
};
return (
<>
<LoadingOverlay isLoading={isLoading ?? false} />
<div className="card card-border !mt-6">
<form
className="flex flex-wrap items-center gap-2 p-2"
onSubmit={(event) => {
event.preventDefault();
void handleSearch();
}}
>
<div className="flex items-center gap-2">
<Label className="mr-2 whitespace-nowrap text-label">
등록기간
</Label>
<SearchDatePicker
selected={fromDate}
onSelect={(date: Date | undefined) => {
if (date) setFromDate(date);
}}
disabled={{ after: new Date() }}
/>
<span>~</span>
<SearchDatePicker
selected={toDate}
onSelect={(date: Date | undefined) => {
if (date) setToDate(date);
}}
disabled={{ after: new Date() }}
/>
</div>
<div className="flex items-center gap-2">
<Label className="mr-2 whitespace-nowrap text-label">등록자</Label>
<Input
className="w-[12rem] !text-[1.3rem]"
value={usr}
onChange={(event) => setUsr(event.target.value)}
/>
</div>
<div className="flex items-center gap-2">
<Label className="mr-2 whitespace-nowrap text-label">파일명</Label>
<Input
className="w-[18rem] !text-[1.3rem]"
value={pjNm}
onChange={(event) => setpjNm(event.target.value)}
/>
</div>
<Button type="submit" className="w-[7.4rem]">
조회
</Button>
<Button
type="button"
color="white"
className="w-[8.8rem]"
onClick={() => void handleReset()}
>
초기화
</Button>
</form>
</div>
<div className="mt-4 w-full min-w-0 max-w-full overflow-hidden">
<StandardDataTable
table={table}
title="도시침수예방사업 목록"
onRowClick={(row) => {
const fileName = String(row.sbmrgPrevntBizNm ?? "");
const id = String(row.atflId ?? "");
setFileNm(fileName);
setAtflId(id);
setSbmrgPrevntBizSn(String(row.sbmrgPrevntBizSn ?? ""));
handleTablePopupOpen(fileName, id);
}}
actions={
<>
<Button type="button" onClick={isChckFile}>
엑셀다운로드
</Button>
<Button type="button" onClick={handleRegisterClick}>
등록
</Button>
<Button
type="button"
color="red"
disabled={isLoading || !sbmrgPrevntBizSn}
onClick={isDeleteFile}
>
삭제
</Button>
</>
}
/>
</div>
</>
);
};
export default Page;
@@ -1,292 +0,0 @@
/**
* 침수예방 엑셀 데이터 테이블 팝업
*
* 첨부 엑셀의 관리SHEET와 운영관리현황 점검결과를 읽어 공통 표준
* 테이블로 표시한다. 원본 엑셀의 열 순서와 값은 그대로 유지한다.
*/
"use client";
import { useEffect, useMemo, useState } from "react";
import {
getCoreRowModel,
getPaginationRowModel,
useReactTable,
type ColumnDef,
} from "@tanstack/react-table";
import * as XLSX from "xlsx";
import { getBlobData } from "@/shared/api/file-api";
import { useAlertStore } from "@/shared/lib";
import { StandardDataTable } from "@common/business_components";
import { UITab } from "@common/business_components/ui";
const TABS = [
{ val: "management", text: "관리SHEET" },
{ val: "inspection-results", text: "운영관리현황 점검결과" },
];
const PAGE_SIZE = 10;
type ExcelTableHeader = {
id: string;
title: string;
};
type ExcelTableRow = Record<string, unknown>;
interface TableModalProps {
fileNm: string;
atflId: string;
}
function normalizeHeaderTitle(value: unknown) {
const title = String(value).replace(/\r\n/g, "\n");
return /^no$/i.test(title.trim()) ? "순번" : title;
}
function createColumns(
headers: ExcelTableHeader[],
): ColumnDef<ExcelTableRow>[] {
return headers.map((header) => ({
id: header.id,
accessorFn: (row) => row[header.id],
header: header.title,
cell: ({ getValue }) => String(getValue() ?? "-"),
size: 140,
}));
}
function filterEmptyRows(data: ExcelTableRow[]) {
return data
.filter((row) =>
Object.entries(row).some(([key, value]) => {
const match = key.match(/^__EMPTY_(\d+)$/);
if (!match || parseInt(match[1] ?? "", 10) < 2) return false;
return (
value !== undefined &&
value !== null &&
value !== "" &&
value !== "-" &&
String(value).trim() !== ""
);
}),
)
.map((row) => {
const processedRow = { ...row };
const keys = Object.keys(processedRow);
keys.forEach((key, keyIndex) => {
if (keyIndex === keys.length - 1) return;
const value = processedRow[key];
if (
value === undefined ||
value === null ||
value === "" ||
String(value).trim() === ""
) {
processedRow[key] = "-";
}
});
return processedRow;
});
}
function filePickedSelectedSheets(
file: File,
headerNum: number = 0,
sheetNames: string[],
): Promise<Record<string, ExcelTableRow[]>> {
const reader = new FileReader();
return new Promise((resolve, reject) => {
reader.onload = (event) => {
const data = event.target?.result;
if (!data) {
reject(new Error("Failed to read file"));
return;
}
const workbook = XLSX.read(data, { type: "binary", cellDates: true });
const result: Record<string, ExcelTableRow[]> = {};
sheetNames.forEach((targetSheetName) => {
const sheetName = workbook.SheetNames.find(
(name) => name.toLowerCase() === targetSheetName.toLowerCase(),
);
const sheet = sheetName ? workbook.Sheets[sheetName] : undefined;
if (!sheet) {
console.warn(`Sheet "${targetSheetName}" not found in workbook`);
result[targetSheetName] = [];
return;
}
result[targetSheetName] = XLSX.utils.sheet_to_json<ExcelTableRow>(
sheet,
{
range: headerNum,
raw: false,
},
);
});
resolve(result);
};
reader.onerror = () => reject(new Error("Error reading file"));
reader.readAsBinaryString(file);
});
}
const TableModal: React.FC<TableModalProps> = ({ fileNm, atflId }) => {
const alert = useAlertStore((state) => state.setMessage);
const [activeTab, setActiveTab] = useState(TABS[0]?.val ?? "management");
const [managementHeaders, setManagementHeaders] = useState<
ExcelTableHeader[]
>([]);
const [managementData, setManagementData] = useState<ExcelTableRow[]>([]);
const [resultHeaders, setResultHeaders] = useState<ExcelTableHeader[]>([]);
const [resultData, setResultData] = useState<ExcelTableRow[]>([]);
const [isLoading, setIsLoading] = useState(false);
useEffect(() => {
const loadFile = async () => {
setIsLoading(true);
try {
if (!fileNm) {
alert("파일을 선택해주세요");
return;
}
if (!atflId) {
alert("첨부파일 ID가 없어 파일을 불러올 수 없습니다.");
return;
}
const blob = await getBlobData(
`/attach-service/api/v1/download/${atflId}`,
);
const file = new File([blob], fileNm, {
type:
blob.type ||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
});
const jsonDataBySheet = await filePickedSelectedSheets(file, 0, [
"관리SHEET",
"운영관리현황 점검결과",
]);
const managementHeaderRow = jsonDataBySheet["관리SHEET"]?.[7] ?? {};
setManagementHeaders(
Object.entries(managementHeaderRow)
.filter(([key]) => {
const match = key.match(/^__EMPTY_(\d+)$/);
if (!match) return false;
const index = parseInt(match[1] ?? "", 10);
return (index > 0 && index < 47) || index > 73;
})
.map(([key, value]) => ({
id: key,
title: normalizeHeaderTitle(value),
})),
);
setManagementData(
filterEmptyRows((jsonDataBySheet["관리SHEET"] ?? []).slice(8)),
);
const resultHeaderRow =
jsonDataBySheet["운영관리현황 점검결과"]?.[2] ?? {};
const nextResultHeaders = Object.entries(resultHeaderRow).map(
([key, value]) => ({
id: key,
title: normalizeHeaderTitle(value),
}),
);
nextResultHeaders.splice(1, 0, { id: "__EMPTY_2", title: "" });
setResultHeaders(nextResultHeaders);
setResultData(
filterEmptyRows(
(jsonDataBySheet["운영관리현황 점검결과"] ?? []).slice(3),
),
);
} catch (error) {
console.error("FloodPre attachment fetch details:", {
atflId,
fileNm,
error,
});
alert("파일 처리 중 오류가 발생했습니다.");
} finally {
setIsLoading(false);
}
};
void loadFile();
}, [alert, atflId, fileNm]);
const managementColumns = useMemo(
() => createColumns(managementHeaders),
[managementHeaders],
);
const resultColumns = useMemo(
() => createColumns(resultHeaders),
[resultHeaders],
);
const managementTable = useReactTable({
data: managementData,
columns: managementColumns,
getCoreRowModel: getCoreRowModel(),
getPaginationRowModel: getPaginationRowModel(),
initialState: { pagination: { pageIndex: 0, pageSize: PAGE_SIZE } },
});
const resultTable = useReactTable({
data: resultData,
columns: resultColumns,
getCoreRowModel: getCoreRowModel(),
getPaginationRowModel: getPaginationRowModel(),
initialState: { pagination: { pageIndex: 0, pageSize: PAGE_SIZE } },
});
const isManagementTab = activeTab === "management";
const activeHeaderCount = isManagementTab
? managementHeaders.length
: resultHeaders.length;
return (
<div className="flex min-h-0 flex-1 flex-col gap-4">
<UITab
defaultValue={activeTab}
tabList={TABS.map((tab) => ({
value: tab.val,
label: tab.text,
}))}
onValueChange={setActiveTab}
/>
{isManagementTab ? (
<StandardDataTable
table={managementTable}
title="관리SHEET 목록"
loading={isLoading}
scrollMode="horizontal"
minTableWidth={`${Math.max(activeHeaderCount * 9, 80)}rem`}
/>
) : (
<StandardDataTable
table={resultTable}
title="운영관리현황 점검결과 목록"
loading={isLoading}
scrollMode="horizontal"
minTableWidth={`${Math.max(activeHeaderCount * 9, 80)}rem`}
/>
)}
</div>
);
};
export default TableModal;
File diff suppressed because it is too large Load Diff
@@ -1,331 +0,0 @@
/**
* 유지관리 정보 - 노후 하수관로 정비사업 파일 목록
*
* 목록 조회, 첨부파일 다운로드·삭제, 업로드·상세 팝업 연결을 제공한다.
*/
"use client";
import { getSnRowNumber } from "@/shared/lib/row-number";
import { useEffect, useMemo, useState } from "react";
import {
getCoreRowModel,
useReactTable,
type ColumnDef,
type PaginationState,
} from "@tanstack/react-table";
import { useConfirm } from "@frontend-opensource/use-react-hooks";
import { deleteData } from "@/shared/api/sewerage-api";
import { useCookieAuth } from "@/entities/auth/lib/use-cookie-auth";
import { searchData } from "@/shared/api/search-page";
import { formatDate, handleDownload } from "@/components/lib/utils";
import LoadingOverlay from "@/components/ui/loading-bar";
import { openWindowPopup } from "@/features/window-popup/lib/open-window-popup";
import { WINDOW_POPUP_MESSAGE_TYPE } from "@/features/window-popup/model/types";
import { useAlertStore } from "@/shared/lib";
import {
StandardDataTable,
} from "@common/business_components";
import { Button, Input, Label } from "@common/components";
import { SearchDatePicker } from "../components/search-date-picker";
const PAGE_SIZE = 10;
type OldPpRow = Record<string, unknown> & {
rowNumber: number;
dcrpPplMtncBizSn: string;
dcrpPplMtncBizNm?: string;
atflId?: string;
};
type OldPpSearch = {
fromDate: Date;
toDate: Date;
projectName: string;
};
const COLUMNS: Array<{
id: keyof OldPpRow;
title: string;
width: number;
}> = [
{ id: "rowNumber", title: "순번", width: 70 },
{ id: "dcrpPplMtncBizNm", title: "파일명", width: 260 },
{ id: "mngYr", title: "년도", width: 90 },
{ id: "mngQu", title: "분기", width: 90 },
{ id: "regDt", title: "등록 일자", width: 120 },
{ id: "rgtrNm", title: "등록자", width: 120 },
];
const Page = () => {
const auth = useCookieAuth();
const { confirm } = useConfirm();
const alert = useAlertStore((state) => state.setMessage);
const [fromDate, setFromDate] = useState(() => {
const date = new Date();
date.setDate(date.getDate() - 7);
return date;
});
const [toDate, setToDate] = useState(new Date());
const [registrant, setRegistrant] = useState("");
const [projectName, setProjectName] = useState("");
const [fileName, setFileName] = useState("");
const [attachmentId, setAttachmentId] = useState("");
const [businessId, setBusinessId] = useState("");
const [rows, setRows] = useState<OldPpRow[]>([]);
const [page, setPage] = useState(1);
const [total, setTotal] = useState(0);
const [loading, setLoading] = useState(true);
const columns = useMemo<ColumnDef<OldPpRow>[]>(
() =>
COLUMNS.map((column) => ({
id: String(column.id),
accessorFn: (row) => row[column.id],
header: column.title,
cell: ({ getValue }) => String(getValue() ?? ""),
meta: { width: column.width, align: "center" },
})),
[],
);
const pagination: PaginationState = {
pageIndex: page - 1,
pageSize: PAGE_SIZE,
};
const table = useReactTable({
data: rows,
columns,
state: { pagination },
rowCount: total,
manualPagination: true,
getCoreRowModel: getCoreRowModel(),
getRowId: (row) => String(row.dcrpPplMtncBizSn),
onPaginationChange: (updater) => {
const next =
typeof updater === "function" ? updater(pagination) : updater;
setPage(next.pageIndex + 1);
},
});
const fetchData = async (
targetPage = page,
condition: OldPpSearch = { fromDate, toDate, projectName },
) => {
setLoading(true);
try {
const result = await searchData("v1/dcrpPpl", {
fromRegDt: formatDate(condition.fromDate),
toRegDt: formatDate(condition.toDate),
dcrpPplMtncBizNm: condition.projectName,
auth,
page: targetPage - 1,
size: String(PAGE_SIZE),
sort: "dcrpPplMtncBizSn,desc",
});
setRows(
(result.data ?? []).map((item: OldPpRow, rowIndex: number) => ({
...item,
rowNumber: getSnRowNumber({
total: result.total,
rowIndex,
pageIndex: targetPage - 1,
pageSize: PAGE_SIZE,
}),
})),
);
setTotal(result.total);
} catch (error) {
console.error("노후 하수관로 정비사업 목록 조회 실패:", error);
} finally {
setFileName("");
setAttachmentId("");
setBusinessId("");
setLoading(false);
}
};
useEffect(() => {
void fetchData();
}, [page]);
useEffect(() => {
const handleMessage = (event: MessageEvent) => {
if (event.origin !== window.location.origin) return;
if (
event.data?.type !== WINDOW_POPUP_MESSAGE_TYPE.OLD_PP_UPLOAD_COMPLETED
)
return;
if (page === 1) void fetchData(1);
else setPage(1);
};
window.addEventListener("message", handleMessage);
return () => window.removeEventListener("message", handleMessage);
}, [fromDate, page, projectName, toDate]);
const handleSearch = async () => {
if (page === 1) {
await fetchData(1);
return;
}
setPage(1);
};
const handleReset = async () => {
const nextFromDate = new Date();
nextFromDate.setDate(nextFromDate.getDate() - 7);
const nextToDate = new Date();
setFromDate(nextFromDate);
setToDate(nextToDate);
setRegistrant("");
setProjectName("");
if (page !== 1) {
setPage(1);
return;
}
await fetchData(1, {
fromDate: nextFromDate,
toDate: nextToDate,
projectName: "",
});
};
const handleFileDownload = () => {
if (!fileName) {
alert("파일을 선택해주세요");
return;
}
handleDownload(`/attach-service/api/v1/download/${attachmentId}`, fileName);
};
// HTTP 실패는 catch에서 안내하고 첨부·업무 삭제가 모두 성공한 뒤 목록을 갱신한다.
const handleDelete = async () => {
if (!businessId) {
alert("삭제할 파일을 선택해주세요");
return;
}
if (!(await confirm("삭제하시겠습니까?"))) return;
try {
await deleteData(`/attach-service/api/v1/atfl/attachments/${attachmentId}`);
await deleteData(`v1/dcrpPpl/${businessId}`);
alert("삭제되었습니다.", () => void fetchData());
} catch {
alert("삭제에 실패했습니다.");
}
};
const handleRegister = () => {
if (!openWindowPopup("oldPpUpload")) {
alert("팝업이 차단되었습니다. 브라우저 팝업 허용 설정을 확인해주세요.");
}
};
const handleOpenDetail = (row: OldPpRow) => {
const nextFileName = String(row.dcrpPplMtncBizNm ?? "");
const nextAttachmentId = String(row.atflId ?? "");
setFileName(nextFileName);
setAttachmentId(nextAttachmentId);
setBusinessId(String(row.dcrpPplMtncBizSn ?? ""));
if (
!openWindowPopup("oldPpTable", {
fileNm: nextFileName,
atflId: nextAttachmentId,
sourcePath: window.location.pathname,
})
) {
alert("팝업이 차단되었습니다. 브라우저 팝업 허용 설정을 확인해주세요.");
}
};
return (
<>
<LoadingOverlay isLoading={loading} />
<div className="card card-border !mt-6">
<form
className="flex flex-wrap items-center gap-2 p-2"
onSubmit={(event) => {
event.preventDefault();
void handleSearch();
}}
>
<div className="flex items-center gap-2">
<Label className="mr-2 whitespace-nowrap text-label">
등록기간
</Label>
<SearchDatePicker
selected={fromDate}
onSelect={(date) => date && setFromDate(date)}
disabled={{ after: new Date() }}
/>
<span>~</span>
<SearchDatePicker
selected={toDate}
onSelect={(date) => date && setToDate(date)}
disabled={{ after: new Date() }}
/>
</div>
<div className="flex items-center gap-2">
<Label className="mr-2 whitespace-nowrap text-label">등록자</Label>
<Input
className="w-[12rem] !text-[1.3rem]"
value={registrant}
onChange={(event) => setRegistrant(event.target.value)}
/>
</div>
<div className="flex items-center gap-2">
<Label className="mr-2 whitespace-nowrap text-label">파일명</Label>
<Input
className="w-[18rem] !text-[1.3rem]"
value={projectName}
onChange={(event) => setProjectName(event.target.value)}
/>
</div>
<Button type="submit" className="w-[7.4rem]">
조회
</Button>
<Button
type="button"
color="white"
className="w-[8.8rem]"
onClick={() => void handleReset()}
>
초기화
</Button>
</form>
</div>
<div className="mt-4 w-full min-w-0 max-w-full overflow-hidden">
<StandardDataTable
table={table}
title="노후 하수관로 정비사업 목록"
onRowClick={handleOpenDetail}
actions={
<>
<Button type="button" onClick={handleFileDownload}>
엑셀다운로드
</Button>
<Button type="button" onClick={handleRegister}>
등록
</Button>
<Button
type="button"
color="red"
disabled={loading || !businessId}
onClick={handleDelete}
>
삭제
</Button>
</>
}
/>
</div>
</>
);
};
export default Page;
@@ -1,365 +0,0 @@
/** 노후 하수관로 정비사업 첨부 엑셀 상세 팝업 테이블 */
"use client";
import { useEffect, useMemo, useState } from "react";
import {
getCoreRowModel,
getPaginationRowModel,
useReactTable,
type ColumnDef,
} from "@tanstack/react-table";
import * as XLSX from "xlsx";
import { getBlobData } from "@/shared/api/file-api";
import { useAlertStore } from "@/shared/lib";
import { StandardDataTable } from "@common/business_components";
import { UITab } from "@common/business_components/ui";
import { oldPpTable2HeadList, oldPpTable6HeadList } from "./head-list";
const TABS = [
{ val: "1", text: "raw data" },
{ val: "2", text: "1.정밀조사" },
{ val: "3", text: "2.정밀조사_정비사업연계" },
{ val: "4", text: "3.정비사업" },
{ val: "5", text: "4.정비사업요약" },
{ val: "6", text: "4.정비사업최종" },
];
const PAGE_SIZE = 10;
type ExcelHeader = {
id: string;
title: string;
};
type ExcelRow = Record<string, unknown>;
interface TableModalProps {
fileNm: string;
atflId: string;
}
function normalizeHeaderTitle(value: unknown) {
const title = String(value).replace(/\r\n/g, "\n");
return /^(no|일련번호)$/i.test(title.trim()) ? "순번" : title;
}
function createColumns(headers: ExcelHeader[]): ColumnDef<ExcelRow>[] {
return headers.map((header) => ({
id: header.id,
accessorFn: (row) => row[header.id],
header: () => <span className="whitespace-pre-line">{header.title}</span>,
cell: ({ getValue }) => String(getValue() ?? "-"),
size: 140,
meta: { align: "center" },
}));
}
function useExcelTable(data: ExcelRow[], headers: ExcelHeader[]) {
const columns = useMemo(() => createColumns(headers), [headers]);
return useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
getPaginationRowModel: getPaginationRowModel(),
initialState: { pagination: { pageIndex: 0, pageSize: PAGE_SIZE } },
});
}
function filterEmptyRows(data: ExcelRow[]) {
return data
.filter((row) =>
Object.entries(row).some(([key, value]) => {
const match = key.match(/^__EMPTY_(\d+)$/);
if (!match || parseInt(match[1] ?? "", 10) < 2) return false;
return (
value !== undefined &&
value !== null &&
String(value).trim() !== "" &&
String(value).trim() !== "-"
);
}),
)
.map((row) => {
const processedRow = { ...row };
const keys = Object.keys(processedRow);
keys.forEach((key, keyIndex) => {
if (keyIndex === keys.length - 1) return;
const value = processedRow[key];
if (
value === undefined ||
value === null ||
value === "" ||
String(value).trim() === ""
) {
processedRow[key] = "-";
}
});
return processedRow;
});
}
function withDescendingRowNumber(rows: ExcelRow[]) {
return rows.map((row, index) => ({
...row,
rowNumber: index + 1,
}));
}
function filePickedSelectedSheets(
file: File,
headerNum: number = 0,
sheetNames: string[],
): Promise<Record<string, ExcelRow[]>> {
const reader = new FileReader();
return new Promise((resolve, reject) => {
reader.onload = (event) => {
const data = event.target?.result;
if (!data) {
reject(new Error("Failed to read file"));
return;
}
const workbook = XLSX.read(data, { type: "binary", cellDates: true });
const result: Record<string, ExcelRow[]> = {};
sheetNames.forEach((targetSheetName) => {
const sheetName = workbook.SheetNames.find(
(name) => name.toLowerCase() === targetSheetName.toLowerCase(),
);
const sheet = sheetName ? workbook.Sheets[sheetName] : undefined;
if (!sheet) {
console.warn(`Sheet "${targetSheetName}" not found in workbook`);
result[targetSheetName] = [];
return;
}
result[targetSheetName] = XLSX.utils.sheet_to_json<ExcelRow>(sheet, {
range: headerNum,
raw: false,
});
});
resolve(result);
};
reader.onerror = () => reject(new Error("Error reading file"));
reader.readAsBinaryString(file);
});
}
const TableModal: React.FC<TableModalProps> = ({ fileNm, atflId }) => {
const alert = useAlertStore((state) => state.setMessage);
const [activeTab, setActiveTab] = useState(TABS[0]?.val ?? "1");
const [headers1, setHeaders1] = useState<ExcelHeader[]>([]);
const [headers2, setHeaders2] = useState<ExcelHeader[]>([]);
const [headers4, setHeaders4] = useState<ExcelHeader[]>([]);
const [headers5, setHeaders5] = useState<ExcelHeader[]>([]);
const [data1, setData1] = useState<ExcelRow[]>([]);
const [data2, setData2] = useState<ExcelRow[]>([]);
const [data3, setData3] = useState<ExcelRow[]>([]);
const [data4, setData4] = useState<ExcelRow[]>([]);
const [data5, setData5] = useState<ExcelRow[]>([]);
const [data6, setData6] = useState<ExcelRow[]>([]);
const [loading, setLoading] = useState(false);
const headers3 = useMemo<ExcelHeader[]>(
() =>
oldPpTable2HeadList.map((header) => ({
id: header.id,
title: normalizeHeaderTitle(header.title),
})),
[],
);
const headers6 = useMemo<ExcelHeader[]>(
() =>
oldPpTable6HeadList.map((header) => ({
id: header.id,
title: normalizeHeaderTitle(header.title),
})),
[],
);
const table1 = useExcelTable(data1, headers1);
const table2 = useExcelTable(data2, headers2);
const table3 = useExcelTable(data3, headers3);
const table4 = useExcelTable(data4, headers4);
const table5 = useExcelTable(data5, headers5);
const table6 = useExcelTable(data6, headers6);
useEffect(() => {
const loadFile = async () => {
setLoading(true);
try {
if (!fileNm) {
alert("파일을 선택해주세요");
return;
}
if (!atflId) {
alert("첨부파일 ID가 없어 파일을 불러올 수 없습니다.");
return;
}
const blob = await getBlobData(
`/attach-service/api/v1/download/${atflId}`,
);
const file = new File([blob], fileNm, {
type:
blob.type ||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
});
const jsonDataBySheet = await filePickedSelectedSheets(file, 0, [
"raw data",
"1.정밀조사",
"2.정밀조사_정비사업연계",
" 3.정비사업",
"4.정비사업요약",
"4.정비사업최종",
]);
const header1Entries = Object.entries(
jsonDataBySheet["raw data"]?.[1] ?? {},
);
const header2Entries = Object.entries(
jsonDataBySheet["1.정밀조사"]?.[1] ?? {},
);
const selectedIndexes = [
0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
];
const selectHeaders = (entries: [string, unknown][]) => [
{ id: "rowNumber", title: "순번" },
...selectedIndexes
.map((index) => entries[index])
.filter((entry): entry is [string, unknown] => Boolean(entry))
.map(([id, title]) => ({
id,
title: normalizeHeaderTitle(title),
})),
];
setHeaders1(selectHeaders(header1Entries));
setHeaders2(selectHeaders(header2Entries));
const nextData1 = filterEmptyRows(
(jsonDataBySheet["raw data"] ?? []).slice(2),
).map((item) => ({
...item,
__EMPTY_1: item.__EMPTY_1 || "-",
}));
setData1(withDescendingRowNumber(nextData1));
setData2(
withDescendingRowNumber(
filterEmptyRows((jsonDataBySheet["1.정밀조사"] ?? []).slice(2)),
),
);
const sourceDescriptionKey =
"*1차 출처: 공단자료\r\n*2차 출처: 정산서, 정밀조사보고서 등.\r\n (파랑) 2024년말 기준 실적 제출 자료. 준공 후 재확인 필요\r\n (노랑셀) 준공(또는 정산) 후에 재확인 필요";
const nextData3 = filterEmptyRows(
(jsonDataBySheet["2.정밀조사_정비사업연계"] ?? []).slice(5),
).map((item) => {
const next = { ...item };
if (next[sourceDescriptionKey] !== undefined) {
next.__EMPTY_0 = next[sourceDescriptionKey];
delete next[sourceDescriptionKey];
}
return { ...next, __EMPTY_4: next.__EMPTY_4 || "-" };
});
setData3(withDescendingRowNumber(nextData3));
const header4Entries = Object.entries(
jsonDataBySheet[" 3.정비사업"]?.[1] ?? {},
);
setHeaders4([
{ id: "rowNumber", title: "순번" },
...header4Entries.map(([id, title]) => ({
id,
title: normalizeHeaderTitle(title),
})),
]);
const nextData4 = filterEmptyRows(
(jsonDataBySheet[" 3.정비사업"] ?? []).slice(2),
).map((item) => ({
...item,
__EMPTY_2: item.__EMPTY_2 || "-",
__EMPTY_11: item.__EMPTY_11 || "-",
}));
setData4(withDescendingRowNumber(nextData4));
const excludedSummaryKeys = [
': "정비사업"sheet에서 사업코드 ctrl+c, Ctrl+v 한 다음 중복된 데이터 제거실시',
"__EMPTY",
"__EMPTY_8",
"__EMPTY_15",
];
const header5Entries = Object.entries(
jsonDataBySheet["4.정비사업요약"]?.[2] ?? {},
).filter(([key]) => !excludedSummaryKeys.includes(key));
setHeaders5([
{ id: "rowNumber", title: "순번" },
...header5Entries.map(([id, title]) => ({
id,
title: normalizeHeaderTitle(title),
})),
]);
setData5(
withDescendingRowNumber(
filterEmptyRows((jsonDataBySheet["4.정비사업요약"] ?? []).slice(3)),
),
);
setData6(
withDescendingRowNumber(
filterEmptyRows((jsonDataBySheet["4.정비사업최종"] ?? []).slice(6)),
),
);
} catch (error) {
console.error("OldPp attachment fetch details:", {
atflId,
fileNm,
error,
});
alert("파일 처리 중 오류가 발생했습니다.");
} finally {
setLoading(false);
}
};
void loadFile();
}, [alert, atflId, fileNm]);
const activeConfig =
activeTab === "1"
? { table: table1, headers: headers1 }
: activeTab === "2"
? { table: table2, headers: headers2 }
: activeTab === "3"
? { table: table3, headers: headers3 }
: activeTab === "4"
? { table: table4, headers: headers4 }
: activeTab === "5"
? { table: table5, headers: headers5 }
: { table: table6, headers: headers6 };
const activeTitle =
TABS.find((tab) => tab.val === activeTab)?.text ?? "첨부 데이터";
return (
<div className="flex min-h-0 flex-1 flex-col gap-4">
<UITab
defaultValue={activeTab}
tabList={TABS.map((tab) => ({ value: tab.val, label: tab.text }))}
onValueChange={setActiveTab}
/>
<StandardDataTable
table={activeConfig.table}
title={`${activeTitle} 목록`}
loading={loading}
scrollMode="horizontal"
minTableWidth={`${Math.max(activeConfig.headers.length * 9, 80)}rem`}
/>
</div>
);
};
export default TableModal;
+5 -9
View File
@@ -122,12 +122,8 @@ export async function PUT(
} }
function getCookieDomain(): string | undefined { function getCookieDomain(): string | undefined {
if (typeof window === "undefined") return undefined; // 개발에서는 현재 사이트 전용, 운영에서는 환경변수의 공용 도메인을 사용한다.
return process.env.NODE_ENV === "production"
if (COOKIE_DOMAIN) return COOKIE_DOMAIN; ? COOKIE_DOMAIN || undefined
: undefined;
const { hostname } = window.location; }
if (hostname === "localhost" || hostname === "127.0.0.1") return undefined;
return hostname;
}
@@ -1,102 +0,0 @@
/**
* 📄 Oper File Upload Form Component
* 운영 파일 업로드 폼 컴포넌트
*
* - 년도 및 분기 선택 기능
* - 파일 업로드 및 등록 처리
* - 년도 변경 시 분기 옵션 동적 업데이트
* - 파일 형식 검증 및 미리보기 지원
* - 콜백 함수를 통한 업로드 결과 전달
* - TUS 프로토콜을 통한 대용량 파일 업로드
*/
"use client";
import { SelectBox } from "@common/business_components/ui";
import React, { useState, useEffect } from "react";
import FileUploadForm from "./file-upload-form";
import { yearOptions, getQuarterOptions } from "@/components/lib/utils";
const operFileUploadForm = ({
title,
onSubmit,
}: {
title: string;
onSubmit: (
files: string,
year: string,
quarter: string,
code: string,
id: string,
) => void;
}) => {
const [selectedYear, setSelectedYear] = useState<string>(
yearOptions[0]?.val || "",
);
const [quaterOptions, setQuaterOptions] = useState(() =>
getQuarterOptions(selectedYear),
);
const [selectedQuarter, setSelectedQuarter] = useState<string>(
quaterOptions[0]?.val || "",
);
// 년도가 변경될 때 분기 옵션 업데이트
useEffect(() => {
const updatedQuarterOptions = getQuarterOptions(selectedYear);
setQuaterOptions(updatedQuarterOptions);
// 분기 옵션이 변경되면 첫 번째 옵션으로 자동 선택
setSelectedQuarter(updatedQuarterOptions[0]?.val || "");
}, [selectedYear]);
// 년도 변경 핸들러
const handleYearChange = (value: string | number) => {
const yearValue = String(value);
setSelectedYear(yearValue);
};
return (
<div>
<div className="card-header">
<h3 className="text-2xl font-medium">{title}</h3>
</div>
<div className="card p-6">
<div className="grid-col-2 grid items-center space-x-4">
<div className="flex">
<SelectBox
className="w-50 ml-4 mr-3"
selectClass="rounded-lg bg-background"
label="년도"
selectArray={yearOptions}
onSelectValue={handleYearChange}
value={selectedYear}
/>
<SelectBox
className="w-50"
selectClass="rounded-lg bg-background"
label="분기"
selectArray={quaterOptions}
onSelectValue={(value: string | number) =>
setSelectedQuarter(String(value))
}
value={selectedQuarter}
/>
<FileUploadForm
onSubmit={(files, year, quarter, code, id) => {
onSubmit(
files,
(selectedYear ?? year) || "",
(selectedQuarter ?? quarter) || "",
code,
id,
);
}}
showButton={true}
showPreview={true}
accept={""}
/>
</div>
</div>
</div>
</div>
);
};
export default operFileUploadForm;
+4 -36
View File
@@ -1,50 +1,18 @@
/** /**
* ➡️ 경로 : 루트 (/) * ➡️ 경로 : 루트 (/)
* *
* 📄 Home Page * 📄 Home Page
* 홈 페이지 컴포넌트 * 홈 페이지 컴포넌트
* *
* - 쿠키 기반 인증 토큰 검증 및 자동 로그인 처리 * - 루트 진입 시 지도 페이지(/map)로 리다이렉트
* - 로그인 성공 시 지도 페이지로 리다이렉트 * - 인증 토큰 검증 및 로그인 화면 이동은 /map 및 공통 인증 흐름에서 처리
* - 개발 환경에서는 루트 진입 시 자동 로그인 후 지도 페이지 이동
* - 로그인 실패 시 에러 로깅 및 처리
* - 사용자 세션 관리 및 초기 라우팅 제어 * - 사용자 세션 관리 및 초기 라우팅 제어
* - Next.js useRouter를 통한 클라이언트 사이드 라우팅
*
* 🔗 사용 API
* - 로그인: POST /api/v1/auth/login (user-service)
*/ */
"use client"; "use client";
import { authService } from "@/entities/auth";
import { useEffect } from "react"; import { useEffect } from "react";
const DEV_HOSTNAMES = new Set(["localhost", "127.0.0.1", "con.mind-one.co.kr"]);
const DEV_LOGIN_PAYLOAD = {
userId: process.env.NEXT_PUBLIC_DEV_LOGIN_USER_ID || "CLEANWATER",
password: process.env.NEXT_PUBLIC_DEV_LOGIN_PASSWORD || "gktneh12!@",
};
export default function Home() { export default function Home() {
useEffect(() => { useEffect(() => {
const hostname = window.location.hostname; window.location.replace("/map");
const isDevHost = DEV_HOSTNAMES.has(hostname);
if (!isDevHost) {
window.location.replace("/map");
return;
}
async function doLogin() {
try {
// 개발 환경에서는 남아 있는 만료/부분 쿠키로 인한 /map <-> / 루프를 막기 위해 항상 토큰을 재발급한다.
await authService.login(DEV_LOGIN_PAYLOAD);
window.location.replace("/map");
} catch (err) {
console.error("로그인 실패", err);
}
}
void doLogin();
}, []); }, []);
} }
@@ -20,8 +20,8 @@
이번 검토에서 실제 `apps/sn` 코드에서 확인한 대표 용어군은 아래와 같다. 이번 검토에서 실제 `apps/sn` 코드에서 확인한 대표 용어군은 아래와 같다.
- 사업/운영 화면 - 사업/운영 화면
- `oldPp`, `dcrpPpl`, `agedPipe` - `oldPp`, `dcrpPpl`(2026-11-20 구 화면 삭제·폐기, 대체 `obsltPplBiz`), `agedPipe`
- `floodPre`, `sbmrgPrevnt` - `floodPre`, `sbmrgPrevnt`(2026-11-20 구 화면 삭제·폐기, 대체 `ctyFldngPrvtnBiz`)
- `bizInfo` - `bizInfo`
- 지도/시설 화면 - 지도/시설 화면
- `swagePpl`, `swageMhl`, `swagePmstn`, `stofcbr` - `swagePpl`, `swageMhl`, `swagePmstn`, `stofcbr`
@@ -37,9 +37,9 @@
## 5. 프론트 기준 용어 매핑 ## 5. 프론트 기준 용어 매핑
| 업무 의미 | 기준 용어 | 현재 코드 별칭 | 화면 라벨 | 사용 기준 | 상태 | | 업무 의미 | 기준 용어 | 현재 코드 별칭 | 화면 라벨 | 사용 기준 | 상태 |
| --- | --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- | --- |
| 노후관로정비사업 | `dcrpPpl` | `oldPp` | 노후관로정비사업 | API/DTO/BE 계약은 `dcrpPpl`, 기존 route는 `oldPp` 유지 | 혼재 | | 노후관로정비사업(구) | `dcrpPpl` | `oldPp` | 노후관로정비사업 | 2026-11-20 구 화면 `/oper/oldPp` 삭제. 현행 화면 `/oper/obsltPplBiz`, API `obsltPplBiz`. 신규 코드에 사용하지 않음 | 폐기 |
| 노후관로 지도 시나리오 | `agedPipe` | `oldPpl`, `dcrpPpl` | 노후관로 | HTML 시안/전용 화면 이름은 `agedPipe` 사용 가능, API 연동 이름으로 직접 쓰지 않음 | 혼재 | | 노후관로 지도 시나리오 | `agedPipe` | `oldPpl`, `dcrpPpl` | 노후관로 | HTML 시안/전용 화면 이름은 `agedPipe` 사용 가능, API 연동 이름으로 직접 쓰지 않음 | 혼재 |
| 침수예방사업 | `sbmrgPrevnt` | `floodPre` | 침수예방사업 | API/DTO는 `sbmrgPrevnt`, 기존 route는 `floodPre` 유지 | 혼재 | | 침수예방사업(구) | `sbmrgPrevnt` | `floodPre` | 침수예방사업 | 2026-11-20 구 화면 `/oper/floodPre` 삭제. 현행 화면 `/oper/ctyFldngPrvtnBiz`, API `ctyFldngPrvtnBiz`. 신규 코드에 사용하지 않음 | 폐기 |
| 사업정보 | `bizInfo` | 없음 | 사업정보 | API/화면 모두 `bizInfo` 사용 | 기준 확정 | | 사업정보 | `bizInfo` | 없음 | 사업정보 | API/화면 모두 `bizInfo` 사용 | 기준 확정 |
| 관로 | `swagePpl` | `ppl` | 하수관로 | 화면/컴포넌트는 `swagePpl`, 백엔드 필드/약어는 `ppl` 허용 | 기준 후보 | | 관로 | `swagePpl` | `ppl` | 하수관로 | 화면/컴포넌트는 `swagePpl`, 백엔드 필드/약어는 `ppl` 허용 | 기준 후보 |
| 맨홀 | `swageMhl` | `mhl`, `smh` | 하수맨홀 | 검색/표 컬럼은 `swageMhl`, 축약 내부 변수만 `mhl` 허용 | 혼재 | | 맨홀 | `swageMhl` | `mhl`, `smh` | 하수맨홀 | 검색/표 컬럼은 `swageMhl`, 축약 내부 변수만 `mhl` 허용 | 혼재 |
@@ -57,8 +57,8 @@
신규 코드에서는 아래 이름을 우선 사용한다. 신규 코드에서는 아래 이름을 우선 사용한다.
### 6.1 사업/운영 ### 6.1 사업/운영
- `dcrpPpl` - `obsltPplBiz` (구 `dcrpPpl`는 2026-11-20 폐기)
- `sbmrgPrevnt` - `ctyFldngPrvtnBiz` (구 `sbmrgPrevnt`는 2026-11-20 폐기)
- `bizInfo` - `bizInfo`
### 6.2 지도/시설 ### 6.2 지도/시설
@@ -81,13 +81,14 @@
- `oldPp`를 API/DTO 이름으로 사용하는 것 - `oldPp`를 API/DTO 이름으로 사용하는 것
- `floodPre`를 API 계약 이름으로 사용하는 것 - `floodPre`를 API 계약 이름으로 사용하는 것
- 폐기된 `dcrpPpl`, `sbmrgPrevnt`, `oldPp`, `floodPre`를 신규 파일/함수/변수/API 이름으로 사용하는 것(2026-11-20 구 화면 삭제)
- `sewagePump`를 신규 화면/컴포넌트 기준 이름으로 사용하는 것 - `sewagePump`를 신규 화면/컴포넌트 기준 이름으로 사용하는 것
- `swagePrcsFclt`, `swagePrcsZone`를 신규 API/DTO 기준 이름으로 사용하는 것 - `swagePrcsFclt`, `swagePrcsZone`를 신규 API/DTO 기준 이름으로 사용하는 것
- `irsetting`을 신규 기능명으로 사용하는 것 - `irsetting`을 신규 기능명으로 사용하는 것
- `infilChart`를 침입수 분석 전체 기능명으로 사용하는 것 - `infilChart`를 침입수 분석 전체 기능명으로 사용하는 것
## 8. 확인 필요 항목 ## 8. 확인 필요 항목
- `oldPp` route를 장기적으로 `dcrpPpl` 또는 한글 route 명으로 정리할지 - (종료 2026-11-20) `oldPp` route 정리: 구 화면을 삭제하고 `/oper/obsltPplBiz`로 대체했다.
- `swagePmstn`와 `sewagePump` 중 화면 컴포넌트 기준 이름을 통일할지 - `swagePmstn`와 `sewagePump` 중 화면 컴포넌트 기준 이름을 통일할지
- `swtrmtFclt`와 `swagePrcsFclt`를 같은 개념으로 볼지 분리할지 - `swtrmtFclt`와 `swagePrcsFclt`를 같은 개념으로 볼지 분리할지
- `swtrmtZone`와 `swagePrcsZone`를 같은 개념으로 볼지 분리할지 - `swtrmtZone`와 `swagePrcsZone`를 같은 개념으로 볼지 분리할지
@@ -6,8 +6,7 @@
## 2. 이번 분석에서 확인한 기준 화면 ## 2. 이번 분석에서 확인한 기준 화면
- 업무형 조회/등록 화면 - 업무형 조회/등록 화면
- `apps/sn/app/(with-base-layout)/oper/oldPp/page.tsx` - (2026-11-20 삭제) 구 `apps/sn/app/(with-base-layout)/oper/oldPp/page.tsx`, `apps/sn/app/(with-base-layout)/oper/floodPre/page.tsx`. 같은 업무의 현행 화면은 `apps/sn/src/features/obslt-ppl/ui/obslt-ppl-list-page.tsx`, `apps/sn/src/features/cty-fldng-prvtn-biz/ui/cty-fldng-prvtn-biz-list-page.tsx`이며 `StandardDataTable`과 창 팝업을 사용한다.
- `apps/sn/app/(with-base-layout)/oper/floodPre/page.tsx`
- `apps/sn/app/(with-base-layout)/ii/rdii/page.tsx` - `apps/sn/app/(with-base-layout)/ii/rdii/page.tsx`
- 지도형 화면 - 지도형 화면
- `apps/sn/app/(map-layout)/map/page.tsx` - `apps/sn/app/(map-layout)/map/page.tsx`
@@ -68,7 +67,7 @@
## 7. 모달/상세 규칙 ## 7. 모달/상세 규칙
- 상세 보기, 등록, 엑셀 미리보기는 `UiModal` 패턴을 우선 사용한다. - 상세 보기, 등록, 엑셀 미리보기는 `UiModal` 패턴을 우선 사용한다.
- 지도형 화면 상세는 우측 고정 패널 또는 기존 지도 상세 팝업 위치를 우선 유지한다. - 지도형 화면 상세는 우측 고정 패널 또는 기존 지도 상세 팝업 위치를 우선 유지한다.
- 같은 기능에서 목록 선택 후 상세/모달이 열리는 흐름은 기존 `oldPp`, `floodPre`, `map` 패턴을 참고한다. - 같은 기능에서 목록 선택 후 상세/모달이 열리는 흐름은 기존 `map` 패턴을 참고한다. (참고하던 구 `oldPp`, `floodPre` 화면은 2026-11-20 삭제)
## 8. 상태관리/API 연동 규칙 ## 8. 상태관리/API 연동 규칙
- 화면 내부 로컬 상태로 충분한 것은 로컬 state를 우선 사용한다. - 화면 내부 로컬 상태로 충분한 것은 로컬 state를 우선 사용한다.
@@ -719,3 +719,19 @@
- 실브라우저: 테스트 사업→초이처리분구→지도3개 표시→실제188001 클릭→사업명 테스트/GIS 맨홀번호188001 확인→조사보고서 보기→1쪽 PDF와188001 표시 성공. 사용자도 최종 정상동작 확인했다. - 실브라우저: 테스트 사업→초이처리분구→지도3개 표시→실제188001 클릭→사업명 테스트/GIS 맨홀번호188001 확인→조사보고서 보기→1쪽 PDF와188001 표시 성공. 사용자도 최종 정상동작 확인했다.
- 실행 서버: 기존 재시작 승인 범위에서 코드 반영 후8883 PID27788로 유지한다(이전PID24204 종료). classpath/실행로그는 기존 .codex-tmp/manhole-backend-* 경로 유지. 종료명령 Stop-Process -Id 27788. - 실행 서버: 기존 재시작 승인 범위에서 코드 반영 후8883 PID27788로 유지한다(이전PID24204 종료). classpath/실행로그는 기존 .codex-tmp/manhole-backend-* 경로 유지. 종료명령 Stop-Process -Id 27788.
- 롤백: 위 FE3개 소스와 ExmnManholeReportService의 이번 변경을 함께 복원한다. DB 롤백 없음. 잔여 리스크는 GIS 미연결 자료 열람 불가 및 대형 사업의 지도 매칭·PDF 판독 비용이며, 임의 위치/다른 사업 fallback을 하지 않는다. - 롤백: 위 FE3개 소스와 ExmnManholeReportService의 이번 변경을 함께 복원한다. DB 롤백 없음. 잔여 리스크는 GIS 미연결 자료 열람 불가 및 대형 사업의 지도 매칭·PDF 판독 비용이며, 임의 위치/다른 사업 fallback을 하지 않는다.
## 2026-10-28 관로조사 남색 표시
- 정적 확인: 관로 선·범례·설정 표식은 `EXMN_RESULT_PPL_LEGEND_COLOR(#000080)`을 공유하고 관로 선 두께는 4를 유지한다. 맨홀·선택 이벤트·API·DB 변경 없음.
- `git -C frontend diff --check`: 통과.
- 3002 리스너 부재로 HMR·실브라우저 검증은 미수행. 실제 지도에서 관로조사 켜기, 등급 필터 변경 후 남색 유지, 선택 강조·맨홀 동시 표시 구분을 후속 확인한다.
### 2026-10-28 개발 서버 기동 후 확인
- 사용자 요청으로 `pnpm --filter sn dev` 실행, Next.js Ready 및 localhost:3002 접속 확인. 서버는 유지한다.
- Chrome에서 /map 진입 시 /auth/login으로 이동하고 로그인 화면이 표시됨. 로컬 로그인 세션이 없어 실제 지도 선·범례 가시성 검증은 로그인 후 계속해야 한다. 인증 우회·환경설정 변경 없음.
### 2026-10-28 백엔드 복구 및 실지도 검증 완료
- 원인: 프론트만 실행되어 localhost:8883 지도 API가 ECONNREFUSED로 실패했다. 기존 local 설정으로 Config Server와 sewerage-service를 기동했다. 코드·환경 파일·DB 변경 없음.
- 지도 레이어 API HTTP 200. 실제 레이어 목록·조사사업 조회 정상.
- 테스트 사업 → 관로조사 → 초이처리분구 → 지도보기: 3개 표시, 줌18.0에서 짙은 남색 관로가 일반지도 배경과 주황색 기존 관로에서 선명하게 구분됨. 이전 실지도 미검증 상태 해소. 위성지도·모든 등급·선택 강조 조합은 미검증.
- 사용자 계속 실행 지시에 따라 FE3002 PID28176, BE8883 PID31232, Config8888 PID27092 유지. 종료 시 해당 PID가 같은 프로세스인지 재확인 후 Stop-Process -Id 명령으로 종료한다.
@@ -0,0 +1,265 @@
# 001. fe SN 기존 침수예방사업·노후관로정비사업 구 화면 삭제 작업계획
## 1. 작업 개요
| 항목 | 내용 |
| --- | --- |
| 작업 ID | `SN-OPER-LEGACY-BIZ-REMOVE-FE` (제안) |
| 작업명 | 운영정보 구 노후관로정비사업(`/oper/oldPp`)·도시침수예방사업(`/oper/floodPre`) 화면 삭제 |
| 상태 | **승인(2026-11-20, "FE부터 진행") → 구현·자동 검증·로그인 브라우저 확인 완료, 최종 build 대기** — 13절의 권장안대로 진행했다. 결과: `002-fe-SN-기존침수예방사업-노후관로정비사업-구화면삭제-결과보고.md` |
| 작성일 | 2026-11-20 |
| 담당 역할 | FE |
| 관련 역할 | BE(구 API 삭제), QA |
| 담당 범위 | `FE_APP_ROOT` (`apps/sn/**`)만. `packages/**`와 다른 앱은 수정하지 않는다. |
| 근거 | 사용자 지시(2026-11-20): 구 테이블 두 개가 신규 테이블로 대체되어 쓰지 않으므로 관련 코드를 삭제한다. FE 구 화면 정리는 별도 fe 작업계획을 먼저 작성한다. |
| 짝 문서(BE) | `COMMON_DOCS_ROOT/작업계획/SN-기존 침수예방사업 노후관로정비사업 API 삭제/001-be-SN-기존침수예방사업-노후관로정비사업-API삭제-작업계획.md` |
**작업 범위 성격**: `FE_APP_ROOT/AGENTS.md`의 기본 작업 범위는 UI/UX·퍼블리싱이다. 이번 작업은 화면과 기능을 없애는 일이라 기본 금지 범위("사용자 요청 없이 기능 동작 변경")에 해당한다. 그래서 사용자 명시 승인을 받은 뒤에만 진행한다(13절).
## 1-1. 공통 동기화 확인
| 항목 | 결과 |
| --- | --- |
| 공통 작업현황판 `002-공통-작업현황판.md` | `oldPp`, `floodPre`를 다루는 미완료 작업이 없다. `windowPopup` 폴더를 범위에 넣은 작업 4건(`SN-SBMRG-DNGR-MAP-LIST`, `SFR-010-004~007-EXMN-NEW-FE-FIRST`, `SN-INFTWT-RESULT-MAP-BE-FE`, `SFR-012-003-FE-SNAP-SESSION-MAINT`)은 "검증" 상태다. 코드 수정은 끝나고 확인만 남은 상태라 이번 작업과 수정이 겹치지 않는다. |
| 파일점유현황 `003-공통-파일점유현황.md` | 228행 `SFR-011-008-FLOOD-PREDICTION-STATUS`(상태 **대기**)가 `FE_APP_ROOT/src/features/{fldngPredcPrst,windowPopup}/**`를 예약해 두었다. 메모는 "작업계획 확인 전 코드 미점유"다. 이 범위가 이번 수정 대상 공유 파일 3개(5.2절)와 겹친다. |
| 결정로그 `004-공통-결정로그.md` | 구 화면 폐기 결정은 아직 없다. 2050행에는 노후하수관로정비사업 신규 구현 때 "기존 `/oper/oldPp`는 변경하지 않는다"는 결정이 있다. 이번 삭제는 그 뒤의 새 사용자 지시다. |
| 진행 중 다른 작업과의 관계 | 침수예측(`fldng-predc-prst`) 작업이 같은 팝업 등록부(`registry.tsx`)에 `FldngPredcPrstPopupContent`를 등록해 두었다(126~128행). 이번 작업은 그 항목을 건드리지 않는다. |
| FE git 상태(2026-11-20) | 브랜치 `iipbs/sn/dev`, HEAD `5aeff4248`. `apps/sn/app`, `apps/sn/src`에 미커밋 변경이 없다. |
## 2. 작업 목적
- 백엔드에서 구 API `/api/v1/dcrpPpl`, `/api/v1/sbmrgPrevnt`를 삭제하려면 이 API를 부르는 FE 구 화면을 먼저(또는 같이) 없애야 한다. 그렇지 않으면 화면에서 404 오류가 난다.
- 대체 화면은 이미 있다.
| 구분 | 삭제할 구 화면 | 구 API | 대체 화면 | 대체 API |
| --- | --- | --- | --- | --- |
| 노후관로정비사업 | `/oper/oldPp` | `v1/dcrpPpl` | `/oper/obsltPplBiz` (`src/features/obslt-ppl`) | `v1/obsltPplBiz` |
| 도시침수예방사업 | `/oper/floodPre` | `v1/sbmrgPrevnt` | `/oper/ctyFldngPrvtnBiz` (`src/features/cty-fldng-prvtn-biz`) | `v1/ctyFldngPrvtnBiz` |
## 3. 원본 요구사항 확인 결과
| 구분 | 경로 | 크기 | 수정일시 |
| --- | --- | --- | --- |
| 화면설계서 | `COMMON_DOCS_ROOT/기준문서/화면설계서.pptx` | 10,736,400 bytes | 2026-08-13 20:35 |
| 요구사항정의서 | `COMMON_DOCS_ROOT/기준문서/요구사항정의서.xlsx` | 124,187 bytes | 2026-08-06 09:54 |
- **화면설계서**: 목차(슬라이드 3)의 하수관로 메뉴는 `하수관망도`, `유지관리`(조사관리·준설관리)뿐이다. `운영정보 > 노후 하수관로 정비사업`, `운영정보 > 도시침수예방사업` 화면은 없다. 화면 ID·입력항목·버튼·표 컬럼을 대조할 원본 슬라이드도 없다.
- 비슷한 주제의 화면: 슬라이드 8~9 `SN_MN010102` 하수관망도 > 노후관로관리(SFR-011-001), 슬라이드 19~32 `SN_MN010201`~`SN_MN010208` 통수위험분석·침수예측·침수발생이력. 모두 지도 화면이라 이번 구 화면과는 업무가 다르다.
- **요구사항정의서**: 시트 `3. (기능)요구사항정의 및 추적표`에서 `노후관로 정비`, `노후하수관로 정비`, `침수 예방`, `도시침수`, `정비사업`을 검색했다. 직접 맞는 요구사항 ID가 없다. 비슷한 주제로 SFR-011-001~004(노후관로 GIS 관리), SFR-011-007~009(침수 위험 분석)만 있다.
- **판단**: 삭제할 두 화면은 2차 원본에 근거가 없는 1차 구축 화면이다. 대체 화면도 원본 ID 없이 사용자 작업지시를 근거로 만든 보완 신규 화면이다. 이번 삭제의 근거는 사용자 지시(2026-11-20)다. 원본과 충돌하는 내용은 없다.
## 4. 현재 화면 흐름 (삭제로 없어지는 기능)
두 화면은 구조가 같다. 엑셀 파일을 첨부로 올리고, 그 첨부 목록을 관리한다.
| 항목 | `/oper/oldPp` | `/oper/floodPre` |
| --- | --- | --- |
| 목록 제목 | 노후 하수관로 정비사업 목록 | 도시침수예방사업 목록 |
| 검색 조건 | 등록기간(시작·종료), 등록자, 파일명 | 같음 |
| 목록 컬럼 | 순번, 파일명, 년도, 분기, 등록 일자, 등록자 | 같음 |
| 버튼 | 조회, 초기화, 엑셀다운로드, 등록, 삭제 | 같음 |
| 등록 | `oldPpUpload` 창 팝업 → 엑셀을 attach-service에 올린 뒤 `POST v1/dcrpPpl` | `floodPreUpload` 창 팝업 → `POST v1/sbmrgPrevnt` |
| 상세 | 행 선택 → `oldPpTable` 창 팝업에서 첨부 엑셀을 내려받아 표로 미리보기 | `floodPreTable` 창 팝업 |
| 삭제 | attach-service 첨부 삭제 → `DELETE v1/dcrpPpl/{id}` | attach-service 첨부 삭제 → `DELETE v1/sbmrgPrevnt/{id}` |
## 5. 수정 대상 파일
기준 경로: `FE_APP_ROOT` (`apps/sn`)
### 5.1 삭제 — 구 화면 전용 파일 (9개, 3,266줄)
| 구분 | 파일 | 줄 수 | 비고 |
| --- | --- | ---: | --- |
| 화면 | `app/(with-base-layout)/oper/oldPp/page.tsx` | 331 | 목록·검색·다운로드·삭제, `v1/dcrpPpl` GET·DELETE |
| 화면 | `app/(with-base-layout)/oper/oldPp/head-list.ts` | 1,721 | 상세 미리보기 표 헤더(`oldPpTable2`, `oldPpTable6`) |
| 화면 | `app/(with-base-layout)/oper/oldPp/table-modal.tsx` | 365 | 첨부 엑셀 미리보기 본문 |
| 화면 | `app/(with-base-layout)/oper/floodPre/page.tsx` | 359 | 목록·검색·다운로드·삭제, `v1/sbmrgPrevnt` GET·DELETE |
| 화면 | `app/(with-base-layout)/oper/floodPre/table-modal.tsx` | 292 | 첨부 엑셀 미리보기 본문 |
| 팝업 | `src/features/window-popup/ui/old-pp-upload-popup-content.tsx` | 54 | `POST v1/dcrpPpl` |
| 팝업 | `src/features/window-popup/ui/old-pp-table-popup-content.tsx` | 45 | `oldPp/table-modal` 동적 import |
| 팝업 | `src/features/window-popup/ui/flood-pre-upload-popup-content.tsx` | 54 | `POST v1/sbmrgPrevnt` |
| 팝업 | `src/features/window-popup/ui/flood-pre-table-popup-content.tsx` | 45 | `floodPre/table-modal` 동적 import |
`oper/oldPp`, `oper/floodPre` 폴더는 비게 되므로 폴더째 지운다.
### 5.2 수정 — 공유 파일에서 구 항목만 제거 (3개)
| 파일 | 제거할 줄 | 내용 |
| --- | --- | --- |
| `src/features/window-popup/registry.tsx` | 60~65, 72~77, 165~180 | `FloodPreTablePopupContent`, `FloodPreUploadPopupContent`, `OldPpUploadPopupContent`, `OldPpTablePopupContent` 동적 import 4개와 등록 항목 4개 |
| `src/features/window-popup/model/popup-definitions.ts` | 51~76 | `oldPpUpload`, `oldPpTable`, `floodPreUpload`, `floodPreTable` 정의 4개 |
| `src/features/window-popup/model/types.ts` | 48~49 | `OLD_PP_UPLOAD_COMPLETED`, `FLOOD_PRE_UPLOAD_COMPLETED` 메시지 타입 2개 |
- `registry.tsx`는 `satisfies Record<WindowPopupKey, WindowPopupRegistryItem>`이고 `WindowPopupKey`는 `popup-definitions.ts`의 키에서 나온다. 그래서 두 파일을 **같이** 고쳐야 타입검사를 통과한다.
- 줄 번호는 2026-11-20 기준이다. 수정 직전에 다시 확인한다.
### 5.3 삭제 후보 — 구 화면만 쓰는 공용 모듈 (2개, 175줄, 승인 시)
| 파일 | 줄 수 | 사용처 |
| --- | ---: | --- |
| `app/components/ui/oper-file-upload-form.tsx` (`@/components/ui/oper-file-upload-form`) | 102 | `old-pp-upload-popup-content.tsx`, `flood-pre-upload-popup-content.tsx`뿐이다. |
| `app/(with-base-layout)/oper/components/search-date-picker.tsx` | 73 | `oldPp/page.tsx`, `floodPre/page.tsx`뿐이다. 지우면 `oper/components` 폴더가 빈다. |
5.1절 파일을 지우면 두 모듈은 아무도 import하지 않는 코드가 된다. 같은 작업에서 지우는 것을 권장한다(13절 2번).
### 5.4 남기는 것
| 대상 | 이유 |
| --- | --- |
| 신규 화면 `oper/obsltPplBiz/**`, `oper/ctyFldngPrvtnBiz/**`, `src/features/{obslt-ppl,cty-fldng-prvtn-biz,cfmtn-bgt}/**` | 대체 기능. 구 화면 코드를 import하지 않는다. |
| 공용 모듈 `src/features/window-popup/{lib/popup-message,lib/open-window-popup,ui/popup-content-utils,ui/popup-missing-params}`, `@/shared/api/{file-api,sewerage-api,search-page}`, `@/shared/lib/row-number` | 구 화면 말고도 5~8개 파일이 쓰고 있다. |
| 팝업 라우트 `app/(popupLayout)/popup/[popupKey]/page.tsx` | 바꾸지 않는다. 지운 키로 접근하면 기존 처리대로 "등록되지 않은 팝업입니다."를 보여 준다. |
| `registry.tsx`의 다른 팝업 항목(침수예측 `fldngPredcPrst` 포함) | 이번 작업과 관계없다. |
| `packages/common/**`, 다른 앱 `apps/*` | 참조가 없어 수정하지 않는다(5.6절). |
| 과거 이력 문서(`docs/작업계획/**`, `docs/작업내용/**`의 기존 기록) | 그 시점의 기록이므로 수정하지 않는다. |
### 5.5 문서 갱신 (승인 시)
| 문서 | 줄 | 내용 |
| --- | --- | --- |
| `docs/기준문서/013-UI레이아웃가이드.md` | 9~10, 71 | 업무형 조회·등록 화면의 기준 예시로 구 화면 두 개를 가리킨다. 지우면 참조가 끊긴다. `설계 제안`: 신규 화면(`src/features/obslt-ppl/ui/obslt-ppl-list-page.tsx`, `src/features/cty-fldng-prvtn-biz/ui/cty-fldng-prvtn-biz-list-page.tsx`)으로 바꾼다. 신규 화면이 가이드의 패턴(`UiModal` 등)을 따르는지는 수정할 때 확인한다. |
| `docs/기준문서/010-용어사전.md` | 23~24, 40~42, 60~61, 90 | `oldPp`, `dcrpPpl`, `floodPre`, `sbmrgPrevnt` 항목에 "폐기(2026-11-20)"를 표시한다. 90행의 "`oldPp` route 정리" 검토 항목은 삭제로 끝났다고 적는다. |
| 이 폴더 `002-fe-SN-기존침수예방사업-노후관로정비사업-구화면삭제-결과보고.md` | 신규 | 구현 결과를 결과 보고 형식으로 기록한다. |
### 5.6 다른 참조 확인 결과
- `git grep`으로 `oldPp`, `floodPre`, `old-pp-`, `flood-pre-`, `OLD_PP_`, `FLOOD_PRE_`, `v1/dcrpPpl`, `v1/sbmrgPrevnt`를 검색했다(`docs` 제외). 5.1~5.2절 파일 말고는 나오지 않았다. 비슷한 이름인 `OldPpl*`(노후관로 통계), `FloodPrediction*`(침수예측)은 다른 기능이므로 대상이 아니다.
- `frontend/packages/**`, `apps/sn` 밖의 다른 앱: 참조 없음.
- 테스트·스토리북·e2e: `apps/sn`에 git이 추적하는 테스트 파일이 없다.
- 메뉴는 CMS 서비스(`ENDPOINT.CMS_SERVICE.MENU_ROLES`)가 DB에서 내려준다. 코드에 메뉴 URL이 고정되어 있지 않다.
## 6. API 연동 — 삭제로 없어지는 호출
| 기능 | Method | URL | 호출 위치 | 처리 |
| --- | --- | --- | --- | --- |
| 노후관로 목록 | GET | `/sewerage-service/api/v1/dcrpPpl` | `oper/oldPp/page.tsx:117` | 파일 삭제로 제거 |
| 노후관로 등록 | POST | `/sewerage-service/api/v1/dcrpPpl` | `old-pp-upload-popup-content.tsx:25` | 파일 삭제로 제거 |
| 노후관로 삭제 | DELETE | `/sewerage-service/api/v1/dcrpPpl/{id}` | `oper/oldPp/page.tsx:214` | 파일 삭제로 제거 |
| 침수예방 목록 | GET | `/sewerage-service/api/v1/sbmrgPrevnt` | `oper/floodPre/page.tsx:183` | 파일 삭제로 제거 |
| 침수예방 등록 | POST | `/sewerage-service/api/v1/sbmrgPrevnt` | `flood-pre-upload-popup-content.tsx:25` | 파일 삭제로 제거 |
| 침수예방 삭제 | DELETE | `/sewerage-service/api/v1/sbmrgPrevnt/{id}` | `oper/floodPre/page.tsx:235` | 파일 삭제로 제거 |
| 첨부 다운로드·삭제 | GET·DELETE | `/attach-service/api/v1/download/{atflId}`, `/attach-service/api/v1/atfl/attachments/{atflId}` | 구 화면·미리보기 | 구 화면에서 부르던 호출만 없어진다. attach-service API는 다른 화면이 계속 쓴다. |
이번 FE 작업은 API 계약을 바꾸지 않는다. 호출하는 쪽만 없앤다.
## 6-1. 멀티에이전트·세션 분리
| 구분 | 내용 |
| --- | --- |
| FE 산출물 | 5.1~5.3절 파일 삭제·수정, 5.5절 문서 |
| BE 산출물 | 짝 문서(BE)의 19개 파일 삭제 |
| QA 산출물 | 10절 검증 결과 |
| 순차 진행 필요 | CMS 메뉴 비노출 → FE 정리 → BE 삭제. 배포는 FE를 먼저 하거나 BE와 같은 회차에 한다(8절). |
| 병렬 가능 | FE 코드 정리와 BE 코드 정리는 파일이 겹치지 않아 동시에 작업할 수 있다. |
## 6-2. 채팅방·세션 간 충돌 방지
- 겹치는 파일: `src/features/window-popup/{registry.tsx,model/popup-definitions.ts,model/types.ts}`. 침수예측 작업(파일점유 228행)이 `src/features/windowPopup/**`을 예약해 두었다.
- 처리 방식: 수정하기 직전에 `git status`와 `git diff`로 세 파일에 미커밋 변경이 있는지 본다.
- 변경이 없고 228행이 계속 "코드 미점유"라면 구 항목만 지우고 바로 점유를 해제한다.
- 미커밋 변경이 있거나 228행이 "진행"으로 바뀌었다면 수정하지 않고 사용자와 침수예측 작업 쪽에 알린다. 그 작업이 끝난 뒤 진행한다.
- 파일점유 등록: 구현을 시작할 때 `COMMON_DOCS_ROOT/작업계획/공통-작업동기화/003-공통-파일점유현황.md`에 5.1~5.3절 파일을 등록한다.
## 7. 메뉴·탭·라우트 처리
| 항목 | 지운 뒤 동작 | 처리 |
| --- | --- | --- |
| CMS 메뉴 | 메뉴가 남아 있으면 메뉴를 눌렀을 때 Next 404 화면이 뜬다. | `확인 필요`: CMS 메뉴관리에서 `/oper/oldPp`, `/oper/floodPre` 메뉴가 있는지 보고 비노출·삭제한다. FE 코드로는 처리할 수 없으며 관리자 작업이다. |
| 직접 URL 접근 | Next 404 | 별도 처리 없음 |
| 저장된 탭 | 탭 목록은 브라우저 `localStorage`(`st-tab-store`)에 저장된다. 구 화면 탭을 열어 두었던 사용자는 배포 뒤 그 탭에서 404를 본다. | 탭을 닫으면 해소된다. 별도 코드 처리는 하지 않는다(`설계 제안`이 필요하면 따로 검토). |
| 팝업 URL `/popup/oldPpUpload` 등 | "등록되지 않은 팝업입니다." | 기존 팝업 라우트 처리 그대로 둔다. |
## 8. 작업 순서 (승인 후)
1. 사용자·관리자가 CMS 메뉴 노출 여부를 확인하고 비노출 처리한다(7절).
2. 파일점유현황에 등록하고 6-2절의 공유 파일 충돌을 확인한다.
3. 5.1절 9개 파일과 빈 폴더를 지운다. 승인하면 5.3절 2개 파일과 빈 `oper/components` 폴더도 지운다.
4. 5.2절 공유 파일 3개에서 구 항목만 지운다. 다른 팝업 항목, 주석, 줄 순서는 그대로 둔다.
5. 10절 순서대로 검증한다.
6. 5.5절 문서를 갱신하고 결과 보고를 쓴다.
7. 파일 점유를 해제한다. 커밋은 사용자가 요청할 때만 한다.
8. 배포: FE를 BE보다 먼저 배포하거나 같은 회차에 배포한다. FE를 먼저 배포하면 구 API가 잠시 남아 있어도 문제가 없다. 반대로 BE를 먼저 배포하면 구 화면이 오류를 낸다.
## 9. 영향 범위
| 구분 | 영향 |
| --- | --- |
| `apps/sn` 화면 | 라우트 2개(`/oper/oldPp`, `/oper/floodPre`)와 창 팝업 4개(`oldPpUpload`, `oldPpTable`, `floodPreUpload`, `floodPreTable`)가 없어진다. |
| 신규 화면 | 영향 없음. 구 화면 코드를 import하지 않는다. |
| 다른 팝업 | 등록부에서 항목 4개만 빠진다. 다른 팝업의 키·정의·메시지 타입은 그대로다. |
| `business_components` | 수정하지 않는다. 구 화면은 import만 했다. |
| 다른 앱 | 영향 없음(참조 없음) |
| 백엔드 API | FE 작업 자체는 BE를 바꾸지 않는다. BE 구 API 삭제의 전제 조건이다. |
| 사용자 업무 | 예전에 올린 구 첨부 엑셀을 화면에서 내려받거나 미리볼 방법이 없어진다(12절 4번). |
## 10. 테스트 / 검증 방법
사용자가 띄운 `sn` 개발 서버(기본 포트 3002)가 있는지 먼저 확인한다. 개발 서버가 실행 중이면 `next build`를 돌리지 않는다.
```powershell
Get-NetTCPConnection -LocalPort 3002 -State Listen -ErrorAction SilentlyContinue # 3002 포트에서 대기 중인 개발 서버 확인
# -LocalPort 확인할 포트, -State Listen 접속 대기 상태만, -ErrorAction SilentlyContinue 없을 때 오류 문구 숨김
cd D:\iipbs\frontend # 프론트엔드 저장소 루트로 이동(경로는 각자 체크아웃 위치로 바꿈)
pnpm --filter sn run typecheck # sn 앱 TypeScript 타입검사(tsc --noEmit). 파일을 만들지 않아 개발 서버와 같이 돌려도 됨
git diff --check # 줄 끝 공백 같은 형식 오류 확인
```
```powershell
cd D:\iipbs\frontend\apps\sn # sn 앱으로 이동
git grep -n -E "v1/dcrpPpl|v1/sbmrgPrevnt" -- . ":!docs" # 구 API 호출 검색. -n 줄 번호, -E 확장 정규식, ":!docs" docs 폴더 제외
git grep -n -E "oldPp([^l]|$)|floodPre([^d]|$)|old-pp-|flood-pre-|OLD_PP_|FLOOD_PRE_" -- . ":!docs" # 구 화면·팝업 이름 검색
# ([^l]|$), ([^d]|$)는 비슷한 이름인 OldPpl(노후관로 통계), FloodPrediction(침수예측)을 빼기 위한 조건
git status --short # 변경 파일 목록. --short 한 줄 요약
```
| 순번 | 확인 | 기대 결과 |
| --- | --- | --- |
| 1 | `typecheck` | 오류 0건. `registry.tsx`·`popup-definitions.ts`의 키가 맞지 않으면 여기서 오류가 난다. |
| 2 | 구 API 검색 | 0건. 삭제 전 시험 실행(2026-11-20)에서는 8줄(호출 6곳 + `floodPre/page.tsx` 머리 주석 2줄)이 나왔다. |
| 3 | 구 이름 검색 | 0건 |
| 4 | `git status` | 5.1절 9개(승인 시 5.3절 2개 추가)는 `D`, 5.2절 3개는 `M`. 그 밖의 변경은 없어야 한다. |
| 5 | 브라우저(개발 서버 HMR) `/oper/obsltPplBiz` | 목록 조회, 등록 화면 진입, 최종확정예산사업(`cfmtnBgt`) 팝업 열기 정상 |
| 6 | 브라우저 `/oper/ctyFldngPrvtnBiz` | 목록 조회, 등록 화면 진입 정상 |
| 7 | 브라우저 다른 창 팝업 | 준설 등록(`dredgingRegister`), 조사사업 등록(`exmnBusinessRegister`), 침수예측(`fldngPredcPrst`) 팝업이 정상으로 열린다. |
| 8 | 브라우저 `/oper/oldPp`, `/oper/floodPre` | 404 |
| 9 | 브라우저 `/popup/oldPpUpload` | "등록되지 않은 팝업입니다." |
| 10 | 네트워크 | 5~7번을 하는 동안 `v1/dcrpPpl`, `v1/sbmrgPrevnt` 요청이 나가지 않는다. |
| 11 | 최종 빌드(승인 시) | 사용자가 개발 서버를 끈 상태에서 `pnpm --filter sn run build` 성공 |
에이전트가 검증을 위해 개발 서버를 직접 띄웠다면 PID·포트를 기록하고 작업 종료 전에 그 프로세스만 종료한다.
## 11. 롤백 방법
| 시점 | 방법 |
| --- | --- |
| 커밋 전 | `git restore --staged --worktree -- <5.1~5.3절 파일 경로>`로 되돌린다(`--staged` 스테이징 취소, `--worktree` 작업 파일 복원). |
| 커밋 후 | `git revert <삭제 커밋>`으로 되돌림 커밋을 만든다(사용자 요청 시). |
| 배포 후 | 직전 FE 빌드를 다시 배포한다. 이때 BE 구 API가 살아 있으면 FE 롤백만으로 복구된다. BE도 이미 지웠다면 BE도 함께 되돌려야 구 화면이 동작한다. |
| CMS 메뉴 | 비노출·삭제한 메뉴를 메뉴관리에서 다시 등록하거나 노출한다. |
기준 커밋: FE `iipbs/sn/dev` `5aeff4248`(2026-11-20 확인)에서 대상 파일을 복원할 수 있다.
## 12. 남은 리스크
1. **공유 파일 충돌**: 침수예측 작업이 `window-popup` 폴더를 예약해 두었다. 같은 체크아웃에서 동시에 고치면 충돌한다(6-2절).
2. **CMS 메뉴 미확인**: 메뉴가 아직 보이는지 확인하지 못했다. 메뉴를 그대로 두고 배포하면 사용자에게 404가 보인다.
3. **배포 순서**: BE를 FE보다 먼저 배포하면 구 화면이 오류를 낸다.
4. **구 첨부 엑셀 열람 수단 상실**: 예전에 올린 엑셀(개발 DB 기준 노후관로 2건, 침수예방 7건)을 화면에서 내려받을 수 없게 된다. 그 내용이 신규 기능에 이미 들어갔는지, 원본 파일을 보관해야 하는지 `확인 필요`.
5. **저장된 탭**: 구 화면 탭을 저장해 둔 사용자는 배포 뒤 한 번 404를 본다.
6. **기준문서 참조 끊김**: UI 레이아웃 가이드를 갱신하지 않으면 없는 파일을 기준 예시로 가리키게 된다.
7. **감리 산출물**: 종료감리 명세서의 화면 목록에 구 화면이 들어 있는지 확인하지 못했다(`확인 필요`).
8. **원본 근거 부재**: 원본 요구사항·화면 ID 근거가 없고 사용자 지시가 근거다. 공통 결정로그 등록을 권장한다.
## 13. 승인 요청 사항
| 번호 | 항목 | 제안 |
| --- | --- | --- |
| 1 | 5.1절 구 화면 전용 9개 파일 삭제(기본 작업 범위 밖의 기능 삭제 승인 포함) | 승인 요청 |
| 2 | 5.3절 구 화면만 쓰는 공용 모듈 2개와 빈 `oper/components` 폴더 삭제 | 포함 권장 |
| 3 | 5.2절 공유 파일 3개에서 구 항목만 제거 | 승인 요청 |
| 4 | 침수예측 작업과 공유 파일 조율 방식(6-2절) | 미커밋 변경이 없을 때만 진행하고, 있으면 그 작업이 끝난 뒤 진행 |
| 5 | 5.5절 문서 갱신(UI 레이아웃 가이드 기준 화면 교체, 용어사전 폐기 표시) | 갱신 권장 |
| 6 | CMS 메뉴 `/oper/oldPp`, `/oper/floodPre` 비노출 담당과 시점 | `확인 필요`(관리자 작업, FE 배포 전) |
| 7 | 배포 순서 | FE 먼저 또는 BE와 같은 회차 |
| 8 | 구 첨부 엑셀 보존·열람 필요 여부 | `확인 필요` |
| 9 | 브라우저 검증 범위(10절 5~10번)와 최종 `build` 실행 | 브라우저 검증 수행 권장. 최종 `build`는 사용자가 개발 서버를 끈 뒤 승인할 때만 실행 |
@@ -0,0 +1,136 @@
# 002. fe SN 기존 침수예방사업·노후관로정비사업 구 화면 삭제 결과보고
| 항목 | 내용 |
| --- | --- |
| 작업 ID | `SN-OPER-LEGACY-BIZ-REMOVE-FE` |
| 수행일 | 2026-11-20 |
| 근거 | 사용자 승인(2026-11-20, "FE부터 진행") — `001-fe-SN-기존침수예방사업-노후관로정비사업-구화면삭제-작업계획.md`의 권장안대로 진행 |
| 상태 | **검증** — 코드·문서 반영, 자동 검증, 로그인한 상태의 브라우저 확인(개발 CMS 메뉴 포함) 완료. 최종 `build`와 운영 CMS 메뉴 확인이 남았다. 커밋하지 않았다. |
## 1. 작업 목적
대체된 구 노후관로정비사업(`/oper/oldPp`, `v1/dcrpPpl`)·도시침수예방사업(`/oper/floodPre`, `v1/sbmrgPrevnt`) 화면을 삭제한다. 그래서 백엔드가 구 API를 지워도 FE에서 오류가 나지 않게 한다. 원본 요구사항·화면 ID 근거가 없는 1차 화면이며, 근거는 사용자 지시다(작업계획 3절).
## 2. 수정 대상 파일
기준 경로: `FE_APP_ROOT` (`apps/sn`)
### 2.1 삭제 (11개)
| 파일 | 줄 수 |
| --- | ---: |
| `app/(with-base-layout)/oper/oldPp/page.tsx` | 331 |
| `app/(with-base-layout)/oper/oldPp/head-list.ts` | 1,722 |
| `app/(with-base-layout)/oper/oldPp/table-modal.tsx` | 365 |
| `app/(with-base-layout)/oper/floodPre/page.tsx` | 359 |
| `app/(with-base-layout)/oper/floodPre/table-modal.tsx` | 292 |
| `src/features/window-popup/ui/old-pp-upload-popup-content.tsx` | 54 |
| `src/features/window-popup/ui/old-pp-table-popup-content.tsx` | 45 |
| `src/features/window-popup/ui/flood-pre-upload-popup-content.tsx` | 54 |
| `src/features/window-popup/ui/flood-pre-table-popup-content.tsx` | 45 |
| `app/components/ui/oper-file-upload-form.tsx` (구 업로드 팝업만 사용) | 102 |
| `app/(with-base-layout)/oper/components/search-date-picker.tsx` (구 화면만 사용) | 73 |
빈 폴더 `oper/oldPp`, `oper/floodPre`, `oper/components`도 지웠다.
### 2.2 수정 — 공유 파일 (3개, 구 항목만 제거)
| 파일 | 제거한 내용 | 줄 |
| --- | --- | ---: |
| `src/features/window-popup/registry.tsx` | 동적 import 4개(`FloodPreTablePopupContent`, `FloodPreUploadPopupContent`, `OldPpUploadPopupContent`, `OldPpTablePopupContent`)와 등록 항목 4개 | -28 |
| `src/features/window-popup/model/popup-definitions.ts` | `oldPpUpload`, `oldPpTable`, `floodPreUpload`, `floodPreTable` 정의 | -26 |
| `src/features/window-popup/model/types.ts` | `OLD_PP_UPLOAD_COMPLETED`, `FLOOD_PRE_UPLOAD_COMPLETED` | -2 |
코드 합계: 14개 파일, 3,498줄 삭제, 추가 0줄.
### 2.3 문서
| 파일 | 내용 |
| --- | --- |
| `docs/기준문서/013-UI레이아웃가이드.md` | 기준 화면 목록의 구 화면 2개에 "2026-11-20 삭제"를 표시하고, 같은 업무의 현행 화면(`obslt-ppl-list-page.tsx`, `cty-fldng-prvtn-biz-list-page.tsx`)을 적었다. 상세·모달 흐름 참고 대상에서 구 화면을 뺐다. 현행 화면은 `StandardDataTable`과 창 팝업을 써서 구 화면의 `UiTable`·`UiModal` 패턴과 다르다. 그래서 "기준 화면"으로 바꾸지 않고 업무 대응 관계만 적었다. |
| `docs/기준문서/010-용어사전.md` | `dcrpPpl`·`oldPp`, `sbmrgPrevnt`·`floodPre`를 "폐기"로 바꾸고 대체 용어 `obsltPplBiz`, `ctyFldngPrvtnBiz`를 적었다. 신규 기준 용어(6.1)와 피할 별칭(7절)을 고쳤고, 확인 필요 항목의 `oldPp` route 정리는 "종료"로 표시했다. |
| `COMMON_DOCS_ROOT/작업계획/공통-작업동기화/{002-공통-작업현황판.md,003-공통-파일점유현황.md}` | 작업 시작·종료 항목 |
## 3. 변경 내용 요약
- `/oper/oldPp`, `/oper/floodPre` 라우트와 창 팝업 4개를 없앴다. 이제 FE 어디에서도 `v1/dcrpPpl`, `v1/sbmrgPrevnt`를 호출하지 않는다.
- 팝업 등록부의 다른 항목(침수예측 `fldngPredcPrst` 포함), 팝업 라우트, 공용 모듈, `packages/**`, 다른 앱은 바꾸지 않았다.
## 4. 공유 파일 조율 결과
- 수정 직전에 `window-popup` 공유 파일 3개에는 미커밋 변경이 없었다. 파일점유 228행 `SFR-011-008-FLOOD-PREDICTION-STATUS`는 "대기, 코드 미점유" 상태였다. 그래서 계획 6-2절에 따라 구 항목만 지웠다.
- 침수예측 작업이 나중에 이 파일들을 고칠 때는 이번 변경(구 항목 삭제)을 기준으로 하면 된다.
## 5. 영향 범위
| 구분 | 영향 |
| --- | --- |
| `apps/sn` | 구 라우트 2개와 창 팝업 4개가 없어졌다. 신규 화면·다른 팝업에는 영향이 없다(아래 검증 결과). |
| `business_components`, 다른 공통 패키지, 다른 앱 | 수정 없음 |
| 백엔드 | 수정 없음. 이제 BE 구 API를 삭제해도 FE 호출처가 없다. |
| 사용자 | CMS 메뉴가 남아 있으면 메뉴 클릭 시 404가 뜬다. 예전에 올린 구 첨부 엑셀은 화면에서 내려받을 수 없다. |
## 6. 테스트 / 검증 결과
| 순번 | 확인 | 결과 |
| --- | --- | --- |
| 1 | `pnpm --filter sn run typecheck` | `apps/sn` 소스 오류 **0건**. 다만 명령은 exit 2로 끝났다. `packages/common/components/src/ui/{footer,header}/index.tsx`에서 `lucide-react`의 `Pause`·`Play`·`Minus` export를 찾지 못한 오류 3건 때문이다. 두 파일은 이번에 수정하지 않았고(마지막 변경 2026-10-12, 로컬 변경 없음), 이번 삭제·수정 파일과 import 관계도 없다. 공통 패키지는 수정 금지 범위라 보고만 한다(7절). |
| 2 | `git grep -n -E "v1/dcrpPpl\|v1/sbmrgPrevnt" -- . ":!docs"` | 0건(삭제 전 8줄) |
| 3 | 구 화면·팝업·고아 모듈 이름 검색 | 0건 |
| 4 | `git diff --check` | 통과 |
| 5 | `git status --short` | 삭제 11건(`D`), 수정 3건(`M`), 그 밖의 코드 변경 없음, 스테이징 없음 |
| 6 | 줄바꿈·인코딩 | 수정한 코드 3개·문서 2개 모두 UTF-8, CRLF만 사용(LF 혼용 0) |
| 7 | 개발 서버 `GET /oper/oldPp`, `/oper/floodPre` | 404 |
| 8 | `GET /popup/{oldPpUpload,oldPpTable,floodPreUpload,floodPreTable}` | 4개 모두 "등록되지 않은 팝업입니다." 표시 |
| 9 | `GET /popup/{dredgingRegister,cfmtnBgt}` | 미등록 안내 없이 정상 응답 |
| 10 | `GET /oper/{obsltPplBiz,ctyFldngPrvtnBiz}`, `/popup/{dredgingRegister,exmnBusinessRegister,fldngPredcPrst,cfmtnBgt}` | 200, 응답에 `Module not found`·`Failed to compile`·`Can't resolve`·`Build Error` 없음 |
| 11 | 로그인한 상태의 브라우저 `/oper/obsltPplBiz` | 목록 조회 정상(10건 표시, 페이지 1~10). "최종확정예산사업" 버튼 → `/popup/cfmtnBgt?bizSe=정밀조사` 팝업 정상 표시(검색 조건·목록 영역 표시, 미등록 안내 없음) |
| 11-1 | 로그인한 상태의 브라우저 `/oper/ctyFldngPrvtnBiz` | 목록 조회 정상(데이터 표시) |
| 11-2 | 로그인한 상태의 브라우저 `/oper/oldPp` | 404 "This page could not be found." |
| 11-3 | 네트워크 | 위 확인 중 `dcrpPpl`, `sbmrgPrevnt` 요청 0건 |
| 11-4 | 개발 CMS 메뉴(`GET /cms-service/api/v1/menu-roles/SN` 응답, 로그인 사용자 권한 기준) | 운영정보 하위 메뉴는 `도시침수예방사업`(menuCd 465, `/oper/ctyFldngPrvtnBiz`), `노후 하수관로 정비사업`(menuCd 466, `/oper/obsltPplBiz`) 두 개뿐이다. `/oper/oldPp`, `/oper/floodPre` 메뉴는 노출되지 않는다. |
| 11-5 | 콘솔 오류 | 이번 변경과 관계있는 오류 없음. 로그인 직후 토큰 갱신 과정의 401, 구 라우트 확인으로 생긴 404, 신규 화면 Select(`aria-controls` id)의 hydration 불일치 경고만 있었다. 마지막 경고는 이번에 수정하지 않은 신규 화면에서 나는 것이다. |
| 12 | 최종 `pnpm --filter sn run build` | **미수행** — 사용자 개발 서버가 3002 포트(PID 38476)에서 실행 중이라 `FE_APP_ROOT/AGENTS.md`에 따라 돌리지 않았다. |
7~10번은 사용자가 띄운 개발 서버(3002)에 HTTP 요청을 보내 확인했다. 개발 서버는 종료·재시작하지 않았다. 에이전트가 띄운 프로세스와 검증용 파일은 없다.
## 7. 별도 보고 — 공통 패키지 타입 오류
| 항목 | 내용 |
| --- | --- |
| 문제 | `tsc --noEmit`에서 `packages/common/components/src/ui/footer/index.tsx(4)`가 `Pause`·`Play`를, `header/index.tsx(5)`가 `Minus`를 `lucide-react`에서 찾지 못한다. |
| 수정 필요 경로 | `packages/common/components/**` 또는 `lucide-react` 타입 해석 환경. `sn` 작업 범위 밖이다. |
| `sn` 영향 | `typecheck` 명령이 exit 2로 끝나 자동 검증 결과를 흐린다. 실행 중인 개발 서버 화면은 정상 응답했다. |
| 다른 앱 영향 | `@common/components`를 쓰는 다른 앱의 타입검사에도 같은 오류가 날 수 있다. 확인하지 않았다. |
## 8. 롤백 방법
**커밋 전** — 이번에 바꾼 파일만 되돌린다. 폴더 단위로 되돌리면 다른 작업의 변경까지 되돌릴 수 있으므로 쓰지 않는다.
```powershell
cd D:\iipbs\frontend # 프론트엔드 저장소 루트로 이동(경로는 각자 체크아웃 위치로 바꿈)
git restore --worktree -- "apps/sn/app/(with-base-layout)/oper/oldPp" "apps/sn/app/(with-base-layout)/oper/floodPre" "apps/sn/app/(with-base-layout)/oper/components/search-date-picker.tsx" apps/sn/app/components/ui/oper-file-upload-form.tsx # 삭제한 화면·모듈 복원
# --worktree 작업 폴더의 파일을 마지막 커밋 상태로 되돌림, -- 뒤는 되돌릴 경로
git restore --worktree -- apps/sn/src/features/window-popup/ui/old-pp-upload-popup-content.tsx apps/sn/src/features/window-popup/ui/old-pp-table-popup-content.tsx apps/sn/src/features/window-popup/ui/flood-pre-upload-popup-content.tsx apps/sn/src/features/window-popup/ui/flood-pre-table-popup-content.tsx # 삭제한 팝업 4개 복원
git restore --worktree -- apps/sn/src/features/window-popup/registry.tsx apps/sn/src/features/window-popup/model/popup-definitions.ts apps/sn/src/features/window-popup/model/types.ts apps/sn/docs/기준문서/010-용어사전.md apps/sn/docs/기준문서/013-UI레이아웃가이드.md # 공유 파일 3개와 기준문서 2개 복원
```
공유 파일 3개는 되돌리기 전에 `git diff -- <파일>`로 다른 작업의 변경이 섞여 있지 않은지 먼저 본다.
| 시점 | 방법 |
| --- | --- |
| 커밋 후 | `git revert <커밋>`(사용자 요청 시) |
| 배포 후 | 직전 FE 빌드 재배포. BE 구 API가 살아 있는 동안에는 FE 롤백만으로 복구된다. |
기준 커밋: FE `iipbs/sn/dev` `5aeff4248`.
## 9. 남은 리스크와 후속 작업
1. **로그인한 상태의 브라우저 확인**: 완료(6절 11~11-5번).
2. **최종 `build`**(6절 12번)는 사용자가 개발 서버를 끈 뒤 승인할 때 실행한다. 공통 패키지 타입 오류(7절)가 빌드에 영향을 주는지도 그때 확인한다.
3. **CMS 메뉴**: 개발 CMS에서는 로그인 사용자 권한 기준으로 구 메뉴가 노출되지 않는다(6절 11-4번). 운영 CMS와 다른 권한의 메뉴는 확인하지 못했다. 운영 배포 전에 관리자가 메뉴관리에서 확인한다.
4. **배포 순서**: FE를 BE보다 먼저 배포하거나 같은 회차에 배포한다.
5. **구 첨부 엑셀 보존**: 화면 열람 수단이 없어졌다. 원본 파일을 보관해야 하는지 `확인 필요`.
6. **저장된 탭**: 구 화면 탭을 저장해 둔 사용자는 배포 뒤 한 번 404를 본다(탭을 닫으면 해소).
7. **BE 구 API 삭제**: `COMMON_DOCS_ROOT/작업계획/SN-기존 침수예방사업 노후관로정비사업 API 삭제/001-be-...-API삭제-작업계획.md` 승인 후 진행한다.
8. **커밋**: 하지 않았다. 사용자가 요청하면 위 14개 코드 파일과 문서만 커밋한다.
@@ -38,7 +38,7 @@
| 파일 | 역할 | 선언/주석 보조 근거 | 행 | 직접 참조 | 상태 | | 파일 | 역할 | 선언/주석 보조 근거 | 행 | 직접 참조 | 상태 |
|---|---|---|---:|---:|---| |---|---|---|---:|---:|---|
| [layout.tsx](<D:/workspace/IIPBS-FRONTEND/frontend/apps/sn/app/layout.tsx>) | Next 루트 HTML·테마·메타데이터·Provider 진입점 | metadata, RootLayout / ➡️ 경로 : 모든 페이지 | 44 | 0 | 등록/도구 진입 규칙 대상 | | [layout.tsx](<D:/workspace/IIPBS-FRONTEND/frontend/apps/sn/app/layout.tsx>) | Next 루트 HTML·테마·메타데이터·Provider 진입점 | metadata, RootLayout / ➡️ 경로 : 모든 페이지 | 44 | 0 | 등록/도구 진입 규칙 대상 |
| [page.tsx](<D:/workspace/IIPBS-FRONTEND/frontend/apps/sn/app/page.tsx>) | 루트 진입/개발 자동로그인·지도 이동 | DEV_HOSTNAMES, DEV_LOGIN_PAYLOAD, Home / 홈 페이지 컴포넌트 | 51 | 0 | 등록/도구 진입 규칙 대상 | | [page.tsx](<D:/workspace/IIPBS-FRONTEND/frontend/apps/sn/app/page.tsx>) | 루트 진입/지도 이동 | Home / 홈 페이지 컴포넌트 | 18 | 0 | 등록/도구 진입 규칙 대상 |
| [providers.tsx](<D:/workspace/IIPBS-FRONTEND/frontend/apps/sn/app/providers.tsx>) | 실제 src/app/providers의 AppProvider 재수출. 현재 layout에서 사용 | | 2 | 1 | 정적 참조 있음 | | [providers.tsx](<D:/workspace/IIPBS-FRONTEND/frontend/apps/sn/app/providers.tsx>) | 실제 src/app/providers의 AppProvider 재수출. 현재 layout에서 사용 | | 2 | 1 | 정적 참조 있음 |
## app/(auth)/auth ## app/(auth)/auth
@@ -1045,3 +1045,12 @@
- 실브라우저: 테스트 사업→초이처리분구→지도3개 표시→실제188001 클릭→사업명 테스트/GIS 맨홀번호188001 확인→조사보고서 보기→1쪽 PDF와188001 표시 성공. 사용자도 최종 정상동작 확인했다. - 실브라우저: 테스트 사업→초이처리분구→지도3개 표시→실제188001 클릭→사업명 테스트/GIS 맨홀번호188001 확인→조사보고서 보기→1쪽 PDF와188001 표시 성공. 사용자도 최종 정상동작 확인했다.
- 실행 서버: 기존 재시작 승인 범위에서 코드 반영 후8883 PID27788로 유지한다(이전PID24204 종료). classpath/실행로그는 기존 .codex-tmp/manhole-backend-* 경로 유지. 종료명령 Stop-Process -Id 27788. - 실행 서버: 기존 재시작 승인 범위에서 코드 반영 후8883 PID27788로 유지한다(이전PID24204 종료). classpath/실행로그는 기존 .codex-tmp/manhole-backend-* 경로 유지. 종료명령 Stop-Process -Id 27788.
- 롤백: 위 FE3개 소스와 ExmnManholeReportService의 이번 변경을 함께 복원한다. DB 롤백 없음. 잔여 리스크는 GIS 미연결 자료 열람 불가 및 대형 사업의 지도 매칭·PDF 판독 비용이며, 임의 위치/다른 사업 fallback을 하지 않는다. - 롤백: 위 FE3개 소스와 ExmnManholeReportService의 이번 변경을 함께 복원한다. DB 롤백 없음. 잔여 리스크는 GIS 미연결 자료 열람 불가 및 대형 사업의 지도 매칭·PDF 판독 비용이며, 임의 위치/다른 사업 fallback을 하지 않는다.
## 2026-10-28 관로조사 지도 색상 가시성 개선
- 사용자 요청에 따라 조사결과 > 관로조사의 지도 선을 상태등급별 색상에서 짙은 남색 `#000080`으로 통일했다. 선 두께 4와 등급 조회·필터는 유지한다.
- `app/(map-layout)/map/lib/analysis-layer-styles.ts`, `components/exmn/exmn-map-types.ts`, `components/exmn/exmn-layer-setting-panel.tsx`에서 지도 선·레이어 범례·설정 표식이 같은 색상 상수를 사용하도록 했다(뒤 두 경로도 같은 map 하위).
- 원본 근거: 요구사항정의서 `3. (기능)요구사항정의 및 추적표`의 SFR-010-004, 화면설계서 45쪽 SN_MN040103 및 48쪽 SN_MN040107의 조사관로 지도 표출. 색상 변경은 이번 사용자 요청을 적용했다.
- 영향: SN 지도 표시 전용. 맨홀 심볼·선택 처리·상세 탭·API·DB 변경 없음.
- 검증: git diff --check 통과, 지도 스타일과 범례·설정 표식의 공통 상수 참조 확인. 3002 개발 서버 리스너가 없어 HMR·실제 배경지도 가시성은 미검증. 빌드·서버 기동/재시작은 수행하지 않았다.
- 롤백: 위 3개 파일의 이번 색상 변경만 되돌린다. DB 조치 없음.
@@ -20,3 +20,30 @@
## 수동 확인 필요 ## 수동 확인 필요
- 실제 로그인 화면에서 팝업 크기·가로 스크롤·강조 색상 및 지도 이동 회귀 확인 - 실제 로그인 화면에서 팝업 크기·가로 스크롤·강조 색상 및 지도 이동 회귀 확인
## 추가 작업: 확률강우량 팝업 엑셀다운로드 (2026-10-30)
### 변경 내용
- 팝업 헤더 우측(닫기 X 왼쪽)에 `엑셀다운로드` 버튼을 추가했다. 닫기 버튼과 겹치지 않도록 헤더에 `pr-14` 여백을 둔다.
- 공통 유틸 `src/shared/util/download-excel-workbook.ts`의 `downloadExcelWorkbook`을 재사용한다.
- 파일명은 `{시군구명}_확률강우량.xlsx`이며 시트는 두 개다.
- `확률강우량`: 재현기간(년) 행 × `N시간` 열. 셀은 소수 4자리로 자르지 않은 원본 숫자 값이다.
- `확률관측소 면적비율`: 확률관측소코드·관측소명·면적비율(%)과 합계(API `areaRtTotal`).
- 로딩 중·오류·표 데이터 없음 상태에서는 버튼을 비활성화한다.
- API 호출, 응답 구조, 화면 문구와 기존 표 렌더링은 변경하지 않았다.
### 이슈: 팝업 본체가 투명하게 렌더링됨
- 증상: 엑셀다운로드 버튼 추가 후 팝업 본체 배경이 투명해져 뒤쪽 목록 화면이 비쳐 보였다. 새로고침과 애니메이션 완료 후에도 재현됐다.
- 추정 원인: `DialogContent`의 배경이 `bg-[var(--dialog-bg)]`(`--dialog-bg: var(--background)`, `packages/common/assets/src/styles/base.css`)인데, 이 모달에서 해당 변수가 값을 가져오지 못한 것으로 추정한다. 정확한 근본 원인은 확인하지 못했다. 공통 패키지(`@common/components`, `@common/assets`)는 수정 범위 밖이라 변경하지 않았다.
- 조치: `PrbbtRnflDialog.tsx`의 `DialogContent` className에 `bg-background`를 추가해 배경을 직접 지정했다. 사용자가 해결을 확인했다(2026-10-30).
- 참고: 같은 증상이 다른 `DialogContent` 사용 팝업에서 보이면 공통 변수 문제일 수 있으므로 별도 보고 대상이다.
### 수정 파일
- `apps/sn/src/features/fldng-predc-prst/ui/PrbbtRnflDialog.tsx`
### 검증
- 사용자가 실제 화면에서 팝업 배경 정상 표시를 확인했다.
- 타입 체크·빌드·엑셀 파일 내용 열람은 수행하지 않았다.
### 롤백
- 위 파일의 변경(헤더 버튼, `handleExcelDownload`, 두 import, `bg-background`)을 되돌린다.
@@ -3,6 +3,10 @@ import { downloadExcelWithKoreanHeaders } from "@/shared/lib/download-excel";
export type FloodPredictionExcelRow = { export type FloodPredictionExcelRow = {
ctpvNm: string; ctpvNm: string;
sggNm: string; sggNm: string;
/** `/prst` 조회 때 시군구-관측소 매핑에서 붙인 관측소명이다. 기존 로직 행이나 매핑에 없는 조합은 null이다. */
obsrvnBrnchNm: string | null;
/** 시군구 면적 중 관측소 영역의 비율(%)이다. 기존 로직 행이나 매핑에 없는 조합은 null이다. */
areaRt: number | null;
analysisDateTime: string; analysisDateTime: string;
rainBeginningDateTime: string; rainBeginningDateTime: string;
observedAccumulatedRainfall: number | null; observedAccumulatedRainfall: number | null;
@@ -12,10 +16,13 @@ export type FloodPredictionExcelRow = {
floodRiskGrade: string; floodRiskGrade: string;
}; };
/** Excel 행 객체 키를 한글 헤더로 바꾸는 매핑이다. 실제 열 순서는 행 객체의 키 순서를 따르므로 같은 순서로 둔다. */
const HEADERS: Record<string, string> = { const HEADERS: Record<string, string> = {
rowNo: "순번", rowNo: "순번",
ctpvNm: "시도", ctpvNm: "시도",
sggNm: "시군구", sggNm: "시군구",
obsrvnBrnchNm: "관측소",
areaRt: "면적비율(%)",
analysisDateTime: "분석시각", analysisDateTime: "분석시각",
rainBeginningDateTime: "강우시작시각", rainBeginningDateTime: "강우시작시각",
observedAccumulatedRainfall: "관측 누적강수량(mm)", observedAccumulatedRainfall: "관측 누적강수량(mm)",
@@ -39,12 +46,20 @@ export const downloadFloodPredictionStatusExcel = async (
rowNo: index + 1, rowNo: index + 1,
ctpvNm: row.ctpvNm || "-", ctpvNm: row.ctpvNm || "-",
sggNm: row.sggNm || "-", sggNm: row.sggNm || "-",
// 관측소·면적비율은 시군구 뒤에 두고, 기존 로직 행이나 매핑에 없는 조합은 `-`로 내보낸다.
obsrvnBrnchNm: row.obsrvnBrnchNm || "-",
// 면적비율은 목록과 같이 소수 둘째 자리까지 반올림한 숫자로 내보낸다.
areaRt:
row.areaRt == null || !Number.isFinite(Number(row.areaRt))
? "-"
: Number(Number(row.areaRt).toFixed(2)),
analysisDateTime: formatDateTime(row.analysisDateTime), analysisDateTime: formatDateTime(row.analysisDateTime),
rainBeginningDateTime: formatDateTime(row.rainBeginningDateTime), rainBeginningDateTime: formatDateTime(row.rainBeginningDateTime),
observedAccumulatedRainfall: observedAccumulatedRainfall:
row.observedAccumulatedRainfall == null row.observedAccumulatedRainfall == null
? "-" ? "-"
: Number(row.observedAccumulatedRainfall.toFixed(1)), : Number(row.observedAccumulatedRainfall.toFixed(1)),
// 관측소 기준 행의 예측시간 0(대표값이 분석시각)도 목록과 같이 `0시간 후`로 내보낸다.
predictionHour: predictionHour:
row.predictionHour == null ? "-" : `${row.predictionHour}시간 후`, row.predictionHour == null ? "-" : `${row.predictionHour}시간 후`,
predictedAccumulatedRainfall: predictedAccumulatedRainfall:
@@ -60,7 +75,8 @@ export const downloadFloodPredictionStatusExcel = async (
data: excelRows as unknown as JSON[], data: excelRows as unknown as JSON[],
fileName: "침수예측현황.xlsx", fileName: "침수예측현황.xlsx",
sheetNameArray: ["침수예측현황"], sheetNameArray: ["침수예측현황"],
headerRange: "A1:J1", // 순번~침수위험도 12개 열(관측소·면적비율 포함)의 헤더 행 범위다.
headerRange: "A1:L1",
headerMapping: HEADERS, headerMapping: HEADERS,
}); });
}; };
@@ -2,9 +2,14 @@
import { useLayoutEffect, useMemo, useRef } from "react"; import { useLayoutEffect, useMemo, useRef } from "react";
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@common/components"; import { Button, Dialog, DialogContent, DialogHeader, DialogTitle } from "@common/components";
/** 시군구별 면적가중 확률강우량 한 셀의 API 응답이다. */ import { downloadExcelWorkbook } from "@/shared/util/download-excel-workbook";
/**
* 시군구별 면적가중 확률강우량 한 셀의 API 응답이다.
* 관측소 기준표 응답에서는 최근접 확률관측소 1곳의 값을 면적가중 없이 그대로 담는다.
*/
export type PrbbtRnflCell = { export type PrbbtRnflCell = {
frequencyYear: number; frequencyYear: number;
durationHour: number; durationHour: number;
@@ -18,18 +23,37 @@ export type PrbbtRnflStation = {
areaRt: number; areaRt: number;
}; };
/** 확률강우량 표와 그 계산에 사용한 관측소 비율을 함께 받는다. */ /**
* 확률강우량 표와 그 계산에 사용한 관측소 비율을 함께 받는다.
* 시군구 기준표(`/prst/prbbt-rnfl?sggCd=`)는 `sggCd`를, 관측소 기준표(`/prst/prbbt-rnfl/obsvtr?obsrvnBrnchCd=`)는
* `sggCd` 대신 `obsrvnBrnchCd`·`obsrvnBrnchNm`을 담으므로 두 응답을 모두 받도록 식별 필드는 선택값으로 둔다.
*/
export type PrbbtRnflResponse = { export type PrbbtRnflResponse = {
sggCd: string; /** 시군구 기준표 응답의 시군구코드다. 관측소 기준표 응답에는 없다. */
sggCd?: string;
/** 관측소 기준표 응답의 관측지점코드다. 시군구 기준표 응답에는 없다. */
obsrvnBrnchCd?: string;
/** 관측소 기준표 응답의 관측소명이다. 시군구 기준표 응답에는 없다. */
obsrvnBrnchNm?: string;
rainfall: PrbbtRnflCell[]; rainfall: PrbbtRnflCell[];
/** 시군구 기준은 면적가중에 쓴 확률관측소 전부, 관측소 기준은 최근접 확률관측소 1곳(비율 100)이다. */
stations: PrbbtRnflStation[]; stations: PrbbtRnflStation[];
areaRtTotal: number; areaRtTotal: number;
}; };
/**
* 기준표를 연 목록 행의 분석 기준이다.
* `sgg`는 기존 시군구 면적가중 행, `obsvtr`는 관측지점코드가 있는 관측소 기준(새 로직) 행이다.
*/
export type PrbbtRnflTargetKind = "sgg" | "obsvtr";
type PrbbtRnflDialogProps = { type PrbbtRnflDialogProps = {
open: boolean; open: boolean;
onOpenChange: (open: boolean) => void; onOpenChange: (open: boolean) => void;
sggName: string; /** 상단 제목·표 제목·Excel 파일명에 쓰는 대상 이름이다. 시군구 기준은 시군구명, 관측소 기준은 관측소명이다. */
targetName: string;
/** 대상 이름이 시군구인지 관측소인지 구분해 아래 표 제목과 안내 문구를 고른다. */
targetKind: PrbbtRnflTargetKind;
selectedDurationHour: number | null; selectedDurationHour: number | null;
selectedFrequencyYear: number | null; selectedFrequencyYear: number | null;
data: PrbbtRnflResponse | null; data: PrbbtRnflResponse | null;
@@ -43,11 +67,27 @@ const formatRainfall = (value: number) =>
const formatAreaRatio = (value: number) => const formatAreaRatio = (value: number) =>
Number.isFinite(Number(value)) ? Number(value).toFixed(3) : "-"; Number.isFinite(Number(value)) ? Number(value).toFixed(3) : "-";
/**
* 아래 확률관측소 표의 제목(Excel 두 번째 시트명 겸용)이다.
* 관측소 기준은 면적가중 없이 최근접 확률관측소 1곳을 쓰므로 `적용 확률관측소`로 보인다.
*/
const STATION_TABLE_TITLE: Record<PrbbtRnflTargetKind, string> = {
sgg: "확률관측소 면적비율",
obsvtr: "적용 확률관측소",
};
/** 기준자료가 없을 때 보이는 안내 문구다. 관측소 기준은 시군구 대신 관측소로 안내한다. */
const EMPTY_MESSAGE: Record<PrbbtRnflTargetKind, string> = {
sgg: "해당 시군구의 확률강우량 기준자료가 없습니다.",
obsvtr: "해당 관측소의 확률강우량 기준자료가 없습니다.",
};
/** 재현기간을 행, 강우지속시간을 열로 구성하고 선택한 두 기준이 교차하는 값만 색으로 강조한다. */ /** 재현기간을 행, 강우지속시간을 열로 구성하고 선택한 두 기준이 교차하는 값만 색으로 강조한다. */
export default function PrbbtRnflDialog({ export default function PrbbtRnflDialog({
open, open,
onOpenChange, onOpenChange,
sggName, targetName,
targetKind,
selectedDurationHour, selectedDurationHour,
selectedFrequencyYear, selectedFrequencyYear,
data, data,
@@ -58,6 +98,8 @@ export default function PrbbtRnflDialog({
const tableScrollRef = useRef<HTMLDivElement>(null); const tableScrollRef = useRef<HTMLDivElement>(null);
/** 목록에서 클릭한 지속시간에 대응하는 표 헤더이다. */ /** 목록에서 클릭한 지속시간에 대응하는 표 헤더이다. */
const selectedDurationHeaderRef = useRef<HTMLTableCellElement>(null); const selectedDurationHeaderRef = useRef<HTMLTableCellElement>(null);
/** 행 종류에 따른 아래 표 제목이다. 시군구 기준 행은 기존 제목을 그대로 쓴다. */
const stationTableTitle = STATION_TABLE_TITLE[targetKind];
const { frequencies, durations, rainfallByKey } = useMemo(() => { const { frequencies, durations, rainfallByKey } = useMemo(() => {
const rainfall = data?.rainfall ?? []; const rainfall = data?.rainfall ?? [];
@@ -77,6 +119,46 @@ export default function PrbbtRnflDialog({
}; };
}, [data]); }, [data]);
/**
* 화면에 표시 중인 확률강우량 표와 관측소 면적비율 표를 두 시트로 내려받는다.
* 파일명은 대상 이름(시군구명 또는 관측소명)을, 두 번째 시트명은 아래 표 제목을 따른다.
*/
const handleExcelDownload = async () => {
const stations = data?.stations ?? [];
await downloadExcelWorkbook({
fileName: `${targetName}_확률강우량`,
sheets: [
{
name: "확률강우량",
rows: [
["재현기간(년)", ...durations.map((hour) => `${hour}시간`)],
...frequencies.map((frequencyYear) => [
frequencyYear,
...durations.map(
(durationHour) =>
rainfallByKey.get(`${frequencyYear}:${durationHour}`) ?? null,
),
]),
],
columnWidths: [14, ...durations.map(() => 12)],
},
{
name: stationTableTitle,
rows: [
["확률관측소코드", "관측소명", "면적비율(%)"],
...stations.map((station) => [
station.prbbtObsvtrCd,
station.prbbtObsvtrNm || "-",
station.areaRt,
]),
["합계", "", data?.areaRtTotal ?? null],
],
columnWidths: [18, 18, 14],
},
],
});
};
/** 표가 표시되면 선택 지속시간 열을 가로 스크롤 영역의 가운데로 맞춘다. */ /** 표가 표시되면 선택 지속시간 열을 가로 스크롤 영역의 가운데로 맞춘다. */
useLayoutEffect(() => { useLayoutEffect(() => {
if (!open || loading || error || selectedDurationHour == null) return; if (!open || loading || error || selectedDurationHour == null) return;
@@ -99,8 +181,16 @@ export default function PrbbtRnflDialog({
className="flex max-h-[90vh] w-[94vw] !max-w-[150rem] flex-col gap-4 overflow-hidden" className="flex max-h-[90vh] w-[94vw] !max-w-[150rem] flex-col gap-4 overflow-hidden"
aria-describedby={undefined} aria-describedby={undefined}
> >
<DialogHeader> {/* 우측 상단 닫기(X) 버튼과 겹치지 않도록 pr-14 여백을 둔다. */}
<DialogTitle>{sggName} 확률강우량</DialogTitle> <DialogHeader className="flex-row items-center justify-between pr-14">
<DialogTitle>{targetName} 확률강우량</DialogTitle>
<Button
type="button"
disabled={loading || !!error || !frequencies.length || !durations.length}
onClick={() => void handleExcelDownload()}
>
엑셀다운로드
</Button>
</DialogHeader> </DialogHeader>
{loading ? ( {loading ? (
@@ -113,14 +203,14 @@ export default function PrbbtRnflDialog({
</p> </p>
) : !frequencies.length || !durations.length ? ( ) : !frequencies.length || !durations.length ? (
<p className="py-8 text-center text-xl" role="status"> <p className="py-8 text-center text-xl" role="status">
해당 시군구의 확률강우량 기준자료가 없습니다. {EMPTY_MESSAGE[targetKind]}
</p> </p>
) : ( ) : (
<> <>
<div ref={tableScrollRef} className="min-h-0 overflow-auto rounded-md border border-border"> <div ref={tableScrollRef} className="min-h-0 overflow-auto rounded-md border border-border">
<table className="w-max min-w-full border-collapse text-right text-lg"> <table className="w-max min-w-full border-collapse text-right text-lg">
<caption className="sr-only"> <caption className="sr-only">
{sggName} 재현기간 및 강우지속시간별 확률강우량(mm) {targetName} 재현기간 및 강우지속시간별 확률강우량(mm)
</caption> </caption>
<thead className="sticky top-0 z-10 bg-muted text-foreground"> <thead className="sticky top-0 z-10 bg-muted text-foreground">
<tr> <tr>
@@ -182,7 +272,7 @@ export default function PrbbtRnflDialog({
</div> </div>
<div className="shrink-0 space-y-2"> <div className="shrink-0 space-y-2">
<h3 className="text-xl font-semibold">확률관측소 면적비율</h3> <h3 className="text-xl font-semibold">{stationTableTitle}</h3>
<div className="max-h-[16rem] overflow-auto rounded-md border border-border"> <div className="max-h-[16rem] overflow-auto rounded-md border border-border">
<table className="w-full border-collapse text-lg"> <table className="w-full border-collapse text-lg">
<thead className="bg-muted text-foreground"> <thead className="bg-muted text-foreground">
@@ -31,9 +31,16 @@ type ApiRow = {
ctpvCd: string; ctpvCd: string;
ctpvNm: string; ctpvNm: string;
sggNm: string; sggNm: string;
/** 관측소 기준(새 로직) 분석 행의 관측지점코드다. 기존 시군구 면적가중 행은 null이다. */
obsrvnBrnchCd: string | null;
/** `/prst` 조회 때 시군구-관측소 매핑에서 붙인 관측소명이다. 기존 로직 행이나 매핑에 없는 조합은 null이다. */
obsrvnBrnchNm: string | null;
/** 시군구 면적 중 관측소 영역의 비율(%)이다. 기존 로직 행이나 매핑에 없는 조합은 null이다. */
areaRt: number | null;
rainBeginningDateTime: string; rainBeginningDateTime: string;
analysisDateTime: string; analysisDateTime: string;
observedAccumulatedRainfall: number | null; observedAccumulatedRainfall: number | null;
/** 분석시각 기준 대표 예측시간이다. 관측소 기준 행의 0은 대표값이 분석시각(관측 누적)이라는 뜻이다. */
predictionHour: number | null; predictionHour: number | null;
predcRainHr: number | null; predcRainHr: number | null;
predictedAccumulatedRainfall: number | null; predictedAccumulatedRainfall: number | null;
@@ -46,6 +53,10 @@ type TableRow = ApiRow &
rowNo: number; rowNo: number;
analysisDateTimeDisplay: string; analysisDateTimeDisplay: string;
rainBeginningDateTimeDisplay: string; rainBeginningDateTimeDisplay: string;
/** 관측소 열 표시값이다. 관측소명이 없으면 `-`이다. */
obsrvnBrnchNmDisplay: string;
/** 면적비율(%) 열 표시값이다. 소수 둘째 자리까지, 값이 없으면 `-`이다. */
areaRtDisplay: string;
observedAccumulatedRainfallDisplay: string; observedAccumulatedRainfallDisplay: string;
predictionHourDisplay: string; predictionHourDisplay: string;
predictedAccumulatedRainfallDisplay: string; predictedAccumulatedRainfallDisplay: string;
@@ -76,47 +87,61 @@ const toFloodMapFrequencyCode = (value: number) => {
return String(normalized).padStart(3, "0"); return String(normalized).padStart(3, "0");
}; };
/**
* 침수예측현황 목록 열 정의다.
* 시군구 뒤에 관측소 기준 분석의 관측소·면적비율 열을 두고, 13개 열의 widthPercent 합은 100으로 맞춘다.
*/
const HEADS: UiHeadProps[] = [ const HEADS: UiHeadProps[] = [
{ id: "rowNo", title: "순번", widthPercent: 5 }, { id: "rowNo", title: "순번", widthPercent: 4 },
{ id: "ctpvNm", title: "시도", widthPercent: 7 }, { id: "ctpvNm", title: "시도", widthPercent: 7 },
{ id: "sggNm", title: "시군구", widthPercent: 8 }, { id: "sggNm", title: "시군구", widthPercent: 8 },
{ id: "obsrvnBrnchNmDisplay", title: "관측소", widthPercent: 7 },
{
id: "areaRtDisplay",
title: "면적비율(%)",
widthPercent: 6,
align: "right",
},
{ {
id: "analysisDateTimeDisplay", id: "analysisDateTimeDisplay",
title: "분석시각", title: "분석시각",
widthPercent: 13, widthPercent: 11,
}, },
{ {
id: "rainBeginningDateTimeDisplay", id: "rainBeginningDateTimeDisplay",
title: "강우시작시각", title: "강우시작시각",
widthPercent: 13, widthPercent: 11,
}, },
{ {
id: "observedAccumulatedRainfallDisplay", id: "observedAccumulatedRainfallDisplay",
title: "관측 누적강수량(mm)", title: "관측 누적강수량(mm)",
widthPercent: 11, widthPercent: 9,
align: "right", align: "right",
}, },
{ {
id: "predictionHourDisplay", id: "predictionHourDisplay",
title: "예측시간", title: "예측시간",
widthPercent: 7, widthPercent: 6,
}, },
{ {
id: "predictedAccumulatedRainfallDisplay", id: "predictedAccumulatedRainfallDisplay",
title: "예측 누적강수량(mm)", title: "예측 누적강수량(mm)",
widthPercent: 12, widthPercent: 9,
align: "right", align: "right",
}, },
{ {
id: "exceededFrequencyYearDisplay", id: "exceededFrequencyYearDisplay",
title: "초과 빈도(년)", title: "초과 빈도(년)",
widthPercent: 8, widthPercent: 7,
align: "right", align: "right",
}, },
{ id: "floodRiskGrade", title: "침수위험도", widthPercent: 8 }, { id: "floodRiskGrade", title: "침수위험도", widthPercent: 7 },
{ id: "probabilityRainfallDisplay", title: "확률강우량", widthPercent: 8 }, { id: "probabilityRainfallDisplay", title: "확률강우량", widthPercent: 8 },
]; ];
/** 관측소·면적비율 열이 더해진 목록의 최소 표 너비다. 기본 팝업 너비(1280px)에서는 가로 스크롤 없이 보이도록 잡는다. */
const LIST_MIN_TABLE_WIDTH = "118rem";
/** 날짜·시각의 뒷부분이 잘리지 않도록 전체 표시할 목록 열이다. */ /** 날짜·시각의 뒷부분이 잘리지 않도록 전체 표시할 목록 열이다. */
const FULL_TEXT_TIME_HEAD_IDS = [ const FULL_TEXT_TIME_HEAD_IDS = [
"analysisDateTimeDisplay", "analysisDateTimeDisplay",
@@ -157,6 +182,34 @@ const predictionHourText = (value: number | null) => {
return hour > 0 ? `${hour}시간 후` : "-"; return hour > 0 ? `${hour}시간 후` : "-";
}; };
/** 관측지점코드가 있으면 관측소 기준(새 로직) 분석 행이다. 기준표 API·표시 문구를 고를 때 쓴다. */
const isObsvtrRow = (row: Pick<ApiRow, "obsrvnBrnchCd">) =>
Boolean(row.obsrvnBrnchCd);
/**
* 목록 예측시간 열의 표시문구를 정한다.
* 관측소 기준 행의 예측시간 0은 대표값이 분석시각(관측 누적)이라는 뜻이므로 `0시간 후`로 보인다.
* 그 밖의 행은 기존 `predictionHourText` 규칙(0 이하 `-`)을 그대로 따른다.
*/
const predictionHourDisplayText = (
row: Pick<ApiRow, "predictionHour" | "obsrvnBrnchCd">,
) =>
isObsvtrRow(row) && row.predictionHour === 0
? "0시간 후"
: predictionHourText(row.predictionHour);
/**
* 확률강우량 기준표 버튼 aria-label과 모달 제목에 쓸 대상 이름이다.
* 관측소 기준 행은 관측소명(목록 → 기준표 응답 → 관측지점코드 순으로 대체), 기존 행은 시군구명을 쓴다.
*/
const probabilityTargetName = (
row: Pick<ApiRow, "obsrvnBrnchCd" | "obsrvnBrnchNm" | "sggNm">,
responseStationName?: string,
) =>
isObsvtrRow(row)
? row.obsrvnBrnchNm || responseStationName || row.obsrvnBrnchCd || ""
: row.sggNm;
/** 분석 결과의 대표 누적강우시간을 확률강우량 기준표 링크 문구로 표시한다. */ /** 분석 결과의 대표 누적강우시간을 확률강우량 기준표 링크 문구로 표시한다. */
const probabilityDurationText = (value: number | null) => { const probabilityDurationText = (value: number | null) => {
const hour = Number(value); const hour = Number(value);
@@ -291,11 +344,14 @@ export default function FldngPredcPrstPopupContent() {
rainBeginningDateTimeDisplay: displayDate( rainBeginningDateTimeDisplay: displayDate(
item.rainBeginningDateTime, item.rainBeginningDateTime,
), ),
// 기존 로직 행(관측지점코드 null)이나 매핑에 없는 조합은 관측소·면적비율을 `-`로 보인다.
obsrvnBrnchNmDisplay: item.obsrvnBrnchNm || "-",
areaRtDisplay: formatNumber(item.areaRt, 2),
observedAccumulatedRainfallDisplay: formatNumber( observedAccumulatedRainfallDisplay: formatNumber(
item.observedAccumulatedRainfall, item.observedAccumulatedRainfall,
1, 1,
), ),
predictionHourDisplay: predictionHourText(item.predictionHour), predictionHourDisplay: predictionHourDisplayText(item),
predictedAccumulatedRainfallDisplay: formatNumber( predictedAccumulatedRainfallDisplay: formatNumber(
item.predictedAccumulatedRainfall, item.predictedAccumulatedRainfall,
1, 1,
@@ -417,9 +473,19 @@ export default function FldngPredcPrstPopupContent() {
} }
}; };
/** 선택 시군구의 확률강우량과 관측소 비율을 조회한다. 지도 행 클릭은 버튼에서 차단한다. */ /**
* 선택 행의 확률강우량과 관측소 비율을 조회한다. 지도 행 클릭은 버튼에서 차단한다.
* 관측지점코드가 있는 관측소 기준 행은 판정에 쓴 최근접 확률관측소 기준표(`/prst/prbbt-rnfl/obsvtr`)를,
* 기존 시군구 기준 행은 지금처럼 시군구 면적가중 기준표(`/prst/prbbt-rnfl`)를 부른다.
*/
const handleProbabilityClick = async (row: TableRow) => { const handleProbabilityClick = async (row: TableRow) => {
if (!row.sggCd || !Number.isInteger(Number(row.predcRainHr)) || Number(row.predcRainHr) <= 0) { // 관측소 기준 행이면 조회에 쓸 관측지점코드, 기존 행이면 null이다.
const obsrvnBrnchCd = row.obsrvnBrnchCd || null;
if (
(!obsrvnBrnchCd && !row.sggCd) ||
!Number.isInteger(Number(row.predcRainHr)) ||
Number(row.predcRainHr) <= 0
) {
return; return;
} }
const requestId = ++probabilityRequestIdRef.current; const requestId = ++probabilityRequestIdRef.current;
@@ -428,16 +494,22 @@ export default function FldngPredcPrstPopupContent() {
setProbabilityError(null); setProbabilityError(null);
setProbabilityLoading(true); setProbabilityLoading(true);
try { try {
const params = new URLSearchParams({ sggCd: row.sggCd }); // 행 종류에 맞는 기준표 API 주소다. 기존 시군구 기준 행은 이전과 같은 sggCd 쿼리를 쓴다.
const response = await getRawJson( const requestUrl = obsrvnBrnchCd
`/sewerage-service/api/v1/fldng/predc/prst/prbbt-rnfl?${params.toString()}`, ? `/sewerage-service/api/v1/fldng/predc/prst/prbbt-rnfl/obsvtr?${new URLSearchParams({ obsrvnBrnchCd }).toString()}`
); : `/sewerage-service/api/v1/fldng/predc/prst/prbbt-rnfl?${new URLSearchParams({ sggCd: row.sggCd }).toString()}`;
const response = await getRawJson(requestUrl);
if (requestId !== probabilityRequestIdRef.current) return; if (requestId !== probabilityRequestIdRef.current) return;
const payload: PrbbtRnflResponse = response?.data ?? response; const payload: PrbbtRnflResponse = response?.data ?? response;
setProbabilityData(payload); setProbabilityData(payload);
} catch (error) { } catch (error) {
if (requestId !== probabilityRequestIdRef.current) return; if (requestId !== probabilityRequestIdRef.current) return;
console.error("시군구 확률강우량 조회 중 오류:", error); console.error(
obsrvnBrnchCd
? "관측소 확률강우량 조회 중 오류:"
: "시군구 확률강우량 조회 중 오류:",
error,
);
setProbabilityError("확률강우량 기준표를 조회하지 못했습니다."); setProbabilityError("확률강우량 기준표를 조회하지 못했습니다.");
} finally { } finally {
if (requestId === probabilityRequestIdRef.current) { if (requestId === probabilityRequestIdRef.current) {
@@ -479,6 +551,7 @@ export default function FldngPredcPrstPopupContent() {
getItems: (response) => response.content, getItems: (response) => response.content,
getTotal: (response) => response.totalElements, getTotal: (response) => response.totalElements,
}); });
// API 원본 행을 그대로 넘겨 관측지점코드·관측소명·면적비율도 Excel 헬퍼에서 함께 쓴다.
await downloadFloodPredictionStatusExcel(result.items); await downloadFloodPredictionStatusExcel(result.items);
} catch (error) { } catch (error) {
console.error("침수예측현황 Excel 다운로드 중 오류:", error); console.error("침수예측현황 Excel 다운로드 중 오류:", error);
@@ -659,7 +732,7 @@ export default function FldngPredcPrstPopupContent() {
<button <button
type="button" type="button"
className="font-medium text-primary underline underline-offset-2 hover:opacity-75 focus-visible:rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary" className="font-medium text-primary underline underline-offset-2 hover:opacity-75 focus-visible:rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
aria-label={`${row.sggNm} ${row.probabilityRainfallDisplay} 확률강우량 기준표 보기`} aria-label={`${probabilityTargetName(row)} ${row.probabilityRainfallDisplay} 확률강우량 기준표 보기`}
onClick={(event) => { onClick={(event) => {
event.stopPropagation(); event.stopPropagation();
void handleProbabilityClick(row); void handleProbabilityClick(row);
@@ -671,7 +744,7 @@ export default function FldngPredcPrstPopupContent() {
) : undefined ) : undefined
} }
scrollMode="horizontal" scrollMode="horizontal"
minTableWidth="112rem" minTableWidth={LIST_MIN_TABLE_WIDTH}
fullTextHeadIds={FULL_TEXT_TIME_HEAD_IDS} fullTextHeadIds={FULL_TEXT_TIME_HEAD_IDS}
fillAvailableHeight={rows.length === 0} fillAvailableHeight={rows.length === 0}
emptyMessage="조회 조건에 해당하는 침수예측현황이 없습니다." emptyMessage="조회 조건에 해당하는 침수예측현황이 없습니다."
@@ -706,7 +779,17 @@ export default function FldngPredcPrstPopupContent() {
<PrbbtRnflDialog <PrbbtRnflDialog
open={probabilityRow !== null} open={probabilityRow !== null}
onOpenChange={handleProbabilityOpenChange} onOpenChange={handleProbabilityOpenChange}
sggName={probabilityRow?.sggNm ?? ""} targetName={
probabilityRow
? probabilityTargetName(
probabilityRow,
probabilityData?.obsrvnBrnchNm,
)
: ""
}
targetKind={
probabilityRow && isObsvtrRow(probabilityRow) ? "obsvtr" : "sgg"
}
selectedDurationHour={probabilityRow?.predcRainHr ?? null} selectedDurationHour={probabilityRow?.predcRainHr ?? null}
selectedFrequencyYear={probabilityRow?.exceededFrequencyYear ?? null} selectedFrequencyYear={probabilityRow?.exceededFrequencyYear ?? null}
data={probabilityData} data={probabilityData}
@@ -48,32 +48,6 @@ export const windowPopupDefinitions = {
height: 850, height: 850,
requiredParams: ["exmnBizId", "pipeNumber"], requiredParams: ["exmnBizId", "pipeNumber"],
}, },
oldPpUpload: {
key: "oldPpUpload",
title: "노후 하수관로 정비사업 등록",
width: 1000,
height: 420,
},
oldPpTable: {
key: "oldPpTable",
title: "노후 하수관로 정비사업 상세",
width: 1400,
height: 900,
requiredParams: ["fileNm", "atflId"],
},
floodPreUpload: {
key: "floodPreUpload",
title: "도시침수예방사업 등록",
width: 1000,
height: 420,
},
floodPreTable: {
key: "floodPreTable",
title: "도시침수예방사업 상세",
width: 1400,
height: 900,
requiredParams: ["fileNm", "atflId"],
},
reportTab: { reportTab: {
key: "reportTab", key: "reportTab",
title: "하수도정비 기본계획보고서", title: "하수도정비 기본계획보고서",
@@ -45,8 +45,6 @@ export const WINDOW_POPUP_MESSAGE_TYPE = {
EXMN_RESULT_COMMITTED: "sn:popup:exmnResultCommitted", EXMN_RESULT_COMMITTED: "sn:popup:exmnResultCommitted",
DREDGING_REGISTERED: "sn:popup:dredgingRegistered", DREDGING_REGISTERED: "sn:popup:dredgingRegistered",
DREDGING_UPDATED: "sn:popup:dredgingUpdated", DREDGING_UPDATED: "sn:popup:dredgingUpdated",
OLD_PP_UPLOAD_COMPLETED: "sn:popup:oldPpUploadCompleted",
FLOOD_PRE_UPLOAD_COMPLETED: "sn:popup:floodPreUploadCompleted",
MAP_SEARCH_SELECT_FEATURE: "sn:popup:mapSearchSelectFeature", MAP_SEARCH_SELECT_FEATURE: "sn:popup:mapSearchSelectFeature",
MAP_SEARCH_SHOW_MULTIPLE: "sn:popup:mapSearchShowMultiple", MAP_SEARCH_SHOW_MULTIPLE: "sn:popup:mapSearchShowMultiple",
MAP_SEARCH_FIT_EXTENT: "sn:popup:mapSearchFitExtent", MAP_SEARCH_FIT_EXTENT: "sn:popup:mapSearchFitExtent",
@@ -57,24 +57,12 @@ const ExmnResultRegisterPopupContent = loadPopupContent(
const ExmnSurveyDetailPopupContent = loadPopupContent( const ExmnSurveyDetailPopupContent = loadPopupContent(
() => import("./ui/exmn-survey-detail-popup-content"), () => import("./ui/exmn-survey-detail-popup-content"),
); );
const FloodPreTablePopupContent = loadPopupContent(
() => import("./ui/flood-pre-table-popup-content"),
);
const FloodPreUploadPopupContent = loadPopupContent(
() => import("./ui/flood-pre-upload-popup-content"),
);
const InfilChartPopupContent = loadPopupContent( const InfilChartPopupContent = loadPopupContent(
() => import("./ui/infil-chart-popup-content"), () => import("./ui/infil-chart-popup-content"),
); );
const InftwtResultPopupContent = loadPopupContent( const InftwtResultPopupContent = loadPopupContent(
() => import("./ui/inftwt-result-popup-content"), () => import("./ui/inftwt-result-popup-content"),
); );
const OldPpUploadPopupContent = loadPopupContent(
() => import("./ui/old-pp-upload-popup-content"),
);
const OldPpTablePopupContent = loadPopupContent(
() => import("./ui/old-pp-table-popup-content"),
);
const RdiiChartPopupContent = loadPopupContent( const RdiiChartPopupContent = loadPopupContent(
() => import("./ui/rdii-chart-popup-content"), () => import("./ui/rdii-chart-popup-content"),
); );
@@ -162,22 +150,6 @@ export const windowPopupRegistry = {
...windowPopupDefinitions.exmnPipeReport, ...windowPopupDefinitions.exmnPipeReport,
component: ExmnPipeReportPopupContent, component: ExmnPipeReportPopupContent,
}, },
oldPpUpload: {
...windowPopupDefinitions.oldPpUpload,
component: OldPpUploadPopupContent,
},
oldPpTable: {
...windowPopupDefinitions.oldPpTable,
component: OldPpTablePopupContent,
},
floodPreUpload: {
...windowPopupDefinitions.floodPreUpload,
component: FloodPreUploadPopupContent,
},
floodPreTable: {
...windowPopupDefinitions.floodPreTable,
component: FloodPreTablePopupContent,
},
reportTab: { reportTab: {
...windowPopupDefinitions.reportTab, ...windowPopupDefinitions.reportTab,
component: ReportTabPopupContent, component: ReportTabPopupContent,
@@ -1,45 +0,0 @@
"use client";
import dynamic from "next/dynamic";
import { StandardPopupLayout } from "@common/business_components";
import { windowPopupDefinitions } from "../model/popup-definitions";
import type { WindowPopupContentProps } from "../model/types";
import PopupMissingParams from "./popup-missing-params";
import { getPopupParamValue } from "./popup-content-utils";
// 엑셀 파서는 브라우저 전용 의존성을 포함한다. 다른 WindowPopup까지 SSR 단계에서
// 함께 실패하지 않도록 해당 상세 팝업을 실제로 열 때만 클라이언트에서 불러온다.
const TableModal = dynamic(
() => import("@/app/(with-base-layout)/oper/floodPre/table-modal"),
{ ssr: false },
);
export default function FloodPreTablePopupContent({
searchParams,
}: WindowPopupContentProps) {
const fileNm = getPopupParamValue(searchParams.fileNm);
const atflId = getPopupParamValue(searchParams.atflId);
const missingParams = [
!fileNm ? "fileNm" : "",
!atflId ? "atflId" : "",
].filter(Boolean);
if (missingParams.length > 0) {
return (
<PopupMissingParams
title={windowPopupDefinitions.floodPreTable.title}
missingParams={missingParams}
/>
);
}
return (
<StandardPopupLayout
title={windowPopupDefinitions.floodPreTable.title}
bodyClassName="overflow-hidden"
>
<TableModal fileNm={fileNm} atflId={atflId} />
</StandardPopupLayout>
);
}
@@ -1,54 +0,0 @@
"use client";
import { postData } from "@/shared/api/sewerage-api";
import OperFileUploadForm from "@/components/ui/oper-file-upload-form";
import { tokenManager } from "@/entities/auth/lib/token-manager";
import { AUTH_USER_ID } from "@/shared/config";
import { useAlertStore } from "@/shared/lib";
import { StandardPopupLayout } from "@common/business_components";
import { postPopupMessageAndClose } from "../lib/popup-message";
import { windowPopupDefinitions } from "../model/popup-definitions";
import { WINDOW_POPUP_MESSAGE_TYPE } from "../model/types";
export default function FloodPreUploadPopupContent() {
const alert = useAlertStore((state) => state.setMessage);
const handleSubmit = async (
fileNm: string,
year: string,
quater: string,
cd: string,
id: string,
) => {
// 공통 POST가 reject한 HTTP 오류를 팝업에서 처리해 완료 메시지를 보내지 않는다.
try {
const data = await postData("v1/sbmrgPrevnt", {
mngYr: year,
mngQu: quater,
atflId: id,
atflCd: cd,
rgtr: tokenManager.getToken(AUTH_USER_ID) || null,
sbmrgPrevntBizNm: fileNm,
});
if (data) {
alert("파일이 등록되었습니다.", () =>
postPopupMessageAndClose(
WINDOW_POPUP_MESSAGE_TYPE.FLOOD_PRE_UPLOAD_COMPLETED,
),
);
}
} catch {
alert("파일 등록에 실패했습니다. 잠시 후 다시 시도해주세요.");
}
};
return (
<StandardPopupLayout
title={windowPopupDefinitions.floodPreUpload.title}
bodyClassName="[&>div>div.card]:!m-0 [&>div>div:first-child]:hidden"
>
<OperFileUploadForm title="" onSubmit={handleSubmit} />
</StandardPopupLayout>
);
}
@@ -1,45 +0,0 @@
"use client";
import dynamic from "next/dynamic";
import { StandardPopupLayout } from "@common/business_components";
import { windowPopupDefinitions } from "../model/popup-definitions";
import type { WindowPopupContentProps } from "../model/types";
import PopupMissingParams from "./popup-missing-params";
import { getPopupParamValue } from "./popup-content-utils";
// 엑셀 파서는 브라우저 전용 의존성을 포함한다. 다른 WindowPopup까지 SSR 단계에서
// 함께 실패하지 않도록 해당 상세 팝업을 실제로 열 때만 클라이언트에서 불러온다.
const TableModal = dynamic(
() => import("@/app/(with-base-layout)/oper/oldPp/table-modal"),
{ ssr: false },
);
export default function OldPpTablePopupContent({
searchParams,
}: WindowPopupContentProps) {
const fileNm = getPopupParamValue(searchParams.fileNm);
const atflId = getPopupParamValue(searchParams.atflId);
const missingParams = [
!fileNm ? "fileNm" : "",
!atflId ? "atflId" : "",
].filter(Boolean);
if (missingParams.length > 0) {
return (
<PopupMissingParams
title={windowPopupDefinitions.oldPpTable.title}
missingParams={missingParams}
/>
);
}
return (
<StandardPopupLayout
title={windowPopupDefinitions.oldPpTable.title}
bodyClassName="overflow-hidden"
>
<TableModal fileNm={fileNm} atflId={atflId} />
</StandardPopupLayout>
);
}
@@ -1,54 +0,0 @@
"use client";
import { postData } from "@/shared/api/sewerage-api";
import OperFileUploadForm from "@/components/ui/oper-file-upload-form";
import { tokenManager } from "@/entities/auth/lib/token-manager";
import { AUTH_USER_ID } from "@/shared/config";
import { useAlertStore } from "@/shared/lib";
import { StandardPopupLayout } from "@common/business_components";
import { postPopupMessageAndClose } from "../lib/popup-message";
import { windowPopupDefinitions } from "../model/popup-definitions";
import { WINDOW_POPUP_MESSAGE_TYPE } from "../model/types";
export default function OldPpUploadPopupContent() {
const alert = useAlertStore((state) => state.setMessage);
const handleSubmit = async (
fileNm: string,
year: string,
quater: string,
cd: string,
id: string,
) => {
// 공통 POST가 reject한 HTTP 오류를 팝업에서 처리해 완료 메시지를 보내지 않는다.
try {
const data = await postData("v1/dcrpPpl", {
mngYr: year,
mngQu: quater,
atflCd: cd,
atflId: id,
rgtr: tokenManager.getToken(AUTH_USER_ID) || null,
dcrpPplMtncBizNm: fileNm,
});
if (data) {
alert("파일이 등록되었습니다.", () =>
postPopupMessageAndClose(
WINDOW_POPUP_MESSAGE_TYPE.OLD_PP_UPLOAD_COMPLETED,
),
);
}
} catch {
alert("파일 등록에 실패했습니다. 잠시 후 다시 시도해주세요.");
}
};
return (
<StandardPopupLayout
title={windowPopupDefinitions.oldPpUpload.title}
bodyClassName="[&>div>div.card]:!m-0 [&>div>div:first-child]:hidden"
>
<OperFileUploadForm title="" onSubmit={handleSubmit} />
</StandardPopupLayout>
);
}
+28
View File
@@ -0,0 +1,28 @@
FROM node:20-alpine
# pnpm 설치
RUN corepack enable && corepack prepare pnpm@8.15.5 --activate
WORKDIR /app
# 모든 소스 복사
COPY . .
# .env.production 파일 생성
RUN mkdir -p /app/apps/st && \
echo "NODE_ENV=production" > /app/apps/st/.env.production && \
echo "PORT=3000" >> /app/apps/st/.env.production && \
echo "NEXT_PUBLIC_PORT=3000" >> /app/apps/st/.env.production && \
echo "SERVER_API_URL=http://dev.onasys.co.kr:8000" >> /app/apps/st/.env.production && \
echo "NEXT_PUBLIC_PROXY_HOST=https://st.apps.rsonesoft.com" >> /app/apps/st/.env.production && \
echo "NEXT_PUBLIC_TINY_API_KEY=t9nc4z6inquvvd5pq1vea8wcp7lb01qmqseh6egms9vpaju2" >> /app/apps/st/.env.production && \
echo "NEXT_PUBLIC_ST_SERVICE_URL=https://apigateway.apps.rsonesoft.com" >> /app/apps/st/.env.production && \
echo "NEXT_PUBLIC_ST_REALGRID_KEY=upVcPE+wPOmtLjqyBIh9RkM/nBOseBrflwxYpzGZyYnkTzf7Gmn/c+YNYZY36ZjDHoLUQjrb+Zx6JscIKXc6ti45WUEqxvh/kkzVSHLUHquykNuBw5QDg+AQvETEhgujkdwMl8bfXmKFzr6UT9cAmQ==" >> /app/apps/st/.env.production && \
echo "NEXT_PUBLIC_SITE_ID=ST" >> /app/apps/st/.env.production
RUN pnpm install --filter=st...
RUN pnpm build --filter=st...
EXPOSE 3000
CMD ["sh", "-c", "pnpm --filter st start & wait"]
+35 -33
View File
@@ -33,6 +33,7 @@ import {
hasAdmdstCdColumn, hasAdmdstCdColumn,
isExcelImportAdmdstCdInvalid, isExcelImportAdmdstCdInvalid,
mergeExcelImportWithExistingRows, mergeExcelImportWithExistingRows,
parseExcelImportCellValue,
prepareGridColumnsForExcelExport, prepareGridColumnsForExcelExport,
releaseFixedOptionsForExcelExport, releaseFixedOptionsForExcelExport,
resolveColumnStyleName, resolveColumnStyleName,
@@ -289,14 +290,28 @@ type GridViewWithSetColumnProperty = {
}; };
type GridViewWithEditOptions = { type GridViewWithEditOptions = {
setEditOptions?: (options: { commitWhenLeave?: boolean }) => void; setEditOptions?: (options: {
commitWhenLeave?: boolean;
appendable?: boolean;
insertable?: boolean;
}) => void;
setPasteOptions?: (options: { enableAppend?: boolean }) => void;
}; };
/** 포커스가 그리드 밖으로 나갈 때 편집 중인 값을 자동 commit */ /** 포커스가 그리드 밖으로 나갈 때 편집 중인 값을 자동 commit */
function applyDefaultGridEditOptions( function applyDefaultGridEditOptions(
gridView: GridViewWithEditOptions | null | undefined, gridView: GridViewWithEditOptions | null | undefined,
options?: { preventRowAppend?: boolean },
) { ) {
gridView?.setEditOptions?.({ commitWhenLeave: true }); gridView?.setEditOptions?.({
commitWhenLeave: true,
...(options?.preventRowAppend
? { appendable: false, insertable: false }
: {}),
});
if (options?.preventRowAppend) {
gridView?.setPasteOptions?.({ enableAppend: false });
}
} }
function isDateEditorColumn(column: { function isDateEditorColumn(column: {
@@ -853,6 +868,7 @@ const DataGrid = ({
gridHeight = 55, // vh 단위 gridHeight = 55, // vh 단위
headerHeight = 60, headerHeight = 60,
fitStyle = GridFitStyle.EVEN, fitStyle = GridFitStyle.EVEN,
preventRowAppend = true,
}: DataGridProps) => { }: DataGridProps) => {
const { columns, columnLayout } = columnInfo; const { columns, columnLayout } = columnInfo;
const fixedColumnNameSet = useMemo( const fixedColumnNameSet = useMemo(
@@ -1331,6 +1347,11 @@ useEffect(() => {
columnLayout, columnLayout,
{ skipNonEditable: false }, { skipNonEditable: false },
); );
const valueTypeByFieldName = new Map(
columns
.filter((c) => c.fieldName)
.map((c) => [c.fieldName as string, c.valueType]),
);
// 데이터 행 읽기 // 데이터 행 읽기
const dataRows: Record<string, string | number>[] = []; const dataRows: Record<string, string | number>[] = [];
@@ -1352,36 +1373,13 @@ useEffect(() => {
]; ];
const fieldName = excelColumnFieldNames[colIndex]; const fieldName = excelColumnFieldNames[colIndex];
const allFieldName = excelColumnFieldNamesAll[colIndex]; const allFieldName = excelColumnFieldNamesAll[colIndex];
const typeFieldName = fieldName || allFieldName;
let cellValue: string | number = ""; const cellValue = parseExcelImportCellValue(
if ( cell,
cell && typeFieldName
cell.v !== undefined && ? valueTypeByFieldName.get(typeFieldName)
cell.v !== null : undefined,
) { );
// 엑셀 셀 타입이 숫자이거나 값이 숫자인 경우 숫자로 변환
if (
cell.t === "n" ||
(typeof cell.v === "number" &&
!isNaN(cell.v))
) {
cellValue = cell.v as number;
} else {
const stringValue = String(cell.v);
// 문자열이지만 숫자로 변환 가능한 경우 숫자로 변환
const numericValue = Number(
stringValue.replace(/,/g, ""),
);
if (
!isNaN(numericValue) &&
stringValue.trim() !== ""
) {
cellValue = numericValue;
} else {
cellValue = stringValue;
}
}
}
if (allFieldName === "admdstCd" && cellValue !== "") { if (allFieldName === "admdstCd" && cellValue !== "") {
rowAdmdstCd = cellValue; rowAdmdstCd = cellValue;
@@ -1467,7 +1465,9 @@ useEffect(() => {
const scheduleFooterTask = (task: () => void, delayMs: number) => { const scheduleFooterTask = (task: () => void, delayMs: number) => {
footerTimerIds.push(setTimeout(task, delayMs)); footerTimerIds.push(setTimeout(task, delayMs));
}; };
applyDefaultGridEditOptions(gridView as GridViewWithEditOptions); applyDefaultGridEditOptions(gridView as GridViewWithEditOptions, {
preventRowAppend,
});
const columnsFieldsSig = columns.map((c) => c.fieldName).join("\u0001"); const columnsFieldsSig = columns.map((c) => c.fieldName).join("\u0001");
if (columnsFieldsSig !== columnsFieldsSigRef.current) { if (columnsFieldsSig !== columnsFieldsSigRef.current) {
@@ -1990,6 +1990,7 @@ useEffect(() => {
fitStyle, fitStyle,
enableSort, enableSort,
footerVerificationResult, footerVerificationResult,
preventRowAppend,
]); ]);
// 행·셀 클릭 이벤트 (검증 오류 툴팁은 hover만 — onShowTooltip / 빈 셀 오버레이) // 행·셀 클릭 이벤트 (검증 오류 툴팁은 hover만 — onShowTooltip / 빈 셀 오버레이)
@@ -2527,6 +2528,7 @@ useEffect(() => {
const gridView = gridRef.current?.gridView ?? grid; const gridView = gridRef.current?.gridView ?? grid;
applyDefaultGridEditOptions( applyDefaultGridEditOptions(
gridView as GridViewWithEditOptions, gridView as GridViewWithEditOptions,
{ preventRowAppend },
); );
if (!gridView?.columnByName) return; if (!gridView?.columnByName) return;
setTimeout(() => { setTimeout(() => {
+13 -17
View File
@@ -53,6 +53,7 @@ import {
hasAdmdstCdColumn, hasAdmdstCdColumn,
isExcelImportAdmdstCdInvalid, isExcelImportAdmdstCdInvalid,
mergeExcelImportWithExistingRows, mergeExcelImportWithExistingRows,
parseExcelImportCellValue,
prepareGridColumnsForExcelExport, prepareGridColumnsForExcelExport,
releaseFixedOptionsForExcelExport, releaseFixedOptionsForExcelExport,
resolveColumnStyleName, resolveColumnStyleName,
@@ -611,6 +612,11 @@ const TabDataGrid = ({
columnLayout, columnLayout,
{ skipNonEditable: false }, { skipNonEditable: false },
); );
const valueTypeByFieldName = new Map(
columns
.filter((c) => c.fieldName)
.map((c) => [c.fieldName as string, c.valueType]),
);
// 데이터 행 읽기 // 데이터 행 읽기
const dataRows: Record<string, string | number>[] = []; const dataRows: Record<string, string | number>[] = [];
@@ -625,23 +631,13 @@ const TabDataGrid = ({
const cell = worksheet[XLSX.utils.encode_cell({ r: row, c: col })]; const cell = worksheet[XLSX.utils.encode_cell({ r: row, c: col })];
const fieldName = excelColumnFieldNames[colIndex]; const fieldName = excelColumnFieldNames[colIndex];
const allFieldName = excelColumnFieldNamesAll[colIndex]; const allFieldName = excelColumnFieldNamesAll[colIndex];
const typeFieldName = fieldName || allFieldName;
let cellValue: string | number = ''; const cellValue = parseExcelImportCellValue(
if (cell && cell.v !== undefined && cell.v !== null) { cell,
// 엑셀 셀 타입이 숫자이거나 값이 숫자인 경우 숫자로 변환 typeFieldName
if (cell.t === 'n' || (typeof cell.v === 'number' && !isNaN(cell.v))) { ? valueTypeByFieldName.get(typeFieldName)
cellValue = cell.v as number; : undefined,
} else { );
const stringValue = String(cell.v);
// 문자열이지만 숫자로 변환 가능한 경우 숫자로 변환
const numericValue = Number(stringValue.replace(/,/g, ''));
if (!isNaN(numericValue) && stringValue.trim() !== '') {
cellValue = numericValue;
} else {
cellValue = stringValue;
}
}
}
if (allFieldName === 'admdstCd' && cellValue !== '') { if (allFieldName === 'admdstCd' && cellValue !== '') {
rowAdmdstCd = cellValue; rowAdmdstCd = cellValue;
@@ -16,10 +16,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation"; import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation"; import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { statisticsInputExcretaTreatmentFacilityApi } from "@/entities/statistics/api/input/statistics-input-excreta-treatment-facility-service"; import { statisticsInputExcretaTreatmentFacilityApi } from "@/entities/statistics/api/input/statistics-input-excreta-treatment-facility-service";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import { import {
EXCRETA_TREATMENT_FACILITY_STATS_CD, EXCRETA_TREATMENT_FACILITY_STATS_CD,
type ExcretaTreatmentFacilityItem, type ExcretaTreatmentFacilityItem,
@@ -75,7 +77,11 @@ import { toGridRows } from "@/components/util/grid/gridFunction";
import { formatCompactYmdForGrid, toCompactYmdOrNull } from "@/components/util/grid/ymdFormat"; import { formatCompactYmdForGrid, toCompactYmdOrNull } from "@/components/util/grid/ymdFormat";
import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport"; import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport";
import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag"; import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -139,8 +145,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -207,7 +212,7 @@ function mapExcretaTreatmentFacilityListToGridRows(
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (item.verificationResult) { if (item.verificationResult) {
row.verificationResult = item.verificationResult; row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
} }
return row; return row;
}); });
@@ -439,7 +444,11 @@ const ExcretaTreatmentFacilityInp = () => {
return { ...col, editable: false as const }; return { ...col, editable: false as const };
} }
if (col.fieldName === "sggNm" && enterable) { if (col.fieldName === "sggNm" && enterable) {
return buildSggNmColumn(col, true, sggOptions); return buildSggNmColumn(
col,
true,
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
);
} }
return col; return col;
}) })
@@ -452,7 +461,7 @@ const ExcretaTreatmentFacilityInp = () => {
columns, columns,
columnLayout: ExcretaTreatFactInpColumn.columnLayout ?? [], columnLayout: ExcretaTreatFactInpColumn.columnLayout ?? [],
}; };
}, [statusInfo, inputPeriodEnterable, isAdminInfo, sggOptions, columnGuidesByEngCol]); }, [statusInfo, inputPeriodEnterable, isAdminInfo, sggOptions, lastSearchedValues?.gugun, columnGuidesByEngCol]);
const canEditGrid = const canEditGrid =
(computeTabEnterable(statusInfo, inputPeriodEnterable) || isAdminInfo) && inputPeriodEnterable; (computeTabEnterable(statusInfo, inputPeriodEnterable) || isAdminInfo) && inputPeriodEnterable;
@@ -502,7 +511,9 @@ const ExcretaTreatmentFacilityInp = () => {
setStatusInfo(nextStatusInfo); setStatusInfo(nextStatusInfo);
setStatsCd(commonInfo.statsCd); setStatsCd(commonInfo.statsCd);
setIsVerificationFailed(isVerificationFailedFromCommonInfo(commonInfo)); setIsVerificationFailed(isVerificationFailedFromCommonInfo(commonInfo));
setFooterVerificationResult(commonInfo.verificationResult ?? null); setFooterVerificationResult(
normalizeVerificationResultMap(commonInfo.verificationResult) ?? null,
);
if (overrides?.mode !== "PRE") { if (overrides?.mode !== "PRE") {
setIsNotApplicable(gridRows.length === 0); setIsNotApplicable(gridRows.length === 0);
} else if (gridRows.length > 0) { } else if (gridRows.length > 0) {
@@ -813,7 +824,13 @@ const ExcretaTreatmentFacilityInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForSubmit,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: statusInfo?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -952,19 +969,7 @@ const ExcretaTreatmentFacilityInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 -";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1043,7 +1048,7 @@ const ExcretaTreatmentFacilityInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{statusInfo?.lclgvSbmsnSttsCd === "2" && submitOk && ( {statusInfo?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -9,6 +9,7 @@ import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { statisticsInputPrivateSewageFacilityApi } from "@/entities/statistics/api/input/statistics-input-private-sewage-facility-service"; import { statisticsInputPrivateSewageFacilityApi } from "@/entities/statistics/api/input/statistics-input-private-sewage-facility-service";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import type { import type {
PrivateSewageDesigStatusItem, PrivateSewageDesigStatusItem,
PrivateSewageDesigStatusSaveItem, PrivateSewageDesigStatusSaveItem,
@@ -68,7 +69,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -156,8 +161,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -175,7 +179,9 @@ function mapRegionalListToGridRows<
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => { return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
const { verificationResult, ...rest } = item; const { verificationResult, ...rest } = item;
const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification; const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -888,7 +894,13 @@ const PrivateSewageFacilityInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1144,18 +1156,7 @@ const PrivateSewageFacilityInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 - ";
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1198,7 +1199,7 @@ const PrivateSewageFacilityInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -8,6 +8,7 @@ import { useStatisticsInputPendingNavigation } from '@/shared/lib/use-statistics
import { statisticsInputSewSupplyRateApi } from '@/entities/statistics/api/input/statistics-input-sew-supply-rate-service'; import { statisticsInputSewSupplyRateApi } from '@/entities/statistics/api/input/statistics-input-sew-supply-rate-service';
import { statisticsInputPublicSewageFacilityApiService } from '@/entities/statistics/api/input/statistics-public-sewage-facility-input-service'; import { statisticsInputPublicSewageFacilityApiService } from '@/entities/statistics/api/input/statistics-public-sewage-facility-input-service';
import { statisticsApi } from '@/entities/statistics/api/statistics-service'; import { statisticsApi } from '@/entities/statistics/api/statistics-service';
import { callImrServiceWithRollbackOnFailure } from '@/components/util/input/call-imr-with-rollback';
import type { import type {
PublicSewageFacilityRequestParams, PublicSewageFacilityRequestParams,
PublicSewageFacilitySaveItem, PublicSewageFacilitySaveItem,
@@ -52,7 +53,11 @@ import { fetchColumnGuidesRecord } from '@/components/util/grid/columnGuides';
import { toGridRows } from '@/components/util/grid/gridFunction'; import { toGridRows } from '@/components/util/grid/gridFunction';
import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport"; import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport";
import { patchFooterVerificationByTab,patchVerificationFailedByTab } from '@/components/util/input/verification-failed-flag'; import { patchFooterVerificationByTab,patchVerificationFailedByTab } from '@/components/util/input/verification-failed-flag';
import type { VerificationResultLikeMap } from '@/components/util/input/verification-result-display'; import {
formatVerificationTooltip,
withNormalizedVerificationResult,
type VerificationResultLikeMap,
} from '@/components/util/input/verification-result-display';
import { nullableTrimmedString } from '@/components/util/input/nullableString'; import { nullableTrimmedString } from '@/components/util/input/nullableString';
import { useAdminStore } from '@/store/admin-store'; import { useAdminStore } from '@/store/admin-store';
import { useTabStore } from '@/store/tab-store'; import { useTabStore } from '@/store/tab-store';
@@ -116,8 +121,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -438,7 +442,13 @@ const PublicSewageFacilityInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? '',
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? '',
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? '',
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -789,11 +799,13 @@ const PublicSewageFacilityInp = () => {
sidoListRef.current, sidoListRef.current,
searchContext, searchContext,
); );
const convertedData = list.map((item) => ({ const convertedData = list.map((item) =>
ctpvNm: commonInfo.ctpvNm, withNormalizedVerificationResult({
...item, ctpvNm: commonInfo.ctpvNm,
rmrk: item.rmrk ?? null, ...item,
})); rmrk: item.rmrk ?? null,
}),
);
if (list.length === 0) { if (list.length === 0) {
setShowIsNotApplicable(true); setShowIsNotApplicable(true);
@@ -1323,7 +1335,7 @@ const PublicSewageFacilityInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{!isMainFacilityTab && activeTabStatus?.lclgvSbmsnSttsCd === '2' && submitOk && ( {!isMainFacilityTab && activeTabStatus?.lclgvSbmsnSttsCd === '2' && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -1575,17 +1587,7 @@ const PublicSewageFacilityInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR" ? "시계열 검증 - " : (e.vrfcCd === "NV" ? "일반검증 - " : "모집단 검증 - ");
const comp = e.cmprCn ?? "";
const now = e.nowCn ?? "";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${comp} / 현재 입력값: ${now})`;
})
.filter(Boolean)
.join("\n");
} }
}} }}
/> />
@@ -16,10 +16,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation"; import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation"; import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { statisticsInputPumpingStationApi } from "@/entities/statistics/api/input/statistics-input-pumping-station-service"; import { statisticsInputPumpingStationApi } from "@/entities/statistics/api/input/statistics-input-pumping-station-service";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import { import {
PUMPING_STATION_STATS_CD, PUMPING_STATION_STATS_CD,
type PumpingStationItem, type PumpingStationItem,
@@ -75,7 +77,11 @@ import { toGridRows } from "@/components/util/grid/gridFunction";
import { formatCompactYmdForGrid, toCompactYmdOrNull } from "@/components/util/grid/ymdFormat"; import { formatCompactYmdForGrid, toCompactYmdOrNull } from "@/components/util/grid/ymdFormat";
import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport"; import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport";
import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag"; import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -139,8 +145,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -206,7 +211,7 @@ function mapPumpingStationListToGridRows(
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (item.verificationResult) { if (item.verificationResult) {
row.verificationResult = item.verificationResult; row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
} }
return row; return row;
}); });
@@ -433,7 +438,11 @@ const PumpingStationInp = () => {
return { ...col, editable: false as const }; return { ...col, editable: false as const };
} }
if (col.fieldName === "sggNm" && enterable) { if (col.fieldName === "sggNm" && enterable) {
return buildSggNmColumn(col, true, sggOptions); return buildSggNmColumn(
col,
true,
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
);
} }
return col; return col;
}) })
@@ -446,7 +455,7 @@ const PumpingStationInp = () => {
columns, columns,
columnLayout: PumpingStationInpColumn.columnLayout ?? [], columnLayout: PumpingStationInpColumn.columnLayout ?? [],
}; };
}, [statusInfo, inputPeriodEnterable, isAdminInfo, sggOptions, columnGuidesByEngCol]); }, [statusInfo, inputPeriodEnterable, isAdminInfo, sggOptions, lastSearchedValues?.gugun, columnGuidesByEngCol]);
const canEditGrid = const canEditGrid =
(computeTabEnterable(statusInfo, inputPeriodEnterable) || isAdminInfo) && inputPeriodEnterable; (computeTabEnterable(statusInfo, inputPeriodEnterable) || isAdminInfo) && inputPeriodEnterable;
@@ -493,7 +502,9 @@ const PumpingStationInp = () => {
setStatusInfo(nextStatusInfo); setStatusInfo(nextStatusInfo);
setStatsCd(commonInfo.statsCd); setStatsCd(commonInfo.statsCd);
setIsVerificationFailed(isVerificationFailedFromCommonInfo(commonInfo)); setIsVerificationFailed(isVerificationFailedFromCommonInfo(commonInfo));
setFooterVerificationResult(commonInfo.verificationResult ?? null); setFooterVerificationResult(
normalizeVerificationResultMap(commonInfo.verificationResult) ?? null,
);
if (overrides?.mode !== "PRE") { if (overrides?.mode !== "PRE") {
setIsNotApplicable(gridRows.length === 0); setIsNotApplicable(gridRows.length === 0);
} else if (gridRows.length > 0) { } else if (gridRows.length > 0) {
@@ -796,7 +807,13 @@ const PumpingStationInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForSubmit,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: statusInfo?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -935,19 +952,7 @@ const PumpingStationInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 -";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1026,7 +1031,7 @@ const PumpingStationInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{statusInfo?.lclgvSbmsnSttsCd === "2" && submitOk && ( {statusInfo?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -5,14 +5,16 @@ import { useConfirm } from "@frontend-opensource/use-react-hooks";
import { ValueType } from "realgrid"; import { ValueType } from "realgrid";
import type { RealGridReact } from "realgrid-react"; import type { RealGridReact } from "realgrid-react";
import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGate, useSearchConditionSidoList } from "@/shared/lib"; import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGate, useSearchConditionSidoList, useUserStore } from "@/shared/lib";
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation"; import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation"; import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputSewageExcretaRelatedApi } from "@/entities/statistics/api/input/statistics-input-sewage-excreta-related-service"; import { statisticsInputSewageExcretaRelatedApi } from "@/entities/statistics/api/input/statistics-input-sewage-excreta-related-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import type { import type {
ExcretaRelatedIndustrySaveItem, ExcretaRelatedIndustrySaveItem,
PrivateSewageTreatRelatedIndustrySaveItem, PrivateSewageTreatRelatedIndustrySaveItem,
@@ -40,7 +42,10 @@ import type {
import { import {
filterBySelectedAdmdstCd, filterBySelectedAdmdstCd,
isGugunOkForToolbar, isGugunOkForToolbar,
isJeonnamGwangjuSidoAllSearch,
isJeonnamGwangjuSidoAllToolbarException,
isSubmitOkForToolbar, isSubmitOkForToolbar,
JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE,
resolveNoApplicableForRequest, resolveNoApplicableForRequest,
toInputSearchRegion, toInputSearchRegion,
} from "@/entities/statistics"; } from "@/entities/statistics";
@@ -84,7 +89,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -168,12 +177,43 @@ const computeTabEnterable = (
}; };
const sidoListRef: { current: Sido[] } = { current: [] }; const sidoListRef: { current: Sido[] } = { current: [] };
const relatedToolbarUserIdRef: { current: string } = { current: "" };
function buildGugunOkForToolbar(values: SearchFormValues | null): boolean { function isJeonnamGwangjuSidoAllToolbarTab(tabKey: string | null | undefined): boolean {
return Boolean(tabKey && ARTICLE_EDIT_TAB_KEYS.has(tabKey));
}
function buildGugunOkForToolbar(
values: SearchFormValues | null,
tabKey?: string | null,
): boolean {
if (
isJeonnamGwangjuSidoAllToolbarTab(tabKey) &&
isJeonnamGwangjuSidoAllToolbarException(
sidoListRef.current,
values,
relatedToolbarUserIdRef.current,
)
) {
return true;
}
return isGugunOkForToolbar(sidoListRef.current, values); return isGugunOkForToolbar(sidoListRef.current, values);
} }
function buildSubmitOkForToolbar(values: SearchFormValues | null): boolean { function buildSubmitOkForToolbar(
values: SearchFormValues | null,
tabKey?: string | null,
): boolean {
if (
isJeonnamGwangjuSidoAllToolbarTab(tabKey) &&
isJeonnamGwangjuSidoAllToolbarException(
sidoListRef.current,
values,
relatedToolbarUserIdRef.current,
)
) {
return true;
}
return isSubmitOkForToolbar(sidoListRef.current, values); return isSubmitOkForToolbar(sidoListRef.current, values);
} }
@@ -192,8 +232,9 @@ function computeTabToolbarSnapshot(
searchContext: SearchFormValues | null, searchContext: SearchFormValues | null,
periodEnterable: boolean, periodEnterable: boolean,
isAdminInfo: boolean, isAdminInfo: boolean,
tabKey?: string | null,
): TabToolbarSnapshot { ): TabToolbarSnapshot {
const gugunOk = buildGugunOkForToolbar(searchContext); const gugunOk = buildGugunOkForToolbar(searchContext, tabKey);
const enterable = computeTabEnterable(statusInfo, periodEnterable); const enterable = computeTabEnterable(statusInfo, periodEnterable);
const isSubmitted = statusInfo?.lclgvSbmsnSttsCd === "2"; const isSubmitted = statusInfo?.lclgvSbmsnSttsCd === "2";
const showSaveInToolbar = (enterable || isAdminInfo) && periodEnterable && gugunOk; const showSaveInToolbar = (enterable || isAdminInfo) && periodEnterable && gugunOk;
@@ -203,8 +244,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -552,19 +592,7 @@ function verificationCellTooltip({
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 - ";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
} }
@@ -588,7 +616,7 @@ function mapListToGridRows<T extends { verificationResult?: SewageExcretaRelated
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => { return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
const row = toGridRows([{ ctpvNm, ...item }])[0] as GridRowWithVerification; const row = toGridRows([{ ctpvNm, ...item }])[0] as GridRowWithVerification;
if (item.verificationResult) { if (item.verificationResult) {
row.verificationResult = item.verificationResult; row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
} }
return row; return row;
}); });
@@ -623,6 +651,8 @@ async function waitForImrJobCompleted(
const SewageExcretaRelatedInp = () => { const SewageExcretaRelatedInp = () => {
const { sidoList } = useSearchConditionSidoList({ isInput: true }); const { sidoList } = useSearchConditionSidoList({ isInput: true });
sidoListRef.current = sidoList; sidoListRef.current = sidoList;
const userId = useUserStore((state) => state.userInfo?.userId ?? "");
relatedToolbarUserIdRef.current = userId;
const { setMessage: alert } = useAlertStore((state) => state); const { setMessage: alert } = useAlertStore((state) => state);
const { confirm } = useConfirm(); const { confirm } = useConfirm();
const isAdminInfo = useAdminStore((state) => state.isAdminInfo); const isAdminInfo = useAdminStore((state) => state.isAdminInfo);
@@ -686,6 +716,8 @@ const SewageExcretaRelatedInp = () => {
/** ST00120001·ST00120002 — 전년도(PRE) 조회로 로드된 ognzSn */ /** ST00120001·ST00120002 — 전년도(PRE) 조회로 로드된 ognzSn */
const preYearArticleOgnzSnByTabRef = useRef<Map<string, ArticleOgnzSnSet>>(new Map()); const preYearArticleOgnzSnByTabRef = useRef<Map<string, ArticleOgnzSnSet>>(new Map());
const sggOptionsSidoRef = useRef<string | null>(null); const sggOptionsSidoRef = useRef<string | null>(null);
const sggHeadOptionsRef = useRef<Sgg[]>([]);
const sggHeadOptionsSidoRef = useRef<string | null>(null);
activeTabRef.current = activeTab; activeTabRef.current = activeTab;
const activeTabId = useTabStore((s) => s.activeTabId); const activeTabId = useTabStore((s) => s.activeTabId);
@@ -754,6 +786,22 @@ const SewageExcretaRelatedInp = () => {
} }
}, []); }, []);
const loadSggHeadOptions = useCallback(async (sido: string): Promise<Sgg[]> => {
if (!sido || sido === "ALL") {
sggHeadOptionsRef.current = [];
return [];
}
try {
const res = await statisticsApi.getSggAllHeadList(sido);
const list = parseSggListFromResponse(res);
sggHeadOptionsRef.current = list;
return list;
} catch {
sggHeadOptionsRef.current = [];
return [];
}
}, []);
const commitToolbarSnapshotForLoadedTab = ( const commitToolbarSnapshotForLoadedTab = (
tabKey: string, tabKey: string,
statusInfo: SewerageStatusInfo | null, statusInfo: SewerageStatusInfo | null,
@@ -771,6 +819,7 @@ const SewageExcretaRelatedInp = () => {
searchContext, searchContext,
periodEnterableRef.current, periodEnterableRef.current,
isAdminInfo, isAdminInfo,
tabKey,
), ),
); );
return next; return next;
@@ -1078,6 +1127,8 @@ const SewageExcretaRelatedInp = () => {
); );
setSggOptions([]); setSggOptions([]);
sggOptionsSidoRef.current = null; sggOptionsSidoRef.current = null;
sggHeadOptionsRef.current = [];
sggHeadOptionsSidoRef.current = null;
setVerificationHistoryOpen(false); setVerificationHistoryOpen(false);
}; };
@@ -1273,7 +1324,7 @@ const SewageExcretaRelatedInp = () => {
alert("먼저 조회를 진행해주세요."); alert("먼저 조회를 진행해주세요.");
return; return;
} }
if (!buildGugunOkForToolbar(lastSearchedValues)) { if (!buildGugunOkForToolbar(lastSearchedValues, tabKey)) {
alert("시군구를 선택해주세요."); alert("시군구를 선택해주세요.");
return; return;
} }
@@ -1282,7 +1333,7 @@ const SewageExcretaRelatedInp = () => {
const noApplicable = buildNoApplicableForRequest(searchContextByTab.get(tabKey) ?? lastSearchedValues, isNotApplicableByTab.get(tabKey) ?? false, getTabGridRows(tabKey).length === 0); const noApplicable = buildNoApplicableForRequest(searchContextByTab.get(tabKey) ?? lastSearchedValues, isNotApplicableByTab.get(tabKey) ?? false, getTabGridRows(tabKey).length === 0);
const currentData = getTabGridRows(tabKey); const currentData = getTabGridRows(tabKey);
if (NOT_APPLICABLE_TAB_KEYS.has(tabKey)) { if (NOT_APPLICABLE_TAB_KEYS.has(tabKey)) {
if (!noApplicable && currentData.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) { if (!noApplicable && currentData.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues, tabKey)) {
alert("해당사항 없음을 체크해주세요."); alert("해당사항 없음을 체크해주세요.");
return; return;
} }
@@ -1291,7 +1342,12 @@ const SewageExcretaRelatedInp = () => {
return; return;
} }
if (await confirm("제출 하시겠습니까?")) { const submitConfirmMessage =
ARTICLE_EDIT_TAB_KEYS.has(tabKey) &&
isJeonnamGwangjuSidoAllSearch(sidoListRef.current, lastSearchedValues)
? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE
: "제출 하시겠습니까?";
if (await confirm(submitConfirmMessage)) {
setShowSubmitDialog(true); setShowSubmitDialog(true);
} }
})(); })();
@@ -1307,7 +1363,7 @@ const SewageExcretaRelatedInp = () => {
alert("먼저 조회를 진행해주세요."); alert("먼저 조회를 진행해주세요.");
return; return;
} }
if (!buildGugunOkForToolbar(lastSearchedValues)) { if (!buildGugunOkForToolbar(lastSearchedValues, tabKey)) {
alert("시군구를 선택해주세요."); alert("시군구를 선택해주세요.");
return; return;
} }
@@ -1387,7 +1443,7 @@ const SewageExcretaRelatedInp = () => {
) )
.map((row) => buildPublicInstitutionIndustrySaveItem(row, list)); .map((row) => buildPublicInstitutionIndustrySaveItem(row, list));
if (!noApplicable && submitList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) { if (!noApplicable && submitList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues, tabKey)) {
alert("해당사항 없음을 체크해주세요."); alert("해당사항 없음을 체크해주세요.");
return; return;
} }
@@ -1503,7 +1559,13 @@ const SewageExcretaRelatedInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1559,7 +1621,7 @@ const SewageExcretaRelatedInp = () => {
alert("먼저 조회를 진행해주세요."); alert("먼저 조회를 진행해주세요.");
return; return;
} }
if (!buildGugunOkForToolbar(lastSearchedValues)) { if (!buildGugunOkForToolbar(lastSearchedValues, tabKey)) {
alert("시군구를 선택해주세요."); alert("시군구를 선택해주세요.");
return; return;
} }
@@ -1567,7 +1629,12 @@ const SewageExcretaRelatedInp = () => {
alert("해당 탭은 저장 기능이 준비되지 않았습니다."); alert("해당 탭은 저장 기능이 준비되지 않았습니다.");
return; return;
} }
if (!(await confirm("저장 하시겠습니까?"))) return; const saveConfirmMessage =
ARTICLE_EDIT_TAB_KEYS.has(tabKey) &&
isJeonnamGwangjuSidoAllSearch(sidoListRef.current, lastSearchedValues)
? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE
: "저장 하시겠습니까?";
if (!(await confirm(saveConfirmMessage))) return;
commitActiveGrid(); commitActiveGrid();
@@ -1663,7 +1730,7 @@ const SewageExcretaRelatedInp = () => {
) )
.map((row) => buildPublicInstitutionIndustrySaveItem(row, list)); .map((row) => buildPublicInstitutionIndustrySaveItem(row, list));
if (!noApplicable && saveList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) { if (!noApplicable && saveList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues, tabKey)) {
alert("해당사항 없음을 체크해주세요."); alert("해당사항 없음을 체크해주세요.");
return; return;
} }
@@ -1726,21 +1793,20 @@ const SewageExcretaRelatedInp = () => {
alert("먼저 조회를 진행해주세요."); alert("먼저 조회를 진행해주세요.");
return; return;
} }
if (!buildGugunOkForToolbar(ctx)) { const tabKey = activeTabRef.current;
if (!buildGugunOkForToolbar(ctx, tabKey)) {
alert("시군구를 선택해주세요."); alert("시군구를 선택해주세요.");
return; return;
} }
const tabKey = activeTabRef.current;
if (!ARTICLE_EDIT_TAB_KEYS.has(tabKey)) { if (!ARTICLE_EDIT_TAB_KEYS.has(tabKey)) {
alert("항목을 추가할 수 없는 탭입니다."); alert("항목을 추가할 수 없는 탭입니다.");
return; return;
} }
let list = sggOptions; let list = sggHeadOptionsRef.current;
if (sggOptionsSidoRef.current !== ctx.sido || list.length === 0) { if (sggHeadOptionsSidoRef.current !== ctx.sido || list.length === 0) {
list = await loadSggOptions(ctx.sido); list = await loadSggHeadOptions(ctx.sido);
sggOptionsSidoRef.current = ctx.sido; sggHeadOptionsSidoRef.current = ctx.sido;
} }
if (list.length === 0) { if (list.length === 0) {
alert("시군구 목록을 불러오지 못했습니다."); alert("시군구 목록을 불러오지 못했습니다.");
@@ -1808,7 +1874,7 @@ const SewageExcretaRelatedInp = () => {
alert("먼저 조회를 진행해주세요."); alert("먼저 조회를 진행해주세요.");
return; return;
} }
if (!buildGugunOkForToolbar(ctx)) { if (!buildGugunOkForToolbar(ctx, tabKey)) {
alert("시군구를 선택해주세요."); alert("시군구를 선택해주세요.");
return; return;
} }
@@ -1888,7 +1954,11 @@ const SewageExcretaRelatedInp = () => {
SGG_NM_DROPDOWN_TAB_KEYS.has(tabKey) && SGG_NM_DROPDOWN_TAB_KEYS.has(tabKey) &&
col.fieldName === "sggNm" col.fieldName === "sggNm"
) { ) {
next = buildSggNmColumn(col, canEdit, sggOptions); next = buildSggNmColumn(
col,
canEdit,
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
);
} else if (col.fieldName === "sggNm") { } else if (col.fieldName === "sggNm") {
next = { ...col, editable: false as const, styleName: "rg-cell-readonly" }; next = { ...col, editable: false as const, styleName: "rg-cell-readonly" };
} }
@@ -1901,7 +1971,7 @@ const SewageExcretaRelatedInp = () => {
}); });
} }
return map; return map;
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab, sggOptions]); }, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab, sggOptions, lastSearchedValues?.gugun]);
const publicInstitutionArticleCellStyleCallback = useCallback<CellStyleCallback>( const publicInstitutionArticleCellStyleCallback = useCallback<CellStyleCallback>(
({ fieldName, row }) => { ({ fieldName, row }) => {
@@ -1938,6 +2008,7 @@ const SewageExcretaRelatedInp = () => {
searchContextForToolbar, searchContextForToolbar,
inputPeriodEnterable, inputPeriodEnterable,
isAdminInfo, isAdminInfo,
activeTab,
); );
const showSaveInToolbar = activeTabToolbar.showSaveInToolbar && toolbarGroupAllowed; const showSaveInToolbar = activeTabToolbar.showSaveInToolbar && toolbarGroupAllowed;
@@ -1948,8 +2019,8 @@ const SewageExcretaRelatedInp = () => {
(activeTabToolbar.showActionToolbarCard || (hasSearched && loadedTabKeys.has(activeTab))); (activeTabToolbar.showActionToolbarCard || (hasSearched && loadedTabKeys.has(activeTab)));
const showArticleEditButtons = const showArticleEditButtons =
ARTICLE_EDIT_TAB_KEYS.has(activeTab) && showEnterableToolbarButtons; ARTICLE_EDIT_TAB_KEYS.has(activeTab) && showEnterableToolbarButtons;
const gugunOk = buildGugunOkForToolbar(searchContextForToolbar); const gugunOk = buildGugunOkForToolbar(searchContextForToolbar, activeTab);
const submitOk = buildSubmitOkForToolbar(searchContextForToolbar); const submitOk = buildSubmitOkForToolbar(searchContextForToolbar, activeTab);
const showNotApplicableForActiveTab = const showNotApplicableForActiveTab =
NOT_APPLICABLE_TAB_KEYS.has(activeTab) && NOT_APPLICABLE_TAB_KEYS.has(activeTab) &&
loadedTabKeys.has(activeTab) && loadedTabKeys.has(activeTab) &&
@@ -2024,7 +2095,7 @@ const SewageExcretaRelatedInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -17,10 +17,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation"; import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation"; import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputSewageExcretaSlurgeApi } from "@/entities/statistics/api/input/statistics-input-sewage-excreta-slurge-service"; import { statisticsInputSewageExcretaSlurgeApi } from "@/entities/statistics/api/input/statistics-input-sewage-excreta-slurge-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import type { import type {
DigestorOperatingStatusSaveItem, DigestorOperatingStatusSaveItem,
ExcretaSlurgeProcessingStatusSaveItem, ExcretaSlurgeProcessingStatusSaveItem,
@@ -59,6 +61,7 @@ import LastYearDataButton from "@/components/button/LastYearDataButton";
import NotApplicableCheckButton from "@/components/button/NotApplicableCheckButton"; import NotApplicableCheckButton from "@/components/button/NotApplicableCheckButton";
import SaveButton from "@/components/button/SaveButton"; import SaveButton from "@/components/button/SaveButton";
import SubmitButton from "@/components/button/SumitButton"; import SubmitButton from "@/components/button/SumitButton";
import UpdateOperateDataButton from "@/components/button/UpdateOperateDataButton";
import VerificationResultButton from "@/components/button/VerificationResultButton"; import VerificationResultButton from "@/components/button/VerificationResultButton";
import DataGrid from "@/components/module/DataGrid"; import DataGrid from "@/components/module/DataGrid";
import { openVerificationResultDialogIfNeeded } from "@/components/module/post-submit-verification-results"; import { openVerificationResultDialogIfNeeded } from "@/components/module/post-submit-verification-results";
@@ -90,7 +93,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -148,19 +155,7 @@ function verificationCellTooltip({
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 - ";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
} }
@@ -185,16 +180,16 @@ function mapListToGridRows<T extends { verificationResult?: SewageExcretaSlurgeV
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => { return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
const row = toGridRows([{ ctpvNm, ...item }])[0] as GridRowWithVerification; const row = toGridRows([{ ctpvNm, ...item }])[0] as GridRowWithVerification;
if (item.verificationResult) { if (item.verificationResult) {
row.verificationResult = item.verificationResult; row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
} }
return row; return row;
}); });
} }
const SewageExcretaSlurgeInpTabList = [ const SewageExcretaSlurgeInpTabList = [
SlurgeProcessingFacStatusInpColumn, SlurgeProcessingFacStatusInpColumn,
DigestorOperatingStatusInpColumn, DigestorOperatingStatusInpColumn,
SewageSlurgeProcessingFacStatusInpColumn, SewageSlurgeProcessingFacStatusInpColumn,
ExcretaSlurgeProcessingStatusInpColumn, ExcretaSlurgeProcessingStatusInpColumn,
] as const; ] as const;
@@ -389,8 +384,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -627,7 +621,6 @@ function buildExcretaSlurgeProcessingStatusSaveItem(
rcycQnt: toGridNumber(row.rcycQnt), rcycQnt: toGridNumber(row.rcycQnt),
olandLfvlm: toGridNumber(row.olandLfvlm), olandLfvlm: toGridNumber(row.olandLfvlm),
incnrQnt: toGridNumber(row.incnrQnt), incnrQnt: toGridNumber(row.incnrQnt),
oceanInputQnt: toGridNumber(row.oceanInputQnt),
fuelQnt: toGridNumber(row.fuelQnt), fuelQnt: toGridNumber(row.fuelQnt),
etcQnt: toGridNumber(row.etcQnt), etcQnt: toGridNumber(row.etcQnt),
unprcsQnt: toGridNumber(row.unprcsQnt), unprcsQnt: toGridNumber(row.unprcsQnt),
@@ -1349,18 +1342,18 @@ const SewageExcretaSlurgeInp = () => {
noApplicable || !isSewageSlurgeFacTab noApplicable || !isSewageSlurgeFacTab
? [] ? []
: rowsForSubmit.map((row) => : rowsForSubmit.map((row) =>
buildSewageSlurgeProcessingFacStatusSaveItem(row, list), buildSewageSlurgeProcessingFacStatusSaveItem(row, list),
); );
const excretaSlurgeSubmitList = const excretaSlurgeSubmitList =
noApplicable || !isExcretaSlurgeTab noApplicable || !isExcretaSlurgeTab
? [] ? []
: rowsForSubmit.map((row) => : rowsForSubmit.map((row) =>
buildExcretaSlurgeProcessingStatusSaveItem(row, list), buildExcretaSlurgeProcessingStatusSaveItem(row, list),
); );
const sewageSlurgeFacDeleteList = isSewageSlurgeFacTab const sewageSlurgeFacDeleteList = isSewageSlurgeFacTab
? (deleteListByTab.get(tabKey) ?? []) ? (deleteListByTab.get(tabKey) ?? [])
.filter((row) => isPersistedArticleRowForTab(tabKey, row)) .filter((row) => isPersistedArticleRowForTab(tabKey, row))
.map((row) => buildSewageSlurgeProcessingFacStatusSaveItem(row, list)) .map((row) => buildSewageSlurgeProcessingFacStatusSaveItem(row, list))
: []; : [];
if ( if (
@@ -1381,10 +1374,10 @@ const SewageExcretaSlurgeInp = () => {
(isDigestorTab (isDigestorTab
? SEWAGE_EXCRETA_DIGESTOR_OPERATING_STATS_CD ? SEWAGE_EXCRETA_DIGESTOR_OPERATING_STATS_CD
: isSewageSlurgeFacTab : isSewageSlurgeFacTab
? SEWAGE_EXCRETA_SEWAGE_SLURGE_FAC_STATUS_STATS_CD ? SEWAGE_EXCRETA_SEWAGE_SLURGE_FAC_STATUS_STATS_CD
: isExcretaSlurgeTab : isExcretaSlurgeTab
? SEWAGE_EXCRETA_EXCRETA_SLURGE_PROCESSING_STATS_CD ? SEWAGE_EXCRETA_EXCRETA_SLURGE_PROCESSING_STATS_CD
: SEWAGE_EXCRETA_SLURGE_PROCESSING_FAC_STATUS_STATS_CD); : SEWAGE_EXCRETA_SLURGE_PROCESSING_FAC_STATUS_STATS_CD);
const verificationQuery = { const verificationQuery = {
...toInputSearchRegion(sidoListRef.current, lastSearchedValues), ...toInputSearchRegion(sidoListRef.current, lastSearchedValues),
@@ -1436,32 +1429,32 @@ const SewageExcretaSlurgeInp = () => {
setGlobalProgressLabel("일반 검증 진행 중..."); setGlobalProgressLabel("일반 검증 진행 중...");
const response = isSlurgeFacTab const response = isSlurgeFacTab
? await statisticsInputSewageExcretaSlurgeApi.submitSlurgeProcessingFacStatus({ ? await statisticsInputSewageExcretaSlurgeApi.submitSlurgeProcessingFacStatus({
...submitRequestBase, ...submitRequestBase,
userUuid: userInfo.userUnqId, userUuid: userInfo.userUnqId,
submitList: slurgeSubmitList, submitList: slurgeSubmitList,
}) })
: isDigestorTab : isDigestorTab
? await statisticsInputSewageExcretaSlurgeApi.submitDigestorOperatingStatus({ ? await statisticsInputSewageExcretaSlurgeApi.submitDigestorOperatingStatus({
...submitRequestBase, ...submitRequestBase,
userUuid: userInfo.userUnqId, userUuid: userInfo.userUnqId,
submitList: digestorSubmitList, submitList: digestorSubmitList,
}) })
: isSewageSlurgeFacTab : isSewageSlurgeFacTab
? await statisticsInputSewageExcretaSlurgeApi.submitSewageSlurgeProcessingFacStatus( ? await statisticsInputSewageExcretaSlurgeApi.submitSewageSlurgeProcessingFacStatus(
{ {
...submitRequestBase, ...submitRequestBase,
userUuid: userInfo.userUnqId, userUuid: userInfo.userUnqId,
submitList: sewageSlurgeFacSubmitList, submitList: sewageSlurgeFacSubmitList,
deleteList: sewageSlurgeFacDeleteList, deleteList: sewageSlurgeFacDeleteList,
}, },
) )
: await statisticsInputSewageExcretaSlurgeApi.submitExcretaSlurgeProcessingStatus( : await statisticsInputSewageExcretaSlurgeApi.submitExcretaSlurgeProcessingStatus(
{ {
...submitRequestBase, ...submitRequestBase,
userUuid: userInfo.userUnqId, userUuid: userInfo.userUnqId,
submitList: excretaSlurgeSubmitList, submitList: excretaSlurgeSubmitList,
}, },
); );
if (response.status !== "success") { if (response.status !== "success") {
alert(response.message ?? "데이터 제출 중 오류가 발생했습니다."); alert(response.message ?? "데이터 제출 중 오류가 발생했습니다.");
@@ -1486,7 +1479,13 @@ const SewageExcretaSlurgeInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForSubmit,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1535,6 +1534,61 @@ const SewageExcretaSlurgeInp = () => {
} }
}; };
const updateOperateDataButtonFunc = () => {
void (async () => {
if (!lastSearchedValues) {
alert("먼저 조회를 진행해주세요.");
return;
}
if (!(await confirm("자체발생량·함수율·자체 1차 처리량이 운영 데이터로 덮어씁니다."))) {
return;
}
try {
showGlobalProgress({ label: "운영 데이터 업데이트 중...", progress: 0 });
const userInfo = await getUserInfo();
const request = {
statsYr: lastSearchedValues.year ?? "",
ctpvNm: lastSearchedValues.sido ?? "",
...toInputSearchRegion(sidoListRef.current, lastSearchedValues),
userUuid: userInfo.userUnqId,
};
const response =
await statisticsInputSewageExcretaSlurgeApi.updateSlurgeProcessingFacStatusOperationData(
request,
);
if (response.status !== "success") {
alert(
response.message ||
"운영 데이터 업데이트 중 오류가 발생했습니다.",
);
return;
}
setGlobalProgress(50);
const tabKey = SlurgeProcessingFacStatusInpColumn.tabKey;
const param =
searchParamRef.current ??
buildSewageExcretaSlurgeSearchParam(lastSearchedValues);
await loadActiveTabData(tabKey, param, lastSearchedValues, true, false);
setGlobalProgress(100);
alert("운영 데이터가 업데이트되었습니다.");
} catch (error) {
const message =
error &&
typeof error === "object" &&
"response" in error
? (error as { response?: { data?: { message?: string } } })
.response?.data?.message
: undefined;
alert(message || "운영 데이터 업데이트 중 오류가 발생했습니다.");
} finally {
hideGlobalProgress();
}
})();
};
const cnacelSubmitFunc = () => { const cnacelSubmitFunc = () => {
void (async () => { void (async () => {
try { try {
@@ -1646,8 +1700,8 @@ const SewageExcretaSlurgeInp = () => {
const saveList = noApplicable const saveList = noApplicable
? [] ? []
: rowsForSave.map((row) => : rowsForSave.map((row) =>
buildSlurgeProcessingFacStatusSaveItem(row, list), buildSlurgeProcessingFacStatusSaveItem(row, list),
); );
if (!noApplicable && saveList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) { if (!noApplicable && saveList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) {
alert("해당사항 없음을 체크해주세요."); alert("해당사항 없음을 체크해주세요.");
@@ -1672,8 +1726,8 @@ const SewageExcretaSlurgeInp = () => {
const saveList = noApplicable const saveList = noApplicable
? [] ? []
: rowsForSave.map((row) => : rowsForSave.map((row) =>
buildDigestorOperatingStatusSaveItem(row, list), buildDigestorOperatingStatusSaveItem(row, list),
); );
if (!noApplicable && saveList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) { if (!noApplicable && saveList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) {
alert("해당사항 없음을 체크해주세요."); alert("해당사항 없음을 체크해주세요.");
@@ -1695,8 +1749,8 @@ const SewageExcretaSlurgeInp = () => {
const saveList = noApplicable const saveList = noApplicable
? [] ? []
: rowsForSave.map((row) => : rowsForSave.map((row) =>
buildSewageSlurgeProcessingFacStatusSaveItem(row, list), buildSewageSlurgeProcessingFacStatusSaveItem(row, list),
); );
const deleteList = (deleteListByTab.get(tabKey) ?? []) const deleteList = (deleteListByTab.get(tabKey) ?? [])
.filter((row) => isPersistedArticleRowForTab(tabKey, row)) .filter((row) => isPersistedArticleRowForTab(tabKey, row))
.map((row) => buildSewageSlurgeProcessingFacStatusSaveItem(row, list)); .map((row) => buildSewageSlurgeProcessingFacStatusSaveItem(row, list));
@@ -1725,8 +1779,8 @@ const SewageExcretaSlurgeInp = () => {
const saveList = noApplicable const saveList = noApplicable
? [] ? []
: rowsForSave.map((row) => : rowsForSave.map((row) =>
buildExcretaSlurgeProcessingStatusSaveItem(row, list), buildExcretaSlurgeProcessingStatusSaveItem(row, list),
); );
if (!noApplicable && saveList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) { if (!noApplicable && saveList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) {
alert("해당사항 없음을 체크해주세요."); alert("해당사항 없음을 체크해주세요.");
@@ -1778,17 +1832,17 @@ const SewageExcretaSlurgeInp = () => {
const getCheckedItemIndexesFromGrid = (rowCount: number): number[] => { const getCheckedItemIndexesFromGrid = (rowCount: number): number[] => {
const gridView = getGridRef.current?.gridView as const gridView = getGridRef.current?.gridView as
| { | {
getCheckedItems?: () => number[]; getCheckedItems?: () => number[];
getCheckedRows?: () => number[]; getCheckedRows?: () => number[];
} }
| undefined; | undefined;
const checked = const checked =
(typeof gridView?.getCheckedItems === "function" (typeof gridView?.getCheckedItems === "function"
? gridView.getCheckedItems() ? gridView.getCheckedItems()
: typeof gridView?.getCheckedRows === "function" : typeof gridView?.getCheckedRows === "function"
? gridView.getCheckedRows() ? gridView.getCheckedRows()
: []) ?? []; : []) ?? [];
return checked.filter( return checked.filter(
(idx) => Number.isInteger(idx) && idx >= 0 && idx < rowCount, (idx) => Number.isInteger(idx) && idx >= 0 && idx < rowCount,
@@ -1860,10 +1914,10 @@ const SewageExcretaSlurgeInp = () => {
checkedIndexes.length > 0 checkedIndexes.length > 0
? new Set(checkedIndexes) ? new Set(checkedIndexes)
: new Set( : new Set(
currentRows currentRows
.map((row, idx) => (isCheckedRow(row) ? idx : -1)) .map((row, idx) => (isCheckedRow(row) ? idx : -1))
.filter((idx) => idx >= 0), .filter((idx) => idx >= 0),
); );
const removedRows = currentRows.filter((_, idx) => checkedIndexSet.has(idx)); const removedRows = currentRows.filter((_, idx) => checkedIndexSet.has(idx));
const nextRows = currentRows.filter((_, idx) => !checkedIndexSet.has(idx)); const nextRows = currentRows.filter((_, idx) => !checkedIndexSet.has(idx));
@@ -1922,7 +1976,11 @@ const SewageExcretaSlurgeInp = () => {
SGG_NM_DROPDOWN_TAB_KEYS.has(tabKey) && SGG_NM_DROPDOWN_TAB_KEYS.has(tabKey) &&
col.fieldName === "sggNm" col.fieldName === "sggNm"
) { ) {
next = buildSggNmColumn(col, canEdit, sggOptions); next = buildSggNmColumn(
col,
canEdit,
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
);
} else if (col.fieldName === "sggNm") { } else if (col.fieldName === "sggNm") {
next = { ...col, editable: false as const, styleName: "rg-cell-readonly" }; next = { ...col, editable: false as const, styleName: "rg-cell-readonly" };
} }
@@ -2082,8 +2140,8 @@ const SewageExcretaSlurgeInp = () => {
onValuesChange={setSearchValues} onValuesChange={setSearchValues}
/> />
{showActionToolbarCard && ( {showActionToolbarCard && (
<div className="card !py-0"> <div className="card !py-0">
<div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]"> <div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]">
<VerificationResultButton <VerificationResultButton
VerificationResultButtonFunc={openVerificationHistoryDialog} VerificationResultButtonFunc={openVerificationHistoryDialog}
isVerificationFailed={ isVerificationFailed={
@@ -2095,19 +2153,24 @@ const SewageExcretaSlurgeInp = () => {
<LastYearDataButton <LastYearDataButton
getLastYearDataFunc={() => void lastYearDataFunc()} getLastYearDataFunc={() => void lastYearDataFunc()}
/> />
{submitOk && <SubmitButton submitFunc={submitFunc} />} {activeTab === SEWAGE_EXCRETA_SLURGE_PROCESSING_FAC_STATUS_STATS_CD && (
<UpdateOperateDataButton
updateOperateDataButtonFunc={updateOperateDataButtonFunc}
/>
)}
{submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
</div> </div>
</div> </div>
)} )}
{showSecondaryToolbarCard && ( {showSecondaryToolbarCard && (
<div className="card !py-0"> <div className="card !py-0">
<div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]"> <div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]">
{showNotApplicableForActiveTab && ( {showNotApplicableForActiveTab && (
<NotApplicableCheckButton <NotApplicableCheckButton
isCheck={isNotApplicableForActiveTab} isCheck={isNotApplicableForActiveTab}
@@ -2116,12 +2179,12 @@ const SewageExcretaSlurgeInp = () => {
)} )}
{showArticleEditButtons && ( {showArticleEditButtons && (
<> <>
<AddArticleButton addArticleFunc={addArticleFunc} /> <AddArticleButton addArticleFunc={addArticleFunc} />
<DeleteArticleButton deleteArticleFunc={deleteArticleFunc} /> <DeleteArticleButton deleteArticleFunc={deleteArticleFunc} />
</> </>
)} )}
</div> </div>
</div> </div>
)} )}
{isLoading && ( {isLoading && (
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center"> <div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
@@ -10,6 +10,7 @@ import {
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputSewPipeApiService } from "@/entities/statistics/api/input/statistics-sewage-pipe-input-service"; import { statisticsInputSewPipeApiService } from "@/entities/statistics/api/input/statistics-sewage-pipe-input-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import type { import type {
SeweragePipeInputFactInstallStatusSaveRequest, SeweragePipeInputFactInstallStatusSaveRequest,
SeweragePipeInputFactInstallStatusSubmitRequest, SeweragePipeInputFactInstallStatusSubmitRequest,
@@ -82,7 +83,10 @@ import {
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { import {
formatVerificationTooltip,
getVerificationErrorsForField, getVerificationErrorsForField,
normalizeVerificationResultMap,
withNormalizedVerificationResult,
type VerificationResultLikeMap, type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display"; } from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
@@ -289,7 +293,10 @@ function normalizePipeTypeStatusRow(
lyngPrlg: Number(lyngPrlgWhol ?? 0), lyngPrlg: Number(lyngPrlgWhol ?? 0),
dmltnPrlg: Number(dmltnPrlgWhol ?? 0), dmltnPrlg: Number(dmltnPrlgWhol ?? 0),
...yearFields, ...yearFields,
verificationResult: remapPipeTypePrlgWholVerification(verificationResult) ?? undefined, verificationResult:
normalizeVerificationResultMap(
remapPipeTypePrlgWholVerification(verificationResult),
) ?? undefined,
}; };
} }
@@ -446,8 +453,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -719,10 +725,12 @@ const SewagePipeInp = () => {
const response = await statisticsInputSewPipeApiService.getRegionalFactStatus(searchParam); const response = await statisticsInputSewPipeApiService.getRegionalFactStatus(searchParam);
if (response.status === 'success') { if (response.status === 'success') {
const commonInfo = response.data.commonInfo; const commonInfo = response.data.commonInfo;
const convertedData = filterFetched(response.data.regionalFactStatusList).map((d) => ({ const convertedData = filterFetched(response.data.regionalFactStatusList).map((d) =>
ctpvNm: commonInfo.ctpvNm, withNormalizedVerificationResult({
...d, ctpvNm: commonInfo.ctpvNm,
})); ...d,
}),
);
applyRowMap((m) => m.set('ST00020001', toGridRows(convertedData))); applyRowMap((m) => m.set('ST00020001', toGridRows(convertedData)));
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo)); setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo));
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd)); setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
@@ -749,10 +757,12 @@ const SewagePipeInp = () => {
const response = await statisticsInputSewPipeApiService.getFactInstallStatus(searchParam); const response = await statisticsInputSewPipeApiService.getFactInstallStatus(searchParam);
if (response.status === 'success') { if (response.status === 'success') {
const commonInfo = response.data.commonInfo; const commonInfo = response.data.commonInfo;
const convertedData = filterFetched(response.data.factInstallStatusList).map((d) => ({ const convertedData = filterFetched(response.data.factInstallStatusList).map((d) =>
ctpvNm: commonInfo.ctpvNm, withNormalizedVerificationResult({
...d, ctpvNm: commonInfo.ctpvNm,
})); ...d,
}),
);
if (convertedData.length === 0) { if (convertedData.length === 0) {
const alreadyHandledForSameSearch = const alreadyHandledForSameSearch =
factInstallNoDataHandledKeyRef.current === searchConditionKey; factInstallNoDataHandledKeyRef.current === searchConditionKey;
@@ -829,10 +839,12 @@ const SewagePipeInp = () => {
const response = await statisticsInputSewPipeApiService.getPipeDiameterStatus(searchParam); const response = await statisticsInputSewPipeApiService.getPipeDiameterStatus(searchParam);
if (response.status === 'success') { if (response.status === 'success') {
const commonInfo = response.data.commonInfo; const commonInfo = response.data.commonInfo;
const convertedData = filterFetched(response.data.pipeDiameterStatusList).map((d) => ({ const convertedData = filterFetched(response.data.pipeDiameterStatusList).map((d) =>
ctpvNm: commonInfo.ctpvNm, withNormalizedVerificationResult({
...d, ctpvNm: commonInfo.ctpvNm,
})); ...d,
}),
);
applyRowMap((m) => m.set('ST00020004', toGridRows(convertedData))); applyRowMap((m) => m.set('ST00020004', toGridRows(convertedData)));
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo)); setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo));
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd)); setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
@@ -859,10 +871,12 @@ const SewagePipeInp = () => {
const response = await statisticsInputSewPipeApiService.getManholeStatus(searchParam); const response = await statisticsInputSewPipeApiService.getManholeStatus(searchParam);
if (response.status === 'success') { if (response.status === 'success') {
const commonInfo = response.data.commonInfo; const commonInfo = response.data.commonInfo;
const convertedData = filterFetched(response.data.manholeStatusList).map((d) => ({ const convertedData = filterFetched(response.data.manholeStatusList).map((d) =>
ctpvNm: commonInfo.ctpvNm, withNormalizedVerificationResult({
...d, ctpvNm: commonInfo.ctpvNm,
})); ...d,
}),
);
applyRowMap((m) => m.set('ST00020005', toGridRows(convertedData))); applyRowMap((m) => m.set('ST00020005', toGridRows(convertedData)));
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo)); setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo));
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd)); setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
@@ -889,13 +903,15 @@ const SewagePipeInp = () => {
const response = await statisticsInputSewPipeApiService.getConnectionStatus(searchParam); const response = await statisticsInputSewPipeApiService.getConnectionStatus(searchParam);
if (response.status === 'success') { if (response.status === 'success') {
const commonInfo = response.data.commonInfo; const commonInfo = response.data.commonInfo;
const facilityConvertedData = filterFetched(response.data.facilityConnectionList).map((d) => ({ const facilityConvertedData = filterFetched(response.data.facilityConnectionList).map((d) =>
...d, withNormalizedVerificationResult({ ...d }),
})); );
const adminConvertedData = filterFetched(response.data.adminAreaConnectionList).map((d) => ({ const adminConvertedData = filterFetched(response.data.adminAreaConnectionList).map((d) =>
...d, withNormalizedVerificationResult({
ctpvNm: d.ctpvNm || commonInfo.ctpvNm, ...d,
})); ctpvNm: d.ctpvNm || commonInfo.ctpvNm,
}),
);
applyRowMap((m) => { applyRowMap((m) => {
m.set('treatmentPlantConnectionInp', toGridRows(facilityConvertedData)); m.set('treatmentPlantConnectionInp', toGridRows(facilityConvertedData));
m.set('adminAreaConnectionInp', toGridRows(adminConvertedData)); m.set('adminAreaConnectionInp', toGridRows(adminConvertedData));
@@ -1338,7 +1354,6 @@ const SewagePipeInp = () => {
rmrk: nullableTrimmedString(d.rmrk), rmrk: nullableTrimmedString(d.rmrk),
lyngPrlgWhol: formatNumber(d.lyngPrlg, "lyngPrlg"), lyngPrlgWhol: formatNumber(d.lyngPrlg, "lyngPrlg"),
dmltnPrlgWhol: formatNumber(d.dmltnPrlg, "dmltnPrlg"), dmltnPrlgWhol: formatNumber(d.dmltnPrlg, "dmltnPrlg"),
pipeByPrstWhol: formatNumber(d.pipeByPrstWhol, "pipeByPrstWhol"),
}; };
}); });
const requestData: SeweragePipeInputPipeTypeStatusSubmitRequest = { const requestData: SeweragePipeInputPipeTypeStatusSubmitRequest = {
@@ -1455,7 +1470,13 @@ const SewagePipeInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: values.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: values?.bsnmCd ?? "",
rollbackStatusCode: statusForTab?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1830,7 +1851,6 @@ const SewagePipeInp = () => {
rmrk: nullableTrimmedString(d.rmrk), rmrk: nullableTrimmedString(d.rmrk),
lyngPrlgWhol: formatNumber(d.lyngPrlg, "lyngPrlg"), lyngPrlgWhol: formatNumber(d.lyngPrlg, "lyngPrlg"),
dmltnPrlgWhol: formatNumber(d.dmltnPrlg, "dmltnPrlg"), dmltnPrlgWhol: formatNumber(d.dmltnPrlg, "dmltnPrlg"),
pipeByPrstWhol: formatNumber(d.pipeByPrstWhol, "pipeByPrstWhol"),
}; };
}); });
@@ -2041,7 +2061,7 @@ const SewagePipeInp = () => {
{submitOk && <SubmitButton submitFunc={() => void submitFunc(false)} />} {submitOk && <SubmitButton submitFunc={() => void submitFunc(false)} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -2237,17 +2257,7 @@ const SewagePipeInp = () => {
tabKey, tabKey,
); );
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR" ? "시계열 검증 - " : (e.vrfcCd === "NV" ? "일반검증 - " : "모집단 검증 - ");
const comp = e.cmprCn ?? "";
const now = e.nowCn ?? "";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${comp} / 현재 입력값: ${now})`;
})
.filter(Boolean)
.join("\n");
} }
}} }}
/> />
@@ -11,6 +11,7 @@ import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { sewagePipeMaintainApiService } from "@/entities/statistics/api/input/statistics-input-sewage-pipe-maintain-service"; import { sewagePipeMaintainApiService } from "@/entities/statistics/api/input/statistics-input-sewage-pipe-maintain-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import type { import type {
SewagePipeMaintainDredgingSaveItem, SewagePipeMaintainDredgingSaveItem,
SewagePipeMaintainDredgingSaveRequest, SewagePipeMaintainDredgingSaveRequest,
@@ -69,7 +70,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
withNormalizedVerificationResult,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useStatisticsInputFocusStore } from "@/store/statistics-input-focus-store"; import { useStatisticsInputFocusStore } from "@/store/statistics-input-focus-store";
@@ -151,8 +156,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -444,10 +448,12 @@ const SewagePipeMaintainInp = () => {
repairStatusList ?? [], repairStatusList ?? [],
sidoListRef.current, sidoListRef.current,
searchContext, searchContext,
).map((d) => ({ ).map((d) =>
ctpvNm: commonInfo.ctpvNm, withNormalizedVerificationResult({
...d, ctpvNm: commonInfo.ctpvNm,
})); ...d,
}),
);
const gridRows = toGridRows(convertedData); const gridRows = toGridRows(convertedData);
applyRowMap(mergeIntoExistingMap, (m) => { applyRowMap(mergeIntoExistingMap, (m) => {
@@ -487,10 +493,12 @@ const SewagePipeMaintainInp = () => {
pipeDredgingStatusList ?? [], pipeDredgingStatusList ?? [],
sidoListRef.current, sidoListRef.current,
searchContext, searchContext,
).map((d) => ({ ).map((d) =>
ctpvNm: commonInfo.ctpvNm, withNormalizedVerificationResult({
...d, ctpvNm: commonInfo.ctpvNm,
})); ...d,
}),
);
const gridRows = toGridRows(convertedData); const gridRows = toGridRows(convertedData);
applyRowMap(mergeIntoExistingMap, (m) => { applyRowMap(mergeIntoExistingMap, (m) => {
@@ -678,7 +686,13 @@ const SewagePipeMaintainInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1103,14 +1117,7 @@ const SewagePipeMaintainInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR" ? "시계열 검증 - " : e.vrfcCd === "NV" ? "일반검증 - " : "모집단 검증 - ";
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1142,7 +1149,7 @@ const SewagePipeMaintainInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -17,10 +17,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation"; import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation"; import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputSewageReservoirPumpApi } from "@/entities/statistics/api/input/statistics-input-sewage-reservoir-pump-service"; import { statisticsInputSewageReservoirPumpApi } from "@/entities/statistics/api/input/statistics-input-sewage-reservoir-pump-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import { import {
type RainfallPumpStationItem, type RainfallPumpStationItem,
type RainfallPumpStationSaveItem, type RainfallPumpStationSaveItem,
@@ -89,7 +91,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -171,8 +177,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -279,7 +284,7 @@ function mapSewageReservoirListToGridRows(
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (item.verificationResult) { if (item.verificationResult) {
row.verificationResult = item.verificationResult; row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
} }
return row; return row;
}); });
@@ -435,7 +440,7 @@ function mapRainfallPumpStationListToGridRows(
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (item.verificationResult) { if (item.verificationResult) {
row.verificationResult = item.verificationResult; row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
} }
return row; return row;
}); });
@@ -864,7 +869,13 @@ const SewageReservoirPumpInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1480,7 +1491,11 @@ const SewageReservoirPumpInp = () => {
col.fieldName === "sggNm" && col.fieldName === "sggNm" &&
canEdit canEdit
) { ) {
return buildSggNmColumn(col, true, sggOptions); return buildSggNmColumn(
col,
true,
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
);
} }
return col; return col;
}).map((col) => { }).map((col) => {
@@ -1493,7 +1508,7 @@ const SewageReservoirPumpInp = () => {
}); });
} }
return map; return map;
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, sggOptions, columnGuidesByTab]); }, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, sggOptions, lastSearchedValues?.gugun, columnGuidesByTab]);
const verificationCellStyle = ({ const verificationCellStyle = ({
fieldName, fieldName,
@@ -1516,19 +1531,7 @@ const SewageReservoirPumpInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 -";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1584,7 +1587,7 @@ const SewageReservoirPumpInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -2,12 +2,13 @@ import { useEffect, useMemo, useRef, useState } from "react";
import { useConfirm } from "@frontend-opensource/use-react-hooks"; import { useConfirm } from "@frontend-opensource/use-react-hooks";
import { useAlertStore, useGlobalProgressStore, useSearchConditionSidoList } from "@/shared/lib"; import { useAlertStore, useGlobalProgressStore, useSearchConditionSidoList, useUserStore } from "@/shared/lib";
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation"; import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation"; import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputSewerageFinanceApi } from "@/entities/statistics/api/input/statistics-input-sewerage-finance-service"; import { statisticsInputSewerageFinanceApi } from "@/entities/statistics/api/input/statistics-input-sewerage-finance-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import type { import type {
CauserBurdenItem, CauserBurdenItem,
CauserBurdenSaveItem, CauserBurdenSaveItem,
@@ -40,7 +41,10 @@ import type {
import { import {
filterBySelectedAdmdstCd, filterBySelectedAdmdstCd,
isGugunOkForToolbar, isGugunOkForToolbar,
isJeonnamGwangjuSidoAllSearch,
isJeonnamGwangjuSidoAllToolbarException,
isSubmitOkForToolbar, isSubmitOkForToolbar,
JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE,
toInputSearchRegion, toInputSearchRegion,
} from "@/entities/statistics"; } from "@/entities/statistics";
@@ -73,7 +77,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -128,12 +136,31 @@ const computeTabEnterable = (
}; };
const sidoListRef: { current: Sido[] } = { current: [] }; const sidoListRef: { current: Sido[] } = { current: [] };
const financeToolbarUserIdRef: { current: string } = { current: "" };
function buildGugunOkForToolbar(values: SearchFormValues | null): boolean { function buildGugunOkForToolbar(values: SearchFormValues | null): boolean {
if (
isJeonnamGwangjuSidoAllToolbarException(
sidoListRef.current,
values,
financeToolbarUserIdRef.current,
)
) {
return true;
}
return isGugunOkForToolbar(sidoListRef.current, values); return isGugunOkForToolbar(sidoListRef.current, values);
} }
function buildSubmitOkForToolbar(values: SearchFormValues | null): boolean { function buildSubmitOkForToolbar(values: SearchFormValues | null): boolean {
if (
isJeonnamGwangjuSidoAllToolbarException(
sidoListRef.current,
values,
financeToolbarUserIdRef.current,
)
) {
return true;
}
return isSubmitOkForToolbar(sidoListRef.current, values); return isSubmitOkForToolbar(sidoListRef.current, values);
} }
@@ -155,8 +182,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -174,7 +200,9 @@ function mapRegionalListToGridRows<
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => { return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
const { verificationResult, ...rest } = item; const { verificationResult, ...rest } = item;
const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification; const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -350,6 +378,8 @@ async function waitForImrJobCompleted(
const SewerageFinanceInp = () => { const SewerageFinanceInp = () => {
const { sidoList } = useSearchConditionSidoList({ isInput: true }); const { sidoList } = useSearchConditionSidoList({ isInput: true });
sidoListRef.current = sidoList; sidoListRef.current = sidoList;
const userId = useUserStore((state) => state.userInfo?.userId ?? "");
financeToolbarUserIdRef.current = userId;
const { setMessage: alert } = useAlertStore((state) => state); const { setMessage: alert } = useAlertStore((state) => state);
const { confirm } = useConfirm(); const { confirm } = useConfirm();
const { isAdminInfo } = useAdminStore(); const { isAdminInfo } = useAdminStore();
@@ -818,7 +848,13 @@ const SewerageFinanceInp = () => {
alert("제출할 데이터가 없습니다."); alert("제출할 데이터가 없습니다.");
return; return;
} }
if (await confirm("제출 하시겠습니까?")) { const submitConfirmMessage = isJeonnamGwangjuSidoAllSearch(
sidoListRef.current,
lastSearchedValues,
)
? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE
: "제출 하시겠습니까?";
if (await confirm(submitConfirmMessage)) {
setShowSubmitDialog(true); setShowSubmitDialog(true);
} }
})(); })();
@@ -940,7 +976,13 @@ const SewerageFinanceInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1009,7 +1051,13 @@ const SewerageFinanceInp = () => {
return; return;
} }
if (!(await confirm("저장 하시겠습니까?"))) return; const saveConfirmMessage = isJeonnamGwangjuSidoAllSearch(
sidoListRef.current,
lastSearchedValues,
)
? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE
: "저장 하시겠습니까?";
if (!(await confirm(saveConfirmMessage))) return;
const currentData = getTabGridRows(tabKey); const currentData = getTabGridRows(tabKey);
if (!currentData.length) { if (!currentData.length) {
@@ -1215,18 +1263,7 @@ const SewerageFinanceInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 - ";
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1269,7 +1306,7 @@ const SewerageFinanceInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -10,6 +10,7 @@ import {
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import { import {
type CheckInputPeriodItem, type CheckInputPeriodItem,
getVerificationPeriodActionBlockedMessage, getVerificationPeriodActionBlockedMessage,
@@ -58,7 +59,11 @@ import { toGridRows } from "@/components/util/grid/gridFunction";
import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport"; import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag"; import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useStatisticsInputFocusStore } from "@/store/statistics-input-focus-store"; import { useStatisticsInputFocusStore } from "@/store/statistics-input-focus-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -87,7 +92,7 @@ const remapCommonInfoVerificationToGridFields = (
// API 키로도 조회 가능하도록 유지 // API 키로도 조회 가능하도록 유지
if (gridField !== key) remapped[key] = errors; if (gridField !== key) remapped[key] = errors;
} }
return remapped; return normalizeVerificationResultMap(remapped) ?? remapped;
}; };
/** 컬럼 가이드 API 조회용 통계코드 (하수도 보급률) */ /** 컬럼 가이드 API 조회용 통계코드 (하수도 보급률) */
@@ -302,7 +307,11 @@ const SeweragePenetrationRateInp = () => {
setRowData( setRowData(
convertedData.map((d) => { convertedData.map((d) => {
const row = toGridRows([d])[0] as GridRowWithVerification; const row = toGridRows([d])[0] as GridRowWithVerification;
if (d.verificationResult) row.verificationResult = d.verificationResult; if (d.verificationResult) {
row.verificationResult = normalizeVerificationResultMap(
d.verificationResult,
);
}
return row; return row;
}) })
); );
@@ -558,7 +567,13 @@ const SeweragePenetrationRateInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: searchValues?.year ?? "",
statsCd,
sewerBzmnCd: searchValues?.bsnmCd ?? "",
rollbackStatusCode: statusInfo?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted(imrResponse.job_id, (id) => await waitForImrJobCompleted(imrResponse.job_id, (id) =>
statisticsApi.getImrStatus(id), statisticsApi.getImrStatus(id),
@@ -800,8 +815,7 @@ const SeweragePenetrationRateInp = () => {
toolbarGroupAllowed && toolbarGroupAllowed &&
(baseShowSaveInToolbar || (baseShowSaveInToolbar ||
baseShowEnterableToolbarButtons || baseShowEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return ( return (
<> <>
@@ -827,7 +841,7 @@ const SeweragePenetrationRateInp = () => {
{submitOk && <SubmitButton submitFunc={() => submitFunc(false)} />} {submitOk && <SubmitButton submitFunc={() => submitFunc(false)} />}
</> </>
)} )}
{statusInfo?.lclgvSbmsnSttsCd === '2' && submitOk && <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />} {statusInfo?.lclgvSbmsnSttsCd === '2' && submitOk && inputPeriodCurrent && <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
</div> </div>
</div> </div>
@@ -867,14 +881,7 @@ const SeweragePenetrationRateInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix = e.vrfcCd === 'IMR' ? '시계열 검증 - ' : (e.vrfcCd === 'NV' ? '일반검증 - ' : '모집단 검증 -');
return `${prefix}${e.rsnExpln}
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join('\n');
} }
}} }}
/> />
@@ -9,6 +9,7 @@ import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputSewerageServiceLevelApi } from "@/entities/statistics/api/input/statistics-input-sewerage-service-level-service"; import { statisticsInputSewerageServiceLevelApi } from "@/entities/statistics/api/input/statistics-input-sewerage-service-level-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import { import {
SEWERAGE_SERVICE_LEVEL_COMPLAINT_STATS_CD, SEWERAGE_SERVICE_LEVEL_COMPLAINT_STATS_CD,
SEWERAGE_SERVICE_LEVEL_RESIDENT_FRIENDLY_FACT_STATS_CD, SEWERAGE_SERVICE_LEVEL_RESIDENT_FRIENDLY_FACT_STATS_CD,
@@ -63,7 +64,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -164,8 +169,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -187,7 +191,9 @@ function mapServiceLevelListToGridRows<
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => { return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
const { verificationResult, ...rest } = item; const { verificationResult, ...rest } = item;
const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification; const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -839,7 +845,13 @@ const SewerageServiceLevelInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1146,18 +1158,7 @@ const SewerageServiceLevelInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 - ";
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1200,7 +1201,7 @@ const SewerageServiceLevelInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -20,8 +20,8 @@ const StatisticsReviewHistory = () => {
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false }, { name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false }, { name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
{ name: "menuNm", fieldName: "menuNm", header: { text: "통계항목" }, editable: false }, { name: "menuNm", fieldName: "menuNm", header: { text: "통계항목" }, editable: false },
{ name: "chckerOpinionSm", fieldName: "chckerOpinionSm", header: { text: "검토자의견" }, editable: false }, { name: "splmntOpnnCn", fieldName: "splmntOpnnCn", header: { text: "검토자의견" }, editable: false },
{ name: "wrterOpinionSm", fieldName: "wrterOpinionSm", header: { text: "처리내역" }, editable: false }, { name: "rjctOpnnCn", fieldName: "rjctOpnnCn", header: { text: "반려의견" }, editable: false },
]; ];
const columnLayout = [ const columnLayout = [
@@ -29,8 +29,8 @@ const StatisticsReviewHistory = () => {
"ctpvNm", "ctpvNm",
"sggNm", "sggNm",
"menuNm", "menuNm",
"chckerOpinionSm", "splmntOpnnCn",
"wrterOpinionSm", "rjctOpnnCn",
]; ];
const handleSearch = async (values: SearchFormValues) => { const handleSearch = async (values: SearchFormValues) => {
@@ -17,10 +17,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation"; import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation"; import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputWaterReuseApi } from "@/entities/statistics/api/input/statistics-input-water-reuse-service"; import { statisticsInputWaterReuseApi } from "@/entities/statistics/api/input/statistics-input-water-reuse-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import { import {
type PublicSewageTreatWaterReuseItem, type PublicSewageTreatWaterReuseItem,
type PublicSewageTreatWaterReuseSaveItem, type PublicSewageTreatWaterReuseSaveItem,
@@ -93,7 +95,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -203,8 +209,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -443,7 +448,9 @@ function mapPublicSewageTreatWaterReuseListToGridRows(
instlAprvYmd: formatCompactYmdForGrid(item.instlAprvYmd), instlAprvYmd: formatCompactYmdForGrid(item.instlAprvYmd),
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -462,7 +469,9 @@ function mapRecycledWaterStatusListToGridRows(
oprtngStrtYmd: formatCompactYmdForGrid(item.oprtngStrtYmd), oprtngStrtYmd: formatCompactYmdForGrid(item.oprtngStrtYmd),
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -480,7 +489,9 @@ function mapRainFallUtilFactStatusListToGridRows(
cmptnYmd: formatCompactYmdForGrid(item.cmptnYmd), cmptnYmd: formatCompactYmdForGrid(item.cmptnYmd),
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -497,7 +508,9 @@ function mapTreatWaterReuseStatusListToGridRows<
coRegYmd: formatCompactYmdForGrid(item.coRegYmd), coRegYmd: formatCompactYmdForGrid(item.coRegYmd),
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -1355,7 +1368,13 @@ const WaterReuseInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1963,7 +1982,11 @@ const WaterReuseInp = () => {
ARTICLE_EDIT_TAB_KEYS.has(tabKey) && ARTICLE_EDIT_TAB_KEYS.has(tabKey) &&
col.fieldName === "sggNm" col.fieldName === "sggNm"
) { ) {
next = buildSggNmColumn(col, canEdit, sggOptions); next = buildSggNmColumn(
col,
canEdit,
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
);
} }
const guide = columnGuidesByTab[tabKey]?.[col.fieldName]?.trim(); const guide = columnGuidesByTab[tabKey]?.[col.fieldName]?.trim();
return guide ? { ...next, tooltip: guide } : next; return guide ? { ...next, tooltip: guide } : next;
@@ -1974,7 +1997,7 @@ const WaterReuseInp = () => {
}); });
} }
return map; return map;
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab, sggOptions]); }, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab, sggOptions, lastSearchedValues?.gugun]);
const searchContextForToolbar = searchContextByTab.get(activeTab) ?? lastSearchedValues; const searchContextForToolbar = searchContextByTab.get(activeTab) ?? lastSearchedValues;
const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null; const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null;
@@ -2063,18 +2086,7 @@ const WaterReuseInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 - ";
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -2117,7 +2129,7 @@ const WaterReuseInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -19,7 +19,6 @@ import {
DialogHeader, DialogHeader,
DialogTitle, DialogTitle,
Input, Input,
InputDatePicker,
Label, Label,
Select, Select,
SelectContent, SelectContent,
@@ -48,9 +47,32 @@ function normalizeStatsYrInput(raw: string): string {
function formatDateToYmd(d: Date | undefined): string | null { function formatDateToYmd(d: Date | undefined): string | null {
if (!d || Number.isNaN(d.getTime())) return null; if (!d || Number.isNaN(d.getTime())) return null;
const y = d.getFullYear(); const y = d.getFullYear();
if (y < 1000 || y > 9999) return null;
const m = String(d.getMonth() + 1).padStart(2, "0"); const m = String(d.getMonth() + 1).padStart(2, "0");
const day = String(d.getDate()).padStart(2, "0"); const day = String(d.getDate()).padStart(2, "0");
return `${y}${m}${day}`; return `${String(y).padStart(4, "0")}${m}${day}`;
}
/** Chrome `type="date"`는 max가 없으면 연도를 6자리까지 받음 */
const PERIOD_DATE_INPUT_MIN = "1000-01-01";
const PERIOD_DATE_INPUT_MAX = "9999-12-31";
function formatDateToInputValue(d: Date | undefined): string {
if (!d || Number.isNaN(d.getTime())) return "";
const ymd = formatDateToYmd(d);
if (!ymd) return "";
return `${ymd.slice(0, 4)}-${ymd.slice(4, 6)}-${ymd.slice(6, 8)}`;
}
function parseFourDigitYearDate(raw: string): Date | undefined {
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(raw);
if (!match) return undefined;
const year = Number(match[1]);
const month = Number(match[2]);
const day = Number(match[3]);
const parsed = new Date(year, month - 1, day);
if (Number.isNaN(parsed.getTime()) || parsed.getFullYear() !== year) return undefined;
return parsed;
} }
export interface StatisticsInputPeriodDialogProps { export interface StatisticsInputPeriodDialogProps {
@@ -281,18 +303,26 @@ export function StatisticsInputPeriodDialog({
)} )}
<div className="flex flex-col gap-2"> <div className="flex flex-col gap-2">
<Label className="text-label">시작일</Label> <Label className="text-label">시작일</Label>
<InputDatePicker <Input
value={bgngYmd} type="date"
onChange={setBgngYmd} min={PERIOD_DATE_INPUT_MIN}
className="w-full" max={PERIOD_DATE_INPUT_MAX}
value={formatDateToInputValue(bgngYmd)}
onChange={(e) => setBgngYmd(parseFourDigitYearDate(e.target.value))}
disabled={isSubmitting}
className="!text-[1.3rem] w-full"
/> />
</div> </div>
<div className="flex flex-col gap-2"> <div className="flex flex-col gap-2">
<Label className="text-label">종료일</Label> <Label className="text-label">종료일</Label>
<InputDatePicker <Input
value={endYmd} type="date"
onChange={setEndYmd} min={PERIOD_DATE_INPUT_MIN}
className="w-full" max={PERIOD_DATE_INPUT_MAX}
value={formatDateToInputValue(endYmd)}
onChange={(e) => setEndYmd(parseFourDigitYearDate(e.target.value))}
disabled={isSubmitting}
className="!text-[1.3rem] w-full"
/> />
</div> </div>
</div> </div>
@@ -49,7 +49,6 @@ const ExcretaTreatmentFacilityRvw = () => {
const [reviewOpinionContext, setReviewOpinionContext] = const [reviewOpinionContext, setReviewOpinionContext] =
useState<ReviewOpinionDialogContext | null>(null); useState<ReviewOpinionDialogContext | null>(null);
const [latestReviewOpinion, setLatestReviewOpinion] = useState(""); const [latestReviewOpinion, setLatestReviewOpinion] = useState("");
const [latestProcessHistory, setLatestProcessHistory] = useState("");
const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null); const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null);
const columnInfo = useMemo(() => { const columnInfo = useMemo(() => {
@@ -116,7 +115,6 @@ const ExcretaTreatmentFacilityRvw = () => {
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
setLastSearchValues(null); setLastSearchValues(null);
setReviewOpinionOpen(false); setReviewOpinionOpen(false);
setReturnDialogOpen(false); setReturnDialogOpen(false);
@@ -170,14 +168,12 @@ const ExcretaTreatmentFacilityRvw = () => {
statsCd: statsInfo.statsCd ?? "", statsCd: statsInfo.statsCd ?? "",
}); });
setLatestReviewOpinion(statsInfo.splmntOpnnCn ?? ""); setLatestReviewOpinion(statsInfo.splmntOpnnCn ?? "");
setLatestProcessHistory(statsInfo.splmntRsltCn ?? "");
setRowData(toGridRows(convertedData as unknown as object[])); setRowData(toGridRows(convertedData as unknown as object[]));
} else { } else {
setRowData([]); setRowData([]);
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
alert(response.message || "데이터가 없습니다."); alert(response.message || "데이터가 없습니다.");
} }
} catch { } catch {
@@ -216,7 +212,6 @@ const ExcretaTreatmentFacilityRvw = () => {
const row = detailRes.data?.[0]; const row = detailRes.data?.[0];
setLatestReviewOpinion(row?.splmntOpnnCn ?? ""); setLatestReviewOpinion(row?.splmntOpnnCn ?? "");
setLatestProcessHistory(row?.splmntRsltCn ?? "");
setReviewOpinionOpen(true); setReviewOpinionOpen(true);
} catch { } catch {
alert("검토의견 조회 중 오류가 발생했습니다."); alert("검토의견 조회 중 오류가 발생했습니다.");
@@ -234,10 +229,8 @@ const ExcretaTreatmentFacilityRvw = () => {
setStatsStatusInfo((prev) => ({ setStatsStatusInfo((prev) => ({
...prev, ...prev,
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
})); }));
setLatestReviewOpinion(param.splmntOpnnCn); setLatestReviewOpinion(param.splmntOpnnCn);
setLatestProcessHistory(param.splmntRsltCn);
} catch { } catch {
alert("저장 중 오류가 발생했습니다."); alert("저장 중 오류가 발생했습니다.");
} }
@@ -297,7 +290,6 @@ const ExcretaTreatmentFacilityRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -102,7 +102,6 @@ const PrivateSewageFacilityRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -284,7 +283,6 @@ const PrivateSewageFacilityRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -307,7 +305,6 @@ const PrivateSewageFacilityRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -411,7 +408,6 @@ const PrivateSewageFacilityRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -41,7 +41,6 @@ const PublicSewageFacilityRvw = () => {
const [reviewOpinionContext, setReviewOpinionContext] = const [reviewOpinionContext, setReviewOpinionContext] =
useState<ReviewOpinionDialogContext | null>(null); useState<ReviewOpinionDialogContext | null>(null);
const [latestReviewOpinion, setLatestReviewOpinion] = useState(""); const [latestReviewOpinion, setLatestReviewOpinion] = useState("");
const [latestProcessHistory, setLatestProcessHistory] = useState("");
const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null); const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null);
const columnInfo = useMemo(() => { const columnInfo = useMemo(() => {
@@ -100,7 +99,6 @@ const PublicSewageFacilityRvw = () => {
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
setLastSearchValues(null); setLastSearchValues(null);
setSubmitDialogOpen(false); setSubmitDialogOpen(false);
}; };
@@ -143,16 +141,12 @@ const PublicSewageFacilityRvw = () => {
setLatestReviewOpinion( setLatestReviewOpinion(
response.data.statsStatusInfo.splmntOpnnCn ?? "", response.data.statsStatusInfo.splmntOpnnCn ?? "",
); );
setLatestProcessHistory(
response.data.statsStatusInfo.splmntRsltCn ?? "",
);
setRowData(toGridRows(convertedData as unknown as object[])); setRowData(toGridRows(convertedData as unknown as object[]));
} else { } else {
setRowData([]); setRowData([]);
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
alert(response.message || "데이터가 없습니다."); alert(response.message || "데이터가 없습니다.");
} }
} catch (error) { } catch (error) {
@@ -192,7 +186,6 @@ const PublicSewageFacilityRvw = () => {
const row = detailRes.data?.[0]; const row = detailRes.data?.[0];
setLatestReviewOpinion(row?.splmntOpnnCn ?? ""); setLatestReviewOpinion(row?.splmntOpnnCn ?? "");
setLatestProcessHistory(row?.splmntRsltCn ?? "");
setReviewOpinionOpen(true); setReviewOpinionOpen(true);
} catch { } catch {
alert("검토의견 조회 중 오류가 발생했습니다."); alert("검토의견 조회 중 오류가 발생했습니다.");
@@ -210,10 +203,8 @@ const PublicSewageFacilityRvw = () => {
setStatsStatusInfo((prev) => ({ setStatsStatusInfo((prev) => ({
...prev, ...prev,
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
})); }));
setLatestReviewOpinion(param.splmntOpnnCn); setLatestReviewOpinion(param.splmntOpnnCn);
setLatestProcessHistory(param.splmntRsltCn);
} catch { } catch {
alert("저장 중 오류가 발생했습니다."); alert("저장 중 오류가 발생했습니다.");
} }
@@ -267,7 +258,6 @@ const PublicSewageFacilityRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -47,7 +47,6 @@ const PumpingStationRvw = () => {
const [reviewOpinionContext, setReviewOpinionContext] = const [reviewOpinionContext, setReviewOpinionContext] =
useState<ReviewOpinionDialogContext | null>(null); useState<ReviewOpinionDialogContext | null>(null);
const [latestReviewOpinion, setLatestReviewOpinion] = useState(""); const [latestReviewOpinion, setLatestReviewOpinion] = useState("");
const [latestProcessHistory, setLatestProcessHistory] = useState("");
const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null); const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null);
const columnInfo = useMemo(() => { const columnInfo = useMemo(() => {
@@ -111,7 +110,6 @@ const PumpingStationRvw = () => {
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
setLastSearchValues(null); setLastSearchValues(null);
setReviewOpinionOpen(false); setReviewOpinionOpen(false);
setReturnDialogOpen(false); setReturnDialogOpen(false);
@@ -157,14 +155,12 @@ const PumpingStationRvw = () => {
statsCd: statsInfo.statsCd ?? "", statsCd: statsInfo.statsCd ?? "",
}); });
setLatestReviewOpinion(statsInfo.splmntOpnnCn ?? ""); setLatestReviewOpinion(statsInfo.splmntOpnnCn ?? "");
setLatestProcessHistory(statsInfo.splmntRsltCn ?? "");
setRowData(toGridRows(convertedData)); setRowData(toGridRows(convertedData));
} else { } else {
setRowData([]); setRowData([]);
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
alert(response.message || "데이터가 없습니다."); alert(response.message || "데이터가 없습니다.");
} }
} catch { } catch {
@@ -203,7 +199,6 @@ const PumpingStationRvw = () => {
const row = detailRes.data?.[0]; const row = detailRes.data?.[0];
setLatestReviewOpinion(row?.splmntOpnnCn ?? ""); setLatestReviewOpinion(row?.splmntOpnnCn ?? "");
setLatestProcessHistory(row?.splmntRsltCn ?? "");
setReviewOpinionOpen(true); setReviewOpinionOpen(true);
} catch { } catch {
alert("검토의견 조회 중 오류가 발생했습니다."); alert("검토의견 조회 중 오류가 발생했습니다.");
@@ -221,10 +216,8 @@ const PumpingStationRvw = () => {
setStatsStatusInfo((prev) => ({ setStatsStatusInfo((prev) => ({
...prev, ...prev,
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
})); }));
setLatestReviewOpinion(param.splmntOpnnCn); setLatestReviewOpinion(param.splmntOpnnCn);
setLatestProcessHistory(param.splmntRsltCn);
} catch { } catch {
alert("저장 중 오류가 발생했습니다."); alert("저장 중 오류가 발생했습니다.");
} }
@@ -284,7 +277,6 @@ const PumpingStationRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -30,8 +30,6 @@ export interface ReviewOpinionDialogProps {
context: ReviewOpinionDialogContext | null; context: ReviewOpinionDialogContext | null;
/** 다이얼로그 열릴 때 검토의견 초기값 */ /** 다이얼로그 열릴 때 검토의견 초기값 */
initialReviewOpinion?: string; initialReviewOpinion?: string;
/** 다이얼로그 열릴 때 처리내역 초기값 */
initialProcessHistory?: string;
/** 저장 시 생성된 param 전달 (API 호출 등) */ /** 저장 시 생성된 param 전달 (API 호출 등) */
onSave?: (param: ReviewOpinionSaveRequest) => void | Promise<void>; onSave?: (param: ReviewOpinionSaveRequest) => void | Promise<void>;
} }
@@ -41,18 +39,15 @@ export function ReviewOpinionDialog({
onOpenChange, onOpenChange,
context, context,
initialReviewOpinion = "", initialReviewOpinion = "",
initialProcessHistory = "",
onSave, onSave,
}: ReviewOpinionDialogProps) { }: ReviewOpinionDialogProps) {
const { setMessage: alert } = useAlertStore((state) => state); const { setMessage: alert } = useAlertStore((state) => state);
const [reviewOpinion, setReviewOpinion] = useState(""); const [reviewOpinion, setReviewOpinion] = useState("");
const [processHistory, setProcessHistory] = useState("");
const [isSaving, setIsSaving] = useState(false); const [isSaving, setIsSaving] = useState(false);
const [reviewOpinionError, setReviewOpinionError] = useState(false); const [reviewOpinionError, setReviewOpinionError] = useState(false);
const resetForm = () => { const resetForm = () => {
setReviewOpinion(""); setReviewOpinion("");
setProcessHistory("");
setReviewOpinionError(false); setReviewOpinionError(false);
}; };
@@ -64,8 +59,7 @@ export function ReviewOpinionDialog({
useEffect(() => { useEffect(() => {
if (!open) return; if (!open) return;
setReviewOpinion(initialReviewOpinion); setReviewOpinion(initialReviewOpinion);
setProcessHistory(initialProcessHistory); }, [open, initialReviewOpinion]);
}, [open, initialReviewOpinion, initialProcessHistory]);
const handleSave = async () => { const handleSave = async () => {
if (reviewOpinion.trim() === "") { if (reviewOpinion.trim() === "") {
@@ -96,7 +90,6 @@ export function ReviewOpinionDialog({
sewerBzmnCd: context.sewerBzmnCd, sewerBzmnCd: context.sewerBzmnCd,
statsCd: context.statsCd, statsCd: context.statsCd,
splmntOpnnCn: reviewOpinion, splmntOpnnCn: reviewOpinion,
splmntRsltCn: processHistory,
mdfrUuid: userInfo.userUnqId, mdfrUuid: userInfo.userUnqId,
}; };
await onSave?.(param); await onSave?.(param);
@@ -136,16 +129,6 @@ export function ReviewOpinionDialog({
</p> </p>
)} )}
</div> </div>
<div className="flex flex-col gap-2">
<Label className="text-label mb-2">처리내역</Label>
<Textarea
value={processHistory}
onChange={(e) => setProcessHistory(e.target.value)}
className="min-h-[10rem] resize-y !text-[1.3rem] !leading-6"
placeholder="처리내역을 입력하세요."
disabled={isSaving}
/>
</div>
</div> </div>
<DialogFooter> <DialogFooter>
<DialogClose asChild> <DialogClose asChild>
@@ -30,8 +30,8 @@ export interface ReviewSubmitDialogProps {
context: ReviewerInfoRequest | null; context: ReviewerInfoRequest | null;
onSubmitted?: () => void | Promise<void>; onSubmitted?: () => void | Promise<void>;
/** /**
* true면 검토의견·처리내역 UI를 숨기고 * true면 검토의견 UI를 숨기고
* submit body에 statsCd / splmntOpnnCn / splmntRsltCn을 넣지 않음 * submit body에 statsCd / splmntOpnnCn을 넣지 않음
*/ */
hideOpinionFields?: boolean; hideOpinionFields?: boolean;
} }
@@ -116,7 +116,6 @@ export function ReviewSubmitDialog({
statsCd: context.statsCd, statsCd: context.statsCd,
mdfrUuid: userInfo.userUnqId, mdfrUuid: userInfo.userUnqId,
splmntOpnnCn: reviewerInfo?.splmntOpnnCn ?? "", splmntOpnnCn: reviewerInfo?.splmntOpnnCn ?? "",
splmntRsltCn: reviewerInfo?.splmntRsltCn ?? "",
}; };
const response = await statisticsApi.submitReview(submitParam); const response = await statisticsApi.submitReview(submitParam);
@@ -175,14 +174,6 @@ export function ReviewSubmitDialog({
className="min-h-[10rem] p-2 resize-none !text-xl" className="min-h-[10rem] p-2 resize-none !text-xl"
/> />
</div> </div>
<div className="col-span-2 flex flex-col gap-2">
<Label className="text-label">처리내역</Label>
<Textarea
value={reviewerInfo?.splmntRsltCn ?? "-"}
readOnly
className="min-h-[10rem] p-2 resize-none !text-xl"
/>
</div>
</> </>
)} )}
</div> </div>
@@ -105,7 +105,6 @@ const SewageExcretaRelatedRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -289,7 +288,6 @@ const SewageExcretaRelatedRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -312,7 +310,6 @@ const SewageExcretaRelatedRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -416,7 +413,6 @@ const SewageExcretaRelatedRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -105,7 +105,6 @@ const SewageExcretaSlurgeRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -290,7 +289,6 @@ const SewageExcretaSlurgeRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -313,7 +311,6 @@ const SewageExcretaSlurgeRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -417,7 +414,6 @@ const SewageExcretaSlurgeRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -120,7 +120,6 @@ const SewagePipeMaintainRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -302,7 +301,6 @@ const SewagePipeMaintainRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -325,7 +323,6 @@ const SewagePipeMaintainRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -429,7 +426,6 @@ const SewagePipeMaintainRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -181,7 +181,6 @@ const SewagePipeRvw = () => {
}; };
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -362,7 +361,6 @@ const SewagePipeRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -385,7 +383,6 @@ const SewagePipeRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -488,7 +485,6 @@ const SewagePipeRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -126,7 +126,6 @@ const SewageReservoirPumpRvw = () => {
}, [activeStatsCd, lastSearchValues]); }, [activeStatsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -308,7 +307,6 @@ const SewageReservoirPumpRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -331,7 +329,6 @@ const SewageReservoirPumpRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -435,7 +432,6 @@ const SewageReservoirPumpRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -105,7 +105,6 @@ const SewerageFinanceRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -287,7 +286,6 @@ const SewerageFinanceRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -310,7 +308,6 @@ const SewerageFinanceRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -414,7 +411,6 @@ const SewerageFinanceRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -40,7 +40,6 @@ const SeweragePenetrationRateRvw = () => {
const [reviewOpinionContext, setReviewOpinionContext] = const [reviewOpinionContext, setReviewOpinionContext] =
useState<ReviewOpinionDialogContext | null>(null); useState<ReviewOpinionDialogContext | null>(null);
const [latestReviewOpinion, setLatestReviewOpinion] = useState(""); const [latestReviewOpinion, setLatestReviewOpinion] = useState("");
const [latestProcessHistory, setLatestProcessHistory] = useState("");
const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null); const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null);
const columnInfo = useMemo(() => { const columnInfo = useMemo(() => {
@@ -100,7 +99,6 @@ const SeweragePenetrationRateRvw = () => {
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
setLastSearchValues(null); setLastSearchValues(null);
}; };
@@ -139,15 +137,11 @@ const SeweragePenetrationRateRvw = () => {
setLatestReviewOpinion( setLatestReviewOpinion(
response.data.statsStatusInfo.splmntOpnnCn ?? "", response.data.statsStatusInfo.splmntOpnnCn ?? "",
); );
setLatestProcessHistory(
response.data.statsStatusInfo.splmntRsltCn ?? "",
);
setRowData(toGridRows(convertedData)); setRowData(toGridRows(convertedData));
} else { } else {
setRowData([]); setRowData([]);
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
alert(response.message || "데이터가 없습니다."); alert(response.message || "데이터가 없습니다.");
} }
} catch (error) { } catch (error) {
@@ -187,7 +181,6 @@ const SeweragePenetrationRateRvw = () => {
const row = detailRes.data?.[0]; const row = detailRes.data?.[0];
setLatestReviewOpinion(row?.splmntOpnnCn ?? ""); setLatestReviewOpinion(row?.splmntOpnnCn ?? "");
setLatestProcessHistory(row?.splmntRsltCn ?? "");
setReviewOpinionOpen(true); setReviewOpinionOpen(true);
} catch { } catch {
alert("검토의견 조회 중 오류가 발생했습니다."); alert("검토의견 조회 중 오류가 발생했습니다.");
@@ -205,10 +198,8 @@ const SeweragePenetrationRateRvw = () => {
setStatsStatusInfo((prev) => ({ setStatsStatusInfo((prev) => ({
...prev, ...prev,
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
})); }));
setLatestReviewOpinion(param.splmntOpnnCn); setLatestReviewOpinion(param.splmntOpnnCn);
setLatestProcessHistory(param.splmntRsltCn);
} catch { } catch {
alert("저장 중 오류가 발생했습니다."); alert("저장 중 오류가 발생했습니다.");
} }
@@ -264,7 +255,6 @@ const SeweragePenetrationRateRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -103,7 +103,6 @@ const SewerageServiceLevelRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -288,7 +287,6 @@ const SewerageServiceLevelRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -311,7 +309,6 @@ const SewerageServiceLevelRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -415,7 +412,6 @@ const SewerageServiceLevelRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -39,22 +39,14 @@ import { toGridRows } from "@/components/util/grid/gridFunction";
type ReviewHistoryRow = ReviewHistoryResponse["data"][number]; type ReviewHistoryRow = ReviewHistoryResponse["data"][number];
const checkPrvnStatusCd = (code: string) => {
return (code === '0' || code === '1') ? '미작성' : (code === '2' ? '제출완료' : (code === '3' ? '승인완료' : '반려'));
};
const checkSubmitStatusCd = (code: string) => {
return code === '0' ? '미작성' : (code === '1' ? '작성중' : (code === '2' ? '제출완료' : (code === '3' ? '승인완료' : '보완요청')));
};
const isStatsInputStatusRowApprovable = (row: Record<string, string | number>) => const isStatsInputStatusRowApprovable = (row: Record<string, string | number>) =>
String(row.submitStatusCd ?? "") === "3" && (String(row.prvnStatusCd ?? "") === "2" || String(row.prvnStatusCd ?? "") === "3"); String(row.lclgvSbmsnSttsCd ?? "") === "3" &&
(String(row.mctpvPicSbmsnSttsCd ?? "") === "2" ||
String(row.mctpvPicSbmsnSttsCd ?? "") === "3");
const mapSewerageListToGridRows = (rawList: StatsInputStatusReviewItem[]) => const mapSewerageListToGridRows = (rawList: StatsInputStatusReviewItem[]) =>
rawList.map((r) => ({ rawList.map((r) => ({
...r, ...r,
prvnStatusNm: checkPrvnStatusCd(r.prvnStatusCd || "0"),
submitStatusNm: checkSubmitStatusCd(r.submitStatusCd || "0"),
reviewHistory: "검토이력", reviewHistory: "검토이력",
})); }));
@@ -97,7 +89,7 @@ const StatsInputStatusRvw = () => {
const reviewHistoryColumns = useMemo(() => { const reviewHistoryColumns = useMemo(() => {
const col = createColumnHelper<ReviewHistoryRow>(); const col = createColumnHelper<ReviewHistoryRow>();
return [ return [
col.accessor("logDt", { col.accessor("regDt", {
header: "등록일", header: "등록일",
cell: (info) => info.getValue(), cell: (info) => info.getValue(),
}), }),
@@ -238,23 +230,23 @@ const StatsInputStatusRvw = () => {
const allSubmitStatusApproved = useMemo( const allSubmitStatusApproved = useMemo(
() => () =>
rowData.length > 0 && rowData.length > 0 &&
rowData.every((row) => String(row.submitStatusCd ?? "") === "3"), rowData.every((row) => String(row.lclgvSbmsnSttsCd ?? "") === "3"),
[rowData], [rowData],
); );
/** 진행상태(prvn) 코드가 모두 승인완료(3) */ /** 진행상태(광역) 코드가 모두 승인완료(3) */
const allPrvnStatusApproved = useMemo( const allPrvnStatusApproved = useMemo(
() => () =>
rowData.length > 0 && rowData.length > 0 &&
rowData.every((row) => String(row.prvnStatusCd ?? "") === "3"), rowData.every((row) => String(row.mctpvPicSbmsnSttsCd ?? "") === "3"),
[rowData], [rowData],
); );
/** 진행상태(prvn) 코드가 모두 제출완료(2) */ /** 진행상태(광역) 코드가 모두 제출완료(2) */
const allPrvnStatusSubmitted = useMemo( const allPrvnStatusSubmitted = useMemo(
() => () =>
rowData.length > 0 && rowData.length > 0 &&
rowData.every((row) => String(row.prvnStatusCd ?? "") === "2"), rowData.every((row) => String(row.mctpvPicSbmsnSttsCd ?? "") === "2"),
[rowData], [rowData],
); );
@@ -392,8 +384,8 @@ const StatsInputStatusRvw = () => {
setRowData={setRowData} setRowData={setRowData}
onDataCellClick={handleReviewHistoryCellClick} onDataCellClick={handleReviewHistoryCellClick}
cellStyleCallback={({ row, fieldName }) => { cellStyleCallback={({ row, fieldName }) => {
if (fieldName === "submitStatusNm") { if (fieldName === "lclgvSbmsnSttsNm") {
const statusCd = String(row.submitStatusCd ?? ""); const statusCd = String(row.lclgvSbmsnSttsCd ?? "");
if (statusCd === "0" || statusCd === "1") { if (statusCd === "0" || statusCd === "1") {
return "rg-cell-stats-status-pending"; return "rg-cell-stats-status-pending";
@@ -408,8 +400,8 @@ const StatsInputStatusRvw = () => {
return "rg-cell-stats-status-rejected"; return "rg-cell-stats-status-rejected";
} }
return undefined; return undefined;
} else if (fieldName === "prvnStatusNm") { } else if (fieldName === "mctpvPicSbmsnSttsNm") {
const statusCd = String(row.prvnStatusCd ?? ""); const statusCd = String(row.mctpvPicSbmsnSttsCd ?? "");
if (statusCd === "0" || statusCd === "1") { if (statusCd === "0" || statusCd === "1") {
return "rg-cell-stats-status-pending"; return "rg-cell-stats-status-pending";
@@ -108,7 +108,6 @@ const WaterReuseRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -291,7 +290,6 @@ const WaterReuseRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -314,7 +312,6 @@ const WaterReuseRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -418,7 +415,6 @@ const WaterReuseRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -554,17 +554,20 @@ const DetailComponent = ({
const userInfo = await getUserInfo(); const userInfo = await getUserInfo();
let response; let response;
const vrfcSn = detailInfo?.commonInfo.vrfcSn;
if (vrfcSn == null) {
alert("검증 일련번호가 없습니다.");
return;
}
if (!hasPersistedDetails) { if (!hasPersistedDetails) {
response = response =
await generalverificationApiService.RegistVrfcDetail({ await generalverificationApiService.RegistVrfcDetail(vrfcSn, {
vrfcSn: detailInfo?.commonInfo.vrfcSn ?? null,
detailList: rows, detailList: rows,
rgtrUuid: userInfo.userUnqId, rgtrUuid: userInfo.userUnqId,
}); });
} else { } else {
response = response =
await generalverificationApiService.UpdateVrfcDetail({ await generalverificationApiService.UpdateVrfcDetail(vrfcSn, {
vrfcSn: detailInfo?.commonInfo.vrfcSn ?? null,
detailList: rows, detailList: rows,
mdfrUuid: userInfo.userUnqId, mdfrUuid: userInfo.userUnqId,
}); });
@@ -146,9 +146,15 @@ const RegistDialog = memo(
} }
}; };
const handleUpdateVrfcMaster = async (data: GeneralVerificationMasterSubmitFormData) => { const handleUpdateVrfcMaster = async (
updateVrfcSn: number,
body: UpdateVrfcMasterRequest,
) => {
try { try {
const response = await generalverificationApiService.UpdateVrfcMaster(data as UpdateVrfcMasterRequest); const response = await generalverificationApiService.UpdateVrfcMaster(
updateVrfcSn,
body,
);
if (response.status === 'success') { if (response.status === 'success') {
alert('수정되었습니다.'); alert('수정되었습니다.');
@@ -258,8 +264,11 @@ const RegistDialog = memo(
if (await confirm(confirmMessage)) { if (await confirm(confirmMessage)) {
const userInfo = await getUserInfo(); const userInfo = await getUserInfo();
if (isVrfcSn) { if (isVrfcSn) {
const updateData = { if (data.vrfcSn == null) {
vrfcSn: data.vrfcSn, alert('수정 대상이 없습니다.');
return;
}
await handleUpdateVrfcMaster(data.vrfcSn, {
vrfcNm: data.vrfcNm, vrfcNm: data.vrfcNm,
vrfcClsfCd: data.vrfcClsfCd, vrfcClsfCd: data.vrfcClsfCd,
dcptDgt: data.dcptDgt, dcptDgt: data.dcptDgt,
@@ -267,10 +276,8 @@ const RegistDialog = memo(
...(data.dcptDgt === 0 ...(data.dcptDgt === 0
? {} ? {}
: { dcptPrcsMthCd: data.dcptPrcsMthCd }), : { dcptPrcsMthCd: data.dcptPrcsMthCd }),
trgtStatsCd: data.trgtStatsCd,
mdfrUuid: userInfo.userUnqId, mdfrUuid: userInfo.userUnqId,
}; });
await handleUpdateVrfcMaster(updateData);
} else { } else {
const registData = { const registData = {
vrfcNm: data.vrfcNm, vrfcNm: data.vrfcNm,
@@ -481,6 +481,11 @@ export type DataGridProps = {
headerHeight?: number; headerHeight?: number;
/** RealGrid `displayOptions.fitStyle` (기본 EVEN). 컬럼별 width 유지 시 NONE */ /** RealGrid `displayOptions.fitStyle` (기본 EVEN). 컬럼별 width 유지 시 NONE */
fitStyle?: GridFitStyle; fitStyle?: GridFitStyle;
/**
* true면 붙여넣기·편집으로 행을 추가하지 않음.
* 검증 결과처럼 조회 행 수가 고정된 그리드에서 사용.
*/
preventRowAppend?: boolean;
}; };
export type TabDataGridProps = { export type TabDataGridProps = {
@@ -8,6 +8,7 @@ export const doList = [
"4600000000", "4600000000",
"4700000000", "4700000000",
"4800000000", "4800000000",
"5000000000",
]; ];
export const needBsnmFrgnrPoplSmSidoList = [ export const needBsnmFrgnrPoplSmSidoList = [
@@ -27,7 +27,6 @@ export const ExcretaSlurgeProcessingStatusInpColumn = {
'rcycQnt', 'rcycQnt',
'olandLfvlm', 'olandLfvlm',
'incnrQnt', 'incnrQnt',
'oceanInputQnt',
'fuelQnt', 'fuelQnt',
'etcQnt', 'etcQnt',
'unprcsQnt' 'unprcsQnt'
@@ -51,7 +50,6 @@ export const ExcretaSlurgeProcessingStatusInpColumn = {
'rcycQnt', 'rcycQnt',
'olandLfvlm', 'olandLfvlm',
'incnrQnt', 'incnrQnt',
'oceanInputQnt',
'fuelQnt', 'fuelQnt',
'etcQnt', 'etcQnt',
], ],
@@ -61,7 +59,6 @@ export const ExcretaSlurgeProcessingStatusInpColumn = {
{ name: 'rcycQnt', fieldName: 'rcycQnt', header: { text: '재활용' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' }, { name: 'rcycQnt', fieldName: 'rcycQnt', header: { text: '재활용' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'olandLfvlm', fieldName: 'olandLfvlm', header: { text: '육상매립' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' }, { name: 'olandLfvlm', fieldName: 'olandLfvlm', header: { text: '육상매립' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'incnrQnt', fieldName: 'incnrQnt', header: { text: '소각' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' }, { name: 'incnrQnt', fieldName: 'incnrQnt', header: { text: '소각' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'oceanInputQnt', fieldName: 'oceanInputQnt', header: { text: '해양투기' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'fuelQnt', fieldName: 'fuelQnt', header: { text: '연료화' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' }, { name: 'fuelQnt', fieldName: 'fuelQnt', header: { text: '연료화' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'etcQnt', fieldName: 'etcQnt', header: { text: '기타' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' }, { name: 'etcQnt', fieldName: 'etcQnt', header: { text: '기타' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
@@ -100,7 +97,6 @@ export const ExcretaSlurgeProcessingStatusInpColumn = {
'rcycQnt', 'rcycQnt',
'olandLfvlm', 'olandLfvlm',
'incnrQnt', 'incnrQnt',
'oceanInputQnt',
'fuelQnt', 'fuelQnt',
'etcQnt' 'etcQnt'
] ]
@@ -49,6 +49,43 @@ export const ManholeStatusInpColumn = {
styleName: "rg-cell-readonly", styleName: "rg-cell-readonly",
footer: { text: "합계" }, footer: { text: "합계" },
}, },
{
name: "wholMnhlCntSum",
fieldName: "wholMnhlCntSum",
header: { text: "맨홀총계" },
footer: footerInt,
editable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0",
styleName: "rg-cell-readonly",
},
{
name: "frlvlMnhlCntSum",
fieldName: "frlvlMnhlCntSum",
header: { text: "주철계" },
footer: footerInt,
editable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0",
styleName: "rg-cell-readonly",
},
{
name: "thlvlMnhlCntSum",
fieldName: "thlvlMnhlCntSum",
header: { text: "콘크리트계" },
footer: footerInt,
editable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0",
styleName: "rg-cell-readonly",
},
{
name: "picNm",
fieldName: "picNm",
header: { text: "담당자명" },
editable: false,
styleName: "rg-cell-readonly",
},
{ {
...intCol("wholMnhlCnt", "계", false), ...intCol("wholMnhlCnt", "계", false),
computed: { computed: {
@@ -88,6 +125,12 @@ export const ManholeStatusInpColumn = {
}, },
"admdstNm", "admdstNm",
"emphsMngSeNm", "emphsMngSeNm",
{
name: "adminRefGroup",
hideChildHeaders: false,
header: { text: "행정참고자료" },
items: ["wholMnhlCntSum", "frlvlMnhlCntSum", "thlvlMnhlCntSum", "picNm"],
},
{ {
name: "mtrlGroup", name: "mtrlGroup",
hideChildHeaders: false, hideChildHeaders: false,
@@ -75,6 +75,8 @@ export const PublicSewageTreatWaterReuseInpColumn = {
name: 'lglYn', name: 'lglYn',
fieldName: 'lglYn', fieldName: 'lglYn',
header: { text: '법적의무대상(대상/미대상)' }, header: { text: '법적의무대상(대상/미대상)' },
editable: false,
styleName: 'rg-cell-readonly'
}, },
PUBLIC_SEWAGE_TREAT_WATER_REUSE_LGL_YN_VALUES, PUBLIC_SEWAGE_TREAT_WATER_REUSE_LGL_YN_VALUES,
), ),
@@ -32,11 +32,11 @@ export const getGeneralVerificationColumns = (
}, },
{ {
accessorKey: "vrfcClsfNm", accessorKey: "vrfcClsfNm",
header: "검증분류", header: "검증 분류",
}, },
{ {
accessorKey: "useYn", accessorKey: "useYn",
header: "사용여부", header: "사용 여부",
}, },
{ {
accessorKey: "regDt", accessorKey: "regDt",
@@ -346,7 +346,6 @@ const rawSludgeList = [
decimal1Col("rcycQnt", "재활용"), decimal1Col("rcycQnt", "재활용"),
decimal1Col("olandLfvlm", "육상매립"), decimal1Col("olandLfvlm", "육상매립"),
decimal1Col("incnrQnt", "소각"), decimal1Col("incnrQnt", "소각"),
decimal1Col("oceanInputQnt", "해양투기"),
decimal1Col("fuelQnt", "연료화"), decimal1Col("fuelQnt", "연료화"),
decimal1Col("etcQnt", "기타"), decimal1Col("etcQnt", "기타"),
decimal1Col("unprcsQnt", "미처분량\n(이월량)(C)"), decimal1Col("unprcsQnt", "미처분량\n(이월량)(C)"),
@@ -366,7 +365,6 @@ const rawSludgeList = [
"rcycQnt", "rcycQnt",
"olandLfvlm", "olandLfvlm",
"incnrQnt", "incnrQnt",
"oceanInputQnt",
"fuelQnt", "fuelQnt",
"etcQnt", "etcQnt",
], ],
@@ -491,6 +491,10 @@ const rawList = [
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' }, mergeCells: true, sortdisable: true }, { name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' }, mergeCells: true, sortdisable: true },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, mergeCells: true, sortdisable: true }, { name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, mergeCells: true, sortdisable: true },
{ name: 'emphsMngSeNm', fieldName: 'emphsMngSeNm', header: { text: '집중강우\n중점관리\n구역구분' }, mergeCells: true }, { name: 'emphsMngSeNm', fieldName: 'emphsMngSeNm', header: { text: '집중강우\n중점관리\n구역구분' }, mergeCells: true },
{ name: 'wholMnhlCntSum', fieldName: 'wholMnhlCntSum', header: { text: '맨홀총계' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'frlvlMnhlCntSum', fieldName: 'frlvlMnhlCntSum', header: { text: '주철계' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'thlvlMnhlCntSum', fieldName: 'thlvlMnhlCntSum', header: { text: '콘크리트계' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'picNm', fieldName: 'picNm', header: { text: '담당자명' } },
{ {
name: 'displayYear', name: 'displayYear',
fieldName: 'displayYear', fieldName: 'displayYear',
@@ -544,6 +548,12 @@ const rawList = [
], ],
}, },
'emphsMngSeNm', 'emphsMngSeNm',
{
name: 'adminRefGroup',
hideChildHeaders: false,
header: { text: '행정참고자료' },
items: ['wholMnhlCntSum', 'frlvlMnhlCntSum', 'thlvlMnhlCntSum', 'picNm'],
},
'displayYear', 'displayYear',
{ {
name: 'mtrlGroup', name: 'mtrlGroup',
@@ -17,12 +17,12 @@ const StatsInputStatusInfoColumnRaw = {
styleName: 'rg-cell-outline-action-btn', styleName: 'rg-cell-outline-action-btn',
}, },
{ name: 'chargerNm', fieldName: 'chargerNm', header: { text: '제출자' } }, { name: 'lclgvPicNm', fieldName: 'lclgvPicNm', header: { text: '제출자' } },
{ name: 'chargerCttpc', fieldName: 'chargerCttpc', header: { text: '연락처' } }, { name: 'lclgvPicTelnoCn', fieldName: 'lclgvPicTelnoCn', header: { text: '연락처' } },
{ name: 'submitStatusNm', fieldName: 'submitStatusNm', header: { text: '지자체진행상태' } }, { name: 'lclgvSbmsnSttsNm', fieldName: 'lclgvSbmsnSttsNm', header: { text: '지자체진행상태' } },
{ name: 'submitStatusCd', fieldName: 'submitStatusCd', header: { text: '지자체진행상태코드' }, visible: false }, { name: 'lclgvSbmsnSttsCd', fieldName: 'lclgvSbmsnSttsCd', header: { text: '지자체진행상태코드' }, visible: false },
{ name: 'prvnStatusNm', fieldName: 'prvnStatusNm', header: { text: '진행상태' } }, { name: 'mctpvPicSbmsnSttsNm', fieldName: 'mctpvPicSbmsnSttsNm', header: { text: '진행상태' } },
{ name: 'prvnStatusCd', fieldName: 'prvnStatusCd', header: { text: '진행상태코드' }, visible: false }, { name: 'mctpvPicSbmsnSttsCd', fieldName: 'mctpvPicSbmsnSttsCd', header: { text: '진행상태코드' }, visible: false },
], ],
columnLayout: [ columnLayout: [
@@ -30,14 +30,14 @@ const StatsInputStatusInfoColumnRaw = {
'sggNm', 'sggNm',
'tabNm', 'tabNm',
'reviewHistory', 'reviewHistory',
'chargerNm', 'lclgvPicNm',
'chargerCttpc', 'lclgvPicTelnoCn',
'submitStatusNm', 'lclgvSbmsnSttsNm',
'prvnStatusNm', 'mctpvPicSbmsnSttsNm',
'statsCd', 'statsCd',
'sewerBzmnCd', 'sewerBzmnCd',
'submitStatusCd', 'lclgvSbmsnSttsCd',
'prvnStatusCd' 'mctpvPicSbmsnSttsCd',
] ]
}; };
@@ -710,6 +710,10 @@ const rawSewagePipeTotList = [
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false }, { name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
{ name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역명" }, editable: false }, { name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역명" }, editable: false },
{ name: "emphsMngSeNm", fieldName: "emphsMngSeNm", header: { text: "집중강우\n중점관리\n구역구분" }, editable: false }, { name: "emphsMngSeNm", fieldName: "emphsMngSeNm", header: { text: "집중강우\n중점관리\n구역구분" }, editable: false },
{ name: "wholMnhlCntSum", fieldName: "wholMnhlCntSum", header: { text: "맨홀총계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "frlvlMnhlCntSum", fieldName: "frlvlMnhlCntSum", header: { text: "주철계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "thlvlMnhlCntSum", fieldName: "thlvlMnhlCntSum", header: { text: "콘크리트계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "picNm", fieldName: "picNm", header: { text: "담당자명" }, editable: false },
{ name: "wholMnhlCnt", fieldName: "wholMnhlCnt", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false }, { name: "wholMnhlCnt", fieldName: "wholMnhlCnt", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "frlvlMnhlCnt", fieldName: "frlvlMnhlCnt", header: { text: "주철" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false }, { name: "frlvlMnhlCnt", fieldName: "frlvlMnhlCnt", header: { text: "주철" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "sclvlMnhlCnt", fieldName: "sclvlMnhlCnt", header: { text: "주철(조화)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false }, { name: "sclvlMnhlCnt", fieldName: "sclvlMnhlCnt", header: { text: "주철(조화)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
@@ -720,6 +724,11 @@ const rawSewagePipeTotList = [
columnLayout: [ columnLayout: [
{ name: "addrGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] }, { name: "addrGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"emphsMngSeNm", "emphsMngSeNm",
{
name: "adminRefGroup",
header: { text: "행정참고자료" },
items: ["wholMnhlCntSum", "frlvlMnhlCntSum", "thlvlMnhlCntSum", "picNm"],
},
{ {
name: "mtrlGroup", name: "mtrlGroup",
header: { text: "맨홀뚜껑 재질(개)" }, header: { text: "맨홀뚜껑 재질(개)" },
@@ -16,7 +16,6 @@ export const HumanWasteSludgeTab4ColumnConfig = {
{ name: "rcycQnt", fieldName: "rcycQnt", header: { text: "재활용" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "rcycQnt", fieldName: "rcycQnt", header: { text: "재활용" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "olandLfvlm", fieldName: "olandLfvlm", header: { text: "육상매립" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "olandLfvlm", fieldName: "olandLfvlm", header: { text: "육상매립" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "incnrQnt", fieldName: "incnrQnt", header: { text: "소각" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "incnrQnt", fieldName: "incnrQnt", header: { text: "소각" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "oceanInputQnt", fieldName: "oceanInputQnt", header: { text: "해양투기" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "fuelQnt", fieldName: "fuelQnt", header: { text: "연료화" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "fuelQnt", fieldName: "fuelQnt", header: { text: "연료화" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "etcQnt", fieldName: "etcQnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "etcQnt", fieldName: "etcQnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "unprcsQnt", fieldName: "unprcsQnt", header: { text: "미처분량\n(이월량)(C)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "unprcsQnt", fieldName: "unprcsQnt", header: { text: "미처분량\n(이월량)(C)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
@@ -29,7 +28,7 @@ export const HumanWasteSludgeTab4ColumnConfig = {
{ {
name: "dspsGroup", name: "dspsGroup",
header: { text: "처분량" }, header: { text: "처분량" },
items: ["wholDspsQnt", "rcycQnt", "olandLfvlm", "incnrQnt", "oceanInputQnt", "fuelQnt", "etcQnt"] items: ["wholDspsQnt", "rcycQnt", "olandLfvlm", "incnrQnt", "fuelQnt", "etcQnt"]
}, },
"unprcsQnt", "unprcsQnt",
"swtrmtFcltNm" "swtrmtFcltNm"
+85 -3
View File
@@ -1,4 +1,4 @@
import type { GridView } from "realgrid"; import { type GridView, ValueType } from "realgrid";
import type { import type {
ColumnConfig, ColumnConfig,
@@ -124,6 +124,82 @@ export function getNonEditableColumnFieldNames(
return fieldNames; return fieldNames;
} }
type ExcelImportCell = {
t?: string;
v?: unknown;
w?: string;
};
/** 엑셀 셀 → 그리드 값. NUMBER 컬럼만 숫자화하고, 코드(01)는 문자열로 유지 */
export function parseExcelImportCellValue(
cell: ExcelImportCell | undefined,
valueType?: ColumnConfig["valueType"],
): string | number {
if (!cell || cell.v === undefined || cell.v === null || cell.v === "") {
return "";
}
if (valueType === ValueType.NUMBER) {
if (typeof cell.v === "number" && !Number.isNaN(cell.v)) {
return cell.v;
}
const stringValue = String(cell.v);
const numericValue = Number(stringValue.replace(/,/g, ""));
if (!Number.isNaN(numericValue) && stringValue.trim() !== "") {
return numericValue;
}
return stringValue;
}
const formatted = typeof cell.w === "string" ? cell.w.trim() : "";
if (/^0\d+$/.test(formatted)) {
return formatted;
}
return String(cell.v);
}
function collectZeroPaddedCodeWidths(
rows: Record<string, string | number>[],
): Map<string, number> {
const widthByField = new Map<string, number>();
for (const row of rows) {
for (const [field, value] of Object.entries(row)) {
const s = String(value ?? "").trim();
if (!/^0\d+$/.test(s)) continue;
widthByField.set(field, Math.max(widthByField.get(field) ?? 0, s.length));
}
}
return widthByField;
}
function restoreImportedCodeLeadingZeros(
importedRow: Record<string, string | number>,
existingRow: Record<string, string | number> | undefined,
codeWidthByField: Map<string, number>,
): Record<string, string | number> {
const next: Record<string, string | number> = { ...importedRow };
for (const [field, value] of Object.entries(next)) {
if (value === "" || value == null) continue;
if (typeof value === "number" && !Number.isInteger(value)) continue;
const importedStr = String(value).trim();
if (!/^\d+$/.test(importedStr)) continue;
const existingStr =
existingRow != null ? String(existingRow[field] ?? "").trim() : "";
let width = codeWidthByField.get(field);
if (!width && /^0\d+$/.test(existingStr)) {
width = existingStr.length;
}
if (!width && field.endsWith("Cd") && importedStr.length <= 2) {
width = 2;
}
if (width && importedStr.length < width) {
next[field] = importedStr.padStart(width, "0");
}
}
return next;
}
/** 엑셀 import 결과를 기존 행과 병합 — preserveFieldNames는 기존 그리드 값 유지 */ /** 엑셀 import 결과를 기존 행과 병합 — preserveFieldNames는 기존 그리드 값 유지 */
export function mergeExcelImportWithExistingRows( export function mergeExcelImportWithExistingRows(
existingRows: Record<string, string | number>[], existingRows: Record<string, string | number>[],
@@ -134,14 +210,20 @@ export function mergeExcelImportWithExistingRows(
options?.preserveFieldNames && options.preserveFieldNames.length > 0 options?.preserveFieldNames && options.preserveFieldNames.length > 0
? new Set(options.preserveFieldNames) ? new Set(options.preserveFieldNames)
: null; : null;
const codeWidthByField = collectZeroPaddedCodeWidths(existingRows);
return importedRows.map((importedRow, index) => { return importedRows.map((importedRow, index) => {
const existingRow = existingRows[index]; const existingRow = existingRows[index];
if (!existingRow) return { ...importedRow }; const normalizedImported = restoreImportedCodeLeadingZeros(
importedRow,
existingRow,
codeWidthByField,
);
if (!existingRow) return normalizedImported;
const merged: Record<string, string | number> = { const merged: Record<string, string | number> = {
...existingRow, ...existingRow,
...importedRow, ...normalizedImported,
}; };
if (preserveSet) { if (preserveSet) {
for (const fieldName of preserveSet) { for (const fieldName of preserveSet) {
@@ -0,0 +1,23 @@
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import type {
ImrRequest,
ImrResponse,
rollbackStatusRequest,
} from "@/entities/statistics/model/statistics-interface";
/** 제출 직후 IMR 요청이 실패하면 검증 이전 상태로 롤백 */
export async function callImrServiceWithRollbackOnFailure(
imrParam: ImrRequest,
rollbackParam: rollbackStatusRequest,
): Promise<ImrResponse> {
try {
return await statisticsApi.callImrService(imrParam);
} catch (error) {
try {
await statisticsApi.rollbackStatus(rollbackParam);
} catch {
// 롤백 실패는 IMR 실패를 가리지 않음
}
throw error;
}
}
@@ -0,0 +1,13 @@
import type { Sgg } from "@/entities/statistics/model/statistics-interface";
/** 조회 시군구가 전체(ALL)면 시도의 전체 옵션, 특정 구면 해당 구만 */
export function filterSggOptionsBySearchGugun(
sggOptions: readonly Sgg[],
gugun: string | null | undefined,
): Sgg[] {
const selected = gugun?.trim();
if (!selected || selected === "ALL") {
return [...sggOptions];
}
return sggOptions.filter((s) => s.gugun === selected);
}
@@ -1,6 +1,9 @@
import type { StatisticsInputCommonInfoBase } from "@/entities/statistics/model/statistics-interface"; import type { StatisticsInputCommonInfoBase } from "@/entities/statistics/model/statistics-interface";
import type { VerificationResultLikeMap } from "./verification-result-display"; import {
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "./verification-result-display";
export function isVerificationFailedFromCommonInfo( export function isVerificationFailedFromCommonInfo(
commonInfo: Pick<StatisticsInputCommonInfoBase, "isVerificationFailed"> | null | undefined, commonInfo: Pick<StatisticsInputCommonInfoBase, "isVerificationFailed"> | null | undefined,
@@ -28,6 +31,9 @@ export function patchFooterVerificationByTab(
| undefined, | undefined,
): Map<string, VerificationResultLikeMap | null> { ): Map<string, VerificationResultLikeMap | null> {
const next = new Map(prev); const next = new Map(prev);
next.set(tabKey, commonInfo?.verificationResult ?? null); next.set(
tabKey,
normalizeVerificationResultMap(commonInfo?.verificationResult) ?? null,
);
return next; return next;
} }
@@ -13,6 +13,49 @@ export type VerificationResultLikeMap = Record<
VerificationResultLikeItem[] VerificationResultLikeItem[]
>; >;
/** 입력 조회 verificationResult의 기준값/입력값이 null이면 "-" */
export function displayVerificationCn(
value: string | null | undefined,
): string {
if (value == null || String(value).trim() === "") return "-";
return String(value);
}
export function normalizeVerificationResultItem<T extends VerificationResultLikeItem>(
item: T,
): T {
return {
...item,
nowCn: displayVerificationCn(item.nowCn ?? item.nowVlCn),
cmprCn: displayVerificationCn(item.cmprCn ?? item.compVlCn),
};
}
export function normalizeVerificationResultMap<T extends VerificationResultLikeMap>(
result: T | null | undefined,
): T | undefined {
if (!result || typeof result !== "object") return undefined;
const next = {} as T;
for (const [key, items] of Object.entries(result)) {
(next as VerificationResultLikeMap)[key] = Array.isArray(items)
? items.map((item) => normalizeVerificationResultItem(item))
: [];
}
return next;
}
/** 조회 행/객체에 붙은 verificationResult의 cmprCn·nowCn null을 "-"로 바꿈 */
export function withNormalizedVerificationResult<T extends object>(item: T): T {
if (!("verificationResult" in item) || item.verificationResult == null) {
return item;
}
const verificationResult = normalizeVerificationResultMap(
item.verificationResult as VerificationResultLikeMap,
);
if (!verificationResult) return item;
return { ...item, verificationResult };
}
/** 검증 오류 배열 → RealGrid styleName */ /** 검증 오류 배열 → RealGrid styleName */
export function getVerificationStyleName( export function getVerificationStyleName(
errors: VerificationResultLikeItem[] | null | undefined, errors: VerificationResultLikeItem[] | null | undefined,
@@ -37,8 +80,8 @@ export function formatVerificationTooltip(
: e.vrfcCd === "NV" : e.vrfcCd === "NV"
? "일반검증 - " ? "일반검증 - "
: "모집단 검증 - "; : "모집단 검증 - ";
const comp = e.cmprCn ?? e.compVlCn ?? ""; const comp = displayVerificationCn(e.cmprCn ?? e.compVlCn);
const now = e.nowCn ?? e.nowVlCn ?? ""; const now = displayVerificationCn(e.nowCn ?? e.nowVlCn);
return `${prefix}${e.rsnExpln}\n(검증 기준값: ${comp} / 현재 입력값: ${now})`; return `${prefix}${e.rsnExpln}\n(검증 기준값: ${comp} / 현재 입력값: ${now})`;
}) })
.filter(Boolean) .filter(Boolean)
@@ -56,10 +56,11 @@ export class GeneralverificationApiService implements GeneralverificationService
} }
public async UpdateVrfcMaster( public async UpdateVrfcMaster(
vrfcSn: number,
param: UpdateVrfcMasterRequest, param: UpdateVrfcMasterRequest,
): Promise<UpdateVrfcMasterResponse> { ): Promise<UpdateVrfcMasterResponse> {
const response = await stClient.put<UpdateVrfcMasterResponse>( const response = await stClient.put<UpdateVrfcMasterResponse>(
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/masters/${param.vrfcSn}`, `${ENDPOINT.ST_SERVICE.INPUTVERIFY}/masters/${vrfcSn}`,
param, param,
); );
return response.data; return response.data;
@@ -127,20 +128,22 @@ export class GeneralverificationApiService implements GeneralverificationService
} }
public async RegistVrfcDetail( public async RegistVrfcDetail(
vrfcSn: number,
param: VerifyDetailRegistRequest, param: VerifyDetailRegistRequest,
): Promise<RegistVrfcMasterResponse> { ): Promise<RegistVrfcMasterResponse> {
const response = await stClient.post<RegistVrfcMasterResponse>( const response = await stClient.post<RegistVrfcMasterResponse>(
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/${param.vrfcSn}/details`, `${ENDPOINT.ST_SERVICE.INPUTVERIFY}/${vrfcSn}/details`,
param, param,
); );
return response.data; return response.data;
} }
public async UpdateVrfcDetail( public async UpdateVrfcDetail(
vrfcSn: number,
param: VerifyDetailUpdateRequest, param: VerifyDetailUpdateRequest,
): Promise<RegistVrfcMasterResponse> { ): Promise<RegistVrfcMasterResponse> {
const response = await stClient.put<RegistVrfcMasterResponse>( const response = await stClient.put<RegistVrfcMasterResponse>(
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/${param.vrfcSn}/details`, `${ENDPOINT.ST_SERVICE.INPUTVERIFY}/${vrfcSn}/details`,
param, param,
); );
return response.data; return response.data;
@@ -22,6 +22,8 @@ import type {
SewageSlurgeProcessingFacStatusSubmitRequest, SewageSlurgeProcessingFacStatusSubmitRequest,
SewageSlurgeProcessingFacStatusSubmitResponse, SewageSlurgeProcessingFacStatusSubmitResponse,
SlurgeProcessingFacStatusApiResponse, SlurgeProcessingFacStatusApiResponse,
SlurgeProcessingFacStatusOperationDataUpdateRequest,
SlurgeProcessingFacStatusOperationDataUpdateResponse,
SlurgeProcessingFacStatusSaveRequest, SlurgeProcessingFacStatusSaveRequest,
SlurgeProcessingFacStatusSaveResponse, SlurgeProcessingFacStatusSaveResponse,
SlurgeProcessingFacStatusSubmitRequest, SlurgeProcessingFacStatusSubmitRequest,
@@ -68,6 +70,18 @@ export class StatisticsInputSewageExcretaSlurgeApiService implements StatisticsI
return response.data; return response.data;
} }
/** 찌꺼기(슬러지)처리시설현황 운영 데이터 업데이트 — ST00110001 */
public async updateSlurgeProcessingFacStatusOperationData(
request: SlurgeProcessingFacStatusOperationDataUpdateRequest,
): Promise<SlurgeProcessingFacStatusOperationDataUpdateResponse> {
const response =
await stClient.put<SlurgeProcessingFacStatusOperationDataUpdateResponse>(
`${BASE}/slurge-processing-fac-status/operation-data/update`,
request,
);
return response.data;
}
/** 소화조 운영현황 조회 — ST00110002 */ /** 소화조 운영현황 조회 — ST00110002 */
public async getDigestorOperatingStatusList( public async getDigestorOperatingStatusList(
params: SewageExcretaSlurgeRequestParams, params: SewageExcretaSlurgeRequestParams,
@@ -16,6 +16,8 @@ import {
type ImrStatusResponse, type ImrStatusResponse,
type ReviewerInfoRequest, type ReviewerInfoRequest,
type ReviewerInfoResponse, type ReviewerInfoResponse,
type rollbackStatusRequest,
type rollbackStatusResponse,
type ReviewInputSaveRequest, type ReviewInputSaveRequest,
type ReviewOpinionSaveRequest, type ReviewOpinionSaveRequest,
type ReviewOpinionSaveResponse, type ReviewOpinionSaveResponse,
@@ -100,6 +102,17 @@ export class StatisticsApiService implements StatisticsService {
return response.data; return response.data;
} }
public async getSggAllHeadList(
sidoName: string,
params?: { instSeCd?: string; gugunSkipYn?: "Y" | "N" },
): Promise<ApiResponse<Sgg[]>> {
const response = await stClient.get<ApiResponse<Sgg[]>>(
`${ENDPOINT.ST_SERVICE.COMMON}/sgg-all-head`,
{ params: { sidoName, ...params } },
);
return response.data;
}
/** 통계 입력 기간(연도·분류별) 목록 조회 — 경로는 백엔드 스펙에 맞게 수정 */ /** 통계 입력 기간(연도·분류별) 목록 조회 — 경로는 백엔드 스펙에 맞게 수정 */
public async getStatsInputPeriodList( public async getStatsInputPeriodList(
params?: StatsInputPeriodListRequest, params?: StatsInputPeriodListRequest,
@@ -156,6 +169,17 @@ export class StatisticsApiService implements StatisticsService {
return response.data; return response.data;
} }
// 입력 - 검증 이전 상태로 롤백
public async rollbackStatus(
param: rollbackStatusRequest,
): Promise<rollbackStatusResponse> {
const response = await stClient.put<rollbackStatusResponse>(
`${ENDPOINT.ST_SERVICE.INPUTCOMMON}/rollback-status`,
param,
);
return response.data;
}
public async callImrService(param: ImrRequest): Promise<ImrResponse> { public async callImrService(param: ImrRequest): Promise<ImrResponse> {
const response = await client.post<ImrResponse>( const response = await client.post<ImrResponse>(
`${ENDPOINT.STATVERIFY_SERVICE.IMR}`, `${ENDPOINT.STATVERIFY_SERVICE.IMR}`,
+5
View File
@@ -10,6 +10,11 @@ export { dashboardApi } from "./api/dashboard/dashboard-service";
export { useScheduleInfo } from "./api/dashboard/schedule-info-queries"; export { useScheduleInfo } from "./api/dashboard/schedule-info-queries";
export { scheduleInfoApi } from "./api/dashboard/schedule-info-service"; export { scheduleInfoApi } from "./api/dashboard/schedule-info-service";
export { imrApi } from "./api/imr-api"; export { imrApi } from "./api/imr-api";
export {
JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE,
isJeonnamGwangjuSidoAllSearch,
isJeonnamGwangjuSidoAllToolbarException,
} from "./lib/jeonnam-gwangju-sido-all-toolbar";
export { export {
filterBySelectedAdmdstCd, filterBySelectedAdmdstCd,
findSidoBySearch, findSidoBySearch,
@@ -0,0 +1,45 @@
import { findSidoBySearch, type SidoGugunLookup } from "./sido-gugun";
import type { Sido } from "../model/statistics-interface";
/** 전남광주통합특별시 — 도 목록에 있어 시군구 전체 조회 시 버튼이 숨겨짐 */
export const JEONNAM_GWANGJU_UNIFIED_SIDO_CD = "1200000000";
export const SIDO_ALL_TOOLBAR_USER_IDS = new Set(["CLEANWATER", "S3291"]);
function isEmptyOrAllGugun(values: SidoGugunLookup | null | undefined): boolean {
const gugun = values?.gugun?.trim() ?? "";
return !gugun || gugun === "ALL";
}
function isJeonnamGwangjuUnifiedSido(
sidoList: readonly Sido[] | undefined,
values: SidoGugunLookup | null | undefined,
): boolean {
if (!values) return false;
const sido = findSidoBySearch(sidoList, values);
const cd = (sido?.bsnmCd ?? values.bsnmCd ?? "").trim();
if (cd === JEONNAM_GWANGJU_UNIFIED_SIDO_CD) return true;
return (values.sido ?? "").trim() === "전남광주통합특별시";
}
export const JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE =
"전남광주통합특별시는 시군구를 선택하지 않고 저장 및 제출 시 본청 데이터만 반영됩니다.\n각 시군구의 데이터는 선택 후 새로 조회하여 작성해주세요.";
export function isJeonnamGwangjuSidoAllSearch(
sidoList: readonly Sido[] | undefined,
values: SidoGugunLookup | null | undefined,
): boolean {
return isJeonnamGwangjuUnifiedSido(sidoList, values) && isEmptyOrAllGugun(values);
}
export function isJeonnamGwangjuSidoAllToolbarException(
sidoList: readonly Sido[] | undefined,
values: SidoGugunLookup | null | undefined,
userId: string | null | undefined,
): boolean {
if (!SIDO_ALL_TOOLBAR_USER_IDS.has((userId ?? "").trim().toUpperCase())) {
return false;
}
return isJeonnamGwangjuSidoAllSearch(sidoList, values);
}
@@ -46,7 +46,6 @@ export interface CheckVerificationNameResponse {
} }
export interface UpdateVrfcMasterRequest { export interface UpdateVrfcMasterRequest {
vrfcSn?: number | null;
vrfcNm?: string | null; vrfcNm?: string | null;
vrfcClsfCd?: string | null; vrfcClsfCd?: string | null;
dcptDgt?: number | null; dcptDgt?: number | null;
@@ -184,13 +183,11 @@ export interface VerifyDetailRegistData {
} }
export interface VerifyDetailRegistRequest { export interface VerifyDetailRegistRequest {
vrfcSn: number | null;
detailList: VerifyDetailRegistData[]; detailList: VerifyDetailRegistData[];
rgtrUuid: string; rgtrUuid: string;
} }
export interface VerifyDetailUpdateRequest { export interface VerifyDetailUpdateRequest {
vrfcSn: number | null;
detailList: VerifyDetailRegistData[]; detailList: VerifyDetailRegistData[];
mdfrUuid: string; mdfrUuid: string;
} }
@@ -297,6 +294,7 @@ export interface GeneralverificationService {
param: CheckVerificationNameRequest, param: CheckVerificationNameRequest,
): Promise<CheckVerificationNameResponse>; ): Promise<CheckVerificationNameResponse>;
UpdateVrfcMaster( UpdateVrfcMaster(
vrfcSn: number,
param: UpdateVrfcMasterRequest, param: UpdateVrfcMasterRequest,
): Promise<UpdateVrfcMasterResponse>; ): Promise<UpdateVrfcMasterResponse>;
RegistVrfcMaster( RegistVrfcMaster(
@@ -315,9 +313,11 @@ export interface GeneralverificationService {
param: string, param: string,
): Promise<VerifyColumnListResponse>; ): Promise<VerifyColumnListResponse>;
RegistVrfcDetail( RegistVrfcDetail(
vrfcSn: number,
param: VerifyDetailRegistRequest, param: VerifyDetailRegistRequest,
): Promise<RegistVrfcMasterResponse>; ): Promise<RegistVrfcMasterResponse>;
UpdateVrfcDetail( UpdateVrfcDetail(
vrfcSn: number,
param: VerifyDetailUpdateRequest, param: VerifyDetailUpdateRequest,
): Promise<RegistVrfcMasterResponse>; ): Promise<RegistVrfcMasterResponse>;
CopyVrfcData( CopyVrfcData(
@@ -205,6 +205,23 @@ export interface SlurgeProcessingFacStatusSubmitResponse {
}; };
} }
/** ST00110001 운영 데이터 업데이트 요청 */
export interface SlurgeProcessingFacStatusOperationDataUpdateRequest {
statsYr: string;
ctpvNm: string;
/** 도에서만 사용, 특·광역시는 빈 값 */
sggNm?: string;
sewerBzmnCd: string;
userUuid: string;
}
/** ST00110001 운영 데이터 업데이트 응답 */
export interface SlurgeProcessingFacStatusOperationDataUpdateResponse {
status: string;
message?: string;
data?: unknown | null;
}
/** /**
* ST00110002 조회 `data.digestorOperatingStatusList[]` 한 행. * ST00110002 조회 `data.digestorOperatingStatusList[]` 한 행.
* `DigestorOperatingStatusInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명). * `DigestorOperatingStatusInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명).
@@ -437,7 +454,6 @@ export interface ExcretaSlurgeProcessingStatusItem {
rcycQnt: number; rcycQnt: number;
olandLfvlm: number; olandLfvlm: number;
incnrQnt: number; incnrQnt: number;
oceanInputQnt: number;
fuelQnt: number; fuelQnt: number;
etcQnt: number; etcQnt: number;
unprcsQnt: number; unprcsQnt: number;
@@ -562,6 +578,10 @@ export interface StatisticsInputSewageExcretaSlurgeService {
submitSlurgeProcessingFacStatus( submitSlurgeProcessingFacStatus(
request: SlurgeProcessingFacStatusSubmitRequest, request: SlurgeProcessingFacStatusSubmitRequest,
): Promise<SlurgeProcessingFacStatusSubmitResponse>; ): Promise<SlurgeProcessingFacStatusSubmitResponse>;
/** 찌꺼기(슬러지)처리시설현황 운영 데이터 업데이트 — ST00110001 */
updateSlurgeProcessingFacStatusOperationData(
request: SlurgeProcessingFacStatusOperationDataUpdateRequest,
): Promise<SlurgeProcessingFacStatusOperationDataUpdateResponse>;
/** 소화조 운영현황 조회 — ST00110002 */ /** 소화조 운영현황 조회 — ST00110002 */
getDigestorOperatingStatusList( getDigestorOperatingStatusList(
params: SewageExcretaSlurgeRequestParams, params: SewageExcretaSlurgeRequestParams,
@@ -81,7 +81,6 @@ export interface ReportStatusResponseDto {
lastCfmtnPicTelnoCn?: string | null; lastCfmtnPicTelnoCn?: string | null;
lastCfmtnPicDeptNm?: string | null; lastCfmtnPicDeptNm?: string | null;
lastCfmtnPicJbgdNm?: string | null; lastCfmtnPicJbgdNm?: string | null;
splmntRsltCn?: string | null;
splmntOpnnCn?: string | null; splmntOpnnCn?: string | null;
rjctOpnnCn?: string | null; rjctOpnnCn?: string | null;
} }
@@ -308,7 +308,6 @@ export interface SeweragePipeInputPipeTypeStatusSaveItem {
rmrk: string | null; rmrk: string | null;
lyngPrlgWhol: number; lyngPrlgWhol: number;
dmltnPrlgWhol: number; dmltnPrlgWhol: number;
pipeByPrstWhol: number;
} }
/** 관종별 현황 저장 API 요청 */ /** 관종별 현황 저장 API 요청 */
@@ -420,6 +419,10 @@ export interface SeweragePipeInputManholeStatusItem {
folvlMnhlCnt: number; folvlMnhlCnt: number;
filvlMnhlCnt: number; filvlMnhlCnt: number;
rmrk: string; rmrk: string;
wholMnhlCntSum: number;
frlvlMnhlCntSum: number;
thlvlMnhlCntSum: number;
picNm: string | null;
verificationResult?: SeweragePipeInputVerificationResult; verificationResult?: SeweragePipeInputVerificationResult;
} }
@@ -9,12 +9,12 @@ export interface StatsInputStatusReviewItem {
sewerBzmnCd?: string; sewerBzmnCd?: string;
tabNm?: string; tabNm?: string;
statsCd?: string; statsCd?: string;
submitStatusNm?: string; lclgvPicNm?: string;
prvnStatusNm?: string; lclgvPicTelnoCn?: string;
chargerNm?: string; lclgvSbmsnSttsCd?: string;
chargerCttpc?: string; lclgvSbmsnSttsNm?: string;
submitStatusCd?: string; mctpvPicSbmsnSttsCd?: string;
prvnStatusCd?: string; mctpvPicSbmsnSttsNm?: string;
} }
export interface StatsInputStatusReviewResponseData { export interface StatsInputStatusReviewResponseData {
@@ -37,7 +37,7 @@ export interface ReviewHistoryResponse {
status: string; status: string;
message?: string; message?: string;
data: { data: {
logDt: string; regDt: string;
historyContent: string; historyContent: string;
}[] }[]
} }
@@ -31,6 +31,21 @@ export interface cancelSubmitResponse {
message?: string; message?: string;
} }
/** 검증 이전 상태로 롤백 요청 */
export interface rollbackStatusRequest {
statsYr: string;
statsCd: string;
sewerBzmnCd: string;
rollbackStatusCode: string;
mdfrUuid: string;
}
/** 검증 이전 상태로 롤백 응답 */
export interface rollbackStatusResponse {
status: string;
message?: string;
}
export interface ApiResponse<T> { export interface ApiResponse<T> {
status: string; status: string;
data?: T; data?: T;
@@ -327,7 +342,6 @@ export interface ReviewOpinionDetailItem {
sewerBzmnCd: string; sewerBzmnCd: string;
statsCd: string; statsCd: string;
splmntOpnnCn: string | null; splmntOpnnCn: string | null;
splmntRsltCn: string | null;
mdfrUuid: string | null; mdfrUuid: string | null;
} }
@@ -343,7 +357,6 @@ export interface ReviewOpinionSaveRequest {
sewerBzmnCd: string; sewerBzmnCd: string;
statsCd: string; statsCd: string;
splmntOpnnCn: string; splmntOpnnCn: string;
splmntRsltCn: string;
mdfrUuid: string; mdfrUuid: string;
} }
@@ -388,7 +401,6 @@ export interface ReviewSubmitRequest {
/** 통계항목 단위 제출 시 사용 (통계 입력 현황 일괄 제출에는 미사용) */ /** 통계항목 단위 제출 시 사용 (통계 입력 현황 일괄 제출에는 미사용) */
statsCd?: string; statsCd?: string;
splmntOpnnCn?: string; splmntOpnnCn?: string;
splmntRsltCn?: string;
} }
export interface ReviewSubmitResponse { export interface ReviewSubmitResponse {
@@ -454,7 +466,6 @@ export interface ReviewerInfoResponse {
dpmNm: string; dpmNm: string;
cps: string; cps: string;
splmntOpnnCn: string; splmntOpnnCn: string;
splmntRsltCn: string;
} }
} }
@@ -478,9 +489,8 @@ export interface StatiscicsManagementReviewHistoryItem {
ctpvNm: string; ctpvNm: string;
sggNm: string; sggNm: string;
menuNm: string; menuNm: string;
wrterOpinionSm: string | null; splmntOpnnCn: string | null;
chckerOpinionSm: string | null; rjctOpnnCn: string | null;
returnOpinionSm: string | null;
} }
export interface StatiscicsManagementReviewHistoryResponse { export interface StatiscicsManagementReviewHistoryResponse {
@@ -552,11 +562,13 @@ export interface StatisticsService {
getSidoListInput(params?: { instSeCd?: string }): Promise<ApiResponse<SearchCondition>>; getSidoListInput(params?: { instSeCd?: string }): Promise<ApiResponse<SearchCondition>>;
getSggList(sidoName: string, params?: { instSeCd?: string; gugunSkipYn?: "Y" | "N" }): Promise<ApiResponse<Sgg[]>>; getSggList(sidoName: string, params?: { instSeCd?: string; gugunSkipYn?: "Y" | "N" }): Promise<ApiResponse<Sgg[]>>;
getSggAllList(sidoName: string, params?: { instSeCd?: string; gugunSkipYn?: "Y" | "N" }): Promise<ApiResponse<Sgg[]>>; getSggAllList(sidoName: string, params?: { instSeCd?: string; gugunSkipYn?: "Y" | "N" }): Promise<ApiResponse<Sgg[]>>;
getSggAllHeadList(sidoName: string, params?: { instSeCd?: string; gugunSkipYn?: "Y" | "N" }): Promise<ApiResponse<Sgg[]>>;
getStatsInputPeriodList(params?: StatsInputPeriodListRequest): Promise<StatsInputPeriodListApiResponse>; getStatsInputPeriodList(params?: StatsInputPeriodListRequest): Promise<StatsInputPeriodListApiResponse>;
getStatsInputPeriodDetail(param: StatsInputPeriodDetailRequest): Promise<StatsInputPeriodDetailResponse>; getStatsInputPeriodDetail(param: StatsInputPeriodDetailRequest): Promise<StatsInputPeriodDetailResponse>;
saveStatsInputPeriod(param: StatsInputPeriodSaveRequest): Promise<StatsInputPeriodSaveApiResponse>; saveStatsInputPeriod(param: StatsInputPeriodSaveRequest): Promise<StatsInputPeriodSaveApiResponse>;
deleteStatsInputPeriod(param: StatsInputPeriodDeleteRequest): Promise<StatsInputPeriodDeleteApiResponse>; deleteStatsInputPeriod(param: StatsInputPeriodDeleteRequest): Promise<StatsInputPeriodDeleteApiResponse>;
cancelSubmit(param: cancelSubmitRequest): Promise<cancelSubmitResponse>; cancelSubmit(param: cancelSubmitRequest): Promise<cancelSubmitResponse>;
rollbackStatus(param: rollbackStatusRequest): Promise<rollbackStatusResponse>;
callImrService(param: ImrRequest): Promise<ImrResponse>; callImrService(param: ImrRequest): Promise<ImrResponse>;
submitException(param: SubmitExceptionRequest): Promise<SubmitExceptionResponse>; submitException(param: SubmitExceptionRequest): Promise<SubmitExceptionResponse>;
getLogList(param: StatisticsLogRequest): Promise<StatisticsLogResponse>; getLogList(param: StatisticsLogRequest): Promise<StatisticsLogResponse>;
@@ -127,7 +127,6 @@ export interface HumanWasteSludgeReviewItem {
rcycQnt: number | null; rcycQnt: number | null;
olandLfvlm: number | null; olandLfvlm: number | null;
incnrQnt: number | null; incnrQnt: number | null;
oceanInputQnt: number | null;
fuelQnt: number | null; fuelQnt: number | null;
etcQnt: number | null; etcQnt: number | null;
unprcsQnt: number | null; unprcsQnt: number | null;
@@ -218,7 +217,6 @@ export function mapSewageExcretaSlurgeReviewRows(list: unknown[]): object[] {
rcycQnt: row.rcycQnt ?? 0, rcycQnt: row.rcycQnt ?? 0,
olandLfvlm: row.olandLfvlm ?? 0, olandLfvlm: row.olandLfvlm ?? 0,
incnrQnt: row.incnrQnt ?? 0, incnrQnt: row.incnrQnt ?? 0,
oceanInputQnt: row.oceanInputQnt ?? 0,
fuelQnt: row.fuelQnt ?? 0, fuelQnt: row.fuelQnt ?? 0,
etcQnt: row.etcQnt ?? 0, etcQnt: row.etcQnt ?? 0,
unprcsQnt: row.unprcsQnt ?? 0, unprcsQnt: row.unprcsQnt ?? 0,
@@ -108,5 +108,4 @@ export interface StatsStatusInfo {
mctpvPicSbmsnSttsCd?: string; mctpvPicSbmsnSttsCd?: string;
rjctOpnnCn?: string; rjctOpnnCn?: string;
splmntOpnnCn?: string; splmntOpnnCn?: string;
splmntRsltCn?: string;
} }
@@ -247,6 +247,10 @@ export interface SewagePipeReviewManholeItem {
folvlMnhlCnt: number; folvlMnhlCnt: number;
filvlMnhlCnt: number; filvlMnhlCnt: number;
rmrk: string | null; rmrk: string | null;
wholMnhlCntSum: number;
frlvlMnhlCntSum: number;
thlvlMnhlCntSum: number;
picNm: string | null;
} }
export interface SewagePipeManholeResponseData { export interface SewagePipeManholeResponseData {
@@ -266,5 +270,4 @@ export interface StatsStatusInfo {
mctpvPicSbmsnSttsCd?: string; mctpvPicSbmsnSttsCd?: string;
rjctOpnnCn?: string; rjctOpnnCn?: string;
splmntOpnnCn?: string; splmntOpnnCn?: string;
splmntRsltCn?: string;
} }
@@ -59,7 +59,6 @@ export interface statsStatusInfo {
mctpvPicSbmsnSttsCd?: string; mctpvPicSbmsnSttsCd?: string;
rjctOpnnCn?: string; rjctOpnnCn?: string;
splmntOpnnCn?: string; splmntOpnnCn?: string;
splmntRsltCn?: string;
} }
export interface SewerageSupplyRateReviewResponseData { export interface SewerageSupplyRateReviewResponseData {

Some files were not shown because too many files have changed in this diff Show More