diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index 9d7ec6c..37da5a6 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -191,6 +191,8 @@ public class ShiroConfig { filterChainDefinitionMap.put("/sys/sysDepart/queryDepartTreeSync4FaRen", "anon");//法人注册时,选择部门列表 + filterChainDefinitionMap.put("/sys/sysDepart/getDepartList4Quxian", "anon");//法人注册时,获取区县级别部门列表 + diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java index 94d75ba..e97c8a3 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java @@ -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> getDepartList4Quxian() { + SysDepart sysDepart = sysDepartService.getOne(new LambdaQueryWrapper().eq(SysDepart::getDelFlag, "0").eq(SysDepart::getParentId, "")); + List departList4Quxian = sysDepartService.list(new LambdaQueryWrapper().eq(SysDepart::getParentId, sysDepart.getId())); + List 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); diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/vo/QuXianDepartVo.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/vo/QuXianDepartVo.java new file mode 100644 index 0000000..aca01e3 --- /dev/null +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/vo/QuXianDepartVo.java @@ -0,0 +1,16 @@ +package org.jeecg.modules.system.vo; + +import lombok.Data; + +/** + * @Description: TODO + * @Author: Z.H.C + * @CreateTime: 2024-11-12 11:20 + * @Version: 1.0 + */ + +@Data +public class QuXianDepartVo { + private String depId; + private String depName; +} diff --git a/jeecgboot-vue3/src/api/sys/user.ts b/jeecgboot-vue3/src/api/sys/user.ts index 1e64eec..76c4e1e 100644 --- a/jeecgboot-vue3/src/api/sys/user.ts +++ b/jeecgboot-vue3/src/api/sys/user.ts @@ -50,6 +50,7 @@ enum Api { //监控二维码扫描状态 getQrcodeToken = '/sys/getQrcodeToken', getdepdataapi= '/expert/expert/getdepdata', + getDepartList4Quxian = '/sys/sysDepart/getDepartList4Quxian', } /** @@ -244,4 +245,8 @@ export async function validateCasLogin(params) { export async function getdepdata(params) { let url = Api.getdepdataapi; return defHttp.get({ url: url, params }); + + +}export async function departList4Quxian(params) { + return defHttp.get({ url: Api.getDepartList4Quxian, params }); } diff --git a/jeecgboot-vue3/src/views/system/loginmini/MiniRegister4faren.vue b/jeecgboot-vue3/src/views/system/loginmini/MiniRegister4faren.vue index 33ce11c..5e25518 100644 --- a/jeecgboot-vue3/src/views/system/loginmini/MiniRegister4faren.vue +++ b/jeecgboot-vue3/src/views/system/loginmini/MiniRegister4faren.vue @@ -39,10 +39,16 @@ - + + +
+ + {{ selectValue }} +
@@ -118,7 +124,7 @@