提交 9e090e13 编写于 作者: zhouweidong's avatar zhouweidong

获取统一待办

上级 97cf9486
...@@ -2103,4 +2103,32 @@ public class WFCoreService ...@@ -2103,4 +2103,32 @@ public class WFCoreService
} }
return true; return true;
} }
/**
* 查询个人实体待办:使用表格查询模式,返回的待办数据中包含工作流信息,后续通过该信息跳转至对应审批页
* @param context
* @return
*/
public Map<String, Map<String, Object>> searchMyTask2(WFTaskSearchContext context) {
Map<String, Map<String, Object>> businessKeys = new HashMap<>();
context.setSort("createtime,desc");
com.baomidou.mybatisplus.extension.plugins.pagination.Page<WFTask> tasks=wfCoreMapper.searchMyTask(context.getPages(),context,context.getSelectCond());
if (!ObjectUtils.isEmpty(tasks)) {
for (WFTask task : tasks.getRecords()) {
Object key = task.getProcessinstancebusinesskey();
if (key != null) {
String str = key.toString();
if (str.indexOf(":k-") > 0) {
str = str.split(":k-")[1];
}
Map<String, Object> params = new HashMap();
params.put("srfprocessdefinitionkey", task.getProcessdefinitionkey());
params.put("srftaskdefinitionkey", task.getTaskdefinitionkey());
params.put("srftaskid", task.getId());
businessKeys.put(str, params);
}
}
}
return businessKeys;
}
} }
...@@ -118,7 +118,7 @@ public class WFCoreResource ...@@ -118,7 +118,7 @@ public class WFCoreResource
@RequestMapping(method = RequestMethod.GET, value = "/{system}-app-{appname}/{entity}/process-definitions") @RequestMapping(method = RequestMethod.GET, value = "/{system}-app-{appname}/{entity}/process-definitions")
public ResponseEntity<List<WFProcessDefinition>> getworkflow(@PathVariable("system") String system,@PathVariable("appname") String appname, public ResponseEntity<List<WFProcessDefinition>> getworkflow(@PathVariable("system") String system,@PathVariable("appname") String appname,
@PathVariable("entity") String entity) { @PathVariable("entity") String entity) {
return ResponseEntity.status(HttpStatus.OK).body(null); return ResponseEntity.status(HttpStatus.OK).body(wfCoreService.getWorkflow(system,appname,entity));
} }
@ApiOperation(value = "getStepByEntity", tags = {"WFProcessNode" }, notes = "根据系统实体查找当前适配的工作流模型步骤") @ApiOperation(value = "getStepByEntity", tags = {"WFProcessNode" }, notes = "根据系统实体查找当前适配的工作流模型步骤")
...@@ -248,6 +248,13 @@ public class WFCoreResource ...@@ -248,6 +248,13 @@ public class WFCoreResource
return ResponseEntity.status(HttpStatus.OK).body(wfCoreService.getBusinessKeys(system,"",entity,processDefinitionKey,taskDefinitionKey,userId)); return ResponseEntity.status(HttpStatus.OK).body(wfCoreService.getBusinessKeys(system,"",entity,processDefinitionKey,taskDefinitionKey,userId));
} }
@ApiOperation(value = "获取我的实体待办", tags = {"工作流任务" } ,notes = "获取我的实体待办")
@RequestMapping(method= RequestMethod.GET , value="/{system}-app-{appname}/{entity}/mytasks")
public ResponseEntity<Map<String,Map<String,Object>>> fetchMyTask(@PathVariable("system") String system,@PathVariable("entity") String entity,WFTaskSearchContext context) {
context.setN_definitionkey_leftlike(String.format("%s-%s",system,entity));
return ResponseEntity.status(HttpStatus.OK).body(wfCoreService.searchMyTask2(context));
}
@ApiOperation(value = "获取我的系统待办", tags = {"工作流任务" } ,notes = "获取我的系统待办") @ApiOperation(value = "获取我的系统待办", tags = {"工作流任务" } ,notes = "获取我的系统待办")
@RequestMapping(method= RequestMethod.GET , value="/{system}-app-{appname}/mytasks") @RequestMapping(method= RequestMethod.GET , value="/{system}-app-{appname}/mytasks")
public ResponseEntity<List<WFTask>> fetchDefault(@PathVariable("system") String system,WFTaskSearchContext context) { public ResponseEntity<List<WFTask>> fetchDefault(@PathVariable("system") String system,WFTaskSearchContext context) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册