|
|
|
@ -216,22 +216,32 @@ public class SysDepartBoundaryServiceImpl extends ServiceImpl<SysDepartBoundaryM |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<SysDepartBoundaryBo> listJson(SysDepartBoundary departBoundary) { |
|
|
|
if(ObjectUtil.isEmpty(departBoundary.getDeptId())){ |
|
|
|
throw new ServiceException("部门【id】不存在"); |
|
|
|
|
|
|
|
SysDepartBoundaryBo result = new SysDepartBoundaryBo(); |
|
|
|
|
|
|
|
//获取当前人所属部门
|
|
|
|
Long deptId = LoginHelper.getDeptId(); |
|
|
|
|
|
|
|
LambdaQueryWrapper<SysDepartBoundary> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.eq(SysDepartBoundary::getDeptId, deptId); |
|
|
|
List<SysDepartBoundary> boundaryList = baseMapper.selectList(wrapper); |
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(boundaryList)) { |
|
|
|
return List.of(); |
|
|
|
} |
|
|
|
|
|
|
|
SysDepartBoundaryBo child = new SysDepartBoundaryBo(); |
|
|
|
child.setDepartId(String.valueOf(departBoundary.getDeptId())); |
|
|
|
child.setAreaType(SysDepartBoundaryBo.AreaType.DistrictLevel); |
|
|
|
child.setLandCategoriesJson(this.baseMapper.listJson(String.valueOf(departBoundary.getDeptId()))); |
|
|
|
Integer areaType = boundaryList.getFirst().getAreaType(); |
|
|
|
String deptName = boundaryList.getFirst().getDeptName(); |
|
|
|
|
|
|
|
//获取部门所属区域
|
|
|
|
String landCategories = this.baseMapper.listJson(String.valueOf(deptId)); |
|
|
|
|
|
|
|
SysDeptVo sysDeptVo = deptService.getByParentId(String.valueOf(departBoundary.getDeptId())); |
|
|
|
SysDepartBoundaryBo parent = new SysDepartBoundaryBo(); |
|
|
|
parent.setDepartId(String.valueOf(sysDeptVo.getDeptId())); |
|
|
|
parent.setAreaType(SysDepartBoundaryBo.AreaType.Municipal); |
|
|
|
parent.setLandCategoriesJson(this.baseMapper.listJson(String.valueOf(sysDeptVo.getDeptId()))); |
|
|
|
result.setDeptId(String.valueOf(deptId)); |
|
|
|
result.setDeptName(deptName); |
|
|
|
result.setAreaType(areaType); |
|
|
|
result.setLandCategoriesJson(landCategories); |
|
|
|
|
|
|
|
return List.of(child,parent); |
|
|
|
return List.of(result); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|