问题修改 11.09

master
zhc077 2 weeks ago
parent 5002adaa4b
commit 9882772f86
  1. 22
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java
  2. 1136
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java
  3. 3
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysUser.java
  4. 20
      jeecgboot-vue3/src/views/declarant/user.data.ts
  5. 7
      jeecgboot-vue3/src/views/declarantUnit/declarantUnitList.vue
  6. 17
      jeecgboot-vue3/src/views/system/depart/components/DepartLeftTree.vue
  7. 4
      jeecgboot-vue3/src/views/system/depart/depart.api.ts
  8. 9
      jeecgboot-vue3/src/views/system/depart/depart.data.ts
  9. 9
      jeecgboot-vue3/src/views/system/departUser/depart.user.data.ts
  10. 1
      jeecgboot-vue3/types/store.d.ts

@ -4,10 +4,12 @@ import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.exceptions.ClientException; import com.aliyuncs.exceptions.ClientException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresRoles; import org.apache.shiro.authz.annotation.RequiresRoles;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
@ -21,10 +23,7 @@ import org.jeecg.common.util.*;
import org.jeecg.common.util.encryption.EncryptedString; import org.jeecg.common.util.encryption.EncryptedString;
import org.jeecg.config.JeecgBaseConfig; import org.jeecg.config.JeecgBaseConfig;
import org.jeecg.modules.base.service.BaseCommonService; import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.modules.system.entity.SysDepart; import org.jeecg.modules.system.entity.*;
import org.jeecg.modules.system.entity.SysRoleIndex;
import org.jeecg.modules.system.entity.SysTenant;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.model.SysLoginModel; import org.jeecg.modules.system.model.SysLoginModel;
import org.jeecg.modules.system.service.*; import org.jeecg.modules.system.service.*;
import org.jeecg.modules.system.service.impl.SysBaseApiImpl; import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
@ -38,7 +37,6 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @Author scott * @Author scott
@ -68,6 +66,12 @@ public class LoginController {
@Autowired @Autowired
private JeecgBaseConfig jeecgBaseConfig; private JeecgBaseConfig jeecgBaseConfig;
@Autowired
private ISysUserRoleService sysUserRoleService;
@Autowired
private ISysRoleService sysRoleService;
private final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890"; private final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890";
@ApiOperation("登录接口") @ApiOperation("登录接口")
@ -162,6 +166,14 @@ public class LoginController {
//update-end---author:scott ---date::2022-06-20 for:vue3前端,支持自定义首页-------------- //update-end---author:scott ---date::2022-06-20 for:vue3前端,支持自定义首页--------------
log.info("2 获取用户信息耗时 (首页面配置)" + (System.currentTimeMillis() - start) + "毫秒"); log.info("2 获取用户信息耗时 (首页面配置)" + (System.currentTimeMillis() - start) + "毫秒");
List<SysUserRole> userRole = sysUserRoleService.list(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, sysUser.getId()));
if(ObjectUtils.isNotEmpty(userRole)){
String rollId = userRole.get(0).getRoleId();
SysRole sysRole = sysRoleService.getById(rollId);
if(ObjectUtils.isNotEmpty(sysRole)){
sysUser.setRoleCode(sysRole.getRoleCode());
}
}
obj.put("userInfo",sysUser); obj.put("userInfo",sysUser);
obj.put("sysAllDictItems", sysDictService.queryAllDictItems()); obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
log.info("3 获取用户信息耗时 (字典数据)" + (System.currentTimeMillis() - start) + "毫秒"); log.info("3 获取用户信息耗时 (字典数据)" + (System.currentTimeMillis() - start) + "毫秒");

@ -222,4 +222,7 @@ public class SysUser implements Serializable {
*/ */
@TableField(exist = false) @TableField(exist = false)
private boolean izBindThird; private boolean izBindThird;
@TableField(exist = false)
private String roleCode;
} }

@ -175,7 +175,7 @@ export const formSchema: FormSchema[] = [
required: true, required: true,
component: 'Input', component: 'Input',
}, },
{ /*{
label: '工号', label: '工号',
field: 'workNo', field: 'workNo',
required: true, required: true,
@ -190,7 +190,7 @@ export const formSchema: FormSchema[] = [
componentProps: { componentProps: {
labelKey: 'name', labelKey: 'name',
}, },
}, },*/
{ {
label: '角色', label: '角色',
field: 'selectedroles', field: 'selectedroles',
@ -234,7 +234,7 @@ export const formSchema: FormSchema[] = [
}; };
}, },
}, },
{ /*{
label: '租户', label: '租户',
field: 'relTenantIds', field: 'relTenantIds',
component: 'ApiSelect', component: 'ApiSelect',
@ -263,8 +263,8 @@ export const formSchema: FormSchema[] = [
}, },
}; };
}, },
}, },*/
{ /*{
label: '负责部门', label: '负责部门',
field: 'departIds', field: 'departIds',
component: 'Select', component: 'Select',
@ -272,7 +272,7 @@ export const formSchema: FormSchema[] = [
mode: 'multiple', mode: 'multiple',
}, },
ifShow: ({ values }) => values.userIdentity == 2, ifShow: ({ values }) => values.userIdentity == 2,
}, },*/
{ {
label: '头像', label: '头像',
field: 'avatar', field: 'avatar',
@ -320,13 +320,13 @@ export const formSchema: FormSchema[] = [
]; ];
}, },
}, },
{ /*{
label: '座机', label: '座机',
field: 'telephone', field: 'telephone',
component: 'Input', component: 'Input',
rules: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' }], rules: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' }],
}, },*/
{ /*{
label: '工作流引擎', label: '工作流引擎',
field: 'activitiSync', field: 'activitiSync',
defaultValue: 1, defaultValue: 1,
@ -336,7 +336,7 @@ export const formSchema: FormSchema[] = [
type: 'radio', type: 'radio',
stringToNumber: true, stringToNumber: true,
}, },
}, },*/
]; ];
export const formPasswordSchema: FormSchema[] = [ export const formPasswordSchema: FormSchema[] = [

@ -58,6 +58,8 @@ import {useMessage} from "@/hooks/web/useMessage";
const queryParam = reactive<any>({}); const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]); const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore(); const userStore = useUserStore();
// console.log("userStore.getUserInfo---",JSON.stringify(userStore.getUserInfo))
// console.log("userStore.getRoleList---",userStore.getRoleList)
const {createMessage, createConfirm} = useMessage(); const {createMessage, createConfirm} = useMessage();
//model //model
@ -180,7 +182,7 @@ function getTableAction(record) {
// }, // },
{ {
label: '驳回', label: '驳回',
ifShow: record.status == 1, ifShow: userStore.getUserInfo.roleCode !='faren_admin' && record.status == 1,
popConfirm: { popConfirm: {
title: '确定驳回吗?', title: '确定驳回吗?',
confirm: handleFrozen.bind(null, record, 0), confirm: handleFrozen.bind(null, record, 0),
@ -188,7 +190,7 @@ function getTableAction(record) {
}, },
{ {
label: '通过', label: '通过',
ifShow: record.status == 0, ifShow: userStore.getUserInfo.roleCode !='faren_admin' && record.status == 0,
popConfirm: { popConfirm: {
title: '确定通过吗?', title: '确定通过吗?',
confirm: handleFrozen.bind(null, record, 1), confirm: handleFrozen.bind(null, record, 1),
@ -196,6 +198,7 @@ function getTableAction(record) {
}, },
{ {
label: '删除', label: '删除',
ifShow: userStore.getUserInfo.roleCode !='faren_admin',
popConfirm: { popConfirm: {
title: '是否确认删除', title: '是否确认删除',
confirm: handleDelete.bind(null, record), confirm: handleDelete.bind(null, record),

@ -3,9 +3,9 @@
<div class="j-table-operator" style="width: 100%"> <div class="j-table-operator" style="width: 100%">
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="onAddDepart">新增</a-button> <a-button type="primary" preIcon="ant-design:plus-outlined" @click="onAddDepart">新增</a-button>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="onAddChildDepart()">添加下级</a-button> <a-button type="primary" preIcon="ant-design:plus-outlined" @click="onAddChildDepart()">添加下级</a-button>
<a-upload name="file" :showUploadList="false" :customRequest="onImportXls"> <!-- <a-upload name="file" :showUploadList="false" :customRequest="onImportXls">
<a-button type="primary" preIcon="ant-design:import-outlined">导入</a-button> <a-button type="primary" preIcon="ant-design:import-outlined">导入</a-button>
</a-upload> </a-upload>-->
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls">导出</a-button> <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls">导出</a-button>
<!-- <a-button type="primary" preIcon="ant-design:sync-outlined">同步企微?</a-button> <!-- <a-button type="primary" preIcon="ant-design:sync-outlined">同步企微?</a-button>
<a-button type="primary" preIcon="ant-design:sync-outlined">同步钉钉?</a-button>--> <a-button type="primary" preIcon="ant-design:sync-outlined">同步钉钉?</a-button>-->
@ -92,10 +92,11 @@
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useMethods } from '/@/hooks/system/useMethods'; import { useMethods } from '/@/hooks/system/useMethods';
import { Api, deleteBatchDepart, queryDepartTreeSync } from '../depart.api'; import { Api, deleteBatchDepart, queryDepartTreeSync4ZhuGuanBuMen } from '../depart.api';
import { searchByKeywords } from '/@/views/system/departUser/depart.user.api'; import { searchByKeywords } from '/@/views/system/departUser/depart.user.api';
import DepartFormModal from '/@/views/system/depart/components/DepartFormModal.vue'; import DepartFormModal from '/@/views/system/depart/components/DepartFormModal.vue';
import { Popconfirm } from 'ant-design-vue'; import { Popconfirm } from 'ant-design-vue';
import {useUserStore} from "@/store/modules/user";
const prefixCls = inject('prefixCls'); const prefixCls = inject('prefixCls');
const emit = defineEmits(['select', 'rootTreeData']); const emit = defineEmits(['select', 'rootTreeData']);
@ -124,13 +125,16 @@
// modal // modal
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const userStore = useUserStore();
// //
async function loadRootTreeData() { async function loadRootTreeData() {
try { try {
loading.value = true; loading.value = true;
treeData.value = []; treeData.value = [];
const result = await queryDepartTreeSync(); const result = await queryDepartTreeSync4ZhuGuanBuMen({
parentOrgCode: userStore.getUserInfo.orgCode,
});
if (Array.isArray(result)) { if (Array.isArray(result)) {
treeData.value = result; treeData.value = result;
} }
@ -158,8 +162,9 @@
// //
async function loadChildrenTreeData(treeNode) { async function loadChildrenTreeData(treeNode) {
try { try {
const result = await queryDepartTreeSync({ const result = await queryDepartTreeSync4ZhuGuanBuMen({
pid: treeNode.dataRef.id, // pid: treeNode.dataRef.id,
parentOrgCode: treeNode.dataRef.orgCode,
}); });
if (result.length == 0) { if (result.length == 0) {
treeNode.dataRef.isLeaf = true; treeNode.dataRef.isLeaf = true;

@ -6,6 +6,7 @@ const { createConfirm } = useMessage();
export enum Api { export enum Api {
queryDepartTreeSync = '/sys/sysDepart/queryDepartTreeSync', queryDepartTreeSync = '/sys/sysDepart/queryDepartTreeSync',
queryDepartTreeSync4ZhuGuanBuMen = '/sys/sysDepart/queryDepartTreeSync4ZhuGuanBuMen',
save = '/sys/sysDepart/add', save = '/sys/sysDepart/add',
edit = '/sys/sysDepart/edit', edit = '/sys/sysDepart/edit',
delete = '/sys/sysDepart/delete', delete = '/sys/sysDepart/delete',
@ -31,6 +32,9 @@ export enum Api {
*/ */
export const queryDepartTreeSync = (params?) => defHttp.get({ url: Api.queryDepartTreeSync, params }); export const queryDepartTreeSync = (params?) => defHttp.get({ url: Api.queryDepartTreeSync, params });
// add by zhc 11.09
export const queryDepartTreeSync4ZhuGuanBuMen = (params?) => defHttp.get({ url: Api.queryDepartTreeSync4ZhuGuanBuMen, params });
/** /**
* 保存或者更新部门角色 * 保存或者更新部门角色
*/ */

@ -81,10 +81,13 @@ export function useBasicFormSchema() {
// //
export const orgCategoryOptions = { export const orgCategoryOptions = {
// //
root: [{ value: '1', label: '公司' }], // root: [{ value: '1', label: '' }],
root: [{ value: '1', label: '管理单位' }],
// //
child: [ child: [
{ value: '2', label: '部门' }, // { value: '2', label: '' },
{ value: '3', label: '岗位' }, { value: '2', label: '直属法人单位' },
// { value: '3', label: '' },
{ value: '3', label: '县区法人单位' },
], ],
}; };

@ -163,11 +163,14 @@ export function useBaseInfoForm(treeData: Ref<any[]>) {
label: '机构类型', label: '机构类型',
render(val) { render(val) {
if (val === '1') { if (val === '1') {
return '公司'; // return '';
return '管理单位';
} else if (val === '2') { } else if (val === '2') {
return '部门'; // return '';
return '直属法人单位';
} else if (val === '3') { } else if (val === '3') {
return '岗位'; // return '';
return '县区法人单位';
} }
return val; return val;
}, },

@ -40,6 +40,7 @@ export interface UserInfo {
homePath?: string; homePath?: string;
tenantid?: string | number; tenantid?: string | number;
roles: RoleInfo[]; roles: RoleInfo[];
roleCode: string;
orgCode?: string; orgCode?: string;
} }

Loading…
Cancel
Save