Map<String,Object> courseMap = new HashMap<>();
for(vo tv: volist){
String key = tv.getCourseId() + "_" + tv.getCalendarId() + "_" + tv.getClassId();String value = tv.getContent() + "(" + 1 + ")";boolean flag = courseMap.containsKey(key);if (flag) { int courseNum=1; String content = (String) courseMap.get(key); String[] split = content.split("\\("); courseNum = Integer.parseInt(split[1].split("\\)")[0]); courseNum++; value = tv.getContent() + "(" + courseNum + ")";}courseMap.put(key, value);
}
时间: 2024-10-04 10:22:06