계획하수량 산정지표현황
- 필요없는 콘솔제거 - 변동부하율 계산 수정
This commit is contained in:
@@ -107,7 +107,6 @@ export default function PlanSewage() {
|
||||
}, [isInit, initializeCommonData, searchPlanSewageList]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('excelList' , excelList);
|
||||
if (excelList && excelList.length > 0) {
|
||||
downloadExcel({
|
||||
data: excelList as unknown as JSON[],
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { TableUpperProps } from "../dashboard";
|
||||
import { getFetch } from "@/app/components/api";
|
||||
import { type ApiResponse, type FlowDataItem } from "../underWaterInput";
|
||||
import CalcRainEffect from "@/app/components/common/CalcRainEffect";
|
||||
import { roundUp } from "../common";
|
||||
export type { TableUpperProps };
|
||||
/**====================================
|
||||
* Store - 타입
|
||||
@@ -95,7 +96,6 @@ const planSewageList:PlanSewageProps[] = [
|
||||
const fetchPlanSewageList = async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
|
||||
const tailStr = partCd ? '/'+ partCd + '/' + (nameCd || '0') + '/' + (fcltCpct || '0') + '/' + (operationValue || '0') +'/0'+ (fcltyNm && fcltyNm !== '' ? '/' + fcltyNm : '') : '';
|
||||
const url = '/prcsFclt/info/plan/' + pageNo + '/' + pageSize + '/' + searchYear + tailStr;
|
||||
console.log(url);
|
||||
const res = await getFetch('fo', url);
|
||||
return { data: res.data, count: res.count }
|
||||
}
|
||||
@@ -183,19 +183,22 @@ export const planSewageReducer:(set:(fn: (state: PlanSewageType) => PlanSewageTy
|
||||
const data = res.data
|
||||
const processedData = await Promise.all(data.map(async (item:PlanSewageProps) => {
|
||||
const res2 = await getFetch('fo', '/fclt/flow/' + item.bscFctCd + '/' + searchYear) as ApiResponse;
|
||||
const calData = CalcRainEffect(res2.data, 'SUNNY');
|
||||
const calData = CalcRainEffect(res2.data, 'SUNNY', 'RAIN_DAY');
|
||||
|
||||
let sumInflAmntSunny = 0;
|
||||
let avgInflAmntSunny = 0;
|
||||
let maxInflAmntSunny = 0;
|
||||
calData.forEach((flowItem:FlowDataItem) => {
|
||||
sumInflAmntSunny += Number(flowItem.inflAmnt);
|
||||
})
|
||||
avgInflAmntSunny = sumInflAmntSunny / calData.length;
|
||||
item.avgInflAmntSunny = avgInflAmntSunny;
|
||||
if(item.bscFctCd === '11200PB001R'){
|
||||
console.log('avgInflAmntSunny : ',item.avgInflAmntSunny);
|
||||
console.log('calData : ',calData);
|
||||
|
||||
if(Number(flowItem.inflAmnt) > maxInflAmntSunny){
|
||||
maxInflAmntSunny = Number(flowItem.inflAmnt);
|
||||
}
|
||||
});
|
||||
|
||||
avgInflAmntSunny = sumInflAmntSunny / calData.length;
|
||||
item.avgInflAmntSunny = roundUp(avgInflAmntSunny, 0);
|
||||
item.maxInflAmntSunny = roundUp(maxInflAmntSunny, 0);
|
||||
return item;
|
||||
}));
|
||||
|
||||
@@ -206,8 +209,6 @@ export const planSewageReducer:(set:(fn: (state: PlanSewageType) => PlanSewageTy
|
||||
* (3) 분류식화율 = 분류식지역 면적(㎢)/처리구역 면적합계(㎢) ×100
|
||||
*/
|
||||
const resultData = processedData.map((item:PlanSewageProps) => {
|
||||
console.log('item.fctCpc : ',item.fctCpc);
|
||||
console.log('item.avgInflAmntSunny : ',item.avgInflAmntSunny);
|
||||
item.spareCapacity = Number(item.fctCpc) - Number(item.avgInflAmntSunny);
|
||||
item.variableLoadPercent = item.maxInflAmntSunny && item.maxInflAmntSunny!==0 ? Number(item.maxInflAmntSunny) / Number(item.avgInflAmntSunny) : 0;
|
||||
item.classifiedSewerPercent = item.sprtProcZoneAr && item.sprtProcZoneAr!==0 ? Number(item.sprtProcZoneAr) / Number(item.procZoneSm) * 100 : 0;
|
||||
|
||||
Reference in New Issue
Block a user