From 92f12c2104990d455aad9fce0fd4a576d52b81d2 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Fri, 12 Sep 2025 17:29:34 +0900 Subject: [PATCH 01/10] =?UTF-8?q?=EA=B3=B5=ED=86=B5=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=9E=91=EC=97=85=20=EC=99=84=EB=A3=8C/=20=EC=A7=80=EB=8F=84?= =?UTF-8?q?=EC=A0=90=EA=B2=80=20=EB=93=B1=EB=A1=9D/=ED=98=84=ED=99=A9=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/layout.tsx | 4 + apps/wr/app/store/common/code/basicCode.tsx | 567 ++++++++++++------ apps/wr/app/store/common/code/index.ts | 57 +- apps/wr/app/store/common/code/type.ts | 31 + .../prfmncReg/chkgdnReg/rainChkgdn/excel.tsx | 53 +- .../chkgdnReg/rainChkgdn/headList.tsx | 11 +- .../prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx | 20 +- .../chkgdnReg/rswrtChkgdn/headList.tsx | 5 +- .../chkgdnSttn/rainChkgdnSttn/headList.tsx | 12 +- .../chkgdnSttn/rswtChkgdnSttn/headList.tsx | 2 +- apps/wr/app/store/store.tsx | 1 + apps/wr/components/lib/func/TableData.tsx | 7 +- apps/wr/components/lib/func/commom.tsx | 20 + .../ui/modal/chkgd/chkgdModal/chkgdModal.tsx | 72 ++- .../chkgdTable/rainChkgd/rainChkgdTable.tsx | 7 +- 15 files changed, 576 insertions(+), 293 deletions(-) create mode 100644 apps/wr/app/store/common/code/type.ts diff --git a/apps/wr/app/layout.tsx b/apps/wr/app/layout.tsx index 17945be51..719717344 100644 --- a/apps/wr/app/layout.tsx +++ b/apps/wr/app/layout.tsx @@ -6,6 +6,7 @@ import koBase from "../public/locales/ko/message.json"; import { StoreProvider } from "./store"; import { LoginApi } from "@/src/entities/auth"; import { useEffect } from "react"; +import { getCommonUpCd } from "./store/common/code/basicCode"; export default function RootLayout({ children, @@ -25,6 +26,9 @@ export default function RootLayout({ useEffect(() => { // 렌더 중이 아니라 클라이언트에서만 실행 + 에러 캐치 void LoginApi.login({ userId: "CLEANWATER", password: "gktneh12!@" }) + .finally(()=>{ + getCommonUpCd() + } ) .catch((e) => { console.error("Auto login failed:", e); }); diff --git a/apps/wr/app/store/common/code/basicCode.tsx b/apps/wr/app/store/common/code/basicCode.tsx index 5fc13c16d..5039dd234 100644 --- a/apps/wr/app/store/common/code/basicCode.tsx +++ b/apps/wr/app/store/common/code/basicCode.tsx @@ -1,8 +1,10 @@ +import { fetchType, getFetchWithCount } from "@/components/lib/api"; import type { SelectDataType } from "@common/business_components"; export const numSize = 12; export const txtSize = 20; +export const lwCds: Record = {}; export const yn: SelectDataType[] = [ { val: "Y", text: "Y" }, { val: "N", text: "N" }, @@ -14,29 +16,35 @@ export const bdstFilterYn: SelectDataType[] = [ { val: "F", text: "미가동" }, ]; // 최우수(그린1)/우수(그린2), 우량(그린3), 일반(그린4), 확인불가 체크 -export const bdstGrntchClass: SelectDataType[] = [ - { val: "최우수(그린1)", text: "최우수(그린1)" }, - { val: "우수(그린2)", text: "우수(그린2)" }, - { val: "우량(그린3)", text: "우량(그린3)" }, - { val: "일반(그린4)", text: "일반(그린4)" }, - { val: "확인불가", text: "확인불가" }, -]; +//export const bdstGrntchClass: SelectDataType[] = lwCds['bdstGrntchClass']??[] + +// [ +// { val: "최우수(그린1)", text: "최우수(그린1)" }, +// { val: "우수(그린2)", text: "우수(그린2)" }, +// { val: "우량(그린3)", text: "우량(그린3)" }, +// { val: "일반(그린4)", text: "일반(그린4)" }, +// { val: "확인불가", text: "확인불가" }, +// ]; export const bdstIncenYn: SelectDataType[] = [ { val: "Y", text: "Y" }, { val: "N", text: "N" }, { val: "D", text: "확인불가" }, ]; //처리장연계/자체+연계/자체처리 -export const erctUswtrPrcsMeth: SelectDataType[] = [ - { val: "처리장연계", text: "처리장연계" }, - { val: "자체+연계", text: "자체+연계" }, - { val: "자체처리", text: "자체처리" }, -]; +//export const erctUswtrPrcsMeth: SelectDataType[] = lwCds['erctUswtrPrcsMeth']??[] -export const rusePrcsMthdCd: SelectDataType[] = [ - { val: "물리학적처리", text: "물리학적처리" }, - { val: "생물학적처리", text: "생물학적처리" }, -]; +// [ +// { val: "처리장연계", text: "처리장연계" }, +// { val: "자체+연계", text: "자체+연계" }, +// { val: "자체처리", text: "자체처리" }, +// ]; + +// export const rusePrcsMthdCd: SelectDataType[] = lwCds['rusePrcsMthdCd']??[] + +// [ +// { val: "물리학적처리", text: "물리학적처리" }, +// { val: "생물학적처리", text: "생물학적처리" }, +// ]; export const ruseSeCd: SelectDataType[] = [ { val: "신규", text: "신규" }, @@ -46,101 +54,107 @@ export const ruseSeCd: SelectDataType[] = [ { val: "개량", text: "개량" }, ]; -export const ruseBizMthdCd: SelectDataType[] = [ - { val: "재정", text: "재정" }, - { val: "민간투자", text: "민간투자" }, - { val: "자체", text: "자체" }, -]; +// export const ruseBizMthdCd: SelectDataType[] = [ +// { val: "재정", text: "재정" }, +// { val: "민간투자", text: "민간투자" }, +// { val: "자체", text: "자체" }, +// ]; // 공통 건축물 용도 -export const bdstUsgCd: SelectDataType[] = [ - { val: "-1", text: "확인불가" }, - { val: "1", text: "운동장" }, - { val: "2", text: "체육관" }, - { val: "3", text: "공공업무시설" }, - { val: "4", text: "공공기관의청사" }, - { val: "5", text: "아파트" }, - { val: "6", text: "연립주택" }, - { val: "7", text: "다세대주택" }, - { val: "8", text: "기숙사" }, - { val: "9", text: "초등학교" }, - { val: "10", text: "중학교" }, - { val: "11", text: "고등학교" }, - { val: "12", text: "전문대학" }, - { val: "13", text: "대학및대학교" }, - { val: "14", text: "골프장" }, - { val: "15", text: "대규모점포" }, - { val: "16", text: "기타" }, - { val: "17", text: "숙박업" }, - { val: "18", text: "목욕장업" }, - { val: "19", text: "공장" }, - { val: "20", text: "발전시설" }, - { val: "21", text: "관광단지개발사업" }, - { val: "22", text: "도시개발사업" }, - { val: "23", text: "산업단지개발사업" }, - { val: "24", text: "택지개발사업" }, - { val: "25", text: "대규모점포(대형마트)" }, - { val: "26", text: "대규모점포(전문점)" }, - { val: "27", text: "대규모점포(백화점)" }, - { val: "28", text: "대규모점포(쇼핑센터)" }, - { val: "29", text: "대규모점포(복합쇼핑몰)" }, - { val: "30", text: "물류시설" }, - { val: "31", text: "운수시설(여객자동차터미널)" }, - { val: "32", text: "운수시설(철도시설)" }, - { val: "33", text: "운수시설(공항시설)" }, - { val: "34", text: "운수시설(항만시설)" }, - { val: "35", text: "업무시설(공공업무시설)" }, - { val: "36", text: "업무시설(금융업소)" }, - { val: "37", text: "업무시설(사무소)" }, - { val: "38", text: "업무시설(결혼상담소 등 소개업소)" }, - { val: "39", text: "업무시설(출판사)" }, - { val: "40", text: "업무시설(신문사)" }, - { val: "41", text: "업무시설(오피스텔)" }, - { val: "42", text: "교정시설" }, - { val: "43", text: "방송국" }, - { val: "44", text: "전신전화국" }, - { val: "45", text: "기타" }, -]; +export const bdstUsgCd: SelectDataType[] =lwCds?.bdstUsgCd?.concat(lwCds?.rswtBdstType??[])??[] -export const rswtBdstType: SelectDataType[] = [ - { val: "17", text: "숙박업" }, - { val: "18", text: "목욕장업" }, - { val: "19", text: "공장" }, - { val: "20", text: "발전시설" }, - { val: "21", text: "관광단지개발사업" }, - { val: "22", text: "도시개발사업" }, - { val: "23", text: "산업단지개발사업" }, - { val: "24", text: "택지개발사업" }, - { val: "25", text: "대규모점포(대형마트)" }, - { val: "26", text: "대규모점포(전문점)" }, - { val: "27", text: "대규모점포(백화점)" }, - { val: "28", text: "대규모점포(쇼핑센터)" }, - { val: "29", text: "대규모점포(복합쇼핑몰)" }, - { val: "30", text: "물류시설" }, - { val: "31", text: "운수시설(여객자동차터미널)" }, - { val: "32", text: "운수시설(철도시설)" }, - { val: "33", text: "운수시설(공항시설)" }, - { val: "34", text: "운수시설(항만시설)" }, - { val: "35", text: "업무시설(공공업무시설)" }, - { val: "36", text: "업무시설(금융업소)" }, - { val: "37", text: "업무시설(사무소)" }, - { val: "38", text: "업무시설(결혼상담소 등 소개업소)" }, - { val: "39", text: "업무시설(출판사)" }, - { val: "40", text: "업무시설(신문사)" }, - { val: "41", text: "업무시설(오피스텔)" }, - { val: "42", text: "교정시설" }, - { val: "43", text: "방송국" }, - { val: "44", text: "전신전화국" }, - { val: "45", text: "기타" }, -]; +// [ +// { val: "-1", text: "확인불가" }, +// { val: "1", text: "운동장" }, +// { val: "2", text: "체육관" }, +// { val: "3", text: "공공업무시설" }, +// { val: "4", text: "공공기관의청사" }, +// { val: "5", text: "아파트" }, +// { val: "6", text: "연립주택" }, +// { val: "7", text: "다세대주택" }, +// { val: "8", text: "기숙사" }, +// { val: "9", text: "초등학교" }, +// { val: "10", text: "중학교" }, +// { val: "11", text: "고등학교" }, +// { val: "12", text: "전문대학" }, +// { val: "13", text: "대학및대학교" }, +// { val: "14", text: "골프장" }, +// { val: "15", text: "대규모점포" }, +// { val: "16", text: "기타" }, +// { val: "17", text: "숙박업" }, +// { val: "18", text: "목욕장업" }, +// { val: "19", text: "공장" }, +// { val: "20", text: "발전시설" }, +// { val: "21", text: "관광단지개발사업" }, +// { val: "22", text: "도시개발사업" }, +// { val: "23", text: "산업단지개발사업" }, +// { val: "24", text: "택지개발사업" }, +// { val: "25", text: "대규모점포(대형마트)" }, +// { val: "26", text: "대규모점포(전문점)" }, +// { val: "27", text: "대규모점포(백화점)" }, +// { val: "28", text: "대규모점포(쇼핑센터)" }, +// { val: "29", text: "대규모점포(복합쇼핑몰)" }, +// { val: "30", text: "물류시설" }, +// { val: "31", text: "운수시설(여객자동차터미널)" }, +// { val: "32", text: "운수시설(철도시설)" }, +// { val: "33", text: "운수시설(공항시설)" }, +// { val: "34", text: "운수시설(항만시설)" }, +// { val: "35", text: "업무시설(공공업무시설)" }, +// { val: "36", text: "업무시설(금융업소)" }, +// { val: "37", text: "업무시설(사무소)" }, +// { val: "38", text: "업무시설(결혼상담소 등 소개업소)" }, +// { val: "39", text: "업무시설(출판사)" }, +// { val: "40", text: "업무시설(신문사)" }, +// { val: "41", text: "업무시설(오피스텔)" }, +// { val: "42", text: "교정시설" }, +// { val: "43", text: "방송국" }, +// { val: "44", text: "전신전화국" }, +// { val: "45", text: "기타" }, +// ]; -export const orgwtKndCd = [ - { text: "오수(변기 오수 제외)", val: "01" }, - { text: "오수", val: "02" }, - { text: "폐수", val: "03" }, - { text: "오수 및 폐수", val: "04" }, - { text: "기타", val: "05" }, -]; + export const rswtBdstType: SelectDataType[] = lwCds?.rswtBdstType??[] +//[ +// { val: "17", text: "숙박업" }, +// { val: "18", text: "목욕장업" }, +// { val: "19", text: "공장" }, +// { val: "20", text: "발전시설" }, +// { val: "21", text: "관광단지개발사업" }, +// { val: "22", text: "도시개발사업" }, +// { val: "23", text: "산업단지개발사업" }, +// { val: "24", text: "택지개발사업" }, +// { val: "25", text: "대규모점포(대형마트)" }, +// { val: "26", text: "대규모점포(전문점)" }, +// { val: "27", text: "대규모점포(백화점)" }, +// { val: "28", text: "대규모점포(쇼핑센터)" }, +// { val: "29", text: "대규모점포(복합쇼핑몰)" }, +// { val: "30", text: "물류시설" }, +// { val: "31", text: "운수시설(여객자동차터미널)" }, +// { val: "32", text: "운수시설(철도시설)" }, +// { val: "33", text: "운수시설(공항시설)" }, +// { val: "34", text: "운수시설(항만시설)" }, +// { val: "35", text: "업무시설(공공업무시설)" }, +// { val: "36", text: "업무시설(금융업소)" }, +// { val: "37", text: "업무시설(사무소)" }, +// { val: "38", text: "업무시설(결혼상담소 등 소개업소)" }, +// { val: "39", text: "업무시설(출판사)" }, +// { val: "40", text: "업무시설(신문사)" }, +// { val: "41", text: "업무시설(오피스텔)" }, +// { val: "42", text: "교정시설" }, +// { val: "43", text: "방송국" }, +// { val: "44", text: "전신전화국" }, +// { val: "45", text: "기타" }, +// ]; + +//export const orgwtKndCd =lwCds['orgwtKndCd']??[] + + +// [ +// { text: "오수(변기 오수 제외)", val: "01" }, +// { text: "오수", val: "02" }, +// { text: "폐수", val: "03" }, +// { text: "오수 및 폐수", val: "04" }, +// { text: "기타", val: "05" }, +// ]; export const chBuCd = [ { val: "증축", text: "증축" }, @@ -148,97 +162,104 @@ export const chBuCd = [ { val: "재축", text: "재축" }, ]; -export const dmdUszCd = [ - { val: "조경용수", text: "조경용수" }, - { val: "청소화장실용수", text: "청소화장실용수" }, - { val: "농업용수", text: "농업용수" }, - { val: "공업용수", text: "공업용수" }, - { val: "친수용수", text: "친수용수" }, - { val: "기타", text: "기타" }, -]; +// export const dmdUszCd = [ +// { val: "조경용수", text: "조경용수" }, +// { val: "청소화장실용수", text: "청소화장실용수" }, +// { val: "농업용수", text: "농업용수" }, +// { val: "공업용수", text: "공업용수" }, +// { val: "친수용수", text: "친수용수" }, +// { val: "기타", text: "기타" }, +// ]; -export const ruseMngMtd = [ - { val: "자체운영", text: "자체운영" }, - { val: "공기업", text: "공기업" }, - { val: "민간(대행)", text: "민간(대행)" }, -]; -export const pplQulity = [ - { val: "도복장강관", text: "도복장강관" }, - { val: "PE관", text: "PE관" }, - { val: "스테인레스관", text: "스테인레스관" }, - { val: "덕타일주철관", text: "덕타일주철관" }, - { val: "유리섬유복합관", text: "유리섬유복합관" }, - { val: "기타", text: "기타" }, -]; -export const pplLenght = [ - { val: "D100", text: "D100" }, - { val: "D200", text: "D200" }, - { val: "D250", text: "D250" }, - { val: "D300", text: "D300" }, - { val: "D350", text: "D350" }, - { val: "D400", text: "D400" }, - { val: "D450", text: "D450" }, - { val: "D500", text: "D500" }, - { val: "D700", text: "D700" }, - { val: "D900", text: "D900" }, - { val: "D1000​", text: "D1000​" }, -]; -export const rainFcltCd = [ - { val: "10", text: "확인불가" }, - { val: "01", text: "지붕" }, - { val: "02", text: "건물옥상" }, - { val: "03", text: "골프장 연못" }, - { val: "04", text: "운동장 바닥" }, - { val: "05", text: "운동장 지붕" }, - { val: "06", text: "주차장" }, - { val: "07", text: "태양광패널" }, - { val: "08", text: "연못" }, - { val: "09", text: "기타" }, -]; +// export const ruseMngMtd = lwCds['ruseMngMtd'] +// [ +// { val: "자체운영", text: "자체운영" }, +// { val: "공기업", text: "공기업" }, +// { val: "민간(대행)", text: "민간(대행)" }, +// ]; + +// export const pplQulity = +// [ +// { val: "도복장강관", text: "도복장강관" }, +// { val: "PE관", text: "PE관" }, +// { val: "스테인레스관", text: "스테인레스관" }, +// { val: "덕타일주철관", text: "덕타일주철관" }, +// { val: "유리섬유복합관", text: "유리섬유복합관" }, +// { val: "기타", text: "기타" }, +// ]; +// export const pplLenght = [ +// { val: "D100", text: "D100" }, +// { val: "D200", text: "D200" }, +// { val: "D250", text: "D250" }, +// { val: "D300", text: "D300" }, +// { val: "D350", text: "D350" }, +// { val: "D400", text: "D400" }, +// { val: "D450", text: "D450" }, +// { val: "D500", text: "D500" }, +// { val: "D700", text: "D700" }, +// { val: "D900", text: "D900" }, +// { val: "D1000​", text: "D1000​" }, +// ]; + +// export const rainFcltCd = lwCds?.rainFcltCd??[] + + +// [ +// { val: "10", text: "확인불가" }, +// { val: "01", text: "지붕" }, +// { val: "02", text: "건물옥상" }, +// { val: "03", text: "골프장 연못" }, +// { val: "04", text: "운동장 바닥" }, +// { val: "05", text: "운동장 지붕" }, +// { val: "06", text: "주차장" }, +// { val: "07", text: "태양광패널" }, +// { val: "08", text: "연못" }, +// { val: "09", text: "기타" }, +// ]; //물리화학적처리(스크린, 응집, 침전)/생물학적처리(활성슬러지법 등)/소독(염소, UV 등)/기타 -export const rswtPrscCdMthdCd = [ - { - val: "물리화학적처리(스크린,응집,침전)", - text: "물리화학적처리(스크린,응집,침전)", - }, - { - val: "생물학적처리(활성슬러지법 등)", - text: "생물학적처리(활성슬러지법 등)", - }, - { val: "소독(염소, UV 등)", text: "소독(염소, UV 등)" }, - { val: "기타", text: "기타" }, - { val: "확인불가", text: "확인불가" }, -]; +export const rswtPrscCdMthdCd = lwCds['rswtPrscCdMthdCd']??[] +// { +// val: "물리화학적처리(스크린,응집,침전)", +// text: "물리화학적처리(스크린,응집,침전)", +// }, +// { +// val: "생물학적처리(활성슬러지법 등)", +// text: "생물학적처리(활성슬러지법 등)", +// }, +// { val: "소독(염소, UV 등)", text: "소독(염소, UV 등)" }, +// { val: "기타", text: "기타" }, +// { val: "확인불가", text: "확인불가" }, +// ]; -export const htdPowerMthdCd= [ - { - val: "해당없음", - text: "해당없음", - }, - { - val: "석탄화력발전", - text: "석탄화력발전", - }, - { - val: "화력발전", - text: "화력발전", - }, - { - val: "수력발전", - text: "수력발전", - }, - { - val: "태양관발전", - text: "태양관발전", - }, -]; +// export const htdPowerMthdCd = [ +// { +// val: "해당없음", +// text: "해당없음", +// }, +// { +// val: "석탄화력발전", +// text: "석탄화력발전", +// }, +// { +// val: "화력발전", +// text: "화력발전", +// }, +// { +// val: "수력발전", +// text: "수력발전", +// }, +// { +// val: "태양관발전", +// text: "태양관발전", +// }, +// ]; //(공업용수/양식장/농업용수) -export const htdUtztnUsgCd= [ +export const htdUtztnUsgCd = [ { val: "공업용수", text: "공업용수", @@ -252,3 +273,171 @@ export const htdUtztnUsgCd= [ text: "농업용수", }, ]; + +export const ruseFcltSpot = [] +//(공업용수/양식장/농업용수) +export const rainRswtMng = [ + { + val: "위탁", + text: "01", + }, + { + val: "자체", + text: "02", + }, +]; + +export const rainFcltFlowRate = [ + { + val: "01", + text: "유량계", + }, + { + val: "02", + text: "수위계", + }, + { + val: "03", + text: "펌프적산전력계", + }, + { + val: "04", + text: "기타", + }, +]; +export const rainRswtUse = [ + { + val: "01", + text: "유량계", + }, + { + val: "02", + text: "수위계", + }, + { + val: "03", + text: "펌프적산전력계", + }, + { + val: "04", + text: "기타", + }, +]; + +export const sewageInFcltUse = [ + { + val: "01", + text: "세척수", + }, + { + val: "02", + text: "냉각수", + }, + { + val: "03", + text: "청소수", + }, + { + val: "04", + text: "삭수대", + }, + { + val: "05", + text: "희석용수", + }, + { + val: "06", + text: "중수도", + }, + { + val: "07", + text: "기타", + }, +]; + +export const sewageOutFclttUse = [ + { + val: "01", + text: "청소화장실용수", + }, + { + val: "02", + text: "세척살수용수", + }, + { + val: "03", + text: "조경용수", + }, + { + val: "04", + text: "친수용수", + }, + { + val: "05", + text: "지하수충전", + }, + { + val: "06", + text: "농업용수", + }, + { + val: "07", + text: "하천등유지용수", + }, + { + val: "08", + text: "공업용수", + }, +]; +const codeMApping = { + WR001: "bdstUsgCd", + WR002: "rswtBdstType", + WR003: "rainFcltCd", + WR004: "bdstGrntchClass", + WR005: "rswtPrscCdMthdCd", // 아직 디 못바꿈 + WR006: "orgwtKndCd", //작업 완ㅛ + WR007: "ruseMngMtd", // 작업완료 + WR008: "rusePrcsMthdCd", //w작업완료 + WR009: "erctUswtrPrcsMeth",//w작업완료 + WR010: "ruseFcltSpot",// inout은 yn 만 사용해야 함으로 해당 코드는 사용안함. + WR011: "pplQulity", + WR012: "pplLenght", + WR013: "bdstFilterYn", // 사용 불가 yn만 사용해야함으로 해당코드 사용 안함 + WR014: "rainRswtMng", // 지도점검 등록 시변경 + WR015: "rainFcltFlowRate", //지도점검 등록 시변경 + WR016: "dmdUszCd", // 지도점검 등록 시변경 + WR017: "sewageInFcltUse", //하수재이용 장내 + WR018: "sewageOutFclttUse", // 하수재이용 장외 + WR019: "htdPowerMthdCd", + WR020: "htdUtztnUsgCd", +}; +export const getCommonUpCd = async () => { + const upCd = await getFetchWithCount( + fetchType.LOCAL, + "/cms-service/api/v1/up-codes?keyword=&upCd=&cdSe=&useYn=Y&siteId=WR&page=0&size=100&sort=string" + ); + + const upWrCode: string[] = upCd.content + .filter((item: any) => item.upCd.slice(0, 2) === "WR") + .map((cd: any) => cd.upCd); + + await Promise.all( + upWrCode.map(async (cd) => { + const mapping = codeMApping[cd as keyof typeof codeMApping]; + if (!mapping) return; + + const lwCd = await getFetchWithCount( + fetchType.LOCAL, + `/cms-service/api/v1/lwpo-cds/up-cd/${cd}` + ); + + const list = Array.isArray(lwCd) ? lwCd : lwCd.content ?? []; + + lwCds[mapping] = list.map((it: any) => ({ + text: it.lwpoCdNm, + val: it.lwpoCd, + })); + }) + ); + +}; \ No newline at end of file diff --git a/apps/wr/app/store/common/code/index.ts b/apps/wr/app/store/common/code/index.ts index 72e910aad..822c95ddb 100644 --- a/apps/wr/app/store/common/code/index.ts +++ b/apps/wr/app/store/common/code/index.ts @@ -5,22 +5,10 @@ import type { } from "@common/business_components/ui"; import { bdstFilterYn, - bdstGrntchClass, bdstIncenYn, - bdstUsgCd, chBuCd, - dmdUszCd, - erctUswtrPrcsMeth, - htdPowerMthdCd, - htdUtztnUsgCd, - orgwtKndCd, - pplLenght, - pplQulity, - rainFcltCd, + lwCds, rswtPrscCdMthdCd, - ruseBizMthdCd, - ruseMngMtd, - rusePrcsMthdCd, ruseSeCd, yn, } from "./basicCode"; @@ -151,6 +139,9 @@ export const getEnvPartCd = async (set: any) => { } }; + + + export type comCodeState = { code: { isInit: boolean; @@ -184,6 +175,7 @@ export type comCodeState = { rswtPrscCdMthdCd: SelectDataType[]; htdPowerMthdCd: SelectDataType[]; htdUtztnUsgCd: SelectDataType[]; + rswtBdstType:SelectDataType[]; userSiSggCd: string; }; }; @@ -193,44 +185,45 @@ export type comCodeType = comCodeState & comCodeActions; export const comCodeStateExport: comCodeState = { code: { isInit: false, - rainFcltCd: rainFcltCd, - bdstUsgCd: bdstUsgCd, + rainFcltCd: lwCds['rainFcltCd']??[], + bdstUsgCd: lwCds['bdstUsgCd']??[] , chBuCd: chBuCd, - orgwtKndCd: orgwtKndCd, + orgwtKndCd: lwCds['orgwtKndCd']??[] , cityCd: [], sggCd: [], rvbsnCd: [], mdmbsnCd: [], lgbsnCd: [], lclgvrnmntCd: [], - pplQulity: pplQulity, - pplLenght: pplLenght, + pplQulity: lwCds['pplQulity']??[] , + pplLenght: lwCds['pplLenght']??[] , yn: yn, - dmdUszCd: dmdUszCd, + dmdUszCd: lwCds['dmdUszCd']??[] , buildingType: buildingType, - ruseMngMtd: ruseMngMtd, + ruseMngMtd: lwCds['ruseMngMtd']??[], ruseSeCd: ruseSeCd, - ruseBizMthdCd: ruseBizMthdCd, - rusePrcsMthdCd: rusePrcsMthdCd, - erctUswtrPrcsMeth: erctUswtrPrcsMeth, + ruseBizMthdCd: lwCds['ruseBizMthdCd']??[], + rusePrcsMthdCd: lwCds['rusePrcsMthdCd']??[], + erctUswtrPrcsMeth: lwCds['erctUswtrPrcsMeth']??[], bdstFilterYn: bdstFilterYn, bdstIncenYn: bdstIncenYn, - bdstGrntchClass: bdstGrntchClass, - rswtPrscCdMthdCd: rswtPrscCdMthdCd, - htdPowerMthdCd: htdPowerMthdCd, - htdUtztnUsgCd: htdUtztnUsgCd, + bdstGrntchClass: lwCds['bdstGrntchClass']??[], + rswtPrscCdMthdCd: rswtPrscCdMthdCd, // 공단연락오면 바꿔야함 + htdPowerMthdCd: lwCds['htdPowerMthdCd']??[], + htdUtztnUsgCd: lwCds['htdUtztnUsgCd']??[], userSiSggCd: laeSecd, + rswtBdstType:lwCds['rswtBdstType']??[] , }, }; export type comCodeActions = { returnCodeText: (val: string, codeName: string) => string; + returnTextCode: (text: string, codeName: string) => string; }; export const codeActionExport: (set: any) => comCodeActions = (set: any) => { return { returnCodeText: (val: string, codeName: string) => { - console.log('val', val, 'codeName', codeName); return set((state: comCodeState) => { const codeList = state.code[codeName] || []; const found = codeList.find((item) => item.val === val); @@ -238,5 +231,13 @@ export const codeActionExport: (set: any) => comCodeActions = (set: any) => { } ); }, + returnTextCode: (text: string, codeName: string) => { + return set((state: comCodeState) => { + const codeList = state.code[codeName] || []; + const found = codeList.find((item) => item.text === text); + return found ? found.val : text; + } + ); + }, }; }; diff --git a/apps/wr/app/store/common/code/type.ts b/apps/wr/app/store/common/code/type.ts new file mode 100644 index 000000000..55f684f55 --- /dev/null +++ b/apps/wr/app/store/common/code/type.ts @@ -0,0 +1,31 @@ + +export type LwCdType= { + lwpoCd: string, + upCd: string, + lwpoCdNm:string, + lwpoCdExpln:string, + unit: string, + prntLwpoCd: string, + useYn: string, + sortSeq: number, + regDt: Date, + rgtr: string, + mdfcnDt: Date, + mdfr: string +} + + +export type UPCdType= { + upCd: string, + upCdNm: string, + upCdExpln: string, + cdSe: string, + useYn: string, + delYn: string, + siteId: string, + regDt:Date, + rgtr: string + mdfcnDt: Date, + mdfr: string + +} diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx index 38e2cab7f..84619f307 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx @@ -7,6 +7,7 @@ import { parseRawValue, } from "@/components/lib/func/excelFunc"; import toast from "react-hot-toast"; +import { codeToText, textToCode } from "@/components/lib/func/commom"; export const useTypes = [ "조경용수", "청소화장실용수", @@ -17,17 +18,13 @@ export const useTypes = [ "기타", ]; - -export const chkMngType =[ - '위탁', - '자체' -] -export const chkSpwtPositnType = [ - '유량계', - '수위계', - '펌프적산전력계', - '기타' -] +export const chkMngType = { "01": "위탁", "02": "자체" }; +export const rainFcltFlowRateType = { + "01": "유량계", + "02": "수위계", + "03": "펌프적산전력계", + "04": "기타", +}; export type Buildingtype = { bdstInfoSn: number; @@ -118,7 +115,7 @@ export const excelToRainChkData = (excelData: any, year: string) => { const ruseData = parseRawValue(item[`빗물_${month}월`]); if (month.length < 2) month = "0" + month; return { - utztnUsgCd: item["이용용도"], + utztnUsgCd: textToCode(item["이용용도"], "dmdUszCd") ?? undefined, ym: year + month, chckYmd: checkYmd, splyUswtrUtztnQnt: splyData, @@ -133,14 +130,14 @@ export const excelToRainChkData = (excelData: any, year: string) => { bdstRuseFcltSn: Number(item["NO"]), chckYmd: checkYmd, rgtr: TEST_UUID, - operMngCd: item["운영관리형태"] ?? "", + operMngCd: textToCode(item["운영관리형태"], "rainRswtMng") ??item["운영관리형태"], anlOperCst: parseRawValue(item["연간운영비(원/년)"]), - oilqMeasMthd: item["유량측정방법"] ?? "", + oilqMeasMthd: textToCode( item["유량측정방법"],"rainFcltFlowRate",)??item["유량측정방법"], guideDetails: makeGuidDetail, rainyDetails: [ { ph: item["PH"], - utztnUsgCd: item["이용용도"], + utztnUsgCd: textToCode(item["이용용도"], "dmdUszCd")??item["이용용도"], trbt: parseRawValue(item["탁도"]), grssClfg: parseRawValue(item["총대장균군수"]), etc: item["기타"] || "", // 필드 누락 방지 @@ -156,10 +153,10 @@ export const excelToRainChkData = (excelData: any, year: string) => { }) .filter((el: any) => el !== undefined); -console.log("rainChkgdData", rainChkgdData); + console.log('rainChkgdData ', rainChkgdData) if (rainChkgdData.length > 0) { rainChkgdData.forEach((rain: any) => { - const defaultMessage = `[시설명: ${rain.bdstNm}, 점검일: ${rain.chckYmd}, 이용용도: ${rain.guideDetails[0]?.utztnUsgCd}] 항목에서 `; + const defaultMessage = `[시설명: ${rain.bdstNm}, 점검일: ${rain.chckYmd}, 이용용도: ${codeToText(rain.guideDetails[0]?.utztnUsgCd, "dmdUszCd") ??rain.guideDetails[0]?.utztnUsgCd}] 항목에서 `; if (rain.chckYmd && isInvalidDate(rain.chckYmd)) { issues.push( @@ -173,15 +170,20 @@ console.log("rainChkgdData", rainChkgdData); ); } - if (rain.operMngCd.length > 1 && !chkMngType.includes(rain.operMngCd)) { + if (rain.operMngCd.length > 1 && !chkMngType[rain.operMngCd]) { issues.push( - defaultMessage + `운영관리 형태: 위탁 혹은 자체 만 허용) /입력값:${rain.oilqMeasMthd}` + defaultMessage + + `운영관리 형태: 위탁 혹은 자체 만 허용) /입력값:${rain.operMngCd}` ); } - if (rain.oilqMeasMthd.length > 1 && !chkSpwtPositnType.includes(rain.oilqMeasMthd)) { + if ( + rain.oilqMeasMthd.length > 1 && + !rainFcltFlowRateType[rain.oilqMeasMthd] + ) { issues.push( - defaultMessage + `유량측정방법: 유량계, 수위계, 펌프적산전력계, 기타) /입력값:${rain.oilqMeasMthd}` + defaultMessage + + `유량측정방법: 유량계, 수위계, 펌프적산전력계, 기타) /입력값:${rain.oilqMeasMthd}` ); } @@ -190,11 +192,14 @@ console.log("rainChkgdData", rainChkgdData); issues.push(defaultMessage + `PH: 숫자 형식 아님 /입력값:${key.ph}`); } if (key.trbt?.length > 1 && isInvalidNumber(key.trbt)) { - issues.push(defaultMessage + `탁도: 숫자 형식 아님 /입력값:${key.trbt}`); + issues.push( + defaultMessage + `탁도: 숫자 형식 아님 /입력값:${key.trbt}` + ); } if (key.grssClfg?.length > 1 && isInvalidNumber(key.grssClfg)) { issues.push( - defaultMessage + `총대장균군수: 숫자 형식 아님 /입력값:${key.grssClfg}` + defaultMessage + + `총대장균군수: 숫자 형식 아님 /입력값:${key.grssClfg}` ); } if (key.levyAmt?.length > 1 && isInvalidNumber(key.levyAmt)) { @@ -226,7 +231,7 @@ console.log("rainChkgdData", rainChkgdData); } }); }); - }else{ + } else { toast.error("데이터가 없습니다. 점검 데이터를 확인해주세요."); } diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx index 2b03d86df..d2c0bf7d7 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx @@ -87,6 +87,7 @@ export type chHeadType = { export type splRuseWaterType = { utztnUsgCd: string; + utztnUsgCdText: string; splTotal: number; spl01: number; spl02: number; @@ -141,12 +142,12 @@ export const rainChkgdnHeadListExport: TableUpperProps[] = [ { id: "cityText", title: "시도", mergeCell: true }, { id: "sggText", title: "시군구", mergeCell: true }, { id: "bdstNm", title: "시설명", mergeCell: true }, - { id: "operMngCd", title: "운영관리형태", mergeCell: true }, - { id: "oilqMeasMthd", title: "유량측정방법", mergeCell: true }, + { id: "operMngCdText", title: "운영관리형태", mergeCell: true }, + { id: "oilqMeasMthdText", title: "유량측정방법", mergeCell: true }, { id: "anlOperCst", title: "연간운영비(원/년)", mergeCell: true }, { id: "dtfcltCpct", title: "빗물저류조용량(m³)", mergeCell: true }, { id: "chckYmd", title: "점검일", mergeCell: true }, - { id: "utztnUsgCd", title: "이용용도" }, + { id: "utztnUsgCdText", title: "이용용도" }, { id: "totalSplyUswtrUtztnQnt", title: "연간대체수이용량(m³)" }, { id: "totalRuseFcltUtztnQnt", title: "연간빗물이용량(m³)" }, { @@ -201,7 +202,7 @@ export const rainChkgdnHeadListExport: TableUpperProps[] = [ ]; export const ruseHeadListExport: TableUpperProps[] = [ - { id: "utztnUsgCd", title: "이용용도" }, + { id: "utztnUsgCdText", title: "이용용도" }, { id: "ruseTotal", title: "계", upName: "ruseWater", upSequnce: 1 }, { id: "ruse01", title: "1월", upName: "ruseWater", upSequnce: 2 , edit: true }, { id: "ruse02", title: "2월", upName: "ruseWater", upSequnce: 3 , edit: true }, @@ -218,7 +219,7 @@ export const ruseHeadListExport: TableUpperProps[] = [ ]; export const splHeadListExport: TableUpperProps[] = [ - { id: "utztnUsgCd", title: "이용용도" }, + { id: "utztnUsgCdText", title: "이용용도" }, { id: "splTotal", title: "계", upName: "splWater", upSequnce: 1}, { id: "spl01", title: "1월", upName: "splWater", upSequnce: 2, edit: true }, { id: "spl02", title: "2월", upName: "splWater", upSequnce: 3, edit: true }, diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx index a3372639b..5edba24b5 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel.tsx @@ -11,6 +11,7 @@ import { useTypes, type Buildingtype } from "../rainChkgdn/excel"; +import { codeToText, textToCode } from "@/components/lib/func/commom"; export const rswtMakeExcelSample = ( buildings: Buildingtype[], @@ -158,12 +159,12 @@ export const excelToRswtGuideData = ( if (checkYmd.length > 7) { return { bdstRuseFcltSn: Number(item["NO"]), - operMngCd: item["운영관리형태"], + operMngCd: textToCode(item["운영관리형태"], "rainRswtMng") ??item["운영관리형태"], anlOperCst: parseCommaRawValue(item["연간운영비(원/년)"]), prcsCpct: parseRawValue(item[`처리용량(m³)`]), spwtPositn: item["채수지점"], chckYmd: checkYmd, - utztnUsgCd: item["이용용도"], + utztnUsgCd: textToCode(item["이용용도"], "dmdUszCd")??item["이용용도"], guideDetails: makeGuidDetail, rgtr: TEST_UUID, mdfr: TEST_UUID, @@ -226,7 +227,7 @@ export const excelToRswtPolution = (excelData: any) => { return { bdstRuseFcltSn: Number(item["NO"]), chckYmd: checkYmd, - utztnUsgCd: item["이용용도"], + utztnUsgCd: textToCode(item["이용용도"], "dmdUszCd")??item["이용용도"], operMngCd: item["운영관리형태"], anlOperCst: parseCommaRawValue(item["연간운영비(원/년)"]), prcsCpct: parseRawValue(item["처리용량(m³)"]), @@ -236,7 +237,7 @@ export const excelToRswtPolution = (excelData: any) => { mdfr: TEST_UUID, rswtrDetails: [ { - utztnUsgCd: item["이용용도"], + utztnUsgCd: textToCode(item["이용용도"], "dmdUszCd")??item["이용용도"], vltnDt: vltnDt, vltnMttr: item["위반사항"], levyAmt: Number(item["과태료 부과금액(천원)"]) ?? 0, @@ -248,13 +249,6 @@ export const excelToRswtPolution = (excelData: any) => { } }) .filter((el: any) => el !== undefined); - // if (rswtChkgdData.length > 0) { - // rswtExcelDataCheck(rswtChkgdData, issues); - // } - - // if (issues.length > 0) { - // return { data: [], issues }; - // } return rswtChkgdData }; @@ -265,7 +259,7 @@ export const rswtExcelDataCheck = ( ) => { rswtChkgdData.forEach((rswt: any) => { - const defaultMessage = `*중수도 수질 [NO: ${rswt.bdstRuseFcltSn}, 점검일: ${rswt.chckYmd}, 이용용도: ${rswt.utztnUsgCd}] 항목에서 `; + const defaultMessage = `*중수도 수질 [NO: ${rswt.bdstRuseFcltSn}, 점검일: ${rswt.chckYmd}, 이용용도: ${codeToText(rswt.utztnUsgCd ,"dmdUszCd")??rswt.utztnUsgCd}] 항목에서 `; if (rswt.chckYmd && isInvalidDate(rswt.chckYmd)) { issues.push(defaultMessage + `점검일: 날짜 형식 아님 (${rswt.chckYmd})`); @@ -284,7 +278,7 @@ export const rswtExcelDataCheck = ( } // if ( // rswt.spwtPositn.length > 1 && - // !chkSpwtPositnType.includes(rswt.spwtPositn) + // !rainFcltFlowRateType[rswt.spwtPositn] // ) { // issues.push( // defaultMessage + diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList.tsx index 56ee59197..652e0fea7 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList.tsx @@ -53,6 +53,7 @@ const buildingZod = z.object({ }); export const rswtrPolutionsZode = z.object({ + utztnUsgCdText:z.string().nullish(), chkgdnDtlFk: z.string().nullish(), utztnUsgCd: z.string().nullish(), node: z.string().nullish(), @@ -143,7 +144,7 @@ export const rswtChkHeadListExport: TableUpperProps[] = [ { id: "prcsCpct", title: "처리용량(m³)" ,mergeCell: true}, { id: "spwtPositn", title: "채수지점" ,mergeCell: true}, { id: "chckYmd", title: "점검일" ,mergeCell: true}, - { id: "utztnUsgCd", title: "이용용도" }, + { id: "utztnUsgCdText", title: "이용용도" }, { id: "splyUswtrUtztnQnt", title: "연간대체수이용량(m³)" ,type: "number"}, { id: "ruseFcltUtztnQnt", title: "연간중수도이용량(m³)",type: "number"}, @@ -197,7 +198,7 @@ export const rswtChkHeadListExport: TableUpperProps[] = [ export const rswtDetailHeadListExport: TableUpperProps[] = [ - { id: "utztnUsgCd", title: "이용용도" }, + { id: "utztnUsgCdText", title: "이용용도" }, { id: "grssClfgUswtr", diff --git a/apps/wr/app/store/prfmncSttn/chkgdnSttn/rainChkgdnSttn/headList.tsx b/apps/wr/app/store/prfmncSttn/chkgdnSttn/rainChkgdnSttn/headList.tsx index bfd2838d0..0d995fbe3 100644 --- a/apps/wr/app/store/prfmncSttn/chkgdnSttn/rainChkgdnSttn/headList.tsx +++ b/apps/wr/app/store/prfmncSttn/chkgdnSttn/rainChkgdnSttn/headList.tsx @@ -5,12 +5,12 @@ export const rainChkgdnHeadSttnExport: TableUpperProps[] = [ { id: "cityText", title: "시도", mergeCell: true }, { id: "sggText", title: "시군구", mergeCell: true }, { id: "bdstNm", title: "시설명", mergeCell: true }, - { id: "operMngCd", title: "운영관리형태", mergeCell: true }, - { id: "oilqMeasMthd", title: "유량측정방법", mergeCell: true }, + { id: "operMngCdText", title: "운영관리형태", mergeCell: true }, + { id: "oilqMeasMthdText", title: "유량측정방법", mergeCell: true }, { id: "anlOperCst", title: "연간운영비(원/년)", mergeCell: true }, { id: "dtfcltCpct", title: "빗물저류조용량(m³)", mergeCell: true }, { id: "chckYmd", title: "점검일", mergeCell: true }, - { id: "utztnUsgCd", title: "이용용도" }, + { id: "utztnUsgCdText", title: "이용용도" }, { id: "totalSplyUswtrUtztnQnt", title: "연간대체수이용량(m³)" }, { id: "totalRuseFcltUtztnQnt", title: "연간빗물이용량(m³)" }, { @@ -59,7 +59,7 @@ export const rainChkgdnHeadSttnExport: TableUpperProps[] = [ ]; export const ruseSttnHeadListExport: TableUpperProps[] = [ - { id: "utztnUsgCd", title: "이용용도" }, + { id: "utztnUsgCdText", title: "이용용도" }, { id: "ruseTotal", title: "계", upName: "ruseWater", upSequnce: 1 }, { id: "ruse01", title: "1월", upName: "ruseWater", upSequnce: 2 }, { id: "ruse02", title: "2월", upName: "ruseWater", upSequnce: 3 }, @@ -76,7 +76,7 @@ export const ruseSttnHeadListExport: TableUpperProps[] = [ ]; export const splSttnHeadListExport: TableUpperProps[] = [ - { id: "utztnUsgCd", title: "이용용도" }, + { id: "utztnUsgCdText", title: "이용용도" }, { id: "splTotal", title: "계", upName: "splWater", upSequnce: 1 }, { id: "spl01", title: "1월", upName: "splWater", upSequnce: 2 }, { id: "spl02", title: "2월", upName: "splWater", upSequnce: 3 }, @@ -108,7 +108,7 @@ export const splSttnHeadListExport: TableUpperProps[] = [ ]; export const rswtDetailHeadListExport: TableUpperProps[] = [ - { id: "utztnUsgCd", title: "이용용도" }, + { id: "utztnUsgCdText", title: "이용용도" }, { id: "grssClfgUswtr", diff --git a/apps/wr/app/store/prfmncSttn/chkgdnSttn/rswtChkgdnSttn/headList.tsx b/apps/wr/app/store/prfmncSttn/chkgdnSttn/rswtChkgdnSttn/headList.tsx index 382396566..eb4d70781 100644 --- a/apps/wr/app/store/prfmncSttn/chkgdnSttn/rswtChkgdnSttn/headList.tsx +++ b/apps/wr/app/store/prfmncSttn/chkgdnSttn/rswtChkgdnSttn/headList.tsx @@ -10,7 +10,7 @@ export const rswtChkSttnHeadListExport: TableUpperProps[] = [ { id: "prcsCpct", title: "처리용량(m³)", mergeCell: true }, { id: "spwtPositn", title: "채수지점", mergeCell: true }, { id: "chckYmd", title: "점검일", mergeCell: true }, - { id: "utztnUsgCd", title: "이용용도" }, + { id: "utztnUsgCdText", title: "이용용도" }, { id: "splyUswtrUtztnQnt", title: "연간보급수이용량(m³)", type: "number" }, { id: "ruseFcltUtztnQnt", title: "연간중수도이용량(m³)", type: "number" }, diff --git a/apps/wr/app/store/store.tsx b/apps/wr/app/store/store.tsx index e19ec2216..6381b1b2a 100644 --- a/apps/wr/app/store/store.tsx +++ b/apps/wr/app/store/store.tsx @@ -341,6 +341,7 @@ export const StoreZus = ( getMiddleRegionCd(set); getUnitWaterShedCd(set); getEnvPartCd(set); + return { ...initState, ...comFcltSearchAction(set), diff --git a/apps/wr/components/lib/func/TableData.tsx b/apps/wr/components/lib/func/TableData.tsx index bee5e093d..1a66802f5 100644 --- a/apps/wr/components/lib/func/TableData.tsx +++ b/apps/wr/components/lib/func/TableData.tsx @@ -10,6 +10,7 @@ import { } from "@common/components/ui"; import moment from "moment"; import { + codeToText, formatCommaNumber, formatYyyymmdd, handleCommaNumberChange @@ -73,23 +74,23 @@ export const rswtChkTableData = (chkData: rswtChkZodType[]) => { let flatRswtChk = {}; const findGuide = root.guideDetails.find( (guide) => guide.utztnUsgCd === detail.utztnUsgCd - ); + ) const findPoluttion = root.rswtrPollutions.find( (polution) => polution.utztnUsgCd === detail.utztnUsgCd ); - const operMngCd = root?.reuseBuilding.operMngCd; flatRswtChk = { ...root, ...detail, ...findGuide, ...findPoluttion, ...flatRswtChk, - operMngCd: operMngCd, + utztnUsgCdText: codeToText(detail.utztnUsgCd, 'dmdUszCd'), }; makeRswtData.push(flatRswtChk); }); }); } + return makeRswtData; }; diff --git a/apps/wr/components/lib/func/commom.tsx b/apps/wr/components/lib/func/commom.tsx index 042e74aa6..144aace66 100644 --- a/apps/wr/components/lib/func/commom.tsx +++ b/apps/wr/components/lib/func/commom.tsx @@ -1,4 +1,5 @@ import type { comCodeState } from "@/app/store/common/code"; +import { lwCds } from "@/app/store/common/code/basicCode"; import { filePickedBlob, filePickedBlobArray, @@ -296,4 +297,23 @@ export const formatArchArea =(value: string, digits: number=0 ) => { // 다시 천 단위 콤마 찍어서 반환 return Number(rounded).toLocaleString(); +} + + +export const codeToText = ( val:string, codeName:string ) =>{ + + if(val===''|| val===undefined){ + return '' + } + + return lwCds[codeName]?.find((cd) => cd.val ===val)?.text +} + +export const textToCode = (text:string, codeName:string) =>{ + if(text===''|| text===undefined){ + return '' + } + + return lwCds[codeName]?.find((cd) => cd.text ===text)?.val + } \ No newline at end of file diff --git a/apps/wr/components/ui/modal/chkgd/chkgdModal/chkgdModal.tsx b/apps/wr/components/ui/modal/chkgd/chkgdModal/chkgdModal.tsx index c528f5add..196ac4b27 100644 --- a/apps/wr/components/ui/modal/chkgd/chkgdModal/chkgdModal.tsx +++ b/apps/wr/components/ui/modal/chkgd/chkgdModal/chkgdModal.tsx @@ -2,13 +2,24 @@ import { useWrStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/common/type/header"; import type { splRuseWaterType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList"; import type { rswtrPolutionsZode } from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList"; +import { codeToText } from "@/components/lib/func/commom"; import { GuideDetailsTable } from "@/components/ui/table/chkgdTable/guideDetailTable/guideDetailTable"; import { ScrollArea, Title } from "@common/business_components/ui"; import { Button } from "@common/components/ui"; import React, { useEffect, useState } from "react"; import type { z } from "zod"; -export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: string; obj: any, setIsModal: (open: boolean) => void, readonly: boolean }) { +export default function ChkgdModal({ + type, + obj, + setIsModal, + readonly, +}: { + type: string; + obj: any; + setIsModal: (open: boolean) => void; + readonly: boolean; +}) { const { rainChkgdn, rswtChkgdn, @@ -58,14 +69,14 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: setHeadList({ splHeadList: rainChkSttn.splHeadList, ruseHeadList: rainChkSttn.ruseHeadList, - rswtDetailHeadList: type === "RNB" ? [] : rswtChkSttn.rswtDetailSttnHeadList, + rswtDetailHeadList: + type === "RNB" ? [] : rswtChkSttn.rswtDetailSttnHeadList, }); } else { setHeadList({ splHeadList: rainChkgdn.splHeadList, ruseHeadList: rainChkgdn.ruseHeadList, - rswtDetailHeadList: - type === "RNB" ? [] : rswtChkgdn.rswtDetailHeadList, + rswtDetailHeadList: type === "RNB" ? [] : rswtChkgdn.rswtDetailHeadList, }); } }, [ @@ -73,12 +84,13 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: rainChkgdn.splHeadList, rainChkSttn.splHeadList, rswtChkgdn.rswtDetailHeadList, - rswtChkSttn.rswtDetailSttnHeadList + rswtChkSttn.rswtDetailSttnHeadList, ]); useEffect(() => { const result = obj.guideDetails?.reduce((acc: any, cur: any) => { const code = cur.utztnUsgCd; + const codeText = codeToText(cur.utztnUsgCd, "dmdUszCd"); const month = cur.ym?.slice(4); // "MM" const ruseMonthKey = `ruse${month}`; const splMonthKey = `spl${month}`; @@ -91,7 +103,12 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: (it: { utztnUsgCd: string }) => it?.utztnUsgCd === code ); if (!target) { - target = { utztnUsgCd: code, ruseTotal: 0, splTotal: 0 }; + target = { + utztnUsgCdText: codeText, + utztnUsgCd: code, + ruseTotal: 0, + splTotal: 0, + }; acc.push(target); } // 월별 값 누적 @@ -106,12 +123,11 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: if (result) { // '기타' 항목을 배열의 맨 뒤로 정렬합니다. result.sort((a: splRuseWaterType, b: splRuseWaterType) => { - if (a.utztnUsgCd === "기타") return 1; // a를 b 뒤로 보냅니다. - if (b.utztnUsgCd === "기타") return -1; // b를 a 뒤로 보냅니다. + if (a.utztnUsgCd === "07") return 1; // a를 b 뒤로 보냅니다. + if (b.utztnUsgCd === "07") return -1; // b를 a 뒤로 보냅니다. return 0; // 순서를 유지합니다. }); } - setGuidData(result as splRuseWaterType[]); if (obj.rswtrPollutions) { @@ -124,6 +140,10 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: obj.rswtrPollutions.forEach( (item: z.infer) => { const nodeKey = String(item.node); + item["utztnUsgCdText"] = codeToText( + item.utztnUsgCd ?? "", + "dmdUszCd" + ); resultPolution[nodeKey]?.push(item); } ); @@ -132,8 +152,8 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: Object.entries(resultPolution).forEach(([nodeKey, items]) => { const onlyData = items as z.infer[]; if (onlyData.length === 0) return; - const total = initStats(); + onlyData.forEach((item) => { total.grssClfgUswtr += item.grssClfgUswtr; total.combResdch += item.combResdch; @@ -148,7 +168,7 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: }); const average = { - utztnUsgCd: "평균", + utztnUsgCdText: "평균", edit: false, grssClfgUswtr: (total.grssClfgUswtr / onlyData.length).toFixed(1), combResdch: (total.combResdch / onlyData.length).toFixed(1), @@ -168,8 +188,8 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: // '기타' 항목을 배열의 맨 뒤로 정렬합니다. resultPolution[nodeKey].sort((a: any, b: any) => { - if (a.utztnUsgCd === "기타") return 1; // a를 b 뒤로 보냅니다. - if (b.utztnUsgCd === "기타") return -1; // b를 a 뒤로 보냅니다. + if (a.utztnUsgCd === "07") return 1; // a를 b 뒤로 보냅니다. + if (b.utztnUsgCd === "07") return -1; // b를 a 뒤로 보냅니다. return 0; // 순서를 유지합니다. }); @@ -213,16 +233,15 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: }); obj.guideDetails = realGuideDetail; if (type === "RNB") { - rainChkGuidUpdate(obj); - setIsModal(false) + setIsModal(false); } else { const polution = Object.values(upPolutionData) .flat() .filter((item) => item.utztnUsgCd !== "평균"); obj.rswtrPollutions = polution; rwstPolAndGuideUpdate([obj]); - setIsModal(false) + setIsModal(false); } }; @@ -247,7 +266,11 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: } > {!rainChkSttn.isSttn ? ( - ) : ( @@ -256,7 +279,8 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type:

{type === "RNB" - ? `시설명 : (${obj.bdstNm})` : `시설명 : (${obj.building.bdstNm})`} + ? `시설명 : (${obj.bdstNm})` + : `시설명 : (${obj.building.bdstNm})`}

@@ -269,7 +293,11 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: { setChGuidData(data); @@ -284,7 +312,11 @@ export default function ChkgdModal({ type, obj, setIsModal, readonly }: { type: { setChGuidData(data); diff --git a/apps/wr/components/ui/table/chkgdTable/rainChkgd/rainChkgdTable.tsx b/apps/wr/components/ui/table/chkgdTable/rainChkgd/rainChkgdTable.tsx index 6fc2c0632..b29d8d935 100644 --- a/apps/wr/components/ui/table/chkgdTable/rainChkgd/rainChkgdTable.tsx +++ b/apps/wr/components/ui/table/chkgdTable/rainChkgd/rainChkgdTable.tsx @@ -4,7 +4,7 @@ import { useWrStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/common/type/header"; import { rainPageSize, type rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"; import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList"; -import { tableData } from "@/components/lib/func/commom"; +import { codeToText, tableData } from "@/components/lib/func/commom"; import { chRowspanTable, rainChkTableData @@ -89,15 +89,18 @@ export default function RainChkgdTable({ } ) }) + return { ...item, ...bud[0], + utztnUsgCdText: codeToText(item.guideDetails[0].utztnUsgCd, 'dmdUszCd'), + oilqMeasMthdText:codeToText(item.oilqMeasMthd, 'rainFcltFlowRate'), + operMngCdText:codeToText(item.operMngCd.trim(), 'rainRswtMng'), rainyDetails:rainyDetails, rowspan: item.rainyDetails?.length, }; }); - console.log('rainChg ', rainChg) setMakeTableData(rainChkTableData(rainChg)); } else { setMakeTableData([]); From ad6e4484b7a67f66d92c258d9f7a2d45491042a8 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Mon, 15 Sep 2025 15:36:56 +0900 Subject: [PATCH 02/10] =?UTF-8?q?=EB=AC=BC=EC=9E=AC=EC=9D=B4=EC=9A=A9=20?= =?UTF-8?q?=EA=B3=B5=ED=86=B5=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/sdmInfoInsertForm/component.tsx | 2 +- .../matMng/coMat/coMatRvw/page.tsx | 2 +- apps/wr/app/store/common/code/basicCode.tsx | 113 ++- apps/wr/app/store/common/code/index.ts | 92 ++- .../app/store/matDmd/ruseCaseMng/headList.tsx | 2 +- .../prfmncReg/chkgdnReg/rainChkgdn/excel.tsx | 2 +- .../chkgdnReg/rainChkgdn/headList.tsx | 2 +- .../chkgdnReg/rswrtChkgdn/headList.tsx | 4 +- .../chkgdnSttn/rainChkgdnSttn/headList.tsx | 4 +- .../chkgdnSttn/rswtChkgdnSttn/headList.tsx | 4 +- .../fcltSttn/pbnstSttn/headList.tsx | 2 +- .../ruseFcltMng/fcltSttn/rainSttn/excel.tsx | 4 +- .../fcltSttn/rainSttn/headList.tsx | 4 +- .../ruseFcltMng/fcltSttn/rswtSttn/excel.tsx | 12 +- .../ruseFcltMng/fcltSttn/rswtSttn/index.tsx | 29 +- apps/wr/components/lib/func/commom.tsx | 19 +- apps/wr/components/lib/func/mapUtil.ts | 2 +- .../buseWaterQulity/buseWaterQulity.tsx | 2 +- .../mngRegFormDetail/mngRegFormDetail.tsx | 1 - .../ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx | 675 +++++++++--------- .../LayerPopUp/RainFacility/RainFacility.tsx | 6 +- .../LayerPopUp/RswtFacilty/RswtFacilty.tsx | 6 +- apps/wr/public/sample_rswtSttn.xlsx | Bin 10856 -> 9020 bytes 23 files changed, 537 insertions(+), 452 deletions(-) diff --git a/apps/dm/components/ui/sdmInfoInsertForm/component.tsx b/apps/dm/components/ui/sdmInfoInsertForm/component.tsx index 7c6c13b32..5cfa526b8 100644 --- a/apps/dm/components/ui/sdmInfoInsertForm/component.tsx +++ b/apps/dm/components/ui/sdmInfoInsertForm/component.tsx @@ -637,7 +637,7 @@ export function SdmInfoRegForm({ }} />
- +
( - +
= {}; +//export const lwCds: Record = {}; export const yn: SelectDataType[] = [ { val: "Y", text: "Y" }, { val: "N", text: "N" }, @@ -54,14 +53,14 @@ export const ruseSeCd: SelectDataType[] = [ { val: "개량", text: "개량" }, ]; -// export const ruseBizMthdCd: SelectDataType[] = [ -// { val: "재정", text: "재정" }, -// { val: "민간투자", text: "민간투자" }, -// { val: "자체", text: "자체" }, -// ]; +export const ruseBizMthdCd: SelectDataType[] = [ + { val: "재정", text: "재정" }, + { val: "민간투자", text: "민간투자" }, + { val: "자체", text: "자체" }, +]; // 공통 건축물 용도 -export const bdstUsgCd: SelectDataType[] =lwCds?.bdstUsgCd?.concat(lwCds?.rswtBdstType??[])??[] +//export const bdstUsgCd: SelectDataType[] =lwCds?.bdstUsgCd?.concat(lwCds?.rswtBdstType??[])??[] // [ // { val: "-1", text: "확인불가" }, @@ -112,7 +111,7 @@ export const bdstUsgCd: SelectDataType[] =lwCds?.bdstUsgCd?.concat(lwCds?.rswtBd // { val: "45", text: "기타" }, // ]; - export const rswtBdstType: SelectDataType[] = lwCds?.rswtBdstType??[] +// export const rswtBdstType: SelectDataType[] = lwCds?.rswtBdstType??[] //[ // { val: "17", text: "숙박업" }, // { val: "18", text: "목욕장업" }, @@ -221,7 +220,7 @@ export const chBuCd = [ // ]; //물리화학적처리(스크린, 응집, 침전)/생물학적처리(활성슬러지법 등)/소독(염소, UV 등)/기타 -export const rswtPrscCdMthdCd = lwCds['rswtPrscCdMthdCd']??[] +//export const rswtPrscCdMthdCd = lwCds['rswtPrscCdMthdCd']??[] // { // val: "물리화학적처리(스크린,응집,침전)", // text: "물리화학적처리(스크린,응집,침전)", @@ -389,55 +388,55 @@ export const sewageOutFclttUse = [ text: "공업용수", }, ]; -const codeMApping = { - WR001: "bdstUsgCd", - WR002: "rswtBdstType", - WR003: "rainFcltCd", - WR004: "bdstGrntchClass", - WR005: "rswtPrscCdMthdCd", // 아직 디 못바꿈 - WR006: "orgwtKndCd", //작업 완ㅛ - WR007: "ruseMngMtd", // 작업완료 - WR008: "rusePrcsMthdCd", //w작업완료 - WR009: "erctUswtrPrcsMeth",//w작업완료 - WR010: "ruseFcltSpot",// inout은 yn 만 사용해야 함으로 해당 코드는 사용안함. - WR011: "pplQulity", - WR012: "pplLenght", - WR013: "bdstFilterYn", // 사용 불가 yn만 사용해야함으로 해당코드 사용 안함 - WR014: "rainRswtMng", // 지도점검 등록 시변경 - WR015: "rainFcltFlowRate", //지도점검 등록 시변경 - WR016: "dmdUszCd", // 지도점검 등록 시변경 - WR017: "sewageInFcltUse", //하수재이용 장내 - WR018: "sewageOutFclttUse", // 하수재이용 장외 - WR019: "htdPowerMthdCd", - WR020: "htdUtztnUsgCd", -}; -export const getCommonUpCd = async () => { - const upCd = await getFetchWithCount( - fetchType.LOCAL, - "/cms-service/api/v1/up-codes?keyword=&upCd=&cdSe=&useYn=Y&siteId=WR&page=0&size=100&sort=string" - ); +// const codeMApping = { +// WR001: "bdstUsgCd", +// WR002: "rswtBdstType", +// WR003: "rainFcltCd", +// WR004: "bdstGrntchClass", +// WR005: "rswtPrscCdMthdCd", // 아직 디 못바꿈 +// WR006: "orgwtKndCd", //작업 완ㅛ +// WR007: "ruseMngMtd", // 작업완료 +// WR008: "rusePrcsMthdCd", //w작업완료 +// WR009: "erctUswtrPrcsMeth",//w작업완료 +// WR010: "ruseFcltSpot",// inout은 yn 만 사용해야 함으로 해당 코드는 사용안함. +// WR011: "pplQulity", +// WR012: "pplLenght", +// WR013: "bdstFilterYn", // 사용 불가 yn만 사용해야함으로 해당코드 사용 안함 +// WR014: "rainRswtMng", // 지도점검 등록 시변경 +// WR015: "rainFcltFlowRate", //지도점검 등록 시변경 +// WR016: "dmdUszCd", // 지도점검 등록 시변경 +// WR017: "sewageInFcltUse", //하수재이용 장내 +// WR018: "sewageOutFclttUse", // 하수재이용 장외 +// WR019: "htdPowerMthdCd", +// WR020: "htdUtztnUsgCd", +// }; +// export const getCommonUpCd = async () => { +// const upCd = await getFetchWithCount( +// fetchType.LOCAL, +// "/cms-service/api/v1/up-codes?keyword=&upCd=&cdSe=&useYn=Y&siteId=WR&page=0&size=100&sort=string" +// ); - const upWrCode: string[] = upCd.content - .filter((item: any) => item.upCd.slice(0, 2) === "WR") - .map((cd: any) => cd.upCd); +// const upWrCode: string[] = upCd.content +// .filter((item: any) => item.upCd.slice(0, 2) === "WR") +// .map((cd: any) => cd.upCd); - await Promise.all( - upWrCode.map(async (cd) => { - const mapping = codeMApping[cd as keyof typeof codeMApping]; - if (!mapping) return; +// await Promise.all( +// upWrCode.map(async (cd) => { +// const mapping = codeMApping[cd as keyof typeof codeMApping]; +// if (!mapping) return; - const lwCd = await getFetchWithCount( - fetchType.LOCAL, - `/cms-service/api/v1/lwpo-cds/up-cd/${cd}` - ); +// const lwCd = await getFetchWithCount( +// fetchType.LOCAL, +// `/cms-service/api/v1/lwpo-cds/up-cd/${cd}` +// ); - const list = Array.isArray(lwCd) ? lwCd : lwCd.content ?? []; +// const list = Array.isArray(lwCd) ? lwCd : lwCd.content ?? []; - lwCds[mapping] = list.map((it: any) => ({ - text: it.lwpoCdNm, - val: it.lwpoCd, - })); - }) - ); - -}; \ No newline at end of file +// lwCds[mapping] = list.map((it: any) => ({ +// text: it.lwpoCdNm, +// val: it.lwpoCd, +// })); +// }) +// ); +// console.log('lwCds ', lwCds) +// }; \ No newline at end of file diff --git a/apps/wr/app/store/common/code/index.ts b/apps/wr/app/store/common/code/index.ts index 822c95ddb..9905db719 100644 --- a/apps/wr/app/store/common/code/index.ts +++ b/apps/wr/app/store/common/code/index.ts @@ -1,4 +1,4 @@ -import { getFetch } from "@/components/lib/api"; +import { fetchType, getFetch, getFetchWithCount } from "@/components/lib/api"; import type { EnvPartSelectDataType, SelectDataType, @@ -7,14 +7,94 @@ import { bdstFilterYn, bdstIncenYn, chBuCd, - lwCds, - rswtPrscCdMthdCd, + ruseBizMthdCd, ruseSeCd, yn, } from "./basicCode"; export const btnClass = "p-4 m-2 text-white rounded-sm text-lg font-medium "; const laeSecd = "41"; +export const lwCds: Record = {}; + + + +const codeMApping = { + WR001: "bdstUsgCd", + WR002: "rswtBdstType", + WR003: "rainFcltCd", + WR004: "bdstGrntchClass", + WR005: "rswtPrscCdMthdCd", // 아직 디 못바꿈 + WR006: "orgwtKndCd", //작업 완ㅛ + WR007: "ruseMngMtd", // 작업완료 + WR008: "rusePrcsMthdCd", //w작업완료 + WR009: "erctUswtrPrcsMeth",//w작업완료 + WR010: "ruseFcltSpot",// inout은 yn 만 사용해야 함으로 해당 코드는 사용안함. + WR011: "pplQulity", + WR012: "pplLenght", + WR013: "bdstFilterYn", // 사용 불가 yn만 사용해야함으로 해당코드 사용 안함 + WR014: "rainRswtMng", // 지도점검 등록 시변경 + WR015: "rainFcltFlowRate", //지도점검 등록 시변경 + WR016: "dmdUszCd", // 지도점검 등록 시변경 + WR017: "sewageInFcltUse", //하수재이용 장내 + WR018: "sewageOutFclttUse", // 하수재이용 장외 + WR019: "htdPowerMthdCd", + WR020: "htdUtztnUsgCd", +}; +export const getCommonUpCd = async (set:any) => { + + try { + let lwCdCode :Record = {}; + const upCd = await getFetchWithCount( + fetchType.LOCAL, + "/cms-service/api/v1/up-codes?keyword=&upCd=&cdSe=&useYn=Y&siteId=WR&page=0&size=100&sort=string" + ); + + const upWrCode: string[] = upCd.content + .filter((item: any) => item.upCd.slice(0, 2) === "WR") + .map((cd: any) => cd.upCd); + + await Promise.all( + upWrCode.map(async (cd) => { + const mapping = codeMApping[cd as keyof typeof codeMApping]; + if (!mapping) return; + + const lwCd = await getFetchWithCount( + fetchType.LOCAL, + `/cms-service/api/v1/lwpo-cds/up-cd/${cd}` + ); + + const list = Array.isArray(lwCd) ? lwCd : lwCd.content ?? []; + + lwCds[mapping] = list.map((it: any) => ({ + text: it.lwpoCdNm, + val: it.lwpoCd, + })); + }) + ); + lwCdCode=lwCds + set((state: comCodeState) => ({ + code: { + ...state.code, + rainFcltCd: lwCdCode['rainFcltCd']??[], + bdstUsgCd: lwCdCode['bdstUsgCd']??[] , + orgwtKndCd: lwCdCode['orgwtKndCd']??[] , + pplQulity: lwCdCode['pplQulity']??[] , + pplLenght: lwCdCode['pplLenght']??[] , + dmdUszCd: lwCdCode['dmdUszCd']??[] , + ruseMngMtd: lwCdCode['ruseMngMtd']??[], + rusePrcsMthdCd: lwCdCode['rusePrcsMthdCd']??[], + erctUswtrPrcsMeth: lwCdCode['erctUswtrPrcsMeth']??[], + bdstGrntchClass: lwCdCode['bdstGrntchClass']??[], + htdPowerMthdCd: lwCdCode['htdPowerMthdCd']??[], + htdUtztnUsgCd: lwCdCode['htdUtztnUsgCd']??[], + rswtBdstType:lwCdCode['rswtBdstType']??[] , + }, + })); + }catch(e){ + console.log('com code error ', e) + } + +}; //물재이용 주소 코드: devU01TX0FVVEgyMDI1MDgyNTEwMzkwNDExNjEwNTM= export const buildingType = { RST: "RST", @@ -172,7 +252,7 @@ export type comCodeState = { bdstFilterYn: SelectDataType[]; bdstIncenYn: SelectDataType[]; bdstGrntchClass: SelectDataType[]; - rswtPrscCdMthdCd: SelectDataType[]; + // rswtPrscCdMthdCd: SelectDataType[]; htdPowerMthdCd: SelectDataType[]; htdUtztnUsgCd: SelectDataType[]; rswtBdstType:SelectDataType[]; @@ -202,13 +282,13 @@ export const comCodeStateExport: comCodeState = { buildingType: buildingType, ruseMngMtd: lwCds['ruseMngMtd']??[], ruseSeCd: ruseSeCd, - ruseBizMthdCd: lwCds['ruseBizMthdCd']??[], + ruseBizMthdCd: ruseBizMthdCd, rusePrcsMthdCd: lwCds['rusePrcsMthdCd']??[], erctUswtrPrcsMeth: lwCds['erctUswtrPrcsMeth']??[], bdstFilterYn: bdstFilterYn, bdstIncenYn: bdstIncenYn, bdstGrntchClass: lwCds['bdstGrntchClass']??[], - rswtPrscCdMthdCd: rswtPrscCdMthdCd, // 공단연락오면 바꿔야함 + // rswtPrscCdMthdCd: rswtPrscCdMthdCd, // 공단연락오면 바꿔야함 htdPowerMthdCd: lwCds['htdPowerMthdCd']??[], htdUtztnUsgCd: lwCds['htdUtztnUsgCd']??[], userSiSggCd: laeSecd, diff --git a/apps/wr/app/store/matDmd/ruseCaseMng/headList.tsx b/apps/wr/app/store/matDmd/ruseCaseMng/headList.tsx index 024f40fe7..33d5ee353 100644 --- a/apps/wr/app/store/matDmd/ruseCaseMng/headList.tsx +++ b/apps/wr/app/store/matDmd/ruseCaseMng/headList.tsx @@ -167,7 +167,7 @@ export const ruseCaseHeadListExport: TableUpperProps[] = [ }, { id: "grnteWqPh", - title: "수소이온농도(ph)​", + title: "수소이온농도(pH)​", visible: true, row: 1, }, diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx index 84619f307..21636860a 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx @@ -189,7 +189,7 @@ export const excelToRainChkData = (excelData: any, year: string) => { rain.rainyDetails?.forEach((key) => { if (key.ph?.length > 1 && isInvalidNumber(key.ph)) { - issues.push(defaultMessage + `PH: 숫자 형식 아님 /입력값:${key.ph}`); + issues.push(defaultMessage + `pH: 숫자 형식 아님 /입력값:${key.ph}`); } if (key.trbt?.length > 1 && isInvalidNumber(key.trbt)) { issues.push( diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx index d2c0bf7d7..b615b6532 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx @@ -152,7 +152,7 @@ export const rainChkgdnHeadListExport: TableUpperProps[] = [ { id: "totalRuseFcltUtztnQnt", title: "연간빗물이용량(m³)" }, { id: "ph", - title: "수소이온농도(ph)", + title: "수소이온농도(pH)", upName: "useQuilty", upSequnce: 1, type: "number", diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList.tsx index 652e0fea7..6e94ec4e6 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList.tsx @@ -168,7 +168,7 @@ export const rswtChkHeadListExport: TableUpperProps[] = [ { id: "crmty", title: "색도(도)", upName: "useQuilty", upSequnce: 6 ,type: "number"}, { id: "tn", title: "총질소(T-N)(mg/L)", upName: "useQuilty", upSequnce: 7 ,type: "number"}, { id: "tph", title: "총인(T-P)(mg/L)", upName: "useQuilty", upSequnce: 8 ,type: "number"}, - { id: "ph", title: "수소이온농도(ph)", upName: "useQuilty", upSequnce: 9,type: "text" }, + { id: "ph", title: "수소이온농도(pH)", upName: "useQuilty", upSequnce: 9,type: "text" }, { id: "clIonQnt", title: "염화물(mg/L)", upName: "useQuilty", upSequnce: 10 ,type: "number"}, { @@ -238,7 +238,7 @@ export const rswtChkHeadListExport: TableUpperProps[] = [ }, { id: "tn", title: "T-N", upName: "detailQulity", upSequnce: 8, edit: true }, { id: "tph", title: "T-P", upName: "detailQulity", upSequnce: 9, edit: true }, - { id: "ph", title: "PH", upName: "detailQulity", upSequnce: 10, edit: true }, + { id: "ph", title: "pH", upName: "detailQulity", upSequnce: 10, edit: true }, { id: "clIonQnt", title: "염화물", diff --git a/apps/wr/app/store/prfmncSttn/chkgdnSttn/rainChkgdnSttn/headList.tsx b/apps/wr/app/store/prfmncSttn/chkgdnSttn/rainChkgdnSttn/headList.tsx index 0d995fbe3..51b9634d3 100644 --- a/apps/wr/app/store/prfmncSttn/chkgdnSttn/rainChkgdnSttn/headList.tsx +++ b/apps/wr/app/store/prfmncSttn/chkgdnSttn/rainChkgdnSttn/headList.tsx @@ -15,7 +15,7 @@ export const rainChkgdnHeadSttnExport: TableUpperProps[] = [ { id: "totalRuseFcltUtztnQnt", title: "연간빗물이용량(m³)" }, { id: "ph", - title: "수소이온농도(ph)", + title: "수소이온농도(pH)", upName: "useQuilty", upSequnce: 1, type: "number", @@ -153,7 +153,7 @@ export const rswtDetailHeadListExport: TableUpperProps[] = [ upName: "detailQulity", upSequnce: 9, }, - { id: "ph", title: "PH", upName: "detailQulity", upSequnce: 10 }, + { id: "ph", title: "pH", upName: "detailQulity", upSequnce: 10 }, { id: "clIonQnt", title: "염화물", diff --git a/apps/wr/app/store/prfmncSttn/chkgdnSttn/rswtChkgdnSttn/headList.tsx b/apps/wr/app/store/prfmncSttn/chkgdnSttn/rswtChkgdnSttn/headList.tsx index eb4d70781..831266e36 100644 --- a/apps/wr/app/store/prfmncSttn/chkgdnSttn/rswtChkgdnSttn/headList.tsx +++ b/apps/wr/app/store/prfmncSttn/chkgdnSttn/rswtChkgdnSttn/headList.tsx @@ -64,7 +64,7 @@ export const rswtChkSttnHeadListExport: TableUpperProps[] = [ upSequnce: 8, type: "number", }, - { id: "ph", title: "수소이온농도(ph)", upName: "useQuilty", upSequnce: 9, type: "text" }, + { id: "ph", title: "수소이온농도(pH)", upName: "useQuilty", upSequnce: 9, type: "text" }, { id: "clIonQnt", title: "염화물(mg/L)", @@ -132,7 +132,7 @@ export const rswtDetailSttnHeadListExport: TableUpperProps[] = [ }, { id: "tn", title: "T-N", upName: "detailQulity", upSequnce: 8}, { id: "tph", title: "T-P", upName: "detailQulity", upSequnce: 9 }, - { id: "ph", title: "PH", upName: "detailQulity", upSequnce: 10 }, + { id: "ph", title: "pH", upName: "detailQulity", upSequnce: 10 }, { id: "clIonQnt", title: "염화물", diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/pbnstSttn/headList.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/pbnstSttn/headList.tsx index 60b726e2b..a1d1193b2 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/pbnstSttn/headList.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/pbnstSttn/headList.tsx @@ -461,7 +461,7 @@ export const ruseGuranteeHeadListExport: TableUpperProps[] = [ { id: "crmty", title: "색도(도)", visible: true }, { id: "tn", title: "총질소(mg/L)", visible: true }, { id: "tph", title: "총인(mg/L)", visible: true }, - { id: "ph", title: "수소이온농도(ph)", visible: true }, + { id: "ph", title: "수소이온농도(pH)", visible: true }, { id: "clIonQnt", title: "염화물(mg/L)", visible: true }, { id: "cdtnv", title: "전기전도도(μs/cm)​", visible: true }, ]; diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx index 65f02e26b..e82ca7b3c 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx @@ -1,6 +1,6 @@ import type { SelectDataType } from "@common/business_components/ui"; import type { customRainBdst } from "../../fcltReg/rainReg"; -import { bdstUsgCd } from "@/app/store/common/code/basicCode"; +import { lwCds } from "@/app/store/common/code"; //TODO: 공통코드시 삭제되니 수정 해야됨 export const excelRainSttnParsing = ( excel: { data: customRainBdst[] }, @@ -16,7 +16,7 @@ export const excelRainSttnParsing = ( sggCode.find((sgg) => sgg.val === item.sggCd?.toString())?.text ?? "", item.bdstNm ?? "", item.daddr ?? "", - bdstUsgCd.find((cd) => cd.val === item.reuseBuilding?.[0]?.bdstUsgCd.toString())?.text ?? "", //건축물용도 + lwCds?.bdstUsgCd?.find((cd) => cd.val === item.reuseBuilding?.[0]?.bdstUsgCd.toString())?.text ?? "", //건축물용도 String(item.frstArchPrmsnDt ?? ""), String(item.archArea.split('.')[0] === '-1' ? '확인불가' : item.archArea.split('.')[0]), String(item.chgBuilding.length > 0 ? "Y" : "N"), diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx index e78183cc5..89bcc0e29 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx @@ -445,7 +445,7 @@ export const rainSttnDetailNodeListExport:CommonTableProps[] = [ rowSpan: 1, colSpan: 4 }, - { id: "ph", title: "PH", + { id: "ph", title: "pH", visible: true, row: 2, rowSpan: 1, @@ -524,7 +524,7 @@ export const rainSttnDetailHeadListExport:CommonTableProps[] = [ colSpan: 1 }, - { id: "ph", title: "PH", + { id: "ph", title: "pH", visible: true, row: 1, rowSpan: 1, diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx index b3d3835c2..847353b32 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx @@ -1,21 +1,19 @@ -import { bdstUsgCd } from "@/app/store/common/code/basicCode"; import type { SelectDataType } from "@common/business_components/ui"; import type { customRswtBdst } from "../../fcltReg/rswtReg"; + export const excelRSwtSttnParsing = ( excel: { data: customRswtBdst[] }, - sidoCode: SelectDataType[], - sggCode: SelectDataType[] + code: Record ): string[][] => { const excelExportData: string[][] = []; excel.data.forEach((item) => { - console.log("item", item) excelExportData.push([ - sidoCode.find((sido) => sido.val === item.ctpvCd.toString())?.text ?? "", - sggCode.find((sgg) => sgg.val === item.sggCd.toString())?.text ?? "", + code.sidoCode?.find((sido) => sido.val === item.ctpvCd.toString())?.text ?? "", + code.sggCode?.find((sgg) => sgg.val === item.sggCd.toString())?.text ?? "", item.bdstNm ?? "", item.daddr ?? "", - bdstUsgCd.find((cd)=> cd.val === item.reuseBuilding?.[0]?.bdstUsgCd.toString())?.text ?? "", //건축물용도 + code?.bdstUsgCd?.find((cd)=> cd.val === item.reuseBuilding?.[0]?.bdstUsgCd.toString())?.text ?? "", //건축물용도 String(item.frstArchPrmsnDt ?? ""), String(item.archArea.split('.')[0] === '-1' ? '확인불가' : item.archArea.split('.')[0]), // String(item.reuseBuilding?.[0]?.rswtrObj.wtrUsqty ?? "0"), //물사용량 diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/index.tsx index 1d4617442..1abcf2f4c 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/index.tsx @@ -31,8 +31,7 @@ export type rswtSttnState = { type rswtSttnActions = { rswtSttnInit: (isExcel: boolean, page: number, total: number, con: string, txt: string, - sidoCode: SelectDataType[], - sggCode: SelectDataType[]) => void; + code: Record) => void; rswtSttnSearch: (isExcel: boolean, page: number, total: number, con: string, txt: string, sidoCode: SelectDataType[], sggCode: SelectDataType[]) => void; @@ -60,9 +59,7 @@ export const rswtSttnActionsExport: (set: any) => rswtSttnActions = ( set: any ) => { return { - rswtSttnInit: async (isExcel: boolean, page: number, total: number, con: string, txt: string, - sidoCode: SelectDataType[], - sggCode: SelectDataType[]) => { + rswtSttnInit: async (isExcel: boolean, page: number, total: number, con: string, txt: string, code: Record) => { try { const rswtSttnRes = await getFetchWithCount( fetchType.WR, @@ -73,17 +70,17 @@ export const rswtSttnActionsExport: (set: any) => rswtSttnActions = ( (txt ? `/${txt}` : "") ); if (isExcel) { - const rswtExcel = excelRSwtSttnParsing(rswtSttnRes, sidoCode, sggCode); - set((state: rswtSttnState) => { - return { - ...state, - rswtSttn: { - ...state.rswtSttn, - excelList: rswtExcel, - }, - }; - }); - } else + const rswtExcel = excelRSwtSttnParsing(rswtSttnRes, code); + set((state: rswtSttnState) => { + return { + ...state, + rswtSttn: { + ...state.rswtSttn, + excelList: rswtExcel, + }, + }; + }); + } set((state: rswtSttnState) => { return { diff --git a/apps/wr/components/lib/func/commom.tsx b/apps/wr/components/lib/func/commom.tsx index 144aace66..1e15fae1c 100644 --- a/apps/wr/components/lib/func/commom.tsx +++ b/apps/wr/components/lib/func/commom.tsx @@ -1,5 +1,4 @@ -import type { comCodeState } from "@/app/store/common/code"; -import { lwCds } from "@/app/store/common/code/basicCode"; +import { lwCds, type comCodeState } from "@/app/store/common/code"; import { filePickedBlob, filePickedBlobArray, @@ -34,12 +33,11 @@ export const getCity = (val: string, sggCd: SelectDataType[]) => { // cd text 넣기 export const tableData = (data: any, code: comCodeState) => { const chCode = code.code; - return data?.map( (item: { sggCd: string; ctpvCd: string; - reuseBuilding: { lawTrgtYn: any; bdstUsgCd: any }[]; + reuseBuilding: { lawTrgtYn: string; bdstUsgCd: string ,grntchBdstCertGrd:string}[]; }) => { let returnData = {}; const sggText = chCode.sggCd.find( @@ -49,16 +47,25 @@ export const tableData = (data: any, code: comCodeState) => { (cd) => cd.val === String(item.ctpvCd).trim() )?.text; if (item?.reuseBuilding?.length > 0) { - const bdsgUsgText = chCode.bdstUsgCd.find( - (cd) => Number(cd.val) === item?.reuseBuilding[0]?.bdstUsgCd + + const bdsgUsgText = chCode?.bdstTotalUsgType?.find( + (cd) => cd.val === item?.reuseBuilding[0]?.bdstUsgCd )?.text; + const lawTrgtYn = item?.reuseBuilding[0]?.lawTrgtYn; + + + const grntchBdstCertGrdText =chCode?.bdstGrntchClass?.find( + (cd) => cd.val === item?.reuseBuilding[0]?.grntchBdstCertGrd + )?.text; + returnData = { ...item, sggText: sggText ?? "없음", cityText: cityText ?? "없음", bdsgUsgText: bdsgUsgText, lawTrgtYn: lawTrgtYn, + grntchBdstCertGrdText:grntchBdstCertGrdText }; } else { returnData = { diff --git a/apps/wr/components/lib/func/mapUtil.ts b/apps/wr/components/lib/func/mapUtil.ts index 13ce5b82a..a39bf17d7 100644 --- a/apps/wr/components/lib/func/mapUtil.ts +++ b/apps/wr/components/lib/func/mapUtil.ts @@ -197,7 +197,7 @@ export const getOverLayObj = (fclType: string, data: any,code?:any) => { newObj = { 건물용도: code?.bdstUsgCd.find((item) => item.val===String(data?.reuseBuilding[0].bdstUsgCd) )?.text ?? '확인불가', 설치완료일: data?.reuseBuilding[0]?.instlCmptnDt ?? '확인불가', - "주요 처리공정": code?.rswtPrscCdMthdCd.find((item) => item.val===data?.reuseBuilding[0]?.rswtrObj.filtrTrtmfctProcs)?.text ?? '확인불가', + "주요 처리공정": data?.reuseBuilding[0]?.rswtrObj.filtrTrtmfctProcs ?? '확인불가', 원수종류: code?.orgwtKndCd.find((item) => item.val === data?.reuseBuilding[0]?.rswtrObj.orgwtKndCd)?.text ?? '확인불가', //이용용도: isCode.filtrTrtmfctUsgCd data?.reuseBuilding[0]?.rswtrObj.altUswtrKndCd ?? '확인불가', }; diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/buseWaterQulity/buseWaterQulity.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/buseWaterQulity/buseWaterQulity.tsx index fd9ed6126..dd43658d1 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/buseWaterQulity/buseWaterQulity.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/buseWaterQulity/buseWaterQulity.tsx @@ -460,7 +460,7 @@ export function BuseWaterQulity({ />
- +
void; readonly?: boolean; isMap?: boolean; - }) { - const { code, rswtBdstUpdate, rswtBdstReg } = useWrStore( - (state) => state - ); + const { code, rswtBdstUpdate, rswtBdstReg } = useWrStore((state) => state); // const [divStyle, setDivStyle] = useState("h-[53vh]"); useEffect(() => { - if(isMap){ + if (isMap) { } }, [isMap]); // const defaultValues: z.infer = rswtZod.parse({}); @@ -64,29 +61,30 @@ export default function RswtrRegForm({ "reuseBuilding.0.rswtrObj.filtrTrtmfctProcs", ]); - const { t } = useTranslation('base'); + const { t } = useTranslation("base"); const onSubmit = (values: z.infer) => { if (isModal) { const handleConfirm = async () => { rswtBdstReg(values, "41"); if (setIsModal) setIsModal(false); }; - confirmToast(t('isInsertMsg'), handleConfirm); - + confirmToast(t("isInsertMsg"), handleConfirm); } else { const handleConfirm = async () => { rswtBdstUpdate(values, "41"); }; - confirmToast(t('isUpdateMsg'), handleConfirm); + confirmToast(t("isUpdateMsg"), handleConfirm); } }; - const filtrTrtmfctCpct = form.watch('reuseBuilding.0.rswtrObj.filtrTrtmfctCpct') + const filtrTrtmfctCpct = form.watch( + "reuseBuilding.0.rswtrObj.filtrTrtmfctCpct" + ); const cleanRswtData = (raw: any): z.infer => { const buildings = - raw?.reuseBuilding && raw.reuseBuilding.length > 0 - ? raw.reuseBuilding - : [{}]; + raw?.reuseBuilding && raw.reuseBuilding.length > 0 + ? raw.reuseBuilding + : [{}]; return { ...raw, frstArchPrmsnDt: raw?.frstArchPrmsnDt @@ -95,20 +93,21 @@ export default function RswtrRegForm({ archChgPrmsnDt: raw?.archChgPrmsnDt ? new Date(raw?.archChgPrmsnDt) : null, - reuseBuilding:buildings.map((item: any) => ({ + reuseBuilding: buildings.map((item: any) => ({ ...item, instlCmptnDt: item?.instlCmptnDt ? new Date(item.instlCmptnDt) : new Date(), // item?.instlCmptnDt가 유효하지 않으면 현재 날짜로 초기화 operMngCd: item?.operMngCd || "", // null → "" - instlCstSprtYn: item?.instlCstSprtYn || 'N', // null → "Y" - grntchBdstCertYn: item?.grntchBdstCertYn ||'N', + instlCstSprtYn: item?.instlCstSprtYn || "N", // null → "Y" + grntchBdstCertYn: item?.grntchBdstCertYn || "N", bdstUsgCd: item?.bdstUsgCd ?? Number("-1"), // null → "-1" rswtrObj: { ...item?.rswtrObj, filtrTrtmfctYn: item?.rainyObj?.filtrTrtmfctYn || code.yn[0]?.val, filtrTrtmfctCpct: item?.rswtrObj?.filtrTrtmfctCpct ?? null, - filtrTrtmfctProcs: item?.rswtrObj?.filtrTrtmfctProcs || code.rswtPrscCdMthdCd[0]?.val, + filtrTrtmfctProcs: + item?.rswtrObj?.filtrTrtmfctProcs||'', orgwtKndCd: item?.rswtrObj?.orgwtKndCd || code.orgwtKndCd[0]?.val, }, })), @@ -118,8 +117,8 @@ export default function RswtrRegForm({ // console.log(' formform ', form.watch()) // },[form.formState]) useEffect(() => { - console.log(' filtrTrtmfctCpct ', filtrTrtmfctCpct) - }, [filtrTrtmfctCpct]) + console.log(" filtrTrtmfctCpct ", filtrTrtmfctCpct); + }, [filtrTrtmfctCpct]); useEffect(() => { console.log("form errors:", form.formState.errors); @@ -133,7 +132,6 @@ export default function RswtrRegForm({ form.setValue("reuseBuilding.0.instlCstSprtAmt", 0); } - if (grntchBdstCertYn === "D") { form.setValue("reuseBuilding.0.grntchBdstCertYr", "0000"); form.setValue("reuseBuilding.0.grntchBdstCertNo", "확인불가"); @@ -141,7 +139,6 @@ export default function RswtrRegForm({ } else if (instlCstSprtYn === "D") { form.setValue("reuseBuilding.0.instlCstSprtAmt", -1); } - }, [grntchBdstCertYn, instlCstSprtYn, filtrTrtmfctProcs, form]); useEffect(() => { @@ -149,7 +146,11 @@ export default function RswtrRegForm({ }, [rswtForm, form]); + useEffect(() =>{ + console.log('code orgin ', code) + console.log('code ', code.orgwtKndCd) + },[code]) return (
@@ -176,335 +177,343 @@ export default function RswtrRegForm({
{/* */} - {isModal && rswtForm != undefined ? : <>} - {isModal ? ( -

- 중수도 시설 정보{" "} -

- ) : ( - <> - )} -

기본정보

-
-
- ( - - field.onChange(date), + {isModal && rswtForm != undefined ? : <>} + {isModal ? ( +

+ 중수도 시설 정보{" "} +

+ ) : ( + <> + )} +

기본정보

+
+
+ ( + + field.onChange(date), + }} + selectClass={"w-full"} + readOnly={readonly} + /> + + )} + /> +
+
+ { + const value = field.value; + const isUnknown = value === null || value === -1; // 또는 Number(value) === -1 + return ( + + { + // 입력 시 자동으로 확인불가 해제 + if (isUnknown && !readonly) { + field.onChange(""); // 초기화 + } + }} + onChange={(e) => { + if (readonly) return; + handleMinusNumberChange(e, field.onChange); }} - selectClass={"w-full"} readOnly={readonly} + maxLength={numSize} /> - )} - /> -
-
- { - const value = field.value; - const isUnknown = value === null || value === -1; // 또는 Number(value) === -1 - return ( - - +
+
+
+

중수도 시설 정보

+
+ +
+
+ { + const value = field.value; + const isUnknown = value === null || value === -1; // 또는 Number(value) === -1 + + return ( + + { + // 입력 시 자동으로 확인불가 해제 + if (isUnknown && !readonly) { + console.log("value"); + field.onChange(""); // 초기화 } - onFocus={() => { - // 입력 시 자동으로 확인불가 해제 - if (isUnknown && !readonly) { - field.onChange(""); // 초기화 - } - }} - onChange={(e) => { - if (readonly) return; - handleMinusNumberChange(e, field.onChange); - }} - readOnly={readonly} - maxLength={numSize} - /> - - ); - }} - /> -
+ }} + onChange={(e) => { + if (readonly) return; + handleMinusNumberChange(e, field.onChange); + }} + readOnly={readonly} + maxLength={numSize} + /> + + ); + }} + />
-
-

중수도 시설 정보

+
+ ( + + {} : field.onChange} + value={field.value ?? code.orgwtKndCd[0]?.val} + readOnly={readonly} + /> + + )} + />
+
+ ( + + { + if (readonly) return; -
-
- { - const value = field.value; - const isUnknown = value === null || value === -1; // 또는 Number(value) === -1 + field.onChange(e.target.value); + }} + maxLength={txtSize} + /> + + )} + /> +
+
- return ( - - +

인센티브 정보

+
+
+

설치비(원) 지원

+
+
+
+ ( + + {} : field.onChange} + value={field.value || code.bdstIncenYn[0]?.val} + readOnly={readonly} + /> + + )} + /> +
+
+ { + const value = field.value; + const isUnknown = value === null || value === -1; // 또는 Number(value) === -1 + return ( + + { + // 입력 시 자동으로 확인불가 해제 + if (isUnknown && !readonly) { + field.onChange(""); // 초기화 } - onFocus={() => { - // 입력 시 자동으로 확인불가 해제 - if (isUnknown && !readonly) { + }} + onChange={(e) => { + if (readonly) return; + handleMinusNumberChange(e, field.onChange); + }} + disabled={ + instlCstSprtYn === "N" || instlCstSprtYn === "D" + } + maxLength={numSize} + /> + + ); + }} + /> +
+
- console.log('value') - field.onChange(""); // 초기화 - } - }} - onChange={(e) => { - if (readonly) return; - handleMinusNumberChange(e, field.onChange); - }} - readOnly={readonly} - maxLength={numSize} - /> - - ); - }} - /> -
-
- ( - - { } : field.onChange} - value={field.value ?? code.orgwtKndCd[0]?.val} - readOnly={readonly} - /> - - )} - /> -
-
- ( - - { } : field.onChange} - value={field.value || code.rswtPrscCdMthdCd[0]?.val} - readOnly={readonly} - /> - - )} - /> -
+
+

녹색건축물 인증

+
+
+
+ ( + + {} : field.onChange} + value={field.value || code.yn[0]?.val} + readOnly={readonly} + /> + + )} + />
- -
-

인센티브 정보

-
-
-

설치비(원) 지원

-
-
-
- ( - - { } : field.onChange} - value={field.value || code.bdstIncenYn[0]?.val} - readOnly={readonly} - /> - - )} - /> -
-
- { - const value = field.value; - const isUnknown = value === null || value === -1; // 또는 Number(value) === -1 - return ( - - + { + const isUnknown = + field.value === null || field.value === "0000"; // 또는 Number(value) === -1 + return ( + + { + // 입력 시 자동으로 확인불가 해제 + if (isUnknown && !readonly) { + field.onChange(""); // 초기화 } - onFocus={() => { - // 입력 시 자동으로 확인불가 해제 - if (isUnknown && !readonly) { - field.onChange(""); // 초기화 - } - }} - onChange={(e) => { - if (readonly) return; - handleMinusNumberChange(e, field.onChange); - }} - disabled={instlCstSprtYn === "N" || instlCstSprtYn === "D"} - maxLength={numSize} - /> - - ); - }} - /> -
-
- -
-

녹색건축물 인증

-
-
-
- ( - - { } : field.onChange} - value={field.value || code.yn[0]?.val} - readOnly={readonly} + }} + value={isUnknown ? "확인불가" : (field.value ?? "")} + onChange={(e) => { + if (readonly) return; + if (e.target.value === "확인불가") { + field.onChange("0000"); + } else { + field.onChange(e.target.value); + } + }} + disabled={ + grntchBdstCertYn == "N" || grntchBdstCertYn == "D" + } + max={4} /> - )} - /> -
-
- { - const isUnknown = field.value === null || field.value === "0000"; // 또는 Number(value) === -1 - return ( - - { - // 입력 시 자동으로 확인불가 해제 - if (isUnknown && !readonly) { - field.onChange(""); // 초기화 - } - }} - value={ - isUnknown ? '확인불가' : field.value ?? ""} - onChange={(e) => { - if (readonly) return - if (e.target.value === '확인불가') { - field.onChange('0000'); - } else { - field.onChange(e.target.value); - } - }} - disabled={grntchBdstCertYn == "N" || grntchBdstCertYn == "D"} - max={4} - /> - - ) - }} - /> -
-
- { - const isUnknown = field.value === null || field.value === "0000"; // 또는 Number(value) === -1 - return ( - - { - // 입력 시 자동으로 확인불가 해제 - if (isUnknown && !readonly) { - field.onChange(""); // 초기화 - } - }} - value={ - isUnknown ? '확인불가' : field.value ?? ""} - onChange={(e) => { - if (readonly) return + ); + }} + /> +
+
+ { + const isUnknown = + field.value === null || field.value === "0000"; // 또는 Number(value) === -1 + return ( + + { + // 입력 시 자동으로 확인불가 해제 + if (isUnknown && !readonly) { + field.onChange(""); // 초기화 + } + }} + value={isUnknown ? "확인불가" : (field.value ?? "")} + onChange={(e) => { + if (readonly) return; - if (e.target.value === '확인불가') { - field.onChange(''); - } else { - field.onChange(e.target.value); - } - }} - disabled={grntchBdstCertYn == "N" || grntchBdstCertYn == "D"} - maxLength={txtSize} - /> - - ) - }} - /> -
-
- ( - - { } : field.onChange} - value={field.value || code.bdstGrntchClass[0]?.val} - readOnly={readonly} + if (e.target.value === "확인불가") { + field.onChange(""); + } else { + field.onChange(e.target.value); + } + }} + disabled={ + grntchBdstCertYn == "N" || grntchBdstCertYn == "D" + } + maxLength={txtSize} /> - )} - /> -
+ ); + }} + />
- +
+ ( + + {} : field.onChange} + value={field.value || code.bdstGrntchClass[0]?.val} + readOnly={readonly} + /> + + )} + /> +
+
+ {/* */} diff --git a/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx b/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx index 80bb8d7ec..96ecadcc9 100644 --- a/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx +++ b/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx @@ -191,8 +191,7 @@ export function RainFacility({ "1000000", String(con), seartchTxt ?? "", - code.cityCd, - code.sggCd + code as unknown as Record ); } }} @@ -249,8 +248,7 @@ export function RainFacility({ String(rainMapSize), String(con), seartchTxt ?? "", - code.cityCd, - code.sggCd + code as unknown as Record ); setIsReset(false); diff --git a/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx b/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx index becd76872..5c3c238d6 100644 --- a/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx +++ b/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx @@ -187,8 +187,7 @@ export function RswtFacility({ "1000000", String(con), seartchTxt ?? "", - code.cityCd, - code.sggCd + code as unknown as Record ); } }} @@ -236,8 +235,7 @@ export function RswtFacility({ String(rainMapSize), String(con), seartchTxt ?? "", - code.cityCd, - code.sggCd + code as unknown as Record ); setIsReset(false); diff --git a/apps/wr/public/sample_rswtSttn.xlsx b/apps/wr/public/sample_rswtSttn.xlsx index cec85971d65b2710e68f9de5473fd808795f6264..1085c6cfc57e6bf71bd0da36f2e4d1bdeb538f0f 100644 GIT binary patch literal 9020 zcmaKS1yoyWw{0j6#e-8^Tio5DxVr}k?pnOKyF-EETD-yC-HN8g+u~5X=;NI8zt?-X z_r8pgy|a_dIlj!b@~t)2+$!?0a6kY8014or&!TTBmp`-x004wv005{@XJZ$zohu9T zU&q*_9;H6kmtn^;?Gh=sdk!*4`NeGt$sQ6`g70O&a@*j%l|}e|h>ZVnmOyCb;r_Pa z`=NtN;k&{NMjx6*O(uA+iNPDCk@Pvx1-a+M;lyR8^te>AH*pfZqAjx*rfLUX|^0R|#sn~& z;M1`2*ZsYC4aFJ`13Q7*kqcvy z4~(&eeVcm|WSn96)1olkoU1{b-2R3x z{?~vTH2elpk9Eh2Ovzq=#>%8Le)bOb-{H+bN0a4$3NPVPs$>1v@R~Wgfd7iGePYK` z!UID+saGjZb9qI838}5vAC)x33veSQTpaYHm+I{18i^gd$GZoqPPEP`oMy4rzWloR zaQ2PtXW?hYU|fPXuel^;frS8I4N5+q1ZQ?!pFC$lDIMQph&IBJLU9i-4EKo`7v4tJdGD?s8K)(olc33|D)!tx80 zxO_O|QQZ%c$PZ`yth1zOjdD{Ap-?Mc8>VZegRi!4_{|I#RdYU@UH`_p<8A41)J6-f zk7GcO;J#w3#hxIvPTTU&#Q)#~JFXcv$(TWMMVe(YQk8w3JOvNbCce49?7a6ygOC|B z{mk35J~Wj)!U@bvJ>b4gC9U7j-X)mfR6+##VwEg&3R5{tBP^@W-D8SExx>5U0|5UP zI{UWpgUXZ8I!{7lJPG~Ij>Xf_#n#l((e^KyV^zhTWX5c#`h_^=nN>s&U%{V>N$wpe zmvVV9m_1lw_7(z7S!?h}nO)`mWNFFK#*sOp983AOR*7iBid&8W#*m2OB5vk*9{PyY46hhwSi<|q--k#q@stOD4sPe{B?-oQ2xRU7tNnr4eLhZ-$C z>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D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruseFcltMng/fcltSttn/rainSttn/page.tsx | 11 +++---- .../ruseFcltMng/fcltSttn/rswtSttn/page.tsx | 15 ++++++---- apps/wr/app/layout.tsx | 29 ++++++++++--------- apps/wr/app/store/common/code/index.ts | 14 +++++---- apps/wr/app/store/map/rainMap/index.tsx | 9 ++---- apps/wr/app/store/map/rswtMap/index.tsx | 10 ++----- .../ruseFcltMng/fcltReg/rswtReg/index.tsx | 4 --- .../ruseFcltMng/fcltSttn/rainSttn/excel.tsx | 12 +++----- .../fcltSttn/rainSttn/headList.tsx | 4 +-- .../ruseFcltMng/fcltSttn/rainSttn/index.tsx | 20 ++++--------- .../ruseFcltMng/fcltSttn/rswtSttn/excel.tsx | 5 ++-- .../fcltSttn/rswtSttn/headList.tsx | 4 +-- .../ruseFcltMng/fcltSttn/rswtSttn/index.tsx | 13 +++------ apps/wr/app/store/store.tsx | 3 +- 14 files changed, 65 insertions(+), 88 deletions(-) diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/rainSttn/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/rainSttn/page.tsx index 8055a2917..f5ec6e8c8 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/rainSttn/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/rainSttn/page.tsx @@ -92,7 +92,7 @@ export default function RainSttn() { useEffect(() => { if (!rainSttn.isInit) { - rainSttnInit(false, 1, rainSttnSize, "0", fcltNm, code.cityCd, code.sggCd); + rainSttnInit(false, 1, rainSttnSize, "0", fcltNm, code as unknown as Record); } }, [rainSttn.isInit, rainSttnInit]); @@ -146,8 +146,7 @@ export default function RainSttn() { rainSttnSize, String(getConValue()), fcltNm, - code.cityCd, - code.sggCd + code as unknown as Record ); isResetPage(false); }, [pageNation]); @@ -177,8 +176,7 @@ export default function RainSttn() { rainSttnResCount, String(getConValue()), fcltNm, - code.cityCd, - code.sggCd + code as unknown as Record ); }, [ rainSttnSearch, @@ -237,8 +235,7 @@ export default function RainSttn() { rainSttnSize, String(getConValue()), fcltNm, - code.cityCd, - code.sggCd + code as unknown as Record ); isResetPage(true); }} diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/rswtSttn/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/rswtSttn/page.tsx index b917a4105..7cb81d209 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/rswtSttn/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/rswtSttn/page.tsx @@ -34,6 +34,7 @@ export default function RswtSttn() { const { code, rswtSttn, rswtSttnSearch, rswtSttnInit } = useWrStore( (state) => state ); + const [pageNation, setPageNation] = useState(1); const { rswtSttnRes, rswtSttnResCount } = rswtSttn; @@ -83,8 +84,8 @@ export default function RswtSttn() { }; useEffect(() => { - if (!rswtSttn.isInit) { - rswtSttnInit(false, 1, rswtSttnSize, "0", fcltNm, code.cityCd, code.sggCd); + if (!rswtSttn.isInit&&code) { + rswtSttnInit(false, 1, rswtSttnSize, code.userSiSggCd, fcltNm, code as unknown as Record); } }, [rswtSttn.isInit, rswtSttnInit]); @@ -93,6 +94,8 @@ export default function RswtSttn() { const chData = data .map((item: customRswtBdst) => { const isOrgwtKndCd = item.reuseBuilding[0]?.rswtrObj.orgwtKndCd + + return { ...item, ...item.reuseBuilding[0], @@ -101,7 +104,7 @@ export default function RswtSttn() { chBuildingYn: item?.chgBuilding[0]?.bdstChgNm !== null && item?.chgBuilding.length > 0 ? 'Y' : 'N', instlCst: item.reuseBuilding[0]?.instlCst === -1 ? "확인불가" : item.reuseBuilding[0]?.instlCst, instlCstSprtAmt: item.reuseBuilding[0]?.instlCstSprtAmt === -1 ? "확인불가" : item.reuseBuilding[0]?.instlCstSprtAmt, - archArea: item?.archArea.split('.')[0] !== '-1' ? item?.archArea.split('.')[0] : '확인불가' + archArea: item?.archArea.split('.')[0] !== '-1' ? item?.archArea.split('.')[0] : '확인불가', } }) .filter( @@ -131,11 +134,11 @@ export default function RswtSttn() { const excelClick = useCallback(() => { isDownloadTriggered.current = true; - rswtSttnSearch(true, 1, rswtSttnResCount, String(getConValue()), fcltNm, code.cityCd, code.sggCd); + rswtSttnSearch(true, 1, rswtSttnResCount, String(getConValue()), fcltNm, code as unknown as Record); }, [rswtSttnSearch, objSearch, code.cityCd, code.sggCd, fcltNm, rswtSttnResCount]); useEffect(() => { - rswtSttnSearch(false, pageNation, rswtSttnSize, String(getConValue()), fcltNm, code.cityCd, code.sggCd); + rswtSttnSearch(false, pageNation, rswtSttnSize, String(getConValue()), fcltNm, code as unknown as Record); isResetPage(false) }, [pageNation]); @@ -186,7 +189,7 @@ export default function RswtSttn() {