유량현황 데이터 맞추는 작업 완료 , 수질현황 작업진행 예정
This commit is contained in:
@@ -182,7 +182,7 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
|
||||
useEffect(() => {
|
||||
operationalStatusList.map((item: { [key: string]: string | number | boolean },index) => {
|
||||
if(index===8 || index===9 || index===10 || index===11 || index===12 || index===13 || index===14 || index===15){
|
||||
item['yearAvg'] = Number(item['yearAvg']).toFixed(3);
|
||||
/* item['yearAvg'] = Number(item['yearAvg']).toFixed(3);
|
||||
item['yearMax'] = item['yearMax']+'%';
|
||||
item['yearMin'] = item['yearMin']+'%';
|
||||
item['summerAll'] = item['summerAll']+'%';
|
||||
@@ -191,7 +191,7 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
|
||||
item['winterAll'] = item['winterAll']+'%';
|
||||
item['winterSunnyAvg'] = item['winterSunnyAvg']+'%';
|
||||
item['winterSunnyMax'] = item['winterSunnyMax']+'%';
|
||||
item['winterSunnyMin'] = item['winterSunnyMin']+'%';
|
||||
item['winterSunnyMin'] = item['winterSunnyMin']+'%'; */
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -223,7 +223,7 @@ export default function UnderWaterInput() {
|
||||
<UiTable cellClick={(index: number | undefined) => index !== undefined && cellClick(index)} headName={"지하수유입량 추정"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} />
|
||||
</div>
|
||||
</div>
|
||||
<span className="text-2xl text-gray-500">※연평균 유입하수량 = 연간 지하수유입량/연평균 유입하수량*100 </span><br></br>
|
||||
<span className="text-2xl text-gray-500">※적정여부 = 연간 지하수유입량/연평균 유입하수량*100 </span><br></br>
|
||||
<span className="text-2xl text-gray-500">※지하수 유입량 = 하수처리장 청천시 실제유입량 - (물사용량 × 오수전환율)</span>
|
||||
</ListDiv>
|
||||
</ContentsDiv>
|
||||
|
||||
@@ -8,7 +8,6 @@ import DataForm from "@/app/components/common/DataForm";
|
||||
import { fetchPlanInfo, OSU_PERCENT, roundUp } from "../common";
|
||||
import type { FacilityWaterQltyProps } from "../facilityWaterQlty";
|
||||
import { fetchFlowRateModalList } from "../flowRate";
|
||||
import { type FlowDataItem } from "../underWaterInput";
|
||||
|
||||
// selectBox
|
||||
export type SelectDataType = {
|
||||
@@ -734,6 +733,117 @@ const fetchMainGraph = async (searchYear: string|undefined, fcltyCd: string|unde
|
||||
}
|
||||
}
|
||||
|
||||
// 수질 데이터 청천시, 강우시 재계산
|
||||
/* const calcWaterQltyData = async (data: any[], searchYear : string|undefined, fcltyCd : string|undefined) => {
|
||||
let orgData = data;
|
||||
console.log('orgData', orgData);
|
||||
await fetchMainGraph(searchYear, fcltyCd).then(res => {
|
||||
if(res.data.count > 0) {
|
||||
const clone = (arr: any[]) => arr?.map(v => ({ ...v })) ?? [];
|
||||
const qltyData = res.data;
|
||||
const qltyChungchunData = CalcRainEffect(clone(qltyData), 'SUNNY', 'RAIN_DAY');
|
||||
const qltyRainData = CalcRainEffect(clone(qltyData), 'RAIN', 'RAIN_DAY');
|
||||
|
||||
// 청천시 변수
|
||||
let chungchunAllDay = 0;
|
||||
let chungchunSummerDay = 0;
|
||||
let chungchunWinterDay = 0;
|
||||
|
||||
let chungchunInflBodAvg = 0;
|
||||
let chungchunInflTnAvg = 0;
|
||||
let chungchunInflTpAvg = 0;
|
||||
let chungchunInflBodMax = 0;
|
||||
let chungchunInflTnMax= 0;
|
||||
let chungchunInflTpMax = 0;
|
||||
let chungchunInflBodMin = 99999999;
|
||||
let chungchunInflTnMin = 99999999;
|
||||
let chungchunInflTpMin = 99999999;
|
||||
|
||||
let chungchunEfflBodAvg = 0;
|
||||
let chungchunEfflTnAvg = 0;
|
||||
let chungchunEfflTpAvg = 0;
|
||||
let chungchunEfflBodMax = 0;
|
||||
let chungchunEfflTnMax= 0;
|
||||
let chungchunEfflTpMax = 0;
|
||||
let chungchunEfflBodMin = 99999999;
|
||||
let chungchunEfflTnMin = 99999999;
|
||||
let chungchunEfflTpMin = 99999999;
|
||||
|
||||
// 강우시 변수
|
||||
let rainAllDay = 0;
|
||||
let rainSummerDay = 0;
|
||||
let rainWinterDay = 0;
|
||||
|
||||
let rainInflBodAvg = 0;
|
||||
let rainInflTnAvg = 0;
|
||||
let rainInflTpAvg = 0;
|
||||
let rainInflBodMax = 0;
|
||||
let rainInflTnMax= 0;
|
||||
let rainInflTpMax = 0;
|
||||
let rainInflBodMin = 99999999;
|
||||
let rainInflTnMin = 99999999;
|
||||
let rainInflTpMin = 99999999;
|
||||
|
||||
const nullToZero = (value: any) => {
|
||||
return value === null || value === undefined || value === '' ? 0 : Number(value);
|
||||
};
|
||||
|
||||
// 청천시
|
||||
qltyChungchunData.forEach((item: any) => {
|
||||
chungchunAllDay += 1;
|
||||
const month = item.msrdt.substring(4, 6); // 월 추출
|
||||
if(month === '01' || month === '02'){
|
||||
chungchunWinterDay += 1;
|
||||
|
||||
const inflbod = nullToZero(item.inflAssctBfrWqltBod);
|
||||
const infltn = nullToZero(item.inflAssctBfrWqltTn);
|
||||
const infltp = nullToZero(item.inflAssctBfrWqltTp);
|
||||
const effbod = nullToZero(item.efflWqltBod);
|
||||
const efftn = nullToZero(item.efflWqltTn);
|
||||
const efftp = nullToZero(item.efflWqltTp);
|
||||
|
||||
chungchunInflBodAvg += inflbod;
|
||||
chungchunInflTnAvg += infltn;
|
||||
chungchunInflTpAvg += infltp;
|
||||
chungchunEfflBodAvg += effbod;
|
||||
chungchunEfflTnAvg += efftn;
|
||||
chungchunEfflTpAvg += efftp;
|
||||
|
||||
if(chungchunInflBodMax < inflbod) chungchunInflBodMax = inflbod;
|
||||
if(chungchunInflTnMax < infltn) chungchunInflTnMax = infltn;
|
||||
if(chungchunInflTpMax < infltp) chungchunInflTpMax = infltp;
|
||||
if(chungchunEfflBodMax < effbod) chungchunEfflBodMax = effbod;
|
||||
if(chungchunEfflTnMax < efftn) chungchunEfflTnMax = efftn;
|
||||
if(chungchunEfflTpMax < efftp) chungchunEfflTpMax = efftp;
|
||||
|
||||
if(chungchunInflBodMin > inflbod) chungchunInflBodMin = inflbod;
|
||||
if(chungchunInflTnMin > infltn) chungchunInflTnMin = infltn;
|
||||
if(chungchunInflTpMin > infltp) chungchunInflTpMin = infltp;
|
||||
if(chungchunEfflBodMin > effbod) chungchunEfflBodMin = effbod;
|
||||
if(chungchunEfflTnMin > efftn) chungchunEfflTnMin = efftn;
|
||||
if(chungchunEfflTpMin > efftp) chungchunEfflTpMin = efftp;
|
||||
}else if(month === '06' || month === '07' || month === '08'){
|
||||
chungchunSummerDay += 1;
|
||||
}
|
||||
});
|
||||
|
||||
orgData[5].winterSunnyAvg = chungchunAllDay > 0 ? '999' : 0;
|
||||
|
||||
// 강우시
|
||||
qltyRainData.forEach((item: any) => {
|
||||
const month = item.msrdt.substring(4, 6); // 월 추출
|
||||
if(month === '01' || month === '02'){
|
||||
}else if(month === '06' || month === '07' || month === '08'){
|
||||
}
|
||||
});
|
||||
|
||||
return orgData;
|
||||
} else {
|
||||
return orgData;
|
||||
}
|
||||
});
|
||||
}; */
|
||||
|
||||
/**====================================
|
||||
* Store - action
|
||||
====================================*/
|
||||
@@ -775,7 +885,7 @@ export type DashBoardType = {
|
||||
OperationStatus : {
|
||||
isInit : boolean;
|
||||
upHeadListOperationStatus : TableUpperProps[];
|
||||
operationalStatusList : OperationalStatusListProps[];
|
||||
operationalStatusList : any;
|
||||
isLoadingOperationStatus : boolean;
|
||||
}
|
||||
|
||||
@@ -1126,7 +1236,26 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
let winterSunnyAvg = 1;
|
||||
let winterSunnyMax = 1;
|
||||
|
||||
// 최대, 최소 총 유입량 (1년 하루 합계의 최대, 최소)
|
||||
|
||||
// 하절기 청천시, 강우시 재계산 리턴값
|
||||
let summerChungchunFlow = 1
|
||||
let summerChungchunReturnAmnt = 1;
|
||||
let summerChungchunEfflAmnt = 1;
|
||||
let summerRainInflAmnt = 1;
|
||||
let summerRainReturnAmnt = 1;
|
||||
let summerRainEfflAmnt = 1;
|
||||
|
||||
// 동절기 청천시 최대, 최소, 평균 리턴값
|
||||
let winterChungchunFlowAvg = 1 ;
|
||||
let winterChungchunFlowMax = 1 ;
|
||||
let winterChungchunFlowMin = 1 ;
|
||||
let winterChungchunReturnAvg = 1 ;
|
||||
let winterChungchunReturnMax = 1 ;
|
||||
let winterChungchunReturnMin = 1 ;
|
||||
let winterChungchunEfflAvg = 1 ;
|
||||
let winterChungchunEfflMax = 1 ;
|
||||
let winterChungchunEfflMin = 1 ;
|
||||
|
||||
if(data && operationalStatusList){
|
||||
// 유량 - 유입
|
||||
@@ -1193,32 +1322,47 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
let summerChungchunDay = 0;
|
||||
let winterChungchuDay = 0;
|
||||
|
||||
let totFlowMax = 0;
|
||||
let totFlowMin = 9999999;
|
||||
|
||||
let yearSumFlow = 0;
|
||||
let maxYearSumFlow = 0;
|
||||
let minYearSumFlow = 9999999;
|
||||
let summerSumFlow = 0;
|
||||
let summerChungchunSumFlow = 0;
|
||||
let summerRainDaySumFlow = 0;
|
||||
let summerRainDayFlow = 0;
|
||||
let summerRainDayReturnFlow = 0;
|
||||
let summerRainDayEfflFlow = 0;
|
||||
|
||||
let winterSumFlow = 0;
|
||||
let winterChungchunSumFlow = 0;
|
||||
let minWinterChungchunSumFlow = 9999999;
|
||||
let maxWinterChungchunSumFlow = 0;
|
||||
|
||||
// 하수유입량 수정
|
||||
let summerRainDayFlow = 0;
|
||||
|
||||
|
||||
// 연계처리수,지하수유입량
|
||||
const bscFctCd = fcltyCd;
|
||||
const res2 = await fetchFlowRateModalList(bscFctCd, searchYear);
|
||||
yearDay = res2.data?res2.data.length:1;
|
||||
res2.data.forEach((item: FlowDataItem) => {
|
||||
res2.data.forEach((item: any) => {
|
||||
yearSumFlow += item.sumFlow && item.sumFlow !== 'x' ? Number(item.sumFlow.toString().trim()) : 0;
|
||||
if(maxYearSumFlow < (item.sumFlow && item.sumFlow !== 'x' ? Number(item.sumFlow.toString().trim()) : 0)) {
|
||||
maxYearSumFlow = item.sumFlow && item.sumFlow !== 'x' ? Number(item.sumFlow.toString().trim()) : 0;
|
||||
}
|
||||
if(minYearSumFlow > (item.sumFlow && item.sumFlow !== 'x' ? Number(item.sumFlow.toString().trim()) : 0) || minYearSumFlow === 0) {
|
||||
if(minYearSumFlow > (item.sumFlow && item.sumFlow !== 'x' ? Number(item.sumFlow.toString().trim()) : 0)) {
|
||||
minYearSumFlow = item.sumFlow && item.sumFlow !== 'x' ? Number(item.sumFlow.toString().trim()) : 0;
|
||||
}
|
||||
|
||||
// 1년 최대 총 하수유입량
|
||||
let totYearFlow = 0;
|
||||
totYearFlow = (item.inflAmnt && item.inflAmnt !== 'x' ? Number(item.inflAmnt.toString().trim()) : 0) + (item.sumFlow && item.sumFlow !== 'x' ? Number(item.sumFlow.toString().trim()) : 0) + (item.returnAmnt && item.returnAmnt !== 'x' ? Number(item.returnAmnt.toString().trim()) : 0);
|
||||
if(totFlowMax < totYearFlow) {
|
||||
totFlowMax = totYearFlow;
|
||||
}
|
||||
if(totFlowMin > totYearFlow || totFlowMin === 0) {
|
||||
totFlowMin = totYearFlow;
|
||||
}
|
||||
|
||||
if(item.msrDt.substring(4,6) === '06' || item.msrDt.substring(4,6) === '07' || item.msrDt.substring(4,6) === '08') {
|
||||
summerDay += 1;
|
||||
summerSumFlow += item.sumFlow && item.sumFlow !== 'x' ? Number(item.sumFlow.toString().trim()) : 0;
|
||||
@@ -1236,35 +1380,92 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
let chungcunSumFlow = 0;
|
||||
let sumSummerChungcunFlow = 0;
|
||||
let sumWinterChungcunFlow = 0;
|
||||
|
||||
// 하절기 청천시 총인설비 반류수
|
||||
let summerChungchunDayReturnAmnt = 0;
|
||||
// 하절기 청천시 방류수
|
||||
let summerChungchunDayEfflAmnt = 0;
|
||||
|
||||
// 동절기 총 유입량 최대, 최소
|
||||
let winterChungchunTotalInflAmntMax = 0 ;
|
||||
let winterChungchunTotalInflAmntMin = 9999999 ;
|
||||
// 동절기 청천시 하수유입량 최대, 최소
|
||||
let winterChungchunDayFlowMax = 0 ;
|
||||
let winterChungchunDayFlowMin = 9999999 ;
|
||||
// 동절기 청천시 총인반류수 최대, 최소, 평균
|
||||
let winterChungchunDayReturnMax = 0 ;
|
||||
let winterChungchunDayReturnMin = 9999999 ;
|
||||
let winterChungchunDayReturnAvg = 0 ;
|
||||
// 동절기 청천시 방류량 최대, 최소, 평균
|
||||
let winterChungchunDayEfflMax = 0 ;
|
||||
let winterChungchunDayEfflMin = 9999999 ;
|
||||
let winterChungchunDayEfflAvg = 0;
|
||||
|
||||
// 하절기, 동절기 청천시 계산
|
||||
calData.forEach((flowItem: FlowDataItem) => {
|
||||
calData.forEach((flowItem: any) => {
|
||||
chungcunSumFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
||||
|
||||
if(flowItem.msrDt.substring(4,6) ==='06' || flowItem.msrDt.substring(4,6) ==='07' || flowItem.msrDt.substring(4,6) ==='08'){
|
||||
summerChungchunDay += 1;
|
||||
summerChungchunSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
|
||||
sumSummerChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
||||
summerChungchunDayReturnAmnt += flowItem.returnAmnt && flowItem.returnAmnt !== 'x' ? Number(flowItem.returnAmnt.toString().trim()) : 0;
|
||||
summerChungchunDayEfflAmnt += flowItem.efflAmnt && flowItem.efflAmnt !== 'x' ? Number(flowItem.efflAmnt.toString().trim()) : 0;
|
||||
|
||||
}else if(flowItem.msrDt.substring(4,6) ==='01' || flowItem.msrDt.substring(4,6) ==='02'){
|
||||
if(minWinterChungchunSumFlow > (flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0) || minWinterChungchunSumFlow === 0) {
|
||||
winterChungchuDay += 1;
|
||||
winterChungchunSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
|
||||
sumWinterChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
||||
winterChungchunDayReturnAvg += flowItem.returnAmnt && flowItem.returnAmnt !== 'x' ? Number(flowItem.returnAmnt.toString().trim()) : 0;
|
||||
winterChungchunDayEfflAvg += flowItem.efflAmnt && flowItem.efflAmnt !== 'x' ? Number(flowItem.efflAmnt.toString().trim()) : 0;
|
||||
|
||||
let totWinterTotalInflAmnt = 0;
|
||||
totWinterTotalInflAmnt = (flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0) + (flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0) + (flowItem.returnAmnt && flowItem.returnAmnt !== 'x' ? Number(flowItem.returnAmnt.toString().trim()) : 0);
|
||||
if(winterChungchunTotalInflAmntMax < totWinterTotalInflAmnt) {
|
||||
winterChungchunTotalInflAmntMax = totWinterTotalInflAmnt;
|
||||
}
|
||||
if(winterChungchunTotalInflAmntMin > totWinterTotalInflAmnt || winterChungchunTotalInflAmntMin === 0) {
|
||||
winterChungchunTotalInflAmntMin = totWinterTotalInflAmnt;
|
||||
}
|
||||
|
||||
if(winterChungchunDayFlowMin > (flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0)) {
|
||||
winterChungchunDayFlowMin = flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
||||
}
|
||||
if(winterChungchunDayFlowMax < (flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0)) {
|
||||
winterChungchunDayFlowMax = flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
||||
}
|
||||
|
||||
if(minWinterChungchunSumFlow > (flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0) ) {
|
||||
minWinterChungchunSumFlow = flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
|
||||
}
|
||||
if(maxWinterChungchunSumFlow < (flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0)) {
|
||||
maxWinterChungchunSumFlow = flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
|
||||
}
|
||||
winterChungchuDay += 1;
|
||||
winterChungchunSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
|
||||
sumWinterChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
||||
|
||||
if(winterChungchunDayReturnMin > (flowItem.returnAmnt && flowItem.returnAmnt !== 'x' ? Number(flowItem.returnAmnt.toString().trim()) : 0)) {
|
||||
winterChungchunDayReturnMin = flowItem.returnAmnt && flowItem.returnAmnt !== 'x' ? Number(flowItem.returnAmnt.toString().trim()) : 0;
|
||||
}
|
||||
if(winterChungchunDayReturnMax < (flowItem.returnAmnt && flowItem.returnAmnt !== 'x' ? Number(flowItem.returnAmnt.toString().trim()) : 0)) {
|
||||
winterChungchunDayReturnMax = flowItem.returnAmnt && flowItem.returnAmnt !== 'x' ? Number(flowItem.returnAmnt.toString().trim()) : 0;
|
||||
}
|
||||
|
||||
if(winterChungchunDayEfflMin > (flowItem.efflAmnt && flowItem.efflAmnt !== 'x' ? Number(flowItem.efflAmnt.toString().trim()) : 0)) {
|
||||
winterChungchunDayEfflMin = flowItem.efflAmnt && flowItem.efflAmnt !== 'x' ? Number(flowItem.efflAmnt.toString().trim()) : 0;
|
||||
}
|
||||
if(winterChungchunDayEfflMax < (flowItem.efflAmnt && flowItem.efflAmnt !== 'x' ? Number(flowItem.efflAmnt.toString().trim()) : 0)) {
|
||||
winterChungchunDayEfflMax = flowItem.efflAmnt && flowItem.efflAmnt !== 'x' ? Number(flowItem.efflAmnt.toString().trim()) : 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 하절기 강우시 계산
|
||||
calRainDate.forEach((flowItem: FlowDataItem) => {
|
||||
calRainDate.forEach((flowItem: any) => {
|
||||
if(flowItem.msrDt.substring(4,6) === '06' || flowItem.msrDt.substring(4,6) === '07' || flowItem.msrDt.substring(4,6) === '08') {
|
||||
console.log('rainDay : ', flowItem.msrDt);
|
||||
summerRainDay += 1;
|
||||
summerRainDaySumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
|
||||
summerRainDayFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
||||
summerRainDayReturnFlow += flowItem.returnAmnt && flowItem.returnAmnt !== 'x' ? Number(flowItem.returnAmnt.toString().trim()) : 0;
|
||||
summerRainDayEfflFlow += flowItem.efflAmnt && flowItem.efflAmnt !== 'x' ? Number(flowItem.efflAmnt.toString().trim()) : 0;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1280,18 +1481,43 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
winterSunnyAvg = winterChungchunSumFlow&&Number(winterChungchunSumFlow)!=0?(winterChungchunSumFlow / winterChungchuDay):0;
|
||||
winterSunnyMax = maxWinterChungchunSumFlow;
|
||||
|
||||
// 하수유입량 (청천, 강우시)
|
||||
// 하절기 강우시 계산
|
||||
// 하수유입량 (강우시)
|
||||
summerRainInflAmnt = summerRainDayFlow&&Number(summerRainDayFlow)!=0?Number(summerRainDayFlow / summerRainDay):0;
|
||||
// 총인설비방류수 (강우시)
|
||||
summerRainReturnAmnt = summerRainDayReturnFlow&&Number(summerRainDayReturnFlow)!=0?Number(summerRainDayReturnFlow / summerRainDay):0;
|
||||
// 방루량 (강우시)
|
||||
summerRainEfflAmnt = summerRainDayEfflFlow&&summerRainDayEfflFlow!=0?summerRainDayEfflFlow / summerRainDay:0;
|
||||
|
||||
// 동절기 청천시 계산
|
||||
// 하수유입량 (청천시) 평균
|
||||
winterChungchunFlowAvg = sumWinterChungcunFlow&&Number(sumWinterChungcunFlow)!=0?(sumWinterChungcunFlow / winterChungchuDay):0;
|
||||
// 총인반류수 (청천시) 평균
|
||||
winterChungchunReturnAvg = winterChungchunDayReturnAvg&&Number(winterChungchunDayReturnAvg)!=0?(winterChungchunDayReturnAvg / winterChungchuDay):0;
|
||||
// 방류량 (청천시) 평균
|
||||
winterChungchunEfflAvg = winterChungchunDayEfflAvg&&Number(winterChungchunDayEfflAvg)!=0?(winterChungchunDayEfflAvg / winterChungchuDay):0;
|
||||
// 하수유입량 (청천시) 최대
|
||||
winterChungchunFlowMax = winterChungchunDayFlowMax;
|
||||
// 총인반류수 (청천시) 최대
|
||||
winterChungchunReturnMax = winterChungchunDayReturnMax;
|
||||
// 방류량 (청천시) 최대
|
||||
winterChungchunEfflMax = winterChungchunDayEfflMax;
|
||||
// 하수유입량 (청천시) 최소
|
||||
winterChungchunFlowMin = winterChungchunDayFlowMin;
|
||||
// 총인반류수 (청천시) 최소
|
||||
winterChungchunReturnMin = winterChungchunDayReturnMin;
|
||||
// 방류량 (청천시) 최소
|
||||
winterChungchunEfflMin = winterChungchunDayEfflMin
|
||||
|
||||
operationalStatusList[0].yearAvg = roundUp(Number(operationalStatusList[0].yearAvg), 0) + roundUp(yearAvgSumFlow, 0);
|
||||
operationalStatusList[0].yearMax = roundUp(Number(operationalStatusList[0].yearMax), 0) + roundUp(yearMaxSumFlow, 0);
|
||||
operationalStatusList[0].yearMin = roundUp(Number(operationalStatusList[0].yearMin), 0) + roundUp(yearMinSumFlow, 0);
|
||||
operationalStatusList[0].yearMax = roundUp(totFlowMax, 0); // + roundUp(yearMaxSumFlow, 0);
|
||||
operationalStatusList[0].yearMin = roundUp(totFlowMin, 0);
|
||||
operationalStatusList[0].summerAll = roundUp(Number(operationalStatusList[0].summerAll), 0) + roundUp(summerAll, 0);
|
||||
operationalStatusList[0].summerThree = roundUp(Number(operationalStatusList[0].summerThree), 0) + roundUp(summerThree, 0);
|
||||
operationalStatusList[0].summerRain = roundUp(Number(operationalStatusList[0].summerRain), 0) + roundUp(summerRain, 0);
|
||||
operationalStatusList[0].winterAll = roundUp(Number(operationalStatusList[0].winterAll), 0) + roundUp(winterAll, 0);
|
||||
operationalStatusList[0].winterSunnyMin = roundUp(Number(operationalStatusList[0].winterSunnyMin), 0) + roundUp(winterSunnyMin, 0);
|
||||
operationalStatusList[0].winterSunnyMax = roundUp(Number(operationalStatusList[0].winterSunnyMax), 0) + roundUp(winterSunnyMax, 0);
|
||||
operationalStatusList[0].winterSunnyMin = roundUp(winterChungchunTotalInflAmntMin, 0);
|
||||
operationalStatusList[0].winterSunnyMax = roundUp(winterChungchunTotalInflAmntMax, 0);
|
||||
operationalStatusList[0].winterSunnyAvg = roundUp(Number(operationalStatusList[0].winterSunnyAvg), 0) + roundUp(winterSunnyAvg, 0);
|
||||
|
||||
// 지하수유입량
|
||||
@@ -1299,6 +1525,11 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
const summerUsage = sumSummerChungcunFlow / summerChungchunDay;
|
||||
const winterUsage = sumWinterChungcunFlow / winterChungchuDay;
|
||||
|
||||
// 임시 계산변수값들 메인에 대입
|
||||
summerChungchunFlow = summerUsage;
|
||||
summerChungchunReturnAmnt = summerChungchunDayReturnAmnt / summerChungchunDay;
|
||||
summerChungchunEfflAmnt = summerChungchunDayEfflAmnt / summerChungchunDay;
|
||||
|
||||
operationalStatusList[0].groundWaterAvg = Math.round((usage-(usage*0.65*OSU_PERCENT)) * 100) / 100;
|
||||
operationalStatusList[0].groundWaterSummer = Math.round((summerUsage-(summerUsage*0.65*OSU_PERCENT)) * 100) / 100;
|
||||
operationalStatusList[0].groundWaterWinter = Math.round((winterUsage-(winterUsage*0.65*OSU_PERCENT)) * 100) / 100;
|
||||
@@ -1344,11 +1575,17 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
}
|
||||
}
|
||||
|
||||
// 순수하수량
|
||||
if(operationalStatusList[1]){
|
||||
operationalStatusList[1].summerThree = summerRainInflAmnt;
|
||||
operationalStatusList[1].summerRain = summerChungchunFlow;
|
||||
operationalStatusList[1].winterSunnyAvg = winterChungchunFlowAvg;
|
||||
operationalStatusList[1].winterSunnyMax = winterChungchunFlowMax;
|
||||
operationalStatusList[1].winterSunnyMin = winterChungchunFlowMin;
|
||||
dataFormSetting(operationalStatusList[1]);
|
||||
}
|
||||
|
||||
// 연계처리수
|
||||
if(operationalStatusList[2]){
|
||||
operationalStatusList[2].yearAvg = yearAvgSumFlow;
|
||||
operationalStatusList[2].yearMax = yearMaxSumFlow;
|
||||
@@ -1363,6 +1600,26 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
dataFormSetting(operationalStatusList[2]);
|
||||
}
|
||||
|
||||
// 총인설비방류수
|
||||
if(operationalStatusList[3]){
|
||||
operationalStatusList[3].summerThree = summerRainReturnAmnt;
|
||||
operationalStatusList[3].summerRain = summerChungchunReturnAmnt;
|
||||
operationalStatusList[3].winterSunnyAvg = winterChungchunReturnAvg;
|
||||
operationalStatusList[3].winterSunnyMax = winterChungchunReturnMax;
|
||||
operationalStatusList[3].winterSunnyMin = winterChungchunReturnMin;
|
||||
dataFormSetting(operationalStatusList[3]);
|
||||
}
|
||||
|
||||
// 방류수
|
||||
if(operationalStatusList[4]){
|
||||
operationalStatusList[4].summerThree = summerRainEfflAmnt;
|
||||
operationalStatusList[4].summerRain = summerChungchunEfflAmnt;
|
||||
operationalStatusList[4].winterSunnyAvg = winterChungchunEfflAvg;
|
||||
operationalStatusList[4].winterSunnyMax = winterChungchunEfflMax;
|
||||
operationalStatusList[4].winterSunnyMin = winterChungchunEfflMin;
|
||||
dataFormSetting(operationalStatusList[4]);
|
||||
}
|
||||
|
||||
if (operationalStatusList[0]) {
|
||||
// 안전하게 숫자 변환하는 함수
|
||||
const toNum = (val) => {
|
||||
@@ -1390,16 +1647,6 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
toNum(operationalStatusList[2]?.winterAll) +
|
||||
toNum(operationalStatusList[3]?.winterAll);
|
||||
|
||||
operationalStatusList[0].winterSunnyMin =
|
||||
toNum(operationalStatusList[1]?.winterSunnyMin) +
|
||||
toNum(operationalStatusList[2]?.winterSunnyMin) +
|
||||
toNum(operationalStatusList[3]?.winterSunnyMin);
|
||||
|
||||
operationalStatusList[0].winterSunnyMax =
|
||||
toNum(operationalStatusList[1]?.winterSunnyMax) +
|
||||
toNum(operationalStatusList[2]?.winterSunnyMax) +
|
||||
toNum(operationalStatusList[3]?.winterSunnyMax);
|
||||
|
||||
operationalStatusList[0].winterSunnyAvg =
|
||||
toNum(operationalStatusList[1]?.winterSunnyAvg) +
|
||||
toNum(operationalStatusList[2]?.winterSunnyAvg) +
|
||||
@@ -1408,10 +1655,9 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
dataFormSetting(operationalStatusList[0]);
|
||||
}
|
||||
}
|
||||
|
||||
// 총인설비가 없을 경우 제외
|
||||
if(data.yearData.TP_INFL_WQLT_TP === null || data.yearData.TP_INFL_WQLT_TP === undefined || data.yearData.TP_INFL_WQLT_TP === 'null') {
|
||||
operationalStatusList = operationalStatusList.slice(0, 10);
|
||||
operationalStatusList = operationalStatusList.slice(0, 11);
|
||||
}
|
||||
set((state: DashBoardType) => ({
|
||||
...state,
|
||||
|
||||
Reference in New Issue
Block a user