Browse Source

Merge branch 'develop' of http://192.168.11.14:51037/gitadmin/tuoheng_freeway into feature_v1.0

tags/v1.1.0^2
chengwang 1 year ago
parent
commit
5b27cc5b02
1 changed files with 16 additions and 9 deletions
  1. +16
    -9
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/delete/DeleteDeptService.java

+ 16
- 9
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/delete/DeleteDeptService.java View File

package com.tuoheng.admin.service.dept.delete; package com.tuoheng.admin.service.dept.delete;


import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.*; import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.MarkEnum; import com.tuoheng.admin.enums.MarkEnum;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;


import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;


/** /**
* @return 结果 * @return 结果
*/ */
private void deleteRoadDept(String tenantId, String deptId) { private void deleteRoadDept(String tenantId, String deptId) {
Map<String, Object> map = new HashMap<>();
map.put("tenant_id", tenantId);
map.put("dept_id", deptId);
roadDeptMapper.deleteByMap(map);
List<String> deptIdList = deptMapper.selectAllChildListById(deptId);
if (CollectionUtil.isEmpty(deptIdList)) {
return;
}
roadDeptMapper.delete(new LambdaQueryWrapper<RoadDept>()
.eq(RoadDept::getTenantId, tenantId)
.in(RoadDept::getDeptId, deptIdList));
} }


/** /**
* @return 结果 * @return 结果
*/ */
private void deleteSectionDept(String tenantId, String deptId) { private void deleteSectionDept(String tenantId, String deptId) {
Map<String, Object> map = new HashMap<>();
map.put("tenant_id", tenantId);
map.put("dept_id", deptId);
sectionDeptMapper.deleteByMap(map);
List<String> deptIdList = deptMapper.selectAllChildListById(deptId);
if (CollectionUtil.isEmpty(deptIdList)) {
return;
}
sectionDeptMapper.delete(new LambdaQueryWrapper<SectionDept>()
.eq(SectionDept::getTenantId, tenantId)
.in(SectionDept::getDeptId, deptIdList));
} }

} }

Loading…
Cancel
Save