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

ibiz4j 发布系统代码

上级 1a261b23
......@@ -9,6 +9,7 @@
}
>.ivu-card-extra {
.item-extract-mode {
display: flex;
.item {
margin-left: 12px;
}
......
......@@ -58,6 +58,18 @@ export default {
caption: "-",
tip: "",
},
tbitem24: {
caption: "行编辑",
tip: "行编辑",
},
tbitem25: {
caption: "新建行",
tip: "新建行",
},
tbitem26: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "Remove",
tip: "Remove {0}",
......
......@@ -57,6 +57,18 @@ export default {
caption: '-',
tip: '',
},
tbitem24: {
caption: '行编辑',
tip: '行编辑',
},
tbitem25: {
caption: '新建行',
tip: '新建行',
},
tbitem26: {
caption: '-',
tip: '',
},
tbitem8: {
caption: '删除',
tip: '删除',
......
<template>
<div class='view-container degridview ibzdept-member-grid-view'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="ibzdeptmembergridview"></app-studioaction>
<card class='view-card ' :dis-hover="true" :bordered="false">
<p slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</p>
<card class='view-card view-no-caption' :dis-hover="true" :bordered="false">
<div class='content-container'>
<div class='view-top-messages'>
</div>
<div style='margin-bottom: 6px;'>
<i-input v-model="query" search enter-button @on-search="onSearch($event)" class='quick-search-input' style='max-width: 400px;' placeholder="请输入成员" />
<div class='pull-right'>
<div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
......@@ -26,6 +22,20 @@
</i-button>
<div slot='content'>{{$t('entities.ibzdeptmember.gridviewtoolbar_toolbar.tbitem6.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem24.visabled" :disabled="toolBarModels.tbitem24.disabled" class='' @click="toolbar_click({ tag: 'tbitem24' }, $event)">
<i class='fa fa-table'></i>
<span class='caption'>{{$t('entities.ibzdeptmember.gridviewtoolbar_toolbar.tbitem24.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibzdeptmember.gridviewtoolbar_toolbar.tbitem24.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem25.visabled" :disabled="toolBarModels.tbitem25.disabled" class='' @click="toolbar_click({ tag: 'tbitem25' }, $event)">
<i class='fa fa-plus'></i>
</i-button>
<div slot='content'>{{$t('entities.ibzdeptmember.gridviewtoolbar_toolbar.tbitem25.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem8.visabled" :disabled="toolBarModels.tbitem8.disabled" class='' @click="toolbar_click({ tag: 'tbitem8' }, $event)">
<i class='fa fa-remove'></i>
......@@ -46,14 +56,14 @@
:context="context"
:isSingleSelect="isSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:isOpenEdit="true"
:gridRowActiveMode="gridRowActiveMode"
@save="onSave"
updateAction=""
updateAction="Update"
removeAction="Remove"
loaddraftAction=""
loadAction=""
createAction=""
loaddraftAction="GetDraft"
loadAction="Get"
createAction="Create"
fetchAction="FetchDefault"
:newdata="newdata"
:opendata="opendata"
......@@ -266,6 +276,11 @@ export default class IBZDeptMemberGridViewBase extends Vue {
tbitem6: { name: 'tbitem6', caption: '拷贝', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Copy', target: 'SINGLEKEY' } },
tbitem7: { name: 'tbitem7', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem24: { name: 'tbitem24', caption: '行编辑', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'ToggleRowEdit', target: '' } },
tbitem25: { name: 'tbitem25', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'NewRow', target: '' } },
tbitem26: { name: 'tbitem26', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem8: { name: 'tbitem8', caption: '删除', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Remove', target: 'MULTIKEY' } },
tbitem9: { name: 'tbitem9', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
......
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
import SaveDeptMemberLogic from '@/service/ibzemployee/save-dept-member-logic';
......
import IBZDeptMemberService from '@/service/ibzdept-member/ibzdept-member-service';
import { Verify } from '@/utils/verify/verify';
/**
* 保存人事关系
*
* @export
* @class SaveDeptMemberLogicBase
*/
export default class SaveDeptMemberLogicBase {
/**
* 名称
*
* @memberof SaveDeptMemberLogicBase
*/
private name:string ="saveDeptMember";
/**
* 唯一标识
*
* @memberof SaveDeptMemberLogicBase
*/
private id:string = "E3FF4728-CD18-4940-BAEF-8A71111A5D05";
/**
* 默认参数名称
*
* @memberof SaveDeptMemberLogicBase
*/
private defaultParamName:string = "Default";
/**
* Creates an instance of SaveDeptMemberLogicBase.
*
* @param {*} [opts={}]
* @memberof SaveDeptMemberLogicBase
*/
constructor(opts: any = {}) {
}
/**
* 计算0节点结果
*
* @param params 传入参数
*/
public compute0Cond(params:any):boolean{
return true;
}
/**
* 计算1节点结果
*
* @param params 传入参数
*/
public compute1Cond(params:any):boolean{
return true;
}
/**
* 执行逻辑
*
* @param context 应用上下文
* @param params 传入参数
*/
public onExecute(context:any,params:any,isloading:boolean){
return this.executeBegin(context,params,isloading);
}
/**
* 保存成员
*
* @param context 应用上下文
* @param params 传入参数
*/
private async executeDeaction1(context:any,params:any,isloading:boolean){
// 行为处理节点
let result: any;
const targetService:IBZDeptMemberService = new IBZDeptMemberService();
if (targetService['Save'] && targetService['Save'] instanceof Function) {
result = await targetService['Save'](context,params, false);
}
if(result && result.status == 200){
Object.assign(params,result.data);
return params;
}
}
/**
* 准备成员
*
* @param context 应用上下文
* @param params 传入参数
*/
private async executePrepareparam1(context:any,params:any,isloading:boolean){
// 准备参数节点
Object.assign(params,{deptid:params.mdeptid});
Object.assign(context,{ibzdeptmember:params.mdeptid});
Object.assign(params,{userid:params.userid});
Object.assign(context,{ibzdeptmember:params.userid});
if(this.compute1Cond(params)){
return this.executeDeaction1(context,params,isloading);
}
}
/**
* 开始
*
* @param params 传入参数
*/
private async executeBegin(context:any,params:any,isloading:boolean){
//开始节点
if(this.compute0Cond(params)){
return this.executePrepareparam1(context,params,isloading);
}
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import SaveDeptMemberLogicBase from './save-dept-member-logic-base';
/**
* 保存人事关系
*
* @export
* @class SaveDeptMemberLogic
*/
export default class SaveDeptMemberLogic extends SaveDeptMemberLogicBase{
/**
* Creates an instance of SaveDeptMemberLogic
*
* @param {*} [opts={}]
* @memberof SaveDeptMemberLogic
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Store } from 'vuex';
import { Util } from '@/utils/util/util';
import CodeListService from "@service/app/codelist-service";
/**
* 部件服务基类
......@@ -26,6 +27,14 @@ export default class ControlService {
*/
public model: any | null = null;
/**
* 代码表服务对象
*
* @type {any}
* @memberof ControlService
*/
public codeListService:any;
/**
* 是否为从数据模式
*
......@@ -43,6 +52,7 @@ export default class ControlService {
constructor(opts: any = {}) {
this.$store = opts.$store;
this.setTempMode();
this.codeListService = new CodeListService({ $store:opts.$store });
}
/**
......@@ -118,31 +128,41 @@ export default class ControlService {
* @param {*} response
* @memberof ControlService
*/
public handleResponse(action: string, response: any,isCreate:boolean = false){
public async handleResponse(action: string, response: any,isCreate:boolean = false){
let result = null;
if (!response.data) {
return
} else if (response.data instanceof Array) {
result = [];
response.data.forEach((item:any) =>{
result.push(this.handleResponseData(action, item, isCreate));
});
}else{
result = this.handleResponseData(action, response.data, isCreate);
}
// response状态,头文件
if(response.headers){
if(response.headers['x-page']){
Object.assign(response,{page:Number(response.headers['x-page'])});
}
if(response.headers['x-per-page']){
Object.assign(response,{size:Number(response.headers['x-per-page'])});
const handleResult:any = (action: string, response: any,isCreate:boolean,codelistArray?:any) =>{
if (response.data instanceof Array) {
result = [];
response.data.forEach((item:any) =>{
result.push(this.handleResponseData(action, item, isCreate,codelistArray));
});
}else{
result = this.handleResponseData(action, response.data, isCreate,codelistArray);
}
if(response.headers['x-total']){
Object.assign(response,{total:Number(response.headers['x-total'])});
// response状态,头文件
if(response.headers){
if(response.headers['x-page']){
Object.assign(response,{page:Number(response.headers['x-page'])});
}
if(response.headers['x-per-page']){
Object.assign(response,{size:Number(response.headers['x-per-page'])});
}
if(response.headers['x-total']){
Object.assign(response,{total:Number(response.headers['x-total'])});
}
}
response.data = result;
}
let codelistModel:Array<any> = this.handleCodelist();
if(codelistModel.length >0){
let res:any = await this.getAllCodeList(codelistModel);
handleResult(action, response,isCreate,res);
}else{
handleResult(action, response,isCreate);
}
response.data = result;
}
/**
......@@ -152,7 +172,7 @@ export default class ControlService {
* @param {*} response
* @memberof ControlService
*/
public handleResponseData(action: string, data: any = {},isCreate?:boolean){
public handleResponseData(action: string, data: any = {},isCreate?:boolean,codelistArray?:any){
let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) {
return data;
......@@ -167,10 +187,13 @@ export default class ControlService {
if((isCreate === undefined || isCreate === null ) && Object.is(dataitem.dataType, 'GUID') && Object.is(dataitem.name, 'srfkey') && (val && !Object.is(val, ''))){
isCreate = true;
}
// if((Object.is(dataitem.dataType,'DATE') || Object.is(dataitem.dataType,'DATETIME')) && !Object.is(Date.parse(val),NaN)){
// val = Util.dateFormat(new Date(val));
// }
item[dataitem.name] = val;
// 转化代码表
if(codelistArray && dataitem.codelist){
if(codelistArray.get(dataitem.codelist.tag) && codelistArray.get(dataitem.codelist.tag).get(val)){
item[dataitem.name] = codelistArray.get(dataitem.codelist.tag).get(val);
}
}
});
item.srfuf = data.srfuf ? data.srfuf : (isCreate ? "0" : "1");
return item;
......@@ -199,4 +222,86 @@ export default class ControlService {
return requestData;
}
/**
* 处理代码表
*
* @memberof ControlService
*/
public handleCodelist(){
let model: any = this.getMode();
if (!model) {
return [];
}
let dataItems: any[] = model.getDataItems();
let codelistMap:Map<string,any> = new Map();
if(dataItems && dataItems.length >0){
dataItems.forEach((item:any) =>{
if(item.codelist){
codelistMap.set(item.name,item.codelist);
}
})
}
if(codelistMap.size >0){
return Array.from(codelistMap).map(item => item[1]);
}else{
return [];
}
}
/**
* 获取所有代码表
*
* @param codelistArray 代码表模型数组
* @memberof ControlService
*/
public getAllCodeList(codelistArray:Array<any>):Promise<any>{
return new Promise((resolve:any,reject:any) =>{
let codeListMap:Map<string,any> = new Map();
let promiseArray:Array<any> = [];
codelistArray.forEach((item:any) =>{
if(!codeListMap.get(item.tag)){
promiseArray.push(this.getCodeList(item));
Promise.all(promiseArray).then((result:any) =>{
if(result && result.length >0){
result.forEach((codeList:any) =>{
let tempCodeListMap:Map<number,any> = new Map();
if(codeList.length >0){
codeList.forEach((codeListItem:any) =>{
tempCodeListMap.set(codeListItem.value,codeListItem.text);
})
}
codeListMap.set(item.tag,tempCodeListMap);
})
resolve(codeListMap);
}
})
}
})
})
}
/**
* 获取代码表
*
* @param codeListObject 传入代码表对象
* @memberof ControlService
*/
public getCodeList(codeListObject:any):Promise<any>{
return new Promise((resolve:any,reject:any) =>{
if(codeListObject.tag && Object.is(codeListObject.codelistType,"STATIC")){
const codelist = (this.getStore() as Store<any>).getters.getCodeList(codeListObject.tag);
if (codelist) {
resolve([...JSON.parse(JSON.stringify(codelist.items))]);
} else {
console.log(`<#noparse>----${codeListObject.tag}----代码表不存在</#noparse>`);
}
}else if(codeListObject.tag && Object.is(codeListObject.codelistType,"DYNAMIC")){
this.codeListService.getItems(codeListObject.tag).then((res:any) => {
resolve(res);
}).catch((error:any) => {
console.log(`<#noparse>----${codeListObject.tag}----代码表不存在</#noparse>`);
});
}
})
}
}
\ No newline at end of file
......@@ -22,63 +22,63 @@
<el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
</template>
<template v-if="getColumnState('deptid')">
<el-table-column show-overflow-tooltip :prop="'deptid'" :label="$t('entities.ibzdepartment.main_grid.columns.deptid')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'deptid'" :label="$t('entities.ibzdepartment.main_grid.columns.deptid')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.deptid}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('deptcode')">
<el-table-column show-overflow-tooltip :prop="'deptcode'" :label="$t('entities.ibzdepartment.main_grid.columns.deptcode')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'deptcode'" :label="$t('entities.ibzdepartment.main_grid.columns.deptcode')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.deptcode}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('deptname')">
<el-table-column show-overflow-tooltip :prop="'deptname'" :label="$t('entities.ibzdepartment.main_grid.columns.deptname')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'deptname'" :label="$t('entities.ibzdepartment.main_grid.columns.deptname')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.deptname}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('shortname')">
<el-table-column show-overflow-tooltip :prop="'shortname'" :label="$t('entities.ibzdepartment.main_grid.columns.shortname')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'shortname'" :label="$t('entities.ibzdepartment.main_grid.columns.shortname')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.shortname}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('deptlevel')">
<el-table-column show-overflow-tooltip :prop="'deptlevel'" :label="$t('entities.ibzdepartment.main_grid.columns.deptlevel')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'deptlevel'" :label="$t('entities.ibzdepartment.main_grid.columns.deptlevel')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.deptlevel}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('bcode')">
<el-table-column show-overflow-tooltip :prop="'bcode'" :label="$t('entities.ibzdepartment.main_grid.columns.bcode')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'bcode'" :label="$t('entities.ibzdepartment.main_grid.columns.bcode')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.bcode}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('showorder')">
<el-table-column show-overflow-tooltip :prop="'showorder'" :label="$t('entities.ibzdepartment.main_grid.columns.showorder')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'showorder'" :label="$t('entities.ibzdepartment.main_grid.columns.showorder')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.showorder}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('createdate')">
<el-table-column show-overflow-tooltip :prop="'createdate'" :label="$t('entities.ibzdepartment.main_grid.columns.createdate')" :width="200" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'createdate'" :label="$t('entities.ibzdepartment.main_grid.columns.createdate')" :width="200" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<app-format-data format="YYYY-MM-DD hh:mm:ss" :data="row.createdate"></app-format-data>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('updatedate')">
<el-table-column show-overflow-tooltip :prop="'updatedate'" :label="$t('entities.ibzdepartment.main_grid.columns.updatedate')" :width="200" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'updatedate'" :label="$t('entities.ibzdepartment.main_grid.columns.updatedate')" :width="200" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<app-format-data format="YYYY-MM-DD hh:mm:ss" :data="row.updatedate"></app-format-data>
</template>
......
......@@ -4,7 +4,7 @@
<row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzdepartment.newform_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzdepartment.newform_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.deptcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='deptcode' :itemRules="this.rules.deptcode" class='' :caption="$t('entities.ibzdepartment.newform_form.details.deptcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.deptcode.error" :isEmptyCaption="false" labelPos="LEFT">
......@@ -486,8 +486,8 @@ export default class NewFormBase extends Vue implements ControlInterface {
orgname: [
{ type: 'string', message: '单位 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '单位 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '单位 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '单位 值不能为空', trigger: 'blur' },
{ required: true, type: 'string', message: '单位 值不能为空', trigger: 'change' },
{ required: true, type: 'string', message: '单位 值不能为空', trigger: 'blur' },
],
pdeptname: [
{ type: 'string', message: '上级部门 值必须为字符串类型', trigger: 'change' },
......
......@@ -4,7 +4,7 @@
<row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzdeptmember.main_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzdeptmember.main_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.deptname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='deptname' :itemRules="this.rules.deptname" class='' :caption="$t('entities.ibzdeptmember.main_form.details.deptname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.deptname.error" :isEmptyCaption="false" labelPos="LEFT">
......
......@@ -22,14 +22,14 @@
<el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
</template>
<template v-if="getColumnState('deptname')">
<el-table-column show-overflow-tooltip :prop="'deptname'" :label="$t('entities.ibzdeptmember.main_grid.columns.deptname')" :width="250" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'deptname'" :label="$t('entities.ibzdeptmember.main_grid.columns.deptname')" :width="250" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.deptname}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('personname')">
<el-table-column show-overflow-tooltip :prop="'personname'" :label="$t('entities.ibzdeptmember.main_grid.columns.personname')" :width="250" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'personname'" :label="$t('entities.ibzdeptmember.main_grid.columns.personname')" :width="250" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.personname}}</span>
</template>
......@@ -1281,6 +1281,117 @@ export default class MainBase extends Vue implements ControlInterface {
});
}
/**
* 新建行
*
* @param {*} $event
* @returns {void}
* @memberof Main
*/
public newRow(args: any[], params?: any, $event?: any, xData?: any): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: 'IBZDeptMemberGridView视图表格loaddraftAction参数未配置' });
return;
}
let _this = this;
Object.assign(args[0],{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction, JSON.parse(JSON.stringify(this.context)), args[0], this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
}
return;
}
const data = response.data;
data.rowDataState = "create";
_this.items.push(data);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
}
/**
* 表格编辑项值变更
*
* @param row 行数据
* @param {{ name: string, value: any }} $event
* @returns {void}
* @memberof Main
*/
public onGridItemValueChange(row: any,$event: { name: string, value: any }): void {
if (!$event) {
return;
}
if (!$event.name || Object.is($event.name, '') || !row.hasOwnProperty($event.name)) {
return;
}
row[$event.name] = $event.value;
this.gridEditItemChange(row, $event.name, $event.value);
}
/**
* 表格编辑项值变化
*
* @public
* @param row 行数据
* @param property 列编辑项名
* @param row 列编辑项值
* @returns {void}
* @memberof Main
*/
public gridEditItemChange(row: any, property: string, value: any){
row.rowDataState = row.rowDataState ? row.rowDataState : "update" ;
}
/**
* 表格编辑项更新
*
* @param {string} mode 界面行为名称
* @param {*} [data={}] 请求数据
* @param {string[]} updateDetails 更新项
* @param {boolean} [showloading] 是否显示加载状态
* @returns {void}
* @memberof Main
*/
public updateGridEditItem(mode: string, data: any = {}, updateDetails: string[], showloading?: boolean): void {
if (!mode || (mode && Object.is(mode, ''))) {
return;
}
const arg: any = JSON.parse(JSON.stringify(data));
Object.assign(arg,{viewparams:this.viewparams});
const post: Promise<any> = this.service.frontLogic(mode,JSON.parse(JSON.stringify(this.context)),arg, showloading);
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '表单项更新失败' });
return;
}
const _data: any = response.data;
if(!_data){
return;
}
updateDetails.forEach((name: string) => {
if (!_data.hasOwnProperty(name)) {
return;
}
data[name] = _data[name];
});
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
}
/**
* 获取对应行class
......
......@@ -4,7 +4,7 @@
<row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzemployee.changepw_form.details.group1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzemployee.changepw_form.details.group1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.oldpasswd.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='oldpasswd' :itemRules="this.rules.oldpasswd" class='' :caption="$t('entities.ibzemployee.changepw_form.details.oldpasswd')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.oldpasswd.error" :isEmptyCaption="false" labelPos="LEFT">
......
......@@ -4,7 +4,7 @@
<row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzemployee.main_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzemployee.main_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.usercode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='usercode' :itemRules="this.rules.usercode" class='' :caption="$t('entities.ibzemployee.main_form.details.usercode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.usercode.error" :isEmptyCaption="false" labelPos="LEFT">
......@@ -25,7 +25,7 @@
</i-col>
<i-col v-show="detailsModel.grouppanel1.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' uiActionGroup="detailsModel.grouppanel1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzemployee.main_form.details.grouppanel1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.grouppanel1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzemployee.main_form.details.grouppanel1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.orgname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='orgname' :itemRules="this.rules.orgname" class='' :caption="$t('entities.ibzemployee.main_form.details.orgname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orgname.error" :isEmptyCaption="false" labelPos="LEFT">
......@@ -173,7 +173,7 @@
</i-col>
<i-col v-show="detailsModel.grouppanel2.visible" :style="{}" :sm="{ span: 24, offset: 0 }" :md="{ span: 24, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' uiActionGroup="detailsModel.grouppanel2.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzemployee.main_form.details.grouppanel2')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.grouppanel2.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzemployee.main_form.details.grouppanel2')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
</row>
......@@ -668,8 +668,8 @@ export default class MainBase extends Vue implements ControlInterface {
mdeptname: [
{ type: 'string', message: '部门 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '部门 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '部门 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '部门 值不能为空', trigger: 'blur' },
{ required: true, type: 'string', message: '部门 值不能为空', trigger: 'change' },
{ required: true, type: 'string', message: '部门 值不能为空', trigger: 'blur' },
],
nickname: [
{ type: 'string', message: '昵称别名 值必须为字符串类型', trigger: 'change' },
......
......@@ -22,56 +22,56 @@
<el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
</template>
<template v-if="getColumnState('usercode')">
<el-table-column show-overflow-tooltip :prop="'usercode'" :label="$t('entities.ibzemployee.main_grid.columns.usercode')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'usercode'" :label="$t('entities.ibzemployee.main_grid.columns.usercode')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.usercode}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('personname')">
<el-table-column show-overflow-tooltip :prop="'personname'" :label="$t('entities.ibzemployee.main_grid.columns.personname')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'personname'" :label="$t('entities.ibzemployee.main_grid.columns.personname')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.personname}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('loginname')">
<el-table-column show-overflow-tooltip :prop="'loginname'" :label="$t('entities.ibzemployee.main_grid.columns.loginname')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'loginname'" :label="$t('entities.ibzemployee.main_grid.columns.loginname')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.loginname}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('orgcode')">
<el-table-column show-overflow-tooltip :prop="'orgcode'" :label="$t('entities.ibzemployee.main_grid.columns.orgcode')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'orgcode'" :label="$t('entities.ibzemployee.main_grid.columns.orgcode')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.orgcode}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('orgname')">
<el-table-column show-overflow-tooltip :prop="'orgname'" :label="$t('entities.ibzemployee.main_grid.columns.orgname')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'orgname'" :label="$t('entities.ibzemployee.main_grid.columns.orgname')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.orgname}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('mdeptcode')">
<el-table-column show-overflow-tooltip :prop="'mdeptcode'" :label="$t('entities.ibzemployee.main_grid.columns.mdeptcode')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'mdeptcode'" :label="$t('entities.ibzemployee.main_grid.columns.mdeptcode')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.mdeptcode}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('mdeptname')">
<el-table-column show-overflow-tooltip :prop="'mdeptname'" :label="$t('entities.ibzemployee.main_grid.columns.mdeptname')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'mdeptname'" :label="$t('entities.ibzemployee.main_grid.columns.mdeptname')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.mdeptname}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('sex')">
<el-table-column show-overflow-tooltip :prop="'sex'" :label="$t('entities.ibzemployee.main_grid.columns.sex')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'sex'" :label="$t('entities.ibzemployee.main_grid.columns.sex')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<template >
<codelist :value="row.sex" tag='CLIBZSex' codelistType='STATIC' ></codelist>
......@@ -80,21 +80,21 @@
</el-table-column>
</template>
<template v-if="getColumnState('phone')">
<el-table-column show-overflow-tooltip :prop="'phone'" :label="$t('entities.ibzemployee.main_grid.columns.phone')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'phone'" :label="$t('entities.ibzemployee.main_grid.columns.phone')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.phone}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('ipaddr')">
<el-table-column show-overflow-tooltip :prop="'ipaddr'" :label="$t('entities.ibzemployee.main_grid.columns.ipaddr')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'ipaddr'" :label="$t('entities.ibzemployee.main_grid.columns.ipaddr')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.ipaddr}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('showorder')">
<el-table-column show-overflow-tooltip :prop="'showorder'" :label="$t('entities.ibzemployee.main_grid.columns.showorder')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'showorder'" :label="$t('entities.ibzemployee.main_grid.columns.showorder')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.showorder}}</span>
</template>
......
......@@ -4,7 +4,7 @@
<row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzemployee.newform_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzemployee.newform_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.usercode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='usercode' :itemRules="this.rules.usercode" class='' :caption="$t('entities.ibzemployee.newform_form.details.usercode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.usercode.error" :isEmptyCaption="false" labelPos="LEFT">
......@@ -499,14 +499,14 @@ export default class NewFormBase extends Vue implements ControlInterface {
orgname: [
{ type: 'string', message: '单位 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '单位 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '单位 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '单位 值不能为空', trigger: 'blur' },
{ required: true, type: 'string', message: '单位 值不能为空', trigger: 'change' },
{ required: true, type: 'string', message: '单位 值不能为空', trigger: 'blur' },
],
mdeptname: [
{ type: 'string', message: '部门 值必须为字符串类型', trigger: 'change' },
{ type: 'string', message: '部门 值必须为字符串类型', trigger: 'blur' },
{ required: false, type: 'string', message: '部门 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '部门 值不能为空', trigger: 'blur' },
{ required: true, type: 'string', message: '部门 值不能为空', trigger: 'change' },
{ required: true, type: 'string', message: '部门 值不能为空', trigger: 'blur' },
],
enable: [
{ type: 'number', message: '逻辑有效 值必须为数值类型', trigger: 'change' },
......
......@@ -22,56 +22,56 @@
<el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
</template>
<template v-if="getColumnState('orgid')">
<el-table-column show-overflow-tooltip :prop="'orgid'" :label="$t('entities.ibzorganization.main_grid.columns.orgid')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'orgid'" :label="$t('entities.ibzorganization.main_grid.columns.orgid')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.orgid}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('orgcode')">
<el-table-column show-overflow-tooltip :prop="'orgcode'" :label="$t('entities.ibzorganization.main_grid.columns.orgcode')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'orgcode'" :label="$t('entities.ibzorganization.main_grid.columns.orgcode')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.orgcode}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('orgname')">
<el-table-column show-overflow-tooltip :prop="'orgname'" :label="$t('entities.ibzorganization.main_grid.columns.orgname')" :width="200" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'orgname'" :label="$t('entities.ibzorganization.main_grid.columns.orgname')" :width="200" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.orgname}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('orglevel')">
<el-table-column show-overflow-tooltip :prop="'orglevel'" :label="$t('entities.ibzorganization.main_grid.columns.orglevel')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'orglevel'" :label="$t('entities.ibzorganization.main_grid.columns.orglevel')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.orglevel}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('shortname')">
<el-table-column show-overflow-tooltip :prop="'shortname'" :label="$t('entities.ibzorganization.main_grid.columns.shortname')" :width="200" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'shortname'" :label="$t('entities.ibzorganization.main_grid.columns.shortname')" :width="200" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.shortname}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('showorder')">
<el-table-column show-overflow-tooltip :prop="'showorder'" :label="$t('entities.ibzorganization.main_grid.columns.showorder')" :width="150" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'showorder'" :label="$t('entities.ibzorganization.main_grid.columns.showorder')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.showorder}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('createdate')">
<el-table-column show-overflow-tooltip :prop="'createdate'" :label="$t('entities.ibzorganization.main_grid.columns.createdate')" :width="200" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'createdate'" :label="$t('entities.ibzorganization.main_grid.columns.createdate')" :width="200" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<app-format-data format="YYYY-MM-DD hh:mm:ss" :data="row.createdate"></app-format-data>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('updatedate')">
<el-table-column show-overflow-tooltip :prop="'updatedate'" :label="$t('entities.ibzorganization.main_grid.columns.updatedate')" :width="200" :align="'left'" :sortable="'custom'">
<el-table-column show-overflow-tooltip :prop="'updatedate'" :label="$t('entities.ibzorganization.main_grid.columns.updatedate')" :width="200" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<app-format-data format="YYYY-MM-DD hh:mm:ss" :data="row.updatedate"></app-format-data>
</template>
......
......@@ -4,7 +4,7 @@
<row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzorganization.newform_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.ibzorganization.newform_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.orgcode.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='orgcode' :itemRules="this.rules.orgcode" class='' :caption="$t('entities.ibzorganization.newform_form.details.orgcode')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.orgcode.error" :isEmptyCaption="false" labelPos="LEFT">
......
......@@ -150,7 +150,7 @@
<verbose>true</verbose>
<logging>debug</logging>
<contexts>!test</contexts>
<diffExcludeObjects>Index:.*,table:IBZFILE,IBZUSER,IBZDATAAUDIT</diffExcludeObjects>
<diffExcludeObjects>Index:.*,table:ibzfile,ibzuser,ibzdataaudit</diffExcludeObjects>
</configuration>
<phase>process-resources</phase>
<goals>
......
package cn.ibizlab.core.ou.service.logic;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import cn.ibizlab.core.ou.domain.IBZEmployee;
/**
* 关系型数据实体[saveDeptMember] 对象
*/
public interface IIBZEmployeesaveDeptMemberLogic {
void execute(IBZEmployee ibzemployee ) ;
}
package cn.ibizlab.core.ou.service.logic.impl;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.KieContainer;
import cn.ibizlab.core.ou.service.logic.IIBZEmployeesaveDeptMemberLogic;
import cn.ibizlab.core.ou.domain.IBZEmployee;
/**
* 关系型数据实体[saveDeptMember] 对象
*/
@Slf4j
@Service
public class IBZEmployeesaveDeptMemberLogicImpl implements IIBZEmployeesaveDeptMemberLogic{
@Autowired
private KieContainer kieContainer;
@Autowired
private cn.ibizlab.core.ou.service.IIBZDeptMemberService ibzdeptmemberservice;
public cn.ibizlab.core.ou.service.IIBZDeptMemberService getIbzdeptmemberService() {
return this.ibzdeptmemberservice;
}
@Autowired
private cn.ibizlab.core.ou.service.IIBZEmployeeService iBzSysDefaultService;
public cn.ibizlab.core.ou.service.IIBZEmployeeService getIBzSysDefaultService() {
return this.iBzSysDefaultService;
}
public void execute(IBZEmployee et){
KieSession kieSession = null;
try{
kieSession=kieContainer.newKieSession();
kieSession.insert(et);
kieSession.setGlobal("ibzemployeesavedeptmemberdefault",et);
cn.ibizlab.core.ou.domain.IBZDeptMember ibzemployeesavedeptmembermember =new cn.ibizlab.core.ou.domain.IBZDeptMember();
kieSession.insert(ibzemployeesavedeptmembermember);
kieSession.setGlobal("ibzemployeesavedeptmembermember",ibzemployeesavedeptmembermember);
kieSession.setGlobal("ibzdeptmemberservice",ibzdeptmemberservice);
kieSession.setGlobal("iBzSysIbzemployeeDefaultService",iBzSysDefaultService);
kieSession.setGlobal("curuser", cn.ibizlab.util.security.AuthenticationUser.getAuthenticationUser());
kieSession.startProcess("cn.ibizlab.core.ou.service.logic.ibzemployeesavedeptmember");
}catch(Exception e){
throw new RuntimeException("执行[保存人事关系]处理逻辑发生异常"+e);
}finally {
if(kieSession!=null)
kieSession.destroy();
}
}
}
......@@ -28,7 +28,7 @@
</createTable>
</changeSet>
<!--输出实体[IBZEMP]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ibzemp-611-2">
<changeSet author="a_A_5d9d78509" id="tab-ibzemp-616-2">
<createTable tableName="IBZEMP">
<column name="USERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_IBZEMP_USERID"/>
......@@ -106,7 +106,7 @@
</createTable>
</changeSet>
<!--输出实体[IBZDEPTMEMBER]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ibzdeptmember-24-3">
<changeSet author="a_A_5d9d78509" id="tab-ibzdeptmember-25-3">
<createTable tableName="IBZDEPTMEMBER">
<column name="MEMBERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_IBZDEPTMEMBER_MEMBERID"/>
......@@ -118,7 +118,7 @@
</createTable>
</changeSet>
<!--输出实体[IBZDEPT]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-ibzdept-541-4">
<changeSet author="a_A_5d9d78509" id="tab-ibzdept-542-4">
<createTable tableName="IBZDEPT">
<column name="DEPTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_IBZDEPT_DEPTID"/>
......@@ -157,24 +157,24 @@
<addForeignKeyConstraint baseColumnNames="PORGID" baseTableName="IBZORG" constraintName="DER1N_IBZORG_IBZORG_PORGID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGID" referencedTableName="IBZORG" validate="true"/>
</changeSet>
<!--输出实体[IBZEMP]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-ibzemp-611-6">
<changeSet author="a_A_5d9d78509" id="fk-ibzemp-616-6">
<addForeignKeyConstraint baseColumnNames="MDEPTID" baseTableName="IBZEMP" constraintName="DER1N_IBZEMP_IBZDEPT_MDEPTID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="DEPTID" referencedTableName="IBZDEPT" validate="true"/>
</changeSet>
<changeSet author="a_A_5d9d78509" id="fk-ibzemp-611-7">
<changeSet author="a_A_5d9d78509" id="fk-ibzemp-616-7">
<addForeignKeyConstraint baseColumnNames="ORGID" baseTableName="IBZEMP" constraintName="DER1N_IBZEMP_IBZORG_ORGID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGID" referencedTableName="IBZORG" validate="true"/>
</changeSet>
<!--输出实体[IBZDEPTMEMBER]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-ibzdeptmember-24-8">
<changeSet author="a_A_5d9d78509" id="fk-ibzdeptmember-25-8">
<addForeignKeyConstraint baseColumnNames="DEPTID" baseTableName="IBZDEPTMEMBER" constraintName="DER1N_IBZDEPTMEMBER_IBZDEPT_DE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="DEPTID" referencedTableName="IBZDEPT" validate="true"/>
</changeSet>
<changeSet author="a_A_5d9d78509" id="fk-ibzdeptmember-24-9">
<changeSet author="a_A_5d9d78509" id="fk-ibzdeptmember-25-9">
<addForeignKeyConstraint baseColumnNames="USERID" baseTableName="IBZDEPTMEMBER" constraintName="DER1N_IBZDEPTMEMBER_IBZEMP_USE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="USERID" referencedTableName="IBZEMP" validate="true"/>
</changeSet>
<!--输出实体[IBZDEPT]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-ibzdept-541-10">
<changeSet author="a_A_5d9d78509" id="fk-ibzdept-542-10">
<addForeignKeyConstraint baseColumnNames="PDEPTID" baseTableName="IBZDEPT" constraintName="DER1N_IBZDEPT_IBZDEPT_PDEPTID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="DEPTID" referencedTableName="IBZDEPT" validate="true"/>
</changeSet>
<changeSet author="a_A_5d9d78509" id="fk-ibzdept-541-11">
<changeSet author="a_A_5d9d78509" id="fk-ibzdept-542-11">
<addForeignKeyConstraint baseColumnNames="ORGID" baseTableName="IBZDEPT" constraintName="DER1N_IBZDEPT_IBZORG_ORGID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGID" referencedTableName="IBZORG" validate="true"/>
</changeSet>
......
package cn.ibizlab.ou.logic.ibzemployeelogic.savedeptmember;
import java.util.Map;
import java.util.HashMap;
import com.alibaba.fastjson.JSONObject;
global cn.ibizlab.core.ou.domain.IBZEmployee ibzemployeesavedeptmemberdefault;
global cn.ibizlab.core.ou.domain.IBZDeptMember ibzemployeesavedeptmembermember;
global cn.ibizlab.core.ou.service.IIBZDeptMemberService ibzdeptmemberservice;
global cn.ibizlab.core.ou.service.IIBZEmployeeService iBzSysIbzemployeeDefaultService;
global cn.ibizlab.util.security.AuthenticationUser curuser;
no-loop
//逻辑处理节点[保存成员]
rule "deaction1"
ruleflow-group "ibzemployeesavedeptmemberdeaction1"
when
then
ibzdeptmemberservice.save(ibzemployeesavedeptmemberdefault);
update(ibzemployeesavedeptmemberdefault);//更新fact中变量值
update(ibzemployeesavedeptmembermember);//更新fact中变量值
end
//逻辑处理节点[准备成员]
rule "prepareparam1"
ruleflow-group "ibzemployeesavedeptmemberprepareparam1"
when
then
ibzemployeesavedeptmembermember.set("deptid",ibzemployeesavedeptmemberdefault.get("mdeptid"));
ibzemployeesavedeptmembermember.set("userid",ibzemployeesavedeptmemberdefault.get("userid"));
update(ibzemployeesavedeptmemberdefault);//更新fact中变量值
update(ibzemployeesavedeptmembermember);//更新fact中变量值
end
//逻辑处理节点[开始]
rule "begin"
ruleflow-group "ibzemployeesavedeptmemberbegin"
when
then
end
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.mvel.org/2.0" id="Definition" name="" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
<process id="cn.ibizlab.core.ou.service.logic.ibzemployeesavedeptmember" isClosed="false" isExecutable="true" name="ScoreRule" processType="Private" tns:packageName="cn.ibizlab.core.ou.service.logic.ibzemployeesavedeptmember">
<extensionElements>
<tns:import name="java.util.Map" />
<tns:import name="org.springframework.util.StringUtils"/>
<tns:import name="cn.ibizlab.util.helper.RuleUtils"/>
<tns:global identifier="ibzemployeesavedeptmemberdefault" type="cn.ibizlab.core.ou.domain.IBZEmployee" />
<tns:global identifier="ibzemployeesavedeptmembermember" type="cn.ibizlab.core.ou.domain.IBZDeptMember" />
</extensionElements>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="ibzemployeesavedeptmemberdeaction1" id="F58FA774-B371-4481-8E9B-8483341ABB57" implementation="http://www.jboss.org/drools/rule" name="保存成员"/>
<endEvent id="F58FA774-B371-4481-8E9B-8483341ABB57_End" name="End"/>
<sequenceFlow id="F58FA774-B371-4481-8E9B-8483341ABB57_End_Line" sourceRef="F58FA774-B371-4481-8E9B-8483341ABB57" targetRef="F58FA774-B371-4481-8E9B-8483341ABB57_End"/>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="ibzemployeesavedeptmemberprepareparam1" id="EE4970ED-28DF-4578-9B6B-7E468DD9B866" implementation="http://www.jboss.org/drools/rule" name="准备成员"/>
<startEvent id="E3FF4728-CD18-4940-BAEF-8A71111A5D05" isInterrupting="true"/>
<sequenceFlow id="0DF4511B-818D-493E-9CC6-77B2E3EEFAE7" sourceRef="E3FF4728-CD18-4940-BAEF-8A71111A5D05" targetRef="EE4970ED-28DF-4578-9B6B-7E468DD9B866">
</sequenceFlow>
<sequenceFlow id="BDDA5BD4-EA82-4239-952F-B33AEC733ACB" sourceRef="EE4970ED-28DF-4578-9B6B-7E468DD9B866" targetRef="F58FA774-B371-4481-8E9B-8483341ABB57">
</sequenceFlow>
</process>
</definitions>
......@@ -50,12 +50,14 @@ public class IBZDepartmentResource {
@Autowired
@Lazy
private IBZDepartmentMapping ibzdepartmentMapping;
public IBZDepartmentMapping ibzdepartmentMapping;
public IBZDepartmentDTO permissionDTO=new IBZDepartmentDTO();
@PreAuthorize("hasPermission('','Create',{this.getEntity(),'Sql'})")
@PreAuthorize("hasPermission('','Create',{'Sql',this.ibzdepartmentMapping,#ibzdepartmentdto})")
@ApiOperation(value = "Create", tags = {"IBZDepartment" }, notes = "Create")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments")
@Transactional
......@@ -65,7 +67,7 @@ public class IBZDepartmentResource {
IBZDepartmentDTO dto = ibzdepartmentMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission('','Create',{this.getEntity(),'Sql'})")
@ApiOperation(value = "createBatch", tags = {"IBZDepartment" }, notes = "createBatch")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<IBZDepartmentDTO> ibzdepartmentdtos) {
......@@ -76,7 +78,7 @@ public class IBZDepartmentResource {
@PreAuthorize("hasPermission(#ibzdepartment_id,'Get',{this.getEntity(),'Sql'})")
@PreAuthorize("hasPermission(#ibzdepartment_id,'Get',{'Sql',this.ibzdepartmentMapping,this.permissionDTO})")
@ApiOperation(value = "Get", tags = {"IBZDepartment" }, notes = "Get")
@RequestMapping(method = RequestMethod.GET, value = "/ibzdepartments/{ibzdepartment_id}")
public ResponseEntity<IBZDepartmentDTO> get(@PathVariable("ibzdepartment_id") String ibzdepartment_id) {
......@@ -88,6 +90,7 @@ public class IBZDepartmentResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-Save-all')")
@ApiOperation(value = "Save", tags = {"IBZDepartment" }, notes = "Save")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/save")
public ResponseEntity<Boolean> save(@RequestBody IBZDepartmentDTO ibzdepartmentdto) {
......@@ -104,6 +107,7 @@ public class IBZDepartmentResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-CheckKey-all')")
@ApiOperation(value = "CheckKey", tags = {"IBZDepartment" }, notes = "CheckKey")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody IBZDepartmentDTO ibzdepartmentdto) {
......@@ -113,6 +117,7 @@ public class IBZDepartmentResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-GetDraft-all')")
@ApiOperation(value = "GetDraft", tags = {"IBZDepartment" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/ibzdepartments/getdraft")
public ResponseEntity<IBZDepartmentDTO> getDraft() {
......@@ -122,7 +127,7 @@ public class IBZDepartmentResource {
@PreAuthorize("hasPermission(#ibzdepartment_id,'Remove',{this.getEntity(),'Sql'})")
@PreAuthorize("hasPermission(#ibzdepartment_id,'Remove',{'Sql',this.ibzdepartmentMapping,this.permissionDTO})")
@ApiOperation(value = "Remove", tags = {"IBZDepartment" }, notes = "Remove")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdepartments/{ibzdepartment_id}")
@Transactional
......@@ -140,7 +145,7 @@ public class IBZDepartmentResource {
@PreAuthorize("hasPermission(#ibzdepartment_id,'Update',{this.getEntity(),'Sql'})")
@PreAuthorize("hasPermission(#ibzdepartment_id,'Update',{'Sql',this.ibzdepartmentMapping,#ibzdepartmentdto})")
@ApiOperation(value = "Update", tags = {"IBZDepartment" }, notes = "Update")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdepartments/{ibzdepartment_id}")
@Transactional
......@@ -152,7 +157,6 @@ public class IBZDepartmentResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(#ibzdepartment_id,'Update',{this.getEntity(),'Sql'})")
@ApiOperation(value = "UpdateBatch", tags = {"IBZDepartment" }, notes = "UpdateBatch")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdepartments/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<IBZDepartmentDTO> ibzdepartmentdtos) {
......@@ -160,7 +164,7 @@ public class IBZDepartmentResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-CurDept-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-CurDept-all')")
@ApiOperation(value = "fetchCurDept", tags = {"IBZDepartment" } ,notes = "fetchCurDept")
@RequestMapping(method= RequestMethod.GET , value="/ibzdepartments/fetchcurdept")
public ResponseEntity<List<IBZDepartmentDTO>> fetchCurDept(IBZDepartmentSearchContext context) {
......@@ -173,7 +177,7 @@ public class IBZDepartmentResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-CurDept-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-CurDept-all')")
@ApiOperation(value = "searchCurDept", tags = {"IBZDepartment" } ,notes = "searchCurDept")
@RequestMapping(method= RequestMethod.POST , value="/ibzdepartments/searchcurdept")
public ResponseEntity<Page<IBZDepartmentDTO>> searchCurDept(@RequestBody IBZDepartmentSearchContext context) {
......@@ -182,7 +186,7 @@ public class IBZDepartmentResource {
.body(new PageImpl(ibzdepartmentMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-Default-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-Default-all')")
@ApiOperation(value = "fetchDEFAULT", tags = {"IBZDepartment" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/ibzdepartments/fetchdefault")
public ResponseEntity<List<IBZDepartmentDTO>> fetchDefault(IBZDepartmentSearchContext context) {
......@@ -195,7 +199,7 @@ public class IBZDepartmentResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-Default-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-Default-all')")
@ApiOperation(value = "searchDEFAULT", tags = {"IBZDepartment" } ,notes = "searchDEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/ibzdepartments/searchdefault")
public ResponseEntity<Page<IBZDepartmentDTO>> searchDefault(@RequestBody IBZDepartmentSearchContext context) {
......@@ -206,6 +210,7 @@ public class IBZDepartmentResource {
//@PreAuthorize("hasPermission('','Create',{'Sql',this.ibzdepartmentMapping,#ibzdepartmentdto})")
@ApiOperation(value = "CreateByIBZOrganization", tags = {"IBZDepartment" }, notes = "CreateByIBZOrganization")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments")
@Transactional
......@@ -228,6 +233,7 @@ public class IBZDepartmentResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasPermission(#ibzdepartment_id,'Get',{'Sql',this.ibzdepartmentMapping,this.permissionDTO})")
@ApiOperation(value = "GetByIBZOrganization", tags = {"IBZDepartment" }, notes = "GetByIBZOrganization")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}")
public ResponseEntity<IBZDepartmentDTO> getByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id) {
......@@ -236,6 +242,7 @@ public class IBZDepartmentResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-Save-all')")
@ApiOperation(value = "SaveByIBZOrganization", tags = {"IBZDepartment" }, notes = "SaveByIBZOrganization")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/save")
public ResponseEntity<Boolean> saveByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZDepartmentDTO ibzdepartmentdto) {
......@@ -255,12 +262,14 @@ public class IBZDepartmentResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-CheckKey-all')")
@ApiOperation(value = "CheckKeyByIBZOrganization", tags = {"IBZDepartment" }, notes = "CheckKeyByIBZOrganization")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/checkkey")
public ResponseEntity<Boolean> checkKeyByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZDepartmentDTO ibzdepartmentdto) {
return ResponseEntity.status(HttpStatus.OK).body(ibzdepartmentService.checkKey(ibzdepartmentMapping.toDomain(ibzdepartmentdto)));
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-GetDraft-all')")
@ApiOperation(value = "GetDraftByIBZOrganization", tags = {"IBZDepartment" }, notes = "GetDraftByIBZOrganization")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/getdraft")
public ResponseEntity<IBZDepartmentDTO> getDraftByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id) {
......@@ -269,6 +278,7 @@ public class IBZDepartmentResource {
return ResponseEntity.status(HttpStatus.OK).body(ibzdepartmentMapping.toDto(ibzdepartmentService.getDraft(domain)));
}
//@PreAuthorize("hasPermission(#ibzdepartment_id,'Remove',{'Sql',this.ibzdepartmentMapping,this.permissionDTO})")
@ApiOperation(value = "RemoveByIBZOrganization", tags = {"IBZDepartment" }, notes = "RemoveByIBZOrganization")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}")
@Transactional
......@@ -283,6 +293,7 @@ public class IBZDepartmentResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasPermission(#ibzdepartment_id,'Update',{'Sql',this.ibzdepartmentMapping,#ibzdepartmentdto})")
@ApiOperation(value = "UpdateByIBZOrganization", tags = {"IBZDepartment" }, notes = "UpdateByIBZOrganization")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}")
@Transactional
......@@ -306,6 +317,7 @@ public class IBZDepartmentResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-CurDept-all')")
@ApiOperation(value = "fetchCurDeptByIBZOrganization", tags = {"IBZDepartment" } ,notes = "fetchCurDeptByIBZOrganization")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/{ibzorganization_id}/ibzdepartments/fetchcurdept")
public ResponseEntity<List<IBZDepartmentDTO>> fetchIBZDepartmentCurDeptByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id,IBZDepartmentSearchContext context) {
......@@ -319,6 +331,7 @@ public class IBZDepartmentResource {
.body(list);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-CurDept-all')")
@ApiOperation(value = "searchCurDeptByIBZOrganization", tags = {"IBZDepartment" } ,notes = "searchCurDeptByIBZOrganization")
@RequestMapping(method= RequestMethod.POST , value="/ibzorganizations/{ibzorganization_id}/ibzdepartments/searchcurdept")
public ResponseEntity<Page<IBZDepartmentDTO>> searchIBZDepartmentCurDeptByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZDepartmentSearchContext context) {
......@@ -328,6 +341,7 @@ public class IBZDepartmentResource {
.body(new PageImpl(ibzdepartmentMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-Default-all')")
@ApiOperation(value = "fetchDEFAULTByIBZOrganization", tags = {"IBZDepartment" } ,notes = "fetchDEFAULTByIBZOrganization")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/{ibzorganization_id}/ibzdepartments/fetchdefault")
public ResponseEntity<List<IBZDepartmentDTO>> fetchIBZDepartmentDefaultByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id,IBZDepartmentSearchContext context) {
......@@ -341,6 +355,7 @@ public class IBZDepartmentResource {
.body(list);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-Default-all')")
@ApiOperation(value = "searchDEFAULTByIBZOrganization", tags = {"IBZDepartment" } ,notes = "searchDEFAULTByIBZOrganization")
@RequestMapping(method= RequestMethod.POST , value="/ibzorganizations/{ibzorganization_id}/ibzdepartments/searchdefault")
public ResponseEntity<Page<IBZDepartmentDTO>> searchIBZDepartmentDefaultByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZDepartmentSearchContext context) {
......@@ -351,12 +366,6 @@ public class IBZDepartmentResource {
}
/**
* 用户权限校验
* @return
*/
public IBZDepartment getEntity(){
return new IBZDepartment();
}
}
......@@ -50,12 +50,14 @@ public class IBZDeptMemberResource {
@Autowired
@Lazy
private IBZDeptMemberMapping ibzdeptmemberMapping;
public IBZDeptMemberMapping ibzdeptmemberMapping;
public IBZDeptMemberDTO permissionDTO=new IBZDeptMemberDTO();
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Update-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Update-all')")
@ApiOperation(value = "Update", tags = {"IBZDeptMember" }, notes = "Update")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdeptmembers/{ibzdeptmember_id}")
@Transactional
......@@ -67,7 +69,6 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Update-all')")
@ApiOperation(value = "UpdateBatch", tags = {"IBZDeptMember" }, notes = "UpdateBatch")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdeptmembers/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<IBZDeptMemberDTO> ibzdeptmemberdtos) {
......@@ -78,7 +79,7 @@ public class IBZDeptMemberResource {
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Create-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Create-all')")
@ApiOperation(value = "Create", tags = {"IBZDeptMember" }, notes = "Create")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdeptmembers")
@Transactional
......@@ -88,7 +89,7 @@ public class IBZDeptMemberResource {
IBZDeptMemberDTO dto = ibzdeptmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Create-all')")
@ApiOperation(value = "createBatch", tags = {"IBZDeptMember" }, notes = "createBatch")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdeptmembers/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<IBZDeptMemberDTO> ibzdeptmemberdtos) {
......@@ -99,6 +100,7 @@ public class IBZDeptMemberResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Save-all')")
@ApiOperation(value = "Save", tags = {"IBZDeptMember" }, notes = "Save")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdeptmembers/save")
public ResponseEntity<Boolean> save(@RequestBody IBZDeptMemberDTO ibzdeptmemberdto) {
......@@ -115,6 +117,7 @@ public class IBZDeptMemberResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-GetDraft-all')")
@ApiOperation(value = "GetDraft", tags = {"IBZDeptMember" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/ibzdeptmembers/getdraft")
public ResponseEntity<IBZDeptMemberDTO> getDraft() {
......@@ -124,7 +127,7 @@ public class IBZDeptMemberResource {
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Get-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Get-all')")
@ApiOperation(value = "Get", tags = {"IBZDeptMember" }, notes = "Get")
@RequestMapping(method = RequestMethod.GET, value = "/ibzdeptmembers/{ibzdeptmember_id}")
public ResponseEntity<IBZDeptMemberDTO> get(@PathVariable("ibzdeptmember_id") String ibzdeptmember_id) {
......@@ -136,7 +139,7 @@ public class IBZDeptMemberResource {
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Remove-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Remove-all')")
@ApiOperation(value = "Remove", tags = {"IBZDeptMember" }, notes = "Remove")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdeptmembers/{ibzdeptmember_id}")
@Transactional
......@@ -154,13 +157,14 @@ public class IBZDeptMemberResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-CheckKey-all')")
@ApiOperation(value = "CheckKey", tags = {"IBZDeptMember" }, notes = "CheckKey")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdeptmembers/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody IBZDeptMemberDTO ibzdeptmemberdto) {
return ResponseEntity.status(HttpStatus.OK).body(ibzdeptmemberService.checkKey(ibzdeptmemberMapping.toDomain(ibzdeptmemberdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Default-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Default-all')")
@ApiOperation(value = "fetchDEFAULT", tags = {"IBZDeptMember" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/ibzdeptmembers/fetchdefault")
public ResponseEntity<List<IBZDeptMemberDTO>> fetchDefault(IBZDeptMemberSearchContext context) {
......@@ -173,7 +177,7 @@ public class IBZDeptMemberResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Default-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Default-all')")
@ApiOperation(value = "searchDEFAULT", tags = {"IBZDeptMember" } ,notes = "searchDEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/ibzdeptmembers/searchdefault")
public ResponseEntity<Page<IBZDeptMemberDTO>> searchDefault(@RequestBody IBZDeptMemberSearchContext context) {
......@@ -184,6 +188,7 @@ public class IBZDeptMemberResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Update-all')")
@ApiOperation(value = "UpdateByIBZEmployee", tags = {"IBZDeptMember" }, notes = "UpdateByIBZEmployee")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzemployees/{ibzemployee_id}/ibzdeptmembers/{ibzdeptmember_id}")
@Transactional
......@@ -207,6 +212,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Create-all')")
@ApiOperation(value = "CreateByIBZEmployee", tags = {"IBZDeptMember" }, notes = "CreateByIBZEmployee")
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/{ibzemployee_id}/ibzdeptmembers")
@Transactional
......@@ -229,6 +235,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Save-all')")
@ApiOperation(value = "SaveByIBZEmployee", tags = {"IBZDeptMember" }, notes = "SaveByIBZEmployee")
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/{ibzemployee_id}/ibzdeptmembers/save")
public ResponseEntity<Boolean> saveByIBZEmployee(@PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZDeptMemberDTO ibzdeptmemberdto) {
......@@ -248,6 +255,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-GetDraft-all')")
@ApiOperation(value = "GetDraftByIBZEmployee", tags = {"IBZDeptMember" }, notes = "GetDraftByIBZEmployee")
@RequestMapping(method = RequestMethod.GET, value = "/ibzemployees/{ibzemployee_id}/ibzdeptmembers/getdraft")
public ResponseEntity<IBZDeptMemberDTO> getDraftByIBZEmployee(@PathVariable("ibzemployee_id") String ibzemployee_id) {
......@@ -256,6 +264,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(ibzdeptmemberMapping.toDto(ibzdeptmemberService.getDraft(domain)));
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Get-all')")
@ApiOperation(value = "GetByIBZEmployee", tags = {"IBZDeptMember" }, notes = "GetByIBZEmployee")
@RequestMapping(method = RequestMethod.GET, value = "/ibzemployees/{ibzemployee_id}/ibzdeptmembers/{ibzdeptmember_id}")
public ResponseEntity<IBZDeptMemberDTO> getByIBZEmployee(@PathVariable("ibzemployee_id") String ibzemployee_id, @PathVariable("ibzdeptmember_id") String ibzdeptmember_id) {
......@@ -264,6 +273,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Remove-all')")
@ApiOperation(value = "RemoveByIBZEmployee", tags = {"IBZDeptMember" }, notes = "RemoveByIBZEmployee")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzemployees/{ibzemployee_id}/ibzdeptmembers/{ibzdeptmember_id}")
@Transactional
......@@ -278,12 +288,14 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-CheckKey-all')")
@ApiOperation(value = "CheckKeyByIBZEmployee", tags = {"IBZDeptMember" }, notes = "CheckKeyByIBZEmployee")
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/{ibzemployee_id}/ibzdeptmembers/checkkey")
public ResponseEntity<Boolean> checkKeyByIBZEmployee(@PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZDeptMemberDTO ibzdeptmemberdto) {
return ResponseEntity.status(HttpStatus.OK).body(ibzdeptmemberService.checkKey(ibzdeptmemberMapping.toDomain(ibzdeptmemberdto)));
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Default-all')")
@ApiOperation(value = "fetchDEFAULTByIBZEmployee", tags = {"IBZDeptMember" } ,notes = "fetchDEFAULTByIBZEmployee")
@RequestMapping(method= RequestMethod.GET , value="/ibzemployees/{ibzemployee_id}/ibzdeptmembers/fetchdefault")
public ResponseEntity<List<IBZDeptMemberDTO>> fetchIBZDeptMemberDefaultByIBZEmployee(@PathVariable("ibzemployee_id") String ibzemployee_id,IBZDeptMemberSearchContext context) {
......@@ -297,6 +309,7 @@ public class IBZDeptMemberResource {
.body(list);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Default-all')")
@ApiOperation(value = "searchDEFAULTByIBZEmployee", tags = {"IBZDeptMember" } ,notes = "searchDEFAULTByIBZEmployee")
@RequestMapping(method= RequestMethod.POST , value="/ibzemployees/{ibzemployee_id}/ibzdeptmembers/searchdefault")
public ResponseEntity<Page<IBZDeptMemberDTO>> searchIBZDeptMemberDefaultByIBZEmployee(@PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZDeptMemberSearchContext context) {
......@@ -309,6 +322,7 @@ public class IBZDeptMemberResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Update-all')")
@ApiOperation(value = "UpdateByIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "UpdateByIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/{ibzdeptmember_id}")
@Transactional
......@@ -332,6 +346,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Create-all')")
@ApiOperation(value = "CreateByIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "CreateByIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers")
@Transactional
......@@ -354,6 +369,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Save-all')")
@ApiOperation(value = "SaveByIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "SaveByIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/save")
public ResponseEntity<Boolean> saveByIBZDepartmentIBZEmployee(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZDeptMemberDTO ibzdeptmemberdto) {
......@@ -373,6 +389,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-GetDraft-all')")
@ApiOperation(value = "GetDraftByIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "GetDraftByIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.GET, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/getdraft")
public ResponseEntity<IBZDeptMemberDTO> getDraftByIBZDepartmentIBZEmployee(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id) {
......@@ -381,6 +398,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(ibzdeptmemberMapping.toDto(ibzdeptmemberService.getDraft(domain)));
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Get-all')")
@ApiOperation(value = "GetByIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "GetByIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.GET, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/{ibzdeptmember_id}")
public ResponseEntity<IBZDeptMemberDTO> getByIBZDepartmentIBZEmployee(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @PathVariable("ibzdeptmember_id") String ibzdeptmember_id) {
......@@ -389,6 +407,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Remove-all')")
@ApiOperation(value = "RemoveByIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "RemoveByIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/{ibzdeptmember_id}")
@Transactional
......@@ -403,12 +422,14 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-CheckKey-all')")
@ApiOperation(value = "CheckKeyByIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "CheckKeyByIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/checkkey")
public ResponseEntity<Boolean> checkKeyByIBZDepartmentIBZEmployee(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZDeptMemberDTO ibzdeptmemberdto) {
return ResponseEntity.status(HttpStatus.OK).body(ibzdeptmemberService.checkKey(ibzdeptmemberMapping.toDomain(ibzdeptmemberdto)));
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Default-all')")
@ApiOperation(value = "fetchDEFAULTByIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" } ,notes = "fetchDEFAULTByIBZDepartmentIBZEmployee")
@RequestMapping(method= RequestMethod.GET , value="/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/fetchdefault")
public ResponseEntity<List<IBZDeptMemberDTO>> fetchIBZDeptMemberDefaultByIBZDepartmentIBZEmployee(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id,IBZDeptMemberSearchContext context) {
......@@ -422,6 +443,7 @@ public class IBZDeptMemberResource {
.body(list);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Default-all')")
@ApiOperation(value = "searchDEFAULTByIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" } ,notes = "searchDEFAULTByIBZDepartmentIBZEmployee")
@RequestMapping(method= RequestMethod.POST , value="/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/searchdefault")
public ResponseEntity<Page<IBZDeptMemberDTO>> searchIBZDeptMemberDefaultByIBZDepartmentIBZEmployee(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZDeptMemberSearchContext context) {
......@@ -434,6 +456,7 @@ public class IBZDeptMemberResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Update-all')")
@ApiOperation(value = "UpdateByIBZOrganizationIBZEmployee", tags = {"IBZDeptMember" }, notes = "UpdateByIBZOrganizationIBZEmployee")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/{ibzdeptmember_id}")
@Transactional
......@@ -457,6 +480,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Create-all')")
@ApiOperation(value = "CreateByIBZOrganizationIBZEmployee", tags = {"IBZDeptMember" }, notes = "CreateByIBZOrganizationIBZEmployee")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers")
@Transactional
......@@ -479,6 +503,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Save-all')")
@ApiOperation(value = "SaveByIBZOrganizationIBZEmployee", tags = {"IBZDeptMember" }, notes = "SaveByIBZOrganizationIBZEmployee")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/save")
public ResponseEntity<Boolean> saveByIBZOrganizationIBZEmployee(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZDeptMemberDTO ibzdeptmemberdto) {
......@@ -498,6 +523,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-GetDraft-all')")
@ApiOperation(value = "GetDraftByIBZOrganizationIBZEmployee", tags = {"IBZDeptMember" }, notes = "GetDraftByIBZOrganizationIBZEmployee")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/getdraft")
public ResponseEntity<IBZDeptMemberDTO> getDraftByIBZOrganizationIBZEmployee(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id) {
......@@ -506,6 +532,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(ibzdeptmemberMapping.toDto(ibzdeptmemberService.getDraft(domain)));
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Get-all')")
@ApiOperation(value = "GetByIBZOrganizationIBZEmployee", tags = {"IBZDeptMember" }, notes = "GetByIBZOrganizationIBZEmployee")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/{ibzdeptmember_id}")
public ResponseEntity<IBZDeptMemberDTO> getByIBZOrganizationIBZEmployee(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @PathVariable("ibzdeptmember_id") String ibzdeptmember_id) {
......@@ -514,6 +541,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Remove-all')")
@ApiOperation(value = "RemoveByIBZOrganizationIBZEmployee", tags = {"IBZDeptMember" }, notes = "RemoveByIBZOrganizationIBZEmployee")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/{ibzdeptmember_id}")
@Transactional
......@@ -528,12 +556,14 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-CheckKey-all')")
@ApiOperation(value = "CheckKeyByIBZOrganizationIBZEmployee", tags = {"IBZDeptMember" }, notes = "CheckKeyByIBZOrganizationIBZEmployee")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/checkkey")
public ResponseEntity<Boolean> checkKeyByIBZOrganizationIBZEmployee(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZDeptMemberDTO ibzdeptmemberdto) {
return ResponseEntity.status(HttpStatus.OK).body(ibzdeptmemberService.checkKey(ibzdeptmemberMapping.toDomain(ibzdeptmemberdto)));
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Default-all')")
@ApiOperation(value = "fetchDEFAULTByIBZOrganizationIBZEmployee", tags = {"IBZDeptMember" } ,notes = "fetchDEFAULTByIBZOrganizationIBZEmployee")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/fetchdefault")
public ResponseEntity<List<IBZDeptMemberDTO>> fetchIBZDeptMemberDefaultByIBZOrganizationIBZEmployee(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id,IBZDeptMemberSearchContext context) {
......@@ -547,6 +577,7 @@ public class IBZDeptMemberResource {
.body(list);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Default-all')")
@ApiOperation(value = "searchDEFAULTByIBZOrganizationIBZEmployee", tags = {"IBZDeptMember" } ,notes = "searchDEFAULTByIBZOrganizationIBZEmployee")
@RequestMapping(method= RequestMethod.POST , value="/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/searchdefault")
public ResponseEntity<Page<IBZDeptMemberDTO>> searchIBZDeptMemberDefaultByIBZOrganizationIBZEmployee(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZDeptMemberSearchContext context) {
......@@ -560,6 +591,7 @@ public class IBZDeptMemberResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Update-all')")
@ApiOperation(value = "UpdateByIBZOrganizationIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "UpdateByIBZOrganizationIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/{ibzdeptmember_id}")
@Transactional
......@@ -583,6 +615,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Create-all')")
@ApiOperation(value = "CreateByIBZOrganizationIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "CreateByIBZOrganizationIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers")
@Transactional
......@@ -605,6 +638,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Save-all')")
@ApiOperation(value = "SaveByIBZOrganizationIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "SaveByIBZOrganizationIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/save")
public ResponseEntity<Boolean> saveByIBZOrganizationIBZDepartmentIBZEmployee(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZDeptMemberDTO ibzdeptmemberdto) {
......@@ -624,6 +658,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-GetDraft-all')")
@ApiOperation(value = "GetDraftByIBZOrganizationIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "GetDraftByIBZOrganizationIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/getdraft")
public ResponseEntity<IBZDeptMemberDTO> getDraftByIBZOrganizationIBZDepartmentIBZEmployee(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id) {
......@@ -632,6 +667,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(ibzdeptmemberMapping.toDto(ibzdeptmemberService.getDraft(domain)));
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Get-all')")
@ApiOperation(value = "GetByIBZOrganizationIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "GetByIBZOrganizationIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/{ibzdeptmember_id}")
public ResponseEntity<IBZDeptMemberDTO> getByIBZOrganizationIBZDepartmentIBZEmployee(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @PathVariable("ibzdeptmember_id") String ibzdeptmember_id) {
......@@ -640,6 +676,7 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Remove-all')")
@ApiOperation(value = "RemoveByIBZOrganizationIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "RemoveByIBZOrganizationIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/{ibzdeptmember_id}")
@Transactional
......@@ -654,12 +691,14 @@ public class IBZDeptMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-CheckKey-all')")
@ApiOperation(value = "CheckKeyByIBZOrganizationIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" }, notes = "CheckKeyByIBZOrganizationIBZDepartmentIBZEmployee")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/checkkey")
public ResponseEntity<Boolean> checkKeyByIBZOrganizationIBZDepartmentIBZEmployee(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZDeptMemberDTO ibzdeptmemberdto) {
return ResponseEntity.status(HttpStatus.OK).body(ibzdeptmemberService.checkKey(ibzdeptmemberMapping.toDomain(ibzdeptmemberdto)));
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Default-all')")
@ApiOperation(value = "fetchDEFAULTByIBZOrganizationIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" } ,notes = "fetchDEFAULTByIBZOrganizationIBZDepartmentIBZEmployee")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/fetchdefault")
public ResponseEntity<List<IBZDeptMemberDTO>> fetchIBZDeptMemberDefaultByIBZOrganizationIBZDepartmentIBZEmployee(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id,IBZDeptMemberSearchContext context) {
......@@ -673,6 +712,7 @@ public class IBZDeptMemberResource {
.body(list);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDeptMember-Default-all')")
@ApiOperation(value = "searchDEFAULTByIBZOrganizationIBZDepartmentIBZEmployee", tags = {"IBZDeptMember" } ,notes = "searchDEFAULTByIBZOrganizationIBZDepartmentIBZEmployee")
@RequestMapping(method= RequestMethod.POST , value="/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/ibzdeptmembers/searchdefault")
public ResponseEntity<Page<IBZDeptMemberDTO>> searchIBZDeptMemberDefaultByIBZOrganizationIBZDepartmentIBZEmployee(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZDeptMemberSearchContext context) {
......@@ -683,12 +723,6 @@ public class IBZDeptMemberResource {
}
/**
* 用户权限校验
* @return
*/
public IBZDeptMember getEntity(){
return new IBZDeptMember();
}
}
......@@ -50,12 +50,14 @@ public class IBZEmployeeResource {
@Autowired
@Lazy
private IBZEmployeeMapping ibzemployeeMapping;
public IBZEmployeeMapping ibzemployeeMapping;
public IBZEmployeeDTO permissionDTO=new IBZEmployeeDTO();
@PreAuthorize("hasPermission(#ibzemployee_id,'Remove',{this.getEntity(),'Sql'})")
@PreAuthorize("hasPermission(#ibzemployee_id,'Remove',{'Sql',this.ibzemployeeMapping,this.permissionDTO})")
@ApiOperation(value = "Remove", tags = {"IBZEmployee" }, notes = "Remove")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzemployees/{ibzemployee_id}")
@Transactional
......@@ -73,6 +75,7 @@ public class IBZEmployeeResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-InitPwd-all')")
@ApiOperation(value = "初始化密码", tags = {"IBZEmployee" }, notes = "初始化密码")
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/{ibzemployee_id}/initpwd")
@Transactional
......@@ -86,7 +89,7 @@ public class IBZEmployeeResource {
@PreAuthorize("hasPermission('','Create',{this.getEntity(),'Sql'})")
@PreAuthorize("hasPermission('','Create',{'Sql',this.ibzemployeeMapping,#ibzemployeedto})")
@ApiOperation(value = "Create", tags = {"IBZEmployee" }, notes = "Create")
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees")
@Transactional
......@@ -96,7 +99,7 @@ public class IBZEmployeeResource {
IBZEmployeeDTO dto = ibzemployeeMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission('','Create',{this.getEntity(),'Sql'})")
@ApiOperation(value = "createBatch", tags = {"IBZEmployee" }, notes = "createBatch")
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
......@@ -107,6 +110,7 @@ public class IBZEmployeeResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-CheckKey-all')")
@ApiOperation(value = "CheckKey", tags = {"IBZEmployee" }, notes = "CheckKey")
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody IBZEmployeeDTO ibzemployeedto) {
......@@ -116,7 +120,7 @@ public class IBZEmployeeResource {
@PreAuthorize("hasPermission(#ibzemployee_id,'Update',{this.getEntity(),'Sql'})")
@PreAuthorize("hasPermission(#ibzemployee_id,'Update',{'Sql',this.ibzemployeeMapping,#ibzemployeedto})")
@ApiOperation(value = "Update", tags = {"IBZEmployee" }, notes = "Update")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzemployees/{ibzemployee_id}")
@Transactional
......@@ -128,7 +132,6 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(#ibzemployee_id,'Update',{this.getEntity(),'Sql'})")
@ApiOperation(value = "UpdateBatch", tags = {"IBZEmployee" }, notes = "UpdateBatch")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzemployees/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
......@@ -139,6 +142,7 @@ public class IBZEmployeeResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Save-all')")
@ApiOperation(value = "Save", tags = {"IBZEmployee" }, notes = "Save")
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/save")
public ResponseEntity<Boolean> save(@RequestBody IBZEmployeeDTO ibzemployeedto) {
......@@ -155,7 +159,7 @@ public class IBZEmployeeResource {
@PreAuthorize("hasPermission(#ibzemployee_id,'Get',{this.getEntity(),'Sql'})")
@PreAuthorize("hasPermission(#ibzemployee_id,'Get',{'Sql',this.ibzemployeeMapping,this.permissionDTO})")
@ApiOperation(value = "Get", tags = {"IBZEmployee" }, notes = "Get")
@RequestMapping(method = RequestMethod.GET, value = "/ibzemployees/{ibzemployee_id}")
public ResponseEntity<IBZEmployeeDTO> get(@PathVariable("ibzemployee_id") String ibzemployee_id) {
......@@ -167,13 +171,14 @@ public class IBZEmployeeResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-GetDraft-all')")
@ApiOperation(value = "GetDraft", tags = {"IBZEmployee" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/ibzemployees/getdraft")
public ResponseEntity<IBZEmployeeDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeMapping.toDto(ibzemployeeService.getDraft(new IBZEmployee())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Default-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Default-all')")
@ApiOperation(value = "fetchDEFAULT", tags = {"IBZEmployee" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/ibzemployees/fetchdefault")
public ResponseEntity<List<IBZEmployeeDTO>> fetchDefault(IBZEmployeeSearchContext context) {
......@@ -186,7 +191,7 @@ public class IBZEmployeeResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Default-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Default-all')")
@ApiOperation(value = "searchDEFAULT", tags = {"IBZEmployee" } ,notes = "searchDEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/ibzemployees/searchdefault")
public ResponseEntity<Page<IBZEmployeeDTO>> searchDefault(@RequestBody IBZEmployeeSearchContext context) {
......@@ -197,6 +202,7 @@ public class IBZEmployeeResource {
//@PreAuthorize("hasPermission(#ibzemployee_id,'Remove',{'Sql',this.ibzemployeeMapping,this.permissionDTO})")
@ApiOperation(value = "RemoveByIBZDepartment", tags = {"IBZEmployee" }, notes = "RemoveByIBZDepartment")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}")
@Transactional
......@@ -211,6 +217,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-InitPwd-all')")
@ApiOperation(value = "初始化密码ByIBZDepartment", tags = {"IBZEmployee" }, notes = "初始化密码ByIBZDepartment")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployeeuserid}/initpwd")
@Transactional
......@@ -222,6 +229,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeedto);
}
//@PreAuthorize("hasPermission('','Create',{'Sql',this.ibzemployeeMapping,#ibzemployeedto})")
@ApiOperation(value = "CreateByIBZDepartment", tags = {"IBZEmployee" }, notes = "CreateByIBZDepartment")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees")
@Transactional
......@@ -244,12 +252,14 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-CheckKey-all')")
@ApiOperation(value = "CheckKeyByIBZDepartment", tags = {"IBZEmployee" }, notes = "CheckKeyByIBZDepartment")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/checkkey")
public ResponseEntity<Boolean> checkKeyByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.checkKey(ibzemployeeMapping.toDomain(ibzemployeedto)));
}
//@PreAuthorize("hasPermission(#ibzemployee_id,'Update',{'Sql',this.ibzemployeeMapping,#ibzemployeedto})")
@ApiOperation(value = "UpdateByIBZDepartment", tags = {"IBZEmployee" }, notes = "UpdateByIBZDepartment")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}")
@Transactional
......@@ -273,6 +283,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Save-all')")
@ApiOperation(value = "SaveByIBZDepartment", tags = {"IBZEmployee" }, notes = "SaveByIBZDepartment")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/save")
public ResponseEntity<Boolean> saveByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
......@@ -292,6 +303,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasPermission(#ibzemployee_id,'Get',{'Sql',this.ibzemployeeMapping,this.permissionDTO})")
@ApiOperation(value = "GetByIBZDepartment", tags = {"IBZEmployee" }, notes = "GetByIBZDepartment")
@RequestMapping(method = RequestMethod.GET, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}")
public ResponseEntity<IBZEmployeeDTO> getByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id) {
......@@ -300,6 +312,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-GetDraft-all')")
@ApiOperation(value = "GetDraftByIBZDepartment", tags = {"IBZEmployee" }, notes = "GetDraftByIBZDepartment")
@RequestMapping(method = RequestMethod.GET, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/getdraft")
public ResponseEntity<IBZEmployeeDTO> getDraftByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id) {
......@@ -308,6 +321,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeMapping.toDto(ibzemployeeService.getDraft(domain)));
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Default-all')")
@ApiOperation(value = "fetchDEFAULTByIBZDepartment", tags = {"IBZEmployee" } ,notes = "fetchDEFAULTByIBZDepartment")
@RequestMapping(method= RequestMethod.GET , value="/ibzdepartments/{ibzdepartment_id}/ibzemployees/fetchdefault")
public ResponseEntity<List<IBZEmployeeDTO>> fetchIBZEmployeeDefaultByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id,IBZEmployeeSearchContext context) {
......@@ -321,6 +335,7 @@ public class IBZEmployeeResource {
.body(list);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Default-all')")
@ApiOperation(value = "searchDEFAULTByIBZDepartment", tags = {"IBZEmployee" } ,notes = "searchDEFAULTByIBZDepartment")
@RequestMapping(method= RequestMethod.POST , value="/ibzdepartments/{ibzdepartment_id}/ibzemployees/searchdefault")
public ResponseEntity<Page<IBZEmployeeDTO>> searchIBZEmployeeDefaultByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeSearchContext context) {
......@@ -332,6 +347,7 @@ public class IBZEmployeeResource {
//@PreAuthorize("hasPermission(#ibzemployee_id,'Remove',{'Sql',this.ibzemployeeMapping,this.permissionDTO})")
@ApiOperation(value = "RemoveByIBZOrganization", tags = {"IBZEmployee" }, notes = "RemoveByIBZOrganization")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}")
@Transactional
......@@ -346,6 +362,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-InitPwd-all')")
@ApiOperation(value = "初始化密码ByIBZOrganization", tags = {"IBZEmployee" }, notes = "初始化密码ByIBZOrganization")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployeeuserid}/initpwd")
@Transactional
......@@ -357,6 +374,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeedto);
}
//@PreAuthorize("hasPermission('','Create',{'Sql',this.ibzemployeeMapping,#ibzemployeedto})")
@ApiOperation(value = "CreateByIBZOrganization", tags = {"IBZEmployee" }, notes = "CreateByIBZOrganization")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees")
@Transactional
......@@ -379,12 +397,14 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-CheckKey-all')")
@ApiOperation(value = "CheckKeyByIBZOrganization", tags = {"IBZEmployee" }, notes = "CheckKeyByIBZOrganization")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/checkkey")
public ResponseEntity<Boolean> checkKeyByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.checkKey(ibzemployeeMapping.toDomain(ibzemployeedto)));
}
//@PreAuthorize("hasPermission(#ibzemployee_id,'Update',{'Sql',this.ibzemployeeMapping,#ibzemployeedto})")
@ApiOperation(value = "UpdateByIBZOrganization", tags = {"IBZEmployee" }, notes = "UpdateByIBZOrganization")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}")
@Transactional
......@@ -408,6 +428,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Save-all')")
@ApiOperation(value = "SaveByIBZOrganization", tags = {"IBZEmployee" }, notes = "SaveByIBZOrganization")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/save")
public ResponseEntity<Boolean> saveByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
......@@ -427,6 +448,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasPermission(#ibzemployee_id,'Get',{'Sql',this.ibzemployeeMapping,this.permissionDTO})")
@ApiOperation(value = "GetByIBZOrganization", tags = {"IBZEmployee" }, notes = "GetByIBZOrganization")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}")
public ResponseEntity<IBZEmployeeDTO> getByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id) {
......@@ -435,6 +457,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-GetDraft-all')")
@ApiOperation(value = "GetDraftByIBZOrganization", tags = {"IBZEmployee" }, notes = "GetDraftByIBZOrganization")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/getdraft")
public ResponseEntity<IBZEmployeeDTO> getDraftByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id) {
......@@ -443,6 +466,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeMapping.toDto(ibzemployeeService.getDraft(domain)));
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Default-all')")
@ApiOperation(value = "fetchDEFAULTByIBZOrganization", tags = {"IBZEmployee" } ,notes = "fetchDEFAULTByIBZOrganization")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/{ibzorganization_id}/ibzemployees/fetchdefault")
public ResponseEntity<List<IBZEmployeeDTO>> fetchIBZEmployeeDefaultByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id,IBZEmployeeSearchContext context) {
......@@ -456,6 +480,7 @@ public class IBZEmployeeResource {
.body(list);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Default-all')")
@ApiOperation(value = "searchDEFAULTByIBZOrganization", tags = {"IBZEmployee" } ,notes = "searchDEFAULTByIBZOrganization")
@RequestMapping(method= RequestMethod.POST , value="/ibzorganizations/{ibzorganization_id}/ibzemployees/searchdefault")
public ResponseEntity<Page<IBZEmployeeDTO>> searchIBZEmployeeDefaultByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZEmployeeSearchContext context) {
......@@ -468,6 +493,7 @@ public class IBZEmployeeResource {
//@PreAuthorize("hasPermission(#ibzemployee_id,'Remove',{'Sql',this.ibzemployeeMapping,this.permissionDTO})")
@ApiOperation(value = "RemoveByIBZOrganizationIBZDepartment", tags = {"IBZEmployee" }, notes = "RemoveByIBZOrganizationIBZDepartment")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}")
@Transactional
......@@ -482,6 +508,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-InitPwd-all')")
@ApiOperation(value = "初始化密码ByIBZOrganizationIBZDepartment", tags = {"IBZEmployee" }, notes = "初始化密码ByIBZOrganizationIBZDepartment")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployeeuserid}/initpwd")
@Transactional
......@@ -493,6 +520,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeedto);
}
//@PreAuthorize("hasPermission('','Create',{'Sql',this.ibzemployeeMapping,#ibzemployeedto})")
@ApiOperation(value = "CreateByIBZOrganizationIBZDepartment", tags = {"IBZEmployee" }, notes = "CreateByIBZOrganizationIBZDepartment")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees")
@Transactional
......@@ -515,12 +543,14 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-CheckKey-all')")
@ApiOperation(value = "CheckKeyByIBZOrganizationIBZDepartment", tags = {"IBZEmployee" }, notes = "CheckKeyByIBZOrganizationIBZDepartment")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/checkkey")
public ResponseEntity<Boolean> checkKeyByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.checkKey(ibzemployeeMapping.toDomain(ibzemployeedto)));
}
//@PreAuthorize("hasPermission(#ibzemployee_id,'Update',{'Sql',this.ibzemployeeMapping,#ibzemployeedto})")
@ApiOperation(value = "UpdateByIBZOrganizationIBZDepartment", tags = {"IBZEmployee" }, notes = "UpdateByIBZOrganizationIBZDepartment")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}")
@Transactional
......@@ -544,6 +574,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Save-all')")
@ApiOperation(value = "SaveByIBZOrganizationIBZDepartment", tags = {"IBZEmployee" }, notes = "SaveByIBZOrganizationIBZDepartment")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/save")
public ResponseEntity<Boolean> saveByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
......@@ -563,6 +594,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
//@PreAuthorize("hasPermission(#ibzemployee_id,'Get',{'Sql',this.ibzemployeeMapping,this.permissionDTO})")
@ApiOperation(value = "GetByIBZOrganizationIBZDepartment", tags = {"IBZEmployee" }, notes = "GetByIBZOrganizationIBZDepartment")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}")
public ResponseEntity<IBZEmployeeDTO> getByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id) {
......@@ -571,6 +603,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-GetDraft-all')")
@ApiOperation(value = "GetDraftByIBZOrganizationIBZDepartment", tags = {"IBZEmployee" }, notes = "GetDraftByIBZOrganizationIBZDepartment")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/getdraft")
public ResponseEntity<IBZEmployeeDTO> getDraftByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id) {
......@@ -579,6 +612,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeMapping.toDto(ibzemployeeService.getDraft(domain)));
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Default-all')")
@ApiOperation(value = "fetchDEFAULTByIBZOrganizationIBZDepartment", tags = {"IBZEmployee" } ,notes = "fetchDEFAULTByIBZOrganizationIBZDepartment")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/fetchdefault")
public ResponseEntity<List<IBZEmployeeDTO>> fetchIBZEmployeeDefaultByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id,IBZEmployeeSearchContext context) {
......@@ -592,6 +626,7 @@ public class IBZEmployeeResource {
.body(list);
}
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Default-all')")
@ApiOperation(value = "searchDEFAULTByIBZOrganizationIBZDepartment", tags = {"IBZEmployee" } ,notes = "searchDEFAULTByIBZOrganizationIBZDepartment")
@RequestMapping(method= RequestMethod.POST , value="/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/searchdefault")
public ResponseEntity<Page<IBZEmployeeDTO>> searchIBZEmployeeDefaultByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeSearchContext context) {
......@@ -602,12 +637,6 @@ public class IBZEmployeeResource {
}
/**
* 用户权限校验
* @return
*/
public IBZEmployee getEntity(){
return new IBZEmployee();
}
}
......@@ -50,11 +50,14 @@ public class IBZOrganizationResource {
@Autowired
@Lazy
private IBZOrganizationMapping ibzorganizationMapping;
public IBZOrganizationMapping ibzorganizationMapping;
public IBZOrganizationDTO permissionDTO=new IBZOrganizationDTO();
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-CheckKey-all')")
@ApiOperation(value = "CheckKey", tags = {"IBZOrganization" }, notes = "CheckKey")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody IBZOrganizationDTO ibzorganizationdto) {
......@@ -64,7 +67,7 @@ public class IBZOrganizationResource {
@PreAuthorize("hasPermission(#ibzorganization_id,'Update',{this.getEntity(),'Sql'})")
@PreAuthorize("hasPermission(#ibzorganization_id,'Update',{'Sql',this.ibzorganizationMapping,#ibzorganizationdto})")
@ApiOperation(value = "Update", tags = {"IBZOrganization" }, notes = "Update")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}")
@Transactional
......@@ -76,7 +79,6 @@ public class IBZOrganizationResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(#ibzorganization_id,'Update',{this.getEntity(),'Sql'})")
@ApiOperation(value = "UpdateBatch", tags = {"IBZOrganization" }, notes = "UpdateBatch")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<IBZOrganizationDTO> ibzorganizationdtos) {
......@@ -87,7 +89,7 @@ public class IBZOrganizationResource {
@PreAuthorize("hasPermission('','Create',{this.getEntity(),'Sql'})")
@PreAuthorize("hasPermission('','Create',{'Sql',this.ibzorganizationMapping,#ibzorganizationdto})")
@ApiOperation(value = "Create", tags = {"IBZOrganization" }, notes = "Create")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations")
@Transactional
......@@ -97,7 +99,7 @@ public class IBZOrganizationResource {
IBZOrganizationDTO dto = ibzorganizationMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission('','Create',{this.getEntity(),'Sql'})")
@ApiOperation(value = "createBatch", tags = {"IBZOrganization" }, notes = "createBatch")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<IBZOrganizationDTO> ibzorganizationdtos) {
......@@ -108,6 +110,7 @@ public class IBZOrganizationResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-Save-all')")
@ApiOperation(value = "Save", tags = {"IBZOrganization" }, notes = "Save")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/save")
public ResponseEntity<Boolean> save(@RequestBody IBZOrganizationDTO ibzorganizationdto) {
......@@ -124,7 +127,7 @@ public class IBZOrganizationResource {
@PreAuthorize("hasPermission(#ibzorganization_id,'Remove',{this.getEntity(),'Sql'})")
@PreAuthorize("hasPermission(#ibzorganization_id,'Remove',{'Sql',this.ibzorganizationMapping,this.permissionDTO})")
@ApiOperation(value = "Remove", tags = {"IBZOrganization" }, notes = "Remove")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}")
@Transactional
......@@ -142,7 +145,7 @@ public class IBZOrganizationResource {
@PreAuthorize("hasPermission(#ibzorganization_id,'Get',{this.getEntity(),'Sql'})")
@PreAuthorize("hasPermission(#ibzorganization_id,'Get',{'Sql',this.ibzorganizationMapping,this.permissionDTO})")
@ApiOperation(value = "Get", tags = {"IBZOrganization" }, notes = "Get")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}")
public ResponseEntity<IBZOrganizationDTO> get(@PathVariable("ibzorganization_id") String ibzorganization_id) {
......@@ -154,13 +157,14 @@ public class IBZOrganizationResource {
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-GetDraft-all')")
@ApiOperation(value = "GetDraft", tags = {"IBZOrganization" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/getdraft")
public ResponseEntity<IBZOrganizationDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(ibzorganizationMapping.toDto(ibzorganizationService.getDraft(new IBZOrganization())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-SelectSOrg-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-SelectSOrg-all')")
@ApiOperation(value = "fetch查询下级单位", tags = {"IBZOrganization" } ,notes = "fetch查询下级单位")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/fetchselectsorg")
public ResponseEntity<List<IBZOrganizationDTO>> fetchSelectSOrg(IBZOrganizationSearchContext context) {
......@@ -173,7 +177,7 @@ public class IBZOrganizationResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-SelectSOrg-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-SelectSOrg-all')")
@ApiOperation(value = "search查询下级单位", tags = {"IBZOrganization" } ,notes = "search查询下级单位")
@RequestMapping(method= RequestMethod.POST , value="/ibzorganizations/searchselectsorg")
public ResponseEntity<Page<IBZOrganizationDTO>> searchSelectSOrg(@RequestBody IBZOrganizationSearchContext context) {
......@@ -182,7 +186,7 @@ public class IBZOrganizationResource {
.body(new PageImpl(ibzorganizationMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-SelectPOrg-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-SelectPOrg-all')")
@ApiOperation(value = "fetch查询上级单位", tags = {"IBZOrganization" } ,notes = "fetch查询上级单位")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/fetchselectporg")
public ResponseEntity<List<IBZOrganizationDTO>> fetchSelectPOrg(IBZOrganizationSearchContext context) {
......@@ -195,7 +199,7 @@ public class IBZOrganizationResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-SelectPOrg-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-SelectPOrg-all')")
@ApiOperation(value = "search查询上级单位", tags = {"IBZOrganization" } ,notes = "search查询上级单位")
@RequestMapping(method= RequestMethod.POST , value="/ibzorganizations/searchselectporg")
public ResponseEntity<Page<IBZOrganizationDTO>> searchSelectPOrg(@RequestBody IBZOrganizationSearchContext context) {
......@@ -204,7 +208,7 @@ public class IBZOrganizationResource {
.body(new PageImpl(ibzorganizationMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-Default-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-Default-all')")
@ApiOperation(value = "fetchDEFAULT", tags = {"IBZOrganization" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/fetchdefault")
public ResponseEntity<List<IBZOrganizationDTO>> fetchDefault(IBZOrganizationSearchContext context) {
......@@ -217,7 +221,7 @@ public class IBZOrganizationResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-Default-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-Default-all')")
@ApiOperation(value = "searchDEFAULT", tags = {"IBZOrganization" } ,notes = "searchDEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/ibzorganizations/searchdefault")
public ResponseEntity<Page<IBZOrganizationDTO>> searchDefault(@RequestBody IBZOrganizationSearchContext context) {
......@@ -227,12 +231,6 @@ public class IBZOrganizationResource {
}
/**
* 用户权限校验
* @return
*/
public IBZOrganization getEntity(){
return new IBZOrganization();
}
}
......@@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mongodb.QueryBuilder;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.domain.DTOBase;
import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.domain.MappingBase;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.filter.QueryBuildContext;
import cn.ibizlab.util.filter.QueryWrapperContext;
......@@ -72,8 +74,10 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
return true;
List paramList = (ArrayList) params;
EntityBase entity = (EntityBase) paramList.get(0);
String deStorageMode= (String) paramList.get(1);
String deStorageMode= (String) paramList.get(0);
MappingBase mappingBase= (MappingBase) paramList.get(1);
DTOBase dtoBase = (DTOBase) paramList.get(2);
EntityBase entity = (EntityBase) mappingBase.toDomain(dtoBase);
if (StringUtils.isEmpty(entity))
return false;
......@@ -82,20 +86,19 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
JSONObject permissionList=userPermission.getJSONObject("entities");
String entityName = entity.getClass().getSimpleName();
//拥有全部数据访问权限时,则跳过权限检查
if(isAllData(permissionList,entityName,action)){
return true;
}
//检查是否有操作权限[create.update.delete.read]
if(!validDEActionHasPermission(permissionList,entityName,action)){
return false;
}
if(action.equalsIgnoreCase("create")){
return validDEActionHasPermission(permissionList,entityName,action);
return createActionPermissionValid(permissionList,entity, action);
}
else{
//拥有全部数据访问权限时,则跳过权限检查
if(isAllData(permissionList,entityName,action)){
return true;
}
//检查是否有操作权限[create.update.delete.read]
if(!validDEActionHasPermission(permissionList,entityName,action)){
return false;
}
//检查是否有数据权限
return deActionPermissionValidRouter(deStorageMode, entity , action , srfKey, permissionList);
return otherActionPermissionValidRouter(deStorageMode, entity , action , srfKey, permissionList);
}
}
......@@ -113,7 +116,10 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
if(!permissionList.containsKey(entityName))
return false;
JSONObject entity=permissionList.getJSONObject(entityName);
if(entity.containsKey(action) && entity.getJSONArray(action).contains("ALL"))
if(!entity.containsKey(DEActionType))
return false;
JSONObject dataRange=entity.getJSONObject(DEActionType);//获取实体行为对应的数据范围
if(dataRange.containsKey(action) && dataRange.getJSONArray(action).contains("all"))
return true;
return false;
......@@ -144,6 +150,81 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
return hasPermission;
}
/**
* 新建行为校验
* @param permissionList
* @param entity
* @param action
* @return
*/
private boolean createActionPermissionValid(JSONObject permissionList,EntityBase entity, String action){
Map<String,String> permissionField=getPermissionField(entity);//获取组织、部门预置属性
String keyField=permissionField.get(keyFieldTag);
if(StringUtils.isEmpty(keyField)){
throw new RuntimeException("权限校验失败,请检查当前实体中是否已经配置主键属性!");
}
//获取权限表达式[全部数据、本单位、本部门等]
JSONObject entityObj=permissionList.getJSONObject(entity.getClass().getSimpleName());//获取实体
JSONObject permissionType= entityObj.getJSONObject(DEActionType);
JSONArray dataRangeList=permissionType.getJSONArray(action);//行为:read;insert...
if(dataRangeList.size()==0)
return false;
boolean isCreate=true;
String orgField=permissionField.get("orgfield");
String orgDeptField=permissionField.get("orgsecfield");
String createManField=permissionField.get("createmanfield");
AuthenticationUser authenticationUser = AuthenticationUser.getAuthenticationUser();
Map<String, Set<String>> userInfo = authenticationUser.getOrgInfo();
Set<String> orgParent = userInfo.get("parentorg");
Set<String> orgChild = userInfo.get("suborg");
Set<String> orgDeptParent = userInfo.get("parentdept");
Set<String> orgDeptChild = userInfo.get("subdept");
Object orgFieldValue=entity.get(orgField);
Object orgDeptFieldValue=entity.get(orgDeptField);
Object crateManFieldValue=entity.get(createManField);
Set<String> userOrg = new HashSet<>();
Set<String> userOrgDept = new HashSet<>();
for(int a=0;a<dataRangeList.size();a++){
String permissionCond=dataRangeList.getString(a);//权限配置条件
if(permissionCond.equals("curorg")){ //本单位
userOrg.add(authenticationUser.getOrgid());
}
else if(permissionCond.equals("porg")){//上级单位
userOrg.addAll(orgParent);
}
else if(permissionCond.equals("sorg")){//下级单位
userOrg.addAll(orgChild);
}
else if(permissionCond.equals("curorgdept")){//本部门
userOrgDept.add(authenticationUser.getMdeptid());
}
else if(permissionCond.equals("porgdept")){//上级部门
userOrgDept.addAll(orgDeptParent);
}
else if(permissionCond.equals("sorgdept")){//下级部门
userOrgDept.addAll(orgDeptChild);
}
}
if(!ObjectUtils.isEmpty(orgFieldValue) && !userOrg.contains(orgFieldValue)){
return false;
}
if(!ObjectUtils.isEmpty(orgDeptFieldValue) && !userOrgDept.contains(orgDeptFieldValue)){
return false;
}
if(!ObjectUtils.isEmpty(crateManFieldValue) && !crateManFieldValue.equals(authenticationUser.getUserid())){
return false;
}
return isCreate;
}
/**
* 根据实体存储模式,进行鉴权
......@@ -154,7 +235,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
* @param permissionList
* @return
*/
private boolean deActionPermissionValidRouter(String deStorageMode, EntityBase entity , String action , Object srfKey , JSONObject permissionList){
private boolean otherActionPermissionValidRouter(String deStorageMode, EntityBase entity , String action , Object srfKey , JSONObject permissionList){
if(deStorageMode.equalsIgnoreCase("sql")){
return sqlPermissionValid(entity , action , srfKey, permissionList);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册