update 接口排序
This commit is contained in:
@@ -104,49 +104,6 @@ public class AController {
|
|||||||
return Result.OK(map);
|
return Result.OK(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/deleteDeployment")
|
|
||||||
@ApiOperation(value = "删除已部署的流程定义", notes = "删除已部署的流程定义")
|
|
||||||
public Result<Object> deleteDeployment(@RequestParam(value = "id", required = false) String id) {
|
|
||||||
// true 表示级联删除引用,比如 act_ru_execution 数据
|
|
||||||
repositoryService.deleteDeployment(id, true);
|
|
||||||
return Result.OK();
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/findProcessDefinition")
|
|
||||||
@ApiOperation(value = "查询流程定义列表", notes = "查询流程定义列表")
|
|
||||||
public Result<List<Map<String, Object>>> findProcessDefinition(@RequestParam(value = "processDefinitionKey", required = false) String processDefinitionKey,
|
|
||||||
@RequestParam(value = "processDefinitionName", required = false) String processDefinitionName) {
|
|
||||||
List<Map<String, Object>> allList = new ArrayList<>();
|
|
||||||
//创建一个流程定义查询
|
|
||||||
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();
|
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(processDefinitionKey)) {
|
|
||||||
//根据流程定义Key查询
|
|
||||||
processDefinitionQuery.processDefinitionKey(processDefinitionKey);
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(processDefinitionName)) {
|
|
||||||
//根据流程定义name查询
|
|
||||||
processDefinitionQuery.processDefinitionNameLike(processDefinitionName);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<ProcessDefinition> processDefinitionList = processDefinitionQuery
|
|
||||||
.orderByProcessDefinitionVersion().asc()
|
|
||||||
.list();
|
|
||||||
//定义有序map,相同的key,添加map值后,后面的会覆盖前面的值
|
|
||||||
Map<String,ProcessDefinition> processDefinitionMap = new LinkedHashMap<>();
|
|
||||||
//遍历相同的key,替换最新的值
|
|
||||||
for(ProcessDefinition pd : processDefinitionList){
|
|
||||||
processDefinitionMap.put(pd.getKey(), pd);
|
|
||||||
}
|
|
||||||
for (ProcessDefinition processDefinition : processDefinitionMap.values()) {
|
|
||||||
//String deploymentId = processDefinition.getDeploymentId();
|
|
||||||
//Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
|
|
||||||
//map.put("processDefinition", BeanUtil.beanToMap(processDefinition));
|
|
||||||
allList.add(BeanUtil.beanToMap(processDefinition));
|
|
||||||
}
|
|
||||||
return Result.OK(allList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation(value="启动流程")
|
@ApiOperation(value="启动流程")
|
||||||
@PostMapping("/start")
|
@PostMapping("/start")
|
||||||
public Result<Map<String, String>> start(@RequestBody Map<String,Object> map) {
|
public Result<Map<String, String>> start(@RequestBody Map<String,Object> map) {
|
||||||
@@ -190,6 +147,7 @@ public class AController {
|
|||||||
|
|
||||||
return Result.OK(map1);
|
return Result.OK(map1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value="查询待办列表")
|
@ApiOperation(value="查询待办列表")
|
||||||
@GetMapping("/getTaskList")
|
@GetMapping("/getTaskList")
|
||||||
public Result<List<Map<String, String>>> testFindPersonalTaskList(@RequestParam(value = "assignee") String assignee,
|
public Result<List<Map<String, String>>> testFindPersonalTaskList(@RequestParam(value = "assignee") String assignee,
|
||||||
@@ -219,18 +177,11 @@ public class AController {
|
|||||||
}
|
}
|
||||||
return Result.OK(resut);
|
return Result.OK(resut);
|
||||||
}
|
}
|
||||||
@ApiOperation(value="签收任务")
|
|
||||||
@PostMapping("/claim")
|
|
||||||
public Result<Object> claim(@RequestBody Map<String,Object> map) {
|
|
||||||
String taskId = map.get("taskId").toString();
|
|
||||||
String userId = map.get("userId").toString();
|
|
||||||
taskService.claim(taskId, userId);
|
|
||||||
return Result.OK();
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation(value="完成任务")
|
@ApiOperation(value="完成任务")
|
||||||
@PostMapping("/complete")
|
@PostMapping("/complete")
|
||||||
public Result<Object> complete(@RequestBody Map<String,Object> map) {
|
public Result<Object> complete(@RequestBody Map<String,Object> map) {
|
||||||
|
//todo 判断当前节点,执行不同的操作
|
||||||
String taskId = map.get("taskId").toString();
|
String taskId = map.get("taskId").toString();
|
||||||
//Map<String, Object> vars = new HashMap<>();
|
//Map<String, Object> vars = new HashMap<>();
|
||||||
//List<String> otherDrafterList = new ArrayList<>();
|
//List<String> otherDrafterList = new ArrayList<>();
|
||||||
@@ -244,6 +195,62 @@ public class AController {
|
|||||||
return Result.OK();
|
return Result.OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/deleteDeployment")
|
||||||
|
@ApiOperation(value = "删除已部署的流程定义", notes = "删除已部署的流程定义")
|
||||||
|
public Result<Object> deleteDeployment(@RequestParam(value = "id", required = false) String id) {
|
||||||
|
// true 表示级联删除引用,比如 act_ru_execution 数据
|
||||||
|
repositoryService.deleteDeployment(id, true);
|
||||||
|
return Result.OK();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/findProcessDefinition")
|
||||||
|
@ApiOperation(value = "查询流程定义列表", notes = "查询流程定义列表")
|
||||||
|
public Result<List<Map<String, Object>>> findProcessDefinition(@RequestParam(value = "processDefinitionKey", required = false) String processDefinitionKey,
|
||||||
|
@RequestParam(value = "processDefinitionName", required = false) String processDefinitionName) {
|
||||||
|
List<Map<String, Object>> allList = new ArrayList<>();
|
||||||
|
//创建一个流程定义查询
|
||||||
|
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(processDefinitionKey)) {
|
||||||
|
//根据流程定义Key查询
|
||||||
|
processDefinitionQuery.processDefinitionKey(processDefinitionKey);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(processDefinitionName)) {
|
||||||
|
//根据流程定义name查询
|
||||||
|
processDefinitionQuery.processDefinitionNameLike(processDefinitionName);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ProcessDefinition> processDefinitionList = processDefinitionQuery
|
||||||
|
.orderByProcessDefinitionVersion().asc()
|
||||||
|
.list();
|
||||||
|
//定义有序map,相同的key,添加map值后,后面的会覆盖前面的值
|
||||||
|
Map<String,ProcessDefinition> processDefinitionMap = new LinkedHashMap<>();
|
||||||
|
//遍历相同的key,替换最新的值
|
||||||
|
for(ProcessDefinition pd : processDefinitionList){
|
||||||
|
processDefinitionMap.put(pd.getKey(), pd);
|
||||||
|
}
|
||||||
|
for (ProcessDefinition processDefinition : processDefinitionMap.values()) {
|
||||||
|
//String deploymentId = processDefinition.getDeploymentId();
|
||||||
|
//Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
|
||||||
|
//map.put("processDefinition", BeanUtil.beanToMap(processDefinition));
|
||||||
|
allList.add(BeanUtil.beanToMap(processDefinition));
|
||||||
|
}
|
||||||
|
return Result.OK(allList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value="签收任务")
|
||||||
|
@PostMapping("/claim")
|
||||||
|
public Result<Object> claim(@RequestBody Map<String,Object> map) {
|
||||||
|
String taskId = map.get("taskId").toString();
|
||||||
|
String userId = map.get("userId").toString();
|
||||||
|
taskService.claim(taskId, userId);
|
||||||
|
return Result.OK();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加签
|
* 加签
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user