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

zhouweidong 发布系统代码 [ibz-wf,统一工作流]

上级 c21fe4dd
...@@ -86,16 +86,241 @@ mock.onDelete(new RegExp(/^\/wfprocessinstances\/batch$/)).reply((config: any) = ...@@ -86,16 +86,241 @@ mock.onDelete(new RegExp(/^\/wfprocessinstances\/batch$/)).reply((config: any) =
return [status, {}]; return [status, {}];
}); });
// URI参数传递情况未实现
// URI参数传递情况未实现 // CheckKey
// URI参数传递情况未实现 mock.onPost(new RegExp(/^\/wfprocessinstances\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
// URI参数传递情况未实现 console.groupCollapsed("实体:wfprocessinstance 方法: CheckKey");
// URI参数传递情况未实现 console.table({url:config.url, method: config.method, data:config.data});
// URI参数传递情况未实现 let status = MockAdapter.mockStatus(config);
// URI参数传递情况未实现 if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfprocessinstances\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/wfprocessinstances\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessinstance 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfprocessinstances\/([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]];
});
// GetDraft
mock.onGet(new RegExp(/^\/wfprocessinstances\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessinstance 方法: 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, {}];
});
// Jump
mock.onPost(new RegExp(/^\/wfprocessinstances\/?([a-zA-Z0-9\-\;]{0,35})\/jump$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessinstance 方法: Jump");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfprocessinstances\/([a-zA-Z0-9\-\;]{1,35})\/jump$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Restart
mock.onPost(new RegExp(/^\/wfprocessinstances\/?([a-zA-Z0-9\-\;]{0,35})\/restart$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessinstance 方法: Restart");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfprocessinstances\/([a-zA-Z0-9\-\;]{1,35})\/restart$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/wfprocessinstances\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessinstance 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfprocessinstances\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Update
mock.onPut(new RegExp(/^\/wfprocessinstances\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessinstance 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfprocessinstances\/([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.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// FetchActiveProcessInstance // FetchActiveProcessInstance
mock.onGet(new RegExp(/^\/wfprocessinstances$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/wfprocessinstances\/fetchactiveprocessinstance$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessinstance 方法: FetchActiveProcessInstance"); console.groupCollapsed("实体:wfprocessinstance 方法: FetchActiveProcessInstance");
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);
...@@ -110,7 +335,7 @@ mock.onGet(new RegExp(/^\/wfprocessinstances$/)).reply((config: any) => { ...@@ -110,7 +335,7 @@ mock.onGet(new RegExp(/^\/wfprocessinstances$/)).reply((config: any) => {
}); });
// FetchActiveProcessInstance // FetchActiveProcessInstance
mock.onGet(new RegExp(/^\/wfprocessinstances(\?[\w-./?%&=,]*)*$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/wfprocessinstances\/fetchactiveprocessinstance(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessinstance 方法: FetchActiveProcessInstance"); console.groupCollapsed("实体:wfprocessinstance 方法: FetchActiveProcessInstance");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){ if(config.url.includes('page')){
...@@ -139,7 +364,7 @@ mock.onGet(new RegExp(/^\/wfprocessinstances(\?[\w-./?%&=,]*)*$/)).reply((config ...@@ -139,7 +364,7 @@ mock.onGet(new RegExp(/^\/wfprocessinstances(\?[\w-./?%&=,]*)*$/)).reply((config
}); });
// FetchDefault // FetchDefault
mock.onGet(new RegExp(/^\/wfprocessinstances$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/wfprocessinstances\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessinstance 方法: FetchDefault"); console.groupCollapsed("实体:wfprocessinstance 方法: FetchDefault");
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);
...@@ -154,7 +379,7 @@ mock.onGet(new RegExp(/^\/wfprocessinstances$/)).reply((config: any) => { ...@@ -154,7 +379,7 @@ mock.onGet(new RegExp(/^\/wfprocessinstances$/)).reply((config: any) => {
}); });
// FetchDefault // FetchDefault
mock.onGet(new RegExp(/^\/wfprocessinstances(\?[\w-./?%&=,]*)*$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/wfprocessinstances\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessinstance 方法: FetchDefault"); console.groupCollapsed("实体:wfprocessinstance 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){ if(config.url.includes('page')){
...@@ -217,3 +442,59 @@ mock.onGet(new RegExp(/^\/wfprocessinstances\/([a-zA-Z0-9\-\;]{1,35})\/select$/) ...@@ -217,3 +442,59 @@ mock.onGet(new RegExp(/^\/wfprocessinstances\/([a-zA-Z0-9\-\;]{1,35})\/select$/)
return [status, _items]; return [status, _items];
}); });
// Get
mock.onGet(new RegExp(/^\/wfprocessinstances\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessinstance 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfprocessinstances\/([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.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/wfprocessinstances\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessinstance 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfprocessinstances\/([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.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
:autosave="false" :autosave="false"
:viewtag="viewtag" :viewtag="viewtag"
:showBusyIndicator="true" :showBusyIndicator="true"
updateAction="" updateAction="Jump"
removeAction="Remove" removeAction="Remove"
loaddraftAction="GetDraft" loaddraftAction="GetDraft"
loadAction="Get" loadAction="Get"
......
...@@ -38,6 +38,179 @@ export default class WFProcessInstanceServiceBase extends EntityService { ...@@ -38,6 +38,179 @@ export default class WFProcessInstanceServiceBase extends EntityService {
// 实体接口 // 实体接口
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfprocessinstances/${context.wfprocessinstance}/checkkey`,data,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/wfprocessinstances`,data,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfprocessinstances/${context.wfprocessinstance}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfprocessinstances/getdraft`,isloading);
res.data.wfprocessinstance = data.wfprocessinstance;
return res;
}
/**
* Jump接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Jump(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfprocessinstances/${context.wfprocessinstance}/jump`,data,isloading);
return res;
}
/**
* JumpBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async JumpBatch(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/wfprocessinstances/jumpbatch`,tempData,isloading);
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/wfprocessinstances/${context.wfprocessinstance}`,isloading);
return res;
}
/**
* Restart接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Restart(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfprocessinstances/${context.wfprocessinstance}/restart`,data,isloading);
return res;
}
/**
* RestartBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async RestartBatch(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/wfprocessinstances/restartbatch`,tempData,isloading);
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfprocessinstances/${context.wfprocessinstance}/save`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfprocessinstances/${context.wfprocessinstance}`,data,isloading);
return res;
}
/** /**
* FetchActiveProcessInstance接口方法 * FetchActiveProcessInstance接口方法
* *
...@@ -48,6 +221,9 @@ export default class WFProcessInstanceServiceBase extends EntityService { ...@@ -48,6 +221,9 @@ export default class WFProcessInstanceServiceBase extends EntityService {
* @memberof WFProcessInstanceServiceBase * @memberof WFProcessInstanceServiceBase
*/ */
public async FetchActiveProcessInstance(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async FetchActiveProcessInstance(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/wfprocessinstances/fetchactiveprocessinstance`,tempData,isloading);
return res;
} }
/** /**
...@@ -74,6 +250,9 @@ export default class WFProcessInstanceServiceBase extends EntityService { ...@@ -74,6 +250,9 @@ export default class WFProcessInstanceServiceBase extends EntityService {
* @memberof WFProcessInstanceServiceBase * @memberof WFProcessInstanceServiceBase
*/ */
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/wfprocessinstances/fetchdefault`,tempData,isloading);
return res;
} }
/** /**
......
...@@ -233,7 +233,26 @@ export default class WFProcessInstanceUIServiceBase extends UIService { ...@@ -233,7 +233,26 @@ export default class WFProcessInstanceUIServiceBase extends UIService {
delete context.srfsessionid; delete context.srfsessionid;
} }
const backend = () => { const backend = () => {
actionContext.$Notice.error({ title: '错误', desc: '模型异常,应用实体方法不存在' }); const curService:WFProcessInstanceService = new WFProcessInstanceService();
curService.Restart(context,data, true).then((response: any) => {
if (!response || response.status !== 200) {
actionContext.$Notice.error({ title: '错误', desc: response.message });
return;
}
actionContext.$Notice.success({ title: '成功', desc: '操作成功' });
const _this: any = actionContext;
return response;
}).catch((response: any) => {
if (response && response.status && response.data) {
actionContext.$Notice.error({ title: (actionContext.$t('app.commonWords.wrong') as string), desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
actionContext.$Notice.error({ title: (actionContext.$t('app.commonWords.wrong') as string), desc: (actionContext.$t('app.commonWords.sysException') as string) });
return;
}
return response;
});
}; };
backend(); backend();
} }
......
...@@ -47,6 +47,162 @@ public class WFProcessInstanceResource { ...@@ -47,6 +47,162 @@ public class WFProcessInstanceResource {
@Lazy @Lazy
public WFProcessInstanceMapping wfprocessinstanceMapping; public WFProcessInstanceMapping wfprocessinstanceMapping;
@ApiOperation(value = "新建流程实例", tags = {"流程实例" }, notes = "新建流程实例")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessinstances")
public ResponseEntity<WFProcessInstanceDTO> create(@Validated @RequestBody WFProcessInstanceDTO wfprocessinstancedto) {
WFProcessInstance domain = wfprocessinstanceMapping.toDomain(wfprocessinstancedto);
wfprocessinstanceService.create(domain);
WFProcessInstanceDTO dto = wfprocessinstanceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量新建流程实例", tags = {"流程实例" }, notes = "批量新建流程实例")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessinstances/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WFProcessInstanceDTO> wfprocessinstancedtos) {
wfprocessinstanceService.createBatch(wfprocessinstanceMapping.toDomain(wfprocessinstancedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取流程实例", tags = {"流程实例" }, notes = "获取流程实例")
@RequestMapping(method = RequestMethod.GET, value = "/wfprocessinstances/{wfprocessinstance_id}")
public ResponseEntity<WFProcessInstanceDTO> get(@PathVariable("wfprocessinstance_id") String wfprocessinstance_id) {
WFProcessInstance domain = wfprocessinstanceService.get(wfprocessinstance_id);
WFProcessInstanceDTO dto = wfprocessinstanceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "删除流程实例", tags = {"流程实例" }, notes = "删除流程实例")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfprocessinstances/{wfprocessinstance_id}")
public ResponseEntity<Boolean> remove(@PathVariable("wfprocessinstance_id") String wfprocessinstance_id) {
return ResponseEntity.status(HttpStatus.OK).body(wfprocessinstanceService.remove(wfprocessinstance_id));
}
@ApiOperation(value = "批量删除流程实例", tags = {"流程实例" }, notes = "批量删除流程实例")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfprocessinstances/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
wfprocessinstanceService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "更新流程实例", tags = {"流程实例" }, notes = "更新流程实例")
@RequestMapping(method = RequestMethod.PUT, value = "/wfprocessinstances/{wfprocessinstance_id}")
public ResponseEntity<WFProcessInstanceDTO> update(@PathVariable("wfprocessinstance_id") String wfprocessinstance_id, @RequestBody WFProcessInstanceDTO wfprocessinstancedto) {
WFProcessInstance domain = wfprocessinstanceMapping.toDomain(wfprocessinstancedto);
domain .setId(wfprocessinstance_id);
wfprocessinstanceService.update(domain );
WFProcessInstanceDTO dto = wfprocessinstanceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量更新流程实例", tags = {"流程实例" }, notes = "批量更新流程实例")
@RequestMapping(method = RequestMethod.PUT, value = "/wfprocessinstances/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFProcessInstanceDTO> wfprocessinstancedtos) {
wfprocessinstanceService.updateBatch(wfprocessinstanceMapping.toDomain(wfprocessinstancedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查流程实例", tags = {"流程实例" }, notes = "检查流程实例")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessinstances/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WFProcessInstanceDTO wfprocessinstancedto) {
return ResponseEntity.status(HttpStatus.OK).body(wfprocessinstanceService.checkKey(wfprocessinstanceMapping.toDomain(wfprocessinstancedto)));
}
@ApiOperation(value = "获取流程实例草稿", tags = {"流程实例" }, notes = "获取流程实例草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfprocessinstances/getdraft")
public ResponseEntity<WFProcessInstanceDTO> getDraft(WFProcessInstanceDTO dto) {
WFProcessInstance domain = wfprocessinstanceMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(wfprocessinstanceMapping.toDto(wfprocessinstanceService.getDraft(domain)));
}
@ApiOperation(value = "流程跳转", tags = {"流程实例" }, notes = "流程跳转")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessinstances/{wfprocessinstance_id}/jump")
public ResponseEntity<WFProcessInstanceDTO> jump(@PathVariable("wfprocessinstance_id") String wfprocessinstance_id, @RequestBody WFProcessInstanceDTO wfprocessinstancedto) {
WFProcessInstance domain = wfprocessinstanceMapping.toDomain(wfprocessinstancedto);
domain.setId(wfprocessinstance_id);
domain = wfprocessinstanceService.jump(domain);
wfprocessinstancedto = wfprocessinstanceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(wfprocessinstancedto);
}
@ApiOperation(value = "批量处理[流程跳转]", tags = {"流程实例" }, notes = "批量处理[流程跳转]")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessinstances/jumpbatch")
public ResponseEntity<Boolean> jumpBatch(@RequestBody List<WFProcessInstanceDTO> wfprocessinstancedtos) {
List<WFProcessInstance> domains = wfprocessinstanceMapping.toDomain(wfprocessinstancedtos);
boolean result = wfprocessinstanceService.jumpBatch(domains);
return ResponseEntity.status(HttpStatus.OK).body(result);
}
@ApiOperation(value = "重启流程", tags = {"流程实例" }, notes = "重启流程")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessinstances/{wfprocessinstance_id}/restart")
public ResponseEntity<WFProcessInstanceDTO> restart(@PathVariable("wfprocessinstance_id") String wfprocessinstance_id, @RequestBody WFProcessInstanceDTO wfprocessinstancedto) {
WFProcessInstance domain = wfprocessinstanceMapping.toDomain(wfprocessinstancedto);
domain.setId(wfprocessinstance_id);
domain = wfprocessinstanceService.restart(domain);
wfprocessinstancedto = wfprocessinstanceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(wfprocessinstancedto);
}
@ApiOperation(value = "批量处理[重启流程]", tags = {"流程实例" }, notes = "批量处理[重启流程]")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessinstances/restartbatch")
public ResponseEntity<Boolean> restartBatch(@RequestBody List<WFProcessInstanceDTO> wfprocessinstancedtos) {
List<WFProcessInstance> domains = wfprocessinstanceMapping.toDomain(wfprocessinstancedtos);
boolean result = wfprocessinstanceService.restartBatch(domains);
return ResponseEntity.status(HttpStatus.OK).body(result);
}
@ApiOperation(value = "保存流程实例", tags = {"流程实例" }, notes = "保存流程实例")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessinstances/save")
public ResponseEntity<WFProcessInstanceDTO> save(@RequestBody WFProcessInstanceDTO wfprocessinstancedto) {
WFProcessInstance domain = wfprocessinstanceMapping.toDomain(wfprocessinstancedto);
wfprocessinstanceService.save(domain);
return ResponseEntity.status(HttpStatus.OK).body(wfprocessinstanceMapping.toDto(domain));
}
@ApiOperation(value = "批量保存流程实例", tags = {"流程实例" }, notes = "批量保存流程实例")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessinstances/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WFProcessInstanceDTO> wfprocessinstancedtos) {
wfprocessinstanceService.saveBatch(wfprocessinstanceMapping.toDomain(wfprocessinstancedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取流程中实例", tags = {"流程实例" } ,notes = "获取流程中实例")
@RequestMapping(method= RequestMethod.GET , value="/wfprocessinstances/fetchactiveprocessinstance")
public ResponseEntity<List<WFProcessInstanceDTO>> fetchActiveProcessInstance(WFProcessInstanceSearchContext context) {
Page<WFProcessInstance> domains = wfprocessinstanceService.searchActiveProcessInstance(context) ;
List<WFProcessInstanceDTO> list = wfprocessinstanceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@ApiOperation(value = "查询流程中实例", tags = {"流程实例" } ,notes = "查询流程中实例")
@RequestMapping(method= RequestMethod.POST , value="/wfprocessinstances/searchactiveprocessinstance")
public ResponseEntity<Page<WFProcessInstanceDTO>> searchActiveProcessInstance(@RequestBody WFProcessInstanceSearchContext context) {
Page<WFProcessInstance> domains = wfprocessinstanceService.searchActiveProcessInstance(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(wfprocessinstanceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@ApiOperation(value = "获取DEFAULT", tags = {"流程实例" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wfprocessinstances/fetchdefault")
public ResponseEntity<List<WFProcessInstanceDTO>> fetchDefault(WFProcessInstanceSearchContext context) {
Page<WFProcessInstance> domains = wfprocessinstanceService.searchDefault(context) ;
List<WFProcessInstanceDTO> list = wfprocessinstanceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@ApiOperation(value = "查询DEFAULT", tags = {"流程实例" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/wfprocessinstances/searchdefault")
public ResponseEntity<Page<WFProcessInstanceDTO>> searchDefault(@RequestBody WFProcessInstanceSearchContext context) {
Page<WFProcessInstance> domains = wfprocessinstanceService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(wfprocessinstanceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册