- 미처리하수량 컬럼 추가
- 연 평균 > 연평균
This commit is contained in:
@@ -7,6 +7,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import type { ReturnType } from "../../../../components/common/FacilityTermModalHeader";
|
||||
import FacilityTermModalHeader from "../../../../components/common/FacilityTermModalHeader";
|
||||
import { HeadMakeColSpan } from "../HeadMakeColSpan";
|
||||
import { roundNumber } from "@/app/components/common/DataForm";
|
||||
|
||||
type ModalProps ={
|
||||
fcltyName: string;
|
||||
@@ -74,8 +75,10 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
||||
|
||||
let maxTpInflWqltBod = 0;
|
||||
let maxTpInflWqltTp = 0;
|
||||
let maxNoProcessInflAmnt = 0;
|
||||
let maxInfoRnDay = 0;
|
||||
|
||||
|
||||
// 초기값 설정
|
||||
let minEfflWqltBod = filteredData.length > 0 ? parseNumber(filteredData[0]?.efflWqltBod) : 0;
|
||||
let minEfflWqltTn = filteredData.length > 0 ? parseNumber(filteredData[0]?.efflWqltTn) : 0;
|
||||
@@ -89,9 +92,9 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
||||
let mininflAssctBfrWqltToc = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctBfrWqltToc) : 0;
|
||||
let mininflAssctBfrWqltSs = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctBfrWqltSs) : 0;
|
||||
|
||||
let minTpInflWqltBod = filteredData.length > 0 ? parseNumber(filteredData[0]?.tpInflWqltBod) : 0;
|
||||
let minTpInflWqltTp = filteredData.length > 0 ? parseNumber(filteredData[0]?.tpInflWqltTp) : 0;
|
||||
|
||||
let minTpInflWqltBod = 99999999;
|
||||
let minTpInflWqltTp = 99999999;
|
||||
let minNoProcessInflAmnt = 99999999;
|
||||
let minInfoRnDay = filteredData.length > 0 ? parseNumber(filteredData[0]?.infoRnDay) : 0;
|
||||
|
||||
let avgEfflWqltBod = 0;
|
||||
@@ -108,6 +111,10 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
||||
|
||||
let avgTpInflWqltBod = 0;
|
||||
let avgTpInflWqltTp = 0;
|
||||
let tpInflWqltBodCnt = 0;
|
||||
let tpInflWqltTpCnt = 0;
|
||||
let avgNoProcessInflAmnt = 0;
|
||||
let noProcessInflAmntCnt = 0;
|
||||
|
||||
let avgInfoRnDay = 0;
|
||||
|
||||
@@ -123,9 +130,14 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
||||
const inflAssctBfrWqltToc = parseNumber(item.inflAssctBfrWqltToc);
|
||||
const inflAssctBfrWqltSs = parseNumber(item.inflAssctBfrWqltSs);
|
||||
|
||||
|
||||
const tpInflWqltBod = parseNumber(item.tpInflWqltBod);
|
||||
const tpInflWqltTp = parseNumber(item.tpInflWqltTp);
|
||||
if(item.tpInflWqltBod != null && item.tpInflWqltBod.trim() != '' && item.tpInflWqltBod != undefined ){
|
||||
tpInflWqltBodCnt += 1;
|
||||
}
|
||||
if(item.tpInflWqltTp != null && item.tpInflWqltTp.trim() != '' && item.tpInflWqltTp != undefined ){
|
||||
tpInflWqltTpCnt += 1;
|
||||
}
|
||||
|
||||
const infoRnDay = parseNumber(item.infoRnDay);
|
||||
|
||||
@@ -158,8 +170,14 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
||||
mininflAssctBfrWqltToc = Math.min(mininflAssctBfrWqltToc, inflAssctBfrWqltToc);
|
||||
mininflAssctBfrWqltSs = Math.min(mininflAssctBfrWqltSs, inflAssctBfrWqltSs);
|
||||
|
||||
minTpInflWqltBod = Math.min(minTpInflWqltBod, tpInflWqltBod);
|
||||
minTpInflWqltTp = Math.min(minTpInflWqltTp, tpInflWqltTp);
|
||||
if(item.tpInflWqltBod != null && item.tpInflWqltBod.trim() != '' && item.tpInflWqltBod != undefined ){
|
||||
minTpInflWqltBod = Math.min(minTpInflWqltBod, tpInflWqltBod);
|
||||
avgTpInflWqltBod += tpInflWqltBod;
|
||||
}
|
||||
if(item.tpInflWqltTp != null && item.tpInflWqltTp.trim() != '' && item.tpInflWqltTp != undefined ){
|
||||
minTpInflWqltTp = Math.min(minTpInflWqltTp, tpInflWqltTp);
|
||||
avgTpInflWqltTp += tpInflWqltTp;
|
||||
}
|
||||
|
||||
minInfoRnDay = Math.min(minInfoRnDay, infoRnDay);
|
||||
|
||||
@@ -175,8 +193,13 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
||||
avginflAssctBfrWqltToc += inflAssctBfrWqltToc;
|
||||
avginflAssctBfrWqltSs += inflAssctBfrWqltSs;
|
||||
|
||||
avgTpInflWqltBod += tpInflWqltBod;
|
||||
avgTpInflWqltTp += tpInflWqltTp;
|
||||
if(item.noProcessInflAmnt && item.noProcessInflAmnt.toString().trim() != '' && item.noProcessInflAmnt != undefined){
|
||||
const noProcessInflAmnt = Number(item.noProcessInflAmnt.toString().replaceAll(',',''));
|
||||
avgNoProcessInflAmnt += noProcessInflAmnt;
|
||||
maxNoProcessInflAmnt = Math.max(maxNoProcessInflAmnt, noProcessInflAmnt);
|
||||
minNoProcessInflAmnt = Math.min(minNoProcessInflAmnt, noProcessInflAmnt);
|
||||
noProcessInflAmntCnt +=1;
|
||||
}
|
||||
|
||||
avgInfoRnDay += infoRnDay;
|
||||
});
|
||||
@@ -201,9 +224,10 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
||||
sggNm: "",
|
||||
addr: "",
|
||||
fctCpc: 0,
|
||||
noProcessInflAmnt : roundNumber(avgNoProcessInflAmnt / noProcessInflAmntCnt, 0),
|
||||
infoRnDay: filteredData.length==0?'0.0':(Math.round(avgInfoRnDay / filteredData.length * 10) / 10).toFixed(1),
|
||||
tpInflWqltBod: filteredData.length==0?'0.0':(Math.round(avgTpInflWqltBod / filteredData.length * 10) / 10).toFixed(1),
|
||||
tpInflWqltTp: filteredData.length==0?'0.000':(Math.round(avgTpInflWqltTp / filteredData.length * 1000) / 1000).toFixed(3)
|
||||
tpInflWqltBod: filteredData.length==0?'0.0':(Math.round(avgTpInflWqltBod / tpInflWqltBodCnt * 10) / 10).toFixed(1),
|
||||
tpInflWqltTp: filteredData.length==0?'0.000':(Math.round(avgTpInflWqltTp / tpInflWqltTpCnt * 1000) / 1000).toFixed(3)
|
||||
},
|
||||
{
|
||||
msrDt : '최대',
|
||||
@@ -224,6 +248,7 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
||||
sggNm: "",
|
||||
addr: "",
|
||||
fctCpc: 0,
|
||||
noProcessInflAmnt : roundNumber(maxNoProcessInflAmnt, 0),
|
||||
infoRnDay: Math.round(maxInfoRnDay * 10) / 10?(Math.round(maxInfoRnDay * 10) / 10).toFixed(1):'0.0',
|
||||
tpInflWqltBod: Math.round(maxTpInflWqltBod * 10) / 10?(Math.round(maxTpInflWqltBod * 10) / 10).toFixed(1):'0.0',
|
||||
tpInflWqltTp: Math.round(maxTpInflWqltTp * 1000) / 1000?(Math.round(maxTpInflWqltTp * 1000) / 1000).toFixed(3):'0.000'
|
||||
@@ -247,12 +272,14 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
|
||||
sggNm: "",
|
||||
addr: "",
|
||||
fctCpc: 0,
|
||||
noProcessInflAmnt : roundNumber(minNoProcessInflAmnt, 0),
|
||||
infoRnDay: Math.round(minInfoRnDay * 10) / 10?'0.0':(Math.round(minInfoRnDay * 10) / 10).toFixed(1),
|
||||
tpInflWqltBod: Math.round(minTpInflWqltBod * 10) / 10?'0.0':(Math.round(minTpInflWqltBod * 10) / 10).toFixed(1),
|
||||
tpInflWqltTp: Math.round(minTpInflWqltTp * 1000) / 1000?'0.000':(Math.round(minTpInflWqltTp * 1000) / 1000).toFixed(3)
|
||||
tpInflWqltBod: Math.round(minTpInflWqltBod * 10) / 10 && minTpInflWqltBod != 99999999?(Math.round(minTpInflWqltBod * 10) / 10).toFixed(1):'0.0',
|
||||
tpInflWqltTp: Math.round(minTpInflWqltTp * 1000) / 1000 && minTpInflWqltTp != 99999999?(Math.round(minTpInflWqltTp * 1000) / 1000).toFixed(3):'0.000'
|
||||
},
|
||||
...filteredData
|
||||
];
|
||||
|
||||
return newFilteredData;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Button, TabsContent } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import type { ReturnType } from "../../../../components/common/FacilityTermModalHeader";
|
||||
import { roundUp } from "@/app/store/common";
|
||||
import { roundNumber } from "@/app/components/common/DataForm";
|
||||
|
||||
const tabList = [
|
||||
{ value: 'tab_term_year', label: '연간' },
|
||||
@@ -59,6 +60,7 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
|
||||
let maxreturnAmnt = 0;
|
||||
let maxefflAmnt = 0;
|
||||
let maxinfoRnDay = 0;
|
||||
let maxNoProcessInflAmnt = 0;
|
||||
|
||||
// 초기값 설정
|
||||
let mintotInflAmnt = parseNumber(filteredData[0]?.totInflAmnt);
|
||||
@@ -67,6 +69,7 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
|
||||
let minreturnAmnt = parseNumber(filteredData[0]?.returnAmnt);
|
||||
let minefflAmnt = parseNumber(filteredData[0]?.efflAmnt);
|
||||
let mininfoRnDay = parseNumber(filteredData[0]?.infoRnDay && filteredData[0]?.infoRnDay.toString().trim() !== 'x' ? filteredData[0]?.infoRnDay.toString().trim() : 0);
|
||||
let minNoProcessInflAmnt = 99999999;
|
||||
|
||||
let avgtotInflAmnt = 0;
|
||||
let avginflAmnt = 0;
|
||||
@@ -74,6 +77,8 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
|
||||
let avgreturnAmnt = 0;
|
||||
let avgefflAmnt = 0;
|
||||
let avginfoRnDay = 0;
|
||||
let avgNoProcessInflAmnt = 0;
|
||||
let noProcessInflAmntCnt = 0;
|
||||
|
||||
filteredData.forEach((item: FlowRateModalInterface) => {
|
||||
const totInflAmnt = parseNumber(item.totInflAmnt);
|
||||
@@ -82,6 +87,7 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
|
||||
const returnAmnt = parseNumber(item.returnAmnt);
|
||||
const efflAmnt = parseNumber(item.efflAmnt);
|
||||
const infoRnDay = parseNumber(item.infoRnDay && item.infoRnDay.toString().trim() !== 'x' ? item.infoRnDay.toString().trim() : 0);
|
||||
|
||||
maxtotInflAmnt = Math.max(maxtotInflAmnt, totInflAmnt);
|
||||
maxinflAmnt = Math.max(maxinflAmnt, inflAmnt);
|
||||
maxsumFlow = Math.max(maxsumFlow, sumFlow);
|
||||
@@ -102,16 +108,25 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
|
||||
avgreturnAmnt += returnAmnt;
|
||||
avgefflAmnt += efflAmnt;
|
||||
avginfoRnDay += infoRnDay;
|
||||
|
||||
if(item.noProcessInflAmnt && item.noProcessInflAmnt.toString().trim() != '' && item.noProcessInflAmnt != undefined){
|
||||
const noProcessInflAmnt = Number(item.noProcessInflAmnt.toString().replaceAll(',',''));
|
||||
avgNoProcessInflAmnt += noProcessInflAmnt;
|
||||
maxNoProcessInflAmnt = Math.max(maxNoProcessInflAmnt, noProcessInflAmnt);
|
||||
minNoProcessInflAmnt = Math.min(minNoProcessInflAmnt, noProcessInflAmnt);
|
||||
noProcessInflAmntCnt +=1;
|
||||
}
|
||||
});
|
||||
|
||||
const newFilteredData = [
|
||||
{
|
||||
msrDt: '평균',
|
||||
totInflAmnt: roundUp((avgtotInflAmnt / filteredData.length), 0),
|
||||
inflAmnt: roundUp((avginflAmnt / filteredData.length), 0),
|
||||
sumFlow: roundUp((avgsumFlow / filteredData.length), 0),
|
||||
returnAmnt: roundUp((avgreturnAmnt / filteredData.length), 0),
|
||||
efflAmnt: roundUp((avgefflAmnt / filteredData.length), 0),
|
||||
totInflAmnt: avgtotInflAmnt && avgtotInflAmnt!=0 ? roundUp((avgtotInflAmnt / filteredData.length), 0) : 0,
|
||||
inflAmnt: avginflAmnt && avginflAmnt!=0 ? roundUp((avginflAmnt / filteredData.length), 0) : 0,
|
||||
sumFlow: avgsumFlow && avgsumFlow!=0 ? roundUp((avgsumFlow / filteredData.length), 0) : 0,
|
||||
returnAmnt: avgreturnAmnt && avgreturnAmnt!=0 ? roundUp((avgreturnAmnt / filteredData.length), 0) : 0,
|
||||
efflAmnt: avgefflAmnt && avgefflAmnt!=0 ? roundUp((avgefflAmnt / filteredData.length), 0) : 0,
|
||||
noProcessInflAmnt : roundNumber(avgNoProcessInflAmnt / noProcessInflAmntCnt, 0),
|
||||
infoRnDay: avginfoRnDay > 0 ? roundUp((avginfoRnDay / filteredData.length), 1) : '0.0',
|
||||
rainEffectDay: 0,
|
||||
},
|
||||
@@ -122,6 +137,7 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
|
||||
sumFlow: roundUp(maxsumFlow, 0),
|
||||
returnAmnt: roundUp(maxreturnAmnt, 0),
|
||||
efflAmnt: roundUp(maxefflAmnt, 0),
|
||||
noProcessInflAmnt : roundNumber(maxNoProcessInflAmnt, 0),
|
||||
infoRnDay: maxinfoRnDay > 0 ? roundUp(maxinfoRnDay, 1) : '0.0',
|
||||
rainEffectDay: 0,
|
||||
},
|
||||
@@ -132,6 +148,7 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
|
||||
sumFlow: roundUp(minsumFlow, 0),
|
||||
returnAmnt: roundUp(minreturnAmnt, 0),
|
||||
efflAmnt: roundUp(minefflAmnt, 0),
|
||||
noProcessInflAmnt : roundNumber(minNoProcessInflAmnt, 0),
|
||||
infoRnDay: mininfoRnDay > 0 ? roundUp(mininfoRnDay, 1) : '0.0',
|
||||
rainEffectDay: 0,
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getFetch } from "@/app/components/api";
|
||||
import DataForm from "@/app/components/common/DataForm";
|
||||
import DataForm, { roundNumber } from "@/app/components/common/DataForm";
|
||||
import type { TableUpperProps } from "../dashboard";
|
||||
import CalcRainEffect from "@/app/components/common/CalcRainEffect";
|
||||
export type { TableUpperProps };
|
||||
@@ -54,6 +54,7 @@ export interface FacilityWaterQltyProps {
|
||||
tpInflWqltTp: string | '',
|
||||
tpInflWqltEclgyTox: string | '',
|
||||
tpInflWqltClfgrpcnt: string | '',
|
||||
noProcessInflAmnt : string | number | '',
|
||||
}
|
||||
export interface ExcelType {
|
||||
시설코드: string,
|
||||
@@ -209,6 +210,7 @@ const upHeadListModalYear: TableUpperProps[] = [
|
||||
{ id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe2", upSequnce: 3, align: "right" },
|
||||
{ id: "efflWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe2", upSequnce: 2, align: "right" },
|
||||
{ id: "efflWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe2", upSequnce: 3, align: "right" },
|
||||
{ id: "noProcessInflAmnt", title: "미처리하수량\n(m³/일)", align:"right"},
|
||||
{ id: "infoRnDay", title: "강우량\n(mm/일)", align: "right" }
|
||||
];
|
||||
|
||||
@@ -577,6 +579,32 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
|
||||
// facilityPrecipitation의 rainEffectDay 계산 로직을 적용
|
||||
const data = CalcRainEffect(res.data.wqltObjs);
|
||||
|
||||
/**
|
||||
* [(강우시 일별유입유량*강우시 일별유입BOD)-(청천시 연평균유입유량*청천시 연평균유입BOD)]
|
||||
/강우시 일별유입BOD)
|
||||
*/
|
||||
//let rainInflAmnt = 0;
|
||||
let sunnyInflAmnt = 0;
|
||||
let sunnyBod = 0;
|
||||
//let rainDay = 0;
|
||||
let sunnyDay = 0;
|
||||
|
||||
data.forEach(item => {
|
||||
if(item.rainEffectDay == 1){
|
||||
//rainDay += 1;
|
||||
//rainInflAmnt += Number(item.inflAmnt);
|
||||
} else {
|
||||
sunnyDay += 1;
|
||||
sunnyInflAmnt += Number(item.inflAmnt);
|
||||
sunnyBod += Number(item.inflAssctBfrWqltBod);
|
||||
}
|
||||
});
|
||||
|
||||
//const yearRainAmnt = rainInflAmnt===0?0:rainInflAmnt / rainDay;
|
||||
const yearSunnyAmnt = sunnyInflAmnt===0?0:sunnyInflAmnt / sunnyDay;
|
||||
const yearSunnyBod = sunnyBod===0?0:sunnyBod / sunnyDay;
|
||||
//
|
||||
|
||||
const rtnData = data.map((item: FacilityWaterQltyProps) => {
|
||||
dataFormSetting(item)
|
||||
if(item.inflAssctBfrWqltTn) {
|
||||
@@ -626,7 +654,11 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
|
||||
}else{
|
||||
item.tpInflWqltTp = '';
|
||||
}
|
||||
|
||||
|
||||
const dayBod = Number(item.inflAssctBfrWqltBod);
|
||||
const noProcessInflAmnt = roundNumber(((Number(item.inflAmnt) * dayBod) - (yearSunnyAmnt * yearSunnyBod)) / dayBod, 0)
|
||||
item.noProcessInflAmnt = noProcessInflAmnt && Number(noProcessInflAmnt.replaceAll(',','')) > 0 ? noProcessInflAmnt : '';
|
||||
|
||||
return item;
|
||||
})
|
||||
set((state: FacilityWaterQltyType) => ({
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { getFetch } from "@/app/components/api";
|
||||
import type { TableUpperProps } from "../dashboard";
|
||||
import DataForm from "@/app/components/common/DataForm";
|
||||
import DataForm, { roundNumber } from "@/app/components/common/DataForm";
|
||||
import CalcRainEffect from "@/app/components/common/CalcRainEffect";
|
||||
import { fetchFacilityWaterQltyListHist } from "../facilityWaterQlty";
|
||||
|
||||
/**====================================
|
||||
* Store - 타입
|
||||
@@ -71,6 +72,7 @@ export interface FlowRateModalInterface {
|
||||
efflAmnt : number | '',
|
||||
infoRnDay : number | string | '',
|
||||
rainEffectDay : number | string | '' ,
|
||||
noProcessInflAmnt : number | string | ''
|
||||
}
|
||||
export type FlowRateModalProps = {
|
||||
msrDt : string,
|
||||
@@ -81,6 +83,7 @@ export type FlowRateModalProps = {
|
||||
efflAmnt : number,
|
||||
infoRnDay : number | string | '',
|
||||
rainEffectDay : number | string | '',
|
||||
noProcessInflAmnt : number | string | ''
|
||||
}
|
||||
|
||||
/**====================================
|
||||
@@ -155,6 +158,7 @@ const upHeadListFlowRateModal:TableUpperProps[] = [
|
||||
{ id: "sumFlow", title: "연계처리량(m³/일)", align:"right"},
|
||||
{ id: "returnAmnt", title: "총인 반류수량(m³/일)", align:"right"},
|
||||
{ id: "efflAmnt", title: "방류량(m³/일)", align:"right"},
|
||||
{ id: "noProcessInflAmnt", title: "미처리하수량(m³/일)", align:"right"},
|
||||
{ id: "infoRnDay", title: "강우량(mm/일)", align:"right"}
|
||||
]
|
||||
|
||||
@@ -166,7 +170,8 @@ const modalFlowRateListYear:FlowRateModalProps[] = [
|
||||
====================================*/
|
||||
const fetchFlowRateList = async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
||||
try {
|
||||
const tailStr = partCd ? '/'+ partCd + '/' + nameCd + '/' + fcltCpct + '/' + operationValue + (fcltyNm && fcltyNm !== '' ? '/' + fcltyNm : '') : ''; const url = '/fclt/flow/' + pageNo + '/' + pageSize + '/' + searchYear + tailStr;
|
||||
const tailStr = partCd ? '/'+ partCd + '/' + nameCd + '/' + fcltCpct + '/' + operationValue + (fcltyNm && fcltyNm !== '' ? '/' + fcltyNm : '') : '';
|
||||
const url = '/fclt/flow/' + pageNo + '/' + pageSize + '/' + searchYear + tailStr;
|
||||
const res = await getFetch('fo', url);
|
||||
return { data: res.data, count: res.count }
|
||||
} catch (error) {
|
||||
@@ -319,10 +324,43 @@ export const flowRateSearchReducer:(set:(fn: (state: FlowRateSearchType) => Flow
|
||||
},
|
||||
searchFlowRateModalList: async (bscFctCd: string, searchYear: string) => {
|
||||
const res = await fetchFlowRateModalList(bscFctCd, searchYear);
|
||||
const data = CalcRainEffect(res.data);
|
||||
console.log(data);
|
||||
const rtnData = data.map((item: FlowRateModalProps) => {
|
||||
item.totInflAmnt = Number(item.inflAmnt || 0) + Number(item.sumFlow || 0) + Number(item.returnAmnt || 0)
|
||||
const inflData = CalcRainEffect(res.data);
|
||||
|
||||
const res2 = await fetchFacilityWaterQltyListHist(searchYear, bscFctCd);
|
||||
const wqltData = CalcRainEffect(res2?.data.wqltObjs);
|
||||
|
||||
/**
|
||||
* [(강우시 일별유입유량*강우시 일별유입BOD)-(청천시 연평균유입유량*청천시 연평균유입BOD)]
|
||||
/강우시 일별유입BOD)
|
||||
*/
|
||||
//let rainInflAmnt = 0;
|
||||
let sunnyInflAmnt = 0;
|
||||
let sunnyBod = 0;
|
||||
//let rainDay = 0;
|
||||
let sunnyDay = 0;
|
||||
|
||||
inflData.forEach(item => {
|
||||
if(item.rainEffectDay == 1){
|
||||
//rainDay += 1;
|
||||
//rainInflAmnt += Number(item.inflAmnt);
|
||||
} else {
|
||||
const msrDt = item.msrDt.replaceAll('-','');
|
||||
sunnyDay += 1;
|
||||
sunnyInflAmnt += Number(item.inflAmnt);
|
||||
sunnyBod += Number(wqltData.filter((wqitem)=>wqitem.msrDt === msrDt)[0].inflAssctBfrWqltBod);
|
||||
}
|
||||
});
|
||||
|
||||
//const yearRainAmnt = rainInflAmnt===0?0:rainInflAmnt / rainDay;
|
||||
const yearSunnyAmnt = sunnyInflAmnt===0?0:sunnyInflAmnt / sunnyDay;
|
||||
const yearSunnyBod = sunnyBod===0?0:sunnyBod / sunnyDay;
|
||||
|
||||
const rtnData = inflData.map((item: FlowRateModalProps) => {
|
||||
const dayBod = Number(wqltData.filter(wqitem=>wqitem.msrDt === item.msrDt.replaceAll('-',''))[0].inflAssctBfrWqltBod);
|
||||
const noProcessInflAmnt = roundNumber(((Number(item.inflAmnt) * dayBod) - (yearSunnyAmnt * yearSunnyBod)) / dayBod, 0)
|
||||
|
||||
item.totInflAmnt = Number(item.inflAmnt || 0) + Number(item.sumFlow || 0) + Number(item.returnAmnt || 0);
|
||||
item.noProcessInflAmnt = noProcessInflAmnt && Number(noProcessInflAmnt.replaceAll(',','')) > 0 ? noProcessInflAmnt : '';
|
||||
dataFormSetting(item);
|
||||
return item;
|
||||
});
|
||||
|
||||
@@ -40,7 +40,7 @@ const upHeadList1:TableUpperProps[] = [
|
||||
{ id: "bscFctNm", title: "시설명", row:0, rowSpan:2 },
|
||||
{ id: "daddr", title: "주소", row:0, rowSpan:2 },
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", align:"right", row:0, rowSpan:2 },
|
||||
{ id: "inflAmnt", title: "연 평균유입하수량(m³/일)", align:"right", row:0, rowSpan:2 },
|
||||
{ id: "inflAmnt", title: "연평균유입하수량(m³/일)", align:"right", row:0, rowSpan:2 },
|
||||
{ id: "C", title: "지하수 유입량 추정", align:"right", row:0, colSpan:3 },
|
||||
{ id: "underWaterInputYear", title: "연간\n(m³/일)", align:"right", row:1 },
|
||||
{ id: "underWaterInputSummer", title: "하절기\n(m³/일)", align:"right", row:1 },
|
||||
@@ -56,7 +56,7 @@ const upHeadList2:TableUpperProps[] = [
|
||||
{ id: "bscFctNm", title: "시설명", row:0, rowSpan:2 },
|
||||
{ id: "daddr", title: "주소", row:0, rowSpan:2 },
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", align:"right", row:0, rowSpan:2 },
|
||||
{ id: "inflAmnt", title: "연 평균유입하수량(m³/일)", align:"right", row:0, rowSpan:2 },
|
||||
{ id: "inflAmnt", title: "연평균유입하수량(m³/일)", align:"right", row:0, rowSpan:2 },
|
||||
{ id: "C", title: "지하수 유입량 추정", align:"right", row:0, colSpan:3 },
|
||||
{ id: "underWaterInputYear", title: "연간\n(m³/일)", align:"right", row:1 },
|
||||
{ id: "underWaterInputSummer", title: "하절기\n(m³/일)", align:"right", row:1 },
|
||||
@@ -76,7 +76,7 @@ const upHeadList3:TableUpperProps[] = [
|
||||
{ id: "bscFctNm", title: "시설명", row:0, rowSpan:2 },
|
||||
{ id: "daddr", title: "주소", row:0, rowSpan:2 },
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", align:"right", row:0, rowSpan:2 },
|
||||
{ id: "inflAmnt", title: "연 평균유입하수량(m³/일)", align:"right", row:0, rowSpan:2 },
|
||||
{ id: "inflAmnt", title: "연평균유입하수량(m³/일)", align:"right", row:0, rowSpan:2 },
|
||||
{ id: "C", title: "지하수 유입량 추정", align:"right", row:0, colSpan:3 },
|
||||
{ id: "underWaterInputYear", title: "연간\n(m³/일)", align:"right", row:1 },
|
||||
{ id: "underWaterInputSummer", title: "하절기\n(m³/일)", align:"right", row:1 },
|
||||
@@ -426,9 +426,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
|
||||
minWaterUsage = 0;
|
||||
}
|
||||
|
||||
console.log('tot', tot, 'calData.length', calData.length);
|
||||
avgWaterUsage = tot/cnt;
|
||||
console.log(avgWaterUsage);
|
||||
const newData= [
|
||||
{
|
||||
msrDt: '평균',
|
||||
|
||||
Reference in New Issue
Block a user