|
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
@ -25,6 +26,7 @@ import org.jeecg.modules.system.model.SysDepartTreeModel; |
|
|
|
|
import org.jeecg.modules.system.service.ISysDepartService; |
|
|
|
|
import org.jeecg.modules.system.service.ISysUserDepartService; |
|
|
|
|
import org.jeecg.modules.system.service.ISysUserService; |
|
|
|
|
import org.jeecg.modules.system.vo.QuXianDepartVo; |
|
|
|
|
import org.jeecg.modules.system.vo.SysDepartExportVo; |
|
|
|
|
import org.jeecg.modules.system.vo.lowapp.ExportDepartVo; |
|
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil; |
|
|
|
@ -198,6 +200,21 @@ public class SysDepartController { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "法人注册时,获取区县级别部门", notes = "法人注册时,获取区县级别部门") |
|
|
|
|
@GetMapping(value = "/getDepartList4Quxian") |
|
|
|
|
public Result<List<QuXianDepartVo>> getDepartList4Quxian() { |
|
|
|
|
SysDepart sysDepart = sysDepartService.getOne(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getDelFlag, "0").eq(SysDepart::getParentId, "")); |
|
|
|
|
List<SysDepart> departList4Quxian = sysDepartService.list(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getParentId, sysDepart.getId())); |
|
|
|
|
List<QuXianDepartVo> quXianDepartVos = new ArrayList<>(); |
|
|
|
|
Optional.ofNullable(departList4Quxian).orElse(new LinkedList<>()).stream().forEach(depart -> { |
|
|
|
|
QuXianDepartVo vo = new QuXianDepartVo(); |
|
|
|
|
vo.setDepName(depart.getDepartName()); |
|
|
|
|
vo.setDepId(depart.getId()); |
|
|
|
|
quXianDepartVos.add(vo); |
|
|
|
|
}); |
|
|
|
|
return Result.OK(quXianDepartVos); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取某个部门的所有父级部门的ID |
|
|
|
|
* |
|
|
|
@ -247,8 +264,8 @@ public class SysDepartController { |
|
|
|
|
} else if ("quxian_admin".equals(user.getRoleCode())) { |
|
|
|
|
queryWrapper.eq("parent_id", user.getOrgId()); |
|
|
|
|
} else if ("kejiju_admin".equals(user.getRoleCode())) {// 查询所有法人级部门
|
|
|
|
|
queryWrapper.ne("depart_name_abbr","null"); |
|
|
|
|
queryWrapper.ne("depart_name_abbr",""); |
|
|
|
|
queryWrapper.ne("depart_name_abbr", "null"); |
|
|
|
|
queryWrapper.ne("depart_name_abbr", ""); |
|
|
|
|
} |
|
|
|
|
return sysDepartService.queryPageList(req, queryWrapper, pageSize, pageNo); |
|
|
|
|
|
|
|
|
|