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 cec85971d..1085c6cfc 100644 Binary files a/apps/wr/public/sample_rswtSttn.xlsx and b/apps/wr/public/sample_rswtSttn.xlsx differ