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";