From 305baa8c58a14d26f8deb2a9c9f797ca7122e3fc Mon Sep 17 00:00:00 2001 From: "hehihoho3@gmail.com" Date: Tue, 5 Aug 2025 14:51:14 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=B5=ED=86=B5=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20=ED=8C=9D?= =?UTF-8?q?=EC=97=85=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cmn/config/CustomUserDetailsService.java | 2 +- .../resources/templates/itn/code/list.html | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/itn/admin/cmn/config/CustomUserDetailsService.java b/src/main/java/com/itn/admin/cmn/config/CustomUserDetailsService.java index 7e3128c..cf32e1d 100644 --- a/src/main/java/com/itn/admin/cmn/config/CustomUserDetailsService.java +++ b/src/main/java/com/itn/admin/cmn/config/CustomUserDetailsService.java @@ -31,7 +31,7 @@ public class CustomUserDetailsService implements UserDetailsService { if (user == null) { throw new UsernameNotFoundException("User not found"); } - log.info("DB Password: {}", user.getPassword()); +// log.info("DB Password: {}", user.getPassword()); // log.info("Encoded password: {}", passwordEncoder.encode("내가 입력한 비밀번호")); // log.info("match? {}", passwordEncoder.matches("내가 입력한 비밀번호", user.getPassword())); diff --git a/src/main/resources/templates/itn/code/list.html b/src/main/resources/templates/itn/code/list.html index b2a8b25..74b4729 100644 --- a/src/main/resources/templates/itn/code/list.html +++ b/src/main/resources/templates/itn/code/list.html @@ -418,6 +418,8 @@ let currentCodeGroupId; // 전역 변수로 코드 그룹 ID를 저장 + let maxCodeId = 0; + let maxSortOrder = 0; // 코드 상세보기 모달을 표시하는 함수 window.showDetails = function(codeGroupId) { currentCodeGroupId = codeGroupId; // 현재 코드 그룹 ID 저장 @@ -427,7 +429,17 @@ success: function(data) { let detailTableBody = $('#detailTableBody'); detailTableBody.empty(); + maxCodeId = 0; // Reset for the current group + maxSortOrder = 0; // Reset for the current group data.forEach(function(detail) { + let currentCodeId = parseInt(detail.codeId, 10); + if (!isNaN(currentCodeId) && currentCodeId > maxCodeId) { + maxCodeId = currentCodeId; + } + let currentSortOrder = parseInt(detail.sortOrder, 10); + if (!isNaN(currentSortOrder) && currentSortOrder > maxSortOrder) { + maxSortOrder = currentSortOrder; + } detailTableBody.append('' + '' + detail.codeId + '' + '' + detail.codeName + '' + @@ -435,7 +447,7 @@ '' + detail.sortOrder + '' + '' + detail.useYn + '' + '' + - '' + + '' + ''); }); $('#commonCodeDetailModal').modal('show'); @@ -465,7 +477,13 @@ // 코드 상세 추가 모달을 표시하는 함수 window.showAddCodeDetailModal = function() { + const newCodeId = maxCodeId + 10; + const newSortOrder = maxSortOrder + 1; + $('#detailCodeGroupId').val(currentCodeGroupId); // 코드 그룹 ID 필드에 현재 ID 설정 + $('#detailCodeId').val(newCodeId); + $('#detailCodeValue').val(newCodeId); + $('#detailSortOrder').val(newSortOrder); $('#addCodeDetailModal').modal('show'); // 상세 추가 모달 표시 };