Browse Source

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
cbcb4d6c6c
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/add/AddDeptService.java

+ 6
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/add/AddDeptService.java View File

import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;


/** /**
} }


// 添加部门和公路数据 // 添加部门和公路数据
// 去重,防止前端提交了重复的数据
roadInformationList = roadInformationList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(RoadInformation::getId))), ArrayList::new));
this.addRoadToDept(tenantId, deptId, roadInformationList); this.addRoadToDept(tenantId, deptId, roadInformationList);


// 添加部门和路段数据
// 去重,防止前端提交了重复的数据
sectionList = sectionList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Section::getId))), ArrayList::new));
this.addSectionToDept(tenantId, deptId, sectionList); this.addSectionToDept(tenantId, deptId, sectionList);
} }



Loading…
Cancel
Save