Compare commits

...
29 Commits
Author SHA1 Message Date
jcchoi 6e626c547d Merge remote-tracking branch 'origin/iipbs/st/dev' 2026-11-12 15:05:37 +09:00
jcchoi 7a0d3919d3 Merge remote-tracking branch 'origin/feature/1007_forkjoin' 2026-11-12 14:22:14 +09:00
rsone001 0307ee9fd6 [ST] - refactor: 입력 11-1 운영데이터 가져오기 기능 추가 2026-11-11 16:37:28 +09:00
rsone001 8087ed343c [ST] - fix: 사내 배포용 라이센스 수정 2026-11-10 17:14:36 +09:00
rsone001 eaf0a618a0 [ST] - fix: st dockerfile update 2026-11-10 16:58:01 +09:00
rsone001 4329eafa9b [ST] - fix: 시군구 드롭다운 컬럼 수정, rsone-dockerfile 추가 2026-11-10 16:26:00 +09:00
jcchoi 1e2be153fa Merge remote-tracking branch 'origin/iipbs/st/dev' 2026-11-09 13:48:01 +09:00
jcchoi b90ff150e8 README.md 업데이트
FSD 관련
2026-11-05 17:41:21 +09:00
rsone001 411e490b5d [ST] - retactor: 지표 변경으로 인한 컬럼 수정 2026-11-04 10:59:48 +09:00
mind-one005 aae176ff08 Merge branch 'main' of https://www.onasys.co.kr:3000/ONAANDALL/frontend 2026-11-03 11:13:36 +09:00
mind-one005 d76bdea702 sn : 침수예측 관측소중심으로 로직 변경 2026-11-02 15:51:53 +09:00
mind-one005 45c8d021cc sn: 확률강우량 엑셀다운로드 2026-10-30 13:34:44 +09:00
rsone001 b5f5938e51 [ST] - fix: excel 가져오기 시 코드값이 숫자로 인식되어 저장이 이루어지지 않던 문제 수정 2026-10-29 10:27:42 +09:00
changwng 94d79908fb [as fr] 병합자 조치요청 작성 버튼에 추가및 TB 단계 추가 2026-10-28 20:04:34 +09:00
mind-one005 0336226562 Merge branch 'iipbs/sn/dev' of https://www.onasys.co.kr:3000/ONAANDALL/frontend into iipbs/sn/dev 2026-10-28 17:33:23 +09:00
mind-one005 e9fb1e3a88 sn: login 2026-10-28 17:33:09 +09:00
rsone001 038b2d441e [ST] - refactor: 처리내역 컬럼 제거 및 표준화 누락 부분 수정 2026-10-28 17:24:12 +09:00
mind-one005 a4412001b3 refresh-token의 도메인 설정 2026-10-28 16:24:48 +09:00
jcchoi 766de07c04 Merge branch 'iipbs/st/dev'
Deploy Frontend / deploy (push) Successful in 4m16s
2026-10-28 15:07:16 +09:00
kiminchan 2c901bd32d 관로조사 지도 표시 색상을 짙은 남색으로 변경 2026-10-28 11:24:04 +09:00
rsone001 2ec58f1f5b [ST] - 기본 페이지에서 대시보드 도움말을 불러오기 위해 메뉴코드 전달 2026-10-27 15:52:00 +09:00
rsone001 3cf3617513 [ST] - 검토 & 집계 2-5 컬럼 추가 2026-10-23 14:45:14 +09:00
rsone001 b611538180 [ST] - input 2-5 맨홀 컬럼 추가 2026-10-23 13:48:17 +09:00
rsone001 1cffe06cf9 [ST] - input : 시계열 검증 오류 시 진행상황 코드 롤백 api 추가, 일반 검증 관리 interface 수정 2026-10-22 18:02:48 +09:00
rsone001 9a24e4aa23 [ST] - 입력 verificationResult - cmprCn, nowCn 값 null 일시 치환 2026-10-22 16:48:34 +09:00
rsone001 3732c9380b [ST] - doList 누락 수정 2026-10-22 11:44:35 +09:00
rsone001 9e15b23eda [ST] - fix: input 2-3 저장, 제출 request 수정 2026-10-21 17:17:54 +09:00
rsone001 6f300918cd [ST] - fix: 그리드 여러행 복사 붙여넣기 시 초과된 행 수 많큼 빈행이 추가되지 않도록 수정 2026-10-21 16:04:41 +09:00
rsone001 619878bc03 Merge branch 'iipbs/st/dev' of https://www.onasys.co.kr:3000/ONAANDALL/frontend into iipbs/st/dev 2026-10-21 16:01:05 +09:00
90 changed files with 1421 additions and 720 deletions
+2
View File
@@ -202,3 +202,5 @@ http://dev.onasys.co.kr:8000/webjars/swagger-ui/index.html?urls.primaryName=atta
- 쿠키명 : menu-code-key - 쿠키명 : menu-code-key
- 해당 메뉴 쿠키 데이터 가져와 페이지 권한 및 상당 Breadcrumb 데이터 전달 처리 - 해당 메뉴 쿠키 데이터 가져와 페이지 권한 및 상당 Breadcrumb 데이터 전달 처리
## FSD 관련
https://fsd.how/kr/docs/get-started/overview/
@@ -68,6 +68,14 @@ async function requestActnReview(docNo: string, body: EnvoActnReviewReqDto): Pro
return response.data; return response.data;
} }
async function tbActnRqst(docNo: string): Promise<void> {
await client.put<void>(`${BASE}/${docNo}/tb-actn-rqst`);
}
async function tbSubmitActnResult(docNo: string, body: { isSubmit: boolean }): Promise<void> {
await client.post<void>(`${BASE}/${docNo}/tb-submit-actn-result`, body);
}
async function submitSupplement(id: string, body: FnrsCnsltnApplySaveRequestDto): Promise<string> { async function submitSupplement(id: string, body: FnrsCnsltnApplySaveRequestDto): Promise<string> {
const response = await client.post<string>(`${BASE}/${id}/submitsupplement`, body); const response = await client.post<string>(`${BASE}/${id}/submitsupplement`, body);
return response.data; return response.data;
@@ -111,6 +119,8 @@ export const fnrsCnsltnMngService = {
techReview, techReview,
requestExamine, requestExamine,
requestActnReview, requestActnReview,
tbActnRqst,
tbSubmitActnResult,
submitSupplement, submitSupplement,
submitReqSupplement, submitReqSupplement,
remove, remove,
@@ -140,6 +140,8 @@ export interface FnrsCnsltnMngService {
techReview(id: string, body: FnrsCnsltnApplySaveRequestDto): Promise<void>; techReview(id: string, body: FnrsCnsltnApplySaveRequestDto): Promise<void>;
requestExamine(docNo: string, body: FnrsExamineRequestDto): Promise<string>; requestExamine(docNo: string, body: FnrsExamineRequestDto): Promise<string>;
requestActnReview(docNo: string, body: EnvoActnReviewReqDto): Promise<string>; requestActnReview(docNo: string, body: EnvoActnReviewReqDto): Promise<string>;
tbActnRqst(docNo: string): Promise<void>;
tbSubmitActnResult(docNo: string, body: { isSubmit: boolean }): Promise<void>;
submitSupplement(id: string, body: FnrsCnsltnApplySaveRequestDto): Promise<string>; submitSupplement(id: string, body: FnrsCnsltnApplySaveRequestDto): Promise<string>;
submitReqSupplement(id: string, body: FnrsCnsltnApplySaveRequestDto): Promise<string>; submitReqSupplement(id: string, body: FnrsCnsltnApplySaveRequestDto): Promise<string>;
remove(fnrsCnsltnDocNo: string): Promise<void>; remove(fnrsCnsltnDocNo: string): Promise<void>;
@@ -22,6 +22,8 @@ export const FNRS_CNSLTN_VIEW_BUTTON_ACTION = {
actnCmptn: "actnCmptn", actnCmptn: "actnCmptn",
rqstActnRvw: "rqstActnRvw", rqstActnRvw: "rqstActnRvw",
costVrfc: "costVrfc", costVrfc: "costVrfc",
tbActnRqst: "tbActnRqst",
tbSubmitActnRslt: "tbSubmitActnRslt",
} as const; } as const;
export type FnrsCnsltnViewButtonAction = export type FnrsCnsltnViewButtonAction =
@@ -40,6 +42,10 @@ const ROLE_STATUS_BUTTON_ACTIONS: Record<string, Record<string, FnrsCnsltnViewBu
FNRS_CNSLTN_VIEW_BUTTON_ACTION.del, FNRS_CNSLTN_VIEW_BUTTON_ACTION.del,
], ],
RB: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng, FNRS_CNSLTN_VIEW_BUTTON_ACTION.actnCmptn], RB: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng, FNRS_CNSLTN_VIEW_BUTTON_ACTION.actnCmptn],
TB: [
FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.tbSubmitActnRslt,
],
RA: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng], RA: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
TA: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng], TA: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
}, },
@@ -71,6 +77,7 @@ const ROLE_USER01_ATRZ_STATUS_CODES = [
"ER", "ER",
"SL", "SL",
"TE", "TE",
"TB",
"TP", "TP",
"RB", "RB",
"RA", "RA",
@@ -108,6 +115,7 @@ const ROLE_USER01_ATRZ_STATUS_ACTIONS: Record<
FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwStrg, FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwStrg,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwCmptn, FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwCmptn,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.dmndSplmnt, FNRS_CNSLTN_VIEW_BUTTON_ACTION.dmndSplmnt,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.tbActnRqst,
], ],
ATRZ03: [ ATRZ03: [
FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng, FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng,
@@ -118,6 +126,13 @@ const ROLE_USER01_ATRZ_STATUS_ACTIONS: Record<
FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzRply, FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzRply,
], ],
}, },
TB: {
ATRZ01: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
ATRZ02: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
ATRZ03: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
ATRZ04: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
ATRZ99: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
},
TP: { TP: {
ATRZ01: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng], ATRZ01: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
ATRZ02: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng], ATRZ02: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
@@ -229,12 +244,20 @@ const ROLE_USER01_FORK_JOIN_ATRZ_STATUS_ACTIONS: Record<
ATRZ04: [ ATRZ04: [
FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng, FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzAprv, FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzAprv,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.tbActnRqst,
], ],
ATRZ99: [ ATRZ99: [
FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng, FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzRply, FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzRply,
], ],
}, },
TB: {
ATRZ01: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
ATRZ02: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
ATRZ03: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
ATRZ04: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
ATRZ99: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
},
TP: { TP: {
ATRZ01: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng], ATRZ01: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
ATRZ02: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng], ATRZ02: [FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng],
@@ -340,6 +363,7 @@ const PENDING_APPROVAL_ACTIONS = new Set<FnrsCnsltnViewButtonAction>([
FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwCmptn, FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwCmptn,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzAprv, FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzAprv,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzRply, FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzRply,
FNRS_CNSLTN_VIEW_BUTTON_ACTION.tbActnRqst,
]); ]);
function resolveRoleUser01AtrzButtonActions( function resolveRoleUser01AtrzButtonActions(
@@ -349,7 +373,10 @@ function resolveRoleUser01AtrzButtonActions(
): FnrsCnsltnViewButtonAction[] { ): FnrsCnsltnViewButtonAction[] {
let effectiveStatus = prgrsSttsComCd; let effectiveStatus = prgrsSttsComCd;
if (options?.isForkJoin && options?.branchSttsCd) { // TB는 문서 단위 상태이고 결재 브랜치는 IN_PROGRESS로 남는다. TE 맵으로 되돌리지 않는다.
if (prgrsSttsComCd === "TB") {
effectiveStatus = "TB";
} else if (options?.isForkJoin && options?.branchSttsCd) {
switch (options.branchSttsCd) { switch (options.branchSttsCd) {
case "SUPPLEMENT": case "SUPPLEMENT":
// 본인 브랜치가 보완요청 중이면 'SL' 맵핑 적용 (검토/승인 버튼 숨김, 실무협의서관리만 노출) // 본인 브랜치가 보완요청 중이면 'SL' 맵핑 적용 (검토/승인 버튼 숨김, 실무협의서관리만 노출)
@@ -415,7 +442,12 @@ function resolveRoleUser01AtrzButtonActions(
} }
if (options?.hasCompletedDraft != null) { if (options?.hasCompletedDraft != null) {
if (effectiveStatus === "SL" || effectiveStatus === "TE" || effectiveStatus === "RK") { if (
effectiveStatus === "SL" ||
effectiveStatus === "TE" ||
effectiveStatus === "TB" ||
effectiveStatus === "RK"
) {
if (action === FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng) { if (action === FNRS_CNSLTN_VIEW_BUTTON_ACTION.pwrkCnsltnDocMng) {
return options.hasCompletedDraft; return options.hasCompletedDraft;
} }
@@ -82,6 +82,7 @@ export const PBADMS_PROGRESS_ORDER = [
// KECO // KECO
"ER", "ER",
"TE", "TE",
"TB",
"EV", "EV",
"RK", "RK",
] as const; ] as const;
@@ -146,10 +146,11 @@ function FloatingActionButtons({
const needsAtrzResolve = needsRoleUser01AtrzResolve(dtlInstCd, prgrsSttsComCd); const needsAtrzResolve = needsRoleUser01AtrzResolve(dtlInstCd, prgrsSttsComCd);
const needsElaprPrgrsCheck = const needsElaprPrgrsCheck =
needsAtrzResolve && needsAtrzResolve &&
(["TE", "RK"].includes(prgrsSttsComCd) || (isForkJoin && prgrsSttsComCd === "SL")); (["TE", "TB", "RK"].includes(prgrsSttsComCd) || (isForkJoin && prgrsSttsComCd === "SL"));
const needsPwrkDraftCheck = const needsPwrkDraftCheck =
dtlInstCd === "ROLE_USER01" && ["SL", "TE", "RK"].includes(prgrsSttsComCd); dtlInstCd === "ROLE_USER01" && ["SL", "TE", "TB", "RK"].includes(prgrsSttsComCd);
const needsPwrkForRb = dtlInstCd === "ROLE_USER05" && prgrsSttsComCd === "RB"; const needsPwrkForRb =
dtlInstCd === "ROLE_USER05" && (prgrsSttsComCd === "RB" || prgrsSttsComCd === "TB");
const needsPwrkForAiRetry = dtlInstCd === "ROLE_USER01" && ["TE", "EV"].includes(prgrsSttsComCd); const needsPwrkForAiRetry = dtlInstCd === "ROLE_USER01" && ["TE", "EV"].includes(prgrsSttsComCd);
const needsPwrkLookup = needsPwrkDraftCheck || needsPwrkForRb || needsPwrkForAiRetry; const needsPwrkLookup = needsPwrkDraftCheck || needsPwrkForRb || needsPwrkForAiRetry;
const needsAiAutoLatest = dtlInstCd === "ROLE_USER01" && AI_RETRY_PRGRS_STTS.has(prgrsSttsComCd); const needsAiAutoLatest = dtlInstCd === "ROLE_USER01" && AI_RETRY_PRGRS_STTS.has(prgrsSttsComCd);
@@ -384,14 +385,22 @@ function FloatingActionButtons({
await handler({ await handler({
request, request,
data, data,
onSuccess: () => { onSuccess: async () => {
if (successMessage) alert(successMessage); if (successMessage) alert(successMessage);
await Promise.all([
queryClient.invalidateQueries({ queryClient.invalidateQueries({
queryKey: fnrsCnsltnKeys.detail(fnrsCnsltnDocNo), queryKey: fnrsCnsltnKeys.detail(fnrsCnsltnDocNo),
}); refetchType: "all",
}),
queryClient.invalidateQueries({ queryClient.invalidateQueries({
queryKey: [ENDPOINT.AS_ELAPR_SERVICE.ELAPR_BRANCH], queryKey: [ENDPOINT.AS_ELAPR_SERVICE.ELAPR_BRANCH],
}); refetchType: "all",
}),
queryClient.invalidateQueries({
queryKey: [ENDPOINT.AS_ELAPR_SERVICE.ELAPR_DMND],
refetchType: "all",
}),
]);
}, },
onError: (error) => { onError: (error) => {
let errorMessage = ""; let errorMessage = "";
@@ -771,6 +780,37 @@ function FloatingActionButtons({
}); });
} }
async function handleTbActnRqstClick() {
if (
!(await confirm(
"지자체에 조치요청하시겠습니까?\n조치요청 후 7일 내 제출하지 않으면 자동으로 결재가 다음 단계로 진행됩니다.",
))
) {
return;
}
await executeAction({
action: FNRS_CNSLTN_VIEW_BUTTON_ACTION.tbActnRqst,
successMessage: "조치요청이 완료되었습니다.",
});
}
async function handleTbSubmitActnRsltClick() {
if (!pwrkCnsltnDocNo) {
alert("실무협의 문서번호를 찾을 수 없습니다.");
return;
}
if (!(await confirm("조치결과를 제출하시겠습니까?"))) return;
await executeAction({
action: FNRS_CNSLTN_VIEW_BUTTON_ACTION.tbSubmitActnRslt,
request: {
pwrkCnsltnDocNo,
body: { isSubmit: true } satisfies PwrkActnResultSubmitDto,
},
successMessage: "조치결과가 제출되었습니다.",
});
}
function handleFileVrfcClick() { function handleFileVrfcClick() {
reTransferDocument.mutate( reTransferDocument.mutate(
{ fnrsCnsltnDocNo: docNo }, { fnrsCnsltnDocNo: docNo },
@@ -940,6 +980,17 @@ function FloatingActionButtons({
조치 완료 조치 완료
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.tbActnRqst) &&
prgrsSttsComCd !== "TB" && (
<Button color="orange" onClick={handleTbActnRqstClick} disabled={isBusy}>
조치요청
</Button>
)}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.tbSubmitActnRslt) && (
<Button color="green" onClick={handleTbSubmitActnRsltClick} disabled={isBusy}>
조치결과 제출
</Button>
)}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRsltInq) && {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.rvwRsltInq) &&
!isSecondApproval && !isSecondApproval &&
!( !(
@@ -970,6 +1021,7 @@ function FloatingActionButtons({
</Button> </Button>
)} )}
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzAprv) && {shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.atrzAprv) &&
prgrsSttsComCd !== "TB" &&
(!isForkJoin || (!isForkJoin ||
(userPendingBranchSeCd === "TOTAL_AGG" && userPendingAtrzSeComCd === "ATRZ04")) && ( (userPendingBranchSeCd === "TOTAL_AGG" && userPendingAtrzSeComCd === "ATRZ04")) && (
<Button onClick={handleApprovalOpen} disabled={isBusy}> <Button onClick={handleApprovalOpen} disabled={isBusy}>
@@ -1223,6 +1275,33 @@ async function handleActnCmptn(
} }
} }
async function handleTbActnRqst(context: ActionHandlerContext<void>): Promise<void> {
try {
const docNo = context.data.detDto?.fnrsCnsltnDocNo;
if (!docNo) throw new Error("문서번호가 없습니다.");
await fnrsCnsltnMngService.tbActnRqst(docNo);
await context.onSuccess?.();
} catch (error) {
context.onError?.(error as Error);
}
}
async function handleTbSubmitActnRslt(
context: ActionHandlerContext<{
pwrkCnsltnDocNo: string;
body: PwrkActnResultSubmitDto;
}>,
): Promise<void> {
try {
const docNo = context.data.detDto?.fnrsCnsltnDocNo;
if (!docNo) throw new Error("문서번호가 없습니다.");
await fnrsCnsltnMngService.tbSubmitActnResult(docNo, context.request.body);
context.onSuccess?.();
} catch (error) {
context.onError?.(error as Error);
}
}
const buttonActionHandlers: Record<FnrsCnsltnViewButtonAction, ActionHandler> = { const buttonActionHandlers: Record<FnrsCnsltnViewButtonAction, ActionHandler> = {
strg: handleSaveApply, strg: handleSaveApply,
aply: handleSaveApply, aply: handleSaveApply,
@@ -1247,13 +1326,15 @@ const buttonActionHandlers: Record<FnrsCnsltnViewButtonAction, ActionHandler> =
actnCmptn: handleActnCmptn, actnCmptn: handleActnCmptn,
rqstActnRvw: handleRequestActnReview, rqstActnRvw: handleRequestActnReview,
costVrfc: () => Promise.resolve(), costVrfc: () => Promise.resolve(),
tbActnRqst: handleTbActnRqst,
tbSubmitActnRslt: handleTbSubmitActnRslt,
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
interface ActionHandlerContext<T = any> { interface ActionHandlerContext<T = any> {
request: T; request: T;
data: FnrsCnsltnMngDetResponseDto; data: FnrsCnsltnMngDetResponseDto;
onSuccess?: () => void; onSuccess?: () => void | Promise<void>;
onError?: (error: Error) => void; onError?: (error: Error) => void;
} }
@@ -54,7 +54,7 @@ const AI_DRAFT_EVL_MAX_VER_SN = 2;
const APPROVER_ATRZ_SE_COM_CDS = new Set(["ATRZ03", "ATRZ99"]); const APPROVER_ATRZ_SE_COM_CDS = new Set(["ATRZ03", "ATRZ99"]);
const VIEW_ONLY_PRGRS_STTS_COM_CDS = new Set(["TP", "RA", "AV", "EV", "RR", "EP", "TA"]); const VIEW_ONLY_PRGRS_STTS_COM_CDS = new Set(["TB", "TP", "RA", "AV", "EV", "RR", "EP", "TA"]);
interface PwrkCnsltnDocMngDialogProps { interface PwrkCnsltnDocMngDialogProps {
open: boolean; open: boolean;
@@ -953,7 +953,9 @@ function PwrkCnsltnDocMngDialog({
]); ]);
// 저장 버튼은 해당 부서 작성 권한이 있는 경우 표시 (메인 기안기는 항상 최신 버전 유지) // 저장 버튼은 해당 부서 작성 권한이 있는 경우 표시 (메인 기안기는 항상 최신 버전 유지)
const canSaveInCurrentView = canSaveCurrentBranch; const canSaveInCurrentView = canSaveCurrentBranch && prgrsSttsComCd !== "TB";
const hideHangulForLocalUser =
effectiveUserRole === "ROLE_USER05" && prgrsSttsComCd === "SL";
// 변경이력 콤보 박스 컴포넌트 (선택 시 해당 버전 새 창으로 열람 및 선택 항목 유지) // 변경이력 콤보 박스 컴포넌트 (선택 시 해당 버전 새 창으로 열람 및 선택 항목 유지)
const versionHistorySelect = ( const versionHistorySelect = (
@@ -1167,7 +1169,12 @@ function PwrkCnsltnDocMngDialog({
생성 완료된 실무협의서 초안이 없습니다. 생성 완료된 실무협의서 초안이 없습니다.
</p> </p>
) : null} ) : null}
{completedDraft && documentBlob ? ( {hideHangulForLocalUser ? (
<p className="py-16 text-center text-lg text-muted-foreground">
기술검토(TE) 이후 보완요청(SL) 상태에서는 지자체 사용자에게 웹기안기가 표시되지 않습니다.
</p>
) : null}
{completedDraft && documentBlob && !hideHangulForLocalUser ? (
<div className={cn("flex items-stretch gap-2", editorContainerMinHeight)}> <div className={cn("flex items-stretch gap-2", editorContainerMinHeight)}>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<HangulGiangi <HangulGiangi
+15 -8
View File
@@ -1,3 +1,14 @@
/**
* 📄 Proxy Route
* API 프록시 라우트
*
* - 서버 API로의 요청 프록시 처리
* - 쿠키 기반 인증 토큰 및 리프레시 토큰 관리
* - POST 및 PUT 요청 핸들링
* - 사용자 인증 정보 검증 및 응답 처리
* - 에러 핸들링 및 상태 코드 반환
* - 사이트 ID 및 헤더 설정
*/
import { import {
ACCESS_TOKEN, ACCESS_TOKEN,
AUTH_USER_ID, AUTH_USER_ID,
@@ -113,12 +124,8 @@ export async function PUT(
} }
function getCookieDomain(): string | undefined { function getCookieDomain(): string | undefined {
if (typeof window === "undefined") return undefined; // 개발에서는 현재 사이트 전용, 운영에서는 환경변수의 공용 도메인을 사용한다.
return process.env.NODE_ENV === "production"
if (COOKIE_DOMAIN) return COOKIE_DOMAIN; ? COOKIE_DOMAIN || undefined
: undefined;
const { hostname } = window.location;
if (hostname === "localhost" || hostname === "127.0.0.1") return undefined;
return hostname;
} }
@@ -5,6 +5,7 @@
"use client"; "use client";
import type { ExmnMapFilters, ExmnMapJobType } from "./exmn-map-types"; import type { ExmnMapFilters, ExmnMapJobType } from "./exmn-map-types";
import { EXMN_RESULT_PPL_LEGEND_COLOR } from "./exmn-map-types";
import LayerSettingCard from "../layer-setting/layer-setting-card"; import LayerSettingCard from "../layer-setting/layer-setting-card";
type Props = { type Props = {
@@ -52,7 +53,8 @@ export default function ExmnLayerSettingPanel({
<label className="flex min-h-[24px] flex-col items-stretch gap-1"> <label className="flex min-h-[24px] flex-col items-stretch gap-1">
<span className={`flex items-center gap-1 ${labelClass}`}> <span className={`flex items-center gap-1 ${labelClass}`}>
<span <span
className={`h-2 w-2 rounded-full ${jobType === "PPL" ? "bg-[#facc15]" : "bg-[#8b5cf6]"}`} className="h-2 w-2 rounded-full"
style={{ backgroundColor: jobType === "PPL" ? EXMN_RESULT_PPL_LEGEND_COLOR : "#8b5cf6" }}
/> />
사업차수 사업차수
</span> </span>
@@ -8,7 +8,7 @@ export const EXMN_RESULT_ROOT_LAYER_TYPE = "sn_exmn_result_group";
export const EXMN_RESULT_PPL_LAYER_TYPE = "sn_exmn_result_ppl"; export const EXMN_RESULT_PPL_LAYER_TYPE = "sn_exmn_result_ppl";
export const EXMN_RESULT_MNHL_LAYER_TYPE = "sn_exmn_result_mnhl"; export const EXMN_RESULT_MNHL_LAYER_TYPE = "sn_exmn_result_mnhl";
// 레이어 트리에서 조사 관로와 기존 맨홀 분류 심볼을 즉시 구분하기 위한 전용 범례 스타일이다. // 레이어 트리에서 조사 관로와 기존 맨홀 분류 심볼을 즉시 구분하기 위한 전용 범례 스타일이다.
export const EXMN_RESULT_PPL_LEGEND_COLOR = "#facc15"; export const EXMN_RESULT_PPL_LEGEND_COLOR = "#000080";
export const EXMN_RESULT_MNHL_LEGEND_ICON = "SN_EXMN_MANHOLE_PURPLE.png?v=3"; export const EXMN_RESULT_MNHL_LEGEND_ICON = "SN_EXMN_MANHOLE_PURPLE.png?v=3";
export type ExmnMapJobType = "PPL" | "MNHL"; export type ExmnMapJobType = "PPL" | "MNHL";
@@ -4,6 +4,7 @@ import Icon from "ol/style/Icon.js";
import Stroke from "ol/style/Stroke.js"; import Stroke from "ol/style/Stroke.js";
import Style from "ol/style/Style.js"; import Style from "ol/style/Style.js";
import Text from "ol/style/Text.js"; import Text from "ol/style/Text.js";
import { EXMN_RESULT_PPL_LEGEND_COLOR } from "../components/exmn/exmn-map-types";
import { import {
EXMN_GRADE_COLORS, EXMN_GRADE_COLORS,
EXMN_RESULT_MANHOLE_ICON_SRC, EXMN_RESULT_MANHOLE_ICON_SRC,
@@ -14,10 +15,11 @@ export const getExmnGradeColor = (feature: any) => {
return EXMN_GRADE_COLORS[grade] ?? "#2563eb"; return EXMN_GRADE_COLORS[grade] ?? "#2563eb";
}; };
export const createExmnPipeStyle = (feature: any) => // 조사 관로는 상태등급과 관계없이 범례와 같은 짙은 남색으로 표시한다.
export const createExmnPipeStyle = () =>
new Style({ new Style({
stroke: new Stroke({ stroke: new Stroke({
color: getExmnGradeColor(feature), color: EXMN_RESULT_PPL_LEGEND_COLOR,
width: 4, width: 4,
}), }),
}); });
+4 -8
View File
@@ -122,12 +122,8 @@ export async function PUT(
} }
function getCookieDomain(): string | undefined { function getCookieDomain(): string | undefined {
if (typeof window === "undefined") return undefined; // 개발에서는 현재 사이트 전용, 운영에서는 환경변수의 공용 도메인을 사용한다.
return process.env.NODE_ENV === "production"
if (COOKIE_DOMAIN) return COOKIE_DOMAIN; ? COOKIE_DOMAIN || undefined
: undefined;
const { hostname } = window.location;
if (hostname === "localhost" || hostname === "127.0.0.1") return undefined;
return hostname;
} }
+2 -34
View File
@@ -4,47 +4,15 @@
* 📄 Home Page * 📄 Home Page
* 홈 페이지 컴포넌트 * 홈 페이지 컴포넌트
* *
* - 쿠키 기반 인증 토큰 검증 및 자동 로그인 처리 * - 루트 진입 시 지도 페이지(/map)로 리다이렉트
* - 로그인 성공 시 지도 페이지로 리다이렉트 * - 인증 토큰 검증 및 로그인 화면 이동은 /map 및 공통 인증 흐름에서 처리
* - 개발 환경에서는 루트 진입 시 자동 로그인 후 지도 페이지 이동
* - 로그인 실패 시 에러 로깅 및 처리
* - 사용자 세션 관리 및 초기 라우팅 제어 * - 사용자 세션 관리 및 초기 라우팅 제어
* - Next.js useRouter를 통한 클라이언트 사이드 라우팅
*
* 🔗 사용 API
* - 로그인: POST /api/v1/auth/login (user-service)
*/ */
"use client"; "use client";
import { authService } from "@/entities/auth";
import { useEffect } from "react"; import { useEffect } from "react";
const DEV_HOSTNAMES = new Set(["localhost", "127.0.0.1", "con.mind-one.co.kr"]);
const DEV_LOGIN_PAYLOAD = {
userId: process.env.NEXT_PUBLIC_DEV_LOGIN_USER_ID || "CLEANWATER",
password: process.env.NEXT_PUBLIC_DEV_LOGIN_PASSWORD || "gktneh12!@",
};
export default function Home() { export default function Home() {
useEffect(() => { useEffect(() => {
const hostname = window.location.hostname;
const isDevHost = DEV_HOSTNAMES.has(hostname);
if (!isDevHost) {
window.location.replace("/map"); window.location.replace("/map");
return;
}
async function doLogin() {
try {
// 개발 환경에서는 남아 있는 만료/부분 쿠키로 인한 /map <-> / 루프를 막기 위해 항상 토큰을 재발급한다.
await authService.login(DEV_LOGIN_PAYLOAD);
window.location.replace("/map");
} catch (err) {
console.error("로그인 실패", err);
}
}
void doLogin();
}, []); }, []);
} }
@@ -719,3 +719,19 @@
- 실브라우저: 테스트 사업→초이처리분구→지도3개 표시→실제188001 클릭→사업명 테스트/GIS 맨홀번호188001 확인→조사보고서 보기→1쪽 PDF와188001 표시 성공. 사용자도 최종 정상동작 확인했다. - 실브라우저: 테스트 사업→초이처리분구→지도3개 표시→실제188001 클릭→사업명 테스트/GIS 맨홀번호188001 확인→조사보고서 보기→1쪽 PDF와188001 표시 성공. 사용자도 최종 정상동작 확인했다.
- 실행 서버: 기존 재시작 승인 범위에서 코드 반영 후8883 PID27788로 유지한다(이전PID24204 종료). classpath/실행로그는 기존 .codex-tmp/manhole-backend-* 경로 유지. 종료명령 Stop-Process -Id 27788. - 실행 서버: 기존 재시작 승인 범위에서 코드 반영 후8883 PID27788로 유지한다(이전PID24204 종료). classpath/실행로그는 기존 .codex-tmp/manhole-backend-* 경로 유지. 종료명령 Stop-Process -Id 27788.
- 롤백: 위 FE3개 소스와 ExmnManholeReportService의 이번 변경을 함께 복원한다. DB 롤백 없음. 잔여 리스크는 GIS 미연결 자료 열람 불가 및 대형 사업의 지도 매칭·PDF 판독 비용이며, 임의 위치/다른 사업 fallback을 하지 않는다. - 롤백: 위 FE3개 소스와 ExmnManholeReportService의 이번 변경을 함께 복원한다. DB 롤백 없음. 잔여 리스크는 GIS 미연결 자료 열람 불가 및 대형 사업의 지도 매칭·PDF 판독 비용이며, 임의 위치/다른 사업 fallback을 하지 않는다.
## 2026-10-28 관로조사 남색 표시
- 정적 확인: 관로 선·범례·설정 표식은 `EXMN_RESULT_PPL_LEGEND_COLOR(#000080)`을 공유하고 관로 선 두께는 4를 유지한다. 맨홀·선택 이벤트·API·DB 변경 없음.
- `git -C frontend diff --check`: 통과.
- 3002 리스너 부재로 HMR·실브라우저 검증은 미수행. 실제 지도에서 관로조사 켜기, 등급 필터 변경 후 남색 유지, 선택 강조·맨홀 동시 표시 구분을 후속 확인한다.
### 2026-10-28 개발 서버 기동 후 확인
- 사용자 요청으로 `pnpm --filter sn dev` 실행, Next.js Ready 및 localhost:3002 접속 확인. 서버는 유지한다.
- Chrome에서 /map 진입 시 /auth/login으로 이동하고 로그인 화면이 표시됨. 로컬 로그인 세션이 없어 실제 지도 선·범례 가시성 검증은 로그인 후 계속해야 한다. 인증 우회·환경설정 변경 없음.
### 2026-10-28 백엔드 복구 및 실지도 검증 완료
- 원인: 프론트만 실행되어 localhost:8883 지도 API가 ECONNREFUSED로 실패했다. 기존 local 설정으로 Config Server와 sewerage-service를 기동했다. 코드·환경 파일·DB 변경 없음.
- 지도 레이어 API HTTP 200. 실제 레이어 목록·조사사업 조회 정상.
- 테스트 사업 → 관로조사 → 초이처리분구 → 지도보기: 3개 표시, 줌18.0에서 짙은 남색 관로가 일반지도 배경과 주황색 기존 관로에서 선명하게 구분됨. 이전 실지도 미검증 상태 해소. 위성지도·모든 등급·선택 강조 조합은 미검증.
- 사용자 계속 실행 지시에 따라 FE3002 PID28176, BE8883 PID31232, Config8888 PID27092 유지. 종료 시 해당 PID가 같은 프로세스인지 재확인 후 Stop-Process -Id 명령으로 종료한다.
@@ -38,7 +38,7 @@
| 파일 | 역할 | 선언/주석 보조 근거 | 행 | 직접 참조 | 상태 | | 파일 | 역할 | 선언/주석 보조 근거 | 행 | 직접 참조 | 상태 |
|---|---|---|---:|---:|---| |---|---|---|---:|---:|---|
| [layout.tsx](<D:/workspace/IIPBS-FRONTEND/frontend/apps/sn/app/layout.tsx>) | Next 루트 HTML·테마·메타데이터·Provider 진입점 | metadata, RootLayout / ➡️ 경로 : 모든 페이지 | 44 | 0 | 등록/도구 진입 규칙 대상 | | [layout.tsx](<D:/workspace/IIPBS-FRONTEND/frontend/apps/sn/app/layout.tsx>) | Next 루트 HTML·테마·메타데이터·Provider 진입점 | metadata, RootLayout / ➡️ 경로 : 모든 페이지 | 44 | 0 | 등록/도구 진입 규칙 대상 |
| [page.tsx](<D:/workspace/IIPBS-FRONTEND/frontend/apps/sn/app/page.tsx>) | 루트 진입/개발 자동로그인·지도 이동 | DEV_HOSTNAMES, DEV_LOGIN_PAYLOAD, Home / 홈 페이지 컴포넌트 | 51 | 0 | 등록/도구 진입 규칙 대상 | | [page.tsx](<D:/workspace/IIPBS-FRONTEND/frontend/apps/sn/app/page.tsx>) | 루트 진입/지도 이동 | Home / 홈 페이지 컴포넌트 | 18 | 0 | 등록/도구 진입 규칙 대상 |
| [providers.tsx](<D:/workspace/IIPBS-FRONTEND/frontend/apps/sn/app/providers.tsx>) | 실제 src/app/providers의 AppProvider 재수출. 현재 layout에서 사용 | | 2 | 1 | 정적 참조 있음 | | [providers.tsx](<D:/workspace/IIPBS-FRONTEND/frontend/apps/sn/app/providers.tsx>) | 실제 src/app/providers의 AppProvider 재수출. 현재 layout에서 사용 | | 2 | 1 | 정적 참조 있음 |
## app/(auth)/auth ## app/(auth)/auth
@@ -1045,3 +1045,12 @@
- 실브라우저: 테스트 사업→초이처리분구→지도3개 표시→실제188001 클릭→사업명 테스트/GIS 맨홀번호188001 확인→조사보고서 보기→1쪽 PDF와188001 표시 성공. 사용자도 최종 정상동작 확인했다. - 실브라우저: 테스트 사업→초이처리분구→지도3개 표시→실제188001 클릭→사업명 테스트/GIS 맨홀번호188001 확인→조사보고서 보기→1쪽 PDF와188001 표시 성공. 사용자도 최종 정상동작 확인했다.
- 실행 서버: 기존 재시작 승인 범위에서 코드 반영 후8883 PID27788로 유지한다(이전PID24204 종료). classpath/실행로그는 기존 .codex-tmp/manhole-backend-* 경로 유지. 종료명령 Stop-Process -Id 27788. - 실행 서버: 기존 재시작 승인 범위에서 코드 반영 후8883 PID27788로 유지한다(이전PID24204 종료). classpath/실행로그는 기존 .codex-tmp/manhole-backend-* 경로 유지. 종료명령 Stop-Process -Id 27788.
- 롤백: 위 FE3개 소스와 ExmnManholeReportService의 이번 변경을 함께 복원한다. DB 롤백 없음. 잔여 리스크는 GIS 미연결 자료 열람 불가 및 대형 사업의 지도 매칭·PDF 판독 비용이며, 임의 위치/다른 사업 fallback을 하지 않는다. - 롤백: 위 FE3개 소스와 ExmnManholeReportService의 이번 변경을 함께 복원한다. DB 롤백 없음. 잔여 리스크는 GIS 미연결 자료 열람 불가 및 대형 사업의 지도 매칭·PDF 판독 비용이며, 임의 위치/다른 사업 fallback을 하지 않는다.
## 2026-10-28 관로조사 지도 색상 가시성 개선
- 사용자 요청에 따라 조사결과 > 관로조사의 지도 선을 상태등급별 색상에서 짙은 남색 `#000080`으로 통일했다. 선 두께 4와 등급 조회·필터는 유지한다.
- `app/(map-layout)/map/lib/analysis-layer-styles.ts`, `components/exmn/exmn-map-types.ts`, `components/exmn/exmn-layer-setting-panel.tsx`에서 지도 선·레이어 범례·설정 표식이 같은 색상 상수를 사용하도록 했다(뒤 두 경로도 같은 map 하위).
- 원본 근거: 요구사항정의서 `3. (기능)요구사항정의 및 추적표`의 SFR-010-004, 화면설계서 45쪽 SN_MN040103 및 48쪽 SN_MN040107의 조사관로 지도 표출. 색상 변경은 이번 사용자 요청을 적용했다.
- 영향: SN 지도 표시 전용. 맨홀 심볼·선택 처리·상세 탭·API·DB 변경 없음.
- 검증: git diff --check 통과, 지도 스타일과 범례·설정 표식의 공통 상수 참조 확인. 3002 개발 서버 리스너가 없어 HMR·실제 배경지도 가시성은 미검증. 빌드·서버 기동/재시작은 수행하지 않았다.
- 롤백: 위 3개 파일의 이번 색상 변경만 되돌린다. DB 조치 없음.
@@ -20,3 +20,30 @@
## 수동 확인 필요 ## 수동 확인 필요
- 실제 로그인 화면에서 팝업 크기·가로 스크롤·강조 색상 및 지도 이동 회귀 확인 - 실제 로그인 화면에서 팝업 크기·가로 스크롤·강조 색상 및 지도 이동 회귀 확인
## 추가 작업: 확률강우량 팝업 엑셀다운로드 (2026-10-30)
### 변경 내용
- 팝업 헤더 우측(닫기 X 왼쪽)에 `엑셀다운로드` 버튼을 추가했다. 닫기 버튼과 겹치지 않도록 헤더에 `pr-14` 여백을 둔다.
- 공통 유틸 `src/shared/util/download-excel-workbook.ts`의 `downloadExcelWorkbook`을 재사용한다.
- 파일명은 `{시군구명}_확률강우량.xlsx`이며 시트는 두 개다.
- `확률강우량`: 재현기간(년) 행 × `N시간` 열. 셀은 소수 4자리로 자르지 않은 원본 숫자 값이다.
- `확률관측소 면적비율`: 확률관측소코드·관측소명·면적비율(%)과 합계(API `areaRtTotal`).
- 로딩 중·오류·표 데이터 없음 상태에서는 버튼을 비활성화한다.
- API 호출, 응답 구조, 화면 문구와 기존 표 렌더링은 변경하지 않았다.
### 이슈: 팝업 본체가 투명하게 렌더링됨
- 증상: 엑셀다운로드 버튼 추가 후 팝업 본체 배경이 투명해져 뒤쪽 목록 화면이 비쳐 보였다. 새로고침과 애니메이션 완료 후에도 재현됐다.
- 추정 원인: `DialogContent`의 배경이 `bg-[var(--dialog-bg)]`(`--dialog-bg: var(--background)`, `packages/common/assets/src/styles/base.css`)인데, 이 모달에서 해당 변수가 값을 가져오지 못한 것으로 추정한다. 정확한 근본 원인은 확인하지 못했다. 공통 패키지(`@common/components`, `@common/assets`)는 수정 범위 밖이라 변경하지 않았다.
- 조치: `PrbbtRnflDialog.tsx`의 `DialogContent` className에 `bg-background`를 추가해 배경을 직접 지정했다. 사용자가 해결을 확인했다(2026-10-30).
- 참고: 같은 증상이 다른 `DialogContent` 사용 팝업에서 보이면 공통 변수 문제일 수 있으므로 별도 보고 대상이다.
### 수정 파일
- `apps/sn/src/features/fldng-predc-prst/ui/PrbbtRnflDialog.tsx`
### 검증
- 사용자가 실제 화면에서 팝업 배경 정상 표시를 확인했다.
- 타입 체크·빌드·엑셀 파일 내용 열람은 수행하지 않았다.
### 롤백
- 위 파일의 변경(헤더 버튼, `handleExcelDownload`, 두 import, `bg-background`)을 되돌린다.
@@ -3,6 +3,10 @@ import { downloadExcelWithKoreanHeaders } from "@/shared/lib/download-excel";
export type FloodPredictionExcelRow = { export type FloodPredictionExcelRow = {
ctpvNm: string; ctpvNm: string;
sggNm: string; sggNm: string;
/** `/prst` 조회 때 시군구-관측소 매핑에서 붙인 관측소명이다. 기존 로직 행이나 매핑에 없는 조합은 null이다. */
obsrvnBrnchNm: string | null;
/** 시군구 면적 중 관측소 영역의 비율(%)이다. 기존 로직 행이나 매핑에 없는 조합은 null이다. */
areaRt: number | null;
analysisDateTime: string; analysisDateTime: string;
rainBeginningDateTime: string; rainBeginningDateTime: string;
observedAccumulatedRainfall: number | null; observedAccumulatedRainfall: number | null;
@@ -12,10 +16,13 @@ export type FloodPredictionExcelRow = {
floodRiskGrade: string; floodRiskGrade: string;
}; };
/** Excel 행 객체 키를 한글 헤더로 바꾸는 매핑이다. 실제 열 순서는 행 객체의 키 순서를 따르므로 같은 순서로 둔다. */
const HEADERS: Record<string, string> = { const HEADERS: Record<string, string> = {
rowNo: "순번", rowNo: "순번",
ctpvNm: "시도", ctpvNm: "시도",
sggNm: "시군구", sggNm: "시군구",
obsrvnBrnchNm: "관측소",
areaRt: "면적비율(%)",
analysisDateTime: "분석시각", analysisDateTime: "분석시각",
rainBeginningDateTime: "강우시작시각", rainBeginningDateTime: "강우시작시각",
observedAccumulatedRainfall: "관측 누적강수량(mm)", observedAccumulatedRainfall: "관측 누적강수량(mm)",
@@ -39,12 +46,20 @@ export const downloadFloodPredictionStatusExcel = async (
rowNo: index + 1, rowNo: index + 1,
ctpvNm: row.ctpvNm || "-", ctpvNm: row.ctpvNm || "-",
sggNm: row.sggNm || "-", sggNm: row.sggNm || "-",
// 관측소·면적비율은 시군구 뒤에 두고, 기존 로직 행이나 매핑에 없는 조합은 `-`로 내보낸다.
obsrvnBrnchNm: row.obsrvnBrnchNm || "-",
// 면적비율은 목록과 같이 소수 둘째 자리까지 반올림한 숫자로 내보낸다.
areaRt:
row.areaRt == null || !Number.isFinite(Number(row.areaRt))
? "-"
: Number(Number(row.areaRt).toFixed(2)),
analysisDateTime: formatDateTime(row.analysisDateTime), analysisDateTime: formatDateTime(row.analysisDateTime),
rainBeginningDateTime: formatDateTime(row.rainBeginningDateTime), rainBeginningDateTime: formatDateTime(row.rainBeginningDateTime),
observedAccumulatedRainfall: observedAccumulatedRainfall:
row.observedAccumulatedRainfall == null row.observedAccumulatedRainfall == null
? "-" ? "-"
: Number(row.observedAccumulatedRainfall.toFixed(1)), : Number(row.observedAccumulatedRainfall.toFixed(1)),
// 관측소 기준 행의 예측시간 0(대표값이 분석시각)도 목록과 같이 `0시간 후`로 내보낸다.
predictionHour: predictionHour:
row.predictionHour == null ? "-" : `${row.predictionHour}시간 후`, row.predictionHour == null ? "-" : `${row.predictionHour}시간 후`,
predictedAccumulatedRainfall: predictedAccumulatedRainfall:
@@ -60,7 +75,8 @@ export const downloadFloodPredictionStatusExcel = async (
data: excelRows as unknown as JSON[], data: excelRows as unknown as JSON[],
fileName: "침수예측현황.xlsx", fileName: "침수예측현황.xlsx",
sheetNameArray: ["침수예측현황"], sheetNameArray: ["침수예측현황"],
headerRange: "A1:J1", // 순번~침수위험도 12개 열(관측소·면적비율 포함)의 헤더 행 범위다.
headerRange: "A1:L1",
headerMapping: HEADERS, headerMapping: HEADERS,
}); });
}; };
@@ -2,9 +2,14 @@
import { useLayoutEffect, useMemo, useRef } from "react"; import { useLayoutEffect, useMemo, useRef } from "react";
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@common/components"; import { Button, Dialog, DialogContent, DialogHeader, DialogTitle } from "@common/components";
/** 시군구별 면적가중 확률강우량 한 셀의 API 응답이다. */ import { downloadExcelWorkbook } from "@/shared/util/download-excel-workbook";
/**
* 시군구별 면적가중 확률강우량 한 셀의 API 응답이다.
* 관측소 기준표 응답에서는 최근접 확률관측소 1곳의 값을 면적가중 없이 그대로 담는다.
*/
export type PrbbtRnflCell = { export type PrbbtRnflCell = {
frequencyYear: number; frequencyYear: number;
durationHour: number; durationHour: number;
@@ -18,18 +23,37 @@ export type PrbbtRnflStation = {
areaRt: number; areaRt: number;
}; };
/** 확률강우량 표와 그 계산에 사용한 관측소 비율을 함께 받는다. */ /**
* 확률강우량 표와 그 계산에 사용한 관측소 비율을 함께 받는다.
* 시군구 기준표(`/prst/prbbt-rnfl?sggCd=`)는 `sggCd`를, 관측소 기준표(`/prst/prbbt-rnfl/obsvtr?obsrvnBrnchCd=`)는
* `sggCd` 대신 `obsrvnBrnchCd`·`obsrvnBrnchNm`을 담으므로 두 응답을 모두 받도록 식별 필드는 선택값으로 둔다.
*/
export type PrbbtRnflResponse = { export type PrbbtRnflResponse = {
sggCd: string; /** 시군구 기준표 응답의 시군구코드다. 관측소 기준표 응답에는 없다. */
sggCd?: string;
/** 관측소 기준표 응답의 관측지점코드다. 시군구 기준표 응답에는 없다. */
obsrvnBrnchCd?: string;
/** 관측소 기준표 응답의 관측소명이다. 시군구 기준표 응답에는 없다. */
obsrvnBrnchNm?: string;
rainfall: PrbbtRnflCell[]; rainfall: PrbbtRnflCell[];
/** 시군구 기준은 면적가중에 쓴 확률관측소 전부, 관측소 기준은 최근접 확률관측소 1곳(비율 100)이다. */
stations: PrbbtRnflStation[]; stations: PrbbtRnflStation[];
areaRtTotal: number; areaRtTotal: number;
}; };
/**
* 기준표를 연 목록 행의 분석 기준이다.
* `sgg`는 기존 시군구 면적가중 행, `obsvtr`는 관측지점코드가 있는 관측소 기준(새 로직) 행이다.
*/
export type PrbbtRnflTargetKind = "sgg" | "obsvtr";
type PrbbtRnflDialogProps = { type PrbbtRnflDialogProps = {
open: boolean; open: boolean;
onOpenChange: (open: boolean) => void; onOpenChange: (open: boolean) => void;
sggName: string; /** 상단 제목·표 제목·Excel 파일명에 쓰는 대상 이름이다. 시군구 기준은 시군구명, 관측소 기준은 관측소명이다. */
targetName: string;
/** 대상 이름이 시군구인지 관측소인지 구분해 아래 표 제목과 안내 문구를 고른다. */
targetKind: PrbbtRnflTargetKind;
selectedDurationHour: number | null; selectedDurationHour: number | null;
selectedFrequencyYear: number | null; selectedFrequencyYear: number | null;
data: PrbbtRnflResponse | null; data: PrbbtRnflResponse | null;
@@ -43,11 +67,27 @@ const formatRainfall = (value: number) =>
const formatAreaRatio = (value: number) => const formatAreaRatio = (value: number) =>
Number.isFinite(Number(value)) ? Number(value).toFixed(3) : "-"; Number.isFinite(Number(value)) ? Number(value).toFixed(3) : "-";
/**
* 아래 확률관측소 표의 제목(Excel 두 번째 시트명 겸용)이다.
* 관측소 기준은 면적가중 없이 최근접 확률관측소 1곳을 쓰므로 `적용 확률관측소`로 보인다.
*/
const STATION_TABLE_TITLE: Record<PrbbtRnflTargetKind, string> = {
sgg: "확률관측소 면적비율",
obsvtr: "적용 확률관측소",
};
/** 기준자료가 없을 때 보이는 안내 문구다. 관측소 기준은 시군구 대신 관측소로 안내한다. */
const EMPTY_MESSAGE: Record<PrbbtRnflTargetKind, string> = {
sgg: "해당 시군구의 확률강우량 기준자료가 없습니다.",
obsvtr: "해당 관측소의 확률강우량 기준자료가 없습니다.",
};
/** 재현기간을 행, 강우지속시간을 열로 구성하고 선택한 두 기준이 교차하는 값만 색으로 강조한다. */ /** 재현기간을 행, 강우지속시간을 열로 구성하고 선택한 두 기준이 교차하는 값만 색으로 강조한다. */
export default function PrbbtRnflDialog({ export default function PrbbtRnflDialog({
open, open,
onOpenChange, onOpenChange,
sggName, targetName,
targetKind,
selectedDurationHour, selectedDurationHour,
selectedFrequencyYear, selectedFrequencyYear,
data, data,
@@ -58,6 +98,8 @@ export default function PrbbtRnflDialog({
const tableScrollRef = useRef<HTMLDivElement>(null); const tableScrollRef = useRef<HTMLDivElement>(null);
/** 목록에서 클릭한 지속시간에 대응하는 표 헤더이다. */ /** 목록에서 클릭한 지속시간에 대응하는 표 헤더이다. */
const selectedDurationHeaderRef = useRef<HTMLTableCellElement>(null); const selectedDurationHeaderRef = useRef<HTMLTableCellElement>(null);
/** 행 종류에 따른 아래 표 제목이다. 시군구 기준 행은 기존 제목을 그대로 쓴다. */
const stationTableTitle = STATION_TABLE_TITLE[targetKind];
const { frequencies, durations, rainfallByKey } = useMemo(() => { const { frequencies, durations, rainfallByKey } = useMemo(() => {
const rainfall = data?.rainfall ?? []; const rainfall = data?.rainfall ?? [];
@@ -77,6 +119,46 @@ export default function PrbbtRnflDialog({
}; };
}, [data]); }, [data]);
/**
* 화면에 표시 중인 확률강우량 표와 관측소 면적비율 표를 두 시트로 내려받는다.
* 파일명은 대상 이름(시군구명 또는 관측소명)을, 두 번째 시트명은 아래 표 제목을 따른다.
*/
const handleExcelDownload = async () => {
const stations = data?.stations ?? [];
await downloadExcelWorkbook({
fileName: `${targetName}_확률강우량`,
sheets: [
{
name: "확률강우량",
rows: [
["재현기간(년)", ...durations.map((hour) => `${hour}시간`)],
...frequencies.map((frequencyYear) => [
frequencyYear,
...durations.map(
(durationHour) =>
rainfallByKey.get(`${frequencyYear}:${durationHour}`) ?? null,
),
]),
],
columnWidths: [14, ...durations.map(() => 12)],
},
{
name: stationTableTitle,
rows: [
["확률관측소코드", "관측소명", "면적비율(%)"],
...stations.map((station) => [
station.prbbtObsvtrCd,
station.prbbtObsvtrNm || "-",
station.areaRt,
]),
["합계", "", data?.areaRtTotal ?? null],
],
columnWidths: [18, 18, 14],
},
],
});
};
/** 표가 표시되면 선택 지속시간 열을 가로 스크롤 영역의 가운데로 맞춘다. */ /** 표가 표시되면 선택 지속시간 열을 가로 스크롤 영역의 가운데로 맞춘다. */
useLayoutEffect(() => { useLayoutEffect(() => {
if (!open || loading || error || selectedDurationHour == null) return; if (!open || loading || error || selectedDurationHour == null) return;
@@ -99,8 +181,16 @@ export default function PrbbtRnflDialog({
className="flex max-h-[90vh] w-[94vw] !max-w-[150rem] flex-col gap-4 overflow-hidden" className="flex max-h-[90vh] w-[94vw] !max-w-[150rem] flex-col gap-4 overflow-hidden"
aria-describedby={undefined} aria-describedby={undefined}
> >
<DialogHeader> {/* 우측 상단 닫기(X) 버튼과 겹치지 않도록 pr-14 여백을 둔다. */}
<DialogTitle>{sggName} 확률강우량</DialogTitle> <DialogHeader className="flex-row items-center justify-between pr-14">
<DialogTitle>{targetName} 확률강우량</DialogTitle>
<Button
type="button"
disabled={loading || !!error || !frequencies.length || !durations.length}
onClick={() => void handleExcelDownload()}
>
엑셀다운로드
</Button>
</DialogHeader> </DialogHeader>
{loading ? ( {loading ? (
@@ -113,14 +203,14 @@ export default function PrbbtRnflDialog({
</p> </p>
) : !frequencies.length || !durations.length ? ( ) : !frequencies.length || !durations.length ? (
<p className="py-8 text-center text-xl" role="status"> <p className="py-8 text-center text-xl" role="status">
해당 시군구의 확률강우량 기준자료가 없습니다. {EMPTY_MESSAGE[targetKind]}
</p> </p>
) : ( ) : (
<> <>
<div ref={tableScrollRef} className="min-h-0 overflow-auto rounded-md border border-border"> <div ref={tableScrollRef} className="min-h-0 overflow-auto rounded-md border border-border">
<table className="w-max min-w-full border-collapse text-right text-lg"> <table className="w-max min-w-full border-collapse text-right text-lg">
<caption className="sr-only"> <caption className="sr-only">
{sggName} 재현기간 및 강우지속시간별 확률강우량(mm) {targetName} 재현기간 및 강우지속시간별 확률강우량(mm)
</caption> </caption>
<thead className="sticky top-0 z-10 bg-muted text-foreground"> <thead className="sticky top-0 z-10 bg-muted text-foreground">
<tr> <tr>
@@ -182,7 +272,7 @@ export default function PrbbtRnflDialog({
</div> </div>
<div className="shrink-0 space-y-2"> <div className="shrink-0 space-y-2">
<h3 className="text-xl font-semibold">확률관측소 면적비율</h3> <h3 className="text-xl font-semibold">{stationTableTitle}</h3>
<div className="max-h-[16rem] overflow-auto rounded-md border border-border"> <div className="max-h-[16rem] overflow-auto rounded-md border border-border">
<table className="w-full border-collapse text-lg"> <table className="w-full border-collapse text-lg">
<thead className="bg-muted text-foreground"> <thead className="bg-muted text-foreground">
@@ -31,9 +31,16 @@ type ApiRow = {
ctpvCd: string; ctpvCd: string;
ctpvNm: string; ctpvNm: string;
sggNm: string; sggNm: string;
/** 관측소 기준(새 로직) 분석 행의 관측지점코드다. 기존 시군구 면적가중 행은 null이다. */
obsrvnBrnchCd: string | null;
/** `/prst` 조회 때 시군구-관측소 매핑에서 붙인 관측소명이다. 기존 로직 행이나 매핑에 없는 조합은 null이다. */
obsrvnBrnchNm: string | null;
/** 시군구 면적 중 관측소 영역의 비율(%)이다. 기존 로직 행이나 매핑에 없는 조합은 null이다. */
areaRt: number | null;
rainBeginningDateTime: string; rainBeginningDateTime: string;
analysisDateTime: string; analysisDateTime: string;
observedAccumulatedRainfall: number | null; observedAccumulatedRainfall: number | null;
/** 분석시각 기준 대표 예측시간이다. 관측소 기준 행의 0은 대표값이 분석시각(관측 누적)이라는 뜻이다. */
predictionHour: number | null; predictionHour: number | null;
predcRainHr: number | null; predcRainHr: number | null;
predictedAccumulatedRainfall: number | null; predictedAccumulatedRainfall: number | null;
@@ -46,6 +53,10 @@ type TableRow = ApiRow &
rowNo: number; rowNo: number;
analysisDateTimeDisplay: string; analysisDateTimeDisplay: string;
rainBeginningDateTimeDisplay: string; rainBeginningDateTimeDisplay: string;
/** 관측소 열 표시값이다. 관측소명이 없으면 `-`이다. */
obsrvnBrnchNmDisplay: string;
/** 면적비율(%) 열 표시값이다. 소수 둘째 자리까지, 값이 없으면 `-`이다. */
areaRtDisplay: string;
observedAccumulatedRainfallDisplay: string; observedAccumulatedRainfallDisplay: string;
predictionHourDisplay: string; predictionHourDisplay: string;
predictedAccumulatedRainfallDisplay: string; predictedAccumulatedRainfallDisplay: string;
@@ -76,47 +87,61 @@ const toFloodMapFrequencyCode = (value: number) => {
return String(normalized).padStart(3, "0"); return String(normalized).padStart(3, "0");
}; };
/**
* 침수예측현황 목록 열 정의다.
* 시군구 뒤에 관측소 기준 분석의 관측소·면적비율 열을 두고, 13개 열의 widthPercent 합은 100으로 맞춘다.
*/
const HEADS: UiHeadProps[] = [ const HEADS: UiHeadProps[] = [
{ id: "rowNo", title: "순번", widthPercent: 5 }, { id: "rowNo", title: "순번", widthPercent: 4 },
{ id: "ctpvNm", title: "시도", widthPercent: 7 }, { id: "ctpvNm", title: "시도", widthPercent: 7 },
{ id: "sggNm", title: "시군구", widthPercent: 8 }, { id: "sggNm", title: "시군구", widthPercent: 8 },
{ id: "obsrvnBrnchNmDisplay", title: "관측소", widthPercent: 7 },
{
id: "areaRtDisplay",
title: "면적비율(%)",
widthPercent: 6,
align: "right",
},
{ {
id: "analysisDateTimeDisplay", id: "analysisDateTimeDisplay",
title: "분석시각", title: "분석시각",
widthPercent: 13, widthPercent: 11,
}, },
{ {
id: "rainBeginningDateTimeDisplay", id: "rainBeginningDateTimeDisplay",
title: "강우시작시각", title: "강우시작시각",
widthPercent: 13, widthPercent: 11,
}, },
{ {
id: "observedAccumulatedRainfallDisplay", id: "observedAccumulatedRainfallDisplay",
title: "관측 누적강수량(mm)", title: "관측 누적강수량(mm)",
widthPercent: 11, widthPercent: 9,
align: "right", align: "right",
}, },
{ {
id: "predictionHourDisplay", id: "predictionHourDisplay",
title: "예측시간", title: "예측시간",
widthPercent: 7, widthPercent: 6,
}, },
{ {
id: "predictedAccumulatedRainfallDisplay", id: "predictedAccumulatedRainfallDisplay",
title: "예측 누적강수량(mm)", title: "예측 누적강수량(mm)",
widthPercent: 12, widthPercent: 9,
align: "right", align: "right",
}, },
{ {
id: "exceededFrequencyYearDisplay", id: "exceededFrequencyYearDisplay",
title: "초과 빈도(년)", title: "초과 빈도(년)",
widthPercent: 8, widthPercent: 7,
align: "right", align: "right",
}, },
{ id: "floodRiskGrade", title: "침수위험도", widthPercent: 8 }, { id: "floodRiskGrade", title: "침수위험도", widthPercent: 7 },
{ id: "probabilityRainfallDisplay", title: "확률강우량", widthPercent: 8 }, { id: "probabilityRainfallDisplay", title: "확률강우량", widthPercent: 8 },
]; ];
/** 관측소·면적비율 열이 더해진 목록의 최소 표 너비다. 기본 팝업 너비(1280px)에서는 가로 스크롤 없이 보이도록 잡는다. */
const LIST_MIN_TABLE_WIDTH = "118rem";
/** 날짜·시각의 뒷부분이 잘리지 않도록 전체 표시할 목록 열이다. */ /** 날짜·시각의 뒷부분이 잘리지 않도록 전체 표시할 목록 열이다. */
const FULL_TEXT_TIME_HEAD_IDS = [ const FULL_TEXT_TIME_HEAD_IDS = [
"analysisDateTimeDisplay", "analysisDateTimeDisplay",
@@ -157,6 +182,34 @@ const predictionHourText = (value: number | null) => {
return hour > 0 ? `${hour}시간 후` : "-"; return hour > 0 ? `${hour}시간 후` : "-";
}; };
/** 관측지점코드가 있으면 관측소 기준(새 로직) 분석 행이다. 기준표 API·표시 문구를 고를 때 쓴다. */
const isObsvtrRow = (row: Pick<ApiRow, "obsrvnBrnchCd">) =>
Boolean(row.obsrvnBrnchCd);
/**
* 목록 예측시간 열의 표시문구를 정한다.
* 관측소 기준 행의 예측시간 0은 대표값이 분석시각(관측 누적)이라는 뜻이므로 `0시간 후`로 보인다.
* 그 밖의 행은 기존 `predictionHourText` 규칙(0 이하 `-`)을 그대로 따른다.
*/
const predictionHourDisplayText = (
row: Pick<ApiRow, "predictionHour" | "obsrvnBrnchCd">,
) =>
isObsvtrRow(row) && row.predictionHour === 0
? "0시간 후"
: predictionHourText(row.predictionHour);
/**
* 확률강우량 기준표 버튼 aria-label과 모달 제목에 쓸 대상 이름이다.
* 관측소 기준 행은 관측소명(목록 → 기준표 응답 → 관측지점코드 순으로 대체), 기존 행은 시군구명을 쓴다.
*/
const probabilityTargetName = (
row: Pick<ApiRow, "obsrvnBrnchCd" | "obsrvnBrnchNm" | "sggNm">,
responseStationName?: string,
) =>
isObsvtrRow(row)
? row.obsrvnBrnchNm || responseStationName || row.obsrvnBrnchCd || ""
: row.sggNm;
/** 분석 결과의 대표 누적강우시간을 확률강우량 기준표 링크 문구로 표시한다. */ /** 분석 결과의 대표 누적강우시간을 확률강우량 기준표 링크 문구로 표시한다. */
const probabilityDurationText = (value: number | null) => { const probabilityDurationText = (value: number | null) => {
const hour = Number(value); const hour = Number(value);
@@ -291,11 +344,14 @@ export default function FldngPredcPrstPopupContent() {
rainBeginningDateTimeDisplay: displayDate( rainBeginningDateTimeDisplay: displayDate(
item.rainBeginningDateTime, item.rainBeginningDateTime,
), ),
// 기존 로직 행(관측지점코드 null)이나 매핑에 없는 조합은 관측소·면적비율을 `-`로 보인다.
obsrvnBrnchNmDisplay: item.obsrvnBrnchNm || "-",
areaRtDisplay: formatNumber(item.areaRt, 2),
observedAccumulatedRainfallDisplay: formatNumber( observedAccumulatedRainfallDisplay: formatNumber(
item.observedAccumulatedRainfall, item.observedAccumulatedRainfall,
1, 1,
), ),
predictionHourDisplay: predictionHourText(item.predictionHour), predictionHourDisplay: predictionHourDisplayText(item),
predictedAccumulatedRainfallDisplay: formatNumber( predictedAccumulatedRainfallDisplay: formatNumber(
item.predictedAccumulatedRainfall, item.predictedAccumulatedRainfall,
1, 1,
@@ -417,9 +473,19 @@ export default function FldngPredcPrstPopupContent() {
} }
}; };
/** 선택 시군구의 확률강우량과 관측소 비율을 조회한다. 지도 행 클릭은 버튼에서 차단한다. */ /**
* 선택 행의 확률강우량과 관측소 비율을 조회한다. 지도 행 클릭은 버튼에서 차단한다.
* 관측지점코드가 있는 관측소 기준 행은 판정에 쓴 최근접 확률관측소 기준표(`/prst/prbbt-rnfl/obsvtr`)를,
* 기존 시군구 기준 행은 지금처럼 시군구 면적가중 기준표(`/prst/prbbt-rnfl`)를 부른다.
*/
const handleProbabilityClick = async (row: TableRow) => { const handleProbabilityClick = async (row: TableRow) => {
if (!row.sggCd || !Number.isInteger(Number(row.predcRainHr)) || Number(row.predcRainHr) <= 0) { // 관측소 기준 행이면 조회에 쓸 관측지점코드, 기존 행이면 null이다.
const obsrvnBrnchCd = row.obsrvnBrnchCd || null;
if (
(!obsrvnBrnchCd && !row.sggCd) ||
!Number.isInteger(Number(row.predcRainHr)) ||
Number(row.predcRainHr) <= 0
) {
return; return;
} }
const requestId = ++probabilityRequestIdRef.current; const requestId = ++probabilityRequestIdRef.current;
@@ -428,16 +494,22 @@ export default function FldngPredcPrstPopupContent() {
setProbabilityError(null); setProbabilityError(null);
setProbabilityLoading(true); setProbabilityLoading(true);
try { try {
const params = new URLSearchParams({ sggCd: row.sggCd }); // 행 종류에 맞는 기준표 API 주소다. 기존 시군구 기준 행은 이전과 같은 sggCd 쿼리를 쓴다.
const response = await getRawJson( const requestUrl = obsrvnBrnchCd
`/sewerage-service/api/v1/fldng/predc/prst/prbbt-rnfl?${params.toString()}`, ? `/sewerage-service/api/v1/fldng/predc/prst/prbbt-rnfl/obsvtr?${new URLSearchParams({ obsrvnBrnchCd }).toString()}`
); : `/sewerage-service/api/v1/fldng/predc/prst/prbbt-rnfl?${new URLSearchParams({ sggCd: row.sggCd }).toString()}`;
const response = await getRawJson(requestUrl);
if (requestId !== probabilityRequestIdRef.current) return; if (requestId !== probabilityRequestIdRef.current) return;
const payload: PrbbtRnflResponse = response?.data ?? response; const payload: PrbbtRnflResponse = response?.data ?? response;
setProbabilityData(payload); setProbabilityData(payload);
} catch (error) { } catch (error) {
if (requestId !== probabilityRequestIdRef.current) return; if (requestId !== probabilityRequestIdRef.current) return;
console.error("시군구 확률강우량 조회 중 오류:", error); console.error(
obsrvnBrnchCd
? "관측소 확률강우량 조회 중 오류:"
: "시군구 확률강우량 조회 중 오류:",
error,
);
setProbabilityError("확률강우량 기준표를 조회하지 못했습니다."); setProbabilityError("확률강우량 기준표를 조회하지 못했습니다.");
} finally { } finally {
if (requestId === probabilityRequestIdRef.current) { if (requestId === probabilityRequestIdRef.current) {
@@ -479,6 +551,7 @@ export default function FldngPredcPrstPopupContent() {
getItems: (response) => response.content, getItems: (response) => response.content,
getTotal: (response) => response.totalElements, getTotal: (response) => response.totalElements,
}); });
// API 원본 행을 그대로 넘겨 관측지점코드·관측소명·면적비율도 Excel 헬퍼에서 함께 쓴다.
await downloadFloodPredictionStatusExcel(result.items); await downloadFloodPredictionStatusExcel(result.items);
} catch (error) { } catch (error) {
console.error("침수예측현황 Excel 다운로드 중 오류:", error); console.error("침수예측현황 Excel 다운로드 중 오류:", error);
@@ -659,7 +732,7 @@ export default function FldngPredcPrstPopupContent() {
<button <button
type="button" type="button"
className="font-medium text-primary underline underline-offset-2 hover:opacity-75 focus-visible:rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary" className="font-medium text-primary underline underline-offset-2 hover:opacity-75 focus-visible:rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
aria-label={`${row.sggNm} ${row.probabilityRainfallDisplay} 확률강우량 기준표 보기`} aria-label={`${probabilityTargetName(row)} ${row.probabilityRainfallDisplay} 확률강우량 기준표 보기`}
onClick={(event) => { onClick={(event) => {
event.stopPropagation(); event.stopPropagation();
void handleProbabilityClick(row); void handleProbabilityClick(row);
@@ -671,7 +744,7 @@ export default function FldngPredcPrstPopupContent() {
) : undefined ) : undefined
} }
scrollMode="horizontal" scrollMode="horizontal"
minTableWidth="112rem" minTableWidth={LIST_MIN_TABLE_WIDTH}
fullTextHeadIds={FULL_TEXT_TIME_HEAD_IDS} fullTextHeadIds={FULL_TEXT_TIME_HEAD_IDS}
fillAvailableHeight={rows.length === 0} fillAvailableHeight={rows.length === 0}
emptyMessage="조회 조건에 해당하는 침수예측현황이 없습니다." emptyMessage="조회 조건에 해당하는 침수예측현황이 없습니다."
@@ -706,7 +779,17 @@ export default function FldngPredcPrstPopupContent() {
<PrbbtRnflDialog <PrbbtRnflDialog
open={probabilityRow !== null} open={probabilityRow !== null}
onOpenChange={handleProbabilityOpenChange} onOpenChange={handleProbabilityOpenChange}
sggName={probabilityRow?.sggNm ?? ""} targetName={
probabilityRow
? probabilityTargetName(
probabilityRow,
probabilityData?.obsrvnBrnchNm,
)
: ""
}
targetKind={
probabilityRow && isObsvtrRow(probabilityRow) ? "obsvtr" : "sgg"
}
selectedDurationHour={probabilityRow?.predcRainHr ?? null} selectedDurationHour={probabilityRow?.predcRainHr ?? null}
selectedFrequencyYear={probabilityRow?.exceededFrequencyYear ?? null} selectedFrequencyYear={probabilityRow?.exceededFrequencyYear ?? null}
data={probabilityData} data={probabilityData}
+28
View File
@@ -0,0 +1,28 @@
FROM node:20-alpine
# pnpm 설치
RUN corepack enable && corepack prepare pnpm@8.15.5 --activate
WORKDIR /app
# 모든 소스 복사
COPY . .
# .env.production 파일 생성
RUN mkdir -p /app/apps/st && \
echo "NODE_ENV=production" > /app/apps/st/.env.production && \
echo "PORT=3000" >> /app/apps/st/.env.production && \
echo "NEXT_PUBLIC_PORT=3000" >> /app/apps/st/.env.production && \
echo "SERVER_API_URL=http://dev.onasys.co.kr:8000" >> /app/apps/st/.env.production && \
echo "NEXT_PUBLIC_PROXY_HOST=https://st.apps.rsonesoft.com" >> /app/apps/st/.env.production && \
echo "NEXT_PUBLIC_TINY_API_KEY=t9nc4z6inquvvd5pq1vea8wcp7lb01qmqseh6egms9vpaju2" >> /app/apps/st/.env.production && \
echo "NEXT_PUBLIC_ST_SERVICE_URL=https://apigateway.apps.rsonesoft.com" >> /app/apps/st/.env.production && \
echo "NEXT_PUBLIC_ST_REALGRID_KEY=upVcPE+wPOmtLjqyBIh9RkM/nBOseBrflwxYpzGZyYnkTzf7Gmn/c+YNYZY36ZjDHoLUQjrb+Zx6JscIKXc6ti45WUEqxvh/kkzVSHLUHquykNuBw5QDg+AQvETEhgujkdwMl8bfXmKFzr6UT9cAmQ==" >> /app/apps/st/.env.production && \
echo "NEXT_PUBLIC_SITE_ID=ST" >> /app/apps/st/.env.production
RUN pnpm install --filter=st...
RUN pnpm build --filter=st...
EXPOSE 3000
CMD ["sh", "-c", "pnpm --filter st start & wait"]
+34 -32
View File
@@ -33,6 +33,7 @@ import {
hasAdmdstCdColumn, hasAdmdstCdColumn,
isExcelImportAdmdstCdInvalid, isExcelImportAdmdstCdInvalid,
mergeExcelImportWithExistingRows, mergeExcelImportWithExistingRows,
parseExcelImportCellValue,
prepareGridColumnsForExcelExport, prepareGridColumnsForExcelExport,
releaseFixedOptionsForExcelExport, releaseFixedOptionsForExcelExport,
resolveColumnStyleName, resolveColumnStyleName,
@@ -289,14 +290,28 @@ type GridViewWithSetColumnProperty = {
}; };
type GridViewWithEditOptions = { type GridViewWithEditOptions = {
setEditOptions?: (options: { commitWhenLeave?: boolean }) => void; setEditOptions?: (options: {
commitWhenLeave?: boolean;
appendable?: boolean;
insertable?: boolean;
}) => void;
setPasteOptions?: (options: { enableAppend?: boolean }) => void;
}; };
/** 포커스가 그리드 밖으로 나갈 때 편집 중인 값을 자동 commit */ /** 포커스가 그리드 밖으로 나갈 때 편집 중인 값을 자동 commit */
function applyDefaultGridEditOptions( function applyDefaultGridEditOptions(
gridView: GridViewWithEditOptions | null | undefined, gridView: GridViewWithEditOptions | null | undefined,
options?: { preventRowAppend?: boolean },
) { ) {
gridView?.setEditOptions?.({ commitWhenLeave: true }); gridView?.setEditOptions?.({
commitWhenLeave: true,
...(options?.preventRowAppend
? { appendable: false, insertable: false }
: {}),
});
if (options?.preventRowAppend) {
gridView?.setPasteOptions?.({ enableAppend: false });
}
} }
function isDateEditorColumn(column: { function isDateEditorColumn(column: {
@@ -853,6 +868,7 @@ const DataGrid = ({
gridHeight = 55, // vh 단위 gridHeight = 55, // vh 단위
headerHeight = 60, headerHeight = 60,
fitStyle = GridFitStyle.EVEN, fitStyle = GridFitStyle.EVEN,
preventRowAppend = true,
}: DataGridProps) => { }: DataGridProps) => {
const { columns, columnLayout } = columnInfo; const { columns, columnLayout } = columnInfo;
const fixedColumnNameSet = useMemo( const fixedColumnNameSet = useMemo(
@@ -1331,6 +1347,11 @@ useEffect(() => {
columnLayout, columnLayout,
{ skipNonEditable: false }, { skipNonEditable: false },
); );
const valueTypeByFieldName = new Map(
columns
.filter((c) => c.fieldName)
.map((c) => [c.fieldName as string, c.valueType]),
);
// 데이터 행 읽기 // 데이터 행 읽기
const dataRows: Record<string, string | number>[] = []; const dataRows: Record<string, string | number>[] = [];
@@ -1352,36 +1373,13 @@ useEffect(() => {
]; ];
const fieldName = excelColumnFieldNames[colIndex]; const fieldName = excelColumnFieldNames[colIndex];
const allFieldName = excelColumnFieldNamesAll[colIndex]; const allFieldName = excelColumnFieldNamesAll[colIndex];
const typeFieldName = fieldName || allFieldName;
let cellValue: string | number = ""; const cellValue = parseExcelImportCellValue(
if ( cell,
cell && typeFieldName
cell.v !== undefined && ? valueTypeByFieldName.get(typeFieldName)
cell.v !== null : undefined,
) {
// 엑셀 셀 타입이 숫자이거나 값이 숫자인 경우 숫자로 변환
if (
cell.t === "n" ||
(typeof cell.v === "number" &&
!isNaN(cell.v))
) {
cellValue = cell.v as number;
} else {
const stringValue = String(cell.v);
// 문자열이지만 숫자로 변환 가능한 경우 숫자로 변환
const numericValue = Number(
stringValue.replace(/,/g, ""),
); );
if (
!isNaN(numericValue) &&
stringValue.trim() !== ""
) {
cellValue = numericValue;
} else {
cellValue = stringValue;
}
}
}
if (allFieldName === "admdstCd" && cellValue !== "") { if (allFieldName === "admdstCd" && cellValue !== "") {
rowAdmdstCd = cellValue; rowAdmdstCd = cellValue;
@@ -1467,7 +1465,9 @@ useEffect(() => {
const scheduleFooterTask = (task: () => void, delayMs: number) => { const scheduleFooterTask = (task: () => void, delayMs: number) => {
footerTimerIds.push(setTimeout(task, delayMs)); footerTimerIds.push(setTimeout(task, delayMs));
}; };
applyDefaultGridEditOptions(gridView as GridViewWithEditOptions); applyDefaultGridEditOptions(gridView as GridViewWithEditOptions, {
preventRowAppend,
});
const columnsFieldsSig = columns.map((c) => c.fieldName).join("\u0001"); const columnsFieldsSig = columns.map((c) => c.fieldName).join("\u0001");
if (columnsFieldsSig !== columnsFieldsSigRef.current) { if (columnsFieldsSig !== columnsFieldsSigRef.current) {
@@ -1990,6 +1990,7 @@ useEffect(() => {
fitStyle, fitStyle,
enableSort, enableSort,
footerVerificationResult, footerVerificationResult,
preventRowAppend,
]); ]);
// 행·셀 클릭 이벤트 (검증 오류 툴팁은 hover만 — onShowTooltip / 빈 셀 오버레이) // 행·셀 클릭 이벤트 (검증 오류 툴팁은 hover만 — onShowTooltip / 빈 셀 오버레이)
@@ -2527,6 +2528,7 @@ useEffect(() => {
const gridView = gridRef.current?.gridView ?? grid; const gridView = gridRef.current?.gridView ?? grid;
applyDefaultGridEditOptions( applyDefaultGridEditOptions(
gridView as GridViewWithEditOptions, gridView as GridViewWithEditOptions,
{ preventRowAppend },
); );
if (!gridView?.columnByName) return; if (!gridView?.columnByName) return;
setTimeout(() => { setTimeout(() => {
@@ -695,20 +695,6 @@ const SidoSggFacilityNameSearchForm = ({
</div> </div>
)} )}
<div className="flex w-full min-w-0 items-stretch gap-[1.2rem]"> <div className="flex w-full min-w-0 items-stretch gap-[1.2rem]">
<div className="flex min-w-0 flex-1 flex-col gap-2">
<h3 className="text-[1.4rem] font-medium text-foreground">
처리시설 정보
</h3>
<CompactDataGrid
columnInfo={treatmentFacilityColumnInfo}
rowData={treatmentFacilityRows}
setRowData={setTreatmentFacilityRows}
showHeaderCheckbox={false}
compactFullWidth
onRowClick={handleTreatmentFacilityRowClick}
// compactGridHeightClass="h-[min(40vh,28rem)] min-h-[16rem]"
/>
</div>
<div className="flex min-w-0 flex-1 flex-col gap-2"> <div className="flex min-w-0 flex-1 flex-col gap-2">
<div className="flex items-center justify-between gap-2"> <div className="flex items-center justify-between gap-2">
<h3 className="text-[1.4rem] font-medium text-foreground"> <h3 className="text-[1.4rem] font-medium text-foreground">
@@ -726,6 +712,20 @@ const SidoSggFacilityNameSearchForm = ({
// compactGridHeightClass="h-[min(40vh,28rem)] min-h-[16rem]" // compactGridHeightClass="h-[min(40vh,28rem)] min-h-[16rem]"
/> />
</div> </div>
<div className="flex min-w-0 flex-1 flex-col gap-2">
<h3 className="text-[1.4rem] font-medium text-foreground">
처리시설 정보
</h3>
<CompactDataGrid
columnInfo={treatmentFacilityColumnInfo}
rowData={treatmentFacilityRows}
setRowData={setTreatmentFacilityRows}
showHeaderCheckbox={false}
compactFullWidth
onRowClick={handleTreatmentFacilityRowClick}
// compactGridHeightClass="h-[min(40vh,28rem)] min-h-[16rem]"
/>
</div>
</div> </div>
</div> </div>
); );
+13 -17
View File
@@ -53,6 +53,7 @@ import {
hasAdmdstCdColumn, hasAdmdstCdColumn,
isExcelImportAdmdstCdInvalid, isExcelImportAdmdstCdInvalid,
mergeExcelImportWithExistingRows, mergeExcelImportWithExistingRows,
parseExcelImportCellValue,
prepareGridColumnsForExcelExport, prepareGridColumnsForExcelExport,
releaseFixedOptionsForExcelExport, releaseFixedOptionsForExcelExport,
resolveColumnStyleName, resolveColumnStyleName,
@@ -611,6 +612,11 @@ const TabDataGrid = ({
columnLayout, columnLayout,
{ skipNonEditable: false }, { skipNonEditable: false },
); );
const valueTypeByFieldName = new Map(
columns
.filter((c) => c.fieldName)
.map((c) => [c.fieldName as string, c.valueType]),
);
// 데이터 행 읽기 // 데이터 행 읽기
const dataRows: Record<string, string | number>[] = []; const dataRows: Record<string, string | number>[] = [];
@@ -625,23 +631,13 @@ const TabDataGrid = ({
const cell = worksheet[XLSX.utils.encode_cell({ r: row, c: col })]; const cell = worksheet[XLSX.utils.encode_cell({ r: row, c: col })];
const fieldName = excelColumnFieldNames[colIndex]; const fieldName = excelColumnFieldNames[colIndex];
const allFieldName = excelColumnFieldNamesAll[colIndex]; const allFieldName = excelColumnFieldNamesAll[colIndex];
const typeFieldName = fieldName || allFieldName;
let cellValue: string | number = ''; const cellValue = parseExcelImportCellValue(
if (cell && cell.v !== undefined && cell.v !== null) { cell,
// 엑셀 셀 타입이 숫자이거나 값이 숫자인 경우 숫자로 변환 typeFieldName
if (cell.t === 'n' || (typeof cell.v === 'number' && !isNaN(cell.v))) { ? valueTypeByFieldName.get(typeFieldName)
cellValue = cell.v as number; : undefined,
} else { );
const stringValue = String(cell.v);
// 문자열이지만 숫자로 변환 가능한 경우 숫자로 변환
const numericValue = Number(stringValue.replace(/,/g, ''));
if (!isNaN(numericValue) && stringValue.trim() !== '') {
cellValue = numericValue;
} else {
cellValue = stringValue;
}
}
}
if (allFieldName === 'admdstCd' && cellValue !== '') { if (allFieldName === 'admdstCd' && cellValue !== '') {
rowAdmdstCd = cellValue; rowAdmdstCd = cellValue;
@@ -16,10 +16,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation"; import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation"; import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { statisticsInputExcretaTreatmentFacilityApi } from "@/entities/statistics/api/input/statistics-input-excreta-treatment-facility-service"; import { statisticsInputExcretaTreatmentFacilityApi } from "@/entities/statistics/api/input/statistics-input-excreta-treatment-facility-service";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import { import {
EXCRETA_TREATMENT_FACILITY_STATS_CD, EXCRETA_TREATMENT_FACILITY_STATS_CD,
type ExcretaTreatmentFacilityItem, type ExcretaTreatmentFacilityItem,
@@ -75,7 +77,11 @@ import { toGridRows } from "@/components/util/grid/gridFunction";
import { formatCompactYmdForGrid, toCompactYmdOrNull } from "@/components/util/grid/ymdFormat"; import { formatCompactYmdForGrid, toCompactYmdOrNull } from "@/components/util/grid/ymdFormat";
import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport"; import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport";
import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag"; import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -139,8 +145,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -207,7 +212,7 @@ function mapExcretaTreatmentFacilityListToGridRows(
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (item.verificationResult) { if (item.verificationResult) {
row.verificationResult = item.verificationResult; row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
} }
return row; return row;
}); });
@@ -439,7 +444,11 @@ const ExcretaTreatmentFacilityInp = () => {
return { ...col, editable: false as const }; return { ...col, editable: false as const };
} }
if (col.fieldName === "sggNm" && enterable) { if (col.fieldName === "sggNm" && enterable) {
return buildSggNmColumn(col, true, sggOptions); return buildSggNmColumn(
col,
true,
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
);
} }
return col; return col;
}) })
@@ -452,7 +461,7 @@ const ExcretaTreatmentFacilityInp = () => {
columns, columns,
columnLayout: ExcretaTreatFactInpColumn.columnLayout ?? [], columnLayout: ExcretaTreatFactInpColumn.columnLayout ?? [],
}; };
}, [statusInfo, inputPeriodEnterable, isAdminInfo, sggOptions, columnGuidesByEngCol]); }, [statusInfo, inputPeriodEnterable, isAdminInfo, sggOptions, lastSearchedValues?.gugun, columnGuidesByEngCol]);
const canEditGrid = const canEditGrid =
(computeTabEnterable(statusInfo, inputPeriodEnterable) || isAdminInfo) && inputPeriodEnterable; (computeTabEnterable(statusInfo, inputPeriodEnterable) || isAdminInfo) && inputPeriodEnterable;
@@ -502,7 +511,9 @@ const ExcretaTreatmentFacilityInp = () => {
setStatusInfo(nextStatusInfo); setStatusInfo(nextStatusInfo);
setStatsCd(commonInfo.statsCd); setStatsCd(commonInfo.statsCd);
setIsVerificationFailed(isVerificationFailedFromCommonInfo(commonInfo)); setIsVerificationFailed(isVerificationFailedFromCommonInfo(commonInfo));
setFooterVerificationResult(commonInfo.verificationResult ?? null); setFooterVerificationResult(
normalizeVerificationResultMap(commonInfo.verificationResult) ?? null,
);
if (overrides?.mode !== "PRE") { if (overrides?.mode !== "PRE") {
setIsNotApplicable(gridRows.length === 0); setIsNotApplicable(gridRows.length === 0);
} else if (gridRows.length > 0) { } else if (gridRows.length > 0) {
@@ -813,7 +824,13 @@ const ExcretaTreatmentFacilityInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForSubmit,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: statusInfo?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -952,19 +969,7 @@ const ExcretaTreatmentFacilityInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 -";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1043,7 +1048,7 @@ const ExcretaTreatmentFacilityInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{statusInfo?.lclgvSbmsnSttsCd === "2" && submitOk && ( {statusInfo?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -9,6 +9,7 @@ import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { statisticsInputPrivateSewageFacilityApi } from "@/entities/statistics/api/input/statistics-input-private-sewage-facility-service"; import { statisticsInputPrivateSewageFacilityApi } from "@/entities/statistics/api/input/statistics-input-private-sewage-facility-service";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import type { import type {
PrivateSewageDesigStatusItem, PrivateSewageDesigStatusItem,
PrivateSewageDesigStatusSaveItem, PrivateSewageDesigStatusSaveItem,
@@ -68,7 +69,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -156,8 +161,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -175,7 +179,9 @@ function mapRegionalListToGridRows<
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => { return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
const { verificationResult, ...rest } = item; const { verificationResult, ...rest } = item;
const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification; const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -888,7 +894,13 @@ const PrivateSewageFacilityInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1144,18 +1156,7 @@ const PrivateSewageFacilityInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 - ";
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1198,7 +1199,7 @@ const PrivateSewageFacilityInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -8,6 +8,7 @@ import { useStatisticsInputPendingNavigation } from '@/shared/lib/use-statistics
import { statisticsInputSewSupplyRateApi } from '@/entities/statistics/api/input/statistics-input-sew-supply-rate-service'; import { statisticsInputSewSupplyRateApi } from '@/entities/statistics/api/input/statistics-input-sew-supply-rate-service';
import { statisticsInputPublicSewageFacilityApiService } from '@/entities/statistics/api/input/statistics-public-sewage-facility-input-service'; import { statisticsInputPublicSewageFacilityApiService } from '@/entities/statistics/api/input/statistics-public-sewage-facility-input-service';
import { statisticsApi } from '@/entities/statistics/api/statistics-service'; import { statisticsApi } from '@/entities/statistics/api/statistics-service';
import { callImrServiceWithRollbackOnFailure } from '@/components/util/input/call-imr-with-rollback';
import type { import type {
PublicSewageFacilityRequestParams, PublicSewageFacilityRequestParams,
PublicSewageFacilitySaveItem, PublicSewageFacilitySaveItem,
@@ -52,7 +53,11 @@ import { fetchColumnGuidesRecord } from '@/components/util/grid/columnGuides';
import { toGridRows } from '@/components/util/grid/gridFunction'; import { toGridRows } from '@/components/util/grid/gridFunction';
import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport"; import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport";
import { patchFooterVerificationByTab,patchVerificationFailedByTab } from '@/components/util/input/verification-failed-flag'; import { patchFooterVerificationByTab,patchVerificationFailedByTab } from '@/components/util/input/verification-failed-flag';
import type { VerificationResultLikeMap } from '@/components/util/input/verification-result-display'; import {
formatVerificationTooltip,
withNormalizedVerificationResult,
type VerificationResultLikeMap,
} from '@/components/util/input/verification-result-display';
import { nullableTrimmedString } from '@/components/util/input/nullableString'; import { nullableTrimmedString } from '@/components/util/input/nullableString';
import { useAdminStore } from '@/store/admin-store'; import { useAdminStore } from '@/store/admin-store';
import { useTabStore } from '@/store/tab-store'; import { useTabStore } from '@/store/tab-store';
@@ -116,8 +121,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -438,7 +442,13 @@ const PublicSewageFacilityInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? '',
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? '',
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? '',
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -789,11 +799,13 @@ const PublicSewageFacilityInp = () => {
sidoListRef.current, sidoListRef.current,
searchContext, searchContext,
); );
const convertedData = list.map((item) => ({ const convertedData = list.map((item) =>
withNormalizedVerificationResult({
ctpvNm: commonInfo.ctpvNm, ctpvNm: commonInfo.ctpvNm,
...item, ...item,
rmrk: item.rmrk ?? null, rmrk: item.rmrk ?? null,
})); }),
);
if (list.length === 0) { if (list.length === 0) {
setShowIsNotApplicable(true); setShowIsNotApplicable(true);
@@ -1323,7 +1335,7 @@ const PublicSewageFacilityInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{!isMainFacilityTab && activeTabStatus?.lclgvSbmsnSttsCd === '2' && submitOk && ( {!isMainFacilityTab && activeTabStatus?.lclgvSbmsnSttsCd === '2' && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -1575,17 +1587,7 @@ const PublicSewageFacilityInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR" ? "시계열 검증 - " : (e.vrfcCd === "NV" ? "일반검증 - " : "모집단 검증 - ");
const comp = e.cmprCn ?? "";
const now = e.nowCn ?? "";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${comp} / 현재 입력값: ${now})`;
})
.filter(Boolean)
.join("\n");
} }
}} }}
/> />
@@ -16,10 +16,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation"; import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation"; import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { statisticsInputPumpingStationApi } from "@/entities/statistics/api/input/statistics-input-pumping-station-service"; import { statisticsInputPumpingStationApi } from "@/entities/statistics/api/input/statistics-input-pumping-station-service";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import { import {
PUMPING_STATION_STATS_CD, PUMPING_STATION_STATS_CD,
type PumpingStationItem, type PumpingStationItem,
@@ -75,7 +77,11 @@ import { toGridRows } from "@/components/util/grid/gridFunction";
import { formatCompactYmdForGrid, toCompactYmdOrNull } from "@/components/util/grid/ymdFormat"; import { formatCompactYmdForGrid, toCompactYmdOrNull } from "@/components/util/grid/ymdFormat";
import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport"; import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport";
import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag"; import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -139,8 +145,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -206,7 +211,7 @@ function mapPumpingStationListToGridRows(
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (item.verificationResult) { if (item.verificationResult) {
row.verificationResult = item.verificationResult; row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
} }
return row; return row;
}); });
@@ -433,7 +438,11 @@ const PumpingStationInp = () => {
return { ...col, editable: false as const }; return { ...col, editable: false as const };
} }
if (col.fieldName === "sggNm" && enterable) { if (col.fieldName === "sggNm" && enterable) {
return buildSggNmColumn(col, true, sggOptions); return buildSggNmColumn(
col,
true,
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
);
} }
return col; return col;
}) })
@@ -446,7 +455,7 @@ const PumpingStationInp = () => {
columns, columns,
columnLayout: PumpingStationInpColumn.columnLayout ?? [], columnLayout: PumpingStationInpColumn.columnLayout ?? [],
}; };
}, [statusInfo, inputPeriodEnterable, isAdminInfo, sggOptions, columnGuidesByEngCol]); }, [statusInfo, inputPeriodEnterable, isAdminInfo, sggOptions, lastSearchedValues?.gugun, columnGuidesByEngCol]);
const canEditGrid = const canEditGrid =
(computeTabEnterable(statusInfo, inputPeriodEnterable) || isAdminInfo) && inputPeriodEnterable; (computeTabEnterable(statusInfo, inputPeriodEnterable) || isAdminInfo) && inputPeriodEnterable;
@@ -493,7 +502,9 @@ const PumpingStationInp = () => {
setStatusInfo(nextStatusInfo); setStatusInfo(nextStatusInfo);
setStatsCd(commonInfo.statsCd); setStatsCd(commonInfo.statsCd);
setIsVerificationFailed(isVerificationFailedFromCommonInfo(commonInfo)); setIsVerificationFailed(isVerificationFailedFromCommonInfo(commonInfo));
setFooterVerificationResult(commonInfo.verificationResult ?? null); setFooterVerificationResult(
normalizeVerificationResultMap(commonInfo.verificationResult) ?? null,
);
if (overrides?.mode !== "PRE") { if (overrides?.mode !== "PRE") {
setIsNotApplicable(gridRows.length === 0); setIsNotApplicable(gridRows.length === 0);
} else if (gridRows.length > 0) { } else if (gridRows.length > 0) {
@@ -796,7 +807,13 @@ const PumpingStationInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForSubmit,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: statusInfo?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -935,19 +952,7 @@ const PumpingStationInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 -";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1026,7 +1031,7 @@ const PumpingStationInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{statusInfo?.lclgvSbmsnSttsCd === "2" && submitOk && ( {statusInfo?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -9,10 +9,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation"; import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation"; import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputSewageExcretaRelatedApi } from "@/entities/statistics/api/input/statistics-input-sewage-excreta-related-service"; import { statisticsInputSewageExcretaRelatedApi } from "@/entities/statistics/api/input/statistics-input-sewage-excreta-related-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import type { import type {
ExcretaRelatedIndustrySaveItem, ExcretaRelatedIndustrySaveItem,
PrivateSewageTreatRelatedIndustrySaveItem, PrivateSewageTreatRelatedIndustrySaveItem,
@@ -84,7 +86,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -203,8 +209,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -552,19 +557,7 @@ function verificationCellTooltip({
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 - ";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
} }
@@ -588,7 +581,7 @@ function mapListToGridRows<T extends { verificationResult?: SewageExcretaRelated
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => { return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
const row = toGridRows([{ ctpvNm, ...item }])[0] as GridRowWithVerification; const row = toGridRows([{ ctpvNm, ...item }])[0] as GridRowWithVerification;
if (item.verificationResult) { if (item.verificationResult) {
row.verificationResult = item.verificationResult; row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
} }
return row; return row;
}); });
@@ -1503,7 +1496,13 @@ const SewageExcretaRelatedInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1888,7 +1887,11 @@ const SewageExcretaRelatedInp = () => {
SGG_NM_DROPDOWN_TAB_KEYS.has(tabKey) && SGG_NM_DROPDOWN_TAB_KEYS.has(tabKey) &&
col.fieldName === "sggNm" col.fieldName === "sggNm"
) { ) {
next = buildSggNmColumn(col, canEdit, sggOptions); next = buildSggNmColumn(
col,
canEdit,
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
);
} else if (col.fieldName === "sggNm") { } else if (col.fieldName === "sggNm") {
next = { ...col, editable: false as const, styleName: "rg-cell-readonly" }; next = { ...col, editable: false as const, styleName: "rg-cell-readonly" };
} }
@@ -1901,7 +1904,7 @@ const SewageExcretaRelatedInp = () => {
}); });
} }
return map; return map;
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab, sggOptions]); }, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab, sggOptions, lastSearchedValues?.gugun]);
const publicInstitutionArticleCellStyleCallback = useCallback<CellStyleCallback>( const publicInstitutionArticleCellStyleCallback = useCallback<CellStyleCallback>(
({ fieldName, row }) => { ({ fieldName, row }) => {
@@ -2024,7 +2027,7 @@ const SewageExcretaRelatedInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -17,10 +17,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation"; import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation"; import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputSewageExcretaSlurgeApi } from "@/entities/statistics/api/input/statistics-input-sewage-excreta-slurge-service"; import { statisticsInputSewageExcretaSlurgeApi } from "@/entities/statistics/api/input/statistics-input-sewage-excreta-slurge-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import type { import type {
DigestorOperatingStatusSaveItem, DigestorOperatingStatusSaveItem,
ExcretaSlurgeProcessingStatusSaveItem, ExcretaSlurgeProcessingStatusSaveItem,
@@ -59,6 +61,7 @@ import LastYearDataButton from "@/components/button/LastYearDataButton";
import NotApplicableCheckButton from "@/components/button/NotApplicableCheckButton"; import NotApplicableCheckButton from "@/components/button/NotApplicableCheckButton";
import SaveButton from "@/components/button/SaveButton"; import SaveButton from "@/components/button/SaveButton";
import SubmitButton from "@/components/button/SumitButton"; import SubmitButton from "@/components/button/SumitButton";
import UpdateOperateDataButton from "@/components/button/UpdateOperateDataButton";
import VerificationResultButton from "@/components/button/VerificationResultButton"; import VerificationResultButton from "@/components/button/VerificationResultButton";
import DataGrid from "@/components/module/DataGrid"; import DataGrid from "@/components/module/DataGrid";
import { openVerificationResultDialogIfNeeded } from "@/components/module/post-submit-verification-results"; import { openVerificationResultDialogIfNeeded } from "@/components/module/post-submit-verification-results";
@@ -90,7 +93,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -148,19 +155,7 @@ function verificationCellTooltip({
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 - ";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
} }
@@ -185,7 +180,7 @@ function mapListToGridRows<T extends { verificationResult?: SewageExcretaSlurgeV
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => { return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
const row = toGridRows([{ ctpvNm, ...item }])[0] as GridRowWithVerification; const row = toGridRows([{ ctpvNm, ...item }])[0] as GridRowWithVerification;
if (item.verificationResult) { if (item.verificationResult) {
row.verificationResult = item.verificationResult; row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
} }
return row; return row;
}); });
@@ -389,8 +384,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -627,7 +621,6 @@ function buildExcretaSlurgeProcessingStatusSaveItem(
rcycQnt: toGridNumber(row.rcycQnt), rcycQnt: toGridNumber(row.rcycQnt),
olandLfvlm: toGridNumber(row.olandLfvlm), olandLfvlm: toGridNumber(row.olandLfvlm),
incnrQnt: toGridNumber(row.incnrQnt), incnrQnt: toGridNumber(row.incnrQnt),
oceanInputQnt: toGridNumber(row.oceanInputQnt),
fuelQnt: toGridNumber(row.fuelQnt), fuelQnt: toGridNumber(row.fuelQnt),
etcQnt: toGridNumber(row.etcQnt), etcQnt: toGridNumber(row.etcQnt),
unprcsQnt: toGridNumber(row.unprcsQnt), unprcsQnt: toGridNumber(row.unprcsQnt),
@@ -1486,7 +1479,13 @@ const SewageExcretaSlurgeInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForSubmit,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1535,6 +1534,61 @@ const SewageExcretaSlurgeInp = () => {
} }
}; };
const updateOperateDataButtonFunc = () => {
void (async () => {
if (!lastSearchedValues) {
alert("먼저 조회를 진행해주세요.");
return;
}
if (!(await confirm("자체발생량·함수율·자체 1차 처리량이 운영 데이터로 덮어씁니다."))) {
return;
}
try {
showGlobalProgress({ label: "운영 데이터 업데이트 중...", progress: 0 });
const userInfo = await getUserInfo();
const request = {
statsYr: lastSearchedValues.year ?? "",
ctpvNm: lastSearchedValues.sido ?? "",
...toInputSearchRegion(sidoListRef.current, lastSearchedValues),
userUuid: userInfo.userUnqId,
};
const response =
await statisticsInputSewageExcretaSlurgeApi.updateSlurgeProcessingFacStatusOperationData(
request,
);
if (response.status !== "success") {
alert(
response.message ||
"운영 데이터 업데이트 중 오류가 발생했습니다.",
);
return;
}
setGlobalProgress(50);
const tabKey = SlurgeProcessingFacStatusInpColumn.tabKey;
const param =
searchParamRef.current ??
buildSewageExcretaSlurgeSearchParam(lastSearchedValues);
await loadActiveTabData(tabKey, param, lastSearchedValues, true, false);
setGlobalProgress(100);
alert("운영 데이터가 업데이트되었습니다.");
} catch (error) {
const message =
error &&
typeof error === "object" &&
"response" in error
? (error as { response?: { data?: { message?: string } } })
.response?.data?.message
: undefined;
alert(message || "운영 데이터 업데이트 중 오류가 발생했습니다.");
} finally {
hideGlobalProgress();
}
})();
};
const cnacelSubmitFunc = () => { const cnacelSubmitFunc = () => {
void (async () => { void (async () => {
try { try {
@@ -1922,7 +1976,11 @@ const SewageExcretaSlurgeInp = () => {
SGG_NM_DROPDOWN_TAB_KEYS.has(tabKey) && SGG_NM_DROPDOWN_TAB_KEYS.has(tabKey) &&
col.fieldName === "sggNm" col.fieldName === "sggNm"
) { ) {
next = buildSggNmColumn(col, canEdit, sggOptions); next = buildSggNmColumn(
col,
canEdit,
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
);
} else if (col.fieldName === "sggNm") { } else if (col.fieldName === "sggNm") {
next = { ...col, editable: false as const, styleName: "rg-cell-readonly" }; next = { ...col, editable: false as const, styleName: "rg-cell-readonly" };
} }
@@ -2095,10 +2153,15 @@ const SewageExcretaSlurgeInp = () => {
<LastYearDataButton <LastYearDataButton
getLastYearDataFunc={() => void lastYearDataFunc()} getLastYearDataFunc={() => void lastYearDataFunc()}
/> />
{activeTab === SEWAGE_EXCRETA_SLURGE_PROCESSING_FAC_STATUS_STATS_CD && (
<UpdateOperateDataButton
updateOperateDataButtonFunc={updateOperateDataButtonFunc}
/>
)}
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -10,6 +10,7 @@ import {
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputSewPipeApiService } from "@/entities/statistics/api/input/statistics-sewage-pipe-input-service"; import { statisticsInputSewPipeApiService } from "@/entities/statistics/api/input/statistics-sewage-pipe-input-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import type { import type {
SeweragePipeInputFactInstallStatusSaveRequest, SeweragePipeInputFactInstallStatusSaveRequest,
SeweragePipeInputFactInstallStatusSubmitRequest, SeweragePipeInputFactInstallStatusSubmitRequest,
@@ -82,7 +83,10 @@ import {
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { import {
formatVerificationTooltip,
getVerificationErrorsForField, getVerificationErrorsForField,
normalizeVerificationResultMap,
withNormalizedVerificationResult,
type VerificationResultLikeMap, type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display"; } from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
@@ -289,7 +293,10 @@ function normalizePipeTypeStatusRow(
lyngPrlg: Number(lyngPrlgWhol ?? 0), lyngPrlg: Number(lyngPrlgWhol ?? 0),
dmltnPrlg: Number(dmltnPrlgWhol ?? 0), dmltnPrlg: Number(dmltnPrlgWhol ?? 0),
...yearFields, ...yearFields,
verificationResult: remapPipeTypePrlgWholVerification(verificationResult) ?? undefined, verificationResult:
normalizeVerificationResultMap(
remapPipeTypePrlgWholVerification(verificationResult),
) ?? undefined,
}; };
} }
@@ -446,8 +453,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -719,10 +725,12 @@ const SewagePipeInp = () => {
const response = await statisticsInputSewPipeApiService.getRegionalFactStatus(searchParam); const response = await statisticsInputSewPipeApiService.getRegionalFactStatus(searchParam);
if (response.status === 'success') { if (response.status === 'success') {
const commonInfo = response.data.commonInfo; const commonInfo = response.data.commonInfo;
const convertedData = filterFetched(response.data.regionalFactStatusList).map((d) => ({ const convertedData = filterFetched(response.data.regionalFactStatusList).map((d) =>
withNormalizedVerificationResult({
ctpvNm: commonInfo.ctpvNm, ctpvNm: commonInfo.ctpvNm,
...d, ...d,
})); }),
);
applyRowMap((m) => m.set('ST00020001', toGridRows(convertedData))); applyRowMap((m) => m.set('ST00020001', toGridRows(convertedData)));
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo)); setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo));
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd)); setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
@@ -749,10 +757,12 @@ const SewagePipeInp = () => {
const response = await statisticsInputSewPipeApiService.getFactInstallStatus(searchParam); const response = await statisticsInputSewPipeApiService.getFactInstallStatus(searchParam);
if (response.status === 'success') { if (response.status === 'success') {
const commonInfo = response.data.commonInfo; const commonInfo = response.data.commonInfo;
const convertedData = filterFetched(response.data.factInstallStatusList).map((d) => ({ const convertedData = filterFetched(response.data.factInstallStatusList).map((d) =>
withNormalizedVerificationResult({
ctpvNm: commonInfo.ctpvNm, ctpvNm: commonInfo.ctpvNm,
...d, ...d,
})); }),
);
if (convertedData.length === 0) { if (convertedData.length === 0) {
const alreadyHandledForSameSearch = const alreadyHandledForSameSearch =
factInstallNoDataHandledKeyRef.current === searchConditionKey; factInstallNoDataHandledKeyRef.current === searchConditionKey;
@@ -829,10 +839,12 @@ const SewagePipeInp = () => {
const response = await statisticsInputSewPipeApiService.getPipeDiameterStatus(searchParam); const response = await statisticsInputSewPipeApiService.getPipeDiameterStatus(searchParam);
if (response.status === 'success') { if (response.status === 'success') {
const commonInfo = response.data.commonInfo; const commonInfo = response.data.commonInfo;
const convertedData = filterFetched(response.data.pipeDiameterStatusList).map((d) => ({ const convertedData = filterFetched(response.data.pipeDiameterStatusList).map((d) =>
withNormalizedVerificationResult({
ctpvNm: commonInfo.ctpvNm, ctpvNm: commonInfo.ctpvNm,
...d, ...d,
})); }),
);
applyRowMap((m) => m.set('ST00020004', toGridRows(convertedData))); applyRowMap((m) => m.set('ST00020004', toGridRows(convertedData)));
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo)); setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo));
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd)); setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
@@ -859,10 +871,12 @@ const SewagePipeInp = () => {
const response = await statisticsInputSewPipeApiService.getManholeStatus(searchParam); const response = await statisticsInputSewPipeApiService.getManholeStatus(searchParam);
if (response.status === 'success') { if (response.status === 'success') {
const commonInfo = response.data.commonInfo; const commonInfo = response.data.commonInfo;
const convertedData = filterFetched(response.data.manholeStatusList).map((d) => ({ const convertedData = filterFetched(response.data.manholeStatusList).map((d) =>
withNormalizedVerificationResult({
ctpvNm: commonInfo.ctpvNm, ctpvNm: commonInfo.ctpvNm,
...d, ...d,
})); }),
);
applyRowMap((m) => m.set('ST00020005', toGridRows(convertedData))); applyRowMap((m) => m.set('ST00020005', toGridRows(convertedData)));
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo)); setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo));
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd)); setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
@@ -889,13 +903,15 @@ const SewagePipeInp = () => {
const response = await statisticsInputSewPipeApiService.getConnectionStatus(searchParam); const response = await statisticsInputSewPipeApiService.getConnectionStatus(searchParam);
if (response.status === 'success') { if (response.status === 'success') {
const commonInfo = response.data.commonInfo; const commonInfo = response.data.commonInfo;
const facilityConvertedData = filterFetched(response.data.facilityConnectionList).map((d) => ({ const facilityConvertedData = filterFetched(response.data.facilityConnectionList).map((d) =>
...d, withNormalizedVerificationResult({ ...d }),
})); );
const adminConvertedData = filterFetched(response.data.adminAreaConnectionList).map((d) => ({ const adminConvertedData = filterFetched(response.data.adminAreaConnectionList).map((d) =>
withNormalizedVerificationResult({
...d, ...d,
ctpvNm: d.ctpvNm || commonInfo.ctpvNm, ctpvNm: d.ctpvNm || commonInfo.ctpvNm,
})); }),
);
applyRowMap((m) => { applyRowMap((m) => {
m.set('treatmentPlantConnectionInp', toGridRows(facilityConvertedData)); m.set('treatmentPlantConnectionInp', toGridRows(facilityConvertedData));
m.set('adminAreaConnectionInp', toGridRows(adminConvertedData)); m.set('adminAreaConnectionInp', toGridRows(adminConvertedData));
@@ -1338,7 +1354,6 @@ const SewagePipeInp = () => {
rmrk: nullableTrimmedString(d.rmrk), rmrk: nullableTrimmedString(d.rmrk),
lyngPrlgWhol: formatNumber(d.lyngPrlg, "lyngPrlg"), lyngPrlgWhol: formatNumber(d.lyngPrlg, "lyngPrlg"),
dmltnPrlgWhol: formatNumber(d.dmltnPrlg, "dmltnPrlg"), dmltnPrlgWhol: formatNumber(d.dmltnPrlg, "dmltnPrlg"),
pipeByPrstWhol: formatNumber(d.pipeByPrstWhol, "pipeByPrstWhol"),
}; };
}); });
const requestData: SeweragePipeInputPipeTypeStatusSubmitRequest = { const requestData: SeweragePipeInputPipeTypeStatusSubmitRequest = {
@@ -1455,7 +1470,13 @@ const SewagePipeInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: values.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: values?.bsnmCd ?? "",
rollbackStatusCode: statusForTab?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1830,7 +1851,6 @@ const SewagePipeInp = () => {
rmrk: nullableTrimmedString(d.rmrk), rmrk: nullableTrimmedString(d.rmrk),
lyngPrlgWhol: formatNumber(d.lyngPrlg, "lyngPrlg"), lyngPrlgWhol: formatNumber(d.lyngPrlg, "lyngPrlg"),
dmltnPrlgWhol: formatNumber(d.dmltnPrlg, "dmltnPrlg"), dmltnPrlgWhol: formatNumber(d.dmltnPrlg, "dmltnPrlg"),
pipeByPrstWhol: formatNumber(d.pipeByPrstWhol, "pipeByPrstWhol"),
}; };
}); });
@@ -2041,7 +2061,7 @@ const SewagePipeInp = () => {
{submitOk && <SubmitButton submitFunc={() => void submitFunc(false)} />} {submitOk && <SubmitButton submitFunc={() => void submitFunc(false)} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -2237,17 +2257,7 @@ const SewagePipeInp = () => {
tabKey, tabKey,
); );
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR" ? "시계열 검증 - " : (e.vrfcCd === "NV" ? "일반검증 - " : "모집단 검증 - ");
const comp = e.cmprCn ?? "";
const now = e.nowCn ?? "";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${comp} / 현재 입력값: ${now})`;
})
.filter(Boolean)
.join("\n");
} }
}} }}
/> />
@@ -11,6 +11,7 @@ import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { sewagePipeMaintainApiService } from "@/entities/statistics/api/input/statistics-input-sewage-pipe-maintain-service"; import { sewagePipeMaintainApiService } from "@/entities/statistics/api/input/statistics-input-sewage-pipe-maintain-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import type { import type {
SewagePipeMaintainDredgingSaveItem, SewagePipeMaintainDredgingSaveItem,
SewagePipeMaintainDredgingSaveRequest, SewagePipeMaintainDredgingSaveRequest,
@@ -69,7 +70,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
withNormalizedVerificationResult,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useStatisticsInputFocusStore } from "@/store/statistics-input-focus-store"; import { useStatisticsInputFocusStore } from "@/store/statistics-input-focus-store";
@@ -151,8 +156,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -444,10 +448,12 @@ const SewagePipeMaintainInp = () => {
repairStatusList ?? [], repairStatusList ?? [],
sidoListRef.current, sidoListRef.current,
searchContext, searchContext,
).map((d) => ({ ).map((d) =>
withNormalizedVerificationResult({
ctpvNm: commonInfo.ctpvNm, ctpvNm: commonInfo.ctpvNm,
...d, ...d,
})); }),
);
const gridRows = toGridRows(convertedData); const gridRows = toGridRows(convertedData);
applyRowMap(mergeIntoExistingMap, (m) => { applyRowMap(mergeIntoExistingMap, (m) => {
@@ -487,10 +493,12 @@ const SewagePipeMaintainInp = () => {
pipeDredgingStatusList ?? [], pipeDredgingStatusList ?? [],
sidoListRef.current, sidoListRef.current,
searchContext, searchContext,
).map((d) => ({ ).map((d) =>
withNormalizedVerificationResult({
ctpvNm: commonInfo.ctpvNm, ctpvNm: commonInfo.ctpvNm,
...d, ...d,
})); }),
);
const gridRows = toGridRows(convertedData); const gridRows = toGridRows(convertedData);
applyRowMap(mergeIntoExistingMap, (m) => { applyRowMap(mergeIntoExistingMap, (m) => {
@@ -678,7 +686,13 @@ const SewagePipeMaintainInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1103,14 +1117,7 @@ const SewagePipeMaintainInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR" ? "시계열 검증 - " : e.vrfcCd === "NV" ? "일반검증 - " : "모집단 검증 - ";
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1142,7 +1149,7 @@ const SewagePipeMaintainInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -17,10 +17,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation"; import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation"; import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputSewageReservoirPumpApi } from "@/entities/statistics/api/input/statistics-input-sewage-reservoir-pump-service"; import { statisticsInputSewageReservoirPumpApi } from "@/entities/statistics/api/input/statistics-input-sewage-reservoir-pump-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import { import {
type RainfallPumpStationItem, type RainfallPumpStationItem,
type RainfallPumpStationSaveItem, type RainfallPumpStationSaveItem,
@@ -89,7 +91,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -171,8 +177,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -279,7 +284,7 @@ function mapSewageReservoirListToGridRows(
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (item.verificationResult) { if (item.verificationResult) {
row.verificationResult = item.verificationResult; row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
} }
return row; return row;
}); });
@@ -435,7 +440,7 @@ function mapRainfallPumpStationListToGridRows(
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (item.verificationResult) { if (item.verificationResult) {
row.verificationResult = item.verificationResult; row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
} }
return row; return row;
}); });
@@ -864,7 +869,13 @@ const SewageReservoirPumpInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1480,7 +1491,11 @@ const SewageReservoirPumpInp = () => {
col.fieldName === "sggNm" && col.fieldName === "sggNm" &&
canEdit canEdit
) { ) {
return buildSggNmColumn(col, true, sggOptions); return buildSggNmColumn(
col,
true,
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
);
} }
return col; return col;
}).map((col) => { }).map((col) => {
@@ -1493,7 +1508,7 @@ const SewageReservoirPumpInp = () => {
}); });
} }
return map; return map;
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, sggOptions, columnGuidesByTab]); }, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, sggOptions, lastSearchedValues?.gugun, columnGuidesByTab]);
const verificationCellStyle = ({ const verificationCellStyle = ({
fieldName, fieldName,
@@ -1516,19 +1531,7 @@ const SewageReservoirPumpInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 -";
return `${prefix}${e.rsnExpln}
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1584,7 +1587,7 @@ const SewageReservoirPumpInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -8,6 +8,7 @@ import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputSewerageFinanceApi } from "@/entities/statistics/api/input/statistics-input-sewerage-finance-service"; import { statisticsInputSewerageFinanceApi } from "@/entities/statistics/api/input/statistics-input-sewerage-finance-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import type { import type {
CauserBurdenItem, CauserBurdenItem,
CauserBurdenSaveItem, CauserBurdenSaveItem,
@@ -73,7 +74,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -155,8 +160,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -174,7 +178,9 @@ function mapRegionalListToGridRows<
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => { return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
const { verificationResult, ...rest } = item; const { verificationResult, ...rest } = item;
const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification; const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -940,7 +946,13 @@ const SewerageFinanceInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1215,18 +1227,7 @@ const SewerageFinanceInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 - ";
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1269,7 +1270,7 @@ const SewerageFinanceInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -10,6 +10,7 @@ import {
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import { import {
type CheckInputPeriodItem, type CheckInputPeriodItem,
getVerificationPeriodActionBlockedMessage, getVerificationPeriodActionBlockedMessage,
@@ -58,7 +59,11 @@ import { toGridRows } from "@/components/util/grid/gridFunction";
import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport"; import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag"; import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useStatisticsInputFocusStore } from "@/store/statistics-input-focus-store"; import { useStatisticsInputFocusStore } from "@/store/statistics-input-focus-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -87,7 +92,7 @@ const remapCommonInfoVerificationToGridFields = (
// API 키로도 조회 가능하도록 유지 // API 키로도 조회 가능하도록 유지
if (gridField !== key) remapped[key] = errors; if (gridField !== key) remapped[key] = errors;
} }
return remapped; return normalizeVerificationResultMap(remapped) ?? remapped;
}; };
/** 컬럼 가이드 API 조회용 통계코드 (하수도 보급률) */ /** 컬럼 가이드 API 조회용 통계코드 (하수도 보급률) */
@@ -302,7 +307,11 @@ const SeweragePenetrationRateInp = () => {
setRowData( setRowData(
convertedData.map((d) => { convertedData.map((d) => {
const row = toGridRows([d])[0] as GridRowWithVerification; const row = toGridRows([d])[0] as GridRowWithVerification;
if (d.verificationResult) row.verificationResult = d.verificationResult; if (d.verificationResult) {
row.verificationResult = normalizeVerificationResultMap(
d.verificationResult,
);
}
return row; return row;
}) })
); );
@@ -558,7 +567,13 @@ const SeweragePenetrationRateInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: searchValues?.year ?? "",
statsCd,
sewerBzmnCd: searchValues?.bsnmCd ?? "",
rollbackStatusCode: statusInfo?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted(imrResponse.job_id, (id) => await waitForImrJobCompleted(imrResponse.job_id, (id) =>
statisticsApi.getImrStatus(id), statisticsApi.getImrStatus(id),
@@ -800,8 +815,7 @@ const SeweragePenetrationRateInp = () => {
toolbarGroupAllowed && toolbarGroupAllowed &&
(baseShowSaveInToolbar || (baseShowSaveInToolbar ||
baseShowEnterableToolbarButtons || baseShowEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return ( return (
<> <>
@@ -827,7 +841,7 @@ const SeweragePenetrationRateInp = () => {
{submitOk && <SubmitButton submitFunc={() => submitFunc(false)} />} {submitOk && <SubmitButton submitFunc={() => submitFunc(false)} />}
</> </>
)} )}
{statusInfo?.lclgvSbmsnSttsCd === '2' && submitOk && <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />} {statusInfo?.lclgvSbmsnSttsCd === '2' && submitOk && inputPeriodCurrent && <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
</div> </div>
</div> </div>
@@ -867,14 +881,7 @@ const SeweragePenetrationRateInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix = e.vrfcCd === 'IMR' ? '시계열 검증 - ' : (e.vrfcCd === 'NV' ? '일반검증 - ' : '모집단 검증 -');
return `${prefix}${e.rsnExpln}
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join('\n');
} }
}} }}
/> />
@@ -9,6 +9,7 @@ import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputSewerageServiceLevelApi } from "@/entities/statistics/api/input/statistics-input-sewerage-service-level-service"; import { statisticsInputSewerageServiceLevelApi } from "@/entities/statistics/api/input/statistics-input-sewerage-service-level-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import { import {
SEWERAGE_SERVICE_LEVEL_COMPLAINT_STATS_CD, SEWERAGE_SERVICE_LEVEL_COMPLAINT_STATS_CD,
SEWERAGE_SERVICE_LEVEL_RESIDENT_FRIENDLY_FACT_STATS_CD, SEWERAGE_SERVICE_LEVEL_RESIDENT_FRIENDLY_FACT_STATS_CD,
@@ -63,7 +64,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -164,8 +169,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -187,7 +191,9 @@ function mapServiceLevelListToGridRows<
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => { return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
const { verificationResult, ...rest } = item; const { verificationResult, ...rest } = item;
const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification; const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -839,7 +845,13 @@ const SewerageServiceLevelInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1146,18 +1158,7 @@ const SewerageServiceLevelInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 - ";
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -1200,7 +1201,7 @@ const SewerageServiceLevelInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -20,8 +20,8 @@ const StatisticsReviewHistory = () => {
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false }, { name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false }, { name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
{ name: "menuNm", fieldName: "menuNm", header: { text: "통계항목" }, editable: false }, { name: "menuNm", fieldName: "menuNm", header: { text: "통계항목" }, editable: false },
{ name: "chckerOpinionSm", fieldName: "chckerOpinionSm", header: { text: "검토자의견" }, editable: false }, { name: "splmntOpnnCn", fieldName: "splmntOpnnCn", header: { text: "검토자의견" }, editable: false },
{ name: "wrterOpinionSm", fieldName: "wrterOpinionSm", header: { text: "처리내역" }, editable: false }, { name: "rjctOpnnCn", fieldName: "rjctOpnnCn", header: { text: "반려의견" }, editable: false },
]; ];
const columnLayout = [ const columnLayout = [
@@ -29,8 +29,8 @@ const StatisticsReviewHistory = () => {
"ctpvNm", "ctpvNm",
"sggNm", "sggNm",
"menuNm", "menuNm",
"chckerOpinionSm", "splmntOpnnCn",
"wrterOpinionSm", "rjctOpnnCn",
]; ];
const handleSearch = async (values: SearchFormValues) => { const handleSearch = async (values: SearchFormValues) => {
@@ -17,10 +17,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation"; import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation"; import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
import { nullableTrimmedString } from "@/components/util/input/nullableString"; import { nullableTrimmedString } from "@/components/util/input/nullableString";
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
import { statisticsInputWaterReuseApi } from "@/entities/statistics/api/input/statistics-input-water-reuse-service"; import { statisticsInputWaterReuseApi } from "@/entities/statistics/api/input/statistics-input-water-reuse-service";
import { statisticsApi } from "@/entities/statistics/api/statistics-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
import { import {
type PublicSewageTreatWaterReuseItem, type PublicSewageTreatWaterReuseItem,
type PublicSewageTreatWaterReuseSaveItem, type PublicSewageTreatWaterReuseSaveItem,
@@ -93,7 +95,11 @@ import {
patchFooterVerificationByTab, patchFooterVerificationByTab,
patchVerificationFailedByTab, patchVerificationFailedByTab,
} from "@/components/util/input/verification-failed-flag"; } from "@/components/util/input/verification-failed-flag";
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; import {
formatVerificationTooltip,
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "@/components/util/input/verification-result-display";
import { useAdminStore } from "@/store/admin-store"; import { useAdminStore } from "@/store/admin-store";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
@@ -203,8 +209,7 @@ function computeTabToolbarSnapshot(
(hasRowData || treatAsSearched) && (hasRowData || treatAsSearched) &&
(showSaveInToolbar || (showSaveInToolbar ||
showEnterableToolbarButtons || showEnterableToolbarButtons ||
showSubmittedInInputPeriodToolbar || showSubmittedInInputPeriodToolbar);
(isSubmitted && isAdminInfo));
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard }; return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
} }
@@ -443,7 +448,9 @@ function mapPublicSewageTreatWaterReuseListToGridRows(
instlAprvYmd: formatCompactYmdForGrid(item.instlAprvYmd), instlAprvYmd: formatCompactYmdForGrid(item.instlAprvYmd),
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -462,7 +469,9 @@ function mapRecycledWaterStatusListToGridRows(
oprtngStrtYmd: formatCompactYmdForGrid(item.oprtngStrtYmd), oprtngStrtYmd: formatCompactYmdForGrid(item.oprtngStrtYmd),
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -480,7 +489,9 @@ function mapRainFallUtilFactStatusListToGridRows(
cmptnYmd: formatCompactYmdForGrid(item.cmptnYmd), cmptnYmd: formatCompactYmdForGrid(item.cmptnYmd),
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -497,7 +508,9 @@ function mapTreatWaterReuseStatusListToGridRows<
coRegYmd: formatCompactYmdForGrid(item.coRegYmd), coRegYmd: formatCompactYmdForGrid(item.coRegYmd),
}, },
])[0] as GridRowWithVerification; ])[0] as GridRowWithVerification;
if (verificationResult) row.verificationResult = verificationResult; if (verificationResult) {
row.verificationResult = normalizeVerificationResultMap(verificationResult);
}
return row; return row;
}); });
} }
@@ -1355,7 +1368,13 @@ const WaterReuseInp = () => {
}; };
try { try {
const imrResponse = await statisticsApi.callImrService(imrParam); const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
statsYr: lastSearchedValues.year ?? "",
statsCd: statsCdForTab,
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
mdfrUuid: userInfo.userUnqId,
});
if (imrResponse.job_id) { if (imrResponse.job_id) {
await waitForImrJobCompleted( await waitForImrJobCompleted(
imrResponse.job_id, imrResponse.job_id,
@@ -1963,7 +1982,11 @@ const WaterReuseInp = () => {
ARTICLE_EDIT_TAB_KEYS.has(tabKey) && ARTICLE_EDIT_TAB_KEYS.has(tabKey) &&
col.fieldName === "sggNm" col.fieldName === "sggNm"
) { ) {
next = buildSggNmColumn(col, canEdit, sggOptions); next = buildSggNmColumn(
col,
canEdit,
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
);
} }
const guide = columnGuidesByTab[tabKey]?.[col.fieldName]?.trim(); const guide = columnGuidesByTab[tabKey]?.[col.fieldName]?.trim();
return guide ? { ...next, tooltip: guide } : next; return guide ? { ...next, tooltip: guide } : next;
@@ -1974,7 +1997,7 @@ const WaterReuseInp = () => {
}); });
} }
return map; return map;
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab, sggOptions]); }, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab, sggOptions, lastSearchedValues?.gugun]);
const searchContextForToolbar = searchContextByTab.get(activeTab) ?? lastSearchedValues; const searchContextForToolbar = searchContextByTab.get(activeTab) ?? lastSearchedValues;
const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null; const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null;
@@ -2063,18 +2086,7 @@ const WaterReuseInp = () => {
if (!verification) return; if (!verification) return;
const errors = verification[fieldName]; const errors = verification[fieldName];
if (Array.isArray(errors) && errors.length > 0) { if (Array.isArray(errors) && errors.length > 0) {
return errors return formatVerificationTooltip(errors);
.map((e) => {
const prefix =
e.vrfcCd === "IMR"
? "시계열 검증 - "
: e.vrfcCd === "NV"
? "일반검증 - "
: "모집단 검증 - ";
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
})
.filter(Boolean)
.join("\n");
} }
}; };
@@ -2117,7 +2129,7 @@ const WaterReuseInp = () => {
{submitOk && <SubmitButton submitFunc={submitFunc} />} {submitOk && <SubmitButton submitFunc={submitFunc} />}
</> </>
)} )}
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && ( {activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} /> <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
)} )}
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />} {showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
@@ -49,7 +49,6 @@ const ExcretaTreatmentFacilityRvw = () => {
const [reviewOpinionContext, setReviewOpinionContext] = const [reviewOpinionContext, setReviewOpinionContext] =
useState<ReviewOpinionDialogContext | null>(null); useState<ReviewOpinionDialogContext | null>(null);
const [latestReviewOpinion, setLatestReviewOpinion] = useState(""); const [latestReviewOpinion, setLatestReviewOpinion] = useState("");
const [latestProcessHistory, setLatestProcessHistory] = useState("");
const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null); const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null);
const columnInfo = useMemo(() => { const columnInfo = useMemo(() => {
@@ -116,7 +115,6 @@ const ExcretaTreatmentFacilityRvw = () => {
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
setLastSearchValues(null); setLastSearchValues(null);
setReviewOpinionOpen(false); setReviewOpinionOpen(false);
setReturnDialogOpen(false); setReturnDialogOpen(false);
@@ -170,14 +168,12 @@ const ExcretaTreatmentFacilityRvw = () => {
statsCd: statsInfo.statsCd ?? "", statsCd: statsInfo.statsCd ?? "",
}); });
setLatestReviewOpinion(statsInfo.splmntOpnnCn ?? ""); setLatestReviewOpinion(statsInfo.splmntOpnnCn ?? "");
setLatestProcessHistory(statsInfo.splmntRsltCn ?? "");
setRowData(toGridRows(convertedData as unknown as object[])); setRowData(toGridRows(convertedData as unknown as object[]));
} else { } else {
setRowData([]); setRowData([]);
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
alert(response.message || "데이터가 없습니다."); alert(response.message || "데이터가 없습니다.");
} }
} catch { } catch {
@@ -216,7 +212,6 @@ const ExcretaTreatmentFacilityRvw = () => {
const row = detailRes.data?.[0]; const row = detailRes.data?.[0];
setLatestReviewOpinion(row?.splmntOpnnCn ?? ""); setLatestReviewOpinion(row?.splmntOpnnCn ?? "");
setLatestProcessHistory(row?.splmntRsltCn ?? "");
setReviewOpinionOpen(true); setReviewOpinionOpen(true);
} catch { } catch {
alert("검토의견 조회 중 오류가 발생했습니다."); alert("검토의견 조회 중 오류가 발생했습니다.");
@@ -234,10 +229,8 @@ const ExcretaTreatmentFacilityRvw = () => {
setStatsStatusInfo((prev) => ({ setStatsStatusInfo((prev) => ({
...prev, ...prev,
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
})); }));
setLatestReviewOpinion(param.splmntOpnnCn); setLatestReviewOpinion(param.splmntOpnnCn);
setLatestProcessHistory(param.splmntRsltCn);
} catch { } catch {
alert("저장 중 오류가 발생했습니다."); alert("저장 중 오류가 발생했습니다.");
} }
@@ -297,7 +290,6 @@ const ExcretaTreatmentFacilityRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -102,7 +102,6 @@ const PrivateSewageFacilityRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -284,7 +283,6 @@ const PrivateSewageFacilityRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -307,7 +305,6 @@ const PrivateSewageFacilityRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -411,7 +408,6 @@ const PrivateSewageFacilityRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -41,7 +41,6 @@ const PublicSewageFacilityRvw = () => {
const [reviewOpinionContext, setReviewOpinionContext] = const [reviewOpinionContext, setReviewOpinionContext] =
useState<ReviewOpinionDialogContext | null>(null); useState<ReviewOpinionDialogContext | null>(null);
const [latestReviewOpinion, setLatestReviewOpinion] = useState(""); const [latestReviewOpinion, setLatestReviewOpinion] = useState("");
const [latestProcessHistory, setLatestProcessHistory] = useState("");
const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null); const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null);
const columnInfo = useMemo(() => { const columnInfo = useMemo(() => {
@@ -100,7 +99,6 @@ const PublicSewageFacilityRvw = () => {
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
setLastSearchValues(null); setLastSearchValues(null);
setSubmitDialogOpen(false); setSubmitDialogOpen(false);
}; };
@@ -143,16 +141,12 @@ const PublicSewageFacilityRvw = () => {
setLatestReviewOpinion( setLatestReviewOpinion(
response.data.statsStatusInfo.splmntOpnnCn ?? "", response.data.statsStatusInfo.splmntOpnnCn ?? "",
); );
setLatestProcessHistory(
response.data.statsStatusInfo.splmntRsltCn ?? "",
);
setRowData(toGridRows(convertedData as unknown as object[])); setRowData(toGridRows(convertedData as unknown as object[]));
} else { } else {
setRowData([]); setRowData([]);
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
alert(response.message || "데이터가 없습니다."); alert(response.message || "데이터가 없습니다.");
} }
} catch (error) { } catch (error) {
@@ -192,7 +186,6 @@ const PublicSewageFacilityRvw = () => {
const row = detailRes.data?.[0]; const row = detailRes.data?.[0];
setLatestReviewOpinion(row?.splmntOpnnCn ?? ""); setLatestReviewOpinion(row?.splmntOpnnCn ?? "");
setLatestProcessHistory(row?.splmntRsltCn ?? "");
setReviewOpinionOpen(true); setReviewOpinionOpen(true);
} catch { } catch {
alert("검토의견 조회 중 오류가 발생했습니다."); alert("검토의견 조회 중 오류가 발생했습니다.");
@@ -210,10 +203,8 @@ const PublicSewageFacilityRvw = () => {
setStatsStatusInfo((prev) => ({ setStatsStatusInfo((prev) => ({
...prev, ...prev,
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
})); }));
setLatestReviewOpinion(param.splmntOpnnCn); setLatestReviewOpinion(param.splmntOpnnCn);
setLatestProcessHistory(param.splmntRsltCn);
} catch { } catch {
alert("저장 중 오류가 발생했습니다."); alert("저장 중 오류가 발생했습니다.");
} }
@@ -267,7 +258,6 @@ const PublicSewageFacilityRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -47,7 +47,6 @@ const PumpingStationRvw = () => {
const [reviewOpinionContext, setReviewOpinionContext] = const [reviewOpinionContext, setReviewOpinionContext] =
useState<ReviewOpinionDialogContext | null>(null); useState<ReviewOpinionDialogContext | null>(null);
const [latestReviewOpinion, setLatestReviewOpinion] = useState(""); const [latestReviewOpinion, setLatestReviewOpinion] = useState("");
const [latestProcessHistory, setLatestProcessHistory] = useState("");
const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null); const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null);
const columnInfo = useMemo(() => { const columnInfo = useMemo(() => {
@@ -111,7 +110,6 @@ const PumpingStationRvw = () => {
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
setLastSearchValues(null); setLastSearchValues(null);
setReviewOpinionOpen(false); setReviewOpinionOpen(false);
setReturnDialogOpen(false); setReturnDialogOpen(false);
@@ -157,14 +155,12 @@ const PumpingStationRvw = () => {
statsCd: statsInfo.statsCd ?? "", statsCd: statsInfo.statsCd ?? "",
}); });
setLatestReviewOpinion(statsInfo.splmntOpnnCn ?? ""); setLatestReviewOpinion(statsInfo.splmntOpnnCn ?? "");
setLatestProcessHistory(statsInfo.splmntRsltCn ?? "");
setRowData(toGridRows(convertedData)); setRowData(toGridRows(convertedData));
} else { } else {
setRowData([]); setRowData([]);
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
alert(response.message || "데이터가 없습니다."); alert(response.message || "데이터가 없습니다.");
} }
} catch { } catch {
@@ -203,7 +199,6 @@ const PumpingStationRvw = () => {
const row = detailRes.data?.[0]; const row = detailRes.data?.[0];
setLatestReviewOpinion(row?.splmntOpnnCn ?? ""); setLatestReviewOpinion(row?.splmntOpnnCn ?? "");
setLatestProcessHistory(row?.splmntRsltCn ?? "");
setReviewOpinionOpen(true); setReviewOpinionOpen(true);
} catch { } catch {
alert("검토의견 조회 중 오류가 발생했습니다."); alert("검토의견 조회 중 오류가 발생했습니다.");
@@ -221,10 +216,8 @@ const PumpingStationRvw = () => {
setStatsStatusInfo((prev) => ({ setStatsStatusInfo((prev) => ({
...prev, ...prev,
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
})); }));
setLatestReviewOpinion(param.splmntOpnnCn); setLatestReviewOpinion(param.splmntOpnnCn);
setLatestProcessHistory(param.splmntRsltCn);
} catch { } catch {
alert("저장 중 오류가 발생했습니다."); alert("저장 중 오류가 발생했습니다.");
} }
@@ -284,7 +277,6 @@ const PumpingStationRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -30,8 +30,6 @@ export interface ReviewOpinionDialogProps {
context: ReviewOpinionDialogContext | null; context: ReviewOpinionDialogContext | null;
/** 다이얼로그 열릴 때 검토의견 초기값 */ /** 다이얼로그 열릴 때 검토의견 초기값 */
initialReviewOpinion?: string; initialReviewOpinion?: string;
/** 다이얼로그 열릴 때 처리내역 초기값 */
initialProcessHistory?: string;
/** 저장 시 생성된 param 전달 (API 호출 등) */ /** 저장 시 생성된 param 전달 (API 호출 등) */
onSave?: (param: ReviewOpinionSaveRequest) => void | Promise<void>; onSave?: (param: ReviewOpinionSaveRequest) => void | Promise<void>;
} }
@@ -41,18 +39,15 @@ export function ReviewOpinionDialog({
onOpenChange, onOpenChange,
context, context,
initialReviewOpinion = "", initialReviewOpinion = "",
initialProcessHistory = "",
onSave, onSave,
}: ReviewOpinionDialogProps) { }: ReviewOpinionDialogProps) {
const { setMessage: alert } = useAlertStore((state) => state); const { setMessage: alert } = useAlertStore((state) => state);
const [reviewOpinion, setReviewOpinion] = useState(""); const [reviewOpinion, setReviewOpinion] = useState("");
const [processHistory, setProcessHistory] = useState("");
const [isSaving, setIsSaving] = useState(false); const [isSaving, setIsSaving] = useState(false);
const [reviewOpinionError, setReviewOpinionError] = useState(false); const [reviewOpinionError, setReviewOpinionError] = useState(false);
const resetForm = () => { const resetForm = () => {
setReviewOpinion(""); setReviewOpinion("");
setProcessHistory("");
setReviewOpinionError(false); setReviewOpinionError(false);
}; };
@@ -64,8 +59,7 @@ export function ReviewOpinionDialog({
useEffect(() => { useEffect(() => {
if (!open) return; if (!open) return;
setReviewOpinion(initialReviewOpinion); setReviewOpinion(initialReviewOpinion);
setProcessHistory(initialProcessHistory); }, [open, initialReviewOpinion]);
}, [open, initialReviewOpinion, initialProcessHistory]);
const handleSave = async () => { const handleSave = async () => {
if (reviewOpinion.trim() === "") { if (reviewOpinion.trim() === "") {
@@ -96,7 +90,6 @@ export function ReviewOpinionDialog({
sewerBzmnCd: context.sewerBzmnCd, sewerBzmnCd: context.sewerBzmnCd,
statsCd: context.statsCd, statsCd: context.statsCd,
splmntOpnnCn: reviewOpinion, splmntOpnnCn: reviewOpinion,
splmntRsltCn: processHistory,
mdfrUuid: userInfo.userUnqId, mdfrUuid: userInfo.userUnqId,
}; };
await onSave?.(param); await onSave?.(param);
@@ -136,16 +129,6 @@ export function ReviewOpinionDialog({
</p> </p>
)} )}
</div> </div>
<div className="flex flex-col gap-2">
<Label className="text-label mb-2">처리내역</Label>
<Textarea
value={processHistory}
onChange={(e) => setProcessHistory(e.target.value)}
className="min-h-[10rem] resize-y !text-[1.3rem] !leading-6"
placeholder="처리내역을 입력하세요."
disabled={isSaving}
/>
</div>
</div> </div>
<DialogFooter> <DialogFooter>
<DialogClose asChild> <DialogClose asChild>
@@ -30,8 +30,8 @@ export interface ReviewSubmitDialogProps {
context: ReviewerInfoRequest | null; context: ReviewerInfoRequest | null;
onSubmitted?: () => void | Promise<void>; onSubmitted?: () => void | Promise<void>;
/** /**
* true면 검토의견·처리내역 UI를 숨기고 * true면 검토의견 UI를 숨기고
* submit body에 statsCd / splmntOpnnCn / splmntRsltCn을 넣지 않음 * submit body에 statsCd / splmntOpnnCn을 넣지 않음
*/ */
hideOpinionFields?: boolean; hideOpinionFields?: boolean;
} }
@@ -116,7 +116,6 @@ export function ReviewSubmitDialog({
statsCd: context.statsCd, statsCd: context.statsCd,
mdfrUuid: userInfo.userUnqId, mdfrUuid: userInfo.userUnqId,
splmntOpnnCn: reviewerInfo?.splmntOpnnCn ?? "", splmntOpnnCn: reviewerInfo?.splmntOpnnCn ?? "",
splmntRsltCn: reviewerInfo?.splmntRsltCn ?? "",
}; };
const response = await statisticsApi.submitReview(submitParam); const response = await statisticsApi.submitReview(submitParam);
@@ -175,14 +174,6 @@ export function ReviewSubmitDialog({
className="min-h-[10rem] p-2 resize-none !text-xl" className="min-h-[10rem] p-2 resize-none !text-xl"
/> />
</div> </div>
<div className="col-span-2 flex flex-col gap-2">
<Label className="text-label">처리내역</Label>
<Textarea
value={reviewerInfo?.splmntRsltCn ?? "-"}
readOnly
className="min-h-[10rem] p-2 resize-none !text-xl"
/>
</div>
</> </>
)} )}
</div> </div>
@@ -105,7 +105,6 @@ const SewageExcretaRelatedRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -289,7 +288,6 @@ const SewageExcretaRelatedRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -312,7 +310,6 @@ const SewageExcretaRelatedRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -416,7 +413,6 @@ const SewageExcretaRelatedRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -105,7 +105,6 @@ const SewageExcretaSlurgeRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -290,7 +289,6 @@ const SewageExcretaSlurgeRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -313,7 +311,6 @@ const SewageExcretaSlurgeRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -417,7 +414,6 @@ const SewageExcretaSlurgeRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -120,7 +120,6 @@ const SewagePipeMaintainRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -302,7 +301,6 @@ const SewagePipeMaintainRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -325,7 +323,6 @@ const SewagePipeMaintainRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -429,7 +426,6 @@ const SewagePipeMaintainRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -181,7 +181,6 @@ const SewagePipeRvw = () => {
}; };
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -362,7 +361,6 @@ const SewagePipeRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -385,7 +383,6 @@ const SewagePipeRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -488,7 +485,6 @@ const SewagePipeRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -126,7 +126,6 @@ const SewageReservoirPumpRvw = () => {
}, [activeStatsCd, lastSearchValues]); }, [activeStatsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -308,7 +307,6 @@ const SewageReservoirPumpRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -331,7 +329,6 @@ const SewageReservoirPumpRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -435,7 +432,6 @@ const SewageReservoirPumpRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -105,7 +105,6 @@ const SewerageFinanceRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -287,7 +286,6 @@ const SewerageFinanceRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -310,7 +308,6 @@ const SewerageFinanceRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -414,7 +411,6 @@ const SewerageFinanceRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -40,7 +40,6 @@ const SeweragePenetrationRateRvw = () => {
const [reviewOpinionContext, setReviewOpinionContext] = const [reviewOpinionContext, setReviewOpinionContext] =
useState<ReviewOpinionDialogContext | null>(null); useState<ReviewOpinionDialogContext | null>(null);
const [latestReviewOpinion, setLatestReviewOpinion] = useState(""); const [latestReviewOpinion, setLatestReviewOpinion] = useState("");
const [latestProcessHistory, setLatestProcessHistory] = useState("");
const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null); const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null);
const columnInfo = useMemo(() => { const columnInfo = useMemo(() => {
@@ -100,7 +99,6 @@ const SeweragePenetrationRateRvw = () => {
setStatsStatusInfo({}); setStatsStatusInfo({});
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
setLastSearchValues(null); setLastSearchValues(null);
}; };
@@ -139,15 +137,11 @@ const SeweragePenetrationRateRvw = () => {
setLatestReviewOpinion( setLatestReviewOpinion(
response.data.statsStatusInfo.splmntOpnnCn ?? "", response.data.statsStatusInfo.splmntOpnnCn ?? "",
); );
setLatestProcessHistory(
response.data.statsStatusInfo.splmntRsltCn ?? "",
);
setRowData(toGridRows(convertedData)); setRowData(toGridRows(convertedData));
} else { } else {
setRowData([]); setRowData([]);
setReviewOpinionContext(null); setReviewOpinionContext(null);
setLatestReviewOpinion(""); setLatestReviewOpinion("");
setLatestProcessHistory("");
alert(response.message || "데이터가 없습니다."); alert(response.message || "데이터가 없습니다.");
} }
} catch (error) { } catch (error) {
@@ -187,7 +181,6 @@ const SeweragePenetrationRateRvw = () => {
const row = detailRes.data?.[0]; const row = detailRes.data?.[0];
setLatestReviewOpinion(row?.splmntOpnnCn ?? ""); setLatestReviewOpinion(row?.splmntOpnnCn ?? "");
setLatestProcessHistory(row?.splmntRsltCn ?? "");
setReviewOpinionOpen(true); setReviewOpinionOpen(true);
} catch { } catch {
alert("검토의견 조회 중 오류가 발생했습니다."); alert("검토의견 조회 중 오류가 발생했습니다.");
@@ -205,10 +198,8 @@ const SeweragePenetrationRateRvw = () => {
setStatsStatusInfo((prev) => ({ setStatsStatusInfo((prev) => ({
...prev, ...prev,
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
})); }));
setLatestReviewOpinion(param.splmntOpnnCn); setLatestReviewOpinion(param.splmntOpnnCn);
setLatestProcessHistory(param.splmntRsltCn);
} catch { } catch {
alert("저장 중 오류가 발생했습니다."); alert("저장 중 오류가 발생했습니다.");
} }
@@ -264,7 +255,6 @@ const SeweragePenetrationRateRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -103,7 +103,6 @@ const SewerageServiceLevelRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -288,7 +287,6 @@ const SewerageServiceLevelRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -311,7 +309,6 @@ const SewerageServiceLevelRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -415,7 +412,6 @@ const SewerageServiceLevelRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -39,22 +39,14 @@ import { toGridRows } from "@/components/util/grid/gridFunction";
type ReviewHistoryRow = ReviewHistoryResponse["data"][number]; type ReviewHistoryRow = ReviewHistoryResponse["data"][number];
const checkPrvnStatusCd = (code: string) => {
return (code === '0' || code === '1') ? '미작성' : (code === '2' ? '제출완료' : (code === '3' ? '승인완료' : '반려'));
};
const checkSubmitStatusCd = (code: string) => {
return code === '0' ? '미작성' : (code === '1' ? '작성중' : (code === '2' ? '제출완료' : (code === '3' ? '승인완료' : '보완요청')));
};
const isStatsInputStatusRowApprovable = (row: Record<string, string | number>) => const isStatsInputStatusRowApprovable = (row: Record<string, string | number>) =>
String(row.submitStatusCd ?? "") === "3" && (String(row.prvnStatusCd ?? "") === "2" || String(row.prvnStatusCd ?? "") === "3"); String(row.lclgvSbmsnSttsCd ?? "") === "3" &&
(String(row.mctpvPicSbmsnSttsCd ?? "") === "2" ||
String(row.mctpvPicSbmsnSttsCd ?? "") === "3");
const mapSewerageListToGridRows = (rawList: StatsInputStatusReviewItem[]) => const mapSewerageListToGridRows = (rawList: StatsInputStatusReviewItem[]) =>
rawList.map((r) => ({ rawList.map((r) => ({
...r, ...r,
prvnStatusNm: checkPrvnStatusCd(r.prvnStatusCd || "0"),
submitStatusNm: checkSubmitStatusCd(r.submitStatusCd || "0"),
reviewHistory: "검토이력", reviewHistory: "검토이력",
})); }));
@@ -97,7 +89,7 @@ const StatsInputStatusRvw = () => {
const reviewHistoryColumns = useMemo(() => { const reviewHistoryColumns = useMemo(() => {
const col = createColumnHelper<ReviewHistoryRow>(); const col = createColumnHelper<ReviewHistoryRow>();
return [ return [
col.accessor("logDt", { col.accessor("regDt", {
header: "등록일", header: "등록일",
cell: (info) => info.getValue(), cell: (info) => info.getValue(),
}), }),
@@ -238,23 +230,23 @@ const StatsInputStatusRvw = () => {
const allSubmitStatusApproved = useMemo( const allSubmitStatusApproved = useMemo(
() => () =>
rowData.length > 0 && rowData.length > 0 &&
rowData.every((row) => String(row.submitStatusCd ?? "") === "3"), rowData.every((row) => String(row.lclgvSbmsnSttsCd ?? "") === "3"),
[rowData], [rowData],
); );
/** 진행상태(prvn) 코드가 모두 승인완료(3) */ /** 진행상태(광역) 코드가 모두 승인완료(3) */
const allPrvnStatusApproved = useMemo( const allPrvnStatusApproved = useMemo(
() => () =>
rowData.length > 0 && rowData.length > 0 &&
rowData.every((row) => String(row.prvnStatusCd ?? "") === "3"), rowData.every((row) => String(row.mctpvPicSbmsnSttsCd ?? "") === "3"),
[rowData], [rowData],
); );
/** 진행상태(prvn) 코드가 모두 제출완료(2) */ /** 진행상태(광역) 코드가 모두 제출완료(2) */
const allPrvnStatusSubmitted = useMemo( const allPrvnStatusSubmitted = useMemo(
() => () =>
rowData.length > 0 && rowData.length > 0 &&
rowData.every((row) => String(row.prvnStatusCd ?? "") === "2"), rowData.every((row) => String(row.mctpvPicSbmsnSttsCd ?? "") === "2"),
[rowData], [rowData],
); );
@@ -392,8 +384,8 @@ const StatsInputStatusRvw = () => {
setRowData={setRowData} setRowData={setRowData}
onDataCellClick={handleReviewHistoryCellClick} onDataCellClick={handleReviewHistoryCellClick}
cellStyleCallback={({ row, fieldName }) => { cellStyleCallback={({ row, fieldName }) => {
if (fieldName === "submitStatusNm") { if (fieldName === "lclgvSbmsnSttsNm") {
const statusCd = String(row.submitStatusCd ?? ""); const statusCd = String(row.lclgvSbmsnSttsCd ?? "");
if (statusCd === "0" || statusCd === "1") { if (statusCd === "0" || statusCd === "1") {
return "rg-cell-stats-status-pending"; return "rg-cell-stats-status-pending";
@@ -408,8 +400,8 @@ const StatsInputStatusRvw = () => {
return "rg-cell-stats-status-rejected"; return "rg-cell-stats-status-rejected";
} }
return undefined; return undefined;
} else if (fieldName === "prvnStatusNm") { } else if (fieldName === "mctpvPicSbmsnSttsNm") {
const statusCd = String(row.prvnStatusCd ?? ""); const statusCd = String(row.mctpvPicSbmsnSttsCd ?? "");
if (statusCd === "0" || statusCd === "1") { if (statusCd === "0" || statusCd === "1") {
return "rg-cell-stats-status-pending"; return "rg-cell-stats-status-pending";
@@ -108,7 +108,6 @@ const WaterReuseRvw = () => {
}, [activeStatsStatusInfo.statsCd, lastSearchValues]); }, [activeStatsStatusInfo.statsCd, lastSearchValues]);
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? ""; const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => { const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
if (lastSearchValues == null) return null; if (lastSearchValues == null) return null;
@@ -291,7 +290,6 @@ const WaterReuseRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: row?.splmntOpnnCn ?? "", splmntOpnnCn: row?.splmntOpnnCn ?? "",
splmntRsltCn: row?.splmntRsltCn ?? "",
}); });
return next; return next;
}); });
@@ -314,7 +312,6 @@ const WaterReuseRvw = () => {
next.set(activeTab, { next.set(activeTab, {
...(next.get(activeTab) ?? {}), ...(next.get(activeTab) ?? {}),
splmntOpnnCn: param.splmntOpnnCn, splmntOpnnCn: param.splmntOpnnCn,
splmntRsltCn: param.splmntRsltCn,
}); });
return next; return next;
}); });
@@ -418,7 +415,6 @@ const WaterReuseRvw = () => {
onOpenChange={setReviewOpinionOpen} onOpenChange={setReviewOpinionOpen}
context={reviewOpinionContext} context={reviewOpinionContext}
initialReviewOpinion={latestReviewOpinion} initialReviewOpinion={latestReviewOpinion}
initialProcessHistory={latestProcessHistory}
onSave={saveReviewOpinion} onSave={saveReviewOpinion}
/> />
<ReviewSubmitDialog <ReviewSubmitDialog
@@ -554,17 +554,20 @@ const DetailComponent = ({
const userInfo = await getUserInfo(); const userInfo = await getUserInfo();
let response; let response;
const vrfcSn = detailInfo?.commonInfo.vrfcSn;
if (vrfcSn == null) {
alert("검증 일련번호가 없습니다.");
return;
}
if (!hasPersistedDetails) { if (!hasPersistedDetails) {
response = response =
await generalverificationApiService.RegistVrfcDetail({ await generalverificationApiService.RegistVrfcDetail(vrfcSn, {
vrfcSn: detailInfo?.commonInfo.vrfcSn ?? null,
detailList: rows, detailList: rows,
rgtrUuid: userInfo.userUnqId, rgtrUuid: userInfo.userUnqId,
}); });
} else { } else {
response = response =
await generalverificationApiService.UpdateVrfcDetail({ await generalverificationApiService.UpdateVrfcDetail(vrfcSn, {
vrfcSn: detailInfo?.commonInfo.vrfcSn ?? null,
detailList: rows, detailList: rows,
mdfrUuid: userInfo.userUnqId, mdfrUuid: userInfo.userUnqId,
}); });
@@ -146,9 +146,15 @@ const RegistDialog = memo(
} }
}; };
const handleUpdateVrfcMaster = async (data: GeneralVerificationMasterSubmitFormData) => { const handleUpdateVrfcMaster = async (
updateVrfcSn: number,
body: UpdateVrfcMasterRequest,
) => {
try { try {
const response = await generalverificationApiService.UpdateVrfcMaster(data as UpdateVrfcMasterRequest); const response = await generalverificationApiService.UpdateVrfcMaster(
updateVrfcSn,
body,
);
if (response.status === 'success') { if (response.status === 'success') {
alert('수정되었습니다.'); alert('수정되었습니다.');
@@ -258,8 +264,11 @@ const RegistDialog = memo(
if (await confirm(confirmMessage)) { if (await confirm(confirmMessage)) {
const userInfo = await getUserInfo(); const userInfo = await getUserInfo();
if (isVrfcSn) { if (isVrfcSn) {
const updateData = { if (data.vrfcSn == null) {
vrfcSn: data.vrfcSn, alert('수정 대상이 없습니다.');
return;
}
await handleUpdateVrfcMaster(data.vrfcSn, {
vrfcNm: data.vrfcNm, vrfcNm: data.vrfcNm,
vrfcClsfCd: data.vrfcClsfCd, vrfcClsfCd: data.vrfcClsfCd,
dcptDgt: data.dcptDgt, dcptDgt: data.dcptDgt,
@@ -267,10 +276,8 @@ const RegistDialog = memo(
...(data.dcptDgt === 0 ...(data.dcptDgt === 0
? {} ? {}
: { dcptPrcsMthCd: data.dcptPrcsMthCd }), : { dcptPrcsMthCd: data.dcptPrcsMthCd }),
trgtStatsCd: data.trgtStatsCd,
mdfrUuid: userInfo.userUnqId, mdfrUuid: userInfo.userUnqId,
}; });
await handleUpdateVrfcMaster(updateData);
} else { } else {
const registData = { const registData = {
vrfcNm: data.vrfcNm, vrfcNm: data.vrfcNm,
@@ -481,6 +481,11 @@ export type DataGridProps = {
headerHeight?: number; headerHeight?: number;
/** RealGrid `displayOptions.fitStyle` (기본 EVEN). 컬럼별 width 유지 시 NONE */ /** RealGrid `displayOptions.fitStyle` (기본 EVEN). 컬럼별 width 유지 시 NONE */
fitStyle?: GridFitStyle; fitStyle?: GridFitStyle;
/**
* true면 붙여넣기·편집으로 행을 추가하지 않음.
* 검증 결과처럼 조회 행 수가 고정된 그리드에서 사용.
*/
preventRowAppend?: boolean;
}; };
export type TabDataGridProps = { export type TabDataGridProps = {
@@ -8,6 +8,7 @@ export const doList = [
"4600000000", "4600000000",
"4700000000", "4700000000",
"4800000000", "4800000000",
"5000000000",
]; ];
export const needBsnmFrgnrPoplSmSidoList = [ export const needBsnmFrgnrPoplSmSidoList = [
@@ -27,7 +27,6 @@ export const ExcretaSlurgeProcessingStatusInpColumn = {
'rcycQnt', 'rcycQnt',
'olandLfvlm', 'olandLfvlm',
'incnrQnt', 'incnrQnt',
'oceanInputQnt',
'fuelQnt', 'fuelQnt',
'etcQnt', 'etcQnt',
'unprcsQnt' 'unprcsQnt'
@@ -51,7 +50,6 @@ export const ExcretaSlurgeProcessingStatusInpColumn = {
'rcycQnt', 'rcycQnt',
'olandLfvlm', 'olandLfvlm',
'incnrQnt', 'incnrQnt',
'oceanInputQnt',
'fuelQnt', 'fuelQnt',
'etcQnt', 'etcQnt',
], ],
@@ -61,7 +59,6 @@ export const ExcretaSlurgeProcessingStatusInpColumn = {
{ name: 'rcycQnt', fieldName: 'rcycQnt', header: { text: '재활용' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' }, { name: 'rcycQnt', fieldName: 'rcycQnt', header: { text: '재활용' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'olandLfvlm', fieldName: 'olandLfvlm', header: { text: '육상매립' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' }, { name: 'olandLfvlm', fieldName: 'olandLfvlm', header: { text: '육상매립' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'incnrQnt', fieldName: 'incnrQnt', header: { text: '소각' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' }, { name: 'incnrQnt', fieldName: 'incnrQnt', header: { text: '소각' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'oceanInputQnt', fieldName: 'oceanInputQnt', header: { text: '해양투기' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'fuelQnt', fieldName: 'fuelQnt', header: { text: '연료화' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' }, { name: 'fuelQnt', fieldName: 'fuelQnt', header: { text: '연료화' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
{ name: 'etcQnt', fieldName: 'etcQnt', header: { text: '기타' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' }, { name: 'etcQnt', fieldName: 'etcQnt', header: { text: '기타' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
@@ -100,7 +97,6 @@ export const ExcretaSlurgeProcessingStatusInpColumn = {
'rcycQnt', 'rcycQnt',
'olandLfvlm', 'olandLfvlm',
'incnrQnt', 'incnrQnt',
'oceanInputQnt',
'fuelQnt', 'fuelQnt',
'etcQnt' 'etcQnt'
] ]
@@ -49,6 +49,43 @@ export const ManholeStatusInpColumn = {
styleName: "rg-cell-readonly", styleName: "rg-cell-readonly",
footer: { text: "합계" }, footer: { text: "합계" },
}, },
{
name: "wholMnhlCntSum",
fieldName: "wholMnhlCntSum",
header: { text: "맨홀총계" },
footer: footerInt,
editable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0",
styleName: "rg-cell-readonly",
},
{
name: "frlvlMnhlCntSum",
fieldName: "frlvlMnhlCntSum",
header: { text: "주철계" },
footer: footerInt,
editable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0",
styleName: "rg-cell-readonly",
},
{
name: "thlvlMnhlCntSum",
fieldName: "thlvlMnhlCntSum",
header: { text: "콘크리트계" },
footer: footerInt,
editable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0",
styleName: "rg-cell-readonly",
},
{
name: "picNm",
fieldName: "picNm",
header: { text: "담당자명" },
editable: false,
styleName: "rg-cell-readonly",
},
{ {
...intCol("wholMnhlCnt", "계", false), ...intCol("wholMnhlCnt", "계", false),
computed: { computed: {
@@ -88,6 +125,12 @@ export const ManholeStatusInpColumn = {
}, },
"admdstNm", "admdstNm",
"emphsMngSeNm", "emphsMngSeNm",
{
name: "adminRefGroup",
hideChildHeaders: false,
header: { text: "행정참고자료" },
items: ["wholMnhlCntSum", "frlvlMnhlCntSum", "thlvlMnhlCntSum", "picNm"],
},
{ {
name: "mtrlGroup", name: "mtrlGroup",
hideChildHeaders: false, hideChildHeaders: false,
@@ -75,6 +75,8 @@ export const PublicSewageTreatWaterReuseInpColumn = {
name: 'lglYn', name: 'lglYn',
fieldName: 'lglYn', fieldName: 'lglYn',
header: { text: '법적의무대상(대상/미대상)' }, header: { text: '법적의무대상(대상/미대상)' },
editable: false,
styleName: 'rg-cell-readonly'
}, },
PUBLIC_SEWAGE_TREAT_WATER_REUSE_LGL_YN_VALUES, PUBLIC_SEWAGE_TREAT_WATER_REUSE_LGL_YN_VALUES,
), ),
@@ -346,7 +346,6 @@ const rawSludgeList = [
decimal1Col("rcycQnt", "재활용"), decimal1Col("rcycQnt", "재활용"),
decimal1Col("olandLfvlm", "육상매립"), decimal1Col("olandLfvlm", "육상매립"),
decimal1Col("incnrQnt", "소각"), decimal1Col("incnrQnt", "소각"),
decimal1Col("oceanInputQnt", "해양투기"),
decimal1Col("fuelQnt", "연료화"), decimal1Col("fuelQnt", "연료화"),
decimal1Col("etcQnt", "기타"), decimal1Col("etcQnt", "기타"),
decimal1Col("unprcsQnt", "미처분량\n(이월량)(C)"), decimal1Col("unprcsQnt", "미처분량\n(이월량)(C)"),
@@ -366,7 +365,6 @@ const rawSludgeList = [
"rcycQnt", "rcycQnt",
"olandLfvlm", "olandLfvlm",
"incnrQnt", "incnrQnt",
"oceanInputQnt",
"fuelQnt", "fuelQnt",
"etcQnt", "etcQnt",
], ],
@@ -491,6 +491,10 @@ const rawList = [
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' }, mergeCells: true, sortdisable: true }, { name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' }, mergeCells: true, sortdisable: true },
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, mergeCells: true, sortdisable: true }, { name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, mergeCells: true, sortdisable: true },
{ name: 'emphsMngSeNm', fieldName: 'emphsMngSeNm', header: { text: '집중강우\n중점관리\n구역구분' }, mergeCells: true }, { name: 'emphsMngSeNm', fieldName: 'emphsMngSeNm', header: { text: '집중강우\n중점관리\n구역구분' }, mergeCells: true },
{ name: 'wholMnhlCntSum', fieldName: 'wholMnhlCntSum', header: { text: '맨홀총계' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'frlvlMnhlCntSum', fieldName: 'frlvlMnhlCntSum', header: { text: '주철계' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'thlvlMnhlCntSum', fieldName: 'thlvlMnhlCntSum', header: { text: '콘크리트계' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
{ name: 'picNm', fieldName: 'picNm', header: { text: '담당자명' } },
{ {
name: 'displayYear', name: 'displayYear',
fieldName: 'displayYear', fieldName: 'displayYear',
@@ -544,6 +548,12 @@ const rawList = [
], ],
}, },
'emphsMngSeNm', 'emphsMngSeNm',
{
name: 'adminRefGroup',
hideChildHeaders: false,
header: { text: '행정참고자료' },
items: ['wholMnhlCntSum', 'frlvlMnhlCntSum', 'thlvlMnhlCntSum', 'picNm'],
},
'displayYear', 'displayYear',
{ {
name: 'mtrlGroup', name: 'mtrlGroup',
@@ -17,12 +17,12 @@ const StatsInputStatusInfoColumnRaw = {
styleName: 'rg-cell-outline-action-btn', styleName: 'rg-cell-outline-action-btn',
}, },
{ name: 'chargerNm', fieldName: 'chargerNm', header: { text: '제출자' } }, { name: 'lclgvPicNm', fieldName: 'lclgvPicNm', header: { text: '제출자' } },
{ name: 'chargerCttpc', fieldName: 'chargerCttpc', header: { text: '연락처' } }, { name: 'lclgvPicTelnoCn', fieldName: 'lclgvPicTelnoCn', header: { text: '연락처' } },
{ name: 'submitStatusNm', fieldName: 'submitStatusNm', header: { text: '지자체진행상태' } }, { name: 'lclgvSbmsnSttsNm', fieldName: 'lclgvSbmsnSttsNm', header: { text: '지자체진행상태' } },
{ name: 'submitStatusCd', fieldName: 'submitStatusCd', header: { text: '지자체진행상태코드' }, visible: false }, { name: 'lclgvSbmsnSttsCd', fieldName: 'lclgvSbmsnSttsCd', header: { text: '지자체진행상태코드' }, visible: false },
{ name: 'prvnStatusNm', fieldName: 'prvnStatusNm', header: { text: '진행상태' } }, { name: 'mctpvPicSbmsnSttsNm', fieldName: 'mctpvPicSbmsnSttsNm', header: { text: '진행상태' } },
{ name: 'prvnStatusCd', fieldName: 'prvnStatusCd', header: { text: '진행상태코드' }, visible: false }, { name: 'mctpvPicSbmsnSttsCd', fieldName: 'mctpvPicSbmsnSttsCd', header: { text: '진행상태코드' }, visible: false },
], ],
columnLayout: [ columnLayout: [
@@ -30,14 +30,14 @@ const StatsInputStatusInfoColumnRaw = {
'sggNm', 'sggNm',
'tabNm', 'tabNm',
'reviewHistory', 'reviewHistory',
'chargerNm', 'lclgvPicNm',
'chargerCttpc', 'lclgvPicTelnoCn',
'submitStatusNm', 'lclgvSbmsnSttsNm',
'prvnStatusNm', 'mctpvPicSbmsnSttsNm',
'statsCd', 'statsCd',
'sewerBzmnCd', 'sewerBzmnCd',
'submitStatusCd', 'lclgvSbmsnSttsCd',
'prvnStatusCd' 'mctpvPicSbmsnSttsCd',
] ]
}; };
@@ -710,6 +710,10 @@ const rawSewagePipeTotList = [
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false }, { name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
{ name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역명" }, editable: false }, { name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역명" }, editable: false },
{ name: "emphsMngSeNm", fieldName: "emphsMngSeNm", header: { text: "집중강우\n중점관리\n구역구분" }, editable: false }, { name: "emphsMngSeNm", fieldName: "emphsMngSeNm", header: { text: "집중강우\n중점관리\n구역구분" }, editable: false },
{ name: "wholMnhlCntSum", fieldName: "wholMnhlCntSum", header: { text: "맨홀총계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "frlvlMnhlCntSum", fieldName: "frlvlMnhlCntSum", header: { text: "주철계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "thlvlMnhlCntSum", fieldName: "thlvlMnhlCntSum", header: { text: "콘크리트계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "picNm", fieldName: "picNm", header: { text: "담당자명" }, editable: false },
{ name: "wholMnhlCnt", fieldName: "wholMnhlCnt", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false }, { name: "wholMnhlCnt", fieldName: "wholMnhlCnt", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "frlvlMnhlCnt", fieldName: "frlvlMnhlCnt", header: { text: "주철" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false }, { name: "frlvlMnhlCnt", fieldName: "frlvlMnhlCnt", header: { text: "주철" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
{ name: "sclvlMnhlCnt", fieldName: "sclvlMnhlCnt", header: { text: "주철(조화)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false }, { name: "sclvlMnhlCnt", fieldName: "sclvlMnhlCnt", header: { text: "주철(조화)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
@@ -720,6 +724,11 @@ const rawSewagePipeTotList = [
columnLayout: [ columnLayout: [
{ name: "addrGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] }, { name: "addrGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
"emphsMngSeNm", "emphsMngSeNm",
{
name: "adminRefGroup",
header: { text: "행정참고자료" },
items: ["wholMnhlCntSum", "frlvlMnhlCntSum", "thlvlMnhlCntSum", "picNm"],
},
{ {
name: "mtrlGroup", name: "mtrlGroup",
header: { text: "맨홀뚜껑 재질(개)" }, header: { text: "맨홀뚜껑 재질(개)" },
@@ -16,7 +16,6 @@ export const HumanWasteSludgeTab4ColumnConfig = {
{ name: "rcycQnt", fieldName: "rcycQnt", header: { text: "재활용" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "rcycQnt", fieldName: "rcycQnt", header: { text: "재활용" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "olandLfvlm", fieldName: "olandLfvlm", header: { text: "육상매립" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "olandLfvlm", fieldName: "olandLfvlm", header: { text: "육상매립" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "incnrQnt", fieldName: "incnrQnt", header: { text: "소각" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "incnrQnt", fieldName: "incnrQnt", header: { text: "소각" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "oceanInputQnt", fieldName: "oceanInputQnt", header: { text: "해양투기" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "fuelQnt", fieldName: "fuelQnt", header: { text: "연료화" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "fuelQnt", fieldName: "fuelQnt", header: { text: "연료화" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "etcQnt", fieldName: "etcQnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "etcQnt", fieldName: "etcQnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
{ name: "unprcsQnt", fieldName: "unprcsQnt", header: { text: "미처분량\n(이월량)(C)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false }, { name: "unprcsQnt", fieldName: "unprcsQnt", header: { text: "미처분량\n(이월량)(C)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
@@ -29,7 +28,7 @@ export const HumanWasteSludgeTab4ColumnConfig = {
{ {
name: "dspsGroup", name: "dspsGroup",
header: { text: "처분량" }, header: { text: "처분량" },
items: ["wholDspsQnt", "rcycQnt", "olandLfvlm", "incnrQnt", "oceanInputQnt", "fuelQnt", "etcQnt"] items: ["wholDspsQnt", "rcycQnt", "olandLfvlm", "incnrQnt", "fuelQnt", "etcQnt"]
}, },
"unprcsQnt", "unprcsQnt",
"swtrmtFcltNm" "swtrmtFcltNm"
+85 -3
View File
@@ -1,4 +1,4 @@
import type { GridView } from "realgrid"; import { type GridView, ValueType } from "realgrid";
import type { import type {
ColumnConfig, ColumnConfig,
@@ -124,6 +124,82 @@ export function getNonEditableColumnFieldNames(
return fieldNames; return fieldNames;
} }
type ExcelImportCell = {
t?: string;
v?: unknown;
w?: string;
};
/** 엑셀 셀 → 그리드 값. NUMBER 컬럼만 숫자화하고, 코드(01)는 문자열로 유지 */
export function parseExcelImportCellValue(
cell: ExcelImportCell | undefined,
valueType?: ColumnConfig["valueType"],
): string | number {
if (!cell || cell.v === undefined || cell.v === null || cell.v === "") {
return "";
}
if (valueType === ValueType.NUMBER) {
if (typeof cell.v === "number" && !Number.isNaN(cell.v)) {
return cell.v;
}
const stringValue = String(cell.v);
const numericValue = Number(stringValue.replace(/,/g, ""));
if (!Number.isNaN(numericValue) && stringValue.trim() !== "") {
return numericValue;
}
return stringValue;
}
const formatted = typeof cell.w === "string" ? cell.w.trim() : "";
if (/^0\d+$/.test(formatted)) {
return formatted;
}
return String(cell.v);
}
function collectZeroPaddedCodeWidths(
rows: Record<string, string | number>[],
): Map<string, number> {
const widthByField = new Map<string, number>();
for (const row of rows) {
for (const [field, value] of Object.entries(row)) {
const s = String(value ?? "").trim();
if (!/^0\d+$/.test(s)) continue;
widthByField.set(field, Math.max(widthByField.get(field) ?? 0, s.length));
}
}
return widthByField;
}
function restoreImportedCodeLeadingZeros(
importedRow: Record<string, string | number>,
existingRow: Record<string, string | number> | undefined,
codeWidthByField: Map<string, number>,
): Record<string, string | number> {
const next: Record<string, string | number> = { ...importedRow };
for (const [field, value] of Object.entries(next)) {
if (value === "" || value == null) continue;
if (typeof value === "number" && !Number.isInteger(value)) continue;
const importedStr = String(value).trim();
if (!/^\d+$/.test(importedStr)) continue;
const existingStr =
existingRow != null ? String(existingRow[field] ?? "").trim() : "";
let width = codeWidthByField.get(field);
if (!width && /^0\d+$/.test(existingStr)) {
width = existingStr.length;
}
if (!width && field.endsWith("Cd") && importedStr.length <= 2) {
width = 2;
}
if (width && importedStr.length < width) {
next[field] = importedStr.padStart(width, "0");
}
}
return next;
}
/** 엑셀 import 결과를 기존 행과 병합 — preserveFieldNames는 기존 그리드 값 유지 */ /** 엑셀 import 결과를 기존 행과 병합 — preserveFieldNames는 기존 그리드 값 유지 */
export function mergeExcelImportWithExistingRows( export function mergeExcelImportWithExistingRows(
existingRows: Record<string, string | number>[], existingRows: Record<string, string | number>[],
@@ -134,14 +210,20 @@ export function mergeExcelImportWithExistingRows(
options?.preserveFieldNames && options.preserveFieldNames.length > 0 options?.preserveFieldNames && options.preserveFieldNames.length > 0
? new Set(options.preserveFieldNames) ? new Set(options.preserveFieldNames)
: null; : null;
const codeWidthByField = collectZeroPaddedCodeWidths(existingRows);
return importedRows.map((importedRow, index) => { return importedRows.map((importedRow, index) => {
const existingRow = existingRows[index]; const existingRow = existingRows[index];
if (!existingRow) return { ...importedRow }; const normalizedImported = restoreImportedCodeLeadingZeros(
importedRow,
existingRow,
codeWidthByField,
);
if (!existingRow) return normalizedImported;
const merged: Record<string, string | number> = { const merged: Record<string, string | number> = {
...existingRow, ...existingRow,
...importedRow, ...normalizedImported,
}; };
if (preserveSet) { if (preserveSet) {
for (const fieldName of preserveSet) { for (const fieldName of preserveSet) {
@@ -0,0 +1,23 @@
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
import type {
ImrRequest,
ImrResponse,
rollbackStatusRequest,
} from "@/entities/statistics/model/statistics-interface";
/** 제출 직후 IMR 요청이 실패하면 검증 이전 상태로 롤백 */
export async function callImrServiceWithRollbackOnFailure(
imrParam: ImrRequest,
rollbackParam: rollbackStatusRequest,
): Promise<ImrResponse> {
try {
return await statisticsApi.callImrService(imrParam);
} catch (error) {
try {
await statisticsApi.rollbackStatus(rollbackParam);
} catch {
// 롤백 실패는 IMR 실패를 가리지 않음
}
throw error;
}
}
@@ -0,0 +1,13 @@
import type { Sgg } from "@/entities/statistics/model/statistics-interface";
/** 조회 시군구가 전체(ALL)면 시도의 전체 옵션, 특정 구면 해당 구만 */
export function filterSggOptionsBySearchGugun(
sggOptions: readonly Sgg[],
gugun: string | null | undefined,
): Sgg[] {
const selected = gugun?.trim();
if (!selected || selected === "ALL") {
return [...sggOptions];
}
return sggOptions.filter((s) => s.gugun === selected);
}
@@ -1,6 +1,9 @@
import type { StatisticsInputCommonInfoBase } from "@/entities/statistics/model/statistics-interface"; import type { StatisticsInputCommonInfoBase } from "@/entities/statistics/model/statistics-interface";
import type { VerificationResultLikeMap } from "./verification-result-display"; import {
normalizeVerificationResultMap,
type VerificationResultLikeMap,
} from "./verification-result-display";
export function isVerificationFailedFromCommonInfo( export function isVerificationFailedFromCommonInfo(
commonInfo: Pick<StatisticsInputCommonInfoBase, "isVerificationFailed"> | null | undefined, commonInfo: Pick<StatisticsInputCommonInfoBase, "isVerificationFailed"> | null | undefined,
@@ -28,6 +31,9 @@ export function patchFooterVerificationByTab(
| undefined, | undefined,
): Map<string, VerificationResultLikeMap | null> { ): Map<string, VerificationResultLikeMap | null> {
const next = new Map(prev); const next = new Map(prev);
next.set(tabKey, commonInfo?.verificationResult ?? null); next.set(
tabKey,
normalizeVerificationResultMap(commonInfo?.verificationResult) ?? null,
);
return next; return next;
} }
@@ -13,6 +13,49 @@ export type VerificationResultLikeMap = Record<
VerificationResultLikeItem[] VerificationResultLikeItem[]
>; >;
/** 입력 조회 verificationResult의 기준값/입력값이 null이면 "-" */
export function displayVerificationCn(
value: string | null | undefined,
): string {
if (value == null || String(value).trim() === "") return "-";
return String(value);
}
export function normalizeVerificationResultItem<T extends VerificationResultLikeItem>(
item: T,
): T {
return {
...item,
nowCn: displayVerificationCn(item.nowCn ?? item.nowVlCn),
cmprCn: displayVerificationCn(item.cmprCn ?? item.compVlCn),
};
}
export function normalizeVerificationResultMap<T extends VerificationResultLikeMap>(
result: T | null | undefined,
): T | undefined {
if (!result || typeof result !== "object") return undefined;
const next = {} as T;
for (const [key, items] of Object.entries(result)) {
(next as VerificationResultLikeMap)[key] = Array.isArray(items)
? items.map((item) => normalizeVerificationResultItem(item))
: [];
}
return next;
}
/** 조회 행/객체에 붙은 verificationResult의 cmprCn·nowCn null을 "-"로 바꿈 */
export function withNormalizedVerificationResult<T extends object>(item: T): T {
if (!("verificationResult" in item) || item.verificationResult == null) {
return item;
}
const verificationResult = normalizeVerificationResultMap(
item.verificationResult as VerificationResultLikeMap,
);
if (!verificationResult) return item;
return { ...item, verificationResult };
}
/** 검증 오류 배열 → RealGrid styleName */ /** 검증 오류 배열 → RealGrid styleName */
export function getVerificationStyleName( export function getVerificationStyleName(
errors: VerificationResultLikeItem[] | null | undefined, errors: VerificationResultLikeItem[] | null | undefined,
@@ -37,8 +80,8 @@ export function formatVerificationTooltip(
: e.vrfcCd === "NV" : e.vrfcCd === "NV"
? "일반검증 - " ? "일반검증 - "
: "모집단 검증 - "; : "모집단 검증 - ";
const comp = e.cmprCn ?? e.compVlCn ?? ""; const comp = displayVerificationCn(e.cmprCn ?? e.compVlCn);
const now = e.nowCn ?? e.nowVlCn ?? ""; const now = displayVerificationCn(e.nowCn ?? e.nowVlCn);
return `${prefix}${e.rsnExpln}\n(검증 기준값: ${comp} / 현재 입력값: ${now})`; return `${prefix}${e.rsnExpln}\n(검증 기준값: ${comp} / 현재 입력값: ${now})`;
}) })
.filter(Boolean) .filter(Boolean)
@@ -56,10 +56,11 @@ export class GeneralverificationApiService implements GeneralverificationService
} }
public async UpdateVrfcMaster( public async UpdateVrfcMaster(
vrfcSn: number,
param: UpdateVrfcMasterRequest, param: UpdateVrfcMasterRequest,
): Promise<UpdateVrfcMasterResponse> { ): Promise<UpdateVrfcMasterResponse> {
const response = await stClient.put<UpdateVrfcMasterResponse>( const response = await stClient.put<UpdateVrfcMasterResponse>(
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/masters/${param.vrfcSn}`, `${ENDPOINT.ST_SERVICE.INPUTVERIFY}/masters/${vrfcSn}`,
param, param,
); );
return response.data; return response.data;
@@ -127,20 +128,22 @@ export class GeneralverificationApiService implements GeneralverificationService
} }
public async RegistVrfcDetail( public async RegistVrfcDetail(
vrfcSn: number,
param: VerifyDetailRegistRequest, param: VerifyDetailRegistRequest,
): Promise<RegistVrfcMasterResponse> { ): Promise<RegistVrfcMasterResponse> {
const response = await stClient.post<RegistVrfcMasterResponse>( const response = await stClient.post<RegistVrfcMasterResponse>(
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/${param.vrfcSn}/details`, `${ENDPOINT.ST_SERVICE.INPUTVERIFY}/${vrfcSn}/details`,
param, param,
); );
return response.data; return response.data;
} }
public async UpdateVrfcDetail( public async UpdateVrfcDetail(
vrfcSn: number,
param: VerifyDetailUpdateRequest, param: VerifyDetailUpdateRequest,
): Promise<RegistVrfcMasterResponse> { ): Promise<RegistVrfcMasterResponse> {
const response = await stClient.put<RegistVrfcMasterResponse>( const response = await stClient.put<RegistVrfcMasterResponse>(
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/${param.vrfcSn}/details`, `${ENDPOINT.ST_SERVICE.INPUTVERIFY}/${vrfcSn}/details`,
param, param,
); );
return response.data; return response.data;
@@ -22,6 +22,8 @@ import type {
SewageSlurgeProcessingFacStatusSubmitRequest, SewageSlurgeProcessingFacStatusSubmitRequest,
SewageSlurgeProcessingFacStatusSubmitResponse, SewageSlurgeProcessingFacStatusSubmitResponse,
SlurgeProcessingFacStatusApiResponse, SlurgeProcessingFacStatusApiResponse,
SlurgeProcessingFacStatusOperationDataUpdateRequest,
SlurgeProcessingFacStatusOperationDataUpdateResponse,
SlurgeProcessingFacStatusSaveRequest, SlurgeProcessingFacStatusSaveRequest,
SlurgeProcessingFacStatusSaveResponse, SlurgeProcessingFacStatusSaveResponse,
SlurgeProcessingFacStatusSubmitRequest, SlurgeProcessingFacStatusSubmitRequest,
@@ -68,6 +70,18 @@ export class StatisticsInputSewageExcretaSlurgeApiService implements StatisticsI
return response.data; return response.data;
} }
/** 찌꺼기(슬러지)처리시설현황 운영 데이터 업데이트 — ST00110001 */
public async updateSlurgeProcessingFacStatusOperationData(
request: SlurgeProcessingFacStatusOperationDataUpdateRequest,
): Promise<SlurgeProcessingFacStatusOperationDataUpdateResponse> {
const response =
await stClient.put<SlurgeProcessingFacStatusOperationDataUpdateResponse>(
`${BASE}/slurge-processing-fac-status/operation-data/update`,
request,
);
return response.data;
}
/** 소화조 운영현황 조회 — ST00110002 */ /** 소화조 운영현황 조회 — ST00110002 */
public async getDigestorOperatingStatusList( public async getDigestorOperatingStatusList(
params: SewageExcretaSlurgeRequestParams, params: SewageExcretaSlurgeRequestParams,
@@ -16,6 +16,8 @@ import {
type ImrStatusResponse, type ImrStatusResponse,
type ReviewerInfoRequest, type ReviewerInfoRequest,
type ReviewerInfoResponse, type ReviewerInfoResponse,
type rollbackStatusRequest,
type rollbackStatusResponse,
type ReviewInputSaveRequest, type ReviewInputSaveRequest,
type ReviewOpinionSaveRequest, type ReviewOpinionSaveRequest,
type ReviewOpinionSaveResponse, type ReviewOpinionSaveResponse,
@@ -156,6 +158,17 @@ export class StatisticsApiService implements StatisticsService {
return response.data; return response.data;
} }
// 입력 - 검증 이전 상태로 롤백
public async rollbackStatus(
param: rollbackStatusRequest,
): Promise<rollbackStatusResponse> {
const response = await stClient.put<rollbackStatusResponse>(
`${ENDPOINT.ST_SERVICE.INPUTCOMMON}/rollback-status`,
param,
);
return response.data;
}
public async callImrService(param: ImrRequest): Promise<ImrResponse> { public async callImrService(param: ImrRequest): Promise<ImrResponse> {
const response = await client.post<ImrResponse>( const response = await client.post<ImrResponse>(
`${ENDPOINT.STATVERIFY_SERVICE.IMR}`, `${ENDPOINT.STATVERIFY_SERVICE.IMR}`,
@@ -46,7 +46,6 @@ export interface CheckVerificationNameResponse {
} }
export interface UpdateVrfcMasterRequest { export interface UpdateVrfcMasterRequest {
vrfcSn?: number | null;
vrfcNm?: string | null; vrfcNm?: string | null;
vrfcClsfCd?: string | null; vrfcClsfCd?: string | null;
dcptDgt?: number | null; dcptDgt?: number | null;
@@ -184,13 +183,11 @@ export interface VerifyDetailRegistData {
} }
export interface VerifyDetailRegistRequest { export interface VerifyDetailRegistRequest {
vrfcSn: number | null;
detailList: VerifyDetailRegistData[]; detailList: VerifyDetailRegistData[];
rgtrUuid: string; rgtrUuid: string;
} }
export interface VerifyDetailUpdateRequest { export interface VerifyDetailUpdateRequest {
vrfcSn: number | null;
detailList: VerifyDetailRegistData[]; detailList: VerifyDetailRegistData[];
mdfrUuid: string; mdfrUuid: string;
} }
@@ -297,6 +294,7 @@ export interface GeneralverificationService {
param: CheckVerificationNameRequest, param: CheckVerificationNameRequest,
): Promise<CheckVerificationNameResponse>; ): Promise<CheckVerificationNameResponse>;
UpdateVrfcMaster( UpdateVrfcMaster(
vrfcSn: number,
param: UpdateVrfcMasterRequest, param: UpdateVrfcMasterRequest,
): Promise<UpdateVrfcMasterResponse>; ): Promise<UpdateVrfcMasterResponse>;
RegistVrfcMaster( RegistVrfcMaster(
@@ -315,9 +313,11 @@ export interface GeneralverificationService {
param: string, param: string,
): Promise<VerifyColumnListResponse>; ): Promise<VerifyColumnListResponse>;
RegistVrfcDetail( RegistVrfcDetail(
vrfcSn: number,
param: VerifyDetailRegistRequest, param: VerifyDetailRegistRequest,
): Promise<RegistVrfcMasterResponse>; ): Promise<RegistVrfcMasterResponse>;
UpdateVrfcDetail( UpdateVrfcDetail(
vrfcSn: number,
param: VerifyDetailUpdateRequest, param: VerifyDetailUpdateRequest,
): Promise<RegistVrfcMasterResponse>; ): Promise<RegistVrfcMasterResponse>;
CopyVrfcData( CopyVrfcData(
@@ -205,6 +205,23 @@ export interface SlurgeProcessingFacStatusSubmitResponse {
}; };
} }
/** ST00110001 운영 데이터 업데이트 요청 */
export interface SlurgeProcessingFacStatusOperationDataUpdateRequest {
statsYr: string;
ctpvNm: string;
/** 도에서만 사용, 특·광역시는 빈 값 */
sggNm?: string;
sewerBzmnCd: string;
userUuid: string;
}
/** ST00110001 운영 데이터 업데이트 응답 */
export interface SlurgeProcessingFacStatusOperationDataUpdateResponse {
status: string;
message?: string;
data?: unknown | null;
}
/** /**
* ST00110002 조회 `data.digestorOperatingStatusList[]` 한 행. * ST00110002 조회 `data.digestorOperatingStatusList[]` 한 행.
* `DigestorOperatingStatusInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명). * `DigestorOperatingStatusInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명).
@@ -437,7 +454,6 @@ export interface ExcretaSlurgeProcessingStatusItem {
rcycQnt: number; rcycQnt: number;
olandLfvlm: number; olandLfvlm: number;
incnrQnt: number; incnrQnt: number;
oceanInputQnt: number;
fuelQnt: number; fuelQnt: number;
etcQnt: number; etcQnt: number;
unprcsQnt: number; unprcsQnt: number;
@@ -562,6 +578,10 @@ export interface StatisticsInputSewageExcretaSlurgeService {
submitSlurgeProcessingFacStatus( submitSlurgeProcessingFacStatus(
request: SlurgeProcessingFacStatusSubmitRequest, request: SlurgeProcessingFacStatusSubmitRequest,
): Promise<SlurgeProcessingFacStatusSubmitResponse>; ): Promise<SlurgeProcessingFacStatusSubmitResponse>;
/** 찌꺼기(슬러지)처리시설현황 운영 데이터 업데이트 — ST00110001 */
updateSlurgeProcessingFacStatusOperationData(
request: SlurgeProcessingFacStatusOperationDataUpdateRequest,
): Promise<SlurgeProcessingFacStatusOperationDataUpdateResponse>;
/** 소화조 운영현황 조회 — ST00110002 */ /** 소화조 운영현황 조회 — ST00110002 */
getDigestorOperatingStatusList( getDigestorOperatingStatusList(
params: SewageExcretaSlurgeRequestParams, params: SewageExcretaSlurgeRequestParams,
@@ -81,7 +81,6 @@ export interface ReportStatusResponseDto {
lastCfmtnPicTelnoCn?: string | null; lastCfmtnPicTelnoCn?: string | null;
lastCfmtnPicDeptNm?: string | null; lastCfmtnPicDeptNm?: string | null;
lastCfmtnPicJbgdNm?: string | null; lastCfmtnPicJbgdNm?: string | null;
splmntRsltCn?: string | null;
splmntOpnnCn?: string | null; splmntOpnnCn?: string | null;
rjctOpnnCn?: string | null; rjctOpnnCn?: string | null;
} }
@@ -308,7 +308,6 @@ export interface SeweragePipeInputPipeTypeStatusSaveItem {
rmrk: string | null; rmrk: string | null;
lyngPrlgWhol: number; lyngPrlgWhol: number;
dmltnPrlgWhol: number; dmltnPrlgWhol: number;
pipeByPrstWhol: number;
} }
/** 관종별 현황 저장 API 요청 */ /** 관종별 현황 저장 API 요청 */
@@ -420,6 +419,10 @@ export interface SeweragePipeInputManholeStatusItem {
folvlMnhlCnt: number; folvlMnhlCnt: number;
filvlMnhlCnt: number; filvlMnhlCnt: number;
rmrk: string; rmrk: string;
wholMnhlCntSum: number;
frlvlMnhlCntSum: number;
thlvlMnhlCntSum: number;
picNm: string | null;
verificationResult?: SeweragePipeInputVerificationResult; verificationResult?: SeweragePipeInputVerificationResult;
} }
@@ -9,12 +9,12 @@ export interface StatsInputStatusReviewItem {
sewerBzmnCd?: string; sewerBzmnCd?: string;
tabNm?: string; tabNm?: string;
statsCd?: string; statsCd?: string;
submitStatusNm?: string; lclgvPicNm?: string;
prvnStatusNm?: string; lclgvPicTelnoCn?: string;
chargerNm?: string; lclgvSbmsnSttsCd?: string;
chargerCttpc?: string; lclgvSbmsnSttsNm?: string;
submitStatusCd?: string; mctpvPicSbmsnSttsCd?: string;
prvnStatusCd?: string; mctpvPicSbmsnSttsNm?: string;
} }
export interface StatsInputStatusReviewResponseData { export interface StatsInputStatusReviewResponseData {
@@ -37,7 +37,7 @@ export interface ReviewHistoryResponse {
status: string; status: string;
message?: string; message?: string;
data: { data: {
logDt: string; regDt: string;
historyContent: string; historyContent: string;
}[] }[]
} }
@@ -31,6 +31,21 @@ export interface cancelSubmitResponse {
message?: string; message?: string;
} }
/** 검증 이전 상태로 롤백 요청 */
export interface rollbackStatusRequest {
statsYr: string;
statsCd: string;
sewerBzmnCd: string;
rollbackStatusCode: string;
mdfrUuid: string;
}
/** 검증 이전 상태로 롤백 응답 */
export interface rollbackStatusResponse {
status: string;
message?: string;
}
export interface ApiResponse<T> { export interface ApiResponse<T> {
status: string; status: string;
data?: T; data?: T;
@@ -327,7 +342,6 @@ export interface ReviewOpinionDetailItem {
sewerBzmnCd: string; sewerBzmnCd: string;
statsCd: string; statsCd: string;
splmntOpnnCn: string | null; splmntOpnnCn: string | null;
splmntRsltCn: string | null;
mdfrUuid: string | null; mdfrUuid: string | null;
} }
@@ -343,7 +357,6 @@ export interface ReviewOpinionSaveRequest {
sewerBzmnCd: string; sewerBzmnCd: string;
statsCd: string; statsCd: string;
splmntOpnnCn: string; splmntOpnnCn: string;
splmntRsltCn: string;
mdfrUuid: string; mdfrUuid: string;
} }
@@ -388,7 +401,6 @@ export interface ReviewSubmitRequest {
/** 통계항목 단위 제출 시 사용 (통계 입력 현황 일괄 제출에는 미사용) */ /** 통계항목 단위 제출 시 사용 (통계 입력 현황 일괄 제출에는 미사용) */
statsCd?: string; statsCd?: string;
splmntOpnnCn?: string; splmntOpnnCn?: string;
splmntRsltCn?: string;
} }
export interface ReviewSubmitResponse { export interface ReviewSubmitResponse {
@@ -454,7 +466,6 @@ export interface ReviewerInfoResponse {
dpmNm: string; dpmNm: string;
cps: string; cps: string;
splmntOpnnCn: string; splmntOpnnCn: string;
splmntRsltCn: string;
} }
} }
@@ -478,9 +489,8 @@ export interface StatiscicsManagementReviewHistoryItem {
ctpvNm: string; ctpvNm: string;
sggNm: string; sggNm: string;
menuNm: string; menuNm: string;
wrterOpinionSm: string | null; splmntOpnnCn: string | null;
chckerOpinionSm: string | null; rjctOpnnCn: string | null;
returnOpinionSm: string | null;
} }
export interface StatiscicsManagementReviewHistoryResponse { export interface StatiscicsManagementReviewHistoryResponse {
@@ -557,6 +567,7 @@ export interface StatisticsService {
saveStatsInputPeriod(param: StatsInputPeriodSaveRequest): Promise<StatsInputPeriodSaveApiResponse>; saveStatsInputPeriod(param: StatsInputPeriodSaveRequest): Promise<StatsInputPeriodSaveApiResponse>;
deleteStatsInputPeriod(param: StatsInputPeriodDeleteRequest): Promise<StatsInputPeriodDeleteApiResponse>; deleteStatsInputPeriod(param: StatsInputPeriodDeleteRequest): Promise<StatsInputPeriodDeleteApiResponse>;
cancelSubmit(param: cancelSubmitRequest): Promise<cancelSubmitResponse>; cancelSubmit(param: cancelSubmitRequest): Promise<cancelSubmitResponse>;
rollbackStatus(param: rollbackStatusRequest): Promise<rollbackStatusResponse>;
callImrService(param: ImrRequest): Promise<ImrResponse>; callImrService(param: ImrRequest): Promise<ImrResponse>;
submitException(param: SubmitExceptionRequest): Promise<SubmitExceptionResponse>; submitException(param: SubmitExceptionRequest): Promise<SubmitExceptionResponse>;
getLogList(param: StatisticsLogRequest): Promise<StatisticsLogResponse>; getLogList(param: StatisticsLogRequest): Promise<StatisticsLogResponse>;
@@ -127,7 +127,6 @@ export interface HumanWasteSludgeReviewItem {
rcycQnt: number | null; rcycQnt: number | null;
olandLfvlm: number | null; olandLfvlm: number | null;
incnrQnt: number | null; incnrQnt: number | null;
oceanInputQnt: number | null;
fuelQnt: number | null; fuelQnt: number | null;
etcQnt: number | null; etcQnt: number | null;
unprcsQnt: number | null; unprcsQnt: number | null;
@@ -218,7 +217,6 @@ export function mapSewageExcretaSlurgeReviewRows(list: unknown[]): object[] {
rcycQnt: row.rcycQnt ?? 0, rcycQnt: row.rcycQnt ?? 0,
olandLfvlm: row.olandLfvlm ?? 0, olandLfvlm: row.olandLfvlm ?? 0,
incnrQnt: row.incnrQnt ?? 0, incnrQnt: row.incnrQnt ?? 0,
oceanInputQnt: row.oceanInputQnt ?? 0,
fuelQnt: row.fuelQnt ?? 0, fuelQnt: row.fuelQnt ?? 0,
etcQnt: row.etcQnt ?? 0, etcQnt: row.etcQnt ?? 0,
unprcsQnt: row.unprcsQnt ?? 0, unprcsQnt: row.unprcsQnt ?? 0,
@@ -108,5 +108,4 @@ export interface StatsStatusInfo {
mctpvPicSbmsnSttsCd?: string; mctpvPicSbmsnSttsCd?: string;
rjctOpnnCn?: string; rjctOpnnCn?: string;
splmntOpnnCn?: string; splmntOpnnCn?: string;
splmntRsltCn?: string;
} }
@@ -247,6 +247,10 @@ export interface SewagePipeReviewManholeItem {
folvlMnhlCnt: number; folvlMnhlCnt: number;
filvlMnhlCnt: number; filvlMnhlCnt: number;
rmrk: string | null; rmrk: string | null;
wholMnhlCntSum: number;
frlvlMnhlCntSum: number;
thlvlMnhlCntSum: number;
picNm: string | null;
} }
export interface SewagePipeManholeResponseData { export interface SewagePipeManholeResponseData {
@@ -266,5 +270,4 @@ export interface StatsStatusInfo {
mctpvPicSbmsnSttsCd?: string; mctpvPicSbmsnSttsCd?: string;
rjctOpnnCn?: string; rjctOpnnCn?: string;
splmntOpnnCn?: string; splmntOpnnCn?: string;
splmntRsltCn?: string;
} }
@@ -59,7 +59,6 @@ export interface statsStatusInfo {
mctpvPicSbmsnSttsCd?: string; mctpvPicSbmsnSttsCd?: string;
rjctOpnnCn?: string; rjctOpnnCn?: string;
splmntOpnnCn?: string; splmntOpnnCn?: string;
splmntRsltCn?: string;
} }
export interface SewerageSupplyRateReviewResponseData { export interface SewerageSupplyRateReviewResponseData {
@@ -168,6 +168,10 @@ export interface FcltyManholeSummaryItem {
thlvlMnhlCnt: number; thlvlMnhlCnt: number;
folvlMnhlCnt: number; folvlMnhlCnt: number;
filvlMnhlCnt: number; filvlMnhlCnt: number;
wholMnhlCntSum: number;
frlvlMnhlCntSum: number;
thlvlMnhlCntSum: number;
picNm: string | null;
} }
/** /**
@@ -135,7 +135,6 @@ export interface HumanWasteSludgeStatusTotalItem {
rcycQnt: number; rcycQnt: number;
olandLfvlm: number; olandLfvlm: number;
incnrQnt: number; incnrQnt: number;
oceanInputQnt: number;
fuelQnt: number; fuelQnt: number;
etcQnt: number; etcQnt: number;
unprcsQnt: number; unprcsQnt: number;
@@ -1,5 +1,7 @@
export const STATISTICS_ROUTE = "/statistics"; export const STATISTICS_ROUTE = "/statistics";
export const STATISTICS_TAB_QUERY_KEY = "tab"; export const STATISTICS_TAB_QUERY_KEY = "tab";
/** 기본 화면(대시보드) 도움말 매칭용. URL에는 넣지 않음 */
export const STATISTICS_DASHBOARD_TAB_ID = "Dashboard";
export function buildStatisticsTabUrl(tabId: string): string { export function buildStatisticsTabUrl(tabId: string): string {
return `${STATISTICS_ROUTE}?${STATISTICS_TAB_QUERY_KEY}=${encodeURIComponent(tabId)}`; return `${STATISTICS_ROUTE}?${STATISTICS_TAB_QUERY_KEY}=${encodeURIComponent(tabId)}`;
@@ -1,13 +1,20 @@
import { PageTitle } from "@common/components"; import { PageTitle } from "@common/components";
import { findMenuItemByUrlPath } from "@/shared/lib/stats-cd-input-navigation";
import { STATISTICS_DASHBOARD_TAB_ID } from "@/shared/lib/statistics-tab-url";
import { TabBar } from "./tab-bar"; import { TabBar } from "./tab-bar";
import { useTabStore } from "@/store/tab-store"; import { useTabStore } from "@/store/tab-store";
function StatisticsPageLayout({ children }: { children: React.ReactNode }) { function StatisticsPageLayout({ children }: { children: React.ReactNode }) {
const { activeTabId, tabs } = useTabStore(); const { activeTabId, tabs, menuList } = useTabStore();
const pageTitle = tabs.find((t) => t.id === activeTabId); const pageTitle = tabs.find((t) => t.id === activeTabId);
const dashboardMenu =
!pageTitle && menuList
? findMenuItemByUrlPath(menuList, STATISTICS_DASHBOARD_TAB_ID)
: null;
const menuPaths = pageTitle?.path?.split(">").map((path) => path.trim()); const menuPaths = pageTitle?.path?.split(">").map((path) => path.trim());
@@ -16,7 +23,7 @@ function StatisticsPageLayout({ children }: { children: React.ReactNode }) {
<TabBar /> <TabBar />
<PageTitle <PageTitle
title={pageTitle?.label ?? ""} title={pageTitle?.label ?? ""}
menuCd={pageTitle?.menuItem?.menuCd} menuCd={pageTitle?.menuItem?.menuCd ?? dashboardMenu?.menuCd}
menuPaths={menuPaths ?? []} menuPaths={menuPaths ?? []}
/> />
{children} {children}
+4 -8
View File
@@ -113,12 +113,8 @@ export async function PUT(
} }
function getCookieDomain(): string | undefined { function getCookieDomain(): string | undefined {
if (typeof window === "undefined") return undefined; // 개발에서는 현재 사이트 전용, 운영에서는 환경변수의 공용 도메인을 사용한다.
return process.env.NODE_ENV === "production"
if (COOKIE_DOMAIN) return COOKIE_DOMAIN; ? COOKIE_DOMAIN || undefined
: undefined;
const { hostname } = window.location;
if (hostname === "localhost" || hostname === "127.0.0.1") return undefined;
return hostname;
} }