diff --git a/apps/wr/app/store/common/code/index.ts b/apps/wr/app/store/common/code/index.ts index 5d93811cc..a0a761f3e 100644 --- a/apps/wr/app/store/common/code/index.ts +++ b/apps/wr/app/store/common/code/index.ts @@ -5,13 +5,13 @@ import type { EnvPartSelectDataType, SelectDataType } from "@common/business_com export const btnClass= "p-4 m-2 text-white rounded-sm text-lg font-medium " -export const yn :SelectDataType[]=[ + const yn :SelectDataType[]=[ {val:'Y', text:'Y'}, {val:'N', text:'N'}, ] //공통 건축물 용도 -export const bdstUsgCd: SelectDataType[] = [ + const bdstUsgCd: SelectDataType[] = [ { val: '1', text: "운동장" }, { val: '2', text: "체육관" }, { val: '3', text: "공공업무시설" }, @@ -30,7 +30,7 @@ export const bdstUsgCd: SelectDataType[] = [ { val: '16', text: "기타" }, ]; //빗물 집수면 종류 용도 -export const rainFcltCd = [ + const rainFcltCd = [ { val: "1", text: "지붕" }, { val: "2", text: "건물옥상" }, { val: "3", text: "골프장 연못" }, @@ -43,7 +43,7 @@ export const rainFcltCd = [ { val: "10", text: "확인불가" }, ]; // 중수도 필수 원수종류 -export const rswtBdstType: SelectDataType[] = [ + const rswtBdstType: SelectDataType[] = [ { text: "숙박업", val: "17" }, { text: "목욕장업", val: "18" }, { text: "공장", val: "19" }, @@ -83,7 +83,7 @@ const orgwtKndCd = [ { text: "기타", val: "5" }, ]; -export const chBuCd = [ + const chBuCd = [ { val: "증축", text: "증축" }, { val: "개축", text: "개축" }, { val: "재축", text: "재축" }, diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/index.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/index.tsx index 3734563a5..542c6e8b1 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/index.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/index.tsx @@ -288,7 +288,7 @@ export type rainChkgdnState = { splHeadList: TableUpperProps[]; rswtDetailHeadList: TableUpperProps[]; isInit: boolean; - excelList:ExcelExportType[] + excelList:ExcelExportType[] | JSON[] }; }; diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/htdflReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/htdflReg/index.tsx index f19962010..2ac27be5a 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/htdflReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/htdflReg/index.tsx @@ -1,5 +1,5 @@ import { getFetch, postFectch, putFectch } from "@/components/lib/api"; -import { upHeadList, type bdstAll, type chgBuilding, type TableUpperProps } from "../rainReg"; +import { upHeadList, type chgBuilding, type TableUpperProps } from "../rainReg"; import { z } from "zod"; import { makeMdfr, makeRstr } from "../bdstReg"; diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx index 55f203c19..0963cf72e 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx @@ -1,7 +1,7 @@ -import type { selectArray } from "@/app/store/common/code"; import { getFetch, postFectch, putFectch } from "@/components/lib/api"; import { z } from "zod"; import { makeMdfr, makeRstr } from "../bdstReg"; +import type { SelectDataType } from "@common/business_components/ui"; export const TEST_UUID= '2d4b151d-1828-41e0-91d9-4cd28ea1cc7e' @@ -138,7 +138,7 @@ export type rainFacState = { rain: { isInit: boolean; upHeadList: TableUpperProps[]; - selectYN: selectArray[]; + selectYN: SelectDataType[]; rainRes: customRainBdst[]; // regRainForm:customRainBdst, diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/excel.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/excel.tsx index 1c8157d1d..b50d77923 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/excel.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/excel.tsx @@ -1,3 +1,5 @@ +import type { customRainBdst } from "../../fcltReg/rainReg" + export type ExcelSttnRainType={ "1.건축물정보": { "행정구역":{"시도": string, "시군구": string}, @@ -19,19 +21,19 @@ export type ExcelSttnRainType={ "여과처리시설유무": string, "여과처리시설용량": string, "여과처리시설처리공정": string, - } + }, "저류조용량": string, }, - "3.시설운영및 이용정보":{ + "3.시설운영및 이용정보"?:{ "운영관리코드": string, "연간빗물운영량": string }, - "4.인센티브 정보":{ + "3.인센티브 정보":{ "설치비지원":{ "설치지원비용여부": string, "설치지원비용": string, }, - "요금감면":{ + "요금감면"?:{ "감면여부": string, "감면근거": string, "감면금액": string, @@ -43,4 +45,52 @@ export type ExcelSttnRainType={ "녹색건축물인증등급": string, } } +} + +const excelSttnParsing = (data: customRainBdst[]): ExcelSttnRainType[] => { + const excelExportData: ExcelSttnRainType[] = [] + data.forEach((item) => { + excelExportData.push( + { + "1.건축물정보": { + "행정구역":{"시도": String(item.ctpvCd), "시군구": String(item.sggCd)}, + "건축물명": item.bdstNm, + "주소": item.daddr, + "건축물용도코드": String(item.bdstInfoPk), + "최초건축허가일":String(item.frstArchPrmsnDt), + "건축면적": String(item.archArea), + "법적의무대상": String(item.reuseBuilding[0]?.lawTrgtYn??''), + "설치완료일시": String(item.reuseBuilding[0]?.instlCmptnDt??''), + }, + "2.빗물이용시설정보":{ + "설치비용": String(item.reuseBuilding[0]?.instlCst??''), + "집수면":{ + "집수지점종류": item.reuseBuilding[0]?.rainyObj.pntfColKnd??'', + "집수지점면적": String(item.reuseBuilding[0]?.rainyObj.pntfColArea??''), + }, + "여과등 처리시설":{ + "여과처리시설유무": String(item.reuseBuilding[0]?.rainyObj.filtrTrtmfctYn??''), + "여과처리시설용량": String(item.reuseBuilding[0]?.rainyObj.filtrTrtmfctCpct??''), + "여과처리시설처리공정":String(item.reuseBuilding[0]?.rainyObj.filtrTrtmfctPrs??''), + }, + "저류조용량": String(item.reuseBuilding[0]?.rainyObj.dtfcltCpct??''), + }, + "3.인센티브 정보":{ + "설치비지원":{ + "설치지원비용여부": String(item.reuseBuilding[0]?.instlCstSprtYn ) , + "설치지원비용": String(item.reuseBuilding[0]?.instlCstSprtAmt ), + }, + "녹색건축물인증여부":{ + "녹색건축물인증여부": String(item.reuseBuilding[0]?.grntchBdstCertYn) , + "녹색건축물인증년도": String(item.reuseBuilding[0]?.grntchBdstCertYr), + "녹색건축물인증번호": String(item.reuseBuilding[0]?.grntchBdstCertNo), + "녹색건축물인증등급": String(item.reuseBuilding[0]?.grntchBdstCertGrd), + } + } + }) + }); + // excelItem = {} as ExcelSttnRainType + // excelItem["1.건축물정보"]["행정구역"]["시도"] = item.sidoNm + // excelItem["1.건축물정보"]["행정구역"]["시군구"] = item.sggNm + return excelExportData; } \ No newline at end of file diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/index.tsx index 62c29a93a..f8e2c6c09 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/index.tsx @@ -314,7 +314,7 @@ export type sttnState = { }; }; type sttnActions = { - rainSttnInit: (page: string, total: string, con: string) => void; + rainSttnSearch: (page: string, total: string, con: string) => void; chSttnHead: (checkList: string[], type: string) => void; excelRainSttn:(data:JSON[] ) => void }; @@ -335,12 +335,24 @@ export const sttnStateExport: sttnState = { export const sttnActionsExport: (set: any) => sttnActions = (set: any) => { return { - rainSttnInit: async (page: string, total: string, con: string) => { + rainSttnSearch: async (page: string, total: string, con: string) => { try { const rainRes = await getFetch( fetchType.WR, `/reuseFc/rainyInfoList/${page}/${total}/${con}` ); + if(Number(total) > 9000){ + set((state: sttnState) => { + return { + ...state, + sttnCommon: { + ...state.sttnCommon, + excelList: rainRes, + }, + }; + }); + } + else set((state: sttnState) => { return { ...state,