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;