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

ibiz4j 发布系统代码

上级 3bfd3f66
## v7.0.0-alpha.5 [2020-5-21]
### Bug修复
修复表格视图搜索placeholder显示为搜索字段
修复表单嵌表单分页异常
修复门户视图操作栏标题
修复看板部件高度自动撑
修复表单分组,界面行为组不显示
修复表格操作列数据异常
### 功能新增及优化
#### 模板
支持拷贝功能
支持实体甘特图视图
支持面板项隐藏表单项
支持表格列最小宽度和操作列样式支持
支持列表项、面板代码表转化
#### 基础文件
支持列表项、面板代码表转化
修复表单分组,界面行为组不显示
## v7.0.0-alpha.4 [2020-5-14] ## v7.0.0-alpha.4 [2020-5-14]
### Bug修复 ### Bug修复
......
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
"element-ui": "^2.13.0", "element-ui": "^2.13.0",
"file-saver": "^2.0.2", "file-saver": "^2.0.2",
"font-awesome": "^4.7.0", "font-awesome": "^4.7.0",
"ibiz-gantt-elastic": "^1.0.8", "ibiz-gantt-elastic": "^1.0.12",
"ibiz-vue-lib": "^0.1.4",
"interactjs": "^1.9.4", "interactjs": "^1.9.4",
"moment": "^2.24.0", "moment": "^2.24.0",
"path-to-regexp": "^6.1.0", "path-to-regexp": "^6.1.0",
......
...@@ -71,6 +71,10 @@ import AppUploadFileInfo from './components/app-upload-file-info/app-upload-file ...@@ -71,6 +71,10 @@ import AppUploadFileInfo from './components/app-upload-file-info/app-upload-file
import ContextMenu from './components/context-menu/context-menu' import ContextMenu from './components/context-menu/context-menu'
import AppColumnFormat from './components/app-column-format/app-column-format.vue' import AppColumnFormat from './components/app-column-format/app-column-format.vue'
import AppQuickGroup from './components/app-quick-group/app-quick-group.vue' import AppQuickGroup from './components/app-quick-group/app-quick-group.vue'
import AppOrgSelect from './components/app-org-select/app-org-select.vue'
import IBizGroupSelect from './components/ibiz-group-select/ibiz-group-select.vue'
import IBizGroupPicker from './components/ibiz-group-picker/ibiz-group-picker.vue'
// 全局挂载UI实体服务注册中心 // 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister; window['uiServiceRegister'] = uiServiceRegister;
...@@ -151,5 +155,8 @@ export const AppComponents = { ...@@ -151,5 +155,8 @@ export const AppComponents = {
v.component('context-menu',ContextMenu); v.component('context-menu',ContextMenu);
v.component('app-column-format',AppColumnFormat); v.component('app-column-format',AppColumnFormat);
v.component('app-quick-group',AppQuickGroup); v.component('app-quick-group',AppQuickGroup);
v.component('app-org-select',AppOrgSelect);
v.component('ibiz-group-select',IBizGroupSelect);
v.component('ibiz-group-picker',IBizGroupPicker);
}, },
}; };
\ No newline at end of file
.app-org-select {
width: 100%;
}
\ No newline at end of file
<template>
<div class="app-org-select">
<ibiz-select-tree :NodesData="NodesData" v-model="selectTreeValue" :multiple="false" @select="treeSelectChange"></ibiz-select-tree>
</div>
</template>
<script lang = 'ts'>
import { Vue, Component, Prop, Watch } from "vue-property-decorator";
import { Http } from '@/utils';
@Component({})
export default class AppOrgSelect extends Vue {
/**
* 表单数据
*
* @memberof AppOrgSelect
*/
@Prop() public data!:any;
/**
* 上下文
*
* @memberof AppOrgSelect
*/
@Prop() public context!:any;
/**
* 填充对象
*
* @memberof AppOrgSelect
*/
@Prop() public fillMap:any;
/**
* 过滤项
*
* @memberof AppOrgSelect
*/
@Prop() public filter?:string;
/**
* 是否多选
*
* @memberof AppOrgSelect
*/
@Prop({default:false}) public multiple?:boolean;
/**
* 监听表单数据变化
*
* @memberof AppOrgSelect
*/
@Watch('data',{immediate:true,deep:true})
onDataChange(newVal: any, oldVal: any) {
if(newVal){
this.computedSelectedData();
if(this.filter){
let tempFilterValue:any = this.initBasicData();
// filter值变化才去请求数据
if(tempFilterValue && (this.copyFilterValue !== tempFilterValue)){
this.loadTreeData(this.orgDataUrl.replace('${orgid}',tempFilterValue));
this.copyFilterValue = tempFilterValue;
}
}
}
}
/**
* 查询单位路径
*
* @memberof AppOrgSelect
*/
public orgDataUrl:string ="/ibzorganizations/${orgid}/suborg/picker";
/**
* 选择值
*
* @memberof AppOrgSelect
*/
public selectTreeValue:any = "";
/**
* 树节点数据
*
* @memberof AppOrgSelect
*/
public NodesData:any = [];
/**
* 备份过滤值
*
* @memberof AppOrgSelect
*/
public copyFilterValue:any;
/**
* vue生命周期
*
* @memberof AppOrgSelect
*/
public created(){
if(!this.filter){
this.loadTreeData(this.orgDataUrl.replace('${orgid}','alls'));
}
}
/**
* 加载树数据
*
* @memberof AppOrgSelect
*/
public initBasicData(){
// 计算出过滤值
if(this.filter){
if(this.data && this.data[this.filter]){
return this.data[this.filter];
}else if(this.context && this.context[this.filter]){
return this.context[this.filter];
}else{
return null;
}
}
}
/**
* 计算选中值
*
* @memberof AppOrgSelect
*/
public computedSelectedData(){
// 单选
if(!this.multiple){
if(this.fillMap && Object.keys(this.fillMap).length >0){
let templateValue = {};
Object.keys(this.fillMap).forEach((item:any) =>{
if(this.data && this.data[this.fillMap[item]]){
Object.assign(templateValue,{[item]:this.data[this.fillMap[item]]});
}
})
this.selectTreeValue = JSON.stringify([templateValue]);
}
}else{
// 多选
}
}
/**
* 加载树数据
*
* @memberof AppOrgSelect
*/
public loadTreeData(requestUrl:string){
Http.getInstance().get(requestUrl).then((res:any) =>{
if(!res.status && res.status !== 200){
console.error("加载数据失败");
return;
}
this.NodesData = res.data;
console.log(this.NodesData);
})
}
/**
* 树选择触发事件
*
* @memberof AppOrgSelect
*/
public treeSelectChange($event:any){
// 多选
if(this.multiple){
}else{
// 单选
if($event){
const tempValue:any = JSON.parse($event)[0];
if(this.fillMap && Object.keys(this.fillMap).length >0){
Object.keys(this.fillMap).forEach((item:any) =>{
this.emitValue(this.fillMap[item],tempValue[item]);
})
}
}else{
if(this.fillMap && Object.keys(this.fillMap).length >0){
Object.keys(this.fillMap).forEach((item:any) =>{
this.emitValue(this.fillMap[item],null);
})
}
}
}
}
/**
* 抛值
*
* @memberof AppOrgSelect
*/
public emitValue(name:string,value:any){
this.$emit('formitemvaluechange',{name:name,value:value});
}
}
</script>
<style lang="less">
@import "./app-org-select.less";
</style>
\ No newline at end of file
<template>
<div class="ibiz-group-picker">
<div class="ibiz-group-container">
<div v-if="showTree" class="ibiz-group-tree">
<ibiz-select-tree :NodesData="treeItems" v-model="treeSelectVal" :isShowSearchBar="false" @select="treeSelect"></ibiz-select-tree>
</div>
<div class="ibiz-group-content">
<ibiz-group-card :data="cardItems" text="label" value="id" groupName="group" :multiple="multiple" :defaultSelect="cardSelctVal" @select="groupSelect"></ibiz-group-card>
</div>
</div>
<div class="ibiz-group-footer">
<el-button size="small" type="primary" @click="onOK">确认</el-button>
<el-button size="small" @click="onCancel">取消</el-button>
</div>
</div>
</template>
<script lang="ts">
import { Component, Vue, Prop, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
import { Http } from '../../utils';
@Component({})
export default class IBizGroupPicker extends Vue {
/**
* 视图上下文参数
*
* @type {*}
* @memberof IBizGroupPicker
*/
@Prop() viewdata: any;
/**
* 视图参数
*
* @type {*}
* @memberof IBizGroupPicker
*/
@Prop() viewparam: any;
/**
* 多选
*
* @type {*}
* @memberof IBizGroupPicker
*/
protected multiple: boolean = false;
/**
* 树数据集
*
* @type {*}
* @memberof IBizGroupPicker
*/
protected treeItems: any[] = [];
/**
* 分组表数据集
*
* @type {*}
* @memberof IBizGroupPicker
*/
protected cardItems: any[] = [];
/**
* 视图上下文参数对象
*
* @type {*}
* @memberof IBizGroupPicker
*/
protected viewData: any;
/**
* 视图参数对象
*
* @type {*}
* @memberof IBizGroupPicker
*/
protected viewParam: any;
/**
* 树选中值
*
* @type {*}
* @memberof IBizGroupPicker
*/
protected treeSelectVal: string = '';
/**
* 分组表选中集合
*
* @type {*}
* @memberof IBizGroupPicker
*/
protected cardSelctVal: any = [];
/**
* 数据选中集合
*
* @type {*}
* @memberof IBizGroupPicker
*/
protected selects: any[] = [];
/**
* 是否显示树
*
* @type {*}
* @memberof IBizGroupPicker
*/
get showTree() {
if(!Object.is(this.viewData.srforgid, this.viewParam.srforgid)) {
return true;
}
}
/**
* 生命周期
*
* @type {*}
* @memberof IBizGroupPicker
*/
public created() {
if(!this.viewdata || !this.viewparam) {
return;
}
this.viewData = JSON.parse(this.viewdata);
this.viewParam = JSON.parse(this.viewparam);
this.multiple = this.viewParam.multiple;
if (this.viewParam.selects) {
this.cardSelctVal = this.viewParam.selects;
}
this.load();
}
/**
* 加载数据
*
* @type {*}
* @memberof IBizGroupPicker
*/
public load() {
if(this.showTree) {
this.loadTree();
} else {
this.loadGroupData(this.viewParam.srforgid);
}
}
/**
* 加载树数据
*
* @type {*}
* @memberof IBizGroupPicker
*/
public loadTree() {
let get = Http.getInstance().get(`/ibzorganizations/450000/suborg/ibzdepartments/picker`, true);
get.then((response: any) => {
if(response.status === 200) {
this.treeItems = response.data;
}
}).catch((error: any) => {
console.log(error)
})
}
/**
* 加载分组表数据
*
* @type {*}
* @memberof IBizGroupPicker
*/
public loadGroupData(key: string) {
let get = Http.getInstance().get(`/ibzorganizations/${key}/ibzemployees/picker`, true);
get.then((response: any) => {
if(response.status === 200) {
this.cardItems = response.data;
}
}).catch((error: any) => {
console.log(error)
})
}
/**
* 树选中
*
* @type {*}
* @memberof IBizGroupPicker
*/
public treeSelect(event: any) {
if(!event || JSON.parse(event).length == 0) {
return;
}
const items: any = JSON.parse(event);
this.loadGroupData(items[0].id);
}
/**
* 分组表选中
*
* @type {*}
* @memberof IBizGroupPicker
*/
public groupSelect(event: any) {
// if (!event || !event.selects) {
// return;
// }
// if(!this.multiple) {
// this.selects = [];
// }
// if(event.rselect) {
// let index: number = this.selects.findIndex((item: any) => Object.is(event.rselect, item.id));
// if(index >= 0) {
// this.selects.splice(index, 1);
// }
// } else {
// event.selects.forEach((key: string) => {
// let index: number = this.selects.findIndex((item: any) => Object.is(key, item.id));
// if(index >= 0) {
// return;
// }
// let item: any = this.cardItems.find((item: any) => Object.is(key, item.id));
// if (item) {
// this.selects.push(item);
// }
// });
// }
// 测试 start
if(!this.multiple) {
this.selects = [];
}
event.forEach((key: string) => {
let index: number = this.selects.findIndex((item: any) => Object.is(key, item.id));
if(index >= 0) {
return;
}
let item: any = this.cardItems.find((item: any) => Object.is(key, item.id));
if (item) {
this.selects.push(item);
}
});
// 测试 end
}
/**
* 确认
*
* @type {*}
* @memberof IBizGroupPicker
*/
public onOK() {
this.$emit('close', this.selects);
}
/**
* 取消
*
* @type {*}
* @memberof IBizGroupPicker
*/
public onCancel() {
this.$emit('close');
}
}
</script>
<style lang="less">
.ibiz-group-container {
display: flex;
height: calc(100% - 65px);
.ibiz-group-tree {
width: 400px;
border-right: 1px solid #ddd;
padding: 0 10px;
overflow: auto;
height: 100%;
}
.ibiz-group-content {
flex-grow: 1;
padding: 0 10px;
overflow: auto;
height: 100%;
}
}
.ibiz-group-footer {
padding: 16px;
text-align: right;
border-top: 1px solid #ddd;
}
</style>
\ No newline at end of file
<template>
<div class="ibiz-group-select">
<div class="ibiz-group-content">
<span v-if="!multiple">
{{ selectName }}
</span>
<template v-else v-for="(select, index) of selects">
<div :key="index" class="ibiz-group-item">
{{ select.label }}
<i class="el-icon-close" @click="remove(select)"></i>
</div>
</template>
</div>
<div class="ibiz-group-open">
<i class="el-icon-search" @click="openView"></i>
</div>
</div>
</template>
<script lang="ts">
import { Component, Vue, Prop, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
@Component({})
export default class IBizGroupSelect extends Vue {
/**
* 名称标识
*
* @type {*}
* @memberof IBizGroupSelect
*/
@Prop() name!: string;
/**
* 数据接口地址
*
* @type {*}
* @memberof IBizGroupSelect
*/
@Prop() url?: string;
/**
* 多选
*
* @type {*}
* @memberof IBizGroupSelect
*/
@Prop({default: false}) multiple?: boolean;
/**
* 数据对象
*
* @type {*}
* @memberof IBizGroupSelect
*/
@Prop() data: any;
/**
* 过滤属性标识
*
* @type {*}
* @memberof IBizGroupSelect
*/
@Prop({default: 'orgid'}) filter?: string;
/**
* 是否启用
*
* @type {*}
* @memberof IBizGroupSelect
*/
@Prop() disabled?: boolean;
/**
* 值
*
* @type {*}
* @memberof IBizGroupSelect
*/
@Prop() value: any;
/**
* 上下文参数
*
* @type {*}
* @memberof IBizGroupSelect
*/
@Prop() context: any;
/**
* 关联属性
*
* @type {*}
* @memberof IBizGroupSelect
*/
@Prop() valueitem: any;
/**
* 选中项集合
*
* @type {*}
* @memberof IBizGroupSelect
*/
protected selects: any[] = [];
/**
* 值变化
*
* @type {*}
* @memberof IBizGroupSelect
*/
@Watch('value')
onValueChange(newVal: any) {
this.selects = [];
if (newVal) {
let vals: any[] = newVal.split(',');
let vals2: any[] = [];
if(this.valueitem) {
vals2 = this.data[this.valueitem].split(',');
}
vals.forEach((val: string, index: number) => {
this.selects.push({
label: val,
id: vals2.length > 0 ? vals2[index] : null
})
})
}
}
/**
* 单选时选中名称
*
* @type {*}
* @memberof IBizGroupSelect
*/
get selectName() {
if(this.selects.length > 0) {
return this.selects[0].label;
}
}
/**
* 打开选择视图
*
* @type {*}
* @memberof IBizGroupSelect
*/
public openView() {
const view: any = {
viewname: 'ibiz-group-picker',
title: '分组选择'
};
let sels: any = this.selects.map((select: any) => {
return select.id;
})
const context: any = JSON.parse(JSON.stringify(this.context));
const param: any = {};
let orgid: any = this.filter;
Object.assign(param, {
orgid: this.data[orgid],
multiple: this.multiple,
selects: sels
});
let container: Subject<any> = this.$appmodal.openModal(view, context, param);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
this.openViewClose(result);
});
}
/**
* 选择视图关闭
*
* @type {*}
* @memberof IBizGroupSelect
*/
public openViewClose(result: any) {
console.log(result)
this.selects = [];
if (result.datas && result.datas.length > 0) {
result.datas.forEach((data: any) => {
this.selects.push({
id: data.id,
label: data.label
})
});
}
this.setValue()
}
/**
* 数据删除
*
* @type {*}
* @memberof IBizGroupSelect
*/
public remove(item: any) {
this.selects.splice(this.selects.indexOf(item), 1);
this.setValue()
}
/**
* 设置值
*
* @type {*}
* @memberof IBizGroupSelect
*/
public setValue() {
let item: any = {};
if(this.multiple) {
let label = '';
let value = '';
this.selects.forEach((select: any) => {
label += ',' + select.label;
value += ',' + select.id;
});
Object.assign(item, {
label: label ? label.substring(1) : null,
id: value ? value.substring(1) : null
})
} else {
item = this.selects.length > 0 ? this.selects[0] : {};
}
if(this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: item.label });
}
if(this.valueitem) {
this.$emit('formitemvaluechange', { name: this.valueitem, value: item.id });
}
}
}
</script>
<style lang="less">
.ibiz-group-select {
width: 100%;
display: flex;
border: 1px solid #DCDFE6;
min-height: 32px;
border-radius: 4px;
.ibiz-group-content {
flex-grow: 1;
padding: 0 16px;
.ibiz-group-item {
display: inline-block;
border: 1px solid #bbb;
line-height: 24px;
border-radius: 5px;
margin-right: 5px;
padding: 0 5px;
}
}
.ibiz-group-open {
width: 20px;
display: flex;
text-align: center;
align-items: center;
}
}
.ibiz-group-select:hover {
border-color: #108cee;
}
</style>
\ No newline at end of file
...@@ -4,6 +4,7 @@ import VueRouter from 'vue-router'; ...@@ -4,6 +4,7 @@ import VueRouter from 'vue-router';
import App from '@/App.vue'; import App from '@/App.vue';
import ElementUi from 'element-ui'; import ElementUi from 'element-ui';
import ViewUI from 'view-design'; import ViewUI from 'view-design';
import ibizLab from 'ibiz-vue-lib';
import { Interceptors } from '@/utils'; import { Interceptors } from '@/utils';
import {Print} from '@/utils/print'; import {Print} from '@/utils/print';
import i18n from '@/locale' import i18n from '@/locale'
...@@ -30,7 +31,8 @@ Vue.config.errorHandler = function (err: any, vm: any, info: any) { ...@@ -30,7 +31,8 @@ Vue.config.errorHandler = function (err: any, vm: any, info: any) {
console.log(err); console.log(err);
} }
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(Print) Vue.use(Print);
Vue.use(ibizLab);
Vue.use(Vuex); Vue.use(Vuex);
Vue.use(VueRouter);; Vue.use(VueRouter);;
Vue.use(ElementUi, { Vue.use(ElementUi, {
......
...@@ -1199,7 +1199,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1199,7 +1199,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof Main * @memberof Main
*/ */
public uiAction(row: any, tag: any, $event: any) { public uiAction(row: any, tag: any, $event: any) {
this.rowClick(row, true); // this.rowClick(row, true);
} }
/** /**
......
...@@ -1185,7 +1185,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1185,7 +1185,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof Main * @memberof Main
*/ */
public uiAction(row: any, tag: any, $event: any) { public uiAction(row: any, tag: any, $event: any) {
this.rowClick(row, true); // this.rowClick(row, true);
} }
/** /**
......
...@@ -1237,7 +1237,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1237,7 +1237,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof Main * @memberof Main
*/ */
public uiAction(row: any, tag: any, $event: any) { public uiAction(row: any, tag: any, $event: any) {
this.rowClick(row, true); // this.rowClick(row, true);
} }
/** /**
......
...@@ -1199,7 +1199,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1199,7 +1199,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @memberof Main * @memberof Main
*/ */
public uiAction(row: any, tag: any, $event: any) { public uiAction(row: any, tag: any, $event: any) {
this.rowClick(row, true); // this.rowClick(row, true);
} }
/** /**
......
...@@ -5209,10 +5209,10 @@ human-signals@^1.1.1: ...@@ -5209,10 +5209,10 @@ human-signals@^1.1.1:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==
ibiz-gantt-elastic@^1.0.8: ibiz-gantt-elastic@^1.0.12:
version "1.0.8" version "1.0.12"
resolved "https://registry.yarnpkg.com/ibiz-gantt-elastic/-/ibiz-gantt-elastic-1.0.8.tgz#d7c40b6b0068a9303772594608375d42b8dbcb61" resolved "https://registry.yarnpkg.com/ibiz-gantt-elastic/-/ibiz-gantt-elastic-1.0.12.tgz#6865ef41e94b8b31f00f4cd1f0f60f132f7398d3"
integrity sha512-vlawRcYGiNv6N8N9Wx2ZO7oorV3R6dZWYT7Yvb2lxWfdWYX+cK1KZP0p+2S/Is1/A7+eDFhu60iZ2nf7LExaFQ== integrity sha512-UHmnTG5q13xUuCKXSf73ZpwN/iOM9M73jFQ+C9wJWAsZcrDVc/36bPaSalMcfRWpfWREtU9wMnONXtFGVvS6pw==
dependencies: dependencies:
dayjs "^1.8.16" dayjs "^1.8.16"
resize-observer-polyfill "^1.5.1" resize-observer-polyfill "^1.5.1"
......
...@@ -23,7 +23,7 @@ import java.util.List; ...@@ -23,7 +23,7 @@ import java.util.List;
@Configuration @Configuration
@EnableFeignClients(basePackages = {"cn.ibizlab" }) @EnableFeignClients(basePackages = {"cn.ibizlab" })
@EnableZuulProxy @EnableZuulProxy
@ComponentScan(basePackages = {"cn.ibizlab"}) @ComponentScan(basePackages = {"cn.ibizlab.web","cn.ibizlab.util"})
@MapperScan("cn.ibizlab.*.mapper") @MapperScan("cn.ibizlab.*.mapper")
@SpringBootApplication(exclude = { @SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
......
...@@ -76,6 +76,14 @@ public class WFProcessInstance extends EntityClient implements Serializable { ...@@ -76,6 +76,14 @@ public class WFProcessInstance extends EntityClient implements Serializable {
@JsonProperty("startTime") @JsonProperty("startTime")
private Timestamp starttime; private Timestamp starttime;
/**
* 结束时间
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "endTime" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("endTime")
private Timestamp endtime;
/** /**
* 属性 * 属性
*/ */
...@@ -122,6 +130,13 @@ public class WFProcessInstance extends EntityClient implements Serializable { ...@@ -122,6 +130,13 @@ public class WFProcessInstance extends EntityClient implements Serializable {
this.starttime = starttime ; this.starttime = starttime ;
this.modify("starttime",starttime); this.modify("starttime",starttime);
} }
/**
* 设置 [结束时间]
*/
public void setEndtime(Timestamp endtime){
this.endtime = endtime ;
this.modify("endtime",endtime);
}
/** /**
* 设置 [属性] * 设置 [属性]
*/ */
......
...@@ -21,33 +21,38 @@ import java.io.Serializable; ...@@ -21,33 +21,38 @@ import java.io.Serializable;
import lombok.Data; import lombok.Data;
import org.springframework.data.annotation.Transient; import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.domain.EntityClient;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
/** /**
* ServiceApi [系统] 对象 * 实体[系统]
*/ */
@Data @Data
public class WFSystem extends EntityClient implements Serializable { @TableName(value = "IBZPSSYSTEM",resultMap = "WFSystemResultMap")
public class WFSystem extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/** /**
* 系统标识 * 系统标识
*/ */
@DEField(isKeyField=true) @DEField(isKeyField=true)
@JSONField(name = "pSSystemId") @TableId(value= "pssystemid",type=IdType.UUID)
@JsonProperty("pSSystemId") @JSONField(name = "pssystemid")
@JsonProperty("pssystemid")
private String pssystemid; private String pssystemid;
/** /**
* 系统名称 * 系统名称
*/ */
@JSONField(name = "pSSystemName") @TableField(value = "pssystemname")
@JsonProperty("pSSystemName") @JSONField(name = "pssystemname")
@JsonProperty("pssystemname")
private String pssystemname; private String pssystemname;
/** /**
* 设置 [系统名称] * 设置 [系统名称]
*/ */
......
...@@ -17,17 +17,36 @@ import org.springframework.util.ObjectUtils; ...@@ -17,17 +17,36 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import cn.ibizlab.util.filter.SearchContextBase; import cn.ibizlab.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.workflow.domain.WFSystem;
/** /**
* ServiceApi数据实体[WFSystem] 查询条件对象 * 关系型数据实体[WFSystem] 查询条件对象
*/ */
@Slf4j @Slf4j
@Data @Data
public class WFSystemSearchContext extends SearchContextBase { public class WFSystemSearchContext extends QueryWrapperContext<WFSystem> {
private String n_pssystemname_like;//[系统名称]
private String n_pssystemname_like;//[系统名称]
public void setN_pssystemname_like(String n_pssystemname_like) {
this.n_pssystemname_like = n_pssystemname_like;
if(!ObjectUtils.isEmpty(this.n_pssystemname_like)){
this.getSelectCond().like("pssystemname", n_pssystemname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().or().like("pssystemname",query);
}
}
} }
...@@ -18,10 +18,12 @@ import cn.ibizlab.core.workflow.domain.WFSystem; ...@@ -18,10 +18,12 @@ import cn.ibizlab.core.workflow.domain.WFSystem;
import cn.ibizlab.core.workflow.filter.WFSystemSearchContext; import cn.ibizlab.core.workflow.filter.WFSystemSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/** /**
* 实体[WFSystem] 服务对象接口 * 实体[WFSystem] 服务对象接口
*/ */
public interface IWFSystemService{ public interface IWFSystemService extends IService<WFSystem>{
boolean remove(String key) ; boolean remove(String key) ;
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
...@@ -35,8 +37,21 @@ public interface IWFSystemService{ ...@@ -35,8 +37,21 @@ public interface IWFSystemService{
boolean checkKey(WFSystem et) ; boolean checkKey(WFSystem et) ;
WFSystem get(String key) ; WFSystem get(String key) ;
Page<WFSystem> searchDefault(WFSystemSearchContext context) ; Page<WFSystem> searchDefault(WFSystemSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
} }
...@@ -30,31 +30,47 @@ import cn.ibizlab.core.workflow.service.IWFSystemService; ...@@ -30,31 +30,47 @@ import cn.ibizlab.core.workflow.service.IWFSystemService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.workflow.mapper.WFSystemMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/** /**
* 实体[系统] 无存储服务对象接口实现 * 实体[系统] 服务对象接口实现
*/ */
@Slf4j @Slf4j
@Service @Service("WFSystemServiceImpl")
public class WFSystemServiceImpl implements IWFSystemService { public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> implements IWFSystemService {
private int batchSize = 500;
@Override @Override
@Transactional
public boolean remove(String key) { public boolean remove(String key) {
return true; boolean result=removeById(key);
return result ;
} }
public void removeBatch(Collection<String> idList){ @Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
} }
@Override @Override
@Transactional
public boolean update(WFSystem et) { public boolean update(WFSystem et) {
//代码实现 if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("pssystemid",et.getPssystemid())))
return false;
CachedBeanCopier.copy(get(et.getPssystemid()),et);
return true; return true;
} }
public void updateBatch(List<WFSystem> list){ @Override
public void updateBatch(List<WFSystem> list) {
updateBatchById(list,batchSize);
} }
@Override @Override
...@@ -65,48 +81,98 @@ public class WFSystemServiceImpl implements IWFSystemService { ...@@ -65,48 +81,98 @@ public class WFSystemServiceImpl implements IWFSystemService {
@Override @Override
@Transactional @Transactional
public boolean save(WFSystem et) { public boolean save(WFSystem et) {
//代码实现 if(!saveOrUpdate(et))
return false;
return true; return true;
} }
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(WFSystem et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override @Override
public void saveBatch(List<WFSystem> list) { public void saveBatch(List<WFSystem> list) {
saveOrUpdateBatch(list,batchSize);
} }
@Override @Override
@Transactional
public boolean create(WFSystem et) { public boolean create(WFSystem et) {
//代码实现 if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getPssystemid()),et);
return true; return true;
} }
public void createBatch(List<WFSystem> list){ @Override
public void createBatch(List<WFSystem> list) {
this.saveBatch(list,batchSize);
} }
@Override @Override
public boolean checkKey(WFSystem et) { public boolean checkKey(WFSystem et) {
return false; return (!ObjectUtils.isEmpty(et.getPssystemid()))&&(!Objects.isNull(this.getById(et.getPssystemid())));
} }
@Override @Override
@Transactional
public WFSystem get(String key) { public WFSystem get(String key) {
WFSystem et = new WFSystem(); WFSystem et = getById(key);
et.setPssystemid(key); if(et==null){
et=new WFSystem();
et.setPssystemid(key);
}
else{
}
return et; return et;
} }
/** /**
* 查询集合 DEFAULT * 查询集合 DEFAULT
*/ */
@Override @Override
public Page<WFSystem> searchDefault(WFSystemSearchContext context) { public Page<WFSystem> searchDefault(WFSystemSearchContext context) {
return new PageImpl<WFSystem>(new ArrayList(),context.getPageable(),0); com.baomidou.mybatisplus.extension.plugins.pagination.Page<WFSystem> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<WFSystem>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
} }
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
} }
<?xml version="1.1" encoding="UTF-8" standalone="no"?> !!!!模版产生代码错误:----
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> FTL stack trace ("~" means nesting-related):
- Failed at: #if de.getAllPSDEDBConfigs()?? && de... [in template "CODETEMPL_zh_CN" at line 14, column 5]
<!--输出实体[WF_GROUP]数据结构 --> ----
<changeSet author="a_A_5d9d78509" id="tab-wf_group-24-1"> \ No newline at end of file
<createTable tableName="IBZWFGROUP">
<column name="GROUPID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WF_GROUP_GROUPID"/>
</column>
<column name="GROUPNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="GROUPSCOPE" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[WF_DEFINITION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-wf_definition-51-2">
<createTable tableName="IBZWFDEFINITION">
<column name="DEFINITIONKEY" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WF_DEFINITION_DEFINITIONKEY"/>
</column>
<column name="DEFINITIONNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="MODELVERSION" remarks="" type="INT">
</column>
<column name="MODELENABLE" remarks="" type="INT">
</column>
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
</column>
<column name="TASKDEFINITIONKEY" remarks="" type="VARCHAR(100)">
</column>
<column name="MD5CHECK" remarks="" type="VARCHAR(100)">
</column>
<column name="BPMNFILE" remarks="" type="VARCHAR(1000)">
</column>
<column name="DEPLOYKEY" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[WF_GROUP_MEMBER]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-wf_group_member-39-3">
<createTable tableName="IBZWFMEMBER">
<column name="MEMBERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WF_GROUP_MEMBER_MEMBERID"/>
</column>
<column name="MEMBERNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="GROUPID" remarks="" type="VARCHAR(100)">
</column>
<column name="USERID" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[WF_GROUP]外键关系 -->
<!--输出实体[WF_DEFINITION]外键关系 -->
<!--输出实体[WF_GROUP_MEMBER]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-wf_group_member-39-4">
<addForeignKeyConstraint baseColumnNames="GROUPID" baseTableName="IBZWFMEMBER" constraintName="DER1N_WF_GROUP_MEMBER_WF_GROUP" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="GROUPID" referencedTableName="IBZWFGROUP" validate="true"/>
</changeSet>
</databaseChangeLog>
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<mapper namespace="cn.ibizlab.core.workflow.mapper.WFSystemMapper"> <mapper namespace="cn.ibizlab.core.workflow.mapper.WFSystemMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性--> <!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="WFSystemResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`PSSYSTEMID`, t1.`PSSYSTEMNAME` FROM `IBZPSSYSTEM` t1 ) t1 where pssystemid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 --> <!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="WFSystemResultMap" type="cn.ibizlab.core.workflow.domain.WFSystem" autoMapping="true"> <resultMap id="WFSystemResultMap" type="cn.ibizlab.core.workflow.domain.WFSystem" autoMapping="true">
...@@ -28,5 +31,11 @@ ...@@ -28,5 +31,11 @@
]]> ]]>
</sql> </sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`PSSYSTEMID`, t1.`PSSYSTEMNAME` FROM `IBZPSSYSTEM` t1
]]>
</sql>
</mapper> </mapper>
...@@ -40,6 +40,21 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -40,6 +40,21 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired @Autowired
AuthorizationTokenFilter authenticationTokenFilter; AuthorizationTokenFilter authenticationTokenFilter;
@Value("${ibiz.auth.path:v7/login}")
private String loginPath;
@Value("${ibiz.auth.logoutpath:v7/logout}")
private String logoutPath;
@Value("${ibiz.file.uploadpath:ibizutil/upload}")
private String uploadpath;
@Value("${ibiz.file.downloadpath:ibizutil/download}")
private String downloadpath;
@Value("${ibiz.file.previewpath:ibizutil/preview}")
private String previewpath;
@Autowired @Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth auth
...@@ -67,13 +82,16 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -67,13 +82,16 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
@Override @Override
protected void configure(HttpSecurity httpSecurity) throws Exception { protected void configure(HttpSecurity httpSecurity) throws Exception {
httpSecurity httpSecurity
// 禁用 CSRF // 禁用 CSRF
.csrf().disable() .csrf().disable()
// 授权异常 // 授权异常
.exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and() .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
// 不创建会话 // 不创建会话
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
// 过滤请求 // 过滤请求
.authorizeRequests() .authorizeRequests()
.antMatchers( .antMatchers(
...@@ -88,15 +106,21 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -88,15 +106,21 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
"/**/fonts/**", "/**/fonts/**",
"/**/js/**", "/**/js/**",
"/**/img/**", "/**/img/**",
"/", "/"
"/webjars/**",
"/swagger-resources/**",
"/v2/**"
).permitAll() ).permitAll()
// 服务中暂时只为重构用户身份,不进行身份认证 //放行登录请求
.anyRequest().permitAll() .antMatchers( HttpMethod.POST,"/"+loginPath).permitAll()
//放行注销请求
.antMatchers( HttpMethod.GET,"/"+logoutPath).permitAll()
// 文件操作
.antMatchers("/"+downloadpath+"/**").permitAll()
.antMatchers("/"+uploadpath).permitAll()
.antMatchers("/"+previewpath+"/**").permitAll()
// 所有请求都需要认证
.anyRequest().authenticated()
// 防止iframe 造成跨域 // 防止iframe 造成跨域
.and().headers().frameOptions().disable(); .and().headers().frameOptions().disable();
httpSecurity httpSecurity
.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class); .addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
} }
......
...@@ -54,16 +54,14 @@ public class WFGroupResource { ...@@ -54,16 +54,14 @@ public class WFGroupResource {
public WFGroupDTO permissionDTO=new WFGroupDTO(); public WFGroupDTO permissionDTO=new WFGroupDTO();
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Save-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Save-all')")
@ApiOperation(value = "Save", tags = {"WFGroup" }, notes = "Save") @ApiOperation(value = "Save", tags = {"WFGroup" }, notes = "Save")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/save") @RequestMapping(method = RequestMethod.POST, value = "/wfgroups/save")
public ResponseEntity<Boolean> save(@RequestBody WFGroupDTO wfgroupdto) { public ResponseEntity<Boolean> save(@RequestBody WFGroupDTO wfgroupdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfgroupService.save(wfgroupMapping.toDomain(wfgroupdto))); return ResponseEntity.status(HttpStatus.OK).body(wfgroupService.save(wfgroupMapping.toDomain(wfgroupdto)));
} }
@PreAuthorize("hasPermission('Save',{'Sql',this.humanMapping,#humandtos})")
@ApiOperation(value = "SaveBatch", tags = {"WFGroup" }, notes = "SaveBatch") @ApiOperation(value = "SaveBatch", tags = {"WFGroup" }, notes = "SaveBatch")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/wfgroups/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) { public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) {
...@@ -71,10 +69,7 @@ public class WFGroupResource { ...@@ -71,10 +69,7 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Update-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Update-all')")
@ApiOperation(value = "Update", tags = {"WFGroup" }, notes = "Update") @ApiOperation(value = "Update", tags = {"WFGroup" }, notes = "Update")
@RequestMapping(method = RequestMethod.PUT, value = "/wfgroups/{wfgroup_id}") @RequestMapping(method = RequestMethod.PUT, value = "/wfgroups/{wfgroup_id}")
@Transactional @Transactional
...@@ -86,6 +81,7 @@ public class WFGroupResource { ...@@ -86,6 +81,7 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission('Update',{'Sql',this.humanMapping,#humandtos})")
@ApiOperation(value = "UpdateBatch", tags = {"WFGroup" }, notes = "UpdateBatch") @ApiOperation(value = "UpdateBatch", tags = {"WFGroup" }, notes = "UpdateBatch")
@RequestMapping(method = RequestMethod.PUT, value = "/wfgroups/batch") @RequestMapping(method = RequestMethod.PUT, value = "/wfgroups/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) { public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) {
...@@ -93,30 +89,21 @@ public class WFGroupResource { ...@@ -93,30 +89,21 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-GetDraft-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-GetDraft-all')")
@ApiOperation(value = "GetDraft", tags = {"WFGroup" }, notes = "GetDraft") @ApiOperation(value = "GetDraft", tags = {"WFGroup" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/wfgroups/getdraft") @RequestMapping(method = RequestMethod.GET, value = "/wfgroups/getdraft")
public ResponseEntity<WFGroupDTO> getDraft() { public ResponseEntity<WFGroupDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfgroupMapping.toDto(wfgroupService.getDraft(new WFGroup()))); return ResponseEntity.status(HttpStatus.OK).body(wfgroupMapping.toDto(wfgroupService.getDraft(new WFGroup())));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-CheckKey-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-CheckKey-all')")
@ApiOperation(value = "CheckKey", tags = {"WFGroup" }, notes = "CheckKey") @ApiOperation(value = "CheckKey", tags = {"WFGroup" }, notes = "CheckKey")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/checkkey") @RequestMapping(method = RequestMethod.POST, value = "/wfgroups/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WFGroupDTO wfgroupdto) { public ResponseEntity<Boolean> checkKey(@RequestBody WFGroupDTO wfgroupdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfgroupService.checkKey(wfgroupMapping.toDomain(wfgroupdto))); return ResponseEntity.status(HttpStatus.OK).body(wfgroupService.checkKey(wfgroupMapping.toDomain(wfgroupdto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Create-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Create-all')")
@ApiOperation(value = "Create", tags = {"WFGroup" }, notes = "Create") @ApiOperation(value = "Create", tags = {"WFGroup" }, notes = "Create")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups") @RequestMapping(method = RequestMethod.POST, value = "/wfgroups")
@Transactional @Transactional
...@@ -127,6 +114,7 @@ public class WFGroupResource { ...@@ -127,6 +114,7 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission('Create',{'Sql',this.humanMapping,#humandtos})")
@ApiOperation(value = "createBatch", tags = {"WFGroup" }, notes = "createBatch") @ApiOperation(value = "createBatch", tags = {"WFGroup" }, notes = "createBatch")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/batch") @RequestMapping(method = RequestMethod.POST, value = "/wfgroups/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) { public ResponseEntity<Boolean> createBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) {
...@@ -134,10 +122,7 @@ public class WFGroupResource { ...@@ -134,10 +122,7 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Remove-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Remove-all')")
@ApiOperation(value = "Remove", tags = {"WFGroup" }, notes = "Remove") @ApiOperation(value = "Remove", tags = {"WFGroup" }, notes = "Remove")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfgroups/{wfgroup_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/wfgroups/{wfgroup_id}")
@Transactional @Transactional
...@@ -145,6 +130,7 @@ public class WFGroupResource { ...@@ -145,6 +130,7 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(wfgroupService.remove(wfgroup_id)); return ResponseEntity.status(HttpStatus.OK).body(wfgroupService.remove(wfgroup_id));
} }
@PreAuthorize("hasPermission('Remove',{'Sql',this.humanMapping,this.permissionDTO,#ids})")
@ApiOperation(value = "RemoveBatch", tags = {"WFGroup" }, notes = "RemoveBatch") @ApiOperation(value = "RemoveBatch", tags = {"WFGroup" }, notes = "RemoveBatch")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfgroups/batch") @RequestMapping(method = RequestMethod.DELETE, value = "/wfgroups/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) { public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
...@@ -152,10 +138,7 @@ public class WFGroupResource { ...@@ -152,10 +138,7 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Get-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Get-all')")
@ApiOperation(value = "Get", tags = {"WFGroup" }, notes = "Get") @ApiOperation(value = "Get", tags = {"WFGroup" }, notes = "Get")
@RequestMapping(method = RequestMethod.GET, value = "/wfgroups/{wfgroup_id}") @RequestMapping(method = RequestMethod.GET, value = "/wfgroups/{wfgroup_id}")
public ResponseEntity<WFGroupDTO> get(@PathVariable("wfgroup_id") String wfgroup_id) { public ResponseEntity<WFGroupDTO> get(@PathVariable("wfgroup_id") String wfgroup_id) {
...@@ -164,7 +147,7 @@ public class WFGroupResource { ...@@ -164,7 +147,7 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Default-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Default-all')")
@ApiOperation(value = "fetchDEFAULT", tags = {"WFGroup" } ,notes = "fetchDEFAULT") @ApiOperation(value = "fetchDEFAULT", tags = {"WFGroup" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfgroups/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/wfgroups/fetchdefault")
public ResponseEntity<List<WFGroupDTO>> fetchDefault(WFGroupSearchContext context) { public ResponseEntity<List<WFGroupDTO>> fetchDefault(WFGroupSearchContext context) {
...@@ -177,7 +160,7 @@ public class WFGroupResource { ...@@ -177,7 +160,7 @@ public class WFGroupResource {
.body(list); .body(list);
} }
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Default-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Default-all')")
@ApiOperation(value = "searchDEFAULT", tags = {"WFGroup" } ,notes = "searchDEFAULT") @ApiOperation(value = "searchDEFAULT", tags = {"WFGroup" } ,notes = "searchDEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfgroups/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/wfgroups/searchdefault")
public ResponseEntity<Page<WFGroupDTO>> searchDefault(@RequestBody WFGroupSearchContext context) { public ResponseEntity<Page<WFGroupDTO>> searchDefault(@RequestBody WFGroupSearchContext context) {
...@@ -185,8 +168,4 @@ public class WFGroupResource { ...@@ -185,8 +168,4 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(wfgroupMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(wfgroupMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
} }
...@@ -54,16 +54,14 @@ public class WFProcessDefinitionResource { ...@@ -54,16 +54,14 @@ public class WFProcessDefinitionResource {
public WFProcessDefinitionDTO permissionDTO=new WFProcessDefinitionDTO(); public WFProcessDefinitionDTO permissionDTO=new WFProcessDefinitionDTO();
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Save-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Save-all')")
@ApiOperation(value = "Save", tags = {"WFProcessDefinition" }, notes = "Save") @ApiOperation(value = "Save", tags = {"WFProcessDefinition" }, notes = "Save")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/save") @RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/save")
public ResponseEntity<Boolean> save(@RequestBody WFProcessDefinitionDTO wfprocessdefinitiondto) { public ResponseEntity<Boolean> save(@RequestBody WFProcessDefinitionDTO wfprocessdefinitiondto) {
return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionService.save(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondto))); return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionService.save(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondto)));
} }
@PreAuthorize("hasPermission('Save',{'Sql',this.humanMapping,#humandtos})")
@ApiOperation(value = "SaveBatch", tags = {"WFProcessDefinition" }, notes = "SaveBatch") @ApiOperation(value = "SaveBatch", tags = {"WFProcessDefinition" }, notes = "SaveBatch")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFProcessDefinitionDTO> wfprocessdefinitiondtos) { public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFProcessDefinitionDTO> wfprocessdefinitiondtos) {
...@@ -71,10 +69,7 @@ public class WFProcessDefinitionResource { ...@@ -71,10 +69,7 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Update-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Update-all')")
@ApiOperation(value = "Update", tags = {"WFProcessDefinition" }, notes = "Update") @ApiOperation(value = "Update", tags = {"WFProcessDefinition" }, notes = "Update")
@RequestMapping(method = RequestMethod.PUT, value = "/wfprocessdefinitions/{wfprocessdefinition_id}") @RequestMapping(method = RequestMethod.PUT, value = "/wfprocessdefinitions/{wfprocessdefinition_id}")
@Transactional @Transactional
...@@ -86,6 +81,7 @@ public class WFProcessDefinitionResource { ...@@ -86,6 +81,7 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission('Update',{'Sql',this.humanMapping,#humandtos})")
@ApiOperation(value = "UpdateBatch", tags = {"WFProcessDefinition" }, notes = "UpdateBatch") @ApiOperation(value = "UpdateBatch", tags = {"WFProcessDefinition" }, notes = "UpdateBatch")
@RequestMapping(method = RequestMethod.PUT, value = "/wfprocessdefinitions/batch") @RequestMapping(method = RequestMethod.PUT, value = "/wfprocessdefinitions/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFProcessDefinitionDTO> wfprocessdefinitiondtos) { public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFProcessDefinitionDTO> wfprocessdefinitiondtos) {
...@@ -93,10 +89,7 @@ public class WFProcessDefinitionResource { ...@@ -93,10 +89,7 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Get-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Get-all')")
@ApiOperation(value = "Get", tags = {"WFProcessDefinition" }, notes = "Get") @ApiOperation(value = "Get", tags = {"WFProcessDefinition" }, notes = "Get")
@RequestMapping(method = RequestMethod.GET, value = "/wfprocessdefinitions/{wfprocessdefinition_id}") @RequestMapping(method = RequestMethod.GET, value = "/wfprocessdefinitions/{wfprocessdefinition_id}")
public ResponseEntity<WFProcessDefinitionDTO> get(@PathVariable("wfprocessdefinition_id") String wfprocessdefinition_id) { public ResponseEntity<WFProcessDefinitionDTO> get(@PathVariable("wfprocessdefinition_id") String wfprocessdefinition_id) {
...@@ -105,30 +98,21 @@ public class WFProcessDefinitionResource { ...@@ -105,30 +98,21 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-CheckKey-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-CheckKey-all')")
@ApiOperation(value = "CheckKey", tags = {"WFProcessDefinition" }, notes = "CheckKey") @ApiOperation(value = "CheckKey", tags = {"WFProcessDefinition" }, notes = "CheckKey")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/checkkey") @RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WFProcessDefinitionDTO wfprocessdefinitiondto) { public ResponseEntity<Boolean> checkKey(@RequestBody WFProcessDefinitionDTO wfprocessdefinitiondto) {
return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionService.checkKey(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondto))); return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionService.checkKey(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-GetDraft-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-GetDraft-all')")
@ApiOperation(value = "GetDraft", tags = {"WFProcessDefinition" }, notes = "GetDraft") @ApiOperation(value = "GetDraft", tags = {"WFProcessDefinition" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/wfprocessdefinitions/getdraft") @RequestMapping(method = RequestMethod.GET, value = "/wfprocessdefinitions/getdraft")
public ResponseEntity<WFProcessDefinitionDTO> getDraft() { public ResponseEntity<WFProcessDefinitionDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionMapping.toDto(wfprocessdefinitionService.getDraft(new WFProcessDefinition()))); return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionMapping.toDto(wfprocessdefinitionService.getDraft(new WFProcessDefinition())));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Create-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Create-all')")
@ApiOperation(value = "Create", tags = {"WFProcessDefinition" }, notes = "Create") @ApiOperation(value = "Create", tags = {"WFProcessDefinition" }, notes = "Create")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions") @RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions")
@Transactional @Transactional
...@@ -139,6 +123,7 @@ public class WFProcessDefinitionResource { ...@@ -139,6 +123,7 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission('Create',{'Sql',this.humanMapping,#humandtos})")
@ApiOperation(value = "createBatch", tags = {"WFProcessDefinition" }, notes = "createBatch") @ApiOperation(value = "createBatch", tags = {"WFProcessDefinition" }, notes = "createBatch")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/batch") @RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFProcessDefinitionDTO> wfprocessdefinitiondtos) { public ResponseEntity<Boolean> createBatch(@RequestBody List<WFProcessDefinitionDTO> wfprocessdefinitiondtos) {
...@@ -146,10 +131,7 @@ public class WFProcessDefinitionResource { ...@@ -146,10 +131,7 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Remove-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Remove-all')")
@ApiOperation(value = "Remove", tags = {"WFProcessDefinition" }, notes = "Remove") @ApiOperation(value = "Remove", tags = {"WFProcessDefinition" }, notes = "Remove")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfprocessdefinitions/{wfprocessdefinition_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/wfprocessdefinitions/{wfprocessdefinition_id}")
@Transactional @Transactional
...@@ -157,6 +139,7 @@ public class WFProcessDefinitionResource { ...@@ -157,6 +139,7 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionService.remove(wfprocessdefinition_id)); return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionService.remove(wfprocessdefinition_id));
} }
@PreAuthorize("hasPermission('Remove',{'Sql',this.humanMapping,this.permissionDTO,#ids})")
@ApiOperation(value = "RemoveBatch", tags = {"WFProcessDefinition" }, notes = "RemoveBatch") @ApiOperation(value = "RemoveBatch", tags = {"WFProcessDefinition" }, notes = "RemoveBatch")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfprocessdefinitions/batch") @RequestMapping(method = RequestMethod.DELETE, value = "/wfprocessdefinitions/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) { public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
...@@ -164,7 +147,7 @@ public class WFProcessDefinitionResource { ...@@ -164,7 +147,7 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Default-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Default-all')")
@ApiOperation(value = "fetchDEFAULT", tags = {"WFProcessDefinition" } ,notes = "fetchDEFAULT") @ApiOperation(value = "fetchDEFAULT", tags = {"WFProcessDefinition" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfprocessdefinitions/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/wfprocessdefinitions/fetchdefault")
public ResponseEntity<List<WFProcessDefinitionDTO>> fetchDefault(WFProcessDefinitionSearchContext context) { public ResponseEntity<List<WFProcessDefinitionDTO>> fetchDefault(WFProcessDefinitionSearchContext context) {
...@@ -177,7 +160,7 @@ public class WFProcessDefinitionResource { ...@@ -177,7 +160,7 @@ public class WFProcessDefinitionResource {
.body(list); .body(list);
} }
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Default-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Default-all')")
@ApiOperation(value = "searchDEFAULT", tags = {"WFProcessDefinition" } ,notes = "searchDEFAULT") @ApiOperation(value = "searchDEFAULT", tags = {"WFProcessDefinition" } ,notes = "searchDEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfprocessdefinitions/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/wfprocessdefinitions/searchdefault")
public ResponseEntity<Page<WFProcessDefinitionDTO>> searchDefault(@RequestBody WFProcessDefinitionSearchContext context) { public ResponseEntity<Page<WFProcessDefinitionDTO>> searchDefault(@RequestBody WFProcessDefinitionSearchContext context) {
...@@ -185,8 +168,4 @@ public class WFProcessDefinitionResource { ...@@ -185,8 +168,4 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(wfprocessdefinitionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(wfprocessdefinitionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
} }
...@@ -54,10 +54,7 @@ public class WFREModelResource { ...@@ -54,10 +54,7 @@ public class WFREModelResource {
public WFREModelDTO permissionDTO=new WFREModelDTO(); public WFREModelDTO permissionDTO=new WFREModelDTO();
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Update-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Update-all')")
@ApiOperation(value = "Update", tags = {"WFREModel" }, notes = "Update") @ApiOperation(value = "Update", tags = {"WFREModel" }, notes = "Update")
@RequestMapping(method = RequestMethod.PUT, value = "/wfremodels/{wfremodel_id}") @RequestMapping(method = RequestMethod.PUT, value = "/wfremodels/{wfremodel_id}")
@Transactional @Transactional
...@@ -69,6 +66,7 @@ public class WFREModelResource { ...@@ -69,6 +66,7 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission('Update',{'None',this.humanMapping,#humandtos})")
@ApiOperation(value = "UpdateBatch", tags = {"WFREModel" }, notes = "UpdateBatch") @ApiOperation(value = "UpdateBatch", tags = {"WFREModel" }, notes = "UpdateBatch")
@RequestMapping(method = RequestMethod.PUT, value = "/wfremodels/batch") @RequestMapping(method = RequestMethod.PUT, value = "/wfremodels/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) { public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) {
...@@ -76,16 +74,14 @@ public class WFREModelResource { ...@@ -76,16 +74,14 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Save-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Save-all')")
@ApiOperation(value = "Save", tags = {"WFREModel" }, notes = "Save") @ApiOperation(value = "Save", tags = {"WFREModel" }, notes = "Save")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels/save") @RequestMapping(method = RequestMethod.POST, value = "/wfremodels/save")
public ResponseEntity<Boolean> save(@RequestBody WFREModelDTO wfremodeldto) { public ResponseEntity<Boolean> save(@RequestBody WFREModelDTO wfremodeldto) {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.save(wfremodelMapping.toDomain(wfremodeldto))); return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.save(wfremodelMapping.toDomain(wfremodeldto)));
} }
@PreAuthorize("hasPermission('Save',{'None',this.humanMapping,#humandtos})")
@ApiOperation(value = "SaveBatch", tags = {"WFREModel" }, notes = "SaveBatch") @ApiOperation(value = "SaveBatch", tags = {"WFREModel" }, notes = "SaveBatch")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/wfremodels/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) { public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) {
...@@ -93,10 +89,7 @@ public class WFREModelResource { ...@@ -93,10 +89,7 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Get-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Get-all')")
@ApiOperation(value = "Get", tags = {"WFREModel" }, notes = "Get") @ApiOperation(value = "Get", tags = {"WFREModel" }, notes = "Get")
@RequestMapping(method = RequestMethod.GET, value = "/wfremodels/{wfremodel_id}") @RequestMapping(method = RequestMethod.GET, value = "/wfremodels/{wfremodel_id}")
public ResponseEntity<WFREModelDTO> get(@PathVariable("wfremodel_id") String wfremodel_id) { public ResponseEntity<WFREModelDTO> get(@PathVariable("wfremodel_id") String wfremodel_id) {
...@@ -105,10 +98,7 @@ public class WFREModelResource { ...@@ -105,10 +98,7 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Create-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Create-all')")
@ApiOperation(value = "Create", tags = {"WFREModel" }, notes = "Create") @ApiOperation(value = "Create", tags = {"WFREModel" }, notes = "Create")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels") @RequestMapping(method = RequestMethod.POST, value = "/wfremodels")
@Transactional @Transactional
...@@ -119,6 +109,7 @@ public class WFREModelResource { ...@@ -119,6 +109,7 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission('Create',{'None',this.humanMapping,#humandtos})")
@ApiOperation(value = "createBatch", tags = {"WFREModel" }, notes = "createBatch") @ApiOperation(value = "createBatch", tags = {"WFREModel" }, notes = "createBatch")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels/batch") @RequestMapping(method = RequestMethod.POST, value = "/wfremodels/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) { public ResponseEntity<Boolean> createBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) {
...@@ -126,20 +117,14 @@ public class WFREModelResource { ...@@ -126,20 +117,14 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-CheckKey-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-CheckKey-all')")
@ApiOperation(value = "CheckKey", tags = {"WFREModel" }, notes = "CheckKey") @ApiOperation(value = "CheckKey", tags = {"WFREModel" }, notes = "CheckKey")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels/checkkey") @RequestMapping(method = RequestMethod.POST, value = "/wfremodels/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WFREModelDTO wfremodeldto) { public ResponseEntity<Boolean> checkKey(@RequestBody WFREModelDTO wfremodeldto) {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.checkKey(wfremodelMapping.toDomain(wfremodeldto))); return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.checkKey(wfremodelMapping.toDomain(wfremodeldto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Remove-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Remove-all')")
@ApiOperation(value = "Remove", tags = {"WFREModel" }, notes = "Remove") @ApiOperation(value = "Remove", tags = {"WFREModel" }, notes = "Remove")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfremodels/{wfremodel_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/wfremodels/{wfremodel_id}")
@Transactional @Transactional
...@@ -147,6 +132,7 @@ public class WFREModelResource { ...@@ -147,6 +132,7 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.remove(wfremodel_id)); return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.remove(wfremodel_id));
} }
@PreAuthorize("hasPermission('Remove',{'None',this.humanMapping,this.permissionDTO,#ids})")
@ApiOperation(value = "RemoveBatch", tags = {"WFREModel" }, notes = "RemoveBatch") @ApiOperation(value = "RemoveBatch", tags = {"WFREModel" }, notes = "RemoveBatch")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfremodels/batch") @RequestMapping(method = RequestMethod.DELETE, value = "/wfremodels/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) { public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
...@@ -154,17 +140,14 @@ public class WFREModelResource { ...@@ -154,17 +140,14 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-GetDraft-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-GetDraft-all')")
@ApiOperation(value = "GetDraft", tags = {"WFREModel" }, notes = "GetDraft") @ApiOperation(value = "GetDraft", tags = {"WFREModel" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/wfremodels/getdraft") @RequestMapping(method = RequestMethod.GET, value = "/wfremodels/getdraft")
public ResponseEntity<WFREModelDTO> getDraft() { public ResponseEntity<WFREModelDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelMapping.toDto(wfremodelService.getDraft(new WFREModel()))); return ResponseEntity.status(HttpStatus.OK).body(wfremodelMapping.toDto(wfremodelService.getDraft(new WFREModel())));
} }
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Default-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Default-all')")
@ApiOperation(value = "fetchDEFAULT", tags = {"WFREModel" } ,notes = "fetchDEFAULT") @ApiOperation(value = "fetchDEFAULT", tags = {"WFREModel" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfremodels/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/wfremodels/fetchdefault")
public ResponseEntity<List<WFREModelDTO>> fetchDefault(WFREModelSearchContext context) { public ResponseEntity<List<WFREModelDTO>> fetchDefault(WFREModelSearchContext context) {
...@@ -177,7 +160,7 @@ public class WFREModelResource { ...@@ -177,7 +160,7 @@ public class WFREModelResource {
.body(list); .body(list);
} }
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Default-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-Default-all')")
@ApiOperation(value = "searchDEFAULT", tags = {"WFREModel" } ,notes = "searchDEFAULT") @ApiOperation(value = "searchDEFAULT", tags = {"WFREModel" } ,notes = "searchDEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfremodels/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/wfremodels/searchdefault")
public ResponseEntity<Page<WFREModelDTO>> searchDefault(@RequestBody WFREModelSearchContext context) { public ResponseEntity<Page<WFREModelDTO>> searchDefault(@RequestBody WFREModelSearchContext context) {
...@@ -185,8 +168,4 @@ public class WFREModelResource { ...@@ -185,8 +168,4 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(wfremodelMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(wfremodelMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
} }
...@@ -54,10 +54,7 @@ public class WFSystemResource { ...@@ -54,10 +54,7 @@ public class WFSystemResource {
public WFSystemDTO permissionDTO=new WFSystemDTO(); public WFSystemDTO permissionDTO=new WFSystemDTO();
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Remove-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Remove-all')")
@ApiOperation(value = "Remove", tags = {"WFSystem" }, notes = "Remove") @ApiOperation(value = "Remove", tags = {"WFSystem" }, notes = "Remove")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfsystems/{wfsystem_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/wfsystems/{wfsystem_id}")
@Transactional @Transactional
...@@ -65,6 +62,7 @@ public class WFSystemResource { ...@@ -65,6 +62,7 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(wfsystemService.remove(wfsystem_id)); return ResponseEntity.status(HttpStatus.OK).body(wfsystemService.remove(wfsystem_id));
} }
@PreAuthorize("hasPermission('Remove',{'Sql',this.humanMapping,this.permissionDTO,#ids})")
@ApiOperation(value = "RemoveBatch", tags = {"WFSystem" }, notes = "RemoveBatch") @ApiOperation(value = "RemoveBatch", tags = {"WFSystem" }, notes = "RemoveBatch")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfsystems/batch") @RequestMapping(method = RequestMethod.DELETE, value = "/wfsystems/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) { public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
...@@ -72,10 +70,7 @@ public class WFSystemResource { ...@@ -72,10 +70,7 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Update-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Update-all')")
@ApiOperation(value = "Update", tags = {"WFSystem" }, notes = "Update") @ApiOperation(value = "Update", tags = {"WFSystem" }, notes = "Update")
@RequestMapping(method = RequestMethod.PUT, value = "/wfsystems/{wfsystem_id}") @RequestMapping(method = RequestMethod.PUT, value = "/wfsystems/{wfsystem_id}")
@Transactional @Transactional
...@@ -87,6 +82,7 @@ public class WFSystemResource { ...@@ -87,6 +82,7 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission('Update',{'Sql',this.humanMapping,#humandtos})")
@ApiOperation(value = "UpdateBatch", tags = {"WFSystem" }, notes = "UpdateBatch") @ApiOperation(value = "UpdateBatch", tags = {"WFSystem" }, notes = "UpdateBatch")
@RequestMapping(method = RequestMethod.PUT, value = "/wfsystems/batch") @RequestMapping(method = RequestMethod.PUT, value = "/wfsystems/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFSystemDTO> wfsystemdtos) { public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFSystemDTO> wfsystemdtos) {
...@@ -94,26 +90,21 @@ public class WFSystemResource { ...@@ -94,26 +90,21 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-GetDraft-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-GetDraft-all')")
@ApiOperation(value = "GetDraft", tags = {"WFSystem" }, notes = "GetDraft") @ApiOperation(value = "GetDraft", tags = {"WFSystem" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/wfsystems/getdraft") @RequestMapping(method = RequestMethod.GET, value = "/wfsystems/getdraft")
public ResponseEntity<WFSystemDTO> getDraft() { public ResponseEntity<WFSystemDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfsystemMapping.toDto(wfsystemService.getDraft(new WFSystem()))); return ResponseEntity.status(HttpStatus.OK).body(wfsystemMapping.toDto(wfsystemService.getDraft(new WFSystem())));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Save-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Save-all')")
@ApiOperation(value = "Save", tags = {"WFSystem" }, notes = "Save") @ApiOperation(value = "Save", tags = {"WFSystem" }, notes = "Save")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems/save") @RequestMapping(method = RequestMethod.POST, value = "/wfsystems/save")
public ResponseEntity<Boolean> save(@RequestBody WFSystemDTO wfsystemdto) { public ResponseEntity<Boolean> save(@RequestBody WFSystemDTO wfsystemdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfsystemService.save(wfsystemMapping.toDomain(wfsystemdto))); return ResponseEntity.status(HttpStatus.OK).body(wfsystemService.save(wfsystemMapping.toDomain(wfsystemdto)));
} }
@PreAuthorize("hasPermission('Save',{'Sql',this.humanMapping,#humandtos})")
@ApiOperation(value = "SaveBatch", tags = {"WFSystem" }, notes = "SaveBatch") @ApiOperation(value = "SaveBatch", tags = {"WFSystem" }, notes = "SaveBatch")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/wfsystems/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFSystemDTO> wfsystemdtos) { public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFSystemDTO> wfsystemdtos) {
...@@ -121,10 +112,7 @@ public class WFSystemResource { ...@@ -121,10 +112,7 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Create-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Create-all')")
@ApiOperation(value = "Create", tags = {"WFSystem" }, notes = "Create") @ApiOperation(value = "Create", tags = {"WFSystem" }, notes = "Create")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems") @RequestMapping(method = RequestMethod.POST, value = "/wfsystems")
@Transactional @Transactional
...@@ -135,6 +123,7 @@ public class WFSystemResource { ...@@ -135,6 +123,7 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission('Create',{'Sql',this.humanMapping,#humandtos})")
@ApiOperation(value = "createBatch", tags = {"WFSystem" }, notes = "createBatch") @ApiOperation(value = "createBatch", tags = {"WFSystem" }, notes = "createBatch")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems/batch") @RequestMapping(method = RequestMethod.POST, value = "/wfsystems/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFSystemDTO> wfsystemdtos) { public ResponseEntity<Boolean> createBatch(@RequestBody List<WFSystemDTO> wfsystemdtos) {
...@@ -142,20 +131,14 @@ public class WFSystemResource { ...@@ -142,20 +131,14 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-CheckKey-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-CheckKey-all')")
@ApiOperation(value = "CheckKey", tags = {"WFSystem" }, notes = "CheckKey") @ApiOperation(value = "CheckKey", tags = {"WFSystem" }, notes = "CheckKey")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems/checkkey") @RequestMapping(method = RequestMethod.POST, value = "/wfsystems/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WFSystemDTO wfsystemdto) { public ResponseEntity<Boolean> checkKey(@RequestBody WFSystemDTO wfsystemdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfsystemService.checkKey(wfsystemMapping.toDomain(wfsystemdto))); return ResponseEntity.status(HttpStatus.OK).body(wfsystemService.checkKey(wfsystemMapping.toDomain(wfsystemdto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Get-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Get-all')")
@ApiOperation(value = "Get", tags = {"WFSystem" }, notes = "Get") @ApiOperation(value = "Get", tags = {"WFSystem" }, notes = "Get")
@RequestMapping(method = RequestMethod.GET, value = "/wfsystems/{wfsystem_id}") @RequestMapping(method = RequestMethod.GET, value = "/wfsystems/{wfsystem_id}")
public ResponseEntity<WFSystemDTO> get(@PathVariable("wfsystem_id") String wfsystem_id) { public ResponseEntity<WFSystemDTO> get(@PathVariable("wfsystem_id") String wfsystem_id) {
...@@ -164,7 +147,7 @@ public class WFSystemResource { ...@@ -164,7 +147,7 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Default-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Default-all')")
@ApiOperation(value = "fetchDEFAULT", tags = {"WFSystem" } ,notes = "fetchDEFAULT") @ApiOperation(value = "fetchDEFAULT", tags = {"WFSystem" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfsystems/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/wfsystems/fetchdefault")
public ResponseEntity<List<WFSystemDTO>> fetchDefault(WFSystemSearchContext context) { public ResponseEntity<List<WFSystemDTO>> fetchDefault(WFSystemSearchContext context) {
...@@ -177,7 +160,7 @@ public class WFSystemResource { ...@@ -177,7 +160,7 @@ public class WFSystemResource {
.body(list); .body(list);
} }
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Default-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Default-all')")
@ApiOperation(value = "searchDEFAULT", tags = {"WFSystem" } ,notes = "searchDEFAULT") @ApiOperation(value = "searchDEFAULT", tags = {"WFSystem" } ,notes = "searchDEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfsystems/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/wfsystems/searchdefault")
public ResponseEntity<Page<WFSystemDTO>> searchDefault(@RequestBody WFSystemSearchContext context) { public ResponseEntity<Page<WFSystemDTO>> searchDefault(@RequestBody WFSystemSearchContext context) {
...@@ -185,8 +168,4 @@ public class WFSystemResource { ...@@ -185,8 +168,4 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(wfsystemMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(wfsystemMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
} }
...@@ -54,10 +54,7 @@ public class WFUserResource { ...@@ -54,10 +54,7 @@ public class WFUserResource {
public WFUserDTO permissionDTO=new WFUserDTO(); public WFUserDTO permissionDTO=new WFUserDTO();
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Remove-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Remove-all')")
@ApiOperation(value = "Remove", tags = {"WFUser" }, notes = "Remove") @ApiOperation(value = "Remove", tags = {"WFUser" }, notes = "Remove")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfusers/{wfuser_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/wfusers/{wfuser_id}")
@Transactional @Transactional
...@@ -65,6 +62,7 @@ public class WFUserResource { ...@@ -65,6 +62,7 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(wfuserService.remove(wfuser_id)); return ResponseEntity.status(HttpStatus.OK).body(wfuserService.remove(wfuser_id));
} }
@PreAuthorize("hasPermission('Remove',{'Sql',this.humanMapping,this.permissionDTO,#ids})")
@ApiOperation(value = "RemoveBatch", tags = {"WFUser" }, notes = "RemoveBatch") @ApiOperation(value = "RemoveBatch", tags = {"WFUser" }, notes = "RemoveBatch")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfusers/batch") @RequestMapping(method = RequestMethod.DELETE, value = "/wfusers/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) { public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
...@@ -72,26 +70,21 @@ public class WFUserResource { ...@@ -72,26 +70,21 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-GetDraft-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-GetDraft-all')")
@ApiOperation(value = "GetDraft", tags = {"WFUser" }, notes = "GetDraft") @ApiOperation(value = "GetDraft", tags = {"WFUser" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/getdraft") @RequestMapping(method = RequestMethod.GET, value = "/wfusers/getdraft")
public ResponseEntity<WFUserDTO> getDraft() { public ResponseEntity<WFUserDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfuserMapping.toDto(wfuserService.getDraft(new WFUser()))); return ResponseEntity.status(HttpStatus.OK).body(wfuserMapping.toDto(wfuserService.getDraft(new WFUser())));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Save-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Save-all')")
@ApiOperation(value = "Save", tags = {"WFUser" }, notes = "Save") @ApiOperation(value = "Save", tags = {"WFUser" }, notes = "Save")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/save") @RequestMapping(method = RequestMethod.POST, value = "/wfusers/save")
public ResponseEntity<Boolean> save(@RequestBody WFUserDTO wfuserdto) { public ResponseEntity<Boolean> save(@RequestBody WFUserDTO wfuserdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfuserService.save(wfuserMapping.toDomain(wfuserdto))); return ResponseEntity.status(HttpStatus.OK).body(wfuserService.save(wfuserMapping.toDomain(wfuserdto)));
} }
@PreAuthorize("hasPermission('Save',{'Sql',this.humanMapping,#humandtos})")
@ApiOperation(value = "SaveBatch", tags = {"WFUser" }, notes = "SaveBatch") @ApiOperation(value = "SaveBatch", tags = {"WFUser" }, notes = "SaveBatch")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/wfusers/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFUserDTO> wfuserdtos) { public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFUserDTO> wfuserdtos) {
...@@ -99,10 +92,7 @@ public class WFUserResource { ...@@ -99,10 +92,7 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Update-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Update-all')")
@ApiOperation(value = "Update", tags = {"WFUser" }, notes = "Update") @ApiOperation(value = "Update", tags = {"WFUser" }, notes = "Update")
@RequestMapping(method = RequestMethod.PUT, value = "/wfusers/{wfuser_id}") @RequestMapping(method = RequestMethod.PUT, value = "/wfusers/{wfuser_id}")
@Transactional @Transactional
...@@ -114,6 +104,7 @@ public class WFUserResource { ...@@ -114,6 +104,7 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission('Update',{'Sql',this.humanMapping,#humandtos})")
@ApiOperation(value = "UpdateBatch", tags = {"WFUser" }, notes = "UpdateBatch") @ApiOperation(value = "UpdateBatch", tags = {"WFUser" }, notes = "UpdateBatch")
@RequestMapping(method = RequestMethod.PUT, value = "/wfusers/batch") @RequestMapping(method = RequestMethod.PUT, value = "/wfusers/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFUserDTO> wfuserdtos) { public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFUserDTO> wfuserdtos) {
...@@ -121,10 +112,7 @@ public class WFUserResource { ...@@ -121,10 +112,7 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Get-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Get-all')")
@ApiOperation(value = "Get", tags = {"WFUser" }, notes = "Get") @ApiOperation(value = "Get", tags = {"WFUser" }, notes = "Get")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/{wfuser_id}") @RequestMapping(method = RequestMethod.GET, value = "/wfusers/{wfuser_id}")
public ResponseEntity<WFUserDTO> get(@PathVariable("wfuser_id") String wfuser_id) { public ResponseEntity<WFUserDTO> get(@PathVariable("wfuser_id") String wfuser_id) {
...@@ -133,10 +121,7 @@ public class WFUserResource { ...@@ -133,10 +121,7 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Create-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Create-all')")
@ApiOperation(value = "Create", tags = {"WFUser" }, notes = "Create") @ApiOperation(value = "Create", tags = {"WFUser" }, notes = "Create")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers") @RequestMapping(method = RequestMethod.POST, value = "/wfusers")
@Transactional @Transactional
...@@ -147,6 +132,7 @@ public class WFUserResource { ...@@ -147,6 +132,7 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission('Create',{'Sql',this.humanMapping,#humandtos})")
@ApiOperation(value = "createBatch", tags = {"WFUser" }, notes = "createBatch") @ApiOperation(value = "createBatch", tags = {"WFUser" }, notes = "createBatch")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/batch") @RequestMapping(method = RequestMethod.POST, value = "/wfusers/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFUserDTO> wfuserdtos) { public ResponseEntity<Boolean> createBatch(@RequestBody List<WFUserDTO> wfuserdtos) {
...@@ -154,17 +140,14 @@ public class WFUserResource { ...@@ -154,17 +140,14 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-CheckKey-all')")
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-CheckKey-all')")
@ApiOperation(value = "CheckKey", tags = {"WFUser" }, notes = "CheckKey") @ApiOperation(value = "CheckKey", tags = {"WFUser" }, notes = "CheckKey")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/checkkey") @RequestMapping(method = RequestMethod.POST, value = "/wfusers/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WFUserDTO wfuserdto) { public ResponseEntity<Boolean> checkKey(@RequestBody WFUserDTO wfuserdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfuserService.checkKey(wfuserMapping.toDomain(wfuserdto))); return ResponseEntity.status(HttpStatus.OK).body(wfuserService.checkKey(wfuserMapping.toDomain(wfuserdto)));
} }
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Default-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Default-all')")
@ApiOperation(value = "fetchDEFAULT", tags = {"WFUser" } ,notes = "fetchDEFAULT") @ApiOperation(value = "fetchDEFAULT", tags = {"WFUser" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfusers/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/wfusers/fetchdefault")
public ResponseEntity<List<WFUserDTO>> fetchDefault(WFUserSearchContext context) { public ResponseEntity<List<WFUserDTO>> fetchDefault(WFUserSearchContext context) {
...@@ -177,7 +160,7 @@ public class WFUserResource { ...@@ -177,7 +160,7 @@ public class WFUserResource {
.body(list); .body(list);
} }
//@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Default-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Default-all')")
@ApiOperation(value = "searchDEFAULT", tags = {"WFUser" } ,notes = "searchDEFAULT") @ApiOperation(value = "searchDEFAULT", tags = {"WFUser" } ,notes = "searchDEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfusers/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/wfusers/searchdefault")
public ResponseEntity<Page<WFUserDTO>> searchDefault(@RequestBody WFUserSearchContext context) { public ResponseEntity<Page<WFUserDTO>> searchDefault(@RequestBody WFUserSearchContext context) {
...@@ -185,8 +168,4 @@ public class WFUserResource { ...@@ -185,8 +168,4 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(wfuserMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(wfuserMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
} }
package cn.ibizlab.util.web;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
/**
* feign请求拦截器
* 拦截所有使用feign发出的请求,附加原始请求Header参数及Token
*/
@Configuration
public class FeignRequestInterceptor implements RequestInterceptor {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Override
public void apply(RequestTemplate requestTemplate) {
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if(requestAttributes!=null){
HttpServletRequest request = requestAttributes.getRequest();
Enumeration<String> headerNames = request.getHeaderNames();
if (headerNames != null) {
while (headerNames.hasMoreElements()) {
String name = headerNames.nextElement();
String values = request.getHeader(name);
requestTemplate.header(name, values);
}
logger.info("feign interceptor header:{}",requestTemplate);
}
}
}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册