Selaa lähdekoodia

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/v1.1.0^2
wanjing 1 vuosi sitten
vanhempi
commit
b4520be5fd
1 muutettua tiedostoa jossa 17 lisäystä ja 11 poistoa
  1. +17
    -11
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/update/UpdateDeptService.java

+ 17
- 11
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/update/UpdateDeptService.java Näytä tiedosto

@@ -1,5 +1,6 @@
package com.tuoheng.admin.service.dept.update;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.constant.SystemConstant;
import com.tuoheng.admin.dto.RoadSectionDto;
@@ -268,12 +269,12 @@ public class UpdateDeptService {
deptList.add(parentDept);
queryChildDeptList(deptList, parentDept);

for (Dept dept : deptList) {
Map<String, Object> map = new HashMap<>();
map.put("tenantId", tenantId);
map.put("deptId", dept.getId());
map.put("roadIdList", roadIdList);
roadDeptMapper.deleteBatchByMap(map);
List<String> deptIdList = deptList.stream().map(p -> p.getId()).collect(Collectors.toList());;
for (String roadId : roadIdList) {
roadDeptMapper.delete(new LambdaQueryWrapper<RoadDept>()
.eq(RoadDept::getTenantId, tenantId)
.eq(RoadDept::getRoadId, roadId)
.in(RoadDept::getDeptId, deptIdList));
}
}

@@ -363,11 +364,16 @@ public class UpdateDeptService {
* @return 结果
*/
private void removeSectionToDept(String tenantId, String deptId, Collection<String> sectionIdList) {
Map<String, Object> map = new HashMap<>();
map.put("tenantId", tenantId);
map.put("deptId", deptId);
map.put("sectionIdList", sectionIdList);
sectionDeptMapper.deleteBatchByMap(map);
List<String> deptIdList = deptMapper.selectAllChildListById(deptId);
if (CollectionUtil.isEmpty(deptIdList)) {
return;
}
for (String sectionId : sectionIdList) {
sectionDeptMapper.delete(new LambdaQueryWrapper<SectionDept>()
.eq(SectionDept::getTenantId, tenantId)
.eq(SectionDept::getSectionId, sectionId)
.in(SectionDept::getDeptId, deptIdList));
}
}

/**

Loading…
Peruuta
Tallenna