From 7fb9454c74415550cace91d1b65b3b627a3a5d21 Mon Sep 17 00:00:00 2001 From: jsyang Date: Fri, 5 Sep 2025 14:17:23 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A3=BC=EC=9A=94=EA=B7=B8=EB=9E=98=ED=94=84?= =?UTF-8?q?=20=EC=8B=9C=EC=84=A4=EC=9A=A9=EB=9F=89=20>=20=EC=A7=80?= =?UTF-8?q?=ED=95=98=EC=88=98=EC=9C=A0=EC=9E=85=EB=9F=89=20=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../(with-layout)/dashboard/maingraph/page.tsx | 2 +- .../app/pages/(with-layout)/dashboard/page.tsx | 2 +- apps/fo/app/store/dashboard/index.tsx | 16 +++++++++++++++- apps/fo/app/store/underWaterInput/index.tsx | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/apps/fo/app/pages/(with-layout)/dashboard/maingraph/page.tsx b/apps/fo/app/pages/(with-layout)/dashboard/maingraph/page.tsx index 3f193e035..b0759e336 100644 --- a/apps/fo/app/pages/(with-layout)/dashboard/maingraph/page.tsx +++ b/apps/fo/app/pages/(with-layout)/dashboard/maingraph/page.tsx @@ -63,7 +63,7 @@ export default function DashBoardChart({searchYear = '', fcltyList = []}: facili color: colors[2], }, lineVal0: { - label: '시설용량', + label: '지하수유입량', color: colors[1], }, lineVal1: { diff --git a/apps/fo/app/pages/(with-layout)/dashboard/page.tsx b/apps/fo/app/pages/(with-layout)/dashboard/page.tsx index 2003addee..7a2c3d8a0 100644 --- a/apps/fo/app/pages/(with-layout)/dashboard/page.tsx +++ b/apps/fo/app/pages/(with-layout)/dashboard/page.tsx @@ -240,7 +240,7 @@ export default function DashBoard() { const sheetParameter = [ { - data: [['날짜', '강수량', '유입하수량', '시설용량', '유입BOD', '유입T-P','총인유입T-P', '방류T-P', '유입T-N', '방류T-N'],...yearValueData], + data: [['날짜', '강수량', '유입하수량', '지하수유입량', '유입BOD', '유입T-P','총인유입T-P', '방류T-P', '유입T-N', '방류T-N'],...yearValueData], headerNum: 1, headerRange: 'A1:J1', sheetName: '주요그래프' diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx index b263c2288..f07e8a933 100644 --- a/apps/fo/app/store/dashboard/index.tsx +++ b/apps/fo/app/store/dashboard/index.tsx @@ -1868,6 +1868,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) const res = await fetchMainGraph(searchYear, fcltyCd); const res2 = await fetchFacilityWaterQltyInfo(fcltyCd); + let chungcunSumFlow = 0; + const calData = CalcRainEffect(res.data.wqltObjs, 'SUNNY') + calData.forEach((flowItem: any) => { + chungcunSumFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0; + }); + const usage = chungcunSumFlow&&chungcunSumFlow>0?chungcunSumFlow / calData.length:0; + + //bscFctCd === '11200PB001R') 중랑 - 테스트할 때 코드넣고 해야 보기편해요~ + /* if(bscFctCd === '11200PB001R') { + console.log('calData.length : ', calData.length); + console.log('usage : ', usage, 'summerUsage : ', summerUsage, 'winterUsage : ', winterUsage); + } */ + const underWaterInputYear = Math.round((usage-(usage*0.65*OSU_PERCENT)) * 1) / 1; + // 법적방류수질 데이터 const sortedWaterQltyInfo = [...res2].sort((a, b) => { // 숫자로 변환하여 비교 @@ -1908,7 +1922,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) const chart_inflowRain = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({ label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8), barVal0: item.infoRnDay ?? 0, - lineVal0: item.fctCpc ?? 0, + lineVal0: underWaterInputYear, lineVal1: item.inflAmnt ?? 0, })); diff --git a/apps/fo/app/store/underWaterInput/index.tsx b/apps/fo/app/store/underWaterInput/index.tsx index 816860469..dc29412ad 100644 --- a/apps/fo/app/store/underWaterInput/index.tsx +++ b/apps/fo/app/store/underWaterInput/index.tsx @@ -288,6 +288,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy const bscFctCd = item.bscFctCd; const res2 = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear) as ApiResponse; const calData = CalcRainEffect(res2.data, 'SUNNY'); + let chungcunSumFlow = 0; let sumSummerChungcunDay = 0;