|
|
|
@ -49,25 +49,36 @@ public class ClassifyApi {
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
String dept = AuthUtil.getUser().getDeptId(); |
|
|
|
|
// if (!("0").equals(dept)){
|
|
|
|
|
// if (!deptId.contains(dept)){
|
|
|
|
|
// log.error(method+"当前登录人无法对选择部门进行考核");
|
|
|
|
|
// return R.fail("此账号无法对该部门进行考核");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
List<Long> a = new ArrayList<>(); |
|
|
|
|
List<Long> list = Func.toLongList(deptId); |
|
|
|
|
Long goal = list.get(list.size() - 1); |
|
|
|
|
a.addAll(list); |
|
|
|
|
Long aLong = list.get(list.size() - 1); |
|
|
|
|
List<Long> userDeptList = Func.toLongList(dept); |
|
|
|
|
a.addAll(userDeptList); |
|
|
|
|
// list.addAll(userDeptList);
|
|
|
|
|
a = a.stream().distinct().collect(Collectors.toList()); |
|
|
|
|
int indexOf = list.indexOf(aLong); |
|
|
|
|
if (indexOf == list.size()){ |
|
|
|
|
a.remove(indexOf); |
|
|
|
|
|
|
|
|
|
List<Long> a = list.stream().filter(f -> !userDeptList.contains(f)).collect(Collectors.toList()); |
|
|
|
|
if (a.size() == 0){ |
|
|
|
|
//判断自身部门权限是否和考核一样
|
|
|
|
|
boolean flag = list.stream().allMatch(all -> userDeptList.contains(all)); |
|
|
|
|
if (flag){ |
|
|
|
|
List<ClassifyApiVO> detail = new ArrayList<>(); |
|
|
|
|
return R.data(detail); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Long goal = list.get(list.size() - 1); |
|
|
|
|
//
|
|
|
|
|
// List<Long> a = new ArrayList<>();
|
|
|
|
|
// a.addAll(list);
|
|
|
|
|
// Long aLong = list.get(list.size() - 1);
|
|
|
|
|
//// a.addAll(userDeptList);
|
|
|
|
|
//// list.addAll(userDeptList);
|
|
|
|
|
// a = a.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
//// int indexOf = list.indexOf(aLong);
|
|
|
|
|
//// if (indexOf == list.size()){
|
|
|
|
|
//// a.remove(indexOf);
|
|
|
|
|
//// }
|
|
|
|
|
// int indexOf = userDeptList.indexOf(aLong);
|
|
|
|
|
// if (indexOf >= 0){
|
|
|
|
|
// //自身存在有考核最后一级部门
|
|
|
|
|
// a.remove(a.indexOf(aLong));
|
|
|
|
|
// }
|
|
|
|
|
String collect = a.stream().map(String::valueOf).collect(Collectors.joining(",")); |
|
|
|
|
List<ClassifyApiVO> detail = classifyService.selectClassifyList(collect,goal); |
|
|
|
|
return R.data(detail); |
|
|
|
|