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

ibiz4j 发布系统代码

上级 5b8e2ed0
......@@ -115,16 +115,16 @@ mock.onGet(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((c
return [status, _items];
});
// Save
mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: Save");
// Create
mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -134,23 +134,11 @@ mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((c
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, mockDatas[0]];
});
// Update
......@@ -245,16 +233,16 @@ mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).repl
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: Create");
// Save
mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -264,11 +252,23 @@ mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, data];
});
// FetchDefault
......
......@@ -115,16 +115,16 @@ mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})\/select$
return [status, _items];
});
// Save
mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Save");
// Create
mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['definitionkey'];
const matchArray:any = new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -134,23 +134,11 @@ mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/save$
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.definitionkey, tempValue.definitionkey));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['definitionkey'] == tempValue['definitionkey'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, mockDatas[0]];
});
// Update
......@@ -190,6 +178,22 @@ mock.onPut(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})$/)).rep
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/wfprocessdefinitions\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
......@@ -228,33 +232,17 @@ mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/check
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/wfprocessdefinitions\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Create
mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Create");
// Save
mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['definitionkey'];
const matchArray:any = new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -264,11 +252,23 @@ mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})$/)).re
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.definitionkey, tempValue.definitionkey));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['definitionkey'] == tempValue['definitionkey'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, data];
});
// FetchDefault
......@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/wfprocessdefinitions\/fetchdefault(\?[\w-./?%&=,]*)*$/
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).repl
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -115,9 +115,9 @@ mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply(
return [status, _items];
});
// Update
mock.onPut(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Update");
// Create
mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -134,35 +134,23 @@ mock.onPut(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, mockDatas[0]];
});
// Save
mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Save");
// Update
mock.onPut(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -190,31 +178,21 @@ mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply(
console.groupEnd();
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Create");
// GetDraft
mock.onGet(new RegExp(/^\/wfremodels\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.table({});
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, {}];
});
// CheckKey
......@@ -254,21 +232,43 @@ mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).re
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/wfremodels\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: GetDraft");
// Save
mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, {}];
return [status, data];
});
// FetchDefault
......@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/wfremodels\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config:
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -115,6 +115,32 @@ mock.onGet(new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['pssystemid'];
const matchArray:any = new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Update");
......@@ -169,16 +195,16 @@ mock.onGet(new RegExp(/^\/wfsystems\/getdraft$/)).reply((config: any) => {
return [status, {}];
});
// Save
mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Save");
// CheckKey
mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['pssystemid'];
const matchArray:any = new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -207,42 +233,16 @@ mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['pssystemid'];
const matchArray:any = new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// CheckKey
mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['pssystemid'];
const matchArray:any = new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......
......@@ -114,33 +114,17 @@ mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((co
console.groupEnd();
return [status, _items];
});
// GetDraft
mock.onGet(new RegExp(/^\/wfusers\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Save
mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: Save");
// Create
mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -150,23 +134,11 @@ mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((co
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, mockDatas[0]];
});
// Update
......@@ -206,17 +178,33 @@ mock.onPut(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: a
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/wfusers\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Create
mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: Create");
// CheckKey
mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -226,23 +214,35 @@ mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, data];
});
// CheckKey
mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......
......@@ -747,9 +747,18 @@ export default class WFGroupMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]);
}
});
this.viewSelections = newSelections;
this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
});
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
* 去重
*
* @memberof WFGroupMPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
}
/**
......
......@@ -747,9 +747,18 @@ export default class WFUserMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]);
}
});
this.viewSelections = newSelections;
this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
});
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
* 去重
*
* @memberof WFUserMPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
}
/**
......
......@@ -53,7 +53,7 @@ export default class WFGroupServiceBase extends EntityService {
}
/**
* Save接口方法
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -61,7 +61,7 @@ export default class WFGroupServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFGroupServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let wfmembersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_wfmembers'),'undefined')){
......@@ -79,8 +79,15 @@ export default class WFGroupServiceBase extends EntityService {
}
masterData.wfmembers = wfmembersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfgroups/${context.wfgroup}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers));
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/wfgroups`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers));
return res;
}
......@@ -116,6 +123,35 @@ export default class WFGroupServiceBase extends EntityService {
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFGroupServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/wfgroups/${context.wfgroup}`,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFGroupServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfgroups/${context.wfgroup}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers));
return res;
}
/**
* GetDraft接口方法
*
......@@ -147,7 +183,7 @@ export default class WFGroupServiceBase extends EntityService {
}
/**
* Create接口方法
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -155,7 +191,7 @@ export default class WFGroupServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFGroupServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let wfmembersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_wfmembers'),'undefined')){
......@@ -173,43 +209,7 @@ export default class WFGroupServiceBase extends EntityService {
}
masterData.wfmembers = wfmembersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/wfgroups`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers));
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFGroupServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/wfgroups/${context.wfgroup}`,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFGroupServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfgroups/${context.wfgroup}`,isloading);
let res:any = await Http.getInstance().post(`/wfgroups/${context.wfgroup}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers));
return res;
}
......
......@@ -58,53 +58,6 @@ export default class WFMemberServiceBase extends EntityService {
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}/checkkey`,data,isloading);
}
if(context.wfgroup && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}/checkkey`,data,isloading);
}
let res:any = await Http.getInstance().post(`/wfmembers/${context.wfmember}/checkkey`,data,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && true){
let res:any = await Http.getInstance().get(`/wfusers/${context.wfuser}/wfmembers/getdraft`,isloading);
res.data.wfmember = data.wfmember;
}
if(context.wfgroup && true){
let res:any = await Http.getInstance().get(`/wfgroups/${context.wfgroup}/wfmembers/getdraft`,isloading);
res.data.wfmember = data.wfmember;
}
let res:any = await Http.getInstance().get(`/wfmembers/getdraft`,isloading);
res.data.wfmember = data.wfmember;
return res;
}
/**
* Create接口方法
*
......@@ -152,6 +105,32 @@ export default class WFMemberServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}`,data,isloading);
}
if(context.wfgroup && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}`,data,isloading);
}
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfmembers/${context.wfmember}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
......@@ -173,7 +152,7 @@ export default class WFMemberServiceBase extends EntityService {
}
/**
* Save接口方法
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -181,25 +160,19 @@ export default class WFMemberServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}/save`,data,isloading);
let res:any = await Http.getInstance().get(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}`,isloading);
}
if(context.wfgroup && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}/save`,data,isloading);
let res:any = await Http.getInstance().get(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}`,isloading);
}
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfmembers/${context.wfmember}/save`,data,isloading);
let res:any = await Http.getInstance().get(`/wfmembers/${context.wfmember}`,isloading);
return res;
}
/**
* Update接口方法
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -207,25 +180,46 @@ export default class WFMemberServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && true){
let res:any = await Http.getInstance().get(`/wfusers/${context.wfuser}/wfmembers/getdraft`,isloading);
res.data.wfmember = data.wfmember;
}
if(context.wfgroup && true){
let res:any = await Http.getInstance().get(`/wfgroups/${context.wfgroup}/wfmembers/getdraft`,isloading);
res.data.wfmember = data.wfmember;
}
let res:any = await Http.getInstance().get(`/wfmembers/getdraft`,isloading);
res.data.wfmember = data.wfmember;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}`,data,isloading);
let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}/checkkey`,data,isloading);
}
if(context.wfgroup && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}`,data,isloading);
let res:any = await Http.getInstance().post(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}/checkkey`,data,isloading);
}
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfmembers/${context.wfmember}`,data,isloading);
let res:any = await Http.getInstance().post(`/wfmembers/${context.wfmember}/checkkey`,data,isloading);
return res;
}
/**
* Get接口方法
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -233,14 +227,20 @@ export default class WFMemberServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && context.wfmember){
let res:any = await Http.getInstance().get(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}`,isloading);
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}/save`,data,isloading);
}
if(context.wfgroup && context.wfmember){
let res:any = await Http.getInstance().get(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}`,isloading);
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}/save`,data,isloading);
}
let res:any = await Http.getInstance().get(`/wfmembers/${context.wfmember}`,isloading);
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfmembers/${context.wfmember}/save`,data,isloading);
return res;
}
......
......@@ -53,7 +53,7 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
}
/**
* Save接口方法
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -61,10 +61,17 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfprocessdefinitions/${context.wfprocessdefinition}/save`,data,isloading);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/wfprocessdefinitions`,data,isloading);
return res;
}
......@@ -85,7 +92,7 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
}
/**
* Get接口方法
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -93,13 +100,13 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfprocessdefinitions/${context.wfprocessdefinition}`,isloading);
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/wfprocessdefinitions/${context.wfprocessdefinition}`,isloading);
return res;
}
/**
* CheckKey接口方法
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -107,8 +114,8 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/wfprocessdefinitions/${context.wfprocessdefinition}/checkkey`,data,isloading);
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfprocessdefinitions/${context.wfprocessdefinition}`,isloading);
return res;
}
......@@ -128,7 +135,7 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
}
/**
* Create接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -136,22 +143,13 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/wfprocessdefinitions`,data,isloading);
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/wfprocessdefinitions/${context.wfprocessdefinition}/checkkey`,data,isloading);
return res;
}
/**
* Remove接口方法
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -159,8 +157,10 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/wfprocessdefinitions/${context.wfprocessdefinition}`,isloading);
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfprocessdefinitions/${context.wfprocessdefinition}/save`,data,isloading);
return res;
}
......
......@@ -53,7 +53,7 @@ export default class WFREModelServiceBase extends EntityService {
}
/**
* Update接口方法
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -61,15 +61,22 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfremodels/${context.wfremodel}`,data,isloading);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/wfremodels`,data,isloading);
return res;
}
/**
* Save接口方法
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -77,15 +84,15 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfremodels/${context.wfremodel}/save`,data,isloading);
let res:any = await Http.getInstance().put(`/wfremodels/${context.wfremodel}`,data,isloading);
return res;
}
/**
* Get接口方法
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -93,13 +100,13 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfremodels/${context.wfremodel}`,isloading);
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/wfremodels/${context.wfremodel}`,isloading);
return res;
}
/**
* Create接口方法
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -107,22 +114,13 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/wfremodels`,data,isloading);
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfremodels/${context.wfremodel}`,isloading);
return res;
}
/**
* CheckKey接口方法
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -130,13 +128,14 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/wfremodels/${context.wfremodel}/checkkey`,data,isloading);
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfremodels/getdraft`,isloading);
res.data.wfremodel = data.wfremodel;
return res;
}
/**
* Remove接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -144,13 +143,13 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/wfremodels/${context.wfremodel}`,isloading);
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/wfremodels/${context.wfremodel}/checkkey`,data,isloading);
return res;
}
/**
* GetDraft接口方法
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -158,9 +157,10 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfremodels/getdraft`,isloading);
res.data.wfremodel = data.wfremodel;
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfremodels/${context.wfremodel}/save`,data,isloading);
return res;
}
......
......@@ -53,7 +53,7 @@ export default class WFSystemServiceBase extends EntityService {
}
/**
* Remove接口方法
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -61,8 +61,17 @@ export default class WFSystemServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFSystemServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/wfsystems/${context.wfsystem}`,isloading);
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/wfsystems`,data,isloading);
return res;
}
......@@ -83,7 +92,7 @@ export default class WFSystemServiceBase extends EntityService {
}
/**
* GetDraft接口方法
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -91,14 +100,13 @@ export default class WFSystemServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFSystemServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfsystems/getdraft`,isloading);
res.data.wfsystem = data.wfsystem;
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/wfsystems/${context.wfsystem}`,isloading);
return res;
}
/**
* Save接口方法
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -106,15 +114,13 @@ export default class WFSystemServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFSystemServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfsystems/${context.wfsystem}/save`,data,isloading);
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfsystems/${context.wfsystem}`,isloading);
return res;
}
/**
* Create接口方法
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -122,17 +128,9 @@ export default class WFSystemServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFSystemServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/wfsystems`,data,isloading);
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfsystems/getdraft`,isloading);
res.data.wfsystem = data.wfsystem;
return res;
}
......@@ -151,7 +149,7 @@ export default class WFSystemServiceBase extends EntityService {
}
/**
* Get接口方法
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -159,8 +157,10 @@ export default class WFSystemServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFSystemServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfsystems/${context.wfsystem}`,isloading);
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfsystems/${context.wfsystem}/save`,data,isloading);
return res;
}
......
......@@ -53,37 +53,7 @@ export default class WFUserServiceBase extends EntityService {
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/wfusers/${context.wfuser}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfusers/getdraft`,isloading);
res.data.wfuser = data.wfuser;
this.tempStorage.setItem(context.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers));
return res;
}
/**
* Save接口方法
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -91,7 +61,7 @@ export default class WFUserServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let wfmembersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_wfmembers'),'undefined')){
......@@ -109,8 +79,15 @@ export default class WFUserServiceBase extends EntityService {
}
masterData.wfmembers = wfmembersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers));
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/wfusers`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers));
return res;
}
......@@ -146,6 +123,20 @@ export default class WFUserServiceBase extends EntityService {
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/wfusers/${context.wfuser}`,isloading);
return res;
}
/**
* Get接口方法
*
......@@ -162,7 +153,7 @@ export default class WFUserServiceBase extends EntityService {
}
/**
* Create接口方法
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -170,7 +161,37 @@ export default class WFUserServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfusers/getdraft`,isloading);
res.data.wfuser = data.wfuser;
this.tempStorage.setItem(context.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers));
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/checkkey`,data,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let wfmembersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_wfmembers'),'undefined')){
......@@ -188,29 +209,8 @@ export default class WFUserServiceBase extends EntityService {
}
masterData.wfmembers = wfmembersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/wfusers`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers));
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/checkkey`,data,isloading);
let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers));
return res;
}
......
......@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IWFGroupService extends IService<WFGroup>{
boolean save(WFGroup et) ;
void saveBatch(List<WFGroup> list) ;
boolean update(WFGroup et) ;
void updateBatch(List<WFGroup> list) ;
WFGroup getDraft(WFGroup et) ;
boolean checkKey(WFGroup et) ;
boolean create(WFGroup et) ;
void createBatch(List<WFGroup> list) ;
boolean update(WFGroup et) ;
void updateBatch(List<WFGroup> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFGroup get(String key) ;
WFGroup getDraft(WFGroup et) ;
boolean checkKey(WFGroup et) ;
boolean save(WFGroup et) ;
void saveBatch(List<WFGroup> list) ;
Page<WFGroup> searchDefault(WFGroupSearchContext context) ;
/**
*自定义查询SQL
......
......@@ -23,17 +23,17 @@ import cn.ibizlab.core.workflow.filter.WFHistorySearchContext;
*/
public interface IWFHistoryService{
boolean checkKey(WFHistory et) ;
boolean update(WFHistory et) ;
void updateBatch(List<WFHistory> list) ;
boolean save(WFHistory et) ;
void saveBatch(List<WFHistory> list) ;
boolean create(WFHistory et) ;
void createBatch(List<WFHistory> list) ;
WFHistory get(String key) ;
boolean update(WFHistory et) ;
void updateBatch(List<WFHistory> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFHistory get(String key) ;
WFHistory getDraft(WFHistory et) ;
boolean checkKey(WFHistory et) ;
boolean save(WFHistory et) ;
void saveBatch(List<WFHistory> list) ;
Page<WFHistory> searchDefault(WFHistorySearchContext context) ;
}
......
......@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IWFMemberService extends IService<WFMember>{
boolean checkKey(WFMember et) ;
WFMember getDraft(WFMember et) ;
boolean create(WFMember et) ;
void createBatch(List<WFMember> list) ;
boolean update(WFMember et) ;
void updateBatch(List<WFMember> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFMember get(String key) ;
WFMember getDraft(WFMember et) ;
boolean checkKey(WFMember et) ;
boolean save(WFMember et) ;
void saveBatch(List<WFMember> list) ;
boolean update(WFMember et) ;
void updateBatch(List<WFMember> list) ;
WFMember get(String key) ;
Page<WFMember> searchDefault(WFMemberSearchContext context) ;
List<WFMember> selectByGroupid(String id) ;
void removeByGroupid(String id) ;
......
......@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IWFProcessDefinitionService extends IService<WFProcessDefinition>{
boolean save(WFProcessDefinition et) ;
void saveBatch(List<WFProcessDefinition> list) ;
boolean update(WFProcessDefinition et) ;
void updateBatch(List<WFProcessDefinition> list) ;
WFProcessDefinition get(String key) ;
boolean checkKey(WFProcessDefinition et) ;
WFProcessDefinition getDraft(WFProcessDefinition et) ;
boolean create(WFProcessDefinition et) ;
void createBatch(List<WFProcessDefinition> list) ;
boolean update(WFProcessDefinition et) ;
void updateBatch(List<WFProcessDefinition> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFProcessDefinition get(String key) ;
WFProcessDefinition getDraft(WFProcessDefinition et) ;
boolean checkKey(WFProcessDefinition et) ;
boolean save(WFProcessDefinition et) ;
void saveBatch(List<WFProcessDefinition> list) ;
Page<WFProcessDefinition> searchDefault(WFProcessDefinitionSearchContext context) ;
/**
*自定义查询SQL
......
......@@ -23,17 +23,17 @@ import cn.ibizlab.core.workflow.filter.WFProcessInstanceSearchContext;
*/
public interface IWFProcessInstanceService{
boolean create(WFProcessInstance et) ;
void createBatch(List<WFProcessInstance> list) ;
boolean update(WFProcessInstance et) ;
void updateBatch(List<WFProcessInstance> list) ;
boolean save(WFProcessInstance et) ;
void saveBatch(List<WFProcessInstance> list) ;
WFProcessInstance getDraft(WFProcessInstance et) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFProcessInstance get(String key) ;
WFProcessInstance getDraft(WFProcessInstance et) ;
boolean checkKey(WFProcessInstance et) ;
boolean create(WFProcessInstance et) ;
void createBatch(List<WFProcessInstance> list) ;
boolean save(WFProcessInstance et) ;
void saveBatch(List<WFProcessInstance> list) ;
Page<WFProcessInstance> searchDefault(WFProcessInstanceSearchContext context) ;
}
......
......@@ -23,17 +23,17 @@ import cn.ibizlab.core.workflow.filter.WFProcessNodeSearchContext;
*/
public interface IWFProcessNodeService{
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
boolean checkKey(WFProcessNode et) ;
boolean save(WFProcessNode et) ;
void saveBatch(List<WFProcessNode> list) ;
WFProcessNode get(String key) ;
boolean create(WFProcessNode et) ;
void createBatch(List<WFProcessNode> list) ;
boolean update(WFProcessNode et) ;
void updateBatch(List<WFProcessNode> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFProcessNode get(String key) ;
WFProcessNode getDraft(WFProcessNode et) ;
boolean checkKey(WFProcessNode et) ;
boolean save(WFProcessNode et) ;
void saveBatch(List<WFProcessNode> list) ;
Page<WFProcessNode> searchDefault(WFProcessNodeSearchContext context) ;
}
......
......@@ -23,17 +23,17 @@ import cn.ibizlab.core.workflow.filter.WFREModelSearchContext;
*/
public interface IWFREModelService{
boolean update(WFREModel et) ;
void updateBatch(List<WFREModel> list) ;
boolean save(WFREModel et) ;
void saveBatch(List<WFREModel> list) ;
WFREModel get(String key) ;
boolean create(WFREModel et) ;
void createBatch(List<WFREModel> list) ;
boolean checkKey(WFREModel et) ;
boolean update(WFREModel et) ;
void updateBatch(List<WFREModel> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFREModel get(String key) ;
WFREModel getDraft(WFREModel et) ;
boolean checkKey(WFREModel et) ;
boolean save(WFREModel et) ;
void saveBatch(List<WFREModel> list) ;
Page<WFREModel> searchDefault(WFREModelSearchContext context) ;
}
......
......@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IWFSystemService extends IService<WFSystem>{
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
boolean create(WFSystem et) ;
void createBatch(List<WFSystem> list) ;
boolean update(WFSystem et) ;
void updateBatch(List<WFSystem> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFSystem get(String key) ;
WFSystem getDraft(WFSystem et) ;
boolean checkKey(WFSystem et) ;
boolean save(WFSystem et) ;
void saveBatch(List<WFSystem> list) ;
boolean create(WFSystem et) ;
void createBatch(List<WFSystem> list) ;
boolean checkKey(WFSystem et) ;
WFSystem get(String key) ;
Page<WFSystem> searchDefault(WFSystemSearchContext context) ;
/**
*自定义查询SQL
......
......@@ -25,13 +25,13 @@ public interface IWFTaskService{
boolean create(WFTask et) ;
void createBatch(List<WFTask> list) ;
WFTask getDraft(WFTask et) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
boolean checkKey(WFTask et) ;
boolean update(WFTask et) ;
void updateBatch(List<WFTask> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFTask get(String key) ;
WFTask getDraft(WFTask et) ;
boolean checkKey(WFTask et) ;
boolean save(WFTask et) ;
void saveBatch(List<WFTask> list) ;
Page<WFTask> searchDefault(WFTaskSearchContext context) ;
......
......@@ -23,15 +23,15 @@ import cn.ibizlab.core.workflow.filter.WFTaskWaySearchContext;
*/
public interface IWFTaskWayService{
boolean checkKey(WFTaskWay et) ;
boolean create(WFTaskWay et) ;
void createBatch(List<WFTaskWay> list) ;
WFTaskWay getDraft(WFTaskWay et) ;
WFTaskWay get(String key) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
boolean update(WFTaskWay et) ;
void updateBatch(List<WFTaskWay> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFTaskWay get(String key) ;
WFTaskWay getDraft(WFTaskWay et) ;
boolean checkKey(WFTaskWay et) ;
boolean save(WFTaskWay et) ;
void saveBatch(List<WFTaskWay> list) ;
Page<WFTaskWay> searchDefault(WFTaskWaySearchContext context) ;
......
......@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IWFUserService extends IService<WFUser>{
boolean create(WFUser et) ;
void createBatch(List<WFUser> list) ;
boolean update(WFUser et) ;
void updateBatch(List<WFUser> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFUser get(String key) ;
WFUser getDraft(WFUser et) ;
boolean checkKey(WFUser et) ;
boolean save(WFUser et) ;
void saveBatch(List<WFUser> list) ;
boolean update(WFUser et) ;
void updateBatch(List<WFUser> list) ;
WFUser get(String key) ;
boolean create(WFUser et) ;
void createBatch(List<WFUser> list) ;
boolean checkKey(WFUser et) ;
Page<WFUser> searchDefault(WFUserSearchContext context) ;
/**
*自定义查询SQL
......
......@@ -52,33 +52,17 @@ public class WFGroupServiceImpl extends ServiceImpl<WFGroupMapper, WFGroup> impl
@Override
@Transactional
public boolean save(WFGroup et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(WFGroup et) {
if (null == et) {
public boolean create(WFGroup et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<WFGroup> list) {
saveOrUpdateBatch(list,batchSize);
wfmemberService.saveByGroupid(et.getId(),et.getWfmember());
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void saveBatch(List<WFGroup> list) {
saveOrUpdateBatch(list,batchSize);
public void createBatch(List<WFGroup> list) {
this.saveBatch(list,batchSize);
}
@Override
......@@ -96,30 +80,6 @@ public class WFGroupServiceImpl extends ServiceImpl<WFGroupMapper, WFGroup> impl
updateBatchById(list,batchSize);
}
@Override
public WFGroup getDraft(WFGroup et) {
return et;
}
@Override
public boolean checkKey(WFGroup et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean create(WFGroup et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
wfmemberService.saveByGroupid(et.getId(),et.getWfmember());
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void createBatch(List<WFGroup> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
......@@ -147,6 +107,46 @@ public class WFGroupServiceImpl extends ServiceImpl<WFGroupMapper, WFGroup> impl
return et;
}
@Override
public WFGroup getDraft(WFGroup et) {
return et;
}
@Override
public boolean checkKey(WFGroup et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(WFGroup et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(WFGroup et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<WFGroup> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<WFGroup> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
......
......@@ -39,39 +39,32 @@ public class WFHistoryServiceImpl implements IWFHistoryService {
@Override
public boolean checkKey(WFHistory et) {
return false;
}
@Override
public boolean update(WFHistory et) {
public boolean create(WFHistory et) {
//代码实现
return true;
}
public void updateBatch(List<WFHistory> list){
public void createBatch(List<WFHistory> list){
}
@Override
@Transactional
public boolean save(WFHistory et) {
public boolean update(WFHistory et) {
//代码实现
return true;
}
@Override
public void saveBatch(List<WFHistory> list) {
public void updateBatch(List<WFHistory> list){
}
@Override
public boolean create(WFHistory et) {
//代码实现
public boolean remove(String key) {
return true;
}
public void createBatch(List<WFHistory> list){
public void removeBatch(Collection<String> idList){
}
@Override
......@@ -82,17 +75,24 @@ public class WFHistoryServiceImpl implements IWFHistoryService {
}
@Override
public boolean remove(String key) {
return true;
public WFHistory getDraft(WFHistory et) {
return et;
}
public void removeBatch(Collection<String> idList){
@Override
public boolean checkKey(WFHistory et) {
return false;
}
@Override
@Transactional
public boolean save(WFHistory et) {
//代码实现
return true;
}
@Override
public WFHistory getDraft(WFHistory et) {
return et;
public void saveBatch(List<WFHistory> list) {
}
......
......@@ -54,29 +54,35 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i
protected int batchSize = 500;
@Override
public boolean checkKey(WFMember et) {
return (!ObjectUtils.isEmpty(et.getMemberid()))&&(!Objects.isNull(this.getById(et.getMemberid())));
@Transactional
public boolean create(WFMember et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getMemberid()),et);
return true;
}
@Override
public WFMember getDraft(WFMember et) {
fillParentData(et);
return et;
public void createBatch(List<WFMember> list) {
list.forEach(item->fillParentData(item));
this.saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public boolean create(WFMember et) {
public boolean update(WFMember et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("memberid",et.getMemberid())))
return false;
CachedBeanCopier.copy(get(et.getMemberid()),et);
return true;
}
@Override
public void createBatch(List<WFMember> list) {
public void updateBatch(List<WFMember> list) {
list.forEach(item->fillParentData(item));
this.saveOrUpdateBatch(list,batchSize);
updateBatchById(list,batchSize);
}
@Override
......@@ -91,6 +97,29 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i
removeByIds(idList);
}
@Override
@Transactional
public WFMember get(String key) {
WFMember et = getById(key);
if(et==null){
et=new WFMember();
et.setMemberid(key);
}
else{
}
return et;
}
@Override
public WFMember getDraft(WFMember et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(WFMember et) {
return (!ObjectUtils.isEmpty(et.getMemberid()))&&(!Objects.isNull(this.getById(et.getMemberid())));
}
@Override
@Transactional
public boolean save(WFMember et) {
......@@ -124,35 +153,6 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i
saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(WFMember et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("memberid",et.getMemberid())))
return false;
CachedBeanCopier.copy(get(et.getMemberid()),et);
return true;
}
@Override
public void updateBatch(List<WFMember> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
@Override
@Transactional
public WFMember get(String key) {
WFMember et = getById(key);
if(et==null){
et=new WFMember();
et.setMemberid(key);
}
else{
}
return et;
}
@Override
public List<WFMember> selectByGroupid(String id) {
......
......@@ -49,33 +49,16 @@ public class WFProcessDefinitionServiceImpl extends ServiceImpl<WFProcessDefinit
@Override
@Transactional
public boolean save(WFProcessDefinition et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(WFProcessDefinition et) {
if (null == et) {
public boolean create(WFProcessDefinition et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<WFProcessDefinition> list) {
saveOrUpdateBatch(list,batchSize);
CachedBeanCopier.copy(get(et.getDefinitionkey()),et);
return true;
}
@Override
public void saveBatch(List<WFProcessDefinition> list) {
saveOrUpdateBatch(list,batchSize);
public void createBatch(List<WFProcessDefinition> list) {
this.saveBatch(list,batchSize);
}
@Override
......@@ -92,6 +75,18 @@ public class WFProcessDefinitionServiceImpl extends ServiceImpl<WFProcessDefinit
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public WFProcessDefinition get(String key) {
......@@ -105,39 +100,44 @@ public class WFProcessDefinitionServiceImpl extends ServiceImpl<WFProcessDefinit
return et;
}
@Override
public boolean checkKey(WFProcessDefinition et) {
return (!ObjectUtils.isEmpty(et.getDefinitionkey()))&&(!Objects.isNull(this.getById(et.getDefinitionkey())));
}
@Override
public WFProcessDefinition getDraft(WFProcessDefinition et) {
return et;
}
@Override
public boolean checkKey(WFProcessDefinition et) {
return (!ObjectUtils.isEmpty(et.getDefinitionkey()))&&(!Objects.isNull(this.getById(et.getDefinitionkey())));
}
@Override
@Transactional
public boolean create(WFProcessDefinition et) {
if(!this.retBool(this.baseMapper.insert(et)))
public boolean save(WFProcessDefinition et) {
if(!saveOrUpdate(et))
return false;
CachedBeanCopier.copy(get(et.getDefinitionkey()),et);
return true;
}
@Override
public void createBatch(List<WFProcessDefinition> list) {
this.saveBatch(list,batchSize);
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(WFProcessDefinition et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
public boolean saveBatch(Collection<WFProcessDefinition> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
public void saveBatch(List<WFProcessDefinition> list) {
saveOrUpdateBatch(list,batchSize);
}
......
......@@ -39,30 +39,23 @@ public class WFProcessInstanceServiceImpl implements IWFProcessInstanceService {
@Override
public boolean update(WFProcessInstance et) {
public boolean create(WFProcessInstance et) {
//代码实现
return true;
}
public void updateBatch(List<WFProcessInstance> list){
public void createBatch(List<WFProcessInstance> list){
}
@Override
@Transactional
public boolean save(WFProcessInstance et) {
public boolean update(WFProcessInstance et) {
//代码实现
return true;
}
@Override
public void saveBatch(List<WFProcessInstance> list) {
}
@Override
public WFProcessInstance getDraft(WFProcessInstance et) {
return et;
public void updateBatch(List<WFProcessInstance> list){
}
@Override
......@@ -81,18 +74,25 @@ public class WFProcessInstanceServiceImpl implements IWFProcessInstanceService {
return et;
}
@Override
public WFProcessInstance getDraft(WFProcessInstance et) {
return et;
}
@Override
public boolean checkKey(WFProcessInstance et) {
return false;
}
@Override
public boolean create(WFProcessInstance et) {
@Transactional
public boolean save(WFProcessInstance et) {
//代码实现
return true;
}
public void createBatch(List<WFProcessInstance> list){
@Override
public void saveBatch(List<WFProcessInstance> list) {
}
......
......@@ -39,28 +39,32 @@ public class WFProcessNodeServiceImpl implements IWFProcessNodeService {
@Override
public boolean remove(String key) {
public boolean create(WFProcessNode et) {
//代码实现
return true;
}
public void removeBatch(Collection<String> idList){
}
public void createBatch(List<WFProcessNode> list){
@Override
public boolean checkKey(WFProcessNode et) {
return false;
}
@Override
@Transactional
public boolean save(WFProcessNode et) {
public boolean update(WFProcessNode et) {
//代码实现
return true;
}
public void updateBatch(List<WFProcessNode> list){
}
@Override
public void saveBatch(List<WFProcessNode> list) {
public boolean remove(String key) {
return true;
}
public void removeBatch(Collection<String> idList){
}
@Override
......@@ -71,28 +75,24 @@ public class WFProcessNodeServiceImpl implements IWFProcessNodeService {
}
@Override
public boolean create(WFProcessNode et) {
//代码实现
return true;
public WFProcessNode getDraft(WFProcessNode et) {
return et;
}
public void createBatch(List<WFProcessNode> list){
@Override
public boolean checkKey(WFProcessNode et) {
return false;
}
@Override
public boolean update(WFProcessNode et) {
@Transactional
public boolean save(WFProcessNode et) {
//代码实现
return true;
}
public void updateBatch(List<WFProcessNode> list){
}
@Override
public WFProcessNode getDraft(WFProcessNode et) {
return et;
public void saveBatch(List<WFProcessNode> list) {
}
......
......@@ -49,14 +49,16 @@ public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> i
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
public boolean create(WFSystem et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getPssystemid()),et);
return true;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
public void createBatch(List<WFSystem> list) {
this.saveBatch(list,batchSize);
}
@Override
......@@ -73,11 +75,40 @@ public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> i
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public WFSystem get(String key) {
WFSystem et = getById(key);
if(et==null){
et=new WFSystem();
et.setPssystemid(key);
}
else{
}
return et;
}
@Override
public WFSystem getDraft(WFSystem et) {
return et;
}
@Override
public boolean checkKey(WFSystem et) {
return (!ObjectUtils.isEmpty(et.getPssystemid()))&&(!Objects.isNull(this.getById(et.getPssystemid())));
}
@Override
@Transactional
public boolean save(WFSystem et) {
......@@ -109,37 +140,6 @@ public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> i
saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public boolean create(WFSystem et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getPssystemid()),et);
return true;
}
@Override
public void createBatch(List<WFSystem> list) {
this.saveBatch(list,batchSize);
}
@Override
public boolean checkKey(WFSystem et) {
return (!ObjectUtils.isEmpty(et.getPssystemid()))&&(!Objects.isNull(this.getById(et.getPssystemid())));
}
@Override
@Transactional
public WFSystem get(String key) {
WFSystem et = getById(key);
if(et==null){
et=new WFSystem();
et.setPssystemid(key);
}
else{
}
return et;
}
/**
......
......@@ -49,31 +49,22 @@ public class WFTaskServiceImpl implements IWFTaskService {
}
@Override
public WFTask getDraft(WFTask et) {
return et;
}
@Override
public boolean remove(String key) {
public boolean update(WFTask et) {
//代码实现
return true;
}
public void removeBatch(Collection<String> idList){
public void updateBatch(List<WFTask> list){
}
@Override
public boolean checkKey(WFTask et) {
return false;
}
@Override
public boolean update(WFTask et) {
//代码实现
public boolean remove(String key) {
return true;
}
public void updateBatch(List<WFTask> list){
public void removeBatch(Collection<String> idList){
}
@Override
......@@ -83,6 +74,15 @@ public class WFTaskServiceImpl implements IWFTaskService {
return et;
}
@Override
public WFTask getDraft(WFTask et) {
return et;
}
@Override
public boolean checkKey(WFTask et) {
return false;
}
@Override
@Transactional
public boolean save(WFTask et) {
......
......@@ -38,10 +38,6 @@ import cn.ibizlab.util.helper.CachedBeanCopier;
public class WFTaskWayServiceImpl implements IWFTaskWayService {
@Override
public boolean checkKey(WFTaskWay et) {
return false;
}
@Override
public boolean create(WFTaskWay et) {
//代码实现
......@@ -53,15 +49,13 @@ public class WFTaskWayServiceImpl implements IWFTaskWayService {
}
@Override
public WFTaskWay getDraft(WFTaskWay et) {
return et;
public boolean update(WFTaskWay et) {
//代码实现
return true;
}
@Override
public WFTaskWay get(String key) {
WFTaskWay et = new WFTaskWay();
et.setSequenceflowid(key);
return et;
public void updateBatch(List<WFTaskWay> list){
}
@Override
......@@ -74,15 +68,21 @@ public class WFTaskWayServiceImpl implements IWFTaskWayService {
}
@Override
public boolean update(WFTaskWay et) {
//代码实现
return true;
public WFTaskWay get(String key) {
WFTaskWay et = new WFTaskWay();
et.setSequenceflowid(key);
return et;
}
public void updateBatch(List<WFTaskWay> list){
@Override
public WFTaskWay getDraft(WFTaskWay et) {
return et;
}
@Override
public boolean checkKey(WFTaskWay et) {
return false;
}
@Override
@Transactional
public boolean save(WFTaskWay et) {
......
......@@ -50,6 +50,34 @@ public class WFUserServiceImpl extends ServiceImpl<WFUserMapper, WFUser> impleme
protected int batchSize = 500;
@Override
@Transactional
public boolean create(WFUser et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void createBatch(List<WFUser> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(WFUser et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("userid",et.getId())))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void updateBatch(List<WFUser> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
......@@ -62,11 +90,28 @@ public class WFUserServiceImpl extends ServiceImpl<WFUserMapper, WFUser> impleme
removeByIds(idList);
}
@Override
@Transactional
public WFUser get(String key) {
WFUser et = getById(key);
if(et==null){
et=new WFUser();
et.setId(key);
}
else{
}
return et;
}
@Override
public WFUser getDraft(WFUser et) {
return et;
}
@Override
public boolean checkKey(WFUser et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(WFUser et) {
......@@ -98,51 +143,6 @@ public class WFUserServiceImpl extends ServiceImpl<WFUserMapper, WFUser> impleme
saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(WFUser et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("userid",et.getId())))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void updateBatch(List<WFUser> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public WFUser get(String key) {
WFUser et = getById(key);
if(et==null){
et=new WFUser();
et.setId(key);
}
else{
}
return et;
}
@Override
@Transactional
public boolean create(WFUser et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void createBatch(List<WFUser> list) {
this.saveBatch(list,batchSize);
}
@Override
public boolean checkKey(WFUser et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
/**
......
......@@ -8,7 +8,7 @@
"delogicname":"流程模型",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
......@@ -16,7 +16,7 @@
"delogicname":"成员",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
......@@ -24,7 +24,7 @@
"delogicname":"角色/用户组",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
......@@ -32,7 +32,7 @@
"delogicname":"用户",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
......@@ -40,7 +40,7 @@
"delogicname":"流程定义",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
......@@ -48,7 +48,7 @@
"delogicname":"系统",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
],
......
......@@ -47,18 +47,22 @@ public class WFGroupResource {
@Lazy
public WFGroupMapping wfgroupMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Save-all')")
@ApiOperation(value = "保存角色/用户组", tags = {"角色/用户组" }, notes = "保存角色/用户组")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/save")
public ResponseEntity<Boolean> save(@RequestBody WFGroupDTO wfgroupdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfgroupService.save(wfgroupMapping.toDomain(wfgroupdto)));
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Create-all')")
@ApiOperation(value = "新建角色/用户组", tags = {"角色/用户组" }, notes = "新建角色/用户组")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups")
@Transactional
public ResponseEntity<WFGroupDTO> create(@RequestBody WFGroupDTO wfgroupdto) {
WFGroup domain = wfgroupMapping.toDomain(wfgroupdto);
wfgroupService.create(domain);
WFGroupDTO dto = wfgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Save-all')")
@ApiOperation(value = "批量保存角色/用户组", tags = {"角色/用户组" }, notes = "批量保存角色/用户组")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) {
wfgroupService.saveBatch(wfgroupMapping.toDomain(wfgroupdtos));
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Create-all')")
@ApiOperation(value = "批量新建角色/用户组", tags = {"角色/用户组" }, notes = "批量新建角色/用户组")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) {
wfgroupService.createBatch(wfgroupMapping.toDomain(wfgroupdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
......@@ -82,37 +86,6 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取角色/用户组草稿", tags = {"角色/用户组" }, notes = "获取角色/用户组草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfgroups/getdraft")
public ResponseEntity<WFGroupDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfgroupMapping.toDto(wfgroupService.getDraft(new WFGroup())));
}
@ApiOperation(value = "检查角色/用户组", tags = {"角色/用户组" }, notes = "检查角色/用户组")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WFGroupDTO wfgroupdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfgroupService.checkKey(wfgroupMapping.toDomain(wfgroupdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Create-all')")
@ApiOperation(value = "新建角色/用户组", tags = {"角色/用户组" }, notes = "新建角色/用户组")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups")
@Transactional
public ResponseEntity<WFGroupDTO> create(@RequestBody WFGroupDTO wfgroupdto) {
WFGroup domain = wfgroupMapping.toDomain(wfgroupdto);
wfgroupService.create(domain);
WFGroupDTO dto = wfgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Create-all')")
@ApiOperation(value = "批量新建角色/用户组", tags = {"角色/用户组" }, notes = "批量新建角色/用户组")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) {
wfgroupService.createBatch(wfgroupMapping.toDomain(wfgroupdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Remove-all')")
@ApiOperation(value = "删除角色/用户组", tags = {"角色/用户组" }, notes = "删除角色/用户组")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfgroups/{wfgroup_id}")
......@@ -138,7 +111,34 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-searchDefault-all')")
@ApiOperation(value = "获取角色/用户组草稿", tags = {"角色/用户组" }, notes = "获取角色/用户组草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfgroups/getdraft")
public ResponseEntity<WFGroupDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfgroupMapping.toDto(wfgroupService.getDraft(new WFGroup())));
}
@ApiOperation(value = "检查角色/用户组", tags = {"角色/用户组" }, notes = "检查角色/用户组")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WFGroupDTO wfgroupdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfgroupService.checkKey(wfgroupMapping.toDomain(wfgroupdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Save-all')")
@ApiOperation(value = "保存角色/用户组", tags = {"角色/用户组" }, notes = "保存角色/用户组")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/save")
public ResponseEntity<Boolean> save(@RequestBody WFGroupDTO wfgroupdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfgroupService.save(wfgroupMapping.toDomain(wfgroupdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Save-all')")
@ApiOperation(value = "批量保存角色/用户组", tags = {"角色/用户组" }, notes = "批量保存角色/用户组")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) {
wfgroupService.saveBatch(wfgroupMapping.toDomain(wfgroupdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-searchDefault-all') and hasPermission(#context,'ibzwf-WFGroup-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"角色/用户组" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfgroups/fetchdefault")
public ResponseEntity<List<WFGroupDTO>> fetchDefault(WFGroupSearchContext context) {
......@@ -151,7 +151,7 @@ public class WFGroupResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-searchDefault-all') and hasPermission(#context,'ibzwf-WFGroup-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"角色/用户组" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfgroups/searchdefault")
public ResponseEntity<Page<WFGroupDTO>> searchDefault(@RequestBody WFGroupSearchContext context) {
......
......@@ -47,6 +47,23 @@ public class WFREModelResource {
@Lazy
public WFREModelMapping wfremodelMapping;
@ApiOperation(value = "新建流程模型", tags = {"流程模型" }, notes = "新建流程模型")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels")
@Transactional
public ResponseEntity<WFREModelDTO> create(@RequestBody WFREModelDTO wfremodeldto) {
WFREModel domain = wfremodelMapping.toDomain(wfremodeldto);
wfremodelService.create(domain);
WFREModelDTO dto = wfremodelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量新建流程模型", tags = {"流程模型" }, notes = "批量新建流程模型")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) {
wfremodelService.createBatch(wfremodelMapping.toDomain(wfremodeldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "更新流程模型", tags = {"流程模型" }, notes = "更新流程模型")
@RequestMapping(method = RequestMethod.PUT, value = "/wfremodels/{wfremodel_id}")
@Transactional
......@@ -65,16 +82,17 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "保存流程模型", tags = {"流程模型" }, notes = "保存流程模型")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels/save")
public ResponseEntity<Boolean> save(@RequestBody WFREModelDTO wfremodeldto) {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.save(wfremodelMapping.toDomain(wfremodeldto)));
@ApiOperation(value = "删除流程模型", tags = {"流程模型" }, notes = "删除流程模型")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfremodels/{wfremodel_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("wfremodel_id") String wfremodel_id) {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.remove(wfremodel_id));
}
@ApiOperation(value = "批量保存流程模型", tags = {"流程模型" }, notes = "批量保存流程模型")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) {
wfremodelService.saveBatch(wfremodelMapping.toDomain(wfremodeldtos));
@ApiOperation(value = "批量删除流程模型", tags = {"流程模型" }, notes = "批量删除流程模型")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfremodels/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
wfremodelService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
......@@ -86,21 +104,10 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "新建流程模型", tags = {"流程模型" }, notes = "新建流程模型")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels")
@Transactional
public ResponseEntity<WFREModelDTO> create(@RequestBody WFREModelDTO wfremodeldto) {
WFREModel domain = wfremodelMapping.toDomain(wfremodeldto);
wfremodelService.create(domain);
WFREModelDTO dto = wfremodelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量新建流程模型", tags = {"流程模型" }, notes = "批量新建流程模型")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) {
wfremodelService.createBatch(wfremodelMapping.toDomain(wfremodeldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
@ApiOperation(value = "获取流程模型草稿", tags = {"流程模型" }, notes = "获取流程模型草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfremodels/getdraft")
public ResponseEntity<WFREModelDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelMapping.toDto(wfremodelService.getDraft(new WFREModel())));
}
@ApiOperation(value = "检查流程模型", tags = {"流程模型" }, notes = "检查流程模型")
......@@ -109,27 +116,20 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.checkKey(wfremodelMapping.toDomain(wfremodeldto)));
}
@ApiOperation(value = "删除流程模型", tags = {"流程模型" }, notes = "删除流程模型")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfremodels/{wfremodel_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("wfremodel_id") String wfremodel_id) {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.remove(wfremodel_id));
@ApiOperation(value = "保存流程模型", tags = {"流程模型" }, notes = "保存流程模型")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels/save")
public ResponseEntity<Boolean> save(@RequestBody WFREModelDTO wfremodeldto) {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.save(wfremodelMapping.toDomain(wfremodeldto)));
}
@ApiOperation(value = "批量删除流程模型", tags = {"流程模型" }, notes = "批量删除流程模型")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfremodels/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
wfremodelService.removeBatch(ids);
@ApiOperation(value = "批量保存流程模型", tags = {"流程模型" }, notes = "批量保存流程模型")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) {
wfremodelService.saveBatch(wfremodelMapping.toDomain(wfremodeldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取流程模型草稿", tags = {"流程模型" }, notes = "获取流程模型草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfremodels/getdraft")
public ResponseEntity<WFREModelDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelMapping.toDto(wfremodelService.getDraft(new WFREModel())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-searchDefault-all') and hasPermission(#context,'ibzwf-WFREModel-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"流程模型" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfremodels/fetchdefault")
public ResponseEntity<List<WFREModelDTO>> fetchDefault(WFREModelSearchContext context) {
......@@ -142,7 +142,7 @@ public class WFREModelResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-searchDefault-all') and hasPermission(#context,'ibzwf-WFREModel-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"流程模型" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfremodels/searchdefault")
public ResponseEntity<Page<WFREModelDTO>> searchDefault(@RequestBody WFREModelSearchContext context) {
......
......@@ -47,19 +47,22 @@ public class WFSystemResource {
@Lazy
public WFSystemMapping wfsystemMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Remove-all')")
@ApiOperation(value = "删除系统", tags = {"系统" }, notes = "删除系统")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfsystems/{wfsystem_id}")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Create-all')")
@ApiOperation(value = "新建系统", tags = {"系统" }, notes = "新建系统")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("wfsystem_id") String wfsystem_id) {
return ResponseEntity.status(HttpStatus.OK).body(wfsystemService.remove(wfsystem_id));
public ResponseEntity<WFSystemDTO> create(@RequestBody WFSystemDTO wfsystemdto) {
WFSystem domain = wfsystemMapping.toDomain(wfsystemdto);
wfsystemService.create(domain);
WFSystemDTO dto = wfsystemMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Remove-all')")
@ApiOperation(value = "批量删除系统", tags = {"系统" }, notes = "批量删除系统")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfsystems/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
wfsystemService.removeBatch(ids);
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Create-all')")
@ApiOperation(value = "批量新建系统", tags = {"系统" }, notes = "批量新建系统")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFSystemDTO> wfsystemdtos) {
wfsystemService.createBatch(wfsystemMapping.toDomain(wfsystemdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
......@@ -83,12 +86,43 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Remove-all')")
@ApiOperation(value = "删除系统", tags = {"系统" }, notes = "删除系统")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfsystems/{wfsystem_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("wfsystem_id") String wfsystem_id) {
return ResponseEntity.status(HttpStatus.OK).body(wfsystemService.remove(wfsystem_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Remove-all')")
@ApiOperation(value = "批量删除系统", tags = {"系统" }, notes = "批量删除系统")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfsystems/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
wfsystemService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Get-all')")
@ApiOperation(value = "获取系统", tags = {"系统" }, notes = "获取系统")
@RequestMapping(method = RequestMethod.GET, value = "/wfsystems/{wfsystem_id}")
public ResponseEntity<WFSystemDTO> get(@PathVariable("wfsystem_id") String wfsystem_id) {
WFSystem domain = wfsystemService.get(wfsystem_id);
WFSystemDTO dto = wfsystemMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取系统草稿", tags = {"系统" }, notes = "获取系统草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfsystems/getdraft")
public ResponseEntity<WFSystemDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfsystemMapping.toDto(wfsystemService.getDraft(new WFSystem())));
}
@ApiOperation(value = "检查系统", tags = {"系统" }, notes = "检查系统")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WFSystemDTO wfsystemdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfsystemService.checkKey(wfsystemMapping.toDomain(wfsystemdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Save-all')")
@ApiOperation(value = "保存系统", tags = {"系统" }, notes = "保存系统")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems/save")
......@@ -104,41 +138,7 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Create-all')")
@ApiOperation(value = "新建系统", tags = {"系统" }, notes = "新建系统")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems")
@Transactional
public ResponseEntity<WFSystemDTO> create(@RequestBody WFSystemDTO wfsystemdto) {
WFSystem domain = wfsystemMapping.toDomain(wfsystemdto);
wfsystemService.create(domain);
WFSystemDTO dto = wfsystemMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Create-all')")
@ApiOperation(value = "批量新建系统", tags = {"系统" }, notes = "批量新建系统")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFSystemDTO> wfsystemdtos) {
wfsystemService.createBatch(wfsystemMapping.toDomain(wfsystemdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查系统", tags = {"系统" }, notes = "检查系统")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WFSystemDTO wfsystemdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfsystemService.checkKey(wfsystemMapping.toDomain(wfsystemdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Get-all')")
@ApiOperation(value = "获取系统", tags = {"系统" }, notes = "获取系统")
@RequestMapping(method = RequestMethod.GET, value = "/wfsystems/{wfsystem_id}")
public ResponseEntity<WFSystemDTO> get(@PathVariable("wfsystem_id") String wfsystem_id) {
WFSystem domain = wfsystemService.get(wfsystem_id);
WFSystemDTO dto = wfsystemMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-searchDefault-all') and hasPermission(#context,'ibzwf-WFSystem-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"系统" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfsystems/fetchdefault")
public ResponseEntity<List<WFSystemDTO>> fetchDefault(WFSystemSearchContext context) {
......@@ -151,7 +151,7 @@ public class WFSystemResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-searchDefault-all') and hasPermission(#context,'ibzwf-WFSystem-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"系统" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfsystems/searchdefault")
public ResponseEntity<Page<WFSystemDTO>> searchDefault(@RequestBody WFSystemSearchContext context) {
......
......@@ -47,40 +47,22 @@ public class WFUserResource {
@Lazy
public WFUserMapping wfuserMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Remove-all')")
@ApiOperation(value = "删除用户", tags = {"用户" }, notes = "删除用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfusers/{wfuser_id}")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Create-all')")
@ApiOperation(value = "新建用户", tags = {"用户" }, notes = "新建用户")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("wfuser_id") String wfuser_id) {
return ResponseEntity.status(HttpStatus.OK).body(wfuserService.remove(wfuser_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Remove-all')")
@ApiOperation(value = "批量删除用户", tags = {"用户" }, notes = "批量删除用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfusers/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
wfuserService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取用户草稿", tags = {"用户" }, notes = "获取用户草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/getdraft")
public ResponseEntity<WFUserDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfuserMapping.toDto(wfuserService.getDraft(new WFUser())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Save-all')")
@ApiOperation(value = "保存用户", tags = {"用户" }, notes = "保存用户")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/save")
public ResponseEntity<Boolean> save(@RequestBody WFUserDTO wfuserdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfuserService.save(wfuserMapping.toDomain(wfuserdto)));
public ResponseEntity<WFUserDTO> create(@RequestBody WFUserDTO wfuserdto) {
WFUser domain = wfuserMapping.toDomain(wfuserdto);
wfuserService.create(domain);
WFUserDTO dto = wfuserMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Save-all')")
@ApiOperation(value = "批量保存用户", tags = {"用户" }, notes = "批量保存用户")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFUserDTO> wfuserdtos) {
wfuserService.saveBatch(wfuserMapping.toDomain(wfuserdtos));
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Create-all')")
@ApiOperation(value = "批量新建用户", tags = {"用户" }, notes = "批量新建用户")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFUserDTO> wfuserdtos) {
wfuserService.createBatch(wfuserMapping.toDomain(wfuserdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
......@@ -104,6 +86,22 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Remove-all')")
@ApiOperation(value = "删除用户", tags = {"用户" }, notes = "删除用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfusers/{wfuser_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("wfuser_id") String wfuser_id) {
return ResponseEntity.status(HttpStatus.OK).body(wfuserService.remove(wfuser_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Remove-all')")
@ApiOperation(value = "批量删除用户", tags = {"用户" }, notes = "批量删除用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfusers/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
wfuserService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Get-all')")
@ApiOperation(value = "获取用户", tags = {"用户" }, notes = "获取用户")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/{wfuser_id}")
......@@ -113,23 +111,10 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Create-all')")
@ApiOperation(value = "新建用户", tags = {"用户" }, notes = "新建用户")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers")
@Transactional
public ResponseEntity<WFUserDTO> create(@RequestBody WFUserDTO wfuserdto) {
WFUser domain = wfuserMapping.toDomain(wfuserdto);
wfuserService.create(domain);
WFUserDTO dto = wfuserMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Create-all')")
@ApiOperation(value = "批量新建用户", tags = {"用户" }, notes = "批量新建用户")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFUserDTO> wfuserdtos) {
wfuserService.createBatch(wfuserMapping.toDomain(wfuserdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
@ApiOperation(value = "获取用户草稿", tags = {"用户" }, notes = "获取用户草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/getdraft")
public ResponseEntity<WFUserDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfuserMapping.toDto(wfuserService.getDraft(new WFUser())));
}
@ApiOperation(value = "检查用户", tags = {"用户" }, notes = "检查用户")
......@@ -138,7 +123,22 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(wfuserService.checkKey(wfuserMapping.toDomain(wfuserdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Save-all')")
@ApiOperation(value = "保存用户", tags = {"用户" }, notes = "保存用户")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/save")
public ResponseEntity<Boolean> save(@RequestBody WFUserDTO wfuserdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfuserService.save(wfuserMapping.toDomain(wfuserdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Save-all')")
@ApiOperation(value = "批量保存用户", tags = {"用户" }, notes = "批量保存用户")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFUserDTO> wfuserdtos) {
wfuserService.saveBatch(wfuserMapping.toDomain(wfuserdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-searchDefault-all') and hasPermission(#context,'ibzwf-WFUser-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"用户" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfusers/fetchdefault")
public ResponseEntity<List<WFUserDTO>> fetchDefault(WFUserSearchContext context) {
......@@ -151,7 +151,7 @@ public class WFUserResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-searchDefault-all') and hasPermission(#context,'ibzwf-WFUser-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"用户" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfusers/searchdefault")
public ResponseEntity<Page<WFUserDTO>> searchDefault(@RequestBody WFUserSearchContext context) {
......
package cn.ibizlab.util.security;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.SneakyThrows;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.filter.QueryWrapperContext;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.PermissionEvaluator;
......@@ -11,7 +14,10 @@ import org.springframework.security.core.GrantedAuthority;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.*;
import java.util.function.Consumer;
/**
* spring security 权限管理类
......@@ -23,44 +29,144 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
@Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验
/**
* 实体行为鉴权
* @param authentication
* @param entity
* @param action
* 服务接口鉴权
* @param authentication 用户
* @param entity 实体
* @param action 操作
* @return
*/
@Override
@SneakyThrows
public boolean hasPermission(Authentication authentication, Object entity, Object action) {
//未开启权限校验、超级管理员则不进行权限检查
if(AuthenticationUser.getAuthenticationUser().getSuperuser()==1 || !enablePermissionValid)
if(!enablePermissionValid)
return true;
Object principal = authentication.getPrincipal();
if(ObjectUtils.isEmpty(principal))
return false;
AuthenticationUser authenticationUser= (AuthenticationUser) authentication.getPrincipal();
if(authenticationUser.getSuperuser()==1)
return true;
String strAction=String.valueOf(action);
Set<String> userAuthorities = getAuthorities(authentication,strAction);
if(userAuthorities.size()==0)
return false;
//拥有全部数据访问权限时,则跳过权限检查
if(isAllData(strAction,userAuthorities)){
return true;
}
if(entity instanceof ArrayList){
List<EntityBase> entities= (List<EntityBase>) entity;
for(EntityBase entityBase: entities){
boolean result=actionValid(entityBase, strAction ,userAuthorities);
boolean result=actionValid(entityBase, strAction ,userAuthorities,authenticationUser);
if(!result){
return false;
}
}
}
else if (entity instanceof QueryWrapperContext){
QueryWrapperContext queryWrapperContext= (QueryWrapperContext) entity;
setPermissionCondToSearchContext(getEntity(queryWrapperContext),queryWrapperContext,userAuthorities,authenticationUser);
}
else{
EntityBase entityBase= (EntityBase) entity;
return actionValid(entityBase , strAction ,userAuthorities);
return actionValid(entityBase , strAction ,userAuthorities,authenticationUser);
}
return true;
}
/**
* 获取实体信息
* @param qc
* @return
*/
@SneakyThrows
private EntityBase getEntity(QueryWrapperContext qc){
EntityBase entity=null;
Type type =qc.getClass().getGenericSuperclass();
if(type instanceof ParameterizedType){
ParameterizedType parameterizedType= (ParameterizedType) qc.getClass().getGenericSuperclass();
Type [] typeArr= parameterizedType.getActualTypeArguments();
if(typeArr.length>0){
Class<EntityBase> entityClass = (Class) typeArr[0];
return entityClass.newInstance();
}
}
return entity;
}
/**
* 在searchContext中拼接权限条件
* @param entity 实体
* @param qc 查询上下文
* @param userAuthorities 用户权限
* @param authenticationUser 当前用户
*/
@SneakyThrows
private void setPermissionCondToSearchContext(EntityBase entity, QueryWrapperContext qc , Set<String> userAuthorities ,AuthenticationUser authenticationUser){
if(entity==null)
return ;
Map<String,String> permissionField=getPermissionField(entity);//获取组织、部门预置属性
String orgField=permissionField.get("orgfield");
String orgDeptField=permissionField.get("orgsecfield");
String createManField=permissionField.get("createmanfield");
Map<String, Set<String>> userInfo = authenticationUser.getOrgInfo();
Set<String> orgParent = userInfo.get("parentorg");
Set<String> orgChild = userInfo.get("suborg");
Set<String> orgDeptParent = userInfo.get("parentdept");
Set<String> orgDeptChild = userInfo.get("subdept");
Set<String> userOrg = new HashSet<>();
Set<String> userOrgDept = new HashSet<>();
Set<String> userCreateMan = new HashSet<>();
for(String authority:userAuthorities){
if(authority.endsWith("curorg")){ //本单位
userOrg.add(authenticationUser.getOrgid());
}
else if(authority.endsWith("porg")){//上级单位
userOrg.addAll(orgParent);
}
else if(authority.endsWith("sorg")){//下级单位
userOrg.addAll(orgChild);
}
else if(authority.endsWith("curorgdept")){//本部门
userOrgDept.add(authenticationUser.getMdeptid());
}
else if(authority.endsWith("porgdept")){//上级部门
userOrgDept.addAll(orgDeptParent);
}
else if(authority.endsWith("sorgdept")){//下级部门
userOrgDept.addAll(orgDeptChild);
}
else if (authority.endsWith("createman")){
userCreateMan.add(authority);
}
}
if(userOrg.size()==0 && userOrgDept.size()==0 && userCreateMan.size()==0){
qc.getSelectCond().apply("1<>1");
}
else{
Consumer<QueryWrapper> consumer = qw -> {
if(userOrg.size()>0){
Consumer<QueryWrapper> org = orgQw -> {
orgQw.in(orgField,userOrg);
};
qw.or(org);
}
if(userOrgDept.size()>0){
Consumer<QueryWrapper> dept = deptQw -> {
deptQw.in(orgDeptField,userOrgDept);
};
qw.or(dept);
}
if(userCreateMan.size()>0){
Consumer<QueryWrapper> createMan = createManQw -> {
createManQw.eq(createManField,authenticationUser.getUserid());
};
qw.or(createMan);
}
};
qc.getSelectCond().and(consumer);
}
}
@Override
public boolean hasPermission(Authentication authentication, Serializable id, String action, Object params) {
......@@ -106,13 +212,12 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
* @param userAuthorities
* @return
*/
private boolean actionValid(EntityBase entity, String action , Set<String> userAuthorities){
private boolean actionValid(EntityBase entity, String action , Set<String> userAuthorities ,AuthenticationUser authenticationUser){
Map<String,String> permissionField=getPermissionField(entity);//获取组织、部门预置属性
String orgField=permissionField.get("orgfield");
String orgDeptField=permissionField.get("orgsecfield");
String createManField=permissionField.get("createmanfield");
AuthenticationUser authenticationUser = AuthenticationUser.getAuthenticationUser();
Map<String, Set<String>> userInfo = authenticationUser.getOrgInfo();
Set<String> orgParent = userInfo.get("parentorg");
Set<String> orgChild = userInfo.get("suborg");
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册