法人注册部门选择问题修改 11.12

master
zhc077 2 weeks ago
parent 7bdf838230
commit 0b41b3bbf5
  1. 2
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  2. 21
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java
  3. 16
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/vo/QuXianDepartVo.java
  4. 5
      jeecgboot-vue3/src/api/sys/user.ts
  5. 27
      jeecgboot-vue3/src/views/system/loginmini/MiniRegister4faren.vue

@ -191,6 +191,8 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/sys/sysDepart/queryDepartTreeSync4FaRen", "anon");//法人注册时,选择部门列表
filterChainDefinitionMap.put("/sys/sysDepart/getDepartList4Quxian", "anon");//法人注册时,获取区县级别部门列表

@ -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);

@ -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;
}

@ -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 });
}

@ -39,10 +39,16 @@
<a-input class="fix-auto-fill" type="text" :placeholder="t('请输法人身份证号')" v-model:value="formData.idNo" />
</div>
</a-form-item>
<a-form-item>
<!-- <a-form-item>
<div class="aui-input-line">
<JSelectDept4FaRen :placeholder="t('sys.login.selectorgPlaceholder4Kejiju')" v-model:value="formData.department" :multiple="false" />
</div>
</a-form-item>-->
<a-form-item>
<div class="aui-input-line">
<j-search-select :placeholder="t('sys.login.selectorgPlaceholder4Kejiju')" v-model:value="formData.department" :dictOptions="dictOptions" />
{{ selectValue }}
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
@ -118,7 +124,7 @@
<script lang="ts" setup name="mini-register">
import { ref, reactive, unref, toRaw,onMounted } from 'vue';
import { getCaptcha, registerFaren, getCodeInfo } from '/@/api/sys/user';
import {getCaptcha, registerFaren, getCodeInfo, departList4Quxian} from '/@/api/sys/user';
import { SmsEnum } from '/@/views/sys/login/useLogin';
import { useMessage } from '/@/hooks/web/useMessage';
import logoImg from '/@/assets/loginmini/icon/jeecg_logo.png';
@ -129,7 +135,7 @@
import JSelectDept4FaRen from '/@/components/Form/src/jeecg/components/JSelectDept4FaRen.vue';
import { useI18n } from '/@/hooks/web/useI18n';
import codeImg from '/@/assets/images/checkcode.png';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
const { t } = useI18n();
const { notification, createErrorModal, createMessage } = useMessage();
const emit = defineEmits(['go-back', 'success', 'register']);
@ -157,6 +163,21 @@
const pwdIndex = ref<string>('close');
//
const confirmPwdIndex = ref<string>('close');
const selectValue=ref('');
const dictOptions=ref([]);
//
function getDepartList4Quxian(){
departList4Quxian().then(res => {
console.log(res,"res")
dictOptions.value = res.map(item => {
return {text:item.depName,value:item.depId}
})
console.log(dictOptions.value,"dictOptions")
})}
getDepartList4Quxian();
/**
* 返回

Loading…
Cancel
Save