diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/course/controller/SeCourseController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/course/controller/SeCourseController.java index 7d83fb5..fc741bc 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/course/controller/SeCourseController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/course/controller/SeCourseController.java @@ -503,6 +503,81 @@ public class SeCourseController extends JeecgController queryByYear() { + List list = seCourseService.list(); + //int xhcs = list.size() / 8 + (list.size() % 8 == 0 ? 0 : 1); + List> listmap1 = new ArrayList<>(); + //for(int k = 0 ; k> listmap = new ArrayList<>(); + Map map = new HashMap(); + Map map2 = new HashMap(); + List delelist = new ArrayList<>(); + for(int i = 0 ; i < list.size() ; i++){ + Map map1 = new HashMap(); + if(list.get(i).getYear()==1&&!map.containsKey("one")){ + map.put("one",list.get(i).getName()); + map1.put("one",list.get(i).getName()); + delelist.add(list.get(i)); + //list.remove(i); + }else if(list.get(i).getYear()==2&&!map.containsKey("two")){ + map.put("two",list.get(i).getName()); + map1.put("two",list.get(i).getName()); + delelist.add(list.get(i)); + //list.remove(i); + }else if(list.get(i).getYear()==3&&!map.containsKey("three")){ + map.put("three",list.get(i).getName()); + map1.put("three",list.get(i).getName()); + delelist.add(list.get(i)); + //list.remove(i); + }else if(list.get(i).getYear()==4&&!map.containsKey("four")){ + map.put("four",list.get(i).getName()); + map1.put("four",list.get(i).getName()); + delelist.add(list.get(i)); + //list.remove(i); + }else if(list.get(i).getYear()==5&&!map.containsKey("five")){ + map.put("five",list.get(i).getName()); + map1.put("five",list.get(i).getName()); + delelist.add(list.get(i)); + //list.remove(i); + }else if(list.get(i).getYear()==6&&!map.containsKey("six")){ + map.put("six",list.get(i).getName()); + map1.put("six",list.get(i).getName()); + delelist.add(list.get(i)); + //list.remove(i); + }else if(list.get(i).getYear()==7&&!map.containsKey("seven")){ + map.put("seven",list.get(i).getName()); + map1.put("seven",list.get(i).getName()); + delelist.add(list.get(i)); + //list.remove(i); + }else if(list.get(i).getYear()==8&&!map.containsKey("eight")){ + map.put("eight",list.get(i).getName()); + map1.put("eight",list.get(i).getName()); + delelist.add(list.get(i)); + //list.remove(i); + }else{ + + } + if(map1.size()!=0){ + map2.putAll(map1); + } + } + list.removeAll(delelist); + listmap1.add(map2); + //} + } + + return Result.OK(listmap1); + } + @AutoLog(value = "当前登录用户信息") @ApiOperation(value = "当前登录用户信息", notes = "当前登录用户信息") @GetMapping(value = "/dqyh")