From f220904742618ea8b07a7628ffd9dbd76fcb49a0 Mon Sep 17 00:00:00 2001 From: jangwoong Date: Mon, 19 Oct 2026 19:05:09 +0900 Subject: [PATCH] =?UTF-8?q?[as]=202=EC=B0=A8=20=EA=B2=B0=EC=9E=AC=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=ED=91=9C=EC=8B=9C=20=EB=B6=80=EB=B6=84=20?= =?UTF-8?q?=EA=B2=80=EC=A6=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../elapr/lib/approval-request-utils.ts | 10 ++++++++-- .../ui/components/floating-action-buttons.tsx | 20 +++++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/apps/as/src/entities/elapr/lib/approval-request-utils.ts b/apps/as/src/entities/elapr/lib/approval-request-utils.ts index 7886e0ad2..d196b0ea4 100644 --- a/apps/as/src/entities/elapr/lib/approval-request-utils.ts +++ b/apps/as/src/entities/elapr/lib/approval-request-utils.ts @@ -6,8 +6,11 @@ export function hasCurrentUserPendingApprovalRequest( ): boolean { if (!currentUserUuid) return false; + const normalizedUserUuid = currentUserUuid.toLowerCase(); return list.some( - (row) => row.aprvrUuid === currentUserUuid && row.atrzPrgrsSttsComCd === "ATRZ_PRGRS_002", + (row) => + row.aprvrUuid?.toLowerCase() === normalizedUserUuid && + row.atrzPrgrsSttsComCd === "ATRZ_PRGRS_002", ); } @@ -17,7 +20,10 @@ export function findCurrentUserPendingApprovalRequest( ): ElaprDocPrgrsResponseDto | undefined { if (!currentUserUuid) return undefined; + const normalizedUserUuid = currentUserUuid.toLowerCase(); return list?.find( - (row) => row.aprvrUuid === currentUserUuid && row.atrzPrgrsSttsComCd === "ATRZ_PRGRS_002", + (row) => + row.aprvrUuid?.toLowerCase() === normalizedUserUuid && + row.atrzPrgrsSttsComCd === "ATRZ_PRGRS_002", ); } diff --git a/apps/as/src/pages/fnrs-cnsltn/ui/components/floating-action-buttons.tsx b/apps/as/src/pages/fnrs-cnsltn/ui/components/floating-action-buttons.tsx index cb42a6523..0e9c87181 100644 --- a/apps/as/src/pages/fnrs-cnsltn/ui/components/floating-action-buttons.tsx +++ b/apps/as/src/pages/fnrs-cnsltn/ui/components/floating-action-buttons.tsx @@ -201,13 +201,14 @@ function FloatingActionButtons({ userInfo?.userUnqId, ); const currentUserPrgrsRow = elaprPrgrsForPending.find( - (row) => row.aprvrUuid === userInfo?.userUnqId, + (row) => row.aprvrUuid?.toLowerCase() === userInfo?.userUnqId?.toLowerCase(), ); const userPendingPrgrs = elaprPrgrsForPending.find( (row) => - row.aprvrUuid === userInfo?.userUnqId && + row.aprvrUuid?.toLowerCase() === userInfo?.userUnqId?.toLowerCase() && row.atrzPrgrsSttsComCd === "ATRZ_PRGRS_002", ); + const userBranchId = userPendingPrgrs?.branchId ?? currentUserPrgrsRow?.branchId; const userBranchSeCd = (userPendingPrgrs?.branchSeCd ?? currentUserPrgrsRow?.branchSeCd) as | "SP" | "SF" @@ -255,7 +256,10 @@ function FloatingActionButtons({ if (!isForkJoin || !userBranchSeCd) return undefined; // 1. elaprBranchList API 응답에서 사용자 브랜치 상태 확인 - const matchedBranch = elaprBranchList.find((b) => b.branchSeCd === userBranchSeCd); + // 현재 결재선(2차 차수 등)의 고유 branchId로 우선 매칭하고, 없으면 findLast로 최신 차수 브랜치 매칭 + const matchedBranch = userBranchId + ? elaprBranchList.find((b) => b.branchId === userBranchId) + : elaprBranchList.findLast((b) => b.branchSeCd === userBranchSeCd); if (matchedBranch?.branchSttsCd) { return matchedBranch.branchSttsCd; } @@ -281,7 +285,15 @@ function FloatingActionButtons({ } return undefined; - }, [elaprBranchList, elaprPrgrsForPending, isForkJoin, prgrsSttsComCd, supplementDmndBranch, userBranchSeCd]); + }, [ + elaprBranchList, + elaprPrgrsForPending, + isForkJoin, + prgrsSttsComCd, + supplementDmndBranch, + userBranchId, + userBranchSeCd, + ]); const isBranchInProgress = isForkJoin && userBranchSttsCd === "IN_PROGRESS" && dtlInstCd === "ROLE_USER01";