diff --git a/apps/wr/app/stats/rainStat/page.tsx b/apps/wr/app/stats/rainStat/page.tsx index da593e073..8da063a90 100644 --- a/apps/wr/app/stats/rainStat/page.tsx +++ b/apps/wr/app/stats/rainStat/page.tsx @@ -93,7 +93,7 @@ export default function RainStat() { // 법정 대상 건축물 개수 (인덱스 6이 'Y'인 경우) const bumCnt = rainDetailList.filter((data: unknown[]) => Array.isArray(data) && data.length > 6 && String(data[0]) === sidoText - ).filter((data: unknown[]) => String(data[6]) === 'Y').length; + ).filter((data: unknown[]) => String(data[6]) === '대상').length; sidoData[i] = bumCnt; } else if(i==8){ const value = Number(item[8]) || 0; @@ -182,7 +182,7 @@ export default function RainStat() {
- + <Title title={"빗물이용시설 통계"} /> <SearchDiv> <div className="grid grid-cols-12 gap-5 m-4"> <div className="col-span-2"> diff --git a/apps/wr/app/stats/rswtStat/page.tsx b/apps/wr/app/stats/rswtStat/page.tsx index 6b51f53f5..bd1c3f363 100644 --- a/apps/wr/app/stats/rswtStat/page.tsx +++ b/apps/wr/app/stats/rswtStat/page.tsx @@ -82,11 +82,10 @@ export default function RswtStat() { const sidoList = new Set(); const sidoDataMap = new Map(); // 시도별 데이터를 저장할 Map - console.log("rswtDetailList : ", rswtDetailList); rswtDetailList.forEach((item: RswtStatProps[]) => { const sidoVal = item.at(0)?.toString().trim(); const sigunVal = item.at(1)?.toString().trim(); - + const bdstVal = item.at(2)?.toString().trim(); let sidoText = ''; let sigunText = ''; @@ -140,7 +139,7 @@ export default function RswtStat() { // 법정 대상 건축물 개수 (인덱스 6이 'Y'인 경우) const bumCnt = rswtDetailList.filter((data: unknown[]) => Array.isArray(data) && data.length > 6 && String(data[0]) === sidoText - ).filter((data: unknown[]) => String(data[6]) === 'Y').length; + ).filter((data: unknown[]) => String(data[6]) === '대상').length; sidoData[i] = bumCnt; } else if(i==9){ const value = Number(item[9]) || 0; @@ -151,7 +150,10 @@ export default function RswtStat() { } else if(i==11){ const value = Number(item[11]) || 0; sidoData[i] = (Number(sidoData[i]) + value) as string | number; - } else if(i==13){ + } else if(i==12){ + const value = Number(item[12]) || 0; + sidoData[i] = (Number(sidoData[i]) + value) as string | number; + }else if(i==13){ const value = Number(item[13]) || 0; sidoData[i] = (Number(sidoData[i]) + value) as string | number; } else if(i==14){ @@ -168,7 +170,6 @@ export default function RswtStat() { }); // Map을 배열로 변환 const sidoSummaryList = Array.from(sidoDataMap.values()); - console.log("sidoSummaryList : ", sidoSummaryList) // sidoSummaryList와 rainDetailList를 합쳐서 엑셀 데이터 생성 const excelData = [...sidoSummaryList, ...rswtDetailList]; @@ -185,7 +186,7 @@ export default function RswtStat() { <ContentsDiv> <div className="grid grid-cols-4 gap-4"> <div className="col-span-4"> - <Title title="재이용 통계" /> + <Title title="중수도시설 통계" /> <SearchDiv> <div className="grid grid-cols-12 gap-5 m-4"> <div className="col-span-2"> diff --git a/apps/wr/app/store/stats/rainStat/excel.tsx b/apps/wr/app/store/stats/rainStat/excel.tsx index 35a918d83..db2099d9a 100644 --- a/apps/wr/app/store/stats/rainStat/excel.tsx +++ b/apps/wr/app/store/stats/rainStat/excel.tsx @@ -1,39 +1,40 @@ import type { RainStatProps } from "."; -export const excelRainStat = (excelList:RainStatProps[]) : string[][] => { - const excelData: string[][] = []; +export const excelRainStat = (excelList:RainStatProps[]) : (string | number)[][] => { + const excelData: (string | number)[][] = []; excelList.forEach((item) => { excelData.push([ //시도 - String(item.ctpvCd) ?? "", + item.ctpvCd ?? "", //시군구 - String(item.sggCd) ?? "", + item.sggCd ?? "", //행정구역명 String(item.areaNm) ?? "", //시설명 String(item.bdstNm) ?? "", - //건축물용도코드 - String(item.bdstUsgCd) ?? "", + //건축물용도코드 (값 없음) + //String(item.bdstUsgCd) ?? "", + "", //주소 String(item.daddr) ?? "", //법적의무대상여부 - String(item.lawTrgtYn) ?? "", + String(item.lawTrgtYn)==="Y" ? "대상" : "미대상", //설치완료일자 - String(item.instlCmptnDt) ?? "", + String(item.instlCmptnDt).substring(0, 10) ?? "", //설치비용 - String(item.instlCst) ?? "", + item.instlCst ?? "", //접수면종류 String(item.pntfColKnd) ?? "", //여과등처리시설유무 String(item.filtrTrtmfctYn) ?? "", //처리용량(저류조용량) - String(item.dtfcltCpct) ?? "", + item.dtfcltCpct ?? "", //연간사용량 - String(item.wtrUsqty) ?? "", + item.wtrUsqty ?? "", //이용용도코드 - String(item.utztnUsgCd) ?? "", + item.utztnUsgCd ?? "", //연간운영비 - String(item.anlOperCst) ?? "", + item.anlOperCst ?? "", ]); }); return excelData; diff --git a/apps/wr/app/store/stats/rswtStat/excel.tsx b/apps/wr/app/store/stats/rswtStat/excel.tsx index d47e0e3fe..35f567253 100644 --- a/apps/wr/app/store/stats/rswtStat/excel.tsx +++ b/apps/wr/app/store/stats/rswtStat/excel.tsx @@ -1,7 +1,7 @@ import type { RswtStatProps } from "."; -export const excelRswtStat = (excelList:RswtStatProps[]) : string[][] => { - const excelData: string[][] = []; +export const excelRswtStat = (excelList:RswtStatProps[]) : (string | number)[][] => { + const excelData: (string | number)[][] = []; excelList.forEach((item) => { excelData.push([ //시도 @@ -18,28 +18,28 @@ export const excelRswtStat = (excelList:RswtStatProps[]) : string[][] => { //주소 String(item.daddr) ?? "", //법적의무대상여부 - String(item.lawTrgtYn) ?? "", + String(item.lawTrgtYn)==="Y" ? "대상" : "미대상", //설치완료일자 - String(item.instlCmptnDt) ?? "", + item.instlCmptnDt ? String(item.instlCmptnDt).substring(0, 10) : "", //가동개시일(빈칸) //String(item.instlCst) ?? "", "", //건축물면적 - String(item.archArea) ?? "", + item.archArea ?? "", //처리용량 - String(item.filtrTrtmfctCpct) ?? "", + item.filtrTrtmfctCpct ?? "", //물사용량 - String(item.wtrUsqty) ?? "", + item.wtrUsqty ?? "", //중수도+대체수이용량 - String(item.rswtAltSum) ?? "", + item.rswtAltSum ?? "", //중수도이용량 - String(item.rswtrUsqty) ?? "", + item.rswtrUsqty ?? "", //대체수이용량 - String(item.altUswtrUtztnQnt) ?? "", + item.altUswtrUtztnQnt ?? "", //중수도용도 String(item.utztnUsgCd) ?? "", //연간운영비 - String(item.anlOperCst) ?? "", + item.anlOperCst ?? "", ]); }); return excelData;