|
|
|
|
@ -9,7 +9,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -40,7 +40,66 @@ public class NotiServiceImpl extends EgovAbstractServiceImpl implements NotiServ
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<NotiImpltInfoVO> selectImpltInfoList(NotiImpltInfoVO vo) {
|
|
|
|
|
return mapper.selectImpltInfoList(vo);
|
|
|
|
|
List<NotiImpltInfoVO> list = mapper.selectImpltInfoList(vo);
|
|
|
|
|
|
|
|
|
|
// 중요로직: 같은 단속년도(crdnYr), 단속번호(crdnNo) 그룹별로 그리드 행에 CSS 클래스를 적용
|
|
|
|
|
applyRowColorByGroup(list);
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 단속년도, 단속번호 그룹별로 행 색상 클래스 적용
|
|
|
|
|
* 중요한 로직 주석: 같은 단속년도와 단속번호를 가진 행들에게 그룹별로 다른 색상을 적용합니다.
|
|
|
|
|
* @param list 이행정보 목록
|
|
|
|
|
*/
|
|
|
|
|
private void applyRowColorByGroup(List<NotiImpltInfoVO> list) {
|
|
|
|
|
// 단속년도 + 단속번호 조합을 키로 하여 그룹 인덱스 매핑
|
|
|
|
|
Map<String, Integer> 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<String, Object> attributes = new HashMap<>();
|
|
|
|
|
Map<String, Object> className = new HashMap<>();
|
|
|
|
|
List<String> 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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ==================== 이행 대상자 정보(TB_IMPLT_TRPR_INFO) 관련 메서드 ====================
|
|
|
|
|
|