This commit is contained in:
mashuai 2025-07-31 15:50:41 +08:00
parent d6279ec605
commit 6fa6783969
1 changed files with 6 additions and 7 deletions

View File

@ -93,22 +93,21 @@ public class SelectServiceImpl implements SelectService {
stepTimes.put("数据过滤", System.currentTimeMillis() - filterStart); stepTimes.put("数据过滤", System.currentTimeMillis() - filterStart);
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
// 步骤6: 获取班组数据可选 // 步骤6: 树形结构构建
long buildStart = System.currentTimeMillis();
groupList = buildTreeEfficiently(list);
// 步骤7: 获取班组数据可选
if (bmUnit.getDeptId() == null) { if (bmUnit.getDeptId() == null) {
long teamStart = System.currentTimeMillis(); long teamStart = System.currentTimeMillis();
List<ProjectTreeNode> newList = mapper.getTeam(); List<ProjectTreeNode> newList = mapper.getTeam();
stepTimes.put("获取班组数据", System.currentTimeMillis() - teamStart); stepTimes.put("获取班组数据", System.currentTimeMillis() - teamStart);
if (CollectionUtils.isNotEmpty(newList)) { if (CollectionUtils.isNotEmpty(newList)) {
list.addAll(newList); groupList.addAll(newList);
} }
} else { } else {
stepTimes.put("获取班组数据", 0L); // 跳过此步骤 stepTimes.put("获取班组数据", 0L); // 跳过此步骤
} }
// 步骤7: 树形结构构建
long buildStart = System.currentTimeMillis();
groupList = buildTreeEfficiently(list);
stepTimes.put("树形结构构建", System.currentTimeMillis() - buildStart); stepTimes.put("树形结构构建", System.currentTimeMillis() - buildStart);
} }
} catch (Exception e) { } catch (Exception e) {