提交 8ad04ed1 编写于 作者: test_0805_001's avatar test_0805_001

Merge remote-tracking branch 'origin/master'

......@@ -242,6 +242,44 @@ mock.onPut(new RegExp(/^\/wftasks\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: a
console.groupEnd();
return [status, data];
});
// UserCustom
mock.onPost(new RegExp(/^\/wftasks\/?([a-zA-Z0-9\-\;]{0,35})\/usercustom$/)).reply((config: any) => {
console.groupCollapsed("实体:wftask 方法: UserCustom");
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(/^\/wftasks\/([a-zA-Z0-9\-\;]{1,35})\/usercustom$/).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];
});
// FetchDefault
mock.onGet(new RegExp(/^\/wftasks\/fetchdefault$/)).reply((config: any) => {
......
......@@ -155,6 +155,34 @@ export default class WFTaskServiceBase extends EntityService {
return res;
}
/**
* UserCustom接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFTaskServiceBase
*/
public async UserCustom(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wftasks/${context.wftask}/usercustom`,data,isloading);
return res;
}
/**
* UserCustomBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFTaskServiceBase
*/
public async UserCustomBatch(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/wftasks/usercustombatch`,tempData,isloading);
}
/**
* FetchDefault接口方法
*
......
package cn.ibizlab.core.extensions.service;
import cn.ibizlab.core.workflow.service.impl.WFTaskServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.core.workflow.domain.WFTask;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;
/**
* 实体[工作流任务] 自定义服务对象
*/
@Slf4j
@Primary
@Service("WFTaskExService")
public class WFTaskExService extends WFTaskServiceImpl {
/**
* [UserCustom:用户自定义] 行为扩展
* @param et
* @return
*/
@Override
@Transactional
public WFTask userCustom(WFTask et) {
return super.userCustom(et);
}
}
......@@ -35,6 +35,8 @@ public interface IWFTaskService {
boolean checkKey(WFTask et);
boolean save(WFTask et);
void saveBatch(List<WFTask> list);
WFTask userCustom(WFTask et);
boolean userCustomBatch(List<WFTask> etList);
Page<WFTask> searchDefault(WFTaskSearchContext context);
Page<WFTask> searchDoneTask(WFTaskSearchContext context);
Page<WFTask> searchFinishTask(WFTaskSearchContext context);
......
......@@ -94,6 +94,22 @@ public class WFTaskServiceImpl implements IWFTaskService {
public void saveBatch(List<WFTask> list) {
}
@Override
@Transactional
public WFTask userCustom(WFTask et) {
//自定义代码
return et;
}
@Override
@Transactional
public boolean userCustomBatch(List<WFTask> etList) {
for(WFTask et : etList) {
userCustom(et);
}
return true;
}
......
create schema if not exists a_A_5d9d78509;
set schema a_A_5d9d78509;
......@@ -48,7 +48,7 @@
"delogicname":"工作流任务",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"},{"id":"DoneTask" , "name":"已办任务"},{"id":"FinishTask" , "name":"办结任务"},{"id":"TodoTask" , "name":"待办任务"},{"id":"ToreadTask" , "name":"待阅任务"}],
"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" }],
"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" },{"id":"UserCustom" , "name":"用户自定义" , "type":"USERCUSTOM" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
......
......@@ -129,6 +129,23 @@ public class WFTaskResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "用户自定义", tags = {"工作流任务" }, notes = "用户自定义")
@RequestMapping(method = RequestMethod.POST, value = "/wftasks/{wftask_id}/usercustom")
public ResponseEntity<WFTaskDTO> userCustom(@PathVariable("wftask_id") String wftask_id, @RequestBody WFTaskDTO wftaskdto) {
WFTask domain = wftaskMapping.toDomain(wftaskdto);
domain.setId(wftask_id);
domain = wftaskService.userCustom(domain);
wftaskdto = wftaskMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(wftaskdto);
}
@ApiOperation(value = "批量处理[用户自定义]", tags = {"工作流任务" }, notes = "批量处理[用户自定义]")
@RequestMapping(method = RequestMethod.POST, value = "/wftasks/usercustombatch")
public ResponseEntity<Boolean> userCustomBatch(@RequestBody List<WFTaskDTO> wftaskdtos) {
List<WFTask> domains = wftaskMapping.toDomain(wftaskdtos);
boolean result = wftaskService.userCustomBatch(domains);
return ResponseEntity.status(HttpStatus.OK).body(result);
}
@ApiOperation(value = "获取DEFAULT", tags = {"工作流任务" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/wftasks/fetchdefault")
public ResponseEntity<List<WFTaskDTO>> fetchDefault(WFTaskSearchContext context) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册