提交 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 ...@@ -115,16 +115,16 @@ mock.onGet(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((c
return [status, _items]; return [status, _items];
}); });
// Save // Create
mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: Save"); console.groupCollapsed("实体:wfgroup 方法: Create");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; 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 = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -134,23 +134,11 @@ mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((c ...@@ -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.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data); console.table(mockDatas[0]);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, data]; return [status, mockDatas[0]];
}); });
// Update // Update
...@@ -245,16 +233,16 @@ mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).repl ...@@ -245,16 +233,16 @@ mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).repl
return [status, data]; return [status, data];
}); });
// Create // Save
mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: Create"); console.groupCollapsed("实体:wfgroup 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; 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 = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -264,11 +252,23 @@ mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: ...@@ -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.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, mockDatas[0]]; return [status, data];
}); });
// FetchDefault // FetchDefault
......
...@@ -174,16 +174,16 @@ mock.onGet(new RegExp(/^\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply(( ...@@ -174,16 +174,16 @@ mock.onGet(new RegExp(/^\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
}); });
// CheckKey // Create
mock.onPost(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: CheckKey"); console.groupCollapsed("实体:wfmember 方法: Create");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id','memberid']; const paramArray:Array<any> = ['id','memberid'];
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -201,16 +201,16 @@ mock.onPost(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z ...@@ -201,16 +201,16 @@ mock.onPost(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z
}); });
// CheckKey // Create
mock.onPost(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: CheckKey"); console.groupCollapsed("实体:wfmember 方法: Create");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id','memberid']; const paramArray:Array<any> = ['id','memberid'];
const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -227,16 +227,16 @@ mock.onPost(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA- ...@@ -227,16 +227,16 @@ mock.onPost(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-
return [status, {}]; return [status, {}];
}); });
// CheckKey // Create
mock.onPost(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: CheckKey"); console.groupCollapsed("实体:wfmember 方法: Create");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['memberid']; const paramArray:Array<any> = ['memberid'];
const matchArray:any = new RegExp(/^\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -246,35 +246,33 @@ mock.onPost(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).rep ...@@ -246,35 +246,33 @@ mock.onPost(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).rep
}); });
}); });
} }
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.memberid, tempValue.memberid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['memberid'] == tempValue['memberid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: "); console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data); console.table(mockDatas[0]);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, data]; return [status, mockDatas[0]];
}); });
// GetDraft // Update
mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/getdraft$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: GetDraft"); console.groupCollapsed("实体:wfmember 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id','memberid'];
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([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.groupCollapsed("response数据 status: "+status+" data: ");
console.table({}); console.table({});
console.groupEnd(); console.groupEnd();
...@@ -283,15 +281,25 @@ mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/getdraft$ ...@@ -283,15 +281,25 @@ mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/getdraft$
}); });
// GetDraft // Update
mock.onGet(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/getdraft$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: GetDraft"); console.groupCollapsed("实体:wfmember 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id','memberid'];
const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([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.groupCollapsed("response数据 status: "+status+" data: ");
console.table({}); console.table({});
console.groupEnd(); console.groupEnd();
...@@ -299,42 +307,58 @@ mock.onGet(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/getdraft ...@@ -299,42 +307,58 @@ mock.onGet(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/getdraft
return [status, {}]; return [status, {}];
}); });
// GetDraft // Update
mock.onGet(new RegExp(/^\/wfmembers\/getdraft$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: GetDraft"); console.groupCollapsed("实体:wfmember 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['memberid'];
const matchArray:any = new RegExp(/^\/wfmembers\/([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]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.memberid, tempValue.memberid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['memberid'] == tempValue['memberid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: "); console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({}); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, {}]; return [status, data];
}); });
// Create
mock.onPost(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: Create");
// GetDraft
mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id','memberid'];
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([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.groupCollapsed("response数据 status: "+status+" data: ");
console.table({}); console.table({});
console.groupEnd(); console.groupEnd();
...@@ -343,25 +367,15 @@ mock.onPost(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z ...@@ -343,25 +367,15 @@ mock.onPost(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z
}); });
// Create // GetDraft
mock.onPost(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: Create"); console.groupCollapsed("实体:wfmember 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id','memberid'];
const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([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.groupCollapsed("response数据 status: "+status+" data: ");
console.table({}); console.table({});
console.groupEnd(); console.groupEnd();
...@@ -369,45 +383,33 @@ mock.onPost(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA- ...@@ -369,45 +383,33 @@ mock.onPost(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-
return [status, {}]; return [status, {}];
}); });
// Create // GetDraft
mock.onPost(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/wfmembers\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: Create"); console.groupCollapsed("实体:wfmember 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['memberid'];
const matchArray:any = new RegExp(/^\/wfmembers\/([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.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]); console.table({});
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, mockDatas[0]]; return [status, {}];
}); });
// CheckKey
mock.onPost(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => {
// Save console.groupCollapsed("实体:wfmember 方法: CheckKey");
mock.onPost(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id','memberid']; const paramArray:Array<any> = ['id','memberid'];
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -425,16 +427,16 @@ mock.onPost(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z ...@@ -425,16 +427,16 @@ mock.onPost(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z
}); });
// Save // CheckKey
mock.onPost(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: Save"); console.groupCollapsed("实体:wfmember 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id','memberid']; const paramArray:Array<any> = ['id','memberid'];
const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -451,16 +453,16 @@ mock.onPost(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA- ...@@ -451,16 +453,16 @@ mock.onPost(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-
return [status, {}]; return [status, {}];
}); });
// Save // CheckKey
mock.onPost(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: Save"); console.groupCollapsed("实体:wfmember 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['memberid']; const paramArray:Array<any> = ['memberid'];
const matchArray:any = new RegExp(/^\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -490,16 +492,16 @@ mock.onPost(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply(( ...@@ -490,16 +492,16 @@ mock.onPost(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((
}); });
// Update // Save
mock.onPut(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: Update"); console.groupCollapsed("实体:wfmember 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id','memberid']; const paramArray:Array<any> = ['id','memberid'];
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url); const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -517,16 +519,16 @@ mock.onPut(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0 ...@@ -517,16 +519,16 @@ mock.onPut(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0
}); });
// Update // Save
mock.onPut(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: Update"); console.groupCollapsed("实体:wfmember 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id','memberid']; const paramArray:Array<any> = ['id','memberid'];
const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url); const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -543,16 +545,16 @@ mock.onPut(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z ...@@ -543,16 +545,16 @@ mock.onPut(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/([a-zA-Z
return [status, {}]; return [status, {}];
}); });
// Update // Save
mock.onPut(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: Update"); console.groupCollapsed("实体:wfmember 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['memberid']; const paramArray:Array<any> = ['memberid'];
const matchArray:any = new RegExp(/^\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url); const matchArray:any = new RegExp(/^\/wfmembers\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -582,8 +584,6 @@ mock.onPut(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: ...@@ -582,8 +584,6 @@ mock.onPut(new RegExp(/^\/wfmembers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
}); });
// FetchDefault // FetchDefault
mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/fetchdefault$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/wfmembers\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:wfmember 方法: FetchDefault"); console.groupCollapsed("实体:wfmember 方法: FetchDefault");
......
...@@ -115,16 +115,16 @@ mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})\/select$ ...@@ -115,16 +115,16 @@ mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})\/select$
return [status, _items]; return [status, _items];
}); });
// Save // Create
mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Save"); console.groupCollapsed("实体:wfprocessdefinition 方法: Create");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['definitionkey']; 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 = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -134,23 +134,11 @@ mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/save$ ...@@ -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.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data); console.table(mockDatas[0]);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, data]; return [status, mockDatas[0]];
}); });
// Update // Update
...@@ -191,6 +179,22 @@ mock.onPut(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})$/)).rep ...@@ -191,6 +179,22 @@ mock.onPut(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})$/)).rep
return [status, data]; 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 // CheckKey
mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: CheckKey"); console.groupCollapsed("实体:wfprocessdefinition 方法: CheckKey");
...@@ -229,32 +233,16 @@ mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/check ...@@ -229,32 +233,16 @@ mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/check
return [status, data]; return [status, data];
}); });
// GetDraft // Save
mock.onGet(new RegExp(/^\/wfprocessdefinitions\/getdraft$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: GetDraft"); console.groupCollapsed("实体:wfprocessdefinition 方法: Save");
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");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['definitionkey']; 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 = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -264,11 +252,23 @@ mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})$/)).re ...@@ -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.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, mockDatas[0]]; return [status, data];
}); });
// FetchDefault // FetchDefault
...@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/wfprocessdefinitions\/fetchdefault(\?[\w-./?%&=,]*)*$/ ...@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/wfprocessdefinitions\/fetchdefault(\?[\w-./?%&=,]*)*$/
// URI参数传递情况未实现 // URI参数传递情况未实现
// Get // Remove
mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Get"); console.groupCollapsed("实体:wfprocessdefinition 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
...@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).repl ...@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).repl
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Remove // Get
mock.onDelete(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Remove"); console.groupCollapsed("实体:wfprocessdefinition 方法: Get");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
......
...@@ -115,9 +115,9 @@ mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply( ...@@ -115,9 +115,9 @@ mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply(
return [status, _items]; return [status, _items];
}); });
// Update // Create
mock.onPut(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Update"); console.groupCollapsed("实体:wfremodel 方法: Create");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
...@@ -134,35 +134,23 @@ mock.onPut(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config ...@@ -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.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data); console.table(mockDatas[0]);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, data]; return [status, mockDatas[0]];
}); });
// Save // Update
mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Save"); console.groupCollapsed("实体:wfremodel 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; 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 = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -191,30 +179,20 @@ mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply( ...@@ -191,30 +179,20 @@ mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply(
return [status, data]; return [status, data];
}); });
// Create // GetDraft
mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/wfremodels\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Create"); console.groupCollapsed("实体:wfremodel 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; 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.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]); console.table({});
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, mockDatas[0]]; return [status, {}];
}); });
// CheckKey // CheckKey
...@@ -255,20 +233,42 @@ mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).re ...@@ -255,20 +233,42 @@ mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).re
return [status, data]; return [status, data];
}); });
// GetDraft // Save
mock.onGet(new RegExp(/^\/wfremodels\/getdraft$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: GetDraft"); console.groupCollapsed("实体:wfremodel 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; 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.groupCollapsed("response数据 status: "+status+" data: ");
console.table({}); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, {}]; return [status, data];
}); });
// FetchDefault // FetchDefault
...@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/wfremodels\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply(( ...@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/wfremodels\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((
// URI参数传递情况未实现 // URI参数传递情况未实现
// Get // Remove
mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Get"); console.groupCollapsed("实体:wfremodel 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
...@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: ...@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config:
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Remove // Get
mock.onDelete(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Remove"); console.groupCollapsed("实体:wfremodel 方法: Get");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
......
...@@ -115,6 +115,32 @@ mock.onGet(new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply(( ...@@ -115,6 +115,32 @@ mock.onGet(new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
return [status, _items]; 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 // Update
mock.onPut(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Update"); console.groupCollapsed("实体:wfsystem 方法: Update");
...@@ -169,16 +195,16 @@ mock.onGet(new RegExp(/^\/wfsystems\/getdraft$/)).reply((config: any) => { ...@@ -169,16 +195,16 @@ mock.onGet(new RegExp(/^\/wfsystems\/getdraft$/)).reply((config: any) => {
return [status, {}]; return [status, {}];
}); });
// Save // CheckKey
mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Save"); console.groupCollapsed("实体:wfsystem 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['pssystemid']; 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 = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -207,42 +233,16 @@ mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply(( ...@@ -207,42 +233,16 @@ mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((
return [status, data]; return [status, data];
}); });
// Create // Save
mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Create"); 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})$/).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");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['pssystemid']; 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 = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
......
...@@ -115,32 +115,16 @@ mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((co ...@@ -115,32 +115,16 @@ mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((co
return [status, _items]; return [status, _items];
}); });
// GetDraft // Create
mock.onGet(new RegExp(/^\/wfusers\/getdraft$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: GetDraft"); console.groupCollapsed("实体:wfuser 方法: Create");
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");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; 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 = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -150,23 +134,11 @@ mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((co ...@@ -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.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data); console.table(mockDatas[0]);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, data]; return [status, mockDatas[0]];
}); });
// Update // Update
...@@ -207,16 +179,32 @@ mock.onPut(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: a ...@@ -207,16 +179,32 @@ mock.onPut(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: a
return [status, data]; return [status, data];
}); });
// Create // GetDraft
mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/wfusers\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: Create"); 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, {}];
});
// 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}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; 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 = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -226,23 +214,35 @@ mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: ...@@ -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.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, mockDatas[0]]; return [status, data];
}); });
// CheckKey // Save
mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: CheckKey"); console.groupCollapsed("实体:wfuser 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; 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 = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
......
...@@ -747,9 +747,18 @@ export default class WFGroupMPickupViewBase extends Vue { ...@@ -747,9 +747,18 @@ export default class WFGroupMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]); 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 { ...@@ -747,9 +747,18 @@ export default class WFUserMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]); 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 { ...@@ -53,7 +53,7 @@ export default class WFGroupServiceBase extends EntityService {
} }
/** /**
* Save接口方法 * Create接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -61,7 +61,7 @@ export default class WFGroupServiceBase extends EntityService { ...@@ -61,7 +61,7 @@ export default class WFGroupServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFGroupServiceBase * @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 masterData:any = {};
let wfmembersData:any = []; let wfmembersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_wfmembers'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_wfmembers'),'undefined')){
...@@ -79,8 +79,15 @@ export default class WFGroupServiceBase extends EntityService { ...@@ -79,8 +79,15 @@ export default class WFGroupServiceBase extends EntityService {
} }
masterData.wfmembers = wfmembersData; masterData.wfmembers = wfmembersData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfgroups/${context.wfgroup}/save`,data,isloading); if(!data.srffrontuf || data.srffrontuf !== "1"){
this.tempStorage.setItem(context.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers)); 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; return res;
} }
...@@ -116,6 +123,35 @@ export default class WFGroupServiceBase extends EntityService { ...@@ -116,6 +123,35 @@ export default class WFGroupServiceBase extends EntityService {
return res; 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接口方法 * GetDraft接口方法
* *
...@@ -147,7 +183,7 @@ export default class WFGroupServiceBase extends EntityService { ...@@ -147,7 +183,7 @@ export default class WFGroupServiceBase extends EntityService {
} }
/** /**
* Create接口方法 * Save接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -155,7 +191,7 @@ export default class WFGroupServiceBase extends EntityService { ...@@ -155,7 +191,7 @@ export default class WFGroupServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFGroupServiceBase * @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 masterData:any = {};
let wfmembersData:any = []; let wfmembersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_wfmembers'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_wfmembers'),'undefined')){
...@@ -173,43 +209,7 @@ export default class WFGroupServiceBase extends EntityService { ...@@ -173,43 +209,7 @@ export default class WFGroupServiceBase extends EntityService {
} }
masterData.wfmembers = wfmembersData; masterData.wfmembers = wfmembersData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ let res:any = await Http.getInstance().post(`/wfgroups/${context.wfgroup}/save`,data,isloading);
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);
this.tempStorage.setItem(context.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers)); this.tempStorage.setItem(context.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers));
return res; return res;
} }
......
...@@ -58,53 +58,6 @@ export default class WFMemberServiceBase extends EntityService { ...@@ -58,53 +58,6 @@ export default class WFMemberServiceBase extends EntityService {
return res; 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接口方法 * Create接口方法
* *
...@@ -152,6 +105,32 @@ export default class WFMemberServiceBase extends EntityService { ...@@ -152,6 +105,32 @@ export default class WFMemberServiceBase extends EntityService {
return res; 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接口方法 * Remove接口方法
* *
...@@ -173,7 +152,7 @@ export default class WFMemberServiceBase extends EntityService { ...@@ -173,7 +152,7 @@ export default class WFMemberServiceBase extends EntityService {
} }
/** /**
* Save接口方法 * Get接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -181,25 +160,19 @@ export default class WFMemberServiceBase extends EntityService { ...@@ -181,25 +160,19 @@ export default class WFMemberServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFMemberServiceBase * @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){ if(context.wfuser && context.wfmember){
let masterData:any = {}; let res:any = await Http.getInstance().get(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}`,isloading);
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){ if(context.wfgroup && context.wfmember){
let masterData:any = {}; let res:any = await Http.getInstance().get(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}`,isloading);
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}/save`,data,isloading);
} }
let masterData:any = {}; let res:any = await Http.getInstance().get(`/wfmembers/${context.wfmember}`,isloading);
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfmembers/${context.wfmember}/save`,data,isloading);
return res; return res;
} }
/** /**
* Update接口方法 * GetDraft接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -207,25 +180,46 @@ export default class WFMemberServiceBase extends EntityService { ...@@ -207,25 +180,46 @@ export default class WFMemberServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFMemberServiceBase * @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){ if(context.wfuser && context.wfmember){
let masterData:any = {}; let masterData:any = {};
Object.assign(data,masterData); 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){ if(context.wfgroup && context.wfmember){
let masterData:any = {}; let masterData:any = {};
Object.assign(data,masterData); 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 = {}; let res:any = await Http.getInstance().post(`/wfmembers/${context.wfmember}/checkkey`,data,isloading);
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfmembers/${context.wfmember}`,data,isloading);
return res; return res;
} }
/** /**
* Get接口方法 * Save接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -233,14 +227,20 @@ export default class WFMemberServiceBase extends EntityService { ...@@ -233,14 +227,20 @@ export default class WFMemberServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFMemberServiceBase * @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){ 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){ 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; return res;
} }
......
...@@ -53,7 +53,7 @@ export default class WFProcessDefinitionServiceBase extends EntityService { ...@@ -53,7 +53,7 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
} }
/** /**
* Save接口方法 * Create接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -61,10 +61,17 @@ export default class WFProcessDefinitionServiceBase extends EntityService { ...@@ -61,10 +61,17 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase * @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 = {}; let masterData:any = {};
Object.assign(data,masterData); 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; return res;
} }
...@@ -85,7 +92,7 @@ export default class WFProcessDefinitionServiceBase extends EntityService { ...@@ -85,7 +92,7 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
} }
/** /**
* Get接口方法 * Remove接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -93,13 +100,13 @@ export default class WFProcessDefinitionServiceBase extends EntityService { ...@@ -93,13 +100,13 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase * @memberof WFProcessDefinitionServiceBase
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfprocessdefinitions/${context.wfprocessdefinition}`,isloading); let res:any = await Http.getInstance().delete(`/wfprocessdefinitions/${context.wfprocessdefinition}`,isloading);
return res; return res;
} }
/** /**
* CheckKey接口方法 * Get接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -107,8 +114,8 @@ export default class WFProcessDefinitionServiceBase extends EntityService { ...@@ -107,8 +114,8 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase * @memberof WFProcessDefinitionServiceBase
*/ */
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/wfprocessdefinitions/${context.wfprocessdefinition}/checkkey`,data,isloading); let res:any = await Http.getInstance().get(`/wfprocessdefinitions/${context.wfprocessdefinition}`,isloading);
return res; return res;
} }
...@@ -128,7 +135,7 @@ export default class WFProcessDefinitionServiceBase extends EntityService { ...@@ -128,7 +135,7 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
} }
/** /**
* Create接口方法 * CheckKey接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -136,22 +143,13 @@ export default class WFProcessDefinitionServiceBase extends EntityService { ...@@ -136,22 +143,13 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase * @memberof WFProcessDefinitionServiceBase
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let res:any = await Http.getInstance().post(`/wfprocessdefinitions/${context.wfprocessdefinition}/checkkey`,data,isloading);
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);
return res; return res;
} }
/** /**
* Remove接口方法 * Save接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -159,8 +157,10 @@ export default class WFProcessDefinitionServiceBase extends EntityService { ...@@ -159,8 +157,10 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase * @memberof WFProcessDefinitionServiceBase
*/ */
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/wfprocessdefinitions/${context.wfprocessdefinition}`,isloading); let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfprocessdefinitions/${context.wfprocessdefinition}/save`,data,isloading);
return res; return res;
} }
......
...@@ -53,7 +53,7 @@ export default class WFREModelServiceBase extends EntityService { ...@@ -53,7 +53,7 @@ export default class WFREModelServiceBase extends EntityService {
} }
/** /**
* Update接口方法 * Create接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -61,15 +61,22 @@ export default class WFREModelServiceBase extends EntityService { ...@@ -61,15 +61,22 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFREModelServiceBase * @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 = {}; let masterData:any = {};
Object.assign(data,masterData); 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; return res;
} }
/** /**
* Save接口方法 * Update接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -77,15 +84,15 @@ export default class WFREModelServiceBase extends EntityService { ...@@ -77,15 +84,15 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFREModelServiceBase * @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 = {}; let masterData:any = {};
Object.assign(data,masterData); 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; return res;
} }
/** /**
* Get接口方法 * Remove接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -93,13 +100,13 @@ export default class WFREModelServiceBase extends EntityService { ...@@ -93,13 +100,13 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFREModelServiceBase * @memberof WFREModelServiceBase
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfremodels/${context.wfremodel}`,isloading); let res:any = await Http.getInstance().delete(`/wfremodels/${context.wfremodel}`,isloading);
return res; return res;
} }
/** /**
* Create接口方法 * Get接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -107,22 +114,13 @@ export default class WFREModelServiceBase extends EntityService { ...@@ -107,22 +114,13 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFREModelServiceBase * @memberof WFREModelServiceBase
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let res:any = await Http.getInstance().get(`/wfremodels/${context.wfremodel}`,isloading);
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);
return res; return res;
} }
/** /**
* CheckKey接口方法 * GetDraft接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -130,13 +128,14 @@ export default class WFREModelServiceBase extends EntityService { ...@@ -130,13 +128,14 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFREModelServiceBase * @memberof WFREModelServiceBase
*/ */
public async CheckKey(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().post(`/wfremodels/${context.wfremodel}/checkkey`,data,isloading); let res:any = await Http.getInstance().get(`/wfremodels/getdraft`,isloading);
res.data.wfremodel = data.wfremodel;
return res; return res;
} }
/** /**
* Remove接口方法 * CheckKey接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -144,13 +143,13 @@ export default class WFREModelServiceBase extends EntityService { ...@@ -144,13 +143,13 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFREModelServiceBase * @memberof WFREModelServiceBase
*/ */
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/wfremodels/${context.wfremodel}`,isloading); let res:any = await Http.getInstance().post(`/wfremodels/${context.wfremodel}/checkkey`,data,isloading);
return res; return res;
} }
/** /**
* GetDraft接口方法 * Save接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -158,9 +157,10 @@ export default class WFREModelServiceBase extends EntityService { ...@@ -158,9 +157,10 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFREModelServiceBase * @memberof WFREModelServiceBase
*/ */
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfremodels/getdraft`,isloading); let masterData:any = {};
res.data.wfremodel = data.wfremodel; Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfremodels/${context.wfremodel}/save`,data,isloading);
return res; return res;
} }
......
...@@ -53,7 +53,7 @@ export default class WFSystemServiceBase extends EntityService { ...@@ -53,7 +53,7 @@ export default class WFSystemServiceBase extends EntityService {
} }
/** /**
* Remove接口方法 * Create接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -61,8 +61,17 @@ export default class WFSystemServiceBase extends EntityService { ...@@ -61,8 +61,17 @@ export default class WFSystemServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFSystemServiceBase * @memberof WFSystemServiceBase
*/ */
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/wfsystems/${context.wfsystem}`,isloading); 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; return res;
} }
...@@ -83,7 +92,7 @@ export default class WFSystemServiceBase extends EntityService { ...@@ -83,7 +92,7 @@ export default class WFSystemServiceBase extends EntityService {
} }
/** /**
* GetDraft接口方法 * Remove接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -91,14 +100,13 @@ export default class WFSystemServiceBase extends EntityService { ...@@ -91,14 +100,13 @@ export default class WFSystemServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFSystemServiceBase * @memberof WFSystemServiceBase
*/ */
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfsystems/getdraft`,isloading); let res:any = await Http.getInstance().delete(`/wfsystems/${context.wfsystem}`,isloading);
res.data.wfsystem = data.wfsystem;
return res; return res;
} }
/** /**
* Save接口方法 * Get接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -106,15 +114,13 @@ export default class WFSystemServiceBase extends EntityService { ...@@ -106,15 +114,13 @@ export default class WFSystemServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFSystemServiceBase * @memberof WFSystemServiceBase
*/ */
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let res:any = await Http.getInstance().get(`/wfsystems/${context.wfsystem}`,isloading);
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfsystems/${context.wfsystem}/save`,data,isloading);
return res; return res;
} }
/** /**
* Create接口方法 * GetDraft接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -122,17 +128,9 @@ export default class WFSystemServiceBase extends EntityService { ...@@ -122,17 +128,9 @@ export default class WFSystemServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFSystemServiceBase * @memberof WFSystemServiceBase
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let res:any = await Http.getInstance().get(`/wfsystems/getdraft`,isloading);
Object.assign(data,masterData); res.data.wfsystem = data.wfsystem;
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; return res;
} }
...@@ -151,7 +149,7 @@ export default class WFSystemServiceBase extends EntityService { ...@@ -151,7 +149,7 @@ export default class WFSystemServiceBase extends EntityService {
} }
/** /**
* Get接口方法 * Save接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -159,8 +157,10 @@ export default class WFSystemServiceBase extends EntityService { ...@@ -159,8 +157,10 @@ export default class WFSystemServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFSystemServiceBase * @memberof WFSystemServiceBase
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfsystems/${context.wfsystem}`,isloading); let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfsystems/${context.wfsystem}/save`,data,isloading);
return res; return res;
} }
......
...@@ -53,37 +53,7 @@ export default class WFUserServiceBase extends EntityService { ...@@ -53,37 +53,7 @@ export default class WFUserServiceBase extends EntityService {
} }
/** /**
* Remove接口方法 * Create接口方法
*
* @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接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -91,7 +61,7 @@ export default class WFUserServiceBase extends EntityService { ...@@ -91,7 +61,7 @@ export default class WFUserServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFUserServiceBase * @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 masterData:any = {};
let wfmembersData:any = []; let wfmembersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_wfmembers'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_wfmembers'),'undefined')){
...@@ -109,8 +79,15 @@ export default class WFUserServiceBase extends EntityService { ...@@ -109,8 +79,15 @@ export default class WFUserServiceBase extends EntityService {
} }
masterData.wfmembers = wfmembersData; masterData.wfmembers = wfmembersData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/save`,data,isloading); if(!data.srffrontuf || data.srffrontuf !== "1"){
this.tempStorage.setItem(context.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers)); 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; return res;
} }
...@@ -146,6 +123,20 @@ export default class WFUserServiceBase extends EntityService { ...@@ -146,6 +123,20 @@ export default class WFUserServiceBase extends EntityService {
return res; 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接口方法 * Get接口方法
* *
...@@ -162,7 +153,7 @@ export default class WFUserServiceBase extends EntityService { ...@@ -162,7 +153,7 @@ export default class WFUserServiceBase extends EntityService {
} }
/** /**
* Create接口方法 * GetDraft接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -170,7 +161,37 @@ export default class WFUserServiceBase extends EntityService { ...@@ -170,7 +161,37 @@ export default class WFUserServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof WFUserServiceBase * @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 masterData:any = {};
let wfmembersData:any = []; let wfmembersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_wfmembers'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_wfmembers'),'undefined')){
...@@ -188,29 +209,8 @@ export default class WFUserServiceBase extends EntityService { ...@@ -188,29 +209,8 @@ export default class WFUserServiceBase extends EntityService {
} }
masterData.wfmembers = wfmembersData; masterData.wfmembers = wfmembersData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/save`,data,isloading);
data[this.APPDEKEY] = null; this.tempStorage.setItem(context.srfsessionkey+'_wfmembers',JSON.stringify(res.data.wfmembers));
}
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);
return res; return res;
} }
......
...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface IWFGroupService extends IService<WFGroup>{ 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) ; boolean create(WFGroup et) ;
void createBatch(List<WFGroup> list) ; void createBatch(List<WFGroup> list) ;
boolean update(WFGroup et) ;
void updateBatch(List<WFGroup> list) ;
boolean remove(String key) ; boolean remove(String key) ;
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
WFGroup get(String key) ; 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) ; Page<WFGroup> searchDefault(WFGroupSearchContext context) ;
/** /**
*自定义查询SQL *自定义查询SQL
......
...@@ -23,17 +23,17 @@ import cn.ibizlab.core.workflow.filter.WFHistorySearchContext; ...@@ -23,17 +23,17 @@ import cn.ibizlab.core.workflow.filter.WFHistorySearchContext;
*/ */
public interface IWFHistoryService{ 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) ; boolean create(WFHistory et) ;
void createBatch(List<WFHistory> list) ; void createBatch(List<WFHistory> list) ;
WFHistory get(String key) ; boolean update(WFHistory et) ;
void updateBatch(List<WFHistory> list) ;
boolean remove(String key) ; boolean remove(String key) ;
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
WFHistory get(String key) ;
WFHistory getDraft(WFHistory et) ; WFHistory getDraft(WFHistory et) ;
boolean checkKey(WFHistory et) ;
boolean save(WFHistory et) ;
void saveBatch(List<WFHistory> list) ;
Page<WFHistory> searchDefault(WFHistorySearchContext context) ; Page<WFHistory> searchDefault(WFHistorySearchContext context) ;
} }
......
...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface IWFMemberService extends IService<WFMember>{ public interface IWFMemberService extends IService<WFMember>{
boolean checkKey(WFMember et) ;
WFMember getDraft(WFMember et) ;
boolean create(WFMember et) ; boolean create(WFMember et) ;
void createBatch(List<WFMember> list) ; void createBatch(List<WFMember> list) ;
boolean update(WFMember et) ;
void updateBatch(List<WFMember> list) ;
boolean remove(String key) ; boolean remove(String key) ;
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
WFMember get(String key) ;
WFMember getDraft(WFMember et) ;
boolean checkKey(WFMember et) ;
boolean save(WFMember et) ; boolean save(WFMember et) ;
void saveBatch(List<WFMember> list) ; void saveBatch(List<WFMember> list) ;
boolean update(WFMember et) ;
void updateBatch(List<WFMember> list) ;
WFMember get(String key) ;
Page<WFMember> searchDefault(WFMemberSearchContext context) ; Page<WFMember> searchDefault(WFMemberSearchContext context) ;
List<WFMember> selectByGroupid(String id) ; List<WFMember> selectByGroupid(String id) ;
void removeByGroupid(String id) ; void removeByGroupid(String id) ;
......
...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface IWFProcessDefinitionService extends IService<WFProcessDefinition>{ 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) ; boolean create(WFProcessDefinition et) ;
void createBatch(List<WFProcessDefinition> list) ; void createBatch(List<WFProcessDefinition> list) ;
boolean update(WFProcessDefinition et) ;
void updateBatch(List<WFProcessDefinition> list) ;
boolean remove(String key) ; boolean remove(String key) ;
void removeBatch(Collection<String> idList) ; 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) ; Page<WFProcessDefinition> searchDefault(WFProcessDefinitionSearchContext context) ;
/** /**
*自定义查询SQL *自定义查询SQL
......
...@@ -23,17 +23,17 @@ import cn.ibizlab.core.workflow.filter.WFProcessInstanceSearchContext; ...@@ -23,17 +23,17 @@ import cn.ibizlab.core.workflow.filter.WFProcessInstanceSearchContext;
*/ */
public interface IWFProcessInstanceService{ public interface IWFProcessInstanceService{
boolean create(WFProcessInstance et) ;
void createBatch(List<WFProcessInstance> list) ;
boolean update(WFProcessInstance et) ; boolean update(WFProcessInstance et) ;
void updateBatch(List<WFProcessInstance> list) ; void updateBatch(List<WFProcessInstance> list) ;
boolean save(WFProcessInstance et) ;
void saveBatch(List<WFProcessInstance> list) ;
WFProcessInstance getDraft(WFProcessInstance et) ;
boolean remove(String key) ; boolean remove(String key) ;
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
WFProcessInstance get(String key) ; WFProcessInstance get(String key) ;
WFProcessInstance getDraft(WFProcessInstance et) ;
boolean checkKey(WFProcessInstance et) ; boolean checkKey(WFProcessInstance et) ;
boolean create(WFProcessInstance et) ; boolean save(WFProcessInstance et) ;
void createBatch(List<WFProcessInstance> list) ; void saveBatch(List<WFProcessInstance> list) ;
Page<WFProcessInstance> searchDefault(WFProcessInstanceSearchContext context) ; Page<WFProcessInstance> searchDefault(WFProcessInstanceSearchContext context) ;
} }
......
...@@ -23,17 +23,17 @@ import cn.ibizlab.core.workflow.filter.WFProcessNodeSearchContext; ...@@ -23,17 +23,17 @@ import cn.ibizlab.core.workflow.filter.WFProcessNodeSearchContext;
*/ */
public interface IWFProcessNodeService{ 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) ; boolean create(WFProcessNode et) ;
void createBatch(List<WFProcessNode> list) ; void createBatch(List<WFProcessNode> list) ;
boolean update(WFProcessNode et) ; boolean update(WFProcessNode et) ;
void updateBatch(List<WFProcessNode> list) ; void updateBatch(List<WFProcessNode> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFProcessNode get(String key) ;
WFProcessNode getDraft(WFProcessNode et) ; WFProcessNode getDraft(WFProcessNode et) ;
boolean checkKey(WFProcessNode et) ;
boolean save(WFProcessNode et) ;
void saveBatch(List<WFProcessNode> list) ;
Page<WFProcessNode> searchDefault(WFProcessNodeSearchContext context) ; Page<WFProcessNode> searchDefault(WFProcessNodeSearchContext context) ;
} }
......
...@@ -23,17 +23,17 @@ import cn.ibizlab.core.workflow.filter.WFREModelSearchContext; ...@@ -23,17 +23,17 @@ import cn.ibizlab.core.workflow.filter.WFREModelSearchContext;
*/ */
public interface IWFREModelService{ 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) ; boolean create(WFREModel et) ;
void createBatch(List<WFREModel> list) ; void createBatch(List<WFREModel> list) ;
boolean checkKey(WFREModel et) ; boolean update(WFREModel et) ;
void updateBatch(List<WFREModel> list) ;
boolean remove(String key) ; boolean remove(String key) ;
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
WFREModel get(String key) ;
WFREModel getDraft(WFREModel et) ; WFREModel getDraft(WFREModel et) ;
boolean checkKey(WFREModel et) ;
boolean save(WFREModel et) ;
void saveBatch(List<WFREModel> list) ;
Page<WFREModel> searchDefault(WFREModelSearchContext context) ; Page<WFREModel> searchDefault(WFREModelSearchContext context) ;
} }
......
...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface IWFSystemService extends IService<WFSystem>{ public interface IWFSystemService extends IService<WFSystem>{
boolean remove(String key) ; boolean create(WFSystem et) ;
void removeBatch(Collection<String> idList) ; void createBatch(List<WFSystem> list) ;
boolean update(WFSystem et) ; boolean update(WFSystem et) ;
void updateBatch(List<WFSystem> list) ; void updateBatch(List<WFSystem> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFSystem get(String key) ;
WFSystem getDraft(WFSystem et) ; WFSystem getDraft(WFSystem et) ;
boolean checkKey(WFSystem et) ;
boolean save(WFSystem et) ; boolean save(WFSystem et) ;
void saveBatch(List<WFSystem> list) ; 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) ; Page<WFSystem> searchDefault(WFSystemSearchContext context) ;
/** /**
*自定义查询SQL *自定义查询SQL
......
...@@ -25,13 +25,13 @@ public interface IWFTaskService{ ...@@ -25,13 +25,13 @@ public interface IWFTaskService{
boolean create(WFTask et) ; boolean create(WFTask et) ;
void createBatch(List<WFTask> list) ; 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) ; boolean update(WFTask et) ;
void updateBatch(List<WFTask> list) ; void updateBatch(List<WFTask> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WFTask get(String key) ; WFTask get(String key) ;
WFTask getDraft(WFTask et) ;
boolean checkKey(WFTask et) ;
boolean save(WFTask et) ; boolean save(WFTask et) ;
void saveBatch(List<WFTask> list) ; void saveBatch(List<WFTask> list) ;
Page<WFTask> searchDefault(WFTaskSearchContext context) ; Page<WFTask> searchDefault(WFTaskSearchContext context) ;
......
...@@ -23,15 +23,15 @@ import cn.ibizlab.core.workflow.filter.WFTaskWaySearchContext; ...@@ -23,15 +23,15 @@ import cn.ibizlab.core.workflow.filter.WFTaskWaySearchContext;
*/ */
public interface IWFTaskWayService{ public interface IWFTaskWayService{
boolean checkKey(WFTaskWay et) ;
boolean create(WFTaskWay et) ; boolean create(WFTaskWay et) ;
void createBatch(List<WFTaskWay> list) ; 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) ; boolean update(WFTaskWay et) ;
void updateBatch(List<WFTaskWay> list) ; 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) ; boolean save(WFTaskWay et) ;
void saveBatch(List<WFTaskWay> list) ; void saveBatch(List<WFTaskWay> list) ;
Page<WFTaskWay> searchDefault(WFTaskWaySearchContext context) ; Page<WFTaskWay> searchDefault(WFTaskWaySearchContext context) ;
......
...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface IWFUserService extends IService<WFUser>{ 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) ; boolean remove(String key) ;
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
WFUser get(String key) ;
WFUser getDraft(WFUser et) ; WFUser getDraft(WFUser et) ;
boolean checkKey(WFUser et) ;
boolean save(WFUser et) ; boolean save(WFUser et) ;
void saveBatch(List<WFUser> list) ; 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) ; Page<WFUser> searchDefault(WFUserSearchContext context) ;
/** /**
*自定义查询SQL *自定义查询SQL
......
...@@ -52,33 +52,17 @@ public class WFGroupServiceImpl extends ServiceImpl<WFGroupMapper, WFGroup> impl ...@@ -52,33 +52,17 @@ public class WFGroupServiceImpl extends ServiceImpl<WFGroupMapper, WFGroup> impl
@Override @Override
@Transactional @Transactional
public boolean save(WFGroup et) { public boolean create(WFGroup et) {
if(!saveOrUpdate(et)) if(!this.retBool(this.baseMapper.insert(et)))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(WFGroup et) {
if (null == et) {
return false; return false;
} else { wfmemberService.saveByGroupid(et.getId(),et.getWfmember());
return checkKey(et) ? this.update(et) : this.create(et); CachedBeanCopier.copy(get(et.getId()),et);
}
}
@Override
public boolean saveBatch(Collection<WFGroup> list) {
saveOrUpdateBatch(list,batchSize);
return true; return true;
} }
@Override @Override
public void saveBatch(List<WFGroup> list) { public void createBatch(List<WFGroup> list) {
saveOrUpdateBatch(list,batchSize); this.saveBatch(list,batchSize);
} }
@Override @Override
...@@ -96,30 +80,6 @@ public class WFGroupServiceImpl extends ServiceImpl<WFGroupMapper, WFGroup> impl ...@@ -96,30 +80,6 @@ public class WFGroupServiceImpl extends ServiceImpl<WFGroupMapper, WFGroup> impl
updateBatchById(list,batchSize); 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 @Override
@Transactional @Transactional
public boolean remove(String key) { public boolean remove(String key) {
...@@ -147,6 +107,46 @@ public class WFGroupServiceImpl extends ServiceImpl<WFGroupMapper, WFGroup> impl ...@@ -147,6 +107,46 @@ public class WFGroupServiceImpl extends ServiceImpl<WFGroupMapper, WFGroup> impl
return et; 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,38 +39,31 @@ public class WFHistoryServiceImpl implements IWFHistoryService { ...@@ -39,38 +39,31 @@ public class WFHistoryServiceImpl implements IWFHistoryService {
@Override @Override
public boolean checkKey(WFHistory et) { public boolean create(WFHistory et) {
return false;
}
@Override
public boolean update(WFHistory et) {
//代码实现 //代码实现
return true; return true;
} }
public void updateBatch(List<WFHistory> list){ public void createBatch(List<WFHistory> list){
} }
@Override @Override
@Transactional public boolean update(WFHistory et) {
public boolean save(WFHistory et) {
//代码实现 //代码实现
return true; return true;
} }
@Override public void updateBatch(List<WFHistory> list){
public void saveBatch(List<WFHistory> list) {
} }
@Override @Override
public boolean create(WFHistory et) { public boolean remove(String key) {
//代码实现
return true; return true;
} }
public void createBatch(List<WFHistory> list){ public void removeBatch(Collection<String> idList){
} }
...@@ -82,17 +75,24 @@ public class WFHistoryServiceImpl implements IWFHistoryService { ...@@ -82,17 +75,24 @@ public class WFHistoryServiceImpl implements IWFHistoryService {
} }
@Override @Override
public boolean remove(String key) { public WFHistory getDraft(WFHistory et) {
return true; 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 @Override
public WFHistory getDraft(WFHistory et) { public void saveBatch(List<WFHistory> list) {
return et;
} }
......
...@@ -54,29 +54,35 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i ...@@ -54,29 +54,35 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i
protected int batchSize = 500; protected int batchSize = 500;
@Override @Override
public boolean checkKey(WFMember et) { @Transactional
return (!ObjectUtils.isEmpty(et.getMemberid()))&&(!Objects.isNull(this.getById(et.getMemberid()))); 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 @Override
public WFMember getDraft(WFMember et) { public void createBatch(List<WFMember> list) {
fillParentData(et); list.forEach(item->fillParentData(item));
return et; this.saveOrUpdateBatch(list,batchSize);
} }
@Override @Override
@Transactional @Transactional
public boolean create(WFMember et) { public boolean update(WFMember et) {
fillParentData(et); fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et))) if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("memberid",et.getMemberid())))
return false; return false;
CachedBeanCopier.copy(get(et.getMemberid()),et); CachedBeanCopier.copy(get(et.getMemberid()),et);
return true; return true;
} }
@Override @Override
public void createBatch(List<WFMember> list) { public void updateBatch(List<WFMember> list) {
list.forEach(item->fillParentData(item)); list.forEach(item->fillParentData(item));
this.saveOrUpdateBatch(list,batchSize); updateBatchById(list,batchSize);
} }
@Override @Override
...@@ -91,6 +97,29 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i ...@@ -91,6 +97,29 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i
removeByIds(idList); 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 @Override
@Transactional @Transactional
public boolean save(WFMember et) { public boolean save(WFMember et) {
...@@ -124,35 +153,6 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i ...@@ -124,35 +153,6 @@ public class WFMemberServiceImpl extends ServiceImpl<WFMemberMapper, WFMember> i
saveOrUpdateBatch(list,batchSize); 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 @Override
public List<WFMember> selectByGroupid(String id) { public List<WFMember> selectByGroupid(String id) {
......
...@@ -49,33 +49,16 @@ public class WFProcessDefinitionServiceImpl extends ServiceImpl<WFProcessDefinit ...@@ -49,33 +49,16 @@ public class WFProcessDefinitionServiceImpl extends ServiceImpl<WFProcessDefinit
@Override @Override
@Transactional @Transactional
public boolean save(WFProcessDefinition et) { public boolean create(WFProcessDefinition et) {
if(!saveOrUpdate(et)) if(!this.retBool(this.baseMapper.insert(et)))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(WFProcessDefinition et) {
if (null == et) {
return false; return false;
} else { CachedBeanCopier.copy(get(et.getDefinitionkey()),et);
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<WFProcessDefinition> list) {
saveOrUpdateBatch(list,batchSize);
return true; return true;
} }
@Override @Override
public void saveBatch(List<WFProcessDefinition> list) { public void createBatch(List<WFProcessDefinition> list) {
saveOrUpdateBatch(list,batchSize); this.saveBatch(list,batchSize);
} }
@Override @Override
...@@ -92,6 +75,18 @@ public class WFProcessDefinitionServiceImpl extends ServiceImpl<WFProcessDefinit ...@@ -92,6 +75,18 @@ public class WFProcessDefinitionServiceImpl extends ServiceImpl<WFProcessDefinit
updateBatchById(list,batchSize); 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 @Override
@Transactional @Transactional
public WFProcessDefinition get(String key) { public WFProcessDefinition get(String key) {
...@@ -105,39 +100,44 @@ public class WFProcessDefinitionServiceImpl extends ServiceImpl<WFProcessDefinit ...@@ -105,39 +100,44 @@ public class WFProcessDefinitionServiceImpl extends ServiceImpl<WFProcessDefinit
return et; return et;
} }
@Override
public boolean checkKey(WFProcessDefinition et) {
return (!ObjectUtils.isEmpty(et.getDefinitionkey()))&&(!Objects.isNull(this.getById(et.getDefinitionkey())));
}
@Override @Override
public WFProcessDefinition getDraft(WFProcessDefinition et) { public WFProcessDefinition getDraft(WFProcessDefinition et) {
return et; return et;
} }
@Override
public boolean checkKey(WFProcessDefinition et) {
return (!ObjectUtils.isEmpty(et.getDefinitionkey()))&&(!Objects.isNull(this.getById(et.getDefinitionkey())));
}
@Override @Override
@Transactional @Transactional
public boolean create(WFProcessDefinition et) { public boolean save(WFProcessDefinition et) {
if(!this.retBool(this.baseMapper.insert(et))) if(!saveOrUpdate(et))
return false; return false;
CachedBeanCopier.copy(get(et.getDefinitionkey()),et);
return true; return true;
} }
@Override @Override
public void createBatch(List<WFProcessDefinition> list) { @Transactional(
this.saveBatch(list,batchSize); rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(WFProcessDefinition et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
} }
@Override @Override
@Transactional public boolean saveBatch(Collection<WFProcessDefinition> list) {
public boolean remove(String key) { saveOrUpdateBatch(list,batchSize);
boolean result=removeById(key); return true;
return result ;
} }
@Override @Override
public void removeBatch(Collection<String> idList) { public void saveBatch(List<WFProcessDefinition> list) {
removeByIds(idList); saveOrUpdateBatch(list,batchSize);
} }
......
...@@ -39,30 +39,23 @@ public class WFProcessInstanceServiceImpl implements IWFProcessInstanceService { ...@@ -39,30 +39,23 @@ public class WFProcessInstanceServiceImpl implements IWFProcessInstanceService {
@Override @Override
public boolean update(WFProcessInstance et) { public boolean create(WFProcessInstance et) {
//代码实现 //代码实现
return true; return true;
} }
public void updateBatch(List<WFProcessInstance> list){ public void createBatch(List<WFProcessInstance> list){
} }
@Override @Override
@Transactional public boolean update(WFProcessInstance et) {
public boolean save(WFProcessInstance et) {
//代码实现 //代码实现
return true; return true;
} }
@Override public void updateBatch(List<WFProcessInstance> list){
public void saveBatch(List<WFProcessInstance> list) {
}
@Override
public WFProcessInstance getDraft(WFProcessInstance et) {
return et;
} }
@Override @Override
...@@ -81,17 +74,24 @@ public class WFProcessInstanceServiceImpl implements IWFProcessInstanceService { ...@@ -81,17 +74,24 @@ public class WFProcessInstanceServiceImpl implements IWFProcessInstanceService {
return et; return et;
} }
@Override
public WFProcessInstance getDraft(WFProcessInstance et) {
return et;
}
@Override @Override
public boolean checkKey(WFProcessInstance et) { public boolean checkKey(WFProcessInstance et) {
return false; return false;
} }
@Override @Override
public boolean create(WFProcessInstance et) { @Transactional
public boolean save(WFProcessInstance et) {
//代码实现 //代码实现
return true; return true;
} }
public void createBatch(List<WFProcessInstance> list){ @Override
public void saveBatch(List<WFProcessInstance> list) {
} }
......
...@@ -39,27 +39,31 @@ public class WFProcessNodeServiceImpl implements IWFProcessNodeService { ...@@ -39,27 +39,31 @@ public class WFProcessNodeServiceImpl implements IWFProcessNodeService {
@Override @Override
public boolean remove(String key) { public boolean create(WFProcessNode et) {
//代码实现
return true; return true;
} }
public void removeBatch(Collection<String> idList){ public void createBatch(List<WFProcessNode> list){
} }
@Override @Override
public boolean checkKey(WFProcessNode et) { public boolean update(WFProcessNode et) {
return false;
}
@Override
@Transactional
public boolean save(WFProcessNode et) {
//代码实现 //代码实现
return true; return true;
} }
public void updateBatch(List<WFProcessNode> list){
}
@Override @Override
public void saveBatch(List<WFProcessNode> list) { public boolean remove(String key) {
return true;
}
public void removeBatch(Collection<String> idList){
} }
...@@ -71,28 +75,24 @@ public class WFProcessNodeServiceImpl implements IWFProcessNodeService { ...@@ -71,28 +75,24 @@ public class WFProcessNodeServiceImpl implements IWFProcessNodeService {
} }
@Override @Override
public boolean create(WFProcessNode et) { public WFProcessNode getDraft(WFProcessNode et) {
//代码实现 return et;
return true;
} }
public void createBatch(List<WFProcessNode> list){ @Override
public boolean checkKey(WFProcessNode et) {
return false;
} }
@Override @Override
public boolean update(WFProcessNode et) { @Transactional
public boolean save(WFProcessNode et) {
//代码实现 //代码实现
return true; return true;
} }
public void updateBatch(List<WFProcessNode> list){
}
@Override @Override
public WFProcessNode getDraft(WFProcessNode et) { public void saveBatch(List<WFProcessNode> list) {
return et;
} }
......
...@@ -49,14 +49,16 @@ public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> i ...@@ -49,14 +49,16 @@ public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> i
@Override @Override
@Transactional @Transactional
public boolean remove(String key) { public boolean create(WFSystem et) {
boolean result=removeById(key); if(!this.retBool(this.baseMapper.insert(et)))
return result ; return false;
CachedBeanCopier.copy(get(et.getPssystemid()),et);
return true;
} }
@Override @Override
public void removeBatch(Collection<String> idList) { public void createBatch(List<WFSystem> list) {
removeByIds(idList); this.saveBatch(list,batchSize);
} }
@Override @Override
...@@ -73,11 +75,40 @@ public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> i ...@@ -73,11 +75,40 @@ public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> i
updateBatchById(list,batchSize); 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 @Override
public WFSystem getDraft(WFSystem et) { public WFSystem getDraft(WFSystem et) {
return et; return et;
} }
@Override
public boolean checkKey(WFSystem et) {
return (!ObjectUtils.isEmpty(et.getPssystemid()))&&(!Objects.isNull(this.getById(et.getPssystemid())));
}
@Override @Override
@Transactional @Transactional
public boolean save(WFSystem et) { public boolean save(WFSystem et) {
...@@ -109,37 +140,6 @@ public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> i ...@@ -109,37 +140,6 @@ public class WFSystemServiceImpl extends ServiceImpl<WFSystemMapper, WFSystem> i
saveOrUpdateBatch(list,batchSize); 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,30 +49,21 @@ public class WFTaskServiceImpl implements IWFTaskService { ...@@ -49,30 +49,21 @@ public class WFTaskServiceImpl implements IWFTaskService {
} }
@Override @Override
public WFTask getDraft(WFTask et) { public boolean update(WFTask et) {
return et; //代码实现
}
@Override
public boolean remove(String key) {
return true; return true;
} }
public void removeBatch(Collection<String> idList){ public void updateBatch(List<WFTask> list){
} }
@Override @Override
public boolean checkKey(WFTask et) { public boolean remove(String key) {
return false;
}
@Override
public boolean update(WFTask et) {
//代码实现
return true; return true;
} }
public void updateBatch(List<WFTask> list){ public void removeBatch(Collection<String> idList){
} }
...@@ -83,6 +74,15 @@ public class WFTaskServiceImpl implements IWFTaskService { ...@@ -83,6 +74,15 @@ public class WFTaskServiceImpl implements IWFTaskService {
return et; return et;
} }
@Override
public WFTask getDraft(WFTask et) {
return et;
}
@Override
public boolean checkKey(WFTask et) {
return false;
}
@Override @Override
@Transactional @Transactional
public boolean save(WFTask et) { public boolean save(WFTask et) {
......
...@@ -38,10 +38,6 @@ import cn.ibizlab.util.helper.CachedBeanCopier; ...@@ -38,10 +38,6 @@ import cn.ibizlab.util.helper.CachedBeanCopier;
public class WFTaskWayServiceImpl implements IWFTaskWayService { public class WFTaskWayServiceImpl implements IWFTaskWayService {
@Override
public boolean checkKey(WFTaskWay et) {
return false;
}
@Override @Override
public boolean create(WFTaskWay et) { public boolean create(WFTaskWay et) {
//代码实现 //代码实现
...@@ -53,15 +49,13 @@ public class WFTaskWayServiceImpl implements IWFTaskWayService { ...@@ -53,15 +49,13 @@ public class WFTaskWayServiceImpl implements IWFTaskWayService {
} }
@Override @Override
public WFTaskWay getDraft(WFTaskWay et) { public boolean update(WFTaskWay et) {
return et; //代码实现
return true;
} }
@Override public void updateBatch(List<WFTaskWay> list){
public WFTaskWay get(String key) {
WFTaskWay et = new WFTaskWay();
et.setSequenceflowid(key);
return et;
} }
@Override @Override
...@@ -74,15 +68,21 @@ public class WFTaskWayServiceImpl implements IWFTaskWayService { ...@@ -74,15 +68,21 @@ public class WFTaskWayServiceImpl implements IWFTaskWayService {
} }
@Override @Override
public boolean update(WFTaskWay et) { public WFTaskWay get(String key) {
//代码实现 WFTaskWay et = new WFTaskWay();
return true; 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 @Override
@Transactional @Transactional
public boolean save(WFTaskWay et) { public boolean save(WFTaskWay et) {
......
...@@ -50,6 +50,34 @@ public class WFUserServiceImpl extends ServiceImpl<WFUserMapper, WFUser> impleme ...@@ -50,6 +50,34 @@ public class WFUserServiceImpl extends ServiceImpl<WFUserMapper, WFUser> impleme
protected int batchSize = 500; 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 @Override
@Transactional @Transactional
public boolean remove(String key) { public boolean remove(String key) {
...@@ -62,11 +90,28 @@ public class WFUserServiceImpl extends ServiceImpl<WFUserMapper, WFUser> impleme ...@@ -62,11 +90,28 @@ public class WFUserServiceImpl extends ServiceImpl<WFUserMapper, WFUser> impleme
removeByIds(idList); 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 @Override
public WFUser getDraft(WFUser et) { public WFUser getDraft(WFUser et) {
return et; return et;
} }
@Override
public boolean checkKey(WFUser et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override @Override
@Transactional @Transactional
public boolean save(WFUser et) { public boolean save(WFUser et) {
...@@ -98,51 +143,6 @@ public class WFUserServiceImpl extends ServiceImpl<WFUserMapper, WFUser> impleme ...@@ -98,51 +143,6 @@ public class WFUserServiceImpl extends ServiceImpl<WFUserMapper, WFUser> impleme
saveOrUpdateBatch(list,batchSize); 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 @@ ...@@ -8,7 +8,7 @@
"delogicname":"流程模型", "delogicname":"流程模型",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"}, "sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "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":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
, { , {
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"delogicname":"成员", "delogicname":"成员",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"}, "sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "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":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
, { , {
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"delogicname":"角色/用户组", "delogicname":"角色/用户组",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"}, "sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "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":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
, { , {
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"delogicname":"用户", "delogicname":"用户",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"}, "sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "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":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
, { , {
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
"delogicname":"流程定义", "delogicname":"流程定义",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"}, "sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "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":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
, { , {
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
"delogicname":"系统", "delogicname":"系统",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"}, "sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "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":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
], ],
......
...@@ -47,18 +47,22 @@ public class WFGroupResource { ...@@ -47,18 +47,22 @@ public class WFGroupResource {
@Lazy @Lazy
public WFGroupMapping wfgroupMapping; public WFGroupMapping wfgroupMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Create-all')")
@ApiOperation(value = "保存角色/用户组", tags = {"角色/用户组" }, notes = "保存角色/用户组") @ApiOperation(value = "新建角色/用户组", tags = {"角色/用户组" }, notes = "新建角色/用户组")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/save") @RequestMapping(method = RequestMethod.POST, value = "/wfgroups")
public ResponseEntity<Boolean> save(@RequestBody WFGroupDTO wfgroupdto) { @Transactional
return ResponseEntity.status(HttpStatus.OK).body(wfgroupService.save(wfgroupMapping.toDomain(wfgroupdto))); 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')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Create-all')")
@ApiOperation(value = "批量保存角色/用户组", tags = {"角色/用户组" }, notes = "批量保存角色/用户组") @ApiOperation(value = "批量新建角色/用户组", tags = {"角色/用户组" }, notes = "批量新建角色/用户组")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/wfgroups/batch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) { public ResponseEntity<Boolean> createBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) {
wfgroupService.saveBatch(wfgroupMapping.toDomain(wfgroupdtos)); wfgroupService.createBatch(wfgroupMapping.toDomain(wfgroupdtos));
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
...@@ -82,37 +86,6 @@ public class WFGroupResource { ...@@ -82,37 +86,6 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(true); 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')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Remove-all')")
@ApiOperation(value = "删除角色/用户组", tags = {"角色/用户组" }, notes = "删除角色/用户组") @ApiOperation(value = "删除角色/用户组", tags = {"角色/用户组" }, notes = "删除角色/用户组")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfgroups/{wfgroup_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/wfgroups/{wfgroup_id}")
...@@ -138,7 +111,34 @@ public class WFGroupResource { ...@@ -138,7 +111,34 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); 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") @ApiOperation(value = "获取DEFAULT", tags = {"角色/用户组" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfgroups/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/wfgroups/fetchdefault")
public ResponseEntity<List<WFGroupDTO>> fetchDefault(WFGroupSearchContext context) { public ResponseEntity<List<WFGroupDTO>> fetchDefault(WFGroupSearchContext context) {
...@@ -151,7 +151,7 @@ public class WFGroupResource { ...@@ -151,7 +151,7 @@ public class WFGroupResource {
.body(list); .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") @ApiOperation(value = "查询DEFAULT", tags = {"角色/用户组" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfgroups/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/wfgroups/searchdefault")
public ResponseEntity<Page<WFGroupDTO>> searchDefault(@RequestBody WFGroupSearchContext context) { public ResponseEntity<Page<WFGroupDTO>> searchDefault(@RequestBody WFGroupSearchContext context) {
......
...@@ -47,18 +47,6 @@ public class WFMemberResource { ...@@ -47,18 +47,6 @@ public class WFMemberResource {
@Lazy @Lazy
public WFMemberMapping wfmemberMapping; public WFMemberMapping wfmemberMapping;
@ApiOperation(value = "检查成员", tags = {"成员" }, notes = "检查成员")
@RequestMapping(method = RequestMethod.POST, value = "/wfmembers/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WFMemberDTO wfmemberdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfmemberService.checkKey(wfmemberMapping.toDomain(wfmemberdto)));
}
@ApiOperation(value = "获取成员草稿", tags = {"成员" }, notes = "获取成员草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfmembers/getdraft")
public ResponseEntity<WFMemberDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfmemberMapping.toDto(wfmemberService.getDraft(new WFMember())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Create-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Create-all')")
@ApiOperation(value = "新建成员", tags = {"成员" }, notes = "新建成员") @ApiOperation(value = "新建成员", tags = {"成员" }, notes = "新建成员")
@RequestMapping(method = RequestMethod.POST, value = "/wfmembers") @RequestMapping(method = RequestMethod.POST, value = "/wfmembers")
...@@ -78,6 +66,26 @@ public class WFMemberResource { ...@@ -78,6 +66,26 @@ public class WFMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Update-all')")
@ApiOperation(value = "更新成员", tags = {"成员" }, notes = "更新成员")
@RequestMapping(method = RequestMethod.PUT, value = "/wfmembers/{wfmember_id}")
@Transactional
public ResponseEntity<WFMemberDTO> update(@PathVariable("wfmember_id") String wfmember_id, @RequestBody WFMemberDTO wfmemberdto) {
WFMember domain = wfmemberMapping.toDomain(wfmemberdto);
domain .setMemberid(wfmember_id);
wfmemberService.update(domain );
WFMemberDTO dto = wfmemberMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Update-all')")
@ApiOperation(value = "批量更新成员", tags = {"成员" }, notes = "批量更新成员")
@RequestMapping(method = RequestMethod.PUT, value = "/wfmembers/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFMemberDTO> wfmemberdtos) {
wfmemberService.updateBatch(wfmemberMapping.toDomain(wfmemberdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Remove-all')")
@ApiOperation(value = "删除成员", tags = {"成员" }, notes = "删除成员") @ApiOperation(value = "删除成员", tags = {"成员" }, notes = "删除成员")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfmembers/{wfmember_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/wfmembers/{wfmember_id}")
...@@ -94,6 +102,27 @@ public class WFMemberResource { ...@@ -94,6 +102,27 @@ public class WFMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Get-all')")
@ApiOperation(value = "获取成员", tags = {"成员" }, notes = "获取成员")
@RequestMapping(method = RequestMethod.GET, value = "/wfmembers/{wfmember_id}")
public ResponseEntity<WFMemberDTO> get(@PathVariable("wfmember_id") String wfmember_id) {
WFMember domain = wfmemberService.get(wfmember_id);
WFMemberDTO dto = wfmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取成员草稿", tags = {"成员" }, notes = "获取成员草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfmembers/getdraft")
public ResponseEntity<WFMemberDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfmemberMapping.toDto(wfmemberService.getDraft(new WFMember())));
}
@ApiOperation(value = "检查成员", tags = {"成员" }, notes = "检查成员")
@RequestMapping(method = RequestMethod.POST, value = "/wfmembers/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WFMemberDTO wfmemberdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfmemberService.checkKey(wfmemberMapping.toDomain(wfmemberdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Save-all')")
@ApiOperation(value = "保存成员", tags = {"成员" }, notes = "保存成员") @ApiOperation(value = "保存成员", tags = {"成员" }, notes = "保存成员")
@RequestMapping(method = RequestMethod.POST, value = "/wfmembers/save") @RequestMapping(method = RequestMethod.POST, value = "/wfmembers/save")
...@@ -109,36 +138,7 @@ public class WFMemberResource { ...@@ -109,36 +138,7 @@ public class WFMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Update-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-searchDefault-all') and hasPermission(#context,'ibzwf-WFMember-Get')")
@ApiOperation(value = "更新成员", tags = {"成员" }, notes = "更新成员")
@RequestMapping(method = RequestMethod.PUT, value = "/wfmembers/{wfmember_id}")
@Transactional
public ResponseEntity<WFMemberDTO> update(@PathVariable("wfmember_id") String wfmember_id, @RequestBody WFMemberDTO wfmemberdto) {
WFMember domain = wfmemberMapping.toDomain(wfmemberdto);
domain .setMemberid(wfmember_id);
wfmemberService.update(domain );
WFMemberDTO dto = wfmemberMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Update-all')")
@ApiOperation(value = "批量更新成员", tags = {"成员" }, notes = "批量更新成员")
@RequestMapping(method = RequestMethod.PUT, value = "/wfmembers/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFMemberDTO> wfmemberdtos) {
wfmemberService.updateBatch(wfmemberMapping.toDomain(wfmemberdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Get-all')")
@ApiOperation(value = "获取成员", tags = {"成员" }, notes = "获取成员")
@RequestMapping(method = RequestMethod.GET, value = "/wfmembers/{wfmember_id}")
public ResponseEntity<WFMemberDTO> get(@PathVariable("wfmember_id") String wfmember_id) {
WFMember domain = wfmemberService.get(wfmember_id);
WFMemberDTO dto = wfmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-searchDefault-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"成员" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"成员" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfmembers/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/wfmembers/fetchdefault")
public ResponseEntity<List<WFMemberDTO>> fetchDefault(WFMemberSearchContext context) { public ResponseEntity<List<WFMemberDTO>> fetchDefault(WFMemberSearchContext context) {
...@@ -151,7 +151,7 @@ public class WFMemberResource { ...@@ -151,7 +151,7 @@ public class WFMemberResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-searchDefault-all') and hasPermission(#context,'ibzwf-WFMember-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"成员" } ,notes = "查询DEFAULT") @ApiOperation(value = "查询DEFAULT", tags = {"成员" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfmembers/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/wfmembers/searchdefault")
public ResponseEntity<Page<WFMemberDTO>> searchDefault(@RequestBody WFMemberSearchContext context) { public ResponseEntity<Page<WFMemberDTO>> searchDefault(@RequestBody WFMemberSearchContext context) {
...@@ -159,20 +159,6 @@ public class WFMemberResource { ...@@ -159,20 +159,6 @@ public class WFMemberResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(wfmemberMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(wfmemberMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@ApiOperation(value = "根据角色/用户组检查成员", tags = {"成员" }, notes = "根据角色/用户组检查成员")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/{wfgroup_id}/wfmembers/checkkey")
public ResponseEntity<Boolean> checkKeyByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id, @RequestBody WFMemberDTO wfmemberdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfmemberService.checkKey(wfmemberMapping.toDomain(wfmemberdto)));
}
@ApiOperation(value = "根据角色/用户组获取成员草稿", tags = {"成员" }, notes = "根据角色/用户组获取成员草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfgroups/{wfgroup_id}/wfmembers/getdraft")
public ResponseEntity<WFMemberDTO> getDraftByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id) {
WFMember domain = new WFMember();
domain.setGroupid(wfgroup_id);
return ResponseEntity.status(HttpStatus.OK).body(wfmemberMapping.toDto(wfmemberService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Create-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Create-all')")
@ApiOperation(value = "根据角色/用户组建立成员", tags = {"成员" }, notes = "根据角色/用户组建立成员") @ApiOperation(value = "根据角色/用户组建立成员", tags = {"成员" }, notes = "根据角色/用户组建立成员")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/{wfgroup_id}/wfmembers") @RequestMapping(method = RequestMethod.POST, value = "/wfgroups/{wfgroup_id}/wfmembers")
...@@ -197,6 +183,31 @@ public class WFMemberResource { ...@@ -197,6 +183,31 @@ public class WFMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Update-all')")
@ApiOperation(value = "根据角色/用户组更新成员", tags = {"成员" }, notes = "根据角色/用户组更新成员")
@RequestMapping(method = RequestMethod.PUT, value = "/wfgroups/{wfgroup_id}/wfmembers/{wfmember_id}")
@Transactional
public ResponseEntity<WFMemberDTO> updateByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id, @PathVariable("wfmember_id") String wfmember_id, @RequestBody WFMemberDTO wfmemberdto) {
WFMember domain = wfmemberMapping.toDomain(wfmemberdto);
domain.setGroupid(wfgroup_id);
domain.setMemberid(wfmember_id);
wfmemberService.update(domain);
WFMemberDTO dto = wfmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Update-all')")
@ApiOperation(value = "根据角色/用户组批量更新成员", tags = {"成员" }, notes = "根据角色/用户组批量更新成员")
@RequestMapping(method = RequestMethod.PUT, value = "/wfgroups/{wfgroup_id}/wfmembers/batch")
public ResponseEntity<Boolean> updateBatchByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id, @RequestBody List<WFMemberDTO> wfmemberdtos) {
List<WFMember> domainlist=wfmemberMapping.toDomain(wfmemberdtos);
for(WFMember domain:domainlist){
domain.setGroupid(wfgroup_id);
}
wfmemberService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Remove-all')")
@ApiOperation(value = "根据角色/用户组删除成员", tags = {"成员" }, notes = "根据角色/用户组删除成员") @ApiOperation(value = "根据角色/用户组删除成员", tags = {"成员" }, notes = "根据角色/用户组删除成员")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfgroups/{wfgroup_id}/wfmembers/{wfmember_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/wfgroups/{wfgroup_id}/wfmembers/{wfmember_id}")
...@@ -213,6 +224,29 @@ public class WFMemberResource { ...@@ -213,6 +224,29 @@ public class WFMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Get-all')")
@ApiOperation(value = "根据角色/用户组获取成员", tags = {"成员" }, notes = "根据角色/用户组获取成员")
@RequestMapping(method = RequestMethod.GET, value = "/wfgroups/{wfgroup_id}/wfmembers/{wfmember_id}")
public ResponseEntity<WFMemberDTO> getByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id, @PathVariable("wfmember_id") String wfmember_id) {
WFMember domain = wfmemberService.get(wfmember_id);
WFMemberDTO dto = wfmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据角色/用户组获取成员草稿", tags = {"成员" }, notes = "根据角色/用户组获取成员草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfgroups/{wfgroup_id}/wfmembers/getdraft")
public ResponseEntity<WFMemberDTO> getDraftByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id) {
WFMember domain = new WFMember();
domain.setGroupid(wfgroup_id);
return ResponseEntity.status(HttpStatus.OK).body(wfmemberMapping.toDto(wfmemberService.getDraft(domain)));
}
@ApiOperation(value = "根据角色/用户组检查成员", tags = {"成员" }, notes = "根据角色/用户组检查成员")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/{wfgroup_id}/wfmembers/checkkey")
public ResponseEntity<Boolean> checkKeyByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id, @RequestBody WFMemberDTO wfmemberdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfmemberService.checkKey(wfmemberMapping.toDomain(wfmemberdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Save-all')")
@ApiOperation(value = "根据角色/用户组保存成员", tags = {"成员" }, notes = "根据角色/用户组保存成员") @ApiOperation(value = "根据角色/用户组保存成员", tags = {"成员" }, notes = "根据角色/用户组保存成员")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/{wfgroup_id}/wfmembers/save") @RequestMapping(method = RequestMethod.POST, value = "/wfgroups/{wfgroup_id}/wfmembers/save")
...@@ -234,41 +268,7 @@ public class WFMemberResource { ...@@ -234,41 +268,7 @@ public class WFMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Update-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-searchDefault-all') and hasPermission(#context,'ibzwf-WFMember-Get')")
@ApiOperation(value = "根据角色/用户组更新成员", tags = {"成员" }, notes = "根据角色/用户组更新成员")
@RequestMapping(method = RequestMethod.PUT, value = "/wfgroups/{wfgroup_id}/wfmembers/{wfmember_id}")
@Transactional
public ResponseEntity<WFMemberDTO> updateByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id, @PathVariable("wfmember_id") String wfmember_id, @RequestBody WFMemberDTO wfmemberdto) {
WFMember domain = wfmemberMapping.toDomain(wfmemberdto);
domain.setGroupid(wfgroup_id);
domain.setMemberid(wfmember_id);
wfmemberService.update(domain);
WFMemberDTO dto = wfmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Update-all')")
@ApiOperation(value = "根据角色/用户组批量更新成员", tags = {"成员" }, notes = "根据角色/用户组批量更新成员")
@RequestMapping(method = RequestMethod.PUT, value = "/wfgroups/{wfgroup_id}/wfmembers/batch")
public ResponseEntity<Boolean> updateBatchByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id, @RequestBody List<WFMemberDTO> wfmemberdtos) {
List<WFMember> domainlist=wfmemberMapping.toDomain(wfmemberdtos);
for(WFMember domain:domainlist){
domain.setGroupid(wfgroup_id);
}
wfmemberService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Get-all')")
@ApiOperation(value = "根据角色/用户组获取成员", tags = {"成员" }, notes = "根据角色/用户组获取成员")
@RequestMapping(method = RequestMethod.GET, value = "/wfgroups/{wfgroup_id}/wfmembers/{wfmember_id}")
public ResponseEntity<WFMemberDTO> getByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id, @PathVariable("wfmember_id") String wfmember_id) {
WFMember domain = wfmemberService.get(wfmember_id);
WFMemberDTO dto = wfmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-searchDefault-all')")
@ApiOperation(value = "根据角色/用户组获取DEFAULT", tags = {"成员" } ,notes = "根据角色/用户组获取DEFAULT") @ApiOperation(value = "根据角色/用户组获取DEFAULT", tags = {"成员" } ,notes = "根据角色/用户组获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfgroups/{wfgroup_id}/wfmembers/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/wfgroups/{wfgroup_id}/wfmembers/fetchdefault")
public ResponseEntity<List<WFMemberDTO>> fetchWFMemberDefaultByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id,WFMemberSearchContext context) { public ResponseEntity<List<WFMemberDTO>> fetchWFMemberDefaultByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id,WFMemberSearchContext context) {
...@@ -282,7 +282,7 @@ public class WFMemberResource { ...@@ -282,7 +282,7 @@ public class WFMemberResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-searchDefault-all') and hasPermission(#context,'ibzwf-WFMember-Get')")
@ApiOperation(value = "根据角色/用户组查询DEFAULT", tags = {"成员" } ,notes = "根据角色/用户组查询DEFAULT") @ApiOperation(value = "根据角色/用户组查询DEFAULT", tags = {"成员" } ,notes = "根据角色/用户组查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfgroups/{wfgroup_id}/wfmembers/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/wfgroups/{wfgroup_id}/wfmembers/searchdefault")
public ResponseEntity<Page<WFMemberDTO>> searchWFMemberDefaultByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id, @RequestBody WFMemberSearchContext context) { public ResponseEntity<Page<WFMemberDTO>> searchWFMemberDefaultByWFGroup(@PathVariable("wfgroup_id") String wfgroup_id, @RequestBody WFMemberSearchContext context) {
...@@ -291,20 +291,6 @@ public class WFMemberResource { ...@@ -291,20 +291,6 @@ public class WFMemberResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(wfmemberMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(wfmemberMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@ApiOperation(value = "根据用户检查成员", tags = {"成员" }, notes = "根据用户检查成员")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/{wfuser_id}/wfmembers/checkkey")
public ResponseEntity<Boolean> checkKeyByWFUser(@PathVariable("wfuser_id") String wfuser_id, @RequestBody WFMemberDTO wfmemberdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfmemberService.checkKey(wfmemberMapping.toDomain(wfmemberdto)));
}
@ApiOperation(value = "根据用户获取成员草稿", tags = {"成员" }, notes = "根据用户获取成员草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/{wfuser_id}/wfmembers/getdraft")
public ResponseEntity<WFMemberDTO> getDraftByWFUser(@PathVariable("wfuser_id") String wfuser_id) {
WFMember domain = new WFMember();
domain.setUserid(wfuser_id);
return ResponseEntity.status(HttpStatus.OK).body(wfmemberMapping.toDto(wfmemberService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Create-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Create-all')")
@ApiOperation(value = "根据用户建立成员", tags = {"成员" }, notes = "根据用户建立成员") @ApiOperation(value = "根据用户建立成员", tags = {"成员" }, notes = "根据用户建立成员")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/{wfuser_id}/wfmembers") @RequestMapping(method = RequestMethod.POST, value = "/wfusers/{wfuser_id}/wfmembers")
...@@ -329,6 +315,31 @@ public class WFMemberResource { ...@@ -329,6 +315,31 @@ public class WFMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Update-all')")
@ApiOperation(value = "根据用户更新成员", tags = {"成员" }, notes = "根据用户更新成员")
@RequestMapping(method = RequestMethod.PUT, value = "/wfusers/{wfuser_id}/wfmembers/{wfmember_id}")
@Transactional
public ResponseEntity<WFMemberDTO> updateByWFUser(@PathVariable("wfuser_id") String wfuser_id, @PathVariable("wfmember_id") String wfmember_id, @RequestBody WFMemberDTO wfmemberdto) {
WFMember domain = wfmemberMapping.toDomain(wfmemberdto);
domain.setUserid(wfuser_id);
domain.setMemberid(wfmember_id);
wfmemberService.update(domain);
WFMemberDTO dto = wfmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Update-all')")
@ApiOperation(value = "根据用户批量更新成员", tags = {"成员" }, notes = "根据用户批量更新成员")
@RequestMapping(method = RequestMethod.PUT, value = "/wfusers/{wfuser_id}/wfmembers/batch")
public ResponseEntity<Boolean> updateBatchByWFUser(@PathVariable("wfuser_id") String wfuser_id, @RequestBody List<WFMemberDTO> wfmemberdtos) {
List<WFMember> domainlist=wfmemberMapping.toDomain(wfmemberdtos);
for(WFMember domain:domainlist){
domain.setUserid(wfuser_id);
}
wfmemberService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Remove-all')")
@ApiOperation(value = "根据用户删除成员", tags = {"成员" }, notes = "根据用户删除成员") @ApiOperation(value = "根据用户删除成员", tags = {"成员" }, notes = "根据用户删除成员")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfusers/{wfuser_id}/wfmembers/{wfmember_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/wfusers/{wfuser_id}/wfmembers/{wfmember_id}")
...@@ -345,6 +356,29 @@ public class WFMemberResource { ...@@ -345,6 +356,29 @@ public class WFMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Get-all')")
@ApiOperation(value = "根据用户获取成员", tags = {"成员" }, notes = "根据用户获取成员")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/{wfuser_id}/wfmembers/{wfmember_id}")
public ResponseEntity<WFMemberDTO> getByWFUser(@PathVariable("wfuser_id") String wfuser_id, @PathVariable("wfmember_id") String wfmember_id) {
WFMember domain = wfmemberService.get(wfmember_id);
WFMemberDTO dto = wfmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据用户获取成员草稿", tags = {"成员" }, notes = "根据用户获取成员草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/{wfuser_id}/wfmembers/getdraft")
public ResponseEntity<WFMemberDTO> getDraftByWFUser(@PathVariable("wfuser_id") String wfuser_id) {
WFMember domain = new WFMember();
domain.setUserid(wfuser_id);
return ResponseEntity.status(HttpStatus.OK).body(wfmemberMapping.toDto(wfmemberService.getDraft(domain)));
}
@ApiOperation(value = "根据用户检查成员", tags = {"成员" }, notes = "根据用户检查成员")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/{wfuser_id}/wfmembers/checkkey")
public ResponseEntity<Boolean> checkKeyByWFUser(@PathVariable("wfuser_id") String wfuser_id, @RequestBody WFMemberDTO wfmemberdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfmemberService.checkKey(wfmemberMapping.toDomain(wfmemberdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Save-all')")
@ApiOperation(value = "根据用户保存成员", tags = {"成员" }, notes = "根据用户保存成员") @ApiOperation(value = "根据用户保存成员", tags = {"成员" }, notes = "根据用户保存成员")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/{wfuser_id}/wfmembers/save") @RequestMapping(method = RequestMethod.POST, value = "/wfusers/{wfuser_id}/wfmembers/save")
...@@ -366,41 +400,7 @@ public class WFMemberResource { ...@@ -366,41 +400,7 @@ public class WFMemberResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Update-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-searchDefault-all') and hasPermission(#context,'ibzwf-WFMember-Get')")
@ApiOperation(value = "根据用户更新成员", tags = {"成员" }, notes = "根据用户更新成员")
@RequestMapping(method = RequestMethod.PUT, value = "/wfusers/{wfuser_id}/wfmembers/{wfmember_id}")
@Transactional
public ResponseEntity<WFMemberDTO> updateByWFUser(@PathVariable("wfuser_id") String wfuser_id, @PathVariable("wfmember_id") String wfmember_id, @RequestBody WFMemberDTO wfmemberdto) {
WFMember domain = wfmemberMapping.toDomain(wfmemberdto);
domain.setUserid(wfuser_id);
domain.setMemberid(wfmember_id);
wfmemberService.update(domain);
WFMemberDTO dto = wfmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Update-all')")
@ApiOperation(value = "根据用户批量更新成员", tags = {"成员" }, notes = "根据用户批量更新成员")
@RequestMapping(method = RequestMethod.PUT, value = "/wfusers/{wfuser_id}/wfmembers/batch")
public ResponseEntity<Boolean> updateBatchByWFUser(@PathVariable("wfuser_id") String wfuser_id, @RequestBody List<WFMemberDTO> wfmemberdtos) {
List<WFMember> domainlist=wfmemberMapping.toDomain(wfmemberdtos);
for(WFMember domain:domainlist){
domain.setUserid(wfuser_id);
}
wfmemberService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-Get-all')")
@ApiOperation(value = "根据用户获取成员", tags = {"成员" }, notes = "根据用户获取成员")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/{wfuser_id}/wfmembers/{wfmember_id}")
public ResponseEntity<WFMemberDTO> getByWFUser(@PathVariable("wfuser_id") String wfuser_id, @PathVariable("wfmember_id") String wfmember_id) {
WFMember domain = wfmemberService.get(wfmember_id);
WFMemberDTO dto = wfmemberMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-searchDefault-all')")
@ApiOperation(value = "根据用户获取DEFAULT", tags = {"成员" } ,notes = "根据用户获取DEFAULT") @ApiOperation(value = "根据用户获取DEFAULT", tags = {"成员" } ,notes = "根据用户获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfusers/{wfuser_id}/wfmembers/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/wfusers/{wfuser_id}/wfmembers/fetchdefault")
public ResponseEntity<List<WFMemberDTO>> fetchWFMemberDefaultByWFUser(@PathVariable("wfuser_id") String wfuser_id,WFMemberSearchContext context) { public ResponseEntity<List<WFMemberDTO>> fetchWFMemberDefaultByWFUser(@PathVariable("wfuser_id") String wfuser_id,WFMemberSearchContext context) {
...@@ -414,7 +414,7 @@ public class WFMemberResource { ...@@ -414,7 +414,7 @@ public class WFMemberResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFMember-searchDefault-all') and hasPermission(#context,'ibzwf-WFMember-Get')")
@ApiOperation(value = "根据用户查询DEFAULT", tags = {"成员" } ,notes = "根据用户查询DEFAULT") @ApiOperation(value = "根据用户查询DEFAULT", tags = {"成员" } ,notes = "根据用户查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfusers/{wfuser_id}/wfmembers/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/wfusers/{wfuser_id}/wfmembers/searchdefault")
public ResponseEntity<Page<WFMemberDTO>> searchWFMemberDefaultByWFUser(@PathVariable("wfuser_id") String wfuser_id, @RequestBody WFMemberSearchContext context) { public ResponseEntity<Page<WFMemberDTO>> searchWFMemberDefaultByWFUser(@PathVariable("wfuser_id") String wfuser_id, @RequestBody WFMemberSearchContext context) {
......
...@@ -47,18 +47,22 @@ public class WFProcessDefinitionResource { ...@@ -47,18 +47,22 @@ public class WFProcessDefinitionResource {
@Lazy @Lazy
public WFProcessDefinitionMapping wfprocessdefinitionMapping; public WFProcessDefinitionMapping wfprocessdefinitionMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Create-all')")
@ApiOperation(value = "保存流程定义", tags = {"流程定义" }, notes = "保存流程定义") @ApiOperation(value = "新建流程定义", tags = {"流程定义" }, notes = "新建流程定义")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/save") @RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions")
public ResponseEntity<Boolean> save(@RequestBody WFProcessDefinitionDTO wfprocessdefinitiondto) { @Transactional
return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionService.save(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondto))); public ResponseEntity<WFProcessDefinitionDTO> create(@RequestBody WFProcessDefinitionDTO wfprocessdefinitiondto) {
WFProcessDefinition domain = wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondto);
wfprocessdefinitionService.create(domain);
WFProcessDefinitionDTO dto = wfprocessdefinitionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Create-all')")
@ApiOperation(value = "批量保存流程定义", tags = {"流程定义" }, notes = "批量保存流程定义") @ApiOperation(value = "批量新建流程定义", tags = {"流程定义" }, notes = "批量新建流程定义")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/batch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFProcessDefinitionDTO> wfprocessdefinitiondtos) { public ResponseEntity<Boolean> createBatch(@RequestBody List<WFProcessDefinitionDTO> wfprocessdefinitiondtos) {
wfprocessdefinitionService.saveBatch(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondtos)); wfprocessdefinitionService.createBatch(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
...@@ -82,6 +86,22 @@ public class WFProcessDefinitionResource { ...@@ -82,6 +86,22 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Remove-all')")
@ApiOperation(value = "删除流程定义", tags = {"流程定义" }, notes = "删除流程定义")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfprocessdefinitions/{wfprocessdefinition_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("wfprocessdefinition_id") String wfprocessdefinition_id) {
return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionService.remove(wfprocessdefinition_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Remove-all')")
@ApiOperation(value = "批量删除流程定义", tags = {"流程定义" }, notes = "批量删除流程定义")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfprocessdefinitions/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
wfprocessdefinitionService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Get-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Get-all')")
@ApiOperation(value = "获取流程定义", tags = {"流程定义" }, notes = "获取流程定义") @ApiOperation(value = "获取流程定义", tags = {"流程定义" }, notes = "获取流程定义")
@RequestMapping(method = RequestMethod.GET, value = "/wfprocessdefinitions/{wfprocessdefinition_id}") @RequestMapping(method = RequestMethod.GET, value = "/wfprocessdefinitions/{wfprocessdefinition_id}")
...@@ -91,54 +111,34 @@ public class WFProcessDefinitionResource { ...@@ -91,54 +111,34 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "检查流程定义", tags = {"流程定义" }, notes = "检查流程定义")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WFProcessDefinitionDTO wfprocessdefinitiondto) {
return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionService.checkKey(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondto)));
}
@ApiOperation(value = "获取流程定义草稿", tags = {"流程定义" }, notes = "获取流程定义草稿") @ApiOperation(value = "获取流程定义草稿", tags = {"流程定义" }, notes = "获取流程定义草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfprocessdefinitions/getdraft") @RequestMapping(method = RequestMethod.GET, value = "/wfprocessdefinitions/getdraft")
public ResponseEntity<WFProcessDefinitionDTO> getDraft() { public ResponseEntity<WFProcessDefinitionDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionMapping.toDto(wfprocessdefinitionService.getDraft(new WFProcessDefinition()))); return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionMapping.toDto(wfprocessdefinitionService.getDraft(new WFProcessDefinition())));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Create-all')") @ApiOperation(value = "检查流程定义", tags = {"流程定义" }, notes = "检查流程定义")
@ApiOperation(value = "新建流程定义", tags = {"流程定义" }, notes = "新建流程定义") @RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/checkkey")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions") public ResponseEntity<Boolean> checkKey(@RequestBody WFProcessDefinitionDTO wfprocessdefinitiondto) {
@Transactional return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionService.checkKey(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondto)));
public ResponseEntity<WFProcessDefinitionDTO> create(@RequestBody WFProcessDefinitionDTO wfprocessdefinitiondto) {
WFProcessDefinition domain = wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondto);
wfprocessdefinitionService.create(domain);
WFProcessDefinitionDTO dto = wfprocessdefinitionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Create-all')")
@ApiOperation(value = "批量新建流程定义", tags = {"流程定义" }, notes = "批量新建流程定义")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFProcessDefinitionDTO> wfprocessdefinitiondtos) {
wfprocessdefinitionService.createBatch(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Save-all')")
@ApiOperation(value = "删除流程定义", tags = {"流程定义" }, notes = "删除流程定义") @ApiOperation(value = "保存流程定义", tags = {"流程定义" }, notes = "保存流程定义")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfprocessdefinitions/{wfprocessdefinition_id}") @RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/save")
@Transactional public ResponseEntity<Boolean> save(@RequestBody WFProcessDefinitionDTO wfprocessdefinitiondto) {
public ResponseEntity<Boolean> remove(@PathVariable("wfprocessdefinition_id") String wfprocessdefinition_id) { return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionService.save(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondto)));
return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionService.remove(wfprocessdefinition_id));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Save-all')")
@ApiOperation(value = "批量删除流程定义", tags = {"流程定义" }, notes = "批量删除流程定义") @ApiOperation(value = "批量保存流程定义", tags = {"流程定义" }, notes = "批量保存流程定义")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfprocessdefinitions/batch") @RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/savebatch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) { public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFProcessDefinitionDTO> wfprocessdefinitiondtos) {
wfprocessdefinitionService.removeBatch(ids); wfprocessdefinitionService.saveBatch(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-searchDefault-all') and hasPermission(#context,'ibzwf-WFProcessDefinition-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"流程定义" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"流程定义" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfprocessdefinitions/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/wfprocessdefinitions/fetchdefault")
public ResponseEntity<List<WFProcessDefinitionDTO>> fetchDefault(WFProcessDefinitionSearchContext context) { public ResponseEntity<List<WFProcessDefinitionDTO>> fetchDefault(WFProcessDefinitionSearchContext context) {
...@@ -151,7 +151,7 @@ public class WFProcessDefinitionResource { ...@@ -151,7 +151,7 @@ public class WFProcessDefinitionResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-searchDefault-all') and hasPermission(#context,'ibzwf-WFProcessDefinition-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"流程定义" } ,notes = "查询DEFAULT") @ApiOperation(value = "查询DEFAULT", tags = {"流程定义" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfprocessdefinitions/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/wfprocessdefinitions/searchdefault")
public ResponseEntity<Page<WFProcessDefinitionDTO>> searchDefault(@RequestBody WFProcessDefinitionSearchContext context) { public ResponseEntity<Page<WFProcessDefinitionDTO>> searchDefault(@RequestBody WFProcessDefinitionSearchContext context) {
......
...@@ -47,6 +47,23 @@ public class WFREModelResource { ...@@ -47,6 +47,23 @@ public class WFREModelResource {
@Lazy @Lazy
public WFREModelMapping wfremodelMapping; 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 = "更新流程模型") @ApiOperation(value = "更新流程模型", tags = {"流程模型" }, notes = "更新流程模型")
@RequestMapping(method = RequestMethod.PUT, value = "/wfremodels/{wfremodel_id}") @RequestMapping(method = RequestMethod.PUT, value = "/wfremodels/{wfremodel_id}")
@Transactional @Transactional
...@@ -65,16 +82,17 @@ public class WFREModelResource { ...@@ -65,16 +82,17 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@ApiOperation(value = "保存流程模型", tags = {"流程模型" }, notes = "保存流程模型") @ApiOperation(value = "删除流程模型", tags = {"流程模型" }, notes = "删除流程模型")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels/save") @RequestMapping(method = RequestMethod.DELETE, value = "/wfremodels/{wfremodel_id}")
public ResponseEntity<Boolean> save(@RequestBody WFREModelDTO wfremodeldto) { @Transactional
return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.save(wfremodelMapping.toDomain(wfremodeldto))); public ResponseEntity<Boolean> remove(@PathVariable("wfremodel_id") String wfremodel_id) {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.remove(wfremodel_id));
} }
@ApiOperation(value = "批量保存流程模型", tags = {"流程模型" }, notes = "批量保存流程模型") @ApiOperation(value = "批量删除流程模型", tags = {"流程模型" }, notes = "批量删除流程模型")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels/savebatch") @RequestMapping(method = RequestMethod.DELETE, value = "/wfremodels/batch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) { public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
wfremodelService.saveBatch(wfremodelMapping.toDomain(wfremodeldtos)); wfremodelService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
...@@ -86,21 +104,10 @@ public class WFREModelResource { ...@@ -86,21 +104,10 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "新建流程模型", tags = {"流程模型" }, notes = "新建流程模型") @ApiOperation(value = "获取流程模型草稿", tags = {"流程模型" }, notes = "获取流程模型草稿")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels") @RequestMapping(method = RequestMethod.GET, value = "/wfremodels/getdraft")
@Transactional public ResponseEntity<WFREModelDTO> getDraft() {
public ResponseEntity<WFREModelDTO> create(@RequestBody WFREModelDTO wfremodeldto) { return ResponseEntity.status(HttpStatus.OK).body(wfremodelMapping.toDto(wfremodelService.getDraft(new WFREModel())));
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 = "检查流程模型") @ApiOperation(value = "检查流程模型", tags = {"流程模型" }, notes = "检查流程模型")
...@@ -109,27 +116,20 @@ public class WFREModelResource { ...@@ -109,27 +116,20 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.checkKey(wfremodelMapping.toDomain(wfremodeldto))); return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.checkKey(wfremodelMapping.toDomain(wfremodeldto)));
} }
@ApiOperation(value = "删除流程模型", tags = {"流程模型" }, notes = "删除流程模型") @ApiOperation(value = "保存流程模型", tags = {"流程模型" }, notes = "保存流程模型")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfremodels/{wfremodel_id}") @RequestMapping(method = RequestMethod.POST, value = "/wfremodels/save")
@Transactional public ResponseEntity<Boolean> save(@RequestBody WFREModelDTO wfremodeldto) {
public ResponseEntity<Boolean> remove(@PathVariable("wfremodel_id") String wfremodel_id) { return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.save(wfremodelMapping.toDomain(wfremodeldto)));
return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.remove(wfremodel_id));
} }
@ApiOperation(value = "批量删除流程模型", tags = {"流程模型" }, notes = "批量删除流程模型") @ApiOperation(value = "批量保存流程模型", tags = {"流程模型" }, notes = "批量保存流程模型")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfremodels/batch") @RequestMapping(method = RequestMethod.POST, value = "/wfremodels/savebatch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) { public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) {
wfremodelService.removeBatch(ids); wfremodelService.saveBatch(wfremodelMapping.toDomain(wfremodeldtos));
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@ApiOperation(value = "获取流程模型草稿", tags = {"流程模型" }, notes = "获取流程模型草稿") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFREModel-searchDefault-all') and hasPermission(#context,'ibzwf-WFREModel-Get')")
@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')")
@ApiOperation(value = "获取DEFAULT", tags = {"流程模型" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"流程模型" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfremodels/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/wfremodels/fetchdefault")
public ResponseEntity<List<WFREModelDTO>> fetchDefault(WFREModelSearchContext context) { public ResponseEntity<List<WFREModelDTO>> fetchDefault(WFREModelSearchContext context) {
...@@ -142,7 +142,7 @@ public class WFREModelResource { ...@@ -142,7 +142,7 @@ public class WFREModelResource {
.body(list); .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") @ApiOperation(value = "查询DEFAULT", tags = {"流程模型" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfremodels/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/wfremodels/searchdefault")
public ResponseEntity<Page<WFREModelDTO>> searchDefault(@RequestBody WFREModelSearchContext context) { public ResponseEntity<Page<WFREModelDTO>> searchDefault(@RequestBody WFREModelSearchContext context) {
......
...@@ -47,19 +47,22 @@ public class WFSystemResource { ...@@ -47,19 +47,22 @@ public class WFSystemResource {
@Lazy @Lazy
public WFSystemMapping wfsystemMapping; public WFSystemMapping wfsystemMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Create-all')")
@ApiOperation(value = "删除系统", tags = {"系统" }, notes = "删除系统") @ApiOperation(value = "新建系统", tags = {"系统" }, notes = "新建系统")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfsystems/{wfsystem_id}") @RequestMapping(method = RequestMethod.POST, value = "/wfsystems")
@Transactional @Transactional
public ResponseEntity<Boolean> remove(@PathVariable("wfsystem_id") String wfsystem_id) { public ResponseEntity<WFSystemDTO> create(@RequestBody WFSystemDTO wfsystemdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfsystemService.remove(wfsystem_id)); 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')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Create-all')")
@ApiOperation(value = "批量删除系统", tags = {"系统" }, notes = "批量删除系统") @ApiOperation(value = "批量新建系统", tags = {"系统" }, notes = "批量新建系统")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfsystems/batch") @RequestMapping(method = RequestMethod.POST, value = "/wfsystems/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) { public ResponseEntity<Boolean> createBatch(@RequestBody List<WFSystemDTO> wfsystemdtos) {
wfsystemService.removeBatch(ids); wfsystemService.createBatch(wfsystemMapping.toDomain(wfsystemdtos));
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
...@@ -83,12 +86,43 @@ public class WFSystemResource { ...@@ -83,12 +86,43 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(true); 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 = "获取系统草稿") @ApiOperation(value = "获取系统草稿", tags = {"系统" }, notes = "获取系统草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfsystems/getdraft") @RequestMapping(method = RequestMethod.GET, value = "/wfsystems/getdraft")
public ResponseEntity<WFSystemDTO> getDraft() { public ResponseEntity<WFSystemDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(wfsystemMapping.toDto(wfsystemService.getDraft(new WFSystem()))); return ResponseEntity.status(HttpStatus.OK).body(wfsystemMapping.toDto(wfsystemService.getDraft(new WFSystem())));
} }
@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')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Save-all')")
@ApiOperation(value = "保存系统", tags = {"系统" }, notes = "保存系统") @ApiOperation(value = "保存系统", tags = {"系统" }, notes = "保存系统")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems/save") @RequestMapping(method = RequestMethod.POST, value = "/wfsystems/save")
...@@ -104,41 +138,7 @@ public class WFSystemResource { ...@@ -104,41 +138,7 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Create-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-searchDefault-all') and hasPermission(#context,'ibzwf-WFSystem-Get')")
@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')")
@ApiOperation(value = "获取DEFAULT", tags = {"系统" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"系统" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfsystems/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/wfsystems/fetchdefault")
public ResponseEntity<List<WFSystemDTO>> fetchDefault(WFSystemSearchContext context) { public ResponseEntity<List<WFSystemDTO>> fetchDefault(WFSystemSearchContext context) {
...@@ -151,7 +151,7 @@ public class WFSystemResource { ...@@ -151,7 +151,7 @@ public class WFSystemResource {
.body(list); .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") @ApiOperation(value = "查询DEFAULT", tags = {"系统" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfsystems/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/wfsystems/searchdefault")
public ResponseEntity<Page<WFSystemDTO>> searchDefault(@RequestBody WFSystemSearchContext context) { public ResponseEntity<Page<WFSystemDTO>> searchDefault(@RequestBody WFSystemSearchContext context) {
......
...@@ -47,40 +47,22 @@ public class WFUserResource { ...@@ -47,40 +47,22 @@ public class WFUserResource {
@Lazy @Lazy
public WFUserMapping wfuserMapping; public WFUserMapping wfuserMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Create-all')")
@ApiOperation(value = "删除用户", tags = {"用户" }, notes = "删除用户") @ApiOperation(value = "新建用户", tags = {"用户" }, notes = "新建用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfusers/{wfuser_id}") @RequestMapping(method = RequestMethod.POST, value = "/wfusers")
@Transactional @Transactional
public ResponseEntity<Boolean> remove(@PathVariable("wfuser_id") String wfuser_id) { public ResponseEntity<WFUserDTO> create(@RequestBody WFUserDTO wfuserdto) {
return ResponseEntity.status(HttpStatus.OK).body(wfuserService.remove(wfuser_id)); WFUser domain = wfuserMapping.toDomain(wfuserdto);
} wfuserService.create(domain);
WFUserDTO dto = wfuserMapping.toDto(domain);
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Remove-all')") return ResponseEntity.status(HttpStatus.OK).body(dto);
@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)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Create-all')")
@ApiOperation(value = "批量保存用户", tags = {"用户" }, notes = "批量保存用户") @ApiOperation(value = "批量新建用户", tags = {"用户" }, notes = "批量新建用户")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/wfusers/batch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFUserDTO> wfuserdtos) { public ResponseEntity<Boolean> createBatch(@RequestBody List<WFUserDTO> wfuserdtos) {
wfuserService.saveBatch(wfuserMapping.toDomain(wfuserdtos)); wfuserService.createBatch(wfuserMapping.toDomain(wfuserdtos));
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
...@@ -104,6 +86,22 @@ public class WFUserResource { ...@@ -104,6 +86,22 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(true); 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')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Get-all')")
@ApiOperation(value = "获取用户", tags = {"用户" }, notes = "获取用户") @ApiOperation(value = "获取用户", tags = {"用户" }, notes = "获取用户")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/{wfuser_id}") @RequestMapping(method = RequestMethod.GET, value = "/wfusers/{wfuser_id}")
...@@ -113,23 +111,10 @@ public class WFUserResource { ...@@ -113,23 +111,10 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-Create-all')") @ApiOperation(value = "获取用户草稿", tags = {"用户" }, notes = "获取用户草稿")
@ApiOperation(value = "新建用户", tags = {"用户" }, notes = "新建用户") @RequestMapping(method = RequestMethod.GET, value = "/wfusers/getdraft")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers") public ResponseEntity<WFUserDTO> getDraft() {
@Transactional return ResponseEntity.status(HttpStatus.OK).body(wfuserMapping.toDto(wfuserService.getDraft(new WFUser())));
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 = "检查用户") @ApiOperation(value = "检查用户", tags = {"用户" }, notes = "检查用户")
...@@ -138,7 +123,22 @@ public class WFUserResource { ...@@ -138,7 +123,22 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(wfuserService.checkKey(wfuserMapping.toDomain(wfuserdto))); return ResponseEntity.status(HttpStatus.OK).body(wfuserService.checkKey(wfuserMapping.toDomain(wfuserdto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFUser-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") @ApiOperation(value = "获取DEFAULT", tags = {"用户" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfusers/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/wfusers/fetchdefault")
public ResponseEntity<List<WFUserDTO>> fetchDefault(WFUserSearchContext context) { public ResponseEntity<List<WFUserDTO>> fetchDefault(WFUserSearchContext context) {
...@@ -151,7 +151,7 @@ public class WFUserResource { ...@@ -151,7 +151,7 @@ public class WFUserResource {
.body(list); .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") @ApiOperation(value = "查询DEFAULT", tags = {"用户" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfusers/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/wfusers/searchdefault")
public ResponseEntity<Page<WFUserDTO>> searchDefault(@RequestBody WFUserSearchContext context) { public ResponseEntity<Page<WFUserDTO>> searchDefault(@RequestBody WFUserSearchContext context) {
......
package cn.ibizlab.util.security; 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.annotation.DEField;
import cn.ibizlab.util.domain.EntityBase; import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.enums.DEPredefinedFieldType; import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.filter.QueryWrapperContext;
import cn.ibizlab.util.helper.DEFieldCacheMap; import cn.ibizlab.util.helper.DEFieldCacheMap;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.PermissionEvaluator; import org.springframework.security.access.PermissionEvaluator;
...@@ -11,7 +14,10 @@ import org.springframework.security.core.GrantedAuthority; ...@@ -11,7 +14,10 @@ import org.springframework.security.core.GrantedAuthority;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.*; import java.util.*;
import java.util.function.Consumer;
/** /**
* spring security 权限管理类 * spring security 权限管理类
...@@ -23,44 +29,144 @@ public class AuthPermissionEvaluator implements PermissionEvaluator { ...@@ -23,44 +29,144 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
@Value("${ibiz.enablePermissionValid:false}") @Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验 boolean enablePermissionValid; //是否开启权限校验
/** /**
* 实体行为鉴权 * 服务接口鉴权
* @param authentication * @param authentication 用户
* @param entity * @param entity 实体
* @param action * @param action 操作
* @return * @return
*/ */
@Override @Override
@SneakyThrows
public boolean hasPermission(Authentication authentication, Object entity, Object action) { public boolean hasPermission(Authentication authentication, Object entity, Object action) {
if(!enablePermissionValid)
//未开启权限校验、超级管理员则不进行权限检查 return true;
if(AuthenticationUser.getAuthenticationUser().getSuperuser()==1 || !enablePermissionValid) Object principal = authentication.getPrincipal();
if(ObjectUtils.isEmpty(principal))
return false;
AuthenticationUser authenticationUser= (AuthenticationUser) authentication.getPrincipal();
if(authenticationUser.getSuperuser()==1)
return true; return true;
String strAction=String.valueOf(action); String strAction=String.valueOf(action);
Set<String> userAuthorities = getAuthorities(authentication,strAction); Set<String> userAuthorities = getAuthorities(authentication,strAction);
if(userAuthorities.size()==0) if(userAuthorities.size()==0)
return false; return false;
//拥有全部数据访问权限时,则跳过权限检查
if(isAllData(strAction,userAuthorities)){ if(isAllData(strAction,userAuthorities)){
return true; return true;
} }
if(entity instanceof ArrayList){ if(entity instanceof ArrayList){
List<EntityBase> entities= (List<EntityBase>) entity; List<EntityBase> entities= (List<EntityBase>) entity;
for(EntityBase entityBase: entities){ for(EntityBase entityBase: entities){
boolean result=actionValid(entityBase, strAction ,userAuthorities); boolean result=actionValid(entityBase, strAction ,userAuthorities,authenticationUser);
if(!result){ if(!result){
return false; return false;
} }
} }
} }
else if (entity instanceof QueryWrapperContext){
QueryWrapperContext queryWrapperContext= (QueryWrapperContext) entity;
setPermissionCondToSearchContext(getEntity(queryWrapperContext),queryWrapperContext,userAuthorities,authenticationUser);
}
else{ else{
EntityBase entityBase= (EntityBase) entity; EntityBase entityBase= (EntityBase) entity;
return actionValid(entityBase , strAction ,userAuthorities); return actionValid(entityBase , strAction ,userAuthorities,authenticationUser);
} }
return true; 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 @Override
public boolean hasPermission(Authentication authentication, Serializable id, String action, Object params) { public boolean hasPermission(Authentication authentication, Serializable id, String action, Object params) {
...@@ -106,13 +212,12 @@ public class AuthPermissionEvaluator implements PermissionEvaluator { ...@@ -106,13 +212,12 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
* @param userAuthorities * @param userAuthorities
* @return * @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);//获取组织、部门预置属性 Map<String,String> permissionField=getPermissionField(entity);//获取组织、部门预置属性
String orgField=permissionField.get("orgfield"); String orgField=permissionField.get("orgfield");
String orgDeptField=permissionField.get("orgsecfield"); String orgDeptField=permissionField.get("orgsecfield");
String createManField=permissionField.get("createmanfield"); String createManField=permissionField.get("createmanfield");
AuthenticationUser authenticationUser = AuthenticationUser.getAuthenticationUser();
Map<String, Set<String>> userInfo = authenticationUser.getOrgInfo(); Map<String, Set<String>> userInfo = authenticationUser.getOrgInfo();
Set<String> orgParent = userInfo.get("parentorg"); Set<String> orgParent = userInfo.get("parentorg");
Set<String> orgChild = userInfo.get("suborg"); Set<String> orgChild = userInfo.get("suborg");
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册