|
@@ -1,5 +1,6 @@
|
|
|
package com.management.platform.service.impl;
|
|
package com.management.platform.service.impl;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -233,6 +234,25 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
|
|
|
mealMap.put("date",sdf.format(date));
|
|
mealMap.put("date",sdf.format(date));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ Integer status = (Integer) mealMap.get("status");
|
|
|
|
|
+ if (status != null) {
|
|
|
|
|
+ switch (status) {
|
|
|
|
|
+ case 0 :
|
|
|
|
|
+ case 3:
|
|
|
|
|
+ mealMap.put("statusString","缺餐");
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ mealMap.put("statusString","已就餐");
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ default:
|
|
|
|
|
+ mealMap.put("statusString","未报餐");
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//
|
|
//
|
|
@@ -250,6 +270,7 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
|
|
|
switch (status) {
|
|
switch (status) {
|
|
|
case 0 :
|
|
case 0 :
|
|
|
ApplyAmount += 1;
|
|
ApplyAmount += 1;
|
|
|
|
|
+ overLine += 1;
|
|
|
break;
|
|
break;
|
|
|
case 1:
|
|
case 1:
|
|
|
ApplyAmount += 1;
|
|
ApplyAmount += 1;
|
|
@@ -259,7 +280,7 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
|
|
|
cancel += 1;
|
|
cancel += 1;
|
|
|
case 3:
|
|
case 3:
|
|
|
ApplyAmount += 1;
|
|
ApplyAmount += 1;
|
|
|
- cancel += 1;
|
|
|
|
|
|
|
+ overLine += 1;
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
@@ -278,32 +299,23 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
|
|
|
|
|
|
|
|
mealList.addAll(totalList);
|
|
mealList.addAll(totalList);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- List<Map<String,Object>> records= new ArrayList<>();
|
|
|
|
|
- if(!StringUtils.isEmpty(deptIds)){
|
|
|
|
|
- String[] split = deptIds.split(",");
|
|
|
|
|
- for (String deptId : split) {
|
|
|
|
|
- List<Integer> branchDepartment = getBranchDepartment(Integer.valueOf(deptId), departmentList);
|
|
|
|
|
- deptIdList.addAll(branchDepartment);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
User count = new User();//小计一栏
|
|
User count = new User();//小计一栏
|
|
|
count.setId("0");
|
|
count.setId("0");
|
|
|
userList.add(count);
|
|
userList.add(count);
|
|
|
-
|
|
|
|
|
|
|
+ List<Map<String,Object>> records = new ArrayList<>();
|
|
|
for(User itemUser:userList){
|
|
for(User itemUser:userList){
|
|
|
Map<String,Object> map=new HashMap<>();
|
|
Map<String,Object> map=new HashMap<>();
|
|
|
String personId = itemUser.getId();
|
|
String personId = itemUser.getId();
|
|
|
map.put("userId",itemUser.getId());
|
|
map.put("userId",itemUser.getId());
|
|
|
map.put("name",itemUser.getName());
|
|
map.put("name",itemUser.getName());
|
|
|
if (map.get("userId").equals("0")) {
|
|
if (map.get("userId").equals("0")) {
|
|
|
- map.put("name","小计");
|
|
|
|
|
|
|
+ map.put("departmentName","小计");
|
|
|
}
|
|
}
|
|
|
map.put("departmentId",itemUser.getDepartmentId());
|
|
map.put("departmentId",itemUser.getDepartmentId());
|
|
|
- String departmentName="未设置部门";
|
|
|
|
|
-
|
|
|
|
|
- Integer departmentId = Integer.valueOf(String.valueOf(map.get("departmentId")));
|
|
|
|
|
- map.put("departmentName", getBranchDepartment(departmentId, departmentList));
|
|
|
|
|
|
|
+ if(map.get("departmentId")!=null){
|
|
|
|
|
+ Integer departmentId = Integer.valueOf(String.valueOf(map.get("departmentId")));
|
|
|
|
|
+ map.put("departmentName", convertDepartmentIdToCascade(departmentId, departmentList));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
List<Map<String,Object>> personList = new ArrayList<>();
|
|
List<Map<String,Object>> personList = new ArrayList<>();
|
|
|
if (personId!= null){
|
|
if (personId!= null){
|
|
@@ -343,4 +355,28 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
|
|
|
}
|
|
}
|
|
|
return list;
|
|
return list;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //将部门id转换为部门层级
|
|
|
|
|
+ private String convertDepartmentIdToCascade(Integer id, List<Department> allDeptList) {
|
|
|
|
|
+ StringBuilder cascade = new StringBuilder();
|
|
|
|
|
+ Integer finalId = id;
|
|
|
|
|
+ Optional<Department> first = allDeptList.stream().filter(al -> finalId != null && finalId.equals(al.getDepartmentId())).findFirst();
|
|
|
|
|
+ if (!first.isPresent()) {
|
|
|
|
|
+ cascade.append("未设置部门");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cascade.append(first.get().getDepartmentName());
|
|
|
|
|
+ id = findById(id, allDeptList).getSuperiorId();
|
|
|
|
|
+ while (id != null) {
|
|
|
|
|
+ Integer finalId1 = id;
|
|
|
|
|
+ Optional<Department> first1 = allDeptList.stream().filter(al -> finalId1 != null && finalId1.equals(al.getDepartmentId())).findFirst();
|
|
|
|
|
+ cascade.append("/").append(first1.get().getDepartmentName());
|
|
|
|
|
+ id = findById(id, allDeptList).getSuperiorId();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return cascade.toString();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private Department findById(int id, List<Department> allList) {
|
|
|
|
|
+ return allList.stream().filter(all->all.getDepartmentId().intValue() == id).findFirst().get();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|