From 34092ada252e87e4514ac178df01a11bc864e4eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=84=B1=EC=98=81?= Date: Tue, 21 Oct 2025 11:02:43 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=89=EC=83=81=EC=B2=98=EB=A6=AC=20?= =?UTF-8?q?=EB=B0=B1=EC=97=94=EB=93=9C=20->=20=ED=94=84=EB=A1=A0=ED=8A=B8?= =?UTF-8?q?=EC=97=94=EB=93=9C=20=EC=B2=98=EB=A6=AC=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD,=20=EB=A7=88=EC=8A=A4=ED=84=B0=20=EA=B7=B8=EB=A6=AC?= =?UTF-8?q?=EB=93=9C=20dataSource=20=EC=97=90=EC=84=9C=20ajax=20=ED=98=B8?= =?UTF-8?q?=EC=B6=9C=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 초기화 에러 수정, 그외 기타 수정 --- .../noti/service/impl/NotiServiceImpl.java | 63 +---- src/main/webapp/WEB-INF/views/noti/list.jsp | 228 ++++++++++++------ 2 files changed, 150 insertions(+), 141 deletions(-) diff --git a/src/main/java/go/kr/project/noti/service/impl/NotiServiceImpl.java b/src/main/java/go/kr/project/noti/service/impl/NotiServiceImpl.java index f71bb4a..d0b1a0b 100644 --- a/src/main/java/go/kr/project/noti/service/impl/NotiServiceImpl.java +++ b/src/main/java/go/kr/project/noti/service/impl/NotiServiceImpl.java @@ -9,7 +9,7 @@ import lombok.extern.slf4j.Slf4j; import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; import org.springframework.stereotype.Service; -import java.util.*; +import java.util.List; /** @@ -40,66 +40,7 @@ public class NotiServiceImpl extends EgovAbstractServiceImpl implements NotiServ @Override public List selectImpltInfoList(NotiImpltInfoVO vo) { - List list = mapper.selectImpltInfoList(vo); - - // 중요로직: 같은 단속년도(crdnYr), 단속번호(crdnNo) 그룹별로 그리드 행에 CSS 클래스를 적용 - applyRowColorByGroup(list); - - return list; - } - - /** - * 단속년도, 단속번호 그룹별로 행 색상 클래스 적용 - * 중요한 로직 주석: 같은 단속년도와 단속번호를 가진 행들에게 그룹별로 다른 색상을 적용합니다. - * @param list 이행정보 목록 - */ - private void applyRowColorByGroup(List list) { - // 단속년도 + 단속번호 조합을 키로 하여 그룹 인덱스 매핑 - Map groupIndexMap = new LinkedHashMap<>(); - int groupIndex = 0; - - // 첫 번째 패스: 각 단속년도+단속번호 조합에 그룹 인덱스 할당 - for (NotiImpltInfoVO item : list) { - if (item.getCrdnYr() != null && item.getCrdnNo() != null) { - String groupKey = item.getCrdnYr() + "-" + item.getCrdnNo(); - - if (!groupIndexMap.containsKey(groupKey)) { - groupIndexMap.put(groupKey, groupIndex++); - } - } - } - - // 두 번째 패스: 각 항목에 _attributes 설정 - for (NotiImpltInfoVO item : list) { - try { - if (item.getCrdnYr() != null && item.getCrdnNo() != null) { - String groupKey = item.getCrdnYr() + "-" + item.getCrdnNo(); - Integer currentGroupIndex = groupIndexMap.get(groupKey); - - if (currentGroupIndex != null) { - // TUI Grid _attributes 설정 - Map attributes = new HashMap<>(); - Map className = new HashMap<>(); - List rowClass = new ArrayList<>(); - - // 그룹 인덱스의 홀/짝에 따라 색상 클래스 적용 - if (currentGroupIndex % 2 == 0) { - rowClass.add("tui-grid-custom-color-blue"); - } else { - rowClass.add("tui-grid-custom-color-red"); - } - - className.put("row", rowClass); - attributes.put("className", className); - item.set_attributes(attributes); - } - } - } catch (Exception e) { - // 예외 발생 시 로그를 남기고 계속 진행 - log.warn("Failed to apply row color for crdnYr: {}, crdnNo: {}", - item.getCrdnYr(), item.getCrdnNo(), e); - } - } + return mapper.selectImpltInfoList(vo); } // ==================== 이행 대상자 정보(TB_IMPLT_TRPR_INFO) 관련 메서드 ==================== diff --git a/src/main/webapp/WEB-INF/views/noti/list.jsp b/src/main/webapp/WEB-INF/views/noti/list.jsp index 715b2be..19b79be 100644 --- a/src/main/webapp/WEB-INF/views/noti/list.jsp +++ b/src/main/webapp/WEB-INF/views/noti/list.jsp @@ -100,8 +100,14 @@