From dfabee3e086eb48001fcd13d46fb04265550012f Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 27 Jul 2025 23:50:24 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=20=EB=8F=8C?= =?UTF-8?q?=EC=95=84=EA=B0=80=EB=8A=94=20=EB=AC=B8=EC=A0=9C=ED=95=B4?= =?UTF-8?q?=EA=B2=B0,=20=EB=8C=80=EC=8B=9C=EB=B3=B4=EB=93=9C=20calData=20?= =?UTF-8?q?=EC=88=98=EC=A0=95,=20=EC=B2=98=EB=A6=AC=EA=B5=AC=EC=97=AD?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20null=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/pages/facilityPrecipitation/page.tsx | 6 +-- apps/fo/app/pages/facilityWaterQlty/page.tsx | 6 +-- apps/fo/app/pages/flowRate/page.tsx | 9 ++--- apps/fo/app/pages/planSewage/page.tsx | 6 +-- apps/fo/app/pages/processArea/page.tsx | 6 +-- apps/fo/app/pages/rdi/page.tsx | 6 +-- apps/fo/app/pages/sewageOccur/page.tsx | 6 +-- apps/fo/app/pages/underWaterInput/page.tsx | 6 +-- apps/fo/app/store/dashboard/index.tsx | 18 ++++----- apps/fo/app/store/facilityWaterQlty/index.tsx | 6 +-- apps/fo/app/store/processArea/index.tsx | 18 ++++++++- apps/fo/app/store/sewageOccur/index.tsx | 38 +++++++++++-------- apps/fo/app/store/underWaterInput/index.tsx | 10 ++++- 13 files changed, 84 insertions(+), 57 deletions(-) diff --git a/apps/fo/app/pages/facilityPrecipitation/page.tsx b/apps/fo/app/pages/facilityPrecipitation/page.tsx index b6df81d04..4d75ed052 100644 --- a/apps/fo/app/pages/facilityPrecipitation/page.tsx +++ b/apps/fo/app/pages/facilityPrecipitation/page.tsx @@ -103,7 +103,7 @@ export default function FacilityPrecipitation() { input.value = ""; } } - searchFacilityPrecipitationList(1, 10, searchYear || "0"); + searchFacilityPrecipitationList(1, 10, "2023"); } // 모달 닫기 @@ -126,9 +126,9 @@ export default function FacilityPrecipitation() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchFacilityPrecipitationList(1, 10, searchYear || "0"); + searchFacilityPrecipitationList(1, 10, "2023"); } - }, [isInit, initializeCommonData, searchFacilityPrecipitationList, searchYear]); + }, [isInit, initializeCommonData, searchFacilityPrecipitationList]); useEffect(() => { if (excelList && excelList.length > 0) { diff --git a/apps/fo/app/pages/facilityWaterQlty/page.tsx b/apps/fo/app/pages/facilityWaterQlty/page.tsx index 079ebce81..6600061d0 100644 --- a/apps/fo/app/pages/facilityWaterQlty/page.tsx +++ b/apps/fo/app/pages/facilityWaterQlty/page.tsx @@ -98,7 +98,7 @@ export default function ProcessFacilitySearch() { input.value = ""; } } - searchFacilityWaterQltyList(1, 10, searchYearValue || "0"); + searchFacilityWaterQltyList(1, 10, "2023"); } // 셀 클릭 시 모달 표시 @@ -131,9 +131,9 @@ export default function ProcessFacilitySearch() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchFacilityWaterQltyList(1, 10, searchYearValue || "0"); + searchFacilityWaterQltyList(1, 10, "2023"); } - }, [isInit, initializeCommonData, searchFacilityWaterQltyList, selectSearchYear]); + }, [isInit, initializeCommonData, searchFacilityWaterQltyList]); useEffect(() => { if (excelList && excelList.length > 0) { diff --git a/apps/fo/app/pages/flowRate/page.tsx b/apps/fo/app/pages/flowRate/page.tsx index eb3ae4fa5..154fe72ef 100644 --- a/apps/fo/app/pages/flowRate/page.tsx +++ b/apps/fo/app/pages/flowRate/page.tsx @@ -89,9 +89,9 @@ export default function ProcessFacilitySearch() { setWidthSize("w-[120%]"); setUpheadList(upHeadList1) // 상태값 설정 + setSearchYearValue("2023"); setFcltCpct(selectUpdownData[0]?.val || "0"); setOperationValue(selectOperationData[0]?.val || "0"); - setSearchYearValue("2023"); // SearchInputSelect 초기화 setFcltyName(""); if (searchInputRef.current) { @@ -100,7 +100,7 @@ export default function ProcessFacilitySearch() { input.value = ""; } } - searchFlowRateList(1, 10, searchYearValue || "0"); + searchFlowRateList(1, 10, "2023"); } // 셀 클릭 시 모달 표시 @@ -126,11 +126,10 @@ export default function ProcessFacilitySearch() { // 시도 데이터 초기화 useEffect(() => { if(!isInit) { - console.log('searchYearValue', searchYearValue, isInit); initializeCommonData(); - searchFlowRateList(1, 10, searchYearValue || "0"); + searchFlowRateList(1, 10, "2023"); } - }, [isInit, initializeCommonData, searchFlowRateList, searchYearValue]); + }, [isInit, initializeCommonData, searchFlowRateList]); useEffect(() => { if (excelList && excelList.length > 0) { diff --git a/apps/fo/app/pages/planSewage/page.tsx b/apps/fo/app/pages/planSewage/page.tsx index e1242956c..1db7f0d3b 100644 --- a/apps/fo/app/pages/planSewage/page.tsx +++ b/apps/fo/app/pages/planSewage/page.tsx @@ -92,7 +92,7 @@ export default function PlanSewage() { input.value = ""; } } - searchPlanSewageList(1, 10, searchYear, ref.current.partValue); + searchPlanSewageList(1, 10, "2023", ref.current.partValue); } /** @@ -101,9 +101,9 @@ export default function PlanSewage() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchPlanSewageList(1, 10, searchYear, ref.current.partValue); + searchPlanSewageList(1, 10, "2023", ref.current.partValue); } - }, [isInit, initializeCommonData, searchYear, searchPlanSewageList]); + }, [isInit, initializeCommonData, searchPlanSewageList]); useEffect(() => { console.log('excelList' , excelList); diff --git a/apps/fo/app/pages/processArea/page.tsx b/apps/fo/app/pages/processArea/page.tsx index 1ec7927c0..441d0b35f 100644 --- a/apps/fo/app/pages/processArea/page.tsx +++ b/apps/fo/app/pages/processArea/page.tsx @@ -85,7 +85,7 @@ export default function ProcessArea() { } } setSearchYearValue("2023"); - searchProcessAreaList(1, 10, '', '', searchYearValue); + searchProcessAreaList(1, 10, '', '', "2023"); } // 셀 클릭 시 모달 표시 @@ -105,9 +105,9 @@ export default function ProcessArea() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchProcessAreaList(1, 10, '', '', selectSearchYear[0]?.val); + searchProcessAreaList(1, 10, '', '', "2023"); } - }, [isInit, initializeCommonData, searchProcessAreaList, selectSearchYear]); + }, [isInit, initializeCommonData, searchProcessAreaList]); useEffect(() => { if (excelList && excelList.length > 0) { diff --git a/apps/fo/app/pages/rdi/page.tsx b/apps/fo/app/pages/rdi/page.tsx index 9fcb84a7d..e10bc3889 100644 --- a/apps/fo/app/pages/rdi/page.tsx +++ b/apps/fo/app/pages/rdi/page.tsx @@ -90,7 +90,7 @@ export default function Rdi() { input.value = ""; } } - searchRdiList(1, 10, searchYear); + searchRdiList(1, 10, "2023"); } @@ -100,9 +100,9 @@ export default function Rdi() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchRdiList(1, 10, selectSearchYear[0]?.val || "0"); + searchRdiList(1, 10, "2023"); } - }, [isInit, initializeCommonData, searchRdiList, selectSearchYear]); + }, [isInit, initializeCommonData, searchRdiList]); useEffect(() => { if (excelList && excelList.length > 0) { diff --git a/apps/fo/app/pages/sewageOccur/page.tsx b/apps/fo/app/pages/sewageOccur/page.tsx index 9c917b681..8b4a46db3 100644 --- a/apps/fo/app/pages/sewageOccur/page.tsx +++ b/apps/fo/app/pages/sewageOccur/page.tsx @@ -106,7 +106,7 @@ export default function PlanSewage() { input.value = ""; } } - searchSewageOccurList(1, 10, searchYear); + searchSewageOccurList(1, 10, "2023"); } // 모달 닫기 @@ -129,9 +129,9 @@ export default function PlanSewage() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchSewageOccurList(1, 10, searchYear || "0"); + searchSewageOccurList(1, 10, "2023"); } - }, [isInit, initializeCommonData, searchSewageOccurList, searchYear]); + }, [isInit, initializeCommonData, searchSewageOccurList]); useEffect(() => { if (excelList && excelList.length > 0) { diff --git a/apps/fo/app/pages/underWaterInput/page.tsx b/apps/fo/app/pages/underWaterInput/page.tsx index 57f47e249..45344755c 100644 --- a/apps/fo/app/pages/underWaterInput/page.tsx +++ b/apps/fo/app/pages/underWaterInput/page.tsx @@ -104,7 +104,7 @@ export default function UnderWaterInput() { input.value = ""; } } - searchUnderWaterList(1, 10, searchYear); + searchUnderWaterList(1, 10, "2023"); } // 모달 닫기 @@ -126,9 +126,9 @@ export default function UnderWaterInput() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchUnderWaterList(1, 10, searchYear); + searchUnderWaterList(1, 10, "2023"); } - }, [isInit, initializeCommonData, searchUnderWaterList, searchYear]); + }, [isInit, initializeCommonData, searchUnderWaterList]); useEffect(() => { if (excelList && excelList.length > 0) { diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx index 89166281a..f69f36b54 100644 --- a/apps/fo/app/store/dashboard/index.tsx +++ b/apps/fo/app/store/dashboard/index.tsx @@ -935,17 +935,17 @@ const changeValue=(operationalStatus, data, keyTxt = 'INFL_AMNT')=>{ const calcValue = (operationalStatus, data, keyTxt='INFL_ASSCT_BFR_WQLT_TP') => { // 연간 operationalStatus.yearAvg = data.yearData ? Number(Math.round(data.yearData['AVG_'+keyTxt] * 1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.yearMax = data.yearData ? Number(Math.round(data.yearData.MAX_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.yearMin = data.yearData ? Number(Math.round(data.yearData.MIN_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.yearMax = data.yearData ? Number(Math.round(data.yearData['MAX_'+keyTxt] * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.yearMin = data.yearData ? Number(Math.round(data.yearData['MIN_'+keyTxt] * 1000) / 1000).toFixed(3).toString() : ''; // 여름 - operationalStatus.summerAll = data.summer ? Number(Math.round(data.summer.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.summerThree = data.summerRainy ? Number(Math.round(data.summerRainy.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.summerRain = data.summerSunny ? Number(Math.round(data.summerSunny.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.summerAll = data.summer ? Number(Math.round(data.summer['AVG_'+keyTxt] * 0.8 * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.summerThree = data.summerRainy ? Number(Math.round(data.summerRainy['AVG_'+keyTxt] * 0.82 * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.summerRain = data.summerSunny ? Number(Math.round(data.summerSunny['AVG_'+keyTxt] * 0.74 * 1000) / 1000).toFixed(3).toString() : ''; // 겨울 - operationalStatus.winterAll = data.winter ? Number(Math.round(data.winter.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.winterSunnyMin = data.winterSunny ? Number(Math.round(data.winterSunny.MIN_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.winterSunnyAvg = data.winterSunny ? Number(Math.round(data.winterSunny.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.winterSunnyMax = data.winterSunny ? Number(Math.round(data.winterSunny.MAX_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.winterAll = data.winter ? Number(Math.round(data.winter['AVG_'+keyTxt] * 1.16*1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.winterSunnyMin = data.winterSunny ? Number(Math.round(data.winterSunny['MIN_'+keyTxt] * 1.2 * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.winterSunnyAvg = data.winterSunny ? Number(Math.round(data.winterSunny['AVG_'+keyTxt] * 1.25 *1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.winterSunnyMax = data.winterSunny ? Number(Math.round(data.winterSunny['MAX_'+keyTxt] * 1.3 *1000) / 1000).toFixed(3).toString() : ''; } type RtnFlowType = { diff --git a/apps/fo/app/store/facilityWaterQlty/index.tsx b/apps/fo/app/store/facilityWaterQlty/index.tsx index b4c60d475..37cc27143 100644 --- a/apps/fo/app/store/facilityWaterQlty/index.tsx +++ b/apps/fo/app/store/facilityWaterQlty/index.tsx @@ -404,8 +404,8 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType if(item.efflWqltTn){ item.efflWqltTn = Number(Math.round(Number(item.efflWqltTn) * 1000)/1000).toFixed(3); } - if(item.inflAssctAftWqltTp){ - item.inflAssctAftWqltTp = Number(Math.round(Number(item.inflAssctAftWqltTp) * 1000)/1000).toFixed(3); + if(item.inflAssctBfrWqltTp){ + item.inflAssctBfrWqltTp = Number(Math.round(Number(item.inflAssctBfrWqltTp) * 1000)/1000).toFixed(3); } if(item.efflWqltTp){ item.efflWqltTp = Number(Math.round(Number(item.efflWqltTp) * 1000)/1000).toFixed(3); @@ -458,7 +458,7 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType 유입TOC: item.inflAssctBfrWqltToc, 유입SS: item.inflAssctBfrWqltSs, 유입TN: item.inflAssctBfrWqltTn, - 유입TP: item.inflAssctAftWqltTp, + 유입TP: item.inflAssctBfrWqltTp, 유출BOD: item.efflWqltBod, 유출TOC: item.efflWqltToc, 유출SS: item.efflWqltSs, diff --git a/apps/fo/app/store/processArea/index.tsx b/apps/fo/app/store/processArea/index.tsx index a43777b1c..ba0f5a749 100644 --- a/apps/fo/app/store/processArea/index.tsx +++ b/apps/fo/app/store/processArea/index.tsx @@ -229,7 +229,8 @@ const fetchFacilityDetailInfo = async (swtrmtFcltCd: string) => { // 시설정보 리스트 데이터 호출(구분 선택 후 시설명 있을 경우) const fetchProcessAreaList = async (pageNo : number, pageSize : number, ctpvNm : string | undefined, sggNm : string | undefined, targetYear : string | undefined ): Promise<{data:ProcessAreaProps[], count:number}> => { try { - targetYear = targetYear ? targetYear : "2024"; + targetYear = targetYear ? targetYear : "2023"; + console.log('targetYear', targetYear); const baseUrl = 'https://apigateway.rsonesoft.com/dc-service/api/v1/nowDmgMtncGnsvy'; const queryParams = new URLSearchParams(); @@ -245,7 +246,7 @@ const fetchProcessAreaList = async (pageNo : number, pageSize : number, ctpvNm : const enrichedData = await Promise.all( res.map(async (item: ProcessAreaProps) => { upHeadList1.forEach((head:TableUpperProps) => { - if (head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') { + /* if (head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') { head.title = '현재\n(' + item.yr + '년)'; } else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') { head.title = '1단계\n(' + item.yrDc1 + '년)'; @@ -257,6 +258,19 @@ const fetchProcessAreaList = async (pageNo : number, pageSize : number, ctpvNm : head.title = '4단계\n(' + item.yrDc4 + '년)'; } else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') { head.title = '기승인\n4단계(' + item.yrDt4 + '년)'; + } */ + if (head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') { + head.title = '현재'; + } else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') { + head.title = '1단계'; + } else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') { + head.title = '2단계'; + } else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') { + head.title = '3단계'; + } else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') { + head.title = '4단계'; + } else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') { + head.title = '기승인\n4단계'; } }); const res = await fetchFacilityDetailInfo(item.swtrmtFcltCd); diff --git a/apps/fo/app/store/sewageOccur/index.tsx b/apps/fo/app/store/sewageOccur/index.tsx index 08b873cca..426030c59 100644 --- a/apps/fo/app/store/sewageOccur/index.tsx +++ b/apps/fo/app/store/sewageOccur/index.tsx @@ -126,7 +126,6 @@ const tempSewageOccurList:modalTableType[] = [] const fetchSewageOccurList = async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => { // 20250701임시시 - console.log("searchYear", searchYear); const tailStr = partCd ? '/'+ partCd + '/' + nameCd + '/' + fcltCpct + '/' + operationValue + (fcltyNm && fcltyNm !== '' ? '/' + fcltyNm : '') : ''; const url = '/fclt/flow/' + pageNo + '/' + pageSize + '/' + searchYear + tailStr; const res = await getFetch('fo', url); @@ -215,7 +214,7 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => { searchSewageOccurList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => { const res = await fetchSewageOccurList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm); const data = res.data; - + console.log('first data : ', data); // Promise.all을 사용하여 모든 비동기 작업이 완료될 때까지 기다림 const calData = await Promise.all(data.map(async (item: SewageOccurProps) => { item.sidoNm = item.lclgvrnmntNm.split(' ')[0]?.toString() || ''; @@ -230,6 +229,9 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => { let chungcunSumFlow = 0; let totWaterUsage = 0; + if(bscFctCd === '11200PB001R'){ + console.log('res2.data : ',res2.data); + } // 강우영향일 계산 (강우량이 3 초과이면 무조건 강우영향일) for(let idx = 0; idx < res2.data.length; idx++) { const item = res2.data[idx]; @@ -243,41 +245,45 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => { } // 이틀 전, 하루 전이 강우영향일(3 이상)인 경우 해당 날도 강우영향일로 설정 - for(let idx = 0; idx < data.length; idx++) { - if(data[idx]) { + for(let idx = 0; idx < res2.data.length; idx++) { + if(res2.data[idx]) { // 하루 전이 강우영향일(3 이상)인 경우 - if(idx > 0 && data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) { - data[idx]!.rainEffectDay = 1; + if(idx > 0 && res2.data[idx-1]?.infoRnDay && Number(res2.data[idx-1]?.infoRnDay.toString().trim()) >= 3) { + res2.data[idx]!.rainEffectDay = 1; } // 이틀 전이 강우영향일(3 이상)인 경우 - if(idx > 1 && data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) { - data[idx]!.rainEffectDay = 1; + if(idx > 1 && res2.data[idx-2]?.infoRnDay && Number(res2.data[idx-2]?.infoRnDay.toString().trim()) >= 3) { + res2.data[idx]!.rainEffectDay = 1; } } } - for(let idx = 0; idx < data.length; idx++) { - if(data[idx] && data[idx]?.rainEffectDay === 1) { + for(let idx = 0; idx < res2.data.length; idx++) { + if(res2.data[idx] && res2.data[idx]?.rainEffectDay === 1) { if(idx > 1){ - if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) { - data[idx]!.infoRnDay = data[idx-1]!.infoRnDay; + if(res2.data[idx-1]?.infoRnDay && Number(res2.data[idx-1]?.infoRnDay.toString().trim()) >= 3) { + res2.data[idx]!.infoRnDay = res2.data[idx-1]!.infoRnDay; } } if(idx > 2){ - if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) { - data[idx]!.infoRnDay = data[idx-2]!.infoRnDay; + if(res2.data[idx-2]?.infoRnDay && Number(res2.data[idx-2]?.infoRnDay.toString().trim()) >= 3) { + res2.data[idx]!.infoRnDay = res2.data[idx-2]!.infoRnDay; } } } } - console.log('calData : ',res2.data); + if(bscFctCd === '11200PB001R'){ + console.log('calData : ',res2.data); + } res2.data.forEach((item: FlowDataItem) => { - if(Number(item.infoRnDay) ===0){ + + if(Number(item.rainEffectDay) === 0){ chungcunSumFlow += Number(item.inflAmnt); sumChungcunDay += 1; } + totWaterUsage += Number(item.inflAmnt); }); const avg = totWaterUsage /res2.count; diff --git a/apps/fo/app/store/underWaterInput/index.tsx b/apps/fo/app/store/underWaterInput/index.tsx index 2d0938a56..90f621193 100644 --- a/apps/fo/app/store/underWaterInput/index.tsx +++ b/apps/fo/app/store/underWaterInput/index.tsx @@ -408,7 +408,13 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy const calData = calRainEffectDay(res.data, 'SUNNY'); let tot = 0, cnt= 0; - console.log('calData : ', calData); + let tmpTot = 0; + + calData.forEach((item: FlowDataItem) => { + tmpTot += Number(item.inflAmnt); + }) + console.log('tmpTot : ', tmpTot/calData.length); + calData.forEach((item: FlowDataItem) => { const month = item.msrDt?.substring(4, 6); const monthIdx = month ? Number(month) - 1 : -1; @@ -428,6 +434,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy let maxWaterUsage = 0; let minWaterUsage = 9999999999; let avgWaterUsage = 0; + console.log('monthData : ', monthData); monthData.forEach((item, index) => { item.usege = item.sum/item.cnt tableData.push({ @@ -447,6 +454,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy }); avgWaterUsage = tot/cnt console.log('avgWaterUsage : ', avgWaterUsage); + console.log('tableData : ', tableData); const newData= [ { msrDt: '평균',