提交 d358d064 编写于 作者: lzlhxj's avatar lzlhxj

Merge branch 'master' of http://labcs.ibizee.cn/ibiz4jteam/ibzuaa

......@@ -5,9 +5,19 @@
"codelisttype":"static",
"items": [
{
"id": "APPMENU",
"label": "应用菜单",
"text": "应用菜单",
"data":"",
"codename":"Appmenu",
"value": "APPMENU",
"disabled": false
}
, {
"id": "OPPRIV",
"label": "数据对象能力",
"text": "数据对象能力",
"label": "数据能力",
"text": "数据能力",
"data":"",
"codename":"Oppriv",
"value": "OPPRIV",
......
......@@ -47,6 +47,14 @@ export default class AppFormDRUIPart extends Vue {
*/
@Prop({ default: '' }) public refreshitems!: string;
/**
* 禁止加载
*
* @type {string}
* @memberof AppFormDRUIPart
*/
@Prop({ default: false }) public isForbidLoad!: boolean;
/**
* 关系视图类型
*
......@@ -254,8 +262,10 @@ export default class AppFormDRUIPart extends Vue {
this.blockUIStop();
}
}
if(!this.isForbidLoad){
this.formDruipart.next({action:'load',data:{srfparentdename:this.parentName,srfparentkey:_paramitem}});
}
}
/**
* vue 生命周期
......
......@@ -22,7 +22,7 @@ export const Environment = {
// 是否为开发模式
devMode: true,
// 项目模板地址
ProjectUrl: "http://demo.ibizlab.cn/groups/ibizr7pfstdtempl",
ProjectUrl: "http://demo.ibizlab.cn/ibizr7pfstdtempl/ibizvuer7",
// 配置平台地址
StudioUrl: "http://172.16.170.145/slnstudio/",
// 中心标识
......
export default {
CLPermissionType: {
'OPPRIV': '数据对象能力',
'APPMENU': '应用菜单',
'OPPRIV': '数据能力',
'UNIRES': '统一资源',
empty: '',
},
......
export default {
CLPermissionType: {
'OPPRIV': '数据对象能力',
'APPMENU': '应用菜单',
'OPPRIV': '数据能力',
'UNIRES': '统一资源',
empty: '',
},
......
......@@ -3,7 +3,7 @@ export default {
fields: {
permissionid: '资源标识',
permissionname: '资源名称',
pssystemid: '系统标识',
pssystemid: '系统',
permissiontype: '资源类别',
enable: '逻辑有效',
createdate: '建立时间',
......@@ -72,6 +72,7 @@ export default {
default_searchform: {
details: {
formpage1: "常规条件",
n_systemid_like: "系统(%)",
n_sys_permissionname_like: "资源名称(%)",
n_permissiontype_eq: "资源类别(=)",
n_pssourcetype_eq: "来源(=)",
......
......@@ -2,7 +2,7 @@ export default {
fields: {
permissionid: '资源标识',
permissionname: '资源名称',
pssystemid: '系统标识',
pssystemid: '系统',
permissiontype: '资源类别',
enable: '逻辑有效',
createdate: '建立时间',
......@@ -71,6 +71,7 @@ export default {
default_searchform: {
details: {
formpage1: '常规条件',
n_systemid_like: '系统(%)',
n_sys_permissionname_like: '资源名称(%)',
n_permissiontype_eq: '资源类别(=)',
n_pssourcetype_eq: '来源(=)',
......
......@@ -3,14 +3,13 @@ export default {
fields: {
appmenuitemid: '系统菜单项标识',
appmenuitemname: '系统菜单项名称',
psappid: '系统应用标识',
psappname: '系统应用名称',
psappmenuid: '系统菜单标识',
psappmenuname: '系统菜单名称',
isleaf: '是否为叶子节点(用于菜单)',
pssystemid: '实体标识',
permissionid: '系统资源标识',
parentpermissionid: '父项资源标识',
psappid: '业务系统应用标识',
psappname: '业务系统应用名称',
psappmenuid: '业务系统菜单标识',
psappmenuitemid: '业务系统菜单项标识',
psapppmenuitemid: '业务系统父菜单项标识',
psappmenuname: '业务系统菜单名称',
pssystemid: '业务系统标识',
createdate: '建立时间',
updatedate: '更新时间',
},
......
......@@ -2,14 +2,13 @@ export default {
fields: {
appmenuitemid: '系统菜单项标识',
appmenuitemname: '系统菜单项名称',
psappid: '系统应用标识',
psappname: '系统应用名称',
psappmenuid: '系统菜单标识',
psappmenuname: '系统菜单名称',
isleaf: '是否为叶子节点(用于菜单)',
pssystemid: '实体标识',
permissionid: '系统资源标识',
parentpermissionid: '父项资源标识',
psappid: '业务系统应用标识',
psappname: '业务系统应用名称',
psappmenuid: '业务系统菜单标识',
psappmenuitemid: '业务系统菜单项标识',
psapppmenuitemid: '业务系统父菜单项标识',
psappmenuname: '业务系统菜单名称',
pssystemid: '业务系统标识',
createdate: '建立时间',
updatedate: '更新时间',
},
......
......@@ -12,10 +12,20 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
emptytext: '未定义',
"codelisttype":"static",
items: [
{
id: 'APPMENU',
label: '应用菜单',
text: '应用菜单',
"data":"",
"codename":"Appmenu",
value: 'APPMENU',
disabled: false,
},
{
id: 'OPPRIV',
label: '数据对象能力',
text: '数据对象能力',
label: '数据能力',
text: '数据能力',
"data":"",
"codename":"Oppriv",
value: 'OPPRIV',
......
......@@ -92,7 +92,7 @@ export class StudioActionUtil {
const config: any = await this.getConfig(viewName);
if (config) {
const context: string = `视图模块:${config.viewmodule}\n视图标识:${config.viewname}\n视图类型:${config.viewtype}\n`;
window.open(`${Environment.ProjectUrl}/issues/`, '_blank');
window.open(`${Environment.ProjectUrl}/issues/new?issue[title]=${encodeURIComponent('问题')}&issue[description]=${encodeURIComponent(context)}`, '_blank');
}
}
......
......@@ -4,6 +4,12 @@
<row>
<i-col span="20" class="form-content">
<row>
<i-col v-show="detailsModel.n_systemid_like.visible" :style="{}" :md="{ span: 6, offset: 0 }" :lg="{ span: 6, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='n_systemid_like' :itemRules="this.rules.n_systemid_like" class='' :caption="$t('entities.sys_permission.default_searchform.details.n_systemid_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_systemid_like.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.n_systemid_like" @enter="onEnter($event)" :disabled="detailsModel.n_systemid_like.disabled" type='text' style="width:100px;"></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>
......@@ -268,6 +274,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public data: any = {
n_systemid_like: null,
n_sys_permissionname_like: null,
n_permissiontype_eq: null,
n_pssourcetype_eq: null,
......@@ -281,6 +288,12 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @memberof DefaultBase
*/
public rules: any = {
n_systemid_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' },
],
n_sys_permissionname_like: [
{ type: 'string', message: '资源名称(%) 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '资源名称(%) 值必须为字符串类型', trigger: 'blur' },
......@@ -315,6 +328,8 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public detailsModel: any = {
formpage1: new FormPageModel({ caption: '常规条件', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
,
n_systemid_like: new FormItemModel({ caption: '系统(%)', detailType: 'FORMITEM', name: 'n_systemid_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 })
,
......@@ -326,6 +341,18 @@ export default class DefaultBase extends Vue implements ControlInterface {
,
};
/**
* 监控表单属性 n_systemid_like 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@Watch('data.n_systemid_like')
onN_systemid_likeChange(newVal: any, oldVal: any) {
this.formDataChange({ name: 'n_systemid_like', newVal: newVal, oldVal: oldVal });
}
/**
* 监控表单属性 n_sys_permissionname_like 值
*
......@@ -399,6 +426,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
}
/**
......
......@@ -25,6 +25,11 @@ export default class DefaultModel {
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'n_systemid_like',
prop: 'pssystemid',
dataType: 'TEXT',
},
{
name: 'n_sys_permissionname_like',
prop: 'permissionname',
......
......@@ -282,8 +282,9 @@ export default class DefaultService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.permissionid = Util.createUUID();
Data.sys_permission = Data.permissionid;
const PrimaryKey = Util.createUUID();
Data.permissionid = PrimaryKey;
Data.sys_permission = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class DefaultService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.permissionid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -282,8 +282,9 @@ export default class MainService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.permissionid = Util.createUUID();
Data.sys_permission = Data.permissionid;
const PrimaryKey = Util.createUUID();
Data.permissionid = PrimaryKey;
Data.sys_permission = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class MainService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.permissionid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -65,6 +65,11 @@ export default class MainModel {
name: 'sys_permission',
prop: 'permissionid',
},
{
name: 'n_systemid_like',
prop: 'n_systemid_like',
dataType: 'TEXT',
},
{
name: 'n_sys_permissionname_like',
prop: 'n_sys_permissionname_like',
......
......@@ -264,7 +264,7 @@ export default class MainService extends ControlService {
if(response.data){
Object.assign(response.data,{srfuf:'0'});
//仿真主键数据
response.data.sys_permission = Util.createUUID();
response.data.permissionid = Util.createUUID();
}
this.handleResponse(action, response, true);
this.mergeDefaults(response);
......
......@@ -282,8 +282,9 @@ export default class DefaultService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.rolepermissionid = Util.createUUID();
Data.sys_role_permission = Data.rolepermissionid;
const PrimaryKey = Util.createUUID();
Data.rolepermissionid = PrimaryKey;
Data.sys_role_permission = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class DefaultService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.rolepermissionid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -306,8 +306,9 @@ export default class MainService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.rolepermissionid = Util.createUUID();
Data.sys_role_permission = Data.rolepermissionid;
const PrimaryKey = Util.createUUID();
Data.rolepermissionid = PrimaryKey;
Data.sys_role_permission = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -317,6 +318,7 @@ export default class MainService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.rolepermissionid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -264,7 +264,7 @@ export default class MainService extends ControlService {
if(response.data){
Object.assign(response.data,{srfuf:'0'});
//仿真主键数据
response.data.sys_role_permission = Util.createUUID();
response.data.rolepermissionid = Util.createUUID();
}
this.handleResponse(action, response, true);
this.mergeDefaults(response);
......
......@@ -282,8 +282,9 @@ export default class DefaultService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.roleid = Util.createUUID();
Data.sys_role = Data.roleid;
const PrimaryKey = Util.createUUID();
Data.roleid = PrimaryKey;
Data.sys_role = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class DefaultService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.roleid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -46,6 +46,7 @@
<app-form-druipart
:formState="formState"
:isForbidLoad="this.data.srfuf === '0'"
paramItem='sys_role'
:parentdata='{"srfparentdefname":"SYS_ROLEID","srfparentdename":"SYS_ROLE","SRFPARENTTYPE":"DER1N","srfparentmode":"DER1N_SYS_ROLE_PERMISSION_SYS_ROLE_SYS_ROLEID","SRFDER1NID":"DER1N_SYS_ROLE_PERMISSION_SYS_ROLE_SYS_ROLEID"}'
:parameters="[
......@@ -81,6 +82,7 @@
<app-form-druipart
:formState="formState"
:isForbidLoad="this.data.srfuf === '0'"
paramItem='sys_role'
:parentdata='{"srfparentdefname":"SYS_ROLEID","srfparentdename":"SYS_ROLE","SRFPARENTTYPE":"DER1N","srfparentmode":"DER1N_SYS_USER_ROLE_SYS_ROLE_SYS_ROLEID","SRFDER1NID":"DER1N_SYS_USER_ROLE_SYS_ROLE_SYS_ROLEID"}'
:parameters="[
......
......@@ -283,8 +283,9 @@ export default class MainService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.roleid = Util.createUUID();
Data.sys_role = Data.roleid;
const PrimaryKey = Util.createUUID();
Data.roleid = PrimaryKey;
Data.sys_role = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -294,6 +295,7 @@ export default class MainService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.roleid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -264,7 +264,7 @@ export default class MainService extends ControlService {
if(response.data){
Object.assign(response.data,{srfuf:'0'});
//仿真主键数据
response.data.sys_role = Util.createUUID();
response.data.roleid = Util.createUUID();
}
this.handleResponse(action, response, true);
this.mergeDefaults(response);
......
......@@ -282,8 +282,9 @@ export default class DefaultService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.userroleid = Util.createUUID();
Data.sys_user_role = Data.userroleid;
const PrimaryKey = Util.createUUID();
Data.userroleid = PrimaryKey;
Data.sys_user_role = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class DefaultService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.userroleid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -307,8 +307,9 @@ export default class MainService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.userroleid = Util.createUUID();
Data.sys_user_role = Data.userroleid;
const PrimaryKey = Util.createUUID();
Data.userroleid = PrimaryKey;
Data.sys_user_role = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -318,6 +319,7 @@ export default class MainService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.userroleid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -264,7 +264,7 @@ export default class MainService extends ControlService {
if(response.data){
Object.assign(response.data,{srfuf:'0'});
//仿真主键数据
response.data.sys_user_role = Util.createUUID();
response.data.userroleid = Util.createUUID();
}
this.handleResponse(action, response, true);
this.mergeDefaults(response);
......
......@@ -282,8 +282,9 @@ export default class DefaultService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.userid = Util.createUUID();
Data.sys_user = Data.userid;
const PrimaryKey = Util.createUUID();
Data.userid = PrimaryKey;
Data.sys_user = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class DefaultService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.userid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -25,6 +25,7 @@
<app-form-druipart
:formState="formState"
:isForbidLoad="this.data.srfuf === '0'"
paramItem='sys_user'
:parentdata='{"srfparentdefname":"SYS_USERID","srfparentdename":"SYS_USER","SRFPARENTTYPE":"DER1N","srfparentmode":"DER1N_SYS_USER_ROLE_SYS_USER_SYS_USERID","SRFDER1NID":"DER1N_SYS_USER_ROLE_SYS_USER_SYS_USERID"}'
:parameters="[
......
......@@ -283,8 +283,9 @@ export default class MainService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.userid = Util.createUUID();
Data.sys_user = Data.userid;
const PrimaryKey = Util.createUUID();
Data.userid = PrimaryKey;
Data.sys_user = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -294,6 +295,7 @@ export default class MainService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.userid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -264,7 +264,7 @@ export default class MainService extends ControlService {
if(response.data){
Object.assign(response.data,{srfuf:'0'});
//仿真主键数据
response.data.sys_user = Util.createUUID();
response.data.userid = Util.createUUID();
}
this.handleResponse(action, response, true);
this.mergeDefaults(response);
......
......@@ -37,11 +37,6 @@
git clone -b master $para2 ibzuaa/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzuaa/
mvn clean package -Pweb
cd ibzuaa-app/ibzuaa-app-web
mvn -Pweb docker:build
mvn -Pweb docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzuaa-app-web.yaml ibzlab-rt --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzuaa-app-web.jar
EXPOSE 30002
EXPOSE 8080
ADD ibzuaa-app-web.jar /ibzuaa-app-web.jar
......@@ -3,11 +3,9 @@ services:
ibzuaa-app-web:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-app-web:latest
ports:
- "30002:30002"
- "8080:8080"
networks:
- agent_network
environment:
SPRING_CLOUD_NACOS_DISCOVERY_IP: 172.16.180.237
deploy:
mode: replicated
replicas: 1
......
......@@ -42,6 +42,9 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter {
@Value("${ibiz.auth.path:v7/login}")
private String loginPath;
@Value("${ibiz.auth.logoutpath:v7/logout}")
private String logoutPath;
@Value("${ibiz.file.uploadpath:ibizutil/upload}")
private String uploadpath;
......@@ -107,6 +110,8 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter {
).permitAll()
//放行登录请求
.antMatchers( HttpMethod.POST,"/"+loginPath).permitAll()
//放行注销请求
.antMatchers( HttpMethod.GET,"/"+logoutPath).permitAll()
// 文件操作
.antMatchers("/"+downloadpath+"/**").permitAll()
.antMatchers("/"+uploadpath).permitAll()
......
server:
port: 30002
\ No newline at end of file
port: 8080
\ No newline at end of file
server:
port: 30002
port: 8080
#zuul网关路由设置
zuul:
......
......@@ -49,7 +49,7 @@ public class SYS_PERMISSION extends EntityMP implements Serializable {
@JsonProperty("permissionname")
private String permissionname;
/**
* 系统标识
* 系统
*/
@DEField(name = "systemid")
@TableField(value = "systemid")
......@@ -121,7 +121,7 @@ public class SYS_PERMISSION extends EntityMP implements Serializable {
this.modify("sys_permissionname",permissionname);
}
/**
* 设置 [系统标识]
* 设置 [系统]
*/
public void setPssystemid(String pssystemid){
this.pssystemid = pssystemid ;
......
......@@ -49,62 +49,54 @@ public class SYS_PSAPPMENUITEM extends EntityMP implements Serializable {
@JsonProperty("appmenuitemname")
private String appmenuitemname;
/**
* 系统应用标识
* 业务系统应用标识
*/
@TableField(value = "psappid")
@JSONField(name = "psappid")
@JsonProperty("psappid")
private String psappid;
/**
* 系统应用名称
* 业务系统应用名称
*/
@TableField(value = "psappname")
@JSONField(name = "psappname")
@JsonProperty("psappname")
private String psappname;
/**
* 系统菜单标识
* 业务系统菜单标识
*/
@TableField(value = "psappmenuid")
@JSONField(name = "psappmenuid")
@JsonProperty("psappmenuid")
private String psappmenuid;
/**
* 系统菜单名称
* 业务系统菜单项标识
*/
@TableField(value = "psappmenuitemid")
@JSONField(name = "psappmenuitemid")
@JsonProperty("psappmenuitemid")
private String psappmenuitemid;
/**
* 业务系统父菜单项标识
*/
@TableField(value = "psapppmenuitemid")
@JSONField(name = "psapppmenuitemid")
@JsonProperty("psapppmenuitemid")
private String psapppmenuitemid;
/**
* 业务系统菜单名称
*/
@TableField(value = "psappmenuname")
@JSONField(name = "psappmenuname")
@JsonProperty("psappmenuname")
private String psappmenuname;
/**
* 是否为叶子节点(用于菜单)
*/
@TableField(value = "isleaf")
@JSONField(name = "isleaf")
@JsonProperty("isleaf")
private Integer isleaf;
/**
* 实体标识
* 业务系统标识
*/
@TableField(value = "pssystemid")
@JSONField(name = "pssystemid")
@JsonProperty("pssystemid")
private String pssystemid;
/**
* 系统资源标识
*/
@TableField(value = "permissionid")
@JSONField(name = "permissionid")
@JsonProperty("permissionid")
private String permissionid;
/**
* 父项资源标识
*/
@DEField(name = "p_permissionid")
@TableField(value = "p_permissionid")
@JSONField(name = "parentpermissionid")
@JsonProperty("parentpermissionid")
private String parentpermissionid;
/**
* 建立时间
*/
......@@ -134,60 +126,53 @@ public class SYS_PSAPPMENUITEM extends EntityMP implements Serializable {
this.modify("sys_psappmenuitemname",appmenuitemname);
}
/**
* 设置 [系统应用标识]
* 设置 [业务系统应用标识]
*/
public void setPsappid(String psappid){
this.psappid = psappid ;
this.modify("psappid",psappid);
}
/**
* 设置 [系统应用名称]
* 设置 [业务系统应用名称]
*/
public void setPsappname(String psappname){
this.psappname = psappname ;
this.modify("psappname",psappname);
}
/**
* 设置 [系统菜单标识]
* 设置 [业务系统菜单标识]
*/
public void setPsappmenuid(String psappmenuid){
this.psappmenuid = psappmenuid ;
this.modify("psappmenuid",psappmenuid);
}
/**
* 设置 [系统菜单名称]
* 设置 [业务系统菜单项标识]
*/
public void setPsappmenuname(String psappmenuname){
this.psappmenuname = psappmenuname ;
this.modify("psappmenuname",psappmenuname);
public void setPsappmenuitemid(String psappmenuitemid){
this.psappmenuitemid = psappmenuitemid ;
this.modify("psappmenuitemid",psappmenuitemid);
}
/**
* 设置 [是否为叶子节点(用于菜单)]
* 设置 [业务系统父菜单项标识]
*/
public void setIsleaf(Integer isleaf){
this.isleaf = isleaf ;
this.modify("isleaf",isleaf);
public void setPsapppmenuitemid(String psapppmenuitemid){
this.psapppmenuitemid = psapppmenuitemid ;
this.modify("psapppmenuitemid",psapppmenuitemid);
}
/**
* 设置 [实体标识]
* 设置 [业务系统菜单名称]
*/
public void setPssystemid(String pssystemid){
this.pssystemid = pssystemid ;
this.modify("pssystemid",pssystemid);
}
/**
* 设置 [系统资源标识]
*/
public void setPermissionid(String permissionid){
this.permissionid = permissionid ;
this.modify("permissionid",permissionid);
public void setPsappmenuname(String psappmenuname){
this.psappmenuname = psappmenuname ;
this.modify("psappmenuname",psappmenuname);
}
/**
* 设置 [父项资源标识]
* 设置 [业务系统标识]
*/
public void setParentpermissionid(String parentpermissionid){
this.parentpermissionid = parentpermissionid ;
this.modify("p_permissionid",parentpermissionid);
public void setPssystemid(String pssystemid){
this.pssystemid = pssystemid ;
this.modify("pssystemid",pssystemid);
}
}
......
......@@ -41,11 +41,11 @@ public class SYS_PERMISSIONSearchContext extends QueryWrapperContext<SYS_PERMISS
this.getSelectCond().like("sys_permissionname", n_sys_permissionname_like);
}
}
private String n_systemid_eq;//[系统标识]
public void setN_systemid_eq(String n_systemid_eq) {
this.n_systemid_eq = n_systemid_eq;
if(!ObjectUtils.isEmpty(this.n_systemid_eq)){
this.getSelectCond().eq("systemid", n_systemid_eq);
private String n_systemid_like;//[系统]
public void setN_systemid_like(String n_systemid_like) {
this.n_systemid_like = n_systemid_like;
if(!ObjectUtils.isEmpty(this.n_systemid_like)){
this.getSelectCond().like("systemid", n_systemid_like);
}
}
private String n_permissiontype_eq;//[资源类别]
......
......@@ -34,7 +34,7 @@ public class SYS_PSAPPMENUITEMSearchContext extends QueryWrapperContext<SYS_PSAP
this.getSelectCond().like("sys_psappmenuitemname", n_sys_psappmenuitemname_like);
}
}
private String n_pssystemid_eq;//[实体标识]
private String n_pssystemid_eq;//[业务系统标识]
public void setN_pssystemid_eq(String n_pssystemid_eq) {
this.n_pssystemid_eq = n_pssystemid_eq;
if(!ObjectUtils.isEmpty(this.n_pssystemid_eq)){
......
......@@ -3,6 +3,13 @@
],
"predefineddatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"entities":[
]
],
"appmenus":[
{
"appid":"web",
"appname":"UAA鉴权",
"appmenu":[{"menuid":"Main", "menuname":"MAIN", "menuitem":[{"id":"f59655c22753740bbcf200f5cfee8a54" , "name":"menuitem3" , "text":"用户管理" },{"id":"db3e0d48d6e76a66784adc84edd90cdc" , "name":"menuitem6" , "text":"角色" },{"id":"aa34fa65ba436d9267830d242fcda6c5" , "name":"menuitem7" , "text":"用户角色" },{"id":"6177ea33605de953767d48b120145efb" , "name":"menuitem10" , "text":"权限" },{"id":"2794bbcfc7b3c81b431d1f2e808a793b" , "name":"menuitem1" , "text":"角色权限" }] }]
}
]
}
......@@ -112,7 +112,7 @@
</createTable>
</changeSet>
<!--输出实体[SYS_PERMISSION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_permission-179-6">
<changeSet author="a_A_5d9d78509" id="tab-sys_permission-191-6">
<createTable tableName="IBZPERMISSION">
<column name="SYS_PERMISSIONID" remarks="" type="VARCHAR(200)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PERMISSION_SYS_PERMISSI"/>
......@@ -158,7 +158,7 @@
</createTable>
</changeSet>
<!--输出实体[SYS_PSAPPMENUITEM]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_psappmenuitem-29-9">
<changeSet author="a_A_5d9d78509" id="tab-sys_psappmenuitem-98-9">
<createTable tableName="IBZPSAPPMENUITEM">
<column name="SYS_PSAPPMENUITEMID" remarks="" type="VARCHAR(200)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PSAPPMENUITEM_SYS_PSAPP"/>
......@@ -171,15 +171,13 @@
</column>
<column name="PSAPPMENUID" remarks="" type="VARCHAR(100)">
</column>
<column name="PSAPPMENUNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="ISLEAF" remarks="" type="INT">
<column name="PSAPPMENUITEMID" remarks="" type="VARCHAR(100)">
</column>
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
<column name="PSAPPPMENUITEMID" remarks="" type="VARCHAR(100)">
</column>
<column name="PERMISSIONID" remarks="" type="VARCHAR(100)">
<column name="PSAPPMENUNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="P_PERMISSIONID" remarks="" type="VARCHAR(100)">
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
......
......@@ -9,7 +9,6 @@
<resultMap id="SYS_PSAPPMENUITEMResultMap" type="cn.ibizlab.core.uaa.domain.SYS_PSAPPMENUITEM" autoMapping="true">
<id property="appmenuitemid" column="sys_psappmenuitemid" /><!--主键字段映射-->
<result property="appmenuitemname" column="sys_psappmenuitemname" />
<result property="parentpermissionid" column="p_permissionid" />
</resultMap>
......@@ -26,7 +25,7 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`ISLEAF`, t1.`PERMISSIONID`, t1.`PSAPPID`, t1.`PSAPPMENUID`, t1.`PSAPPMENUNAME`, t1.`PSAPPNAME`, t1.`PSSYSTEMID`, t1.`P_PERMISSIONID`, t1.`SYS_PSAPPMENUITEMID`, t1.`SYS_PSAPPMENUITEMNAME`, t1.`UPDATEDATE` FROM `IBZPSAPPMENUITEM` t1
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`PSAPPID`, t1.`PSAPPMENUID`, t1.`PSAPPMENUITEMID`, t1.`PSAPPMENUNAME`, t1.`PSAPPNAME`, t1.`PSAPPPMENUITEMID`, t1.`PSSYSTEMID`, t1.`SYS_PSAPPMENUITEMID`, t1.`SYS_PSAPPMENUITEMNAME`, t1.`UPDATEDATE` FROM `IBZPSAPPMENUITEM` t1
]]>
</sql>
......
{
"unires":[
],
"predefineddatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"entities":[
],
"appmenus":[
{
"appid":"web",
"appname":"UAA鉴权",
"appmenu":[{"menuid":"Main", "menuname":"MAIN", "menuitem":[{ "id":"menuitem3" , "name":"用户管理" },{ "id":"menuitem6" , "name":"角色" },{ "id":"menuitem7" , "name":"用户角色" },{ "id":"menuitem10" , "name":"权限" },{ "id":"menuitem1" , "name":"角色权限" }] }]
}
]
}
......@@ -64,44 +64,36 @@ public class SYS_PSAPPMENUITEMDTO extends DTOBase implements Serializable {
private String psappmenuid;
/**
* 属性 [PSAPPMENUNAME]
*
*/
@JSONField(name = "psappmenuname")
@JsonProperty("psappmenuname")
private String psappmenuname;
/**
* 属性 [ISLEAF]
* 属性 [PSAPPMENUITEMID]
*
*/
@JSONField(name = "isleaf")
@JsonProperty("isleaf")
private Integer isleaf;
@JSONField(name = "psappmenuitemid")
@JsonProperty("psappmenuitemid")
private String psappmenuitemid;
/**
* 属性 [PSSYSTEMID]
* 属性 [PSAPPPMENUITEMID]
*
*/
@JSONField(name = "pssystemid")
@JsonProperty("pssystemid")
private String pssystemid;
@JSONField(name = "psapppmenuitemid")
@JsonProperty("psapppmenuitemid")
private String psapppmenuitemid;
/**
* 属性 [PERMISSIONID]
* 属性 [PSAPPMENUNAME]
*
*/
@JSONField(name = "permissionid")
@JsonProperty("permissionid")
private String permissionid;
@JSONField(name = "psappmenuname")
@JsonProperty("psappmenuname")
private String psappmenuname;
/**
* 属性 [P_PERMISSIONID]
* 属性 [PSSYSTEMID]
*
*/
@JSONField(name = "parentpermissionid")
@JsonProperty("parentpermissionid")
private String parentpermissionid;
@JSONField(name = "pssystemid")
@JsonProperty("pssystemid")
private String pssystemid;
/**
* 属性 [CREATEDATE]
......@@ -155,43 +147,35 @@ public class SYS_PSAPPMENUITEMDTO extends DTOBase implements Serializable {
}
/**
* 设置 [PSAPPMENUNAME]
*/
public void setPsappmenuname(String psappmenuname){
this.psappmenuname = psappmenuname ;
this.modify("psappmenuname",psappmenuname);
}
/**
* 设置 [ISLEAF]
* 设置 [PSAPPMENUITEMID]
*/
public void setIsleaf(Integer isleaf){
this.isleaf = isleaf ;
this.modify("isleaf",isleaf);
public void setPsappmenuitemid(String psappmenuitemid){
this.psappmenuitemid = psappmenuitemid ;
this.modify("psappmenuitemid",psappmenuitemid);
}
/**
* 设置 [PSSYSTEMID]
* 设置 [PSAPPPMENUITEMID]
*/
public void setPssystemid(String pssystemid){
this.pssystemid = pssystemid ;
this.modify("pssystemid",pssystemid);
public void setPsapppmenuitemid(String psapppmenuitemid){
this.psapppmenuitemid = psapppmenuitemid ;
this.modify("psapppmenuitemid",psapppmenuitemid);
}
/**
* 设置 [PERMISSIONID]
* 设置 [PSAPPMENUNAME]
*/
public void setPermissionid(String permissionid){
this.permissionid = permissionid ;
this.modify("permissionid",permissionid);
public void setPsappmenuname(String psappmenuname){
this.psappmenuname = psappmenuname ;
this.modify("psappmenuname",psappmenuname);
}
/**
* 设置 [P_PERMISSIONID]
* 设置 [PSSYSTEMID]
*/
public void setParentpermissionid(String parentpermissionid){
this.parentpermissionid = parentpermissionid ;
this.modify("p_permissionid",parentpermissionid);
public void setPssystemid(String pssystemid){
this.pssystemid = pssystemid ;
this.modify("pssystemid",pssystemid);
}
......
......@@ -14,13 +14,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -48,6 +46,10 @@ public class ClientAuthenticationResource
* 统一资源标识
*/
private String UniResTag="UNIRES";
/**
* 菜单项标识
*/
private String AppMenuTag="APPMENU";
@Autowired
@Qualifier("IBZUSERService")
......@@ -107,6 +109,7 @@ public class ClientAuthenticationResource
JSONObject permissionObj=new JSONObject();
//数据能力
String opprivSQL="SELECT\n" +
"\tT2.pssysmoduleid as sysmodule,\n" +
"\tT2.psdataentityid as dataentity,\n" +
......@@ -128,8 +131,7 @@ public class ClientAuthenticationResource
"\t)\n" +
"AND T1.PERMISSIONTYPE = #{et.param1} ";
//统一资源
String uniResSQL="SELECT\n" +
"\tt2.SYS_PSSYSUNIRESID,\n" +
"\tt2.SYS_PSSYSUNIRESNAME,\n" +
......@@ -148,24 +150,68 @@ public class ClientAuthenticationResource
"\t)\n" +
"AND T1.PERMISSIONTYPE = #{et.param1} ";
//应用菜单
String appMenuSQL="SELECT\n" +
"\tt2.PSAPPMENUITEMID as MENUITEMID,\n" +
"\tt2.SYS_PSAPPMENUITEMNAME AS MENUITEMNAME \n" +
"FROM\n" +
"\tibzrole_permission T\n" +
"INNER JOIN ibzpermission T1 ON T.SYS_PERMISSIONID = T1.SYS_PERMISSIONID\n" +
"INNER JOIN ibzpsappmenuitem T2 on T1.SYS_PERMISSIONID=t2.SYS_PSAPPMENUITEMID\n" +
"WHERE\n" +
"\tT.SYS_ROLEID IN (\n" +
"\t SELECT SYS_ROLEID\n" +
"\t FROM\n" +
"\t IBZUSER_ROLE t LEFT JOIN IBZUSER t1 ON t.SYS_USERID=T1.USERID\n" +
"\t WHERE\n" +
"\t T1.USERID = #{et.param0}\n" +
"\t)\n" +
"AND T1.PERMISSIONTYPE = #{et.param1} ";
Map opprivParam=new HashMap();
opprivParam.put("param0",user.getUserid());
opprivParam.put("param1",OPPriTag);
List<JSONObject> entitiesList= permissionService.select(opprivSQL,opprivParam); //查询用户权限下的菜单数据
Map uniresParam=new HashMap();
uniresParam.put("param0",user.getUserid());
uniresParam.put("param1",UniResTag);
List<JSONObject> uniResList= permissionService.select(uniResSQL,uniresParam); //查询用户权限下的菜单数据
Map appMenuParam=new HashMap();
appMenuParam.put("param0",user.getUserid());
appMenuParam.put("param1",AppMenuTag);
List<JSONObject> entitiesList= permissionService.select(opprivSQL,opprivParam); //查询用户权限下数据能力
List<JSONObject> uniResList= permissionService.select(uniResSQL,uniresParam); //查询用户权限下的统一资源
List<JSONObject> appMenuItemList= permissionService.select(appMenuSQL,appMenuParam); //查询用户权限下的菜单项
JSONObject entities=getEntitiesList(entitiesList);
JSONArray uniRes=getUniRes(uniResList);
JSONArray appMenuItem=getAppMenuItem(appMenuItemList);
permissionObj.put("entities",entities);
permissionObj.put("unires",uniRes);
permissionObj.put("appmenu",appMenuItem);
user.setPermissionList(permissionObj);
}
/**
* 获取应用菜单
* @param menuItemList
* @return
*/
private JSONArray getAppMenuItem(List<JSONObject> menuItemList) {
JSONArray menuItemArr=new JSONArray();
for(int a=0;a<menuItemList.size();a++){
JSONObject menuItem=menuItemList.get(a);
JSONObject newMenuItem=new JSONObject();
newMenuItem.put("menuitemid",menuItem.getString("MENUITEMID"));
newMenuItem.put("menuitemname",menuItem.getString("MENUITEMNAME"));
menuItemArr.add(newMenuItem);
}
return menuItemArr;
}
/**
* 获取统一资源
* @param uniResList
......
package cn.ibizlab.api.rest.extensions;
import cn.ibizlab.core.uaa.domain.SYS_PERMISSION;
import cn.ibizlab.core.uaa.domain.SYS_PSAPPMENUITEM;
import cn.ibizlab.core.uaa.domain.SYS_PSDEOPPRIV;
import cn.ibizlab.core.uaa.domain.SYS_PSSYSUNIRES;
import cn.ibizlab.core.uaa.service.ISYS_PERMISSIONService;
import cn.ibizlab.core.uaa.service.ISYS_PSAPPMENUITEMService;
import cn.ibizlab.core.uaa.service.ISYS_PSDEOPPRIVService;
import cn.ibizlab.core.uaa.service.ISYS_PSSYSUNIRESService;
import com.alibaba.fastjson.JSONArray;
......@@ -16,10 +18,8 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.sql.Timestamp;
import java.util.*;
/**
* 为业务系统提供权限相关服务
......@@ -37,6 +37,10 @@ public class PermissionFeignService {
* 统一资源标识
*/
private String UniResTag="UNIRES";
/**
* 菜单项标识
*/
private String AppMenuTag="APPMENU";
/**
* 实体行为操作标识
*/
......@@ -55,12 +59,15 @@ public class PermissionFeignService {
@Autowired
private ISYS_PSSYSUNIRESService pssysuniresService;
@Autowired
private ISYS_PSAPPMENUITEMService psappmenuitemService;
/**
* 拿到业务系统传过来的权限和菜单数据,存入uaa的权限表中
*/
@PostMapping("/uaa/permission/save")
public Map<String, JsonNode> pushSystemPermissionData(@RequestBody Map<String,Object> map, @Validated @NotBlank(message = "systemid不允许为空")@RequestParam("systemid")String systemId){
public JSONObject pushSystemPermissionData(@RequestBody Map<String,Object> map, @Validated @NotBlank(message = "systemid不允许为空")@RequestParam("systemid")String systemId){
try {
//如果map值不为null说明要更新数据,则先将表中该系统标识下的所有数据进行逻辑删除
Map param=new HashMap();
param.put("param0",systemId);
......@@ -69,25 +76,126 @@ public class PermissionFeignService {
permissionService.execute(sql,param);
}
List<SYS_PSDEOPPRIV> opprivList=new ArrayList<>();//数据能力
List<SYS_PERMISSION> permission_list=new ArrayList<>();//权限
List<SYS_PERMISSION> permission_list=new ArrayList<>();//资源
List<SYS_PSSYSUNIRES> unires_list=new ArrayList<>();//统一资源
List<SYS_PSAPPMENUITEM> menu_list=new ArrayList<>();//资源-菜单项集合
if(map.containsKey("permission")){
JSONObject paramsObj = new JSONObject(map);
JSONObject capabilityPermissionObj = paramsObj.getJSONObject("permission");
parseDECapability(capabilityPermissionObj,systemId,permission_list,opprivList);
parseUniRes(capabilityPermissionObj,systemId,permission_list,unires_list);
parseAppMenus(capabilityPermissionObj,systemId,permission_list,menu_list);
}
if(opprivList.size()>0){
opprivService.saveOrUpdateBatch(opprivList);//批量保存数据能力
}
if(unires_list.size()>0){
pssysuniresService.saveOrUpdateBatch(unires_list);//批量保存统一资源
}
if(menu_list.size()>0){
psappmenuitemService.saveOrUpdateBatch(menu_list);//批量保存统一资源
}
if(permission_list.size()>0){
permissionService.saveOrUpdateBatch(permission_list);//批量保存权限资源
}
if(unires_list.size()>0){
pssysuniresService.saveOrUpdateBatch(unires_list);//批量保存统一资源
} catch (Exception e) {
return error("资源同步失败,失败原因为:"+e);
}
return null;
return success("资源同步成功");
}
/**
* 存储菜单资源
* @param capabilityPermissionObj
* @param systemId
* @param permission_list
* @param menu_list
*/
private void parseAppMenus(JSONObject capabilityPermissionObj, String systemId, List<SYS_PERMISSION> permission_list, List<SYS_PSAPPMENUITEM> menu_list) {
if(capabilityPermissionObj!=null) {
JSONArray appMenuArr = capabilityPermissionObj.getJSONArray("appmenus");
if(appMenuArr.size()>0){
for(int a=0;a<appMenuArr.size();a++){
JSONObject App=appMenuArr.getJSONObject(a);
String appId=App.getString("appid");
String appName=App.getString("appname");
if(App.containsKey("appmenu") && App.getJSONArray("appmenu").size()>0){
JSONArray AppMenuArr=App.getJSONArray("appmenu");
for(int b=0;b<AppMenuArr.size();b++){
JSONObject appMenu=AppMenuArr.getJSONObject(b);
String appMenuId=appMenu.getString("menuid");
String appMenuName=appMenu.getString("menuname");
if(appMenu.containsKey("menuitem")&& appMenu.getJSONArray("menuitem").size()>0){
JSONArray menuItemArr=appMenu.getJSONArray("menuitem");
parseMenuItems( menuItemArr , "", systemId, appId, appName, appMenuId, appMenuName, permission_list, menu_list);
}
}
}
}
}
}
}
/**
* 解析菜单项集合
* @param menuItemArr
* @param systemId
* @param permission_list
* @param menu_list
*/
private void parseMenuItems(JSONArray menuItemArr ,String parentMenuItemId, String systemId, String appId, String appName, String appMenuId,String appMenuName, List<SYS_PERMISSION> permission_list, List<SYS_PSAPPMENUITEM> menu_list){
for(int a=0;a<menuItemArr.size();a++){
JSONObject menuItem=menuItemArr.getJSONObject(a);
String menuItemId=menuItem.getString("id");
String menuItemName=menuItem.getString("name");
if(menuItem.containsKey("items") && menuItem.getJSONArray("items").size()>0){
JSONArray tempMenuItems=menuItem.getJSONArray("items");
parseMenuItems(tempMenuItems,menuItemId,systemId,appId,appName,appMenuId,appMenuName,permission_list,menu_list);
}
saveMenuItem(menuItemId,menuItemName,parentMenuItemId,systemId,appId,appName,appMenuId,appMenuName,permission_list,menu_list);
}
}
/**
* 保存菜单项
* @param menuItemId
* @param menuItemName
* @param parentMenuItemId
* @param systemId
* @param appId
* @param appName
* @param appMenuId
* @param appMenuName
* @param permission_list
* @param menu_list
*/
private void saveMenuItem(String menuItemId,String menuItemName , String parentMenuItemId, String systemId, String appId, String appName, String appMenuId,String appMenuName, List<SYS_PERMISSION> permission_list, List<SYS_PSAPPMENUITEM> menu_list){
String sysPermissionId=DigestUtils.md5DigestAsHex(String.format("%s%s%s%s",systemId,appId,appMenuId,menuItemId).getBytes());
SYS_PERMISSION sys_permission =new SYS_PERMISSION();
sys_permission.setPermissionid(sysPermissionId);
sys_permission.setPermissionname(menuItemName);
sys_permission.setPssystemid(systemId);
sys_permission.setPermissiontype(AppMenuTag);
sys_permission.setEnable(1);
sys_permission.setCreatedate(new Timestamp(new Date().getTime()));
sys_permission.setUpdatedate(new Timestamp(new Date().getTime()));
permission_list.add(sys_permission);
//存菜单项表
SYS_PSAPPMENUITEM psAppMenuItem=new SYS_PSAPPMENUITEM();
psAppMenuItem.setAppmenuitemid(sysPermissionId);
psAppMenuItem.setAppmenuitemname(menuItemName);
psAppMenuItem.setPsappid(appId);
psAppMenuItem.setPsappname(appName);
psAppMenuItem.setPsappmenuid(appMenuId);
psAppMenuItem.setPsappmenuname(appMenuName);
psAppMenuItem.setPssystemid(systemId);
psAppMenuItem.setPsappmenuitemid(menuItemId);
psAppMenuItem.setPsapppmenuitemid(parentMenuItemId);
psAppMenuItem.setCreatedate(new Timestamp(new Date().getTime()));
psAppMenuItem.setUpdatedate(new Timestamp(new Date().getTime()));
menu_list.add(psAppMenuItem);
}
/**
......@@ -122,12 +230,16 @@ public class PermissionFeignService {
sys_permission.setPssystemid(systemId);
sys_permission.setPermissiontype(UniResTag);
sys_permission.setEnable(1);
sys_permission.setCreatedate(new Timestamp(new Date().getTime()));
sys_permission.setUpdatedate(new Timestamp(new Date().getTime()));
permission_list.add(sys_permission);
SYS_PSSYSUNIRES sys_pssysunires=new SYS_PSSYSUNIRES();
sys_pssysunires.setUniresid(uniResId);
sys_pssysunires.setUniresname(uniResName);
sys_pssysunires.setUnirescode(uniResCode);
sys_pssysunires.setCreatedate(new Timestamp(new Date().getTime()));
sys_pssysunires.setUpdatedate(new Timestamp(new Date().getTime()));
unires_list.add(sys_pssysunires);
}
......@@ -167,9 +279,10 @@ public class PermissionFeignService {
for(int b=0;b<deActionArray.size();b++) {
JSONObject deSource = deActionArray.getJSONObject(b);
String deActionType=deSource.getString("type");
if(permissionType.equalsIgnoreCase(DEActionType) && !StringUtils.isEmpty(deActionType) && !deActionType.equalsIgnoreCase("BUILTIN")) {
//数据查询与自定义行为不生成预置范围相关数据
if( (permissionType.equalsIgnoreCase(DEActionType) && !deActionType.equalsIgnoreCase("BUILTIN")) || (permissionType.equalsIgnoreCase(DataSetTag)) ) {
JSONObject dataRange =new JSONObject();
createDataRange(entity,deSource,dataRange,permissionType,systemId,ability_list,opprivList);//自定义用户行为
createDataRange(entity,deSource,dataRange,permissionType,systemId,ability_list,opprivList);
}
else{
for(int c=0;c<preDefinedDataRange.size();c++){
......@@ -219,6 +332,8 @@ public class PermissionFeignService {
sys_permission.setPermissionid(permissionId);
sys_permission.setPermissiontype(OPPriTag);
sys_permission.setEnable(1);
sys_permission.setUpdatedate(new Timestamp(new Date().getTime()));
sys_permission.setCreatedate(new Timestamp(new Date().getTime()));
ability_list.add(sys_permission);
//存数据操作能力表
......@@ -235,8 +350,23 @@ public class PermissionFeignService {
psDEOppriv.setPsdedatarangeid(dataRangeId);
psDEOppriv.setPsdedatarangename(dataRangeName);
psDEOppriv.setPssourcetype(permissionType);
psDEOppriv.setCreatedate(new Timestamp(new Date().getTime()));
psDEOppriv.setUpdatedate(new Timestamp(new Date().getTime()));
opprivList.add(psDEOppriv);
}
private JSONObject success(String msg){
JSONObject obj =new JSONObject();
obj.put("code",1);
obj.put("msg",msg);
return obj;
}
private JSONObject error(String msg){
JSONObject obj =new JSONObject();
obj.put("code",0);
obj.put("msg",msg);
return obj;
}
}
......@@ -3,13 +3,14 @@ package cn.ibizlab.util.client;
import cn.ibizlab.util.security.AuthenticationUser;
import cn.ibizlab.util.security.AuthorizationLogin;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
import java.util.Map;
@Component
public class IBZUAAFallback implements IBZUAAFeignClient {
@Override
public Map<String, Object> pushSystemPermissionData(Map<String, Object> systemPermissionData, String systemId) {
public JSONObject pushSystemPermissionData(Map<String, Object> systemPermissionData, String systemId) {
return null;
}
......
......@@ -4,6 +4,7 @@ import cn.ibizlab.util.security.AuthenticationUser;
import cn.ibizlab.util.security.AuthorizationLogin;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
import java.util.Map;
@FeignClient(value = "ibzuaa-api",fallback = IBZUAAFallback.class)
......@@ -16,7 +17,7 @@ public interface IBZUAAFeignClient
* @return
*/
@PostMapping("/uaa/permission/save")
Map<String,Object> pushSystemPermissionData(@RequestBody Map<String, Object> systemPermissionData, @RequestParam("systemid") String systemId);
JSONObject pushSystemPermissionData(@RequestBody Map<String, Object> systemPermissionData, @RequestParam("systemid") String systemId);
/**
* 用户登录
......
......@@ -39,15 +39,20 @@ public class PermissionSyncJob implements ApplicationRunner {
public void run(ApplicationArguments args) {
if(enablePermissionValid){
try {
InputStream permission= this.getClass().getResourceAsStream("/deprivs/DEPrivs.json"); //获取当前系统所有实体资源能力
InputStream permission= this.getClass().getResourceAsStream("/permission/systemResource.json"); //获取当前系统所有实体资源能力
String permissionResult = IOUtils.toString(permission,"UTF-8");
JSONObject jsonNodePermission = JSONObject.parseObject(permissionResult);
Map<String,Object> map=new HashMap<>();
map.put("permission",jsonNodePermission);
client.pushSystemPermissionData(map,systemId);
JSONObject syncResult=client.pushSystemPermissionData(map,systemId);
if(syncResult.getInteger("code")==1){
log.info("向[UAA]同步系统资源成功");
}else{
log.info(String.format("向[UAA]同步系统资源失败,失败原因为[%s]",syncResult.getString("msg")));
}
}
catch (Exception ex) {
log.error(String.format("向UAA同步数据发生错误,请检查UAA服务是否正常! [%s]",ex));
log.error(String.format("向[UAA]同步系统资源失败,请检查[UAA]服务是否正常! [%s]",ex));
}
}
}
......
......@@ -9,7 +9,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Autowired;
import cn.ibizlab.util.security.AuthenticationUser;
import cn.ibizlab.util.service.AuthenticationUserService;
@RestController
@RequestMapping(value = "")
......@@ -18,19 +20,32 @@ public class AppController {
@Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验
@Autowired
private AuthenticationUserService userDetailsService;
@RequestMapping(method = RequestMethod.GET, value = "/appdata")
public ResponseEntity<JSONObject> getAppData() {
JSONObject appData = new JSONObject() ;
JSONArray uniRes=new JSONArray();
JSONArray appMenu=new JSONArray();
if(enablePermissionValid){
JSONObject userPermission=AuthenticationUser.getAuthenticationUser().getPermissionList();
if(!ObjectUtils.isEmpty(userPermission)){
uniRes = userPermission.getJSONArray("unires");
appMenu = userPermission.getJSONArray("appmenu");
}
}
appData.put("unires",uniRes);
appData.put("appmenu",appMenu);
appData.put("enablepermissionvalid",enablePermissionValid);
return ResponseEntity.status(HttpStatus.OK).body(appData);
}
@RequestMapping(method = RequestMethod.GET, value = "${ibiz.auth.logoutpath:v7/logout}")
public void logout() {
if(AuthenticationUser.getAuthenticationUser()!=null){
userDetailsService.resetByUsername(AuthenticationUser.getAuthenticationUser().getUsername());
}
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册