|
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.LinkedHashSet;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -74,12 +75,17 @@ public class HandleBusinessServiceImpl implements HandleBusinessService{
|
|
|
List<HandleDept> handleDepts = handleDeptDao.findById(handleBusiness.getId());
|
|
|
// 获取分页后的 HandleMatters 对象
|
|
|
List<HandleMatters> allHandleMatters = new ArrayList<>();
|
|
|
+ LinkedHashSet<HandleDept> allHandleDepts = new LinkedHashSet<>();
|
|
|
int total = 0;
|
|
|
for (HandleDept handleDept : handleDepts) {
|
|
|
long deptId = handleDept.getId();
|
|
|
List<HandleMatters> handleMattersList = handleMattersDao.findByDeptIdAndWindowNum(deptId,windowNum);
|
|
|
allHandleMatters.addAll(handleMattersList);
|
|
|
total += handleMattersDao.queryCount(deptId,windowNum);
|
|
|
+ for (HandleMatters handleMatters : handleMattersList) {
|
|
|
+ HandleDept dept = handleDeptDao.selectOne(handleMatters.getDeptId().longValue());
|
|
|
+ allHandleDepts.add(dept);
|
|
|
+ }
|
|
|
}
|
|
|
// 计算分页参数
|
|
|
int offset = (currentPage - 1) * pageSize;
|
|
@@ -92,7 +98,7 @@ public class HandleBusinessServiceImpl implements HandleBusinessService{
|
|
|
int totalPages = (int) Math.ceil((double) total / pageSize);
|
|
|
// 将数据放入 map 中
|
|
|
map.put("handleBusiness", handleBusiness);
|
|
|
- map.put("handleDepts", handleDepts);
|
|
|
+ map.put("handleDepts", allHandleDepts);
|
|
|
map.put("handleMatters", ss);
|
|
|
map.put("totalPages", totalPages);
|
|
|
map.put("total", total);
|
|
@@ -108,10 +114,15 @@ public class HandleBusinessServiceImpl implements HandleBusinessService{
|
|
|
HandleBusiness handleBusiness = handleBusinessDao.findById(query.getBusinessId());
|
|
|
List<HandleDept> handleDepts = handleDeptDao.findById(handleBusiness.getId());
|
|
|
ArrayList<Object> handleMatter = new ArrayList<>();
|
|
|
+ LinkedHashSet<HandleDept> allHandleDepts = new LinkedHashSet<>();
|
|
|
for (HandleDept handleDept : handleDepts) {
|
|
|
List<HandleMatters> HandleMatters = handleMattersDao.findByIdByKey(handleDept.getId(), query.getKeyword(),query.getWindowNum());
|
|
|
handleMatter.addAll(HandleMatters);
|
|
|
total += handleMattersDao.findByIdByKeyCount(handleDept.getId(), query.getKeyword(), query.getWindowNum());
|
|
|
+ for (HandleMatters handleMatters : HandleMatters) {
|
|
|
+ HandleDept dept = handleDeptDao.selectOne(handleMatters.getDeptId().longValue());
|
|
|
+ allHandleDepts.add(dept);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 计算分页参数
|
|
@@ -126,7 +137,7 @@ public class HandleBusinessServiceImpl implements HandleBusinessService{
|
|
|
|
|
|
map.put("handleMatters", ss);
|
|
|
map.put("handleBusiness", handleBusiness);
|
|
|
- map.put("handleDepts", handleDepts);
|
|
|
+ map.put("handleDepts", allHandleDepts);
|
|
|
map.put("total", total);
|
|
|
map.put("totalPages", totalPages);
|
|
|
return map;
|