提交 f6c46904 编写于 作者: ibizdev's avatar ibizdev

ibizdev提交

上级 6bb6586d
export default {
fields: {
permissionid: '资源标识',
permissionname: '资源名称',
pssystemid: '系统标识',
type: '资源类别',
enable: '逻辑有效',
createdate: '建立时间',
updatedate: '更新时间',
psdataentity: '实体',
psdedataset: '数据集',
psdedatarange: '数据范围',
},
views: {
gridview: {
caption: "权限/资源",
......@@ -67,6 +79,7 @@ export default {
n_psdataentity_like: "实体(%)",
n_psdedataset_like: "数据集(%)",
n_psdedatarange_like: "数据范围(%)",
n_sys_permissionname_like: "资源名称(%)",
},
uiactions: {
},
......
export default {
fields: {
permissionid: '资源标识',
permissionname: '资源名称',
pssystemid: '系统标识',
type: '资源类别',
enable: '逻辑有效',
createdate: '建立时间',
updatedate: '更新时间',
psdataentity: '实体',
psdedataset: '数据集',
psdedatarange: '数据范围',
},
views: {
gridview: {
caption: '权限/资源',
......@@ -66,6 +78,7 @@ export default {
n_psdataentity_like: '实体(%)',
n_psdedataset_like: '数据集(%)',
n_psdedatarange_like: '数据范围(%)',
n_sys_permissionname_like: '资源名称(%)',
},
uiactions: {
},
......
export default {
fields: {
appmenuitemid: '系统菜单项标识',
appmenuitemname: '系统菜单项名称',
psappid: '系统应用标识',
psappname: '系统应用名称',
psappmenuid: '系统菜单标识',
psappmenuname: '系统菜单名称',
isleaf: '是否为叶子节点(用于菜单)',
pssystemid: '实体标识',
permissionid: '系统资源标识',
parentpermissionid: '父项资源标识',
createdate: '建立时间',
updatedate: '更新时间',
},
};
\ No newline at end of file
export default {
fields: {
appmenuitemid: '系统菜单项标识',
appmenuitemname: '系统菜单项名称',
psappid: '系统应用标识',
psappname: '系统应用名称',
psappmenuid: '系统菜单标识',
psappmenuname: '系统菜单名称',
isleaf: '是否为叶子节点(用于菜单)',
pssystemid: '实体标识',
permissionid: '系统资源标识',
parentpermissionid: '父项资源标识',
createdate: '建立时间',
updatedate: '更新时间',
},
};
\ No newline at end of file
export default {
fields: {
psdeopprivid: '实体数据操作标识标识',
psdeopprivname: '实体数据操作标识名称',
psdataentityid: '实体标识',
psdataentityname: '实体名称',
psdedatasetid: '实体数据集标识',
psdedatasetname: '实体数据集名称',
psdedatarangeid: '实体数据范围标识',
psdedatarangename: '实体数据范围名称',
pssysmoduleid: '系统模块标识',
pssysmodulename: '系统模块名称',
pssystemid: '系统标识',
permissionid: '系统资源标识',
createdate: '建立时间',
updatedate: '更新时间',
},
};
\ No newline at end of file
export default {
fields: {
psdeopprivid: '实体数据操作标识标识',
psdeopprivname: '实体数据操作标识名称',
psdataentityid: '实体标识',
psdataentityname: '实体名称',
psdedatasetid: '实体数据集标识',
psdedatasetname: '实体数据集名称',
psdedatarangeid: '实体数据范围标识',
psdedatarangename: '实体数据范围名称',
pssysmoduleid: '系统模块标识',
pssysmodulename: '系统模块名称',
pssystemid: '系统标识',
permissionid: '系统资源标识',
createdate: '建立时间',
updatedate: '更新时间',
},
};
\ No newline at end of file
export default {
fields: {
rolepermissionid: '角色权限关系表标识',
rolepermission: '角色权限关系表名称',
roleid: '角色表标识',
rolename: '角色名称',
permissionid: '权限表标识',
permissionname: '权限名称',
type: '资源类型',
createdate: '建立时间',
updatedate: '更新时间',
systemid: '系统标识',
},
views: {
mpickupview: {
caption: "角色权限关系",
......
export default {
fields: {
rolepermissionid: '角色权限关系表标识',
rolepermission: '角色权限关系表名称',
roleid: '角色表标识',
rolename: '角色名称',
permissionid: '权限表标识',
permissionname: '权限名称',
type: '资源类型',
createdate: '建立时间',
updatedate: '更新时间',
systemid: '系统标识',
},
views: {
mpickupview: {
caption: '角色权限关系',
......
export default {
fields: {
roleid: '角色表标识',
rolename: '角色表名称',
memo: '备注',
createdate: '建立时间',
updatedate: '更新时间',
},
views: {
pickupgridview: {
caption: "系统角色",
......
export default {
fields: {
roleid: '角色表标识',
rolename: '角色表名称',
memo: '备注',
createdate: '建立时间',
updatedate: '更新时间',
},
views: {
pickupgridview: {
caption: '系统角色',
......
export default {
fields: {
userroleid: '用户角色关系表标识',
userrolename: '用户角色关系表名称',
roleid: '角色表标识',
rolename: '角色名称',
userid: '用户标识',
personname: '用户名称',
createdate: '建立时间',
updatedate: '更新时间',
},
views: {
redirectview: {
caption: "用户角色关系",
......
export default {
fields: {
userroleid: '用户角色关系表标识',
userrolename: '用户角色关系表名称',
roleid: '角色表标识',
rolename: '角色名称',
userid: '用户标识',
personname: '用户名称',
createdate: '建立时间',
updatedate: '更新时间',
},
views: {
redirectview: {
caption: '用户角色关系',
......
export default {
fields: {
userid: '用户标识',
username: '用户全局名',
personname: '用户姓名',
},
views: {
mpickupview: {
caption: "系统用户",
......
export default {
fields: {
userid: '用户标识',
username: '用户全局名',
personname: '用户姓名',
},
views: {
mpickupview: {
caption: '系统用户',
......
......@@ -6,6 +6,39 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
// createBatch
mock.onPost(new RegExp(/^\/sys_permissions\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_permission 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/sys_permissions\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_permission 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/sys_permissions\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_permission 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/sys_permissions\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
......
......@@ -6,6 +6,39 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
// createBatch
mock.onPost(new RegExp(/^\/sys_psappmenuitems\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_psappmenuitem 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/sys_psappmenuitems\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_psappmenuitem 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/sys_psappmenuitems\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_psappmenuitem 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/sys_psappmenuitems\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
......
......@@ -6,6 +6,39 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
// createBatch
mock.onPost(new RegExp(/^\/sys_psdeopprivs\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_psdeoppriv 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/sys_psdeopprivs\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_psdeoppriv 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/sys_psdeopprivs\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_psdeoppriv 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/sys_psdeopprivs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
......
......@@ -6,6 +6,39 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
// createBatch
mock.onPost(new RegExp(/^\/sys_role_permissions\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_role_permission 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/sys_role_permissions\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_role_permission 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/sys_role_permissions\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_role_permission 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
......
......@@ -6,6 +6,39 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
// createBatch
mock.onPost(new RegExp(/^\/sys_roles\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_role 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/sys_roles\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_role 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/sys_roles\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_role 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/sys_roles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
......
......@@ -6,6 +6,39 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
// createBatch
mock.onPost(new RegExp(/^\/sys_user_roles\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_user_role 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/sys_user_roles\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_user_role 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/sys_user_roles\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_user_role 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
......
......@@ -6,6 +6,39 @@ const mock = MockAdapter.getInstance();
const mockDatas: Array<any> = [
];
// createBatch
mock.onPost(new RegExp(/^\/sys_users\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_user 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/sys_users\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_user 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/sys_users\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_user 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/sys_users\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
......
......@@ -565,6 +565,45 @@ export default class EntityService {
return Http.getInstance().post(`/${this.APPDENAME}/import`,data,isloading);
}
/**
* createBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EntityService
*/
public async createBatch(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/${this.APPDENAME}/batch`,data,isloading);
}
/**
* updateBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EntityService
*/
public async updateBatch(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().put(`/${this.APPDENAME}/batch`,data,isloading);
}
/**
* removeBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EntityService
*/
public async removeBatch(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().delete(`/${this.APPDENAME}/batch`,isloading,data);
}
/**
* WFStart接口方法
*
......
......@@ -150,16 +150,24 @@ export class Http {
* @returns {Promise<any>}
* @memberof Http
*/
public delete(url: string, isloading?: boolean, serialnumber?: number): Promise<any> {
public delete(url: string, isloading?: boolean,data?:any, serialnumber?: number): Promise<any> {
if (isloading) {
this.beginLoading();
}
return new Promise((resolve: any, reject: any) => {
axios.delete(url).then((response: any) => {
this.doResponseRresult(response, resolve, isloading, serialnumber);
}).catch((response: any) => {
this.doResponseRresult(response, reject, isloading, serialnumber);
});
if(!data){
axios.delete(url).then((response: any) => {
this.doResponseRresult(response, resolve, isloading, serialnumber);
}).catch((response: any) => {
this.doResponseRresult(response, reject, isloading, serialnumber);
});
}else{
axios.delete(url,{data:data}).then((response: any) => {
this.doResponseRresult(response, resolve, isloading, serialnumber);
}).catch((response: any) => {
this.doResponseRresult(response, reject, isloading, serialnumber);
});
}
});
}
......
import { Store } from 'vuex';
import axios from 'axios';
import Router from 'vue-router';
import i18n from '@/locale';
/**
......@@ -81,13 +82,13 @@ export class Interceptors {
appdata = this.store.getters.getAppData();
}
if (appdata && appdata.context) {
config.headers.srforgsectorid = appdata.context.srforgsectorid;
//config.headers.srforgsectorname = appdata.context.srforgsectorname;
config.headers['srforgsectorid'] = appdata.context.srforgsectorid;
}
if (window.localStorage.getItem('token')) {
const token = window.localStorage.getItem('token');
config.headers.Authorization = `Bearer ${token}`;
config.headers['Authorization'] = `Bearer ${token}`;
}
config.headers['Accept-Language'] = i18n.locale;
// if (!config.url.startsWith('https://') && !config.url.startsWith('http://')) {
// config.url = Environment.BaseUrl + config.url;
// }
......
......@@ -197,7 +197,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
{
text: "主表单",
disabled: false,
drviewid: "form",
id: "form",
},
];
......@@ -270,7 +269,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof Default
*/
private getDRBarItem(arg: any = {}): any {
let expmode = arg.nodetype.toUpperCase();
let expmode = arg.nodetype;
if (!expmode) {
expmode = '';
}
......@@ -301,7 +300,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 获取子项
*
* @param {any[]} items
* @param {string} drviewid
* @param {string} id
* @returns {*}
* @memberof Default
*/
......@@ -338,7 +337,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$emit('selectionchange', [item]);
const refview = this.getDRBarItem({ nodetype: item.drviewid });
const refview = this.getDRBarItem({ nodetype: item.id });
this.selection = {};
const _context: any = { ...JSON.parse(JSON.stringify(this.context)) };
const _params: any = { ...JSON.parse(JSON.stringify(this.viewparams)) };
......
......@@ -27,6 +27,7 @@
height: 18px;
width: 18px;
margin-top: -2px;
margin-right: 5px;
}
}
.el-menu-item, .el-submenu, .el-menu {
......
......@@ -4,23 +4,29 @@
<row>
<i-col span="20">
<row>
<i-col v-show="detailsModel.n_psdataentity_like.visible" :style="{}" :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<i-col v-show="detailsModel.n_psdataentity_like.visible" :style="{}" :md="{ span: 6, offset: 0 }" :lg="{ span: 6, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='n_psdataentity_like' :itemRules="this.rules.n_psdataentity_like" class='' :caption="$t('entities.sys_permission.default_searchform.details.n_psdataentity_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_psdataentity_like.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.n_psdataentity_like" @enter="onEnter($event)" :disabled="detailsModel.n_psdataentity_like.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.n_psdedataset_like.visible" :style="{}" :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<i-col v-show="detailsModel.n_psdedataset_like.visible" :style="{}" :md="{ span: 6, offset: 0 }" :lg="{ span: 6, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='n_psdedataset_like' :itemRules="this.rules.n_psdedataset_like" class='' :caption="$t('entities.sys_permission.default_searchform.details.n_psdedataset_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_psdedataset_like.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.n_psdedataset_like" @enter="onEnter($event)" :disabled="detailsModel.n_psdedataset_like.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.n_psdedatarange_like.visible" :style="{}" :md="{ span: 8, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<i-col v-show="detailsModel.n_psdedatarange_like.visible" :style="{}" :md="{ span: 6, offset: 0 }" :lg="{ span: 6, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='n_psdedatarange_like' :itemRules="this.rules.n_psdedatarange_like" class='' :caption="$t('entities.sys_permission.default_searchform.details.n_psdedatarange_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_psdedatarange_like.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.n_psdedatarange_like" @enter="onEnter($event)" :disabled="detailsModel.n_psdedatarange_like.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.n_sys_permissionname_like.visible" :style="{}" :md="{ span: 6, offset: 0 }" :lg="{ span: 6, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='n_sys_permissionname_like' :itemRules="this.rules.n_sys_permissionname_like" class='' :caption="$t('entities.sys_permission.default_searchform.details.n_sys_permissionname_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_sys_permissionname_like.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.n_sys_permissionname_like" @enter="onEnter($event)" :disabled="detailsModel.n_sys_permissionname_like.disabled" type='text' style="width:100px;"></input-box>
</app-form-item>
</i-col>
</row>
</i-col>
......@@ -265,6 +271,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
n_psdataentity_like: null,
n_psdedataset_like: null,
n_psdedatarange_like: null,
n_sys_permissionname_like: null,
};
/**
......@@ -292,6 +299,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
{ required: false, type: 'string', message: '数据范围(%) 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '数据范围(%) 值不能为空', trigger: 'blur' },
],
n_sys_permissionname_like: [
{ type: 'string', message: '资源名称(%) 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '资源名称(%) 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '资源名称(%) 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '资源名称(%) 值不能为空', trigger: 'blur' },
],
}
/**
......@@ -308,6 +321,8 @@ export default class DefaultBase extends Vue implements ControlInterface {
n_psdedataset_like: new FormItemModel({ caption: '数据集(%)', detailType: 'FORMITEM', name: 'n_psdedataset_like', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
n_psdedatarange_like: new FormItemModel({ caption: '数据范围(%)', detailType: 'FORMITEM', name: 'n_psdedatarange_like', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
n_sys_permissionname_like: new FormItemModel({ caption: '资源名称(%)', detailType: 'FORMITEM', name: 'n_sys_permissionname_like', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
};
......@@ -347,6 +362,18 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.formDataChange({ name: 'n_psdedatarange_like', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 n_sys_permissionname_like 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@Watch('data.n_sys_permissionname_like')
onN_sys_permissionname_likeChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'n_sys_permissionname_like', newVal: newVal, oldVal: oldVal });
}
/**
* 重置表单项值
......@@ -371,6 +398,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
}
/**
......
......@@ -40,6 +40,11 @@ export default class DefaultModel {
prop: 'psdedatarange',
dataType: 'TEXT',
},
{
name: 'n_sys_permissionname_like',
prop: 'permissionname',
dataType: 'TEXT',
},
]
}
......
......@@ -85,6 +85,11 @@ export default class MainModel {
prop: 'n_psdedatarange_like',
dataType: 'TEXT',
},
{
name: 'n_sys_permissionname_like',
prop: 'n_sys_permissionname_like',
dataType: 'TEXT',
},
{
name:'size',
......
......@@ -197,7 +197,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
{
text: "主表单",
disabled: false,
drviewid: "form",
id: "form",
},
];
......@@ -270,7 +269,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof Default
*/
private getDRBarItem(arg: any = {}): any {
let expmode = arg.nodetype.toUpperCase();
let expmode = arg.nodetype;
if (!expmode) {
expmode = '';
}
......@@ -301,7 +300,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 获取子项
*
* @param {any[]} items
* @param {string} drviewid
* @param {string} id
* @returns {*}
* @memberof Default
*/
......@@ -338,7 +337,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$emit('selectionchange', [item]);
const refview = this.getDRBarItem({ nodetype: item.drviewid });
const refview = this.getDRBarItem({ nodetype: item.id });
this.selection = {};
const _context: any = { ...JSON.parse(JSON.stringify(this.context)) };
const _params: any = { ...JSON.parse(JSON.stringify(this.viewparams)) };
......
......@@ -27,6 +27,7 @@
height: 18px;
width: 18px;
margin-top: -2px;
margin-right: 5px;
}
}
.el-menu-item, .el-submenu, .el-menu {
......
......@@ -197,7 +197,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
{
text: "主表单",
disabled: false,
drviewid: "form",
id: "form",
},
];
......@@ -270,7 +269,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof Default
*/
private getDRBarItem(arg: any = {}): any {
let expmode = arg.nodetype.toUpperCase();
let expmode = arg.nodetype;
if (!expmode) {
expmode = '';
}
......@@ -301,7 +300,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 获取子项
*
* @param {any[]} items
* @param {string} drviewid
* @param {string} id
* @returns {*}
* @memberof Default
*/
......@@ -338,7 +337,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$emit('selectionchange', [item]);
const refview = this.getDRBarItem({ nodetype: item.drviewid });
const refview = this.getDRBarItem({ nodetype: item.id });
this.selection = {};
const _context: any = { ...JSON.parse(JSON.stringify(this.context)) };
const _params: any = { ...JSON.parse(JSON.stringify(this.viewparams)) };
......
......@@ -27,6 +27,7 @@
height: 18px;
width: 18px;
margin-top: -2px;
margin-right: 5px;
}
}
.el-menu-item, .el-submenu, .el-menu {
......
......@@ -197,7 +197,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
{
text: "主表单",
disabled: false,
drviewid: "form",
id: "form",
},
];
......@@ -270,7 +269,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof Default
*/
private getDRBarItem(arg: any = {}): any {
let expmode = arg.nodetype.toUpperCase();
let expmode = arg.nodetype;
if (!expmode) {
expmode = '';
}
......@@ -301,7 +300,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 获取子项
*
* @param {any[]} items
* @param {string} drviewid
* @param {string} id
* @returns {*}
* @memberof Default
*/
......@@ -338,7 +337,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$emit('selectionchange', [item]);
const refview = this.getDRBarItem({ nodetype: item.drviewid });
const refview = this.getDRBarItem({ nodetype: item.id });
this.selection = {};
const _context: any = { ...JSON.parse(JSON.stringify(this.context)) };
const _params: any = { ...JSON.parse(JSON.stringify(this.viewparams)) };
......
......@@ -27,6 +27,7 @@
height: 18px;
width: 18px;
margin-top: -2px;
margin-right: 5px;
}
}
.el-menu-item, .el-submenu, .el-menu {
......
......@@ -197,7 +197,6 @@ export default class DefaultBase extends Vue implements ControlInterface {
{
text: "主表单",
disabled: false,
drviewid: "form",
id: "form",
},
];
......@@ -270,7 +269,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof Default
*/
private getDRBarItem(arg: any = {}): any {
let expmode = arg.nodetype.toUpperCase();
let expmode = arg.nodetype;
if (!expmode) {
expmode = '';
}
......@@ -301,7 +300,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 获取子项
*
* @param {any[]} items
* @param {string} drviewid
* @param {string} id
* @returns {*}
* @memberof Default
*/
......@@ -338,7 +337,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
this.$emit('selectionchange', [item]);
const refview = this.getDRBarItem({ nodetype: item.drviewid });
const refview = this.getDRBarItem({ nodetype: item.id });
this.selection = {};
const _context: any = { ...JSON.parse(JSON.stringify(this.context)) };
const _params: any = { ...JSON.parse(JSON.stringify(this.viewparams)) };
......
......@@ -27,6 +27,7 @@
height: 18px;
width: 18px;
margin-top: -2px;
margin-right: 5px;
}
}
.el-menu-item, .el-submenu, .el-menu {
......
......@@ -22,7 +22,7 @@
</dependencies>
<properties>
<docker.image.prefix>172.16.100.243:5000/ibiz</docker.image.prefix>
<docker.image.prefix>registry.cn-shanghai.aliyuncs.com/ibizsys</docker.image.prefix>
</properties>
......@@ -103,6 +103,7 @@
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<serverId>ibiz-dev</serverId>
<imageName>${docker.image.prefix}/${project.artifactId}:latest</imageName>
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<resources>
......
version: "3.2"
services:
ibzuaa-app-web:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-app-web:latest
ports:
- "8080:8080"
networks:
- agent_network
deploy:
mode: replicated
replicas: 1
networks:
agent_network:
driver: overlay
attachable: true
\ No newline at end of file
package cn.ibizlab.core.uaa.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
/**
* 实体[实体]
*/
@Data
@TableName(value = "IBZPSSYSTEM",resultMap = "SYS_PSSYSTEMResultMap")
public class SYS_PSSYSTEM extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 系统标识
*/
@DEField(isKeyField=true)
@TableId(value= "pssystemid",type=IdType.UUID)
@JSONField(name = "pssystemid")
@JsonProperty("pssystemid")
private String pssystemid;
/**
* 系统名称
*/
@TableField(value = "pssystemname")
@JSONField(name = "pssystemname")
@JsonProperty("pssystemname")
private String pssystemname;
/**
* 设置 [系统名称]
*/
public void setPssystemname(String pssystemname){
this.pssystemname = pssystemname ;
this.modify("pssystemname",pssystemname);
}
}
package cn.ibizlab.core.uaa.filter;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.uaa.domain.SYS_PSSYSTEM;
/**
* 关系型数据实体[SYS_PSSYSTEM] 查询条件对象
*/
@Slf4j
@Data
public class SYS_PSSYSTEMSearchContext extends QueryWrapperContext<SYS_PSSYSTEM> {
private String n_pssystemname_like;//[系统名称]
public void setN_pssystemname_like(String n_pssystemname_like) {
this.n_pssystemname_like = n_pssystemname_like;
if(!ObjectUtils.isEmpty(this.n_pssystemname_like)){
this.getSelectCond().like("pssystemname", n_pssystemname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().or().like("pssystemname",query);
}
}
}
package cn.ibizlab.core.uaa.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.Map;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.core.uaa.domain.SYS_PSSYSTEM;
import cn.ibizlab.core.uaa.filter.SYS_PSSYSTEMSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface SYS_PSSYSTEMMapper extends BaseMapper<SYS_PSSYSTEM>{
Page<SYS_PSSYSTEM> searchDefault(IPage page, @Param("srf") SYS_PSSYSTEMSearchContext context, @Param("ew") Wrapper<SYS_PSSYSTEM> wrapper) ;
@Override
SYS_PSSYSTEM selectById(Serializable id);
@Override
int insert(SYS_PSSYSTEM entity);
@Override
int updateById(@Param(Constants.ENTITY) SYS_PSSYSTEM entity);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql);
}
package cn.ibizlab.core.uaa.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import cn.ibizlab.core.uaa.domain.SYS_PSSYSTEM;
import cn.ibizlab.core.uaa.filter.SYS_PSSYSTEMSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[SYS_PSSYSTEM] 服务对象接口
*/
public interface ISYS_PSSYSTEMService extends IService<SYS_PSSYSTEM>{
boolean checkKey(SYS_PSSYSTEM et) ;
SYS_PSSYSTEM get(String key) ;
boolean create(SYS_PSSYSTEM et) ;
void createBatch(List<SYS_PSSYSTEM> list) ;
SYS_PSSYSTEM getDraft(SYS_PSSYSTEM et) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
boolean save(SYS_PSSYSTEM et) ;
void saveBatch(List<SYS_PSSYSTEM> list) ;
boolean update(SYS_PSSYSTEM et) ;
void updateBatch(List<SYS_PSSYSTEM> list) ;
Page<SYS_PSSYSTEM> searchDefault(SYS_PSSYSTEMSearchContext context) ;
List<JSONObject> select(String sql);
boolean execute(String sql);
}
package cn.ibizlab.core.uaa.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.HashSet;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.uaa.domain.SYS_PSSYSTEM;
import cn.ibizlab.core.uaa.filter.SYS_PSSYSTEMSearchContext;
import cn.ibizlab.core.uaa.service.ISYS_PSSYSTEMService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.uaa.mapper.SYS_PSSYSTEMMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
/**
* 实体[实体] 服务对象接口实现
*/
@Slf4j
@Service
public class SYS_PSSYSTEMServiceImpl extends ServiceImpl<SYS_PSSYSTEMMapper, SYS_PSSYSTEM> implements ISYS_PSSYSTEMService {
private int batchSize = 500;
@Override
public boolean checkKey(SYS_PSSYSTEM et) {
return (!ObjectUtils.isEmpty(et.getPssystemid()))&&(!Objects.isNull(this.getById(et.getPssystemid())));
}
@Override
@Transactional
public SYS_PSSYSTEM get(String key) {
SYS_PSSYSTEM et = getById(key);
if(et==null){
et=new SYS_PSSYSTEM();
et.setPssystemid(key);
}
else{
}
return et;
}
@Override
@Transactional
public boolean create(SYS_PSSYSTEM et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getPssystemid()),et);
return true;
}
@Override
public void createBatch(List<SYS_PSSYSTEM> list) {
saveBatch(list,batchSize);
}
@Override
public SYS_PSSYSTEM getDraft(SYS_PSSYSTEM et) {
return et;
}
@Override
@Transactional
public boolean remove(String key) {
if(!removeById(key)) return false;
return true ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public boolean save(SYS_PSSYSTEM et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(SYS_PSSYSTEM et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public void saveBatch(List<SYS_PSSYSTEM> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(SYS_PSSYSTEM et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("pssystemid",et.getPssystemid())))
return false;
CachedBeanCopier.copy(get(et.getPssystemid()),et);
return true;
}
@Override
public void updateBatch(List<SYS_PSSYSTEM> list) {
updateBatchById(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<SYS_PSSYSTEM> searchDefault(SYS_PSSYSTEMSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<SYS_PSSYSTEM> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<SYS_PSSYSTEM>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql){
return this.baseMapper.selectBySQL(sql);
}
@Override
@Transactional
public boolean execute(String sql){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql);
}
log.warn("暂未支持的SQL语法");
return true;
}
}
......@@ -4,63 +4,63 @@
{
"dename":"SYS_ROLE_PERMISSION",
"delogicname":"角色权限关系",
"sysmoudle":{"id":"UAA","name":"统一授权认证"},
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default","name":"默认数据集"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CUR_ORG","name":"当前部门"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"deprivs":[{"id":"READ","name":"READ"},{"id":"CREATE","name":"CREATE"},{"id":"UPDATE","name":"UPDATE"},{"id":"DELETE","name":"DELETE"}]
}
,
{
"dename":"SYS_PERMISSION",
"delogicname":"权限/资源",
"sysmoudle":{"id":"UAA","name":"统一授权认证"},
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default","name":"默认数据集"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CUR_ORG","name":"当前部门"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"deprivs":[{"id":"READ","name":"READ"},{"id":"CREATE","name":"CREATE"},{"id":"UPDATE","name":"UPDATE"},{"id":"DELETE","name":"DELETE"}]
}
,
{
"dename":"SYS_USER_ROLE",
"delogicname":"用户角色关系",
"sysmoudle":{"id":"UAA","name":"统一授权认证"},
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default","name":"默认数据集"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CUR_ORG","name":"当前部门"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"deprivs":[{"id":"READ","name":"READ"},{"id":"CREATE","name":"CREATE"},{"id":"UPDATE","name":"UPDATE"},{"id":"DELETE","name":"DELETE"}]
}
,
{
"dename":"SYS_USER",
"delogicname":"系统用户",
"sysmoudle":{"id":"UAA","name":"统一授权认证"},
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default","name":"默认数据集"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CUR_ORG","name":"当前部门"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"deprivs":[{"id":"READ","name":"READ"},{"id":"CREATE","name":"CREATE"},{"id":"UPDATE","name":"UPDATE"},{"id":"DELETE","name":"DELETE"}]
}
,
{
"dename":"SYS_ROLE",
"delogicname":"系统角色",
"sysmoudle":{"id":"UAA","name":"统一授权认证"},
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default","name":"默认数据集"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CUR_ORG","name":"当前部门"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"deprivs":[{"id":"READ","name":"READ"},{"id":"CREATE","name":"CREATE"},{"id":"UPDATE","name":"UPDATE"},{"id":"DELETE","name":"DELETE"}]
}
,
{
"dename":"SYS_PSAPPMENUITEM",
"delogicname":"系统菜单项",
"sysmoudle":{"id":"UAA","name":"统一授权认证"},
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default","name":"默认数据集"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CUR_ORG","name":"当前部门"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"deprivs":[{"id":"READ","name":"READ"},{"id":"CREATE","name":"CREATE"},{"id":"UPDATE","name":"UPDATE"},{"id":"DELETE","name":"DELETE"}]
}
,
{
"dename":"SYS_PSDEOPPRIV",
"delogicname":"实体数据操作标识",
"sysmoudle":{"id":"UAA","name":"统一授权认证"},
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default","name":"默认数据集"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CUR_ORG","name":"当前部门"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"deprivs":[{"id":"READ","name":"READ"},{"id":"CREATE","name":"CREATE"},{"id":"UPDATE","name":"UPDATE"},{"id":"DELETE","name":"DELETE"}]
}
]
......
......@@ -111,8 +111,18 @@
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_PSSYSTEM]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_pssystem-9-6">
<createTable tableName="IBZPSSYSTEM">
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PSSYSTEM_PSSYSTEMID"/>
</column>
<column name="PSSYSTEMNAME" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_PERMISSION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_permission-60-6">
<changeSet author="a_A_5d9d78509" id="tab-sys_permission-65-7">
<createTable tableName="IBZPERMISSION">
<column name="SYS_PERMISSIONID" remarks="" type="VARCHAR(200)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PERMISSION_SYS_PERMISSI"/>
......@@ -132,7 +142,7 @@
</createTable>
</changeSet>
<!--输出实体[SYS_PSAPPMENUITEM]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_psappmenuitem-29-7">
<changeSet author="a_A_5d9d78509" id="tab-sys_psappmenuitem-29-8">
<createTable tableName="IBZPSAPPMENUITEM">
<column name="SYS_PSAPPMENUITEMID" remarks="" type="VARCHAR(200)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PSAPPMENUITEM_SYS_PSAPP"/>
......@@ -165,17 +175,18 @@
<!--输出实体[SYS_PSDEOPPRIV]外键关系 -->
<!--输出实体[SYS_USER]外键关系 -->
<!--输出实体[SYS_ROLE_PERMISSION]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-sys_role_permission-28-8">
<changeSet author="a_A_5d9d78509" id="fk-sys_role_permission-28-9">
<addForeignKeyConstraint baseColumnNames="SYS_PERMISSIONID" baseTableName="IBZROLE_PERMISSION" constraintName="DER1N_SYS_ROLE_PERMISSION_SYS_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SYS_PERMISSIONID" referencedTableName="IBZPERMISSION" validate="true"/>
</changeSet>
<!--输出实体[SYS_USER_ROLE]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-sys_user_role-33-10">
<changeSet author="a_A_5d9d78509" id="fk-sys_user_role-33-11">
<addForeignKeyConstraint baseColumnNames="SYS_ROLEID" baseTableName="IBZUSER_ROLE" constraintName="DER1N_SYS_USER_ROLE_SYS_ROLE_S" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SYS_ROLEID" referencedTableName="IBZROLE" validate="true"/>
</changeSet>
<changeSet author="a_A_5d9d78509" id="fk-sys_user_role-33-11">
<changeSet author="a_A_5d9d78509" id="fk-sys_user_role-33-12">
<addForeignKeyConstraint baseColumnNames="SYS_USERID" baseTableName="IBZUSER_ROLE" constraintName="DER1N_SYS_USER_ROLE_SYS_USER_S" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="USERID" referencedTableName="IBZUSER" validate="true"/>
</changeSet>
<!--输出实体[SYS_ROLE]外键关系 -->
<!--输出实体[SYS_PSSYSTEM]外键关系 -->
<!--输出实体[SYS_PERMISSION]外键关系 -->
<!--输出实体[SYS_PSAPPMENUITEM]外键关系 -->
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.core.uaa.mapper.SYS_PSSYSTEMMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="SYS_PSSYSTEMResultMap" type="cn.ibizlab.core.uaa.domain.SYS_PSSYSTEM" autoMapping="true">
<id property="pssystemid" column="pssystemid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.uaa.filter.SYS_PSSYSTEMSearchContext" resultMap="SYS_PSSYSTEMResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`PSSYSTEMID`, t1.`PSSYSTEMNAME` FROM `IBZPSSYSTEM` t1
]]>
</sql>
</mapper>
......@@ -31,6 +31,10 @@
</dependency>
</dependencies>
<properties>
<docker.image.prefix>registry.cn-shanghai.aliyuncs.com/ibizsys</docker.image.prefix>
</properties>
<profiles>
<profile>
<id>uaaapi</id>
......@@ -62,6 +66,23 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<serverId>ibiz-dev</serverId>
<imageName>${docker.image.prefix}/${project.artifactId}:latest</imageName>
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>../../</directory>
<include>${project.artifactId}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
......
FROM openjdk:8-jre-alpine
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
IBZ_SLEEP=0 \
JAVA_OPTS=""
CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzuaa-provider-uaaapi.jar
EXPOSE 8081
ADD ibzuaa-provider-uaaapi.jar /ibzuaa-provider-uaaapi.jar
version: "3.2"
services:
ibzuaa-provider-uaaapi:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-provider-uaaapi:latest
ports:
- "8081:8081"
networks:
- agent_network
deploy:
mode: replicated
replicas: 1
networks:
agent_network:
driver: overlay
attachable: true
\ No newline at end of file
......@@ -71,7 +71,6 @@ public class SYS_PERMISSIONResource {
@PreAuthorize("hasPermission('','CREATE',this.getEntity())")
@ApiOperation(value = "GetDraft", tags = {"SYS_PERMISSION" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/sys_permissions/getdraft")
public ResponseEntity<SYS_PERMISSIONDTO> getDraft() {
......
......@@ -116,7 +116,6 @@ public class SYS_PSAPPMENUITEMResource {
@PreAuthorize("hasPermission('','CREATE',this.getEntity())")
@ApiOperation(value = "GetDraft", tags = {"SYS_PSAPPMENUITEM" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/sys_psappmenuitems/getdraft")
public ResponseEntity<SYS_PSAPPMENUITEMDTO> getDraft() {
......
......@@ -82,7 +82,6 @@ public class SYS_PSDEOPPRIVResource {
@PreAuthorize("hasPermission('','CREATE',this.getEntity())")
@ApiOperation(value = "GetDraft", tags = {"SYS_PSDEOPPRIV" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/sys_psdeopprivs/getdraft")
public ResponseEntity<SYS_PSDEOPPRIVDTO> getDraft() {
......
......@@ -146,7 +146,6 @@ public class SYS_ROLEResource {
@PreAuthorize("hasPermission('','CREATE',this.getEntity())")
@ApiOperation(value = "GetDraft", tags = {"SYS_ROLE" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/sys_roles/getdraft")
public ResponseEntity<SYS_ROLEDTO> getDraft() {
......
......@@ -85,7 +85,6 @@ public class SYS_ROLE_PERMISSIONResource {
@PreAuthorize("hasPermission('','CREATE',this.getEntity())")
@ApiOperation(value = "GetDraft", tags = {"SYS_ROLE_PERMISSION" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/sys_role_permissions/getdraft")
public ResponseEntity<SYS_ROLE_PERMISSIONDTO> getDraft() {
......
......@@ -133,7 +133,6 @@ public class SYS_USERResource {
@PreAuthorize("hasPermission('','CREATE',this.getEntity())")
@ApiOperation(value = "GetDraft", tags = {"SYS_USER" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/sys_users/getdraft")
public ResponseEntity<SYS_USERDTO> getDraft() {
......
......@@ -64,7 +64,6 @@ public class SYS_USER_ROLEResource {
@PreAuthorize("hasPermission('','CREATE',this.getEntity())")
@ApiOperation(value = "GetDraft", tags = {"SYS_USER_ROLE" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/sys_user_roles/getdraft")
public ResponseEntity<SYS_USER_ROLEDTO> getDraft() {
......
package cn.ibizlab.util.client;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
@Component
public class IBZOUFallback implements IBZOUFeignClient {
@Override
public JSONObject getOrgInfo(String loginName) {
return null;
}
}
package cn.ibizlab.util.client;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@FeignClient(value = "ibzou",fallback = IBZOUFallback.class)
public interface IBZOUFeignClient
{
/**
* 从ou中获取当前上下级组织、部门信息
* @param loginName 登录名
* @return
*/
@GetMapping(value = "/ibzou/org/{loginname}")
JSONObject getOrgInfo(@PathVariable("loginname") String loginName);
}
package cn.ibizlab.util.client;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
import java.util.Map;
@Component
public class IBZUAAFallback implements IBZUAAFeignClient {
@Override
public JSONObject getUserPermissionData(String loginName, String systemId) {
return null;
}
@Override
public Map<String, Object> pushSystemPermissionData(Map<String, Object> systemPermissionData, String systemId) {
return null;
}
}
package cn.ibizlab.util.client;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@FeignClient(value = "ibzuaa",fallback = IBZUAAFallback.class)
public interface IBZUAAFeignClient
{
/**
* 从uaa中获取当前用户权限
* @param loginName
* @param systemId
* @return
*/
@GetMapping(value = "/uaa/permission/{loginname}")
JSONObject getUserPermissionData(@PathVariable("loginname") String loginName, @RequestParam("systemid") String systemId);
/**
* 推送系统权限数据到uaa
* @param systemPermissionData
* @param systemId
* @return
*/
@PostMapping("/uaa/permission/save")
Map<String,Object> pushSystemPermissionData(@RequestBody Map<String, Object> systemPermissionData, @RequestParam("systemid") String systemId);
}
......@@ -2,7 +2,7 @@ package cn.ibizlab.util.job;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import cn.ibizlab.util.client.uaa.UAAFeignClient;
import cn.ibizlab.util.client.IBZUAAFeignClient;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
......@@ -21,13 +21,13 @@ import java.io.IOException;
/**
* 权限:向uaa同步当前系统菜单、权限资源任务类
*/
//@Component //开启此类需要保证Main中开启了feign :EnableFeignClients
@Component //开启此类需要保证Main中开启了feign :EnableFeignClients
public class PermissionSyncJob implements ApplicationRunner {
private Log log = LogFactory.getLog(PermissionSyncJob.class);
@Autowired
private UAAFeignClient client;
private IBZUAAFeignClient client;
@Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验
......
......@@ -2,7 +2,6 @@ package cn.ibizlab.util.security;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.util.domain.EntityBase;
......@@ -111,28 +110,32 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
boolean isPermission;
EntityBase entityBase = null;
EntityBase entity = null;
if (cur_entity instanceof EntityBase)
entityBase = (EntityBase) cur_entity;
entity = (EntityBase) cur_entity;
if (StringUtils.isEmpty(entityBase))
if (StringUtils.isEmpty(entity))
return false;
try {
String entityName = entityBase.getClass().getSimpleName(); //实体名
String entityName = entity.getClass().getSimpleName(); //实体名
if(action.equals("CREATE")){ //表单新建权限校验
JSONObject permissionList= AuthenticationUser.getAuthenticationUser().getPermisionList();//获取权限列表
JSONObject formDataAbility=permissionList.getJSONObject("dataAbility-form");//获取表单的权限数据
return isFormCreatePermission(formDataAbility,entityName,action);//拼接权限条件
}
else{ //表单编辑、查询权限校验
else{
//表单编辑、查询权限校验
ServiceImpl service= SpringContextHolder.getBean(String.format("%s%s",getBeanName(entityName),"ServiceImpl"));//获取当前实体service
JSONObject permissionList= AuthenticationUser.getAuthenticationUser().getPermisionList();//获取权限列表
JSONObject formDataAbility=permissionList.getJSONObject("dataAbility-form");//获取表单的权限数据
Map<String,String> permissionField=getPermissionField(entityBase);
String selectCond=generatePermissionSQLForm(formDataAbility,entityName,action,srfkey,permissionField);//拼接权限条件
if(isAllData(formDataAbility,entityName,action)){//若为全部数据则直接返回,不再进行校验
return true;
}
Map<String,String> permissionField=getPermissionField(entity);//获取系统预置属性
String selectCond=generatePermissionSQLForm(formDataAbility,entityName,action,srfkey,permissionField);//根据uaa中分配的权限拼接where条件
if(StringUtils.isEmpty(selectCond))
return false;
QueryWrapper permissionCond=getPermissionCond(selectCond,permissionField);
......@@ -144,6 +147,33 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
return isPermission;
}
/**
* 判断是否包含全部数据
* @param formDataAbility
* @param entityName
* @param action
* @return
*/
private boolean isAllData(JSONObject formDataAbility, String entityName, String action) {
if(formDataAbility==null)
return false;
if(!formDataAbility.containsKey(entityName))
return false;
JSONObject entityObj=formDataAbility.getJSONObject(entityName);//获取实体
if(!entityObj.containsKey(action))
return false;
JSONArray entityOperation=entityObj.getJSONArray(action);//行为:read;insert...
if(entityOperation.size()==0)
return false;
if(entityOperation.contains("ALL")){ //全部数据
return true;
}
return false;
}
/**
* 拼接表格查询条件
* @param gridDataAbility
......@@ -260,41 +290,51 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
*/
private String getPermissionCond(JSONArray entityOperation, Map<String,String> permissionField){
String orgField=permissionField.get("orgfield");
String orgsecfield=permissionField.get("orgsecfield");
StringBuffer cond=new StringBuffer();
String orgDeptField=permissionField.get("orgsecfield");
StringBuffer permissionSQL=new StringBuffer();
AuthenticationUser authenticationUser = AuthenticationUser.getAuthenticationUser();
JSONObject userInfo = authenticationUser.getOrgInfo();
JSONObject orgObject = userInfo.getJSONObject("org");
JSONArray orgParent = orgObject.getJSONArray("porg");
JSONArray orgChild = orgObject.getJSONArray("sorg");
JSONObject orgDeptObject = userInfo.getJSONObject("orgdept");
JSONArray orgDeptParent = orgDeptObject.getJSONArray("porgdept");
JSONArray orgDeptChild = orgDeptObject.getJSONArray("sorgdept");
for(int i=0;i<entityOperation.size();i++){
if(i>0 && (!StringUtils.isEmpty(cond.toString())))
cond.append("OR");
if(i>0 && (!StringUtils.isEmpty(permissionSQL.toString())))
permissionSQL.append("OR");
String permissionCond=entityOperation.getString(i);//权限配置条件
if(permissionCond.equals("CUR_ORG")){ //本单位
cond.append(String.format("(t1.%s='%s')",orgField,AuthenticationUser.getAuthenticationUser().getOrgid()));
if(permissionCond.equals("CURORG")){ //本单位
permissionSQL.append(String.format("(%s='%s')",orgField,AuthenticationUser.getAuthenticationUser().getOrgid()));
}
if(permissionCond.equals("SUB_ORG")){//下级单位
cond.append(" INSTR(j1.LEVELCODE,'"+AuthenticationUser.getAuthenticationUser().getLevelcode()+"')=1 ");
if(permissionCond.equals("SORG")){//下级单位
permissionSQL.append(String.format(" %s in(%s) ", orgField, formatStringArr(orgChild)));
}
if(permissionCond.equals("HIT_ORG")){//上级单位
cond.append(" INSTR('"+AuthenticationUser.getAuthenticationUser().getLevelcode()+"',j1.LEVELCODE)=1 ");
if(permissionCond.equals("PORG")){//上级单位
permissionSQL.append(String.format(" %s in(%s) ", orgField, formatStringArr(orgParent)));
}
if(permissionCond.equals("CREATEMAN")){//建立人
cond.append(String.format("(t1.createman='%s')",AuthenticationUser.getAuthenticationUser().getUserid()));
permissionSQL.append(String.format("(createman='%s')",AuthenticationUser.getAuthenticationUser().getUserid()));
}
if(permissionCond.equals("CURORGDEPT")){//本部门
permissionSQL.append(String.format("(orgsecid='%s')",AuthenticationUser.getAuthenticationUser().getMdeptid()));
}
if(permissionCond.equals("SORGDEPT")){//下级部门
permissionSQL.append(String.format(" %s in (%s) ", orgDeptField, formatStringArr(orgDeptChild)));
}
if(permissionCond.equals("PORGDEPT")){//上级部门
permissionSQL.append(String.format(" %s in (%s) ", orgDeptField, formatStringArr(orgDeptParent)));
}
// if(permissionCond.equals("CUR_ORGSEC")){//本部门
// cond.append(String.format("(t1.orgsecid='%s')",AuthenticationUser.getAuthenticationUser().getMdeptid()));
// }
// if(permissionCond.equals("SUB_ORGSEC")){//下级部门
// cond.append(" INSTR(j2.LEVELCODE,'"+AuthenticationUser.getAuthenticationUser().getMdeptcode()+"')=1 ");
// }
// if(permissionCond.equals("HIGH_ORGSEC")){//上级部门
// cond.append(" INSTR('"+AuthenticationUser.getAuthenticationUser().getMdeptcode()+"',j2.LEVELCODE)=1 ");
// }
if(permissionCond.equals("ALL")){//全部数据
cond.append("(1=1)");
permissionSQL.append("(1=1)");
}
}
if(StringUtils.isEmpty(cond.toString()))
if(StringUtils.isEmpty(permissionSQL.toString()))
return "";
String resultCond=cond.toString();
String resultCond=permissionSQL.toString();
if(resultCond.endsWith("OR")){
resultCond=resultCond.substring(0,resultCond.lastIndexOf("OR"));
}
......@@ -309,15 +349,11 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
*/
private QueryWrapper getPermissionCond(String whereCond, Map<String,String> permissionField){
Wrapper wrapper =new QueryWrapper();
QueryWrapper allPermissionCond=new QueryWrapper();
//permissionCond.apply("inner join JC_ORG j1 on t1.ORGID=j1.orgid inner join JC_ORGSEC j2 on t1.orgsecid=j2.orgsecid");
if(StringUtils.isEmpty(whereCond))
return allPermissionCond;
// String strAllPermissionCond=String.format("inner join XT_ZZJG_DWBM j1 on t1.%s=j1.dwbm where (%s) ",permissionField.get("orgfield"),whereCond);
allPermissionCond.apply(whereCond);
return allPermissionCond;
......@@ -361,4 +397,15 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
}
}
/**
* 转换[a,b]格式字符串到 'a','b'格式
*
* @return
*/
private String formatStringArr(JSONArray array) {
String[] arr = array.toArray(new String[array.size()]);
return "'" + String.join("','", arr) + "'";
}
}
\ No newline at end of file
......@@ -62,9 +62,12 @@ public class AuthenticationUser implements UserDetails
private int superuser;
@JsonIgnore
private JSONObject permisionList;
private String levelcode;//单位级别编码
private String orglevel;//单位级别
private String deptlevel;//部门级别
@JsonIgnore
private Map<String,String> userSessionParam;//用户自定义session值
@JsonIgnore
private JSONObject orgInfo;//上下级组织信息
@JsonIgnore
......
package cn.ibizlab.util.service;
import cn.ibizlab.util.security.AuthenticationUser;
import cn.ibizlab.util.client.uaa.UAAFeignClient;
import cn.ibizlab.util.client.IBZUAAFeignClient;
import cn.ibizlab.util.client.IBZOUFeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
......@@ -18,7 +19,17 @@ import org.springframework.beans.factory.annotation.Value;
@Service("SimpleUserService")
public class SimpleUserService implements AuthenticationUserService{
@Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验
@Value("${ibiz.systemid:2C40DFCD-0DF5-47BF-91A5-C45F810B0001}")
private String systemid;
@Autowired
private IBZUAAFeignClient uaaFeignClient;
@Autowired
private IBZOUFeignClient ouFeignClient;
@Override
public AuthenticationUser loadUserByUsername(String username) {
......@@ -50,6 +61,7 @@ public class SimpleUserService implements AuthenticationUserService{
user.setOrgname(domains);
setUserPermission(user);
setUserOrgInfo(user);
return user;
}
......@@ -73,25 +85,27 @@ public class SimpleUserService implements AuthenticationUserService{
}
@Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验
@Value("${ibiz.systemid:2C40DFCD-0DF5-47BF-91A5-C45F810B0001}")
private String systemid;
@Autowired
private UAAFeignClient client;
/**
* 设置用户权限
*/
private void setUserPermission(AuthenticationUser curUser) {
private void setUserPermission(AuthenticationUser user) {
if(enablePermissionValid){
String userid=curUser.getUserid();
//String userid="4fb71d8997d4505d2748ad2bdc471969";
//String systemid="2C40DFCD-0DF5-47BF-91A5-C45F810B0001";
JSONObject permission= client.getUserPermissionData(userid,systemid);
curUser.setPermisionList(permission);
JSONObject permission= uaaFeignClient.getUserPermissionData(user.getLoginname(),systemid);
user.setPermisionList(permission);
}
}
/**
* 设置用户组织相关信息
* @param user
*/
private void setUserOrgInfo(AuthenticationUser user) {
if(enablePermissionValid) {
JSONObject orgInfo=ouFeignClient.getOrgInfo(user.getLoginname());
if(orgInfo==null)
throw new RuntimeException("获取用户信息失败,请检查用户中心[IBZOU]中是否存在当前用户!");
user.setOrgInfo(orgInfo);
}
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册