|
@@ -18,7 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody; |
|
@@ -18,7 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody; |
18
|
import org.springframework.web.bind.annotation.RequestMapping;
|
18
|
import org.springframework.web.bind.annotation.RequestMapping;
|
19
|
import org.springframework.web.bind.annotation.ResponseBody;
|
19
|
import org.springframework.web.bind.annotation.ResponseBody;
|
20
|
|
20
|
|
21
|
-import java.util.List;
|
21
|
+import java.util.*;
|
|
|
22
|
+import java.util.stream.Collectors;
|
22
|
|
23
|
|
23
|
@Controller
|
24
|
@Controller
|
24
|
@RequestMapping("module")
|
25
|
@RequestMapping("module")
|
|
@@ -42,6 +43,37 @@ public class ModuleCtrl { |
|
@@ -42,6 +43,37 @@ public class ModuleCtrl { |
42
|
return new BaseResponse<List<User>>();
|
43
|
return new BaseResponse<List<User>>();
|
43
|
}
|
44
|
}
|
44
|
|
45
|
|
|
|
46
|
+ List<ModuleGroup> groups=moduleGroupMapper.selectAll();
|
|
|
47
|
+ Map<String,Integer> groupSeq=groups.stream().collect(Collectors.toMap(ModuleGroup::getName, ModuleGroup::getSeqNO));
|
|
|
48
|
+ for(AuthModule a:list){
|
|
|
49
|
+ if(groupSeq.containsKey(a.getModuleGroup())){
|
|
|
50
|
+ a.setModuleGroupSeq(groupSeq.get(a.getModuleGroup()));
|
|
|
51
|
+ }else{
|
|
|
52
|
+ a.setModuleGroupSeq(0);
|
|
|
53
|
+ }
|
|
|
54
|
+ }
|
|
|
55
|
+
|
|
|
56
|
+ Collections.sort(list, new Comparator(){
|
|
|
57
|
+ @Override
|
|
|
58
|
+ public int compare(Object o1, Object o2) {
|
|
|
59
|
+ AuthModule stu1=(AuthModule)o1;
|
|
|
60
|
+ AuthModule stu2=(AuthModule)o2;
|
|
|
61
|
+ if(stu1.getModuleGroupSeq()
|
|
|
62
|
+ >stu2.getModuleGroupSeq()){
|
|
|
63
|
+ return 1;
|
|
|
64
|
+ }else if(stu1.getModuleGroupSeq()==stu2.getModuleGroupSeq()){
|
|
|
65
|
+ if(stu1.getId()>stu2.getId()){
|
|
|
66
|
+ return 1;
|
|
|
67
|
+ }else {
|
|
|
68
|
+ return -1;
|
|
|
69
|
+ }
|
|
|
70
|
+ }else{
|
|
|
71
|
+ return -1;
|
|
|
72
|
+ }
|
|
|
73
|
+ }
|
|
|
74
|
+ });
|
|
|
75
|
+
|
|
|
76
|
+
|
45
|
return new BaseResponse<List<AuthModule>>(list);
|
77
|
return new BaseResponse<List<AuthModule>>(list);
|
46
|
}catch (Exception e){
|
78
|
}catch (Exception e){
|
47
|
log.error("getAll error",e);
|
79
|
log.error("getAll error",e);
|