Merge commit '5a5ed9e669677a70beb42c641fce78fa238f936b' into iipbs/wr/dev
iipbs_wr / build (push) Waiting to run

This commit is contained in:
leedj312
2025-07-10 09:22:36 +09:00
5 changed files with 27 additions and 23 deletions
@@ -56,7 +56,6 @@ export default function RainSttn() {
const [fcltNm, setFcltNm] = useState<string>("");
const cellClick = (index: number | undefined, headId: string) => {
if (headId !== 'chBuildingYn' && index !== undefined && bdstTable !== undefined) {
setDetailModal({ isOpen: true, data: bdstTable[index] })
} else if (headId === 'chBuildingYn' && index !== undefined && bdstTable !== undefined) {
@@ -68,14 +67,12 @@ export default function RainSttn() {
const getSelCity = (val: string | number) => {
const cityValue = String(val);
if (cityValue === "0") {
setSelectSgg([]);
setObjSearch({ city: cityValue, sgg: "" });
} else {
const data = getCity(cityValue, code.sggCd);
setSelectSgg(data);
const firstSggVal = data.find(item => item.val === "0")?.val || (data[0]?.val ?? "");
setObjSearch({ city: cityValue, sgg: firstSggVal });
}
@@ -130,7 +127,7 @@ export default function RainSttn() {
})
.filter((item: any) => item.rainyObj !== undefined);
setBdstTable(chData);
}, [code, rainSttnRes, rainSttn.rainSttHeadList]);
}, [code, rainSttnRes]);
useEffect(() => {
rainSttnSearch(false, pageNation, "20", String(getConValue()), fcltNm, code.cityCd, code.sggCd);
@@ -42,9 +42,7 @@ type pbnstPrfmncActions = {
};
const checkWrRegList = async (year:string) => {
let url =`/reuseFc/pubDetailList`
if(year&& year.length>0){
// url+=`/${year}`
}
@@ -58,8 +56,6 @@ const hasuListFetch = async (page: number, sggOrCity: string , year:string,searc
checkWrRegListRes?.fcltCds,
fetchType.COMMON
);
let findData = rainRes.data.map((item: pubHasuType) => {
const data = checkWrRegListRes?.fcPrfList.find(
(fclt: FcPrfType) =>
@@ -175,7 +175,7 @@ export const htdflFacActionsExport: (set: any) => htdflFacSActions = (
const chData = await makeMdfr(data);
const res = await putFectch("/drain/facility", chData);
if (res.status) {
toast.success("온배수 건축물 수정이 완료되었습니다.");
toast.success("온배수 시설물 수정이 완료되었습니다.");
}
const htdflRes = await getFetchWithCount(
"wr",
@@ -191,7 +191,7 @@ export const htdflFacActionsExport: (set: any) => htdflFacSActions = (
},
}));
} catch (errorUpdate) {
toast.error("온배수 건축물 수정 오류입니다..");
toast.error("온배수 시설물 수정 오류입니다..");
}
},
htdflBdstReg: async (data: customHtdflBdst, code: string | number) => {
@@ -202,7 +202,7 @@ export const htdflFacActionsExport: (set: any) => htdflFacSActions = (
const chData = makeRstr(data);
const res = await postFectch("/drain/facility", chData);
if (res.status ===200) {
toast.success("온배수 건축물 등록이 완료되었습니다.");
toast.success("온배수 시설 등록이 완료되었습니다.");
}
const htdflRes = await initFetch(String(code));
set((state: htdflFacState) => ({
@@ -215,7 +215,7 @@ export const htdflFacActionsExport: (set: any) => htdflFacSActions = (
},
}));
} catch (errorReg) {
toast.error("온배수 건축물 등록 오류입니다..");
toast.error("온배수 시설물 등록 오류입니다..");
}
},htdflNmSearch :async(code:string | number, fcltNm:string) =>{
@@ -196,15 +196,15 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
if(chch.status ===200) {
console.log('chch.status' , chch.status)
toast.success("건축물 및 증축/개축/중축 등록이 완료되었습니다.");
toast.success("건축물(중수도) 및 증축/개축/중축 등록이 완료되었습니다.");
}else{
toast.error("건축물 증축/개축/중축 오류입니다.");
toast.error("건축물(중수도 증축/개축/중축 오류입니다.");
}
} else {
toast.success("건축물 등록이 완료되었습니다.");
toast.success("건축물(중수도 등록이 완료되었습니다.");
}
}else{
toast.error("건축물 등록이 완료되었습니다.");
toast.error("건축물(중수도) 등록이 완료하였습니다.");
}
const rswtRes = await initFetch(code);
set((state: rswtFacState) => ({
@@ -59,7 +59,8 @@ type pbnstSttnActions = {
total: string,
reurnValue: ReturnType,
searchNm: string | undefined,
year: string
year: string,
flcts:string[]
) => void;
};
@@ -109,9 +110,7 @@ const hasuListFetch = async (
}/0/1/SW`
} else if( reurnValue.partValue === 'G'){
console.log('reurnValue.sigunValue ', reurnValue.sidoValue)
console.log('reurnValue.sigunValue ', reurnValue.sigunValue)
url += `${page}/${total}/${reurnValue.envPartValue}/${reurnValue.sigunValue !== '0' ? reurnValue.sigunValue : reurnValue.sidoValue}/0/1/SW`
}else{
@@ -121,6 +120,8 @@ const hasuListFetch = async (
if (searchNm && searchNm?.length > 0) {
url += "/" + searchNm
}
console.log(' flcts ' ,flcts)
const pbnList = await postFectch(url, flcts,fetchType.COMMON);
const getRuseList = await postFectch(
`/reuseFc/pubDetailList/${year}`,
@@ -130,12 +131,16 @@ const hasuListFetch = async (
const checkWrRegListRes = getRuseList.data;
const count = getRuseList.count;
const data: WaterReuseFacility[] = checkWrRegListRes.map(
(item: FcPrfType) => {
const findData = pbnList.data.find(
(fclt: pubHasuType) =>
fclt.bscFctCd === item.pbnstRuseFcltPk.substring(0, 11)
);
console.log(' pbnList ', pbnList)
if(findData){
const usage = item.prfList.reduce(
@@ -163,7 +168,7 @@ const hasuListFetch = async (
},
{ total: 0, inUsage: 0, outUsage: 0 }
);
console.log('findData ', findData)
return {
rvbsn: findData?.rvbsn ||'-',
lgbsn: findData?.lgbsn||'-',
@@ -196,6 +201,10 @@ const hasuListFetch = async (
}
).filter(Boolean);
console.log( ' checkWrRegListRes ', getRuseList.data)
console.log( ' data ', data)
return data;
};
@@ -292,7 +301,7 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
year,
fclts
);
console.log('pbnstSttnRes ' , pbnstSttnRes)
set( (state: pbnstSttnState) => {
return {
...state,
@@ -332,7 +341,8 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
total: string,
reurnValue: ReturnType,
searchNm: string | undefined,
year: string
year: string,
flcts:string[]
) => {
try {
@@ -341,7 +351,8 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
total,
reurnValue,
searchNm,
year
year,
flcts
);
set((state: pbnstSttnState) => {