|
@@ -371,7 +371,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|
fillSubDepartmentList(departmentList, rootDeptVO, departmentOtherManagerList);
|
|
fillSubDepartmentList(departmentList, rootDeptVO, departmentOtherManagerList);
|
|
});
|
|
});
|
|
//递归排序
|
|
//递归排序
|
|
- seqResultDeptList(list);
|
|
|
|
|
|
+ sortResultDeptList(list);
|
|
//返回数据
|
|
//返回数据
|
|
httpRespMsg.data = list;
|
|
httpRespMsg.data = list;
|
|
} catch (NullPointerException e) {
|
|
} catch (NullPointerException e) {
|
|
@@ -511,6 +511,8 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|
}
|
|
}
|
|
list.add(departmentMasterVO);
|
|
list.add(departmentMasterVO);
|
|
}
|
|
}
|
|
|
|
+ //对部门排序
|
|
|
|
+ list.sort(Comparator.comparing(l->l.getSeq()));
|
|
resultMap.put("totalCostMoney", totalCostMoney);
|
|
resultMap.put("totalCostMoney", totalCostMoney);
|
|
resultMap.put("costList", list);
|
|
resultMap.put("costList", list);
|
|
if(functionCostList.size()==0){
|
|
if(functionCostList.size()==0){
|
|
@@ -1535,10 +1537,10 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public HttpRespMsg seqList(HttpServletRequest request, List<DepartmentVO> list) {
|
|
|
|
|
|
+ public HttpRespMsg sortList(HttpServletRequest request, List<DepartmentVO> list) {
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
ArrayList<Department> departments = new ArrayList<>();
|
|
ArrayList<Department> departments = new ArrayList<>();
|
|
- seqDeptList(departments, list);
|
|
|
|
|
|
+ sortDeptList(departments, list);
|
|
departmentService.updateBatchById(departments);
|
|
departmentService.updateBatchById(departments);
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
@@ -1548,11 +1550,11 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|
* @param list
|
|
* @param list
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public List<DepartmentVO> seqResultDeptList(List<DepartmentVO> list){
|
|
|
|
|
|
+ public List<DepartmentVO> sortResultDeptList(List<DepartmentVO> list){
|
|
list.sort(Comparator.comparing(dept->dept.getSeq()));
|
|
list.sort(Comparator.comparing(dept->dept.getSeq()));
|
|
for (DepartmentVO departmentVO : list) {
|
|
for (DepartmentVO departmentVO : list) {
|
|
if (departmentVO.getChildren()!=null){
|
|
if (departmentVO.getChildren()!=null){
|
|
- seqResultDeptList(departmentVO.getChildren());
|
|
|
|
|
|
+ sortResultDeptList(departmentVO.getChildren());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return list;
|
|
return list;
|
|
@@ -1562,7 +1564,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|
* 递归对DepartmentVO进行拆分排序
|
|
* 递归对DepartmentVO进行拆分排序
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public List<Department> seqDeptList(ArrayList<Department> departments,List<DepartmentVO> list){
|
|
|
|
|
|
+ public List<Department> sortDeptList(ArrayList<Department> departments,List<DepartmentVO> list){
|
|
Integer seq = 1;
|
|
Integer seq = 1;
|
|
for (DepartmentVO departmentVO : list) {
|
|
for (DepartmentVO departmentVO : list) {
|
|
Department department = new Department();
|
|
Department department = new Department();
|
|
@@ -1571,7 +1573,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|
seq++;
|
|
seq++;
|
|
departments.add(department);
|
|
departments.add(department);
|
|
if (departmentVO.getChildren()!=null){
|
|
if (departmentVO.getChildren()!=null){
|
|
- seqDeptList(departments,departmentVO.getChildren());
|
|
|
|
|
|
+ sortDeptList(departments,departmentVO.getChildren());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return departments;
|
|
return departments;
|