REQ-3502: 按钮排序

This commit is contained in:
yanglin 2025-01-15 16:17:26 +08:00
parent f5f42f06d5
commit 1baeac0fcd

View File

@ -58,176 +58,14 @@ class WorkflowTodoCardButtonInterceptorFactory implements CardButtonInterceptorF
}
BpmnTaskButtonVo fetchWorkflowButtons(Todo todo) {
String json = "{\n" +
" \"buttons\": [\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 7,\n" +
" \"btnKey\": \"BPMN_ROLLBACK\",\n" +
" \"btnName\": \"回退\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false,\n" +
" \"visibleScopes\": [\n" +
" \"EXECUTOR\"\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 6,\n" +
" \"btnKey\": \"BPMN_COMMENT\",\n" +
" \"btnName\": \"评论\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false,\n" +
" \"visibleScopes\": [\n" +
" \"INITIATOR\",\n" +
" \"EXECUTOR\"\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 1,\n" +
" \"btnKey\": \"BPMN_APPROVE\",\n" +
" \"btnName\": \"同意\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false,\n" +
" \"visibleScopes\": [\n" +
" \"EXECUTOR\"\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 4,\n" +
" \"btnKey\": \"BPMN_TRANSFER\",\n" +
" \"btnName\": \"转交\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false,\n" +
" \"visibleScopes\": [\n" +
" \"EXECUTOR\"\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 2,\n" +
" \"btnKey\": \"BPMN_REJECT\",\n" +
" \"btnName\": \"驳回\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false,\n" +
" \"visibleScopes\": [\n" +
" \"EXECUTOR\"\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 8,\n" +
" \"btnKey\": \"BPMN_COPY\",\n" +
" \"btnName\": \"抄送\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false,\n" +
" \"visibleScopes\": [\n" +
" \"EXECUTOR\"\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 3,\n" +
" \"btnKey\": \"BPMN_REVOCATION\",\n" +
" \"btnName\": \"撤回\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false,\n" +
" \"visibleScopes\": [\n" +
" \"INITIATOR\"\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 5,\n" +
" \"btnKey\": \"BPMN_COUNTERSIGN\",\n" +
" \"btnName\": \"加签\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false,\n" +
" \"visibleScopes\": [\n" +
" \"EXECUTOR\"\n" +
" ]\n" +
" }\n" +
" ],\n" +
" \"allConfigButtons\": [\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 1,\n" +
" \"btnKey\": \"BPMN_APPROVE\",\n" +
" \"btnName\": \"同意\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 2,\n" +
" \"btnKey\": \"BPMN_REJECT\",\n" +
" \"btnName\": \"驳回\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 3,\n" +
" \"btnKey\": \"BPMN_REVOCATION\",\n" +
" \"btnName\": \"撤回\",\n" +
" \"checked\": false,\n" +
" \"disabled\": true\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 4,\n" +
" \"btnKey\": \"BPMN_TRANSFER\",\n" +
" \"btnName\": \"转交\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 5,\n" +
" \"btnKey\": \"BPMN_COUNTERSIGN\",\n" +
" \"btnName\": \"加签\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 6,\n" +
" \"btnKey\": \"BPMN_COMMENT\",\n" +
" \"btnName\": \"评论\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 7,\n" +
" \"btnKey\": \"BPMN_ROLLBACK\",\n" +
" \"btnName\": \"回退\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false\n" +
" },\n" +
" {\n" +
" \"type\": \"SYSTEM\",\n" +
" \"order\": 8,\n" +
" \"btnKey\": \"BPMN_COPY\",\n" +
" \"btnName\": \"抄送\",\n" +
" \"checked\": true,\n" +
" \"disabled\": false\n" +
" }\n" +
" ],\n" +
" \"executorTaskResult\": \"PROCESSING\",\n" +
" \"customHiddenButtons\": []\n" +
" }";
return JSON.parseObject(json, BpmnTaskButtonVo.class);
//TodoBusiness business = todoBusinessDao.getBusinesses(todo).findBusiness(todo).orElse(null);
//BizAssertions.assertNotNull(business, "todo business not found. todoIdentityCode={}", todo.getIdentityCode());
//BpmnTaskButtonSearchDTO workflowRequest = new BpmnTaskButtonSearchDTO();
//workflowRequest.setProcessInstanceId(todo.getBizCode());
//workflowRequest.setTaskId(todo.getSubBizCode());
//workflowRequest.setInitiatorPersonId(business.getPromoterPersonId());
//workflowRequest.setExecutorPersonId(todo.getExecutorPersonId());
//return workflowCoreService.findProcessSingleTaskButtons(workflowRequest);
TodoBusiness business = todoBusinessDao.getBusinesses(todo).findBusiness(todo).orElse(null);
BizAssertions.assertNotNull(business, "todo business not found. todoIdentityCode={}", todo.getIdentityCode());
BpmnTaskButtonSearchDTO workflowRequest = new BpmnTaskButtonSearchDTO();
workflowRequest.setProcessInstanceId(todo.getBizCode());
workflowRequest.setTaskId(todo.getSubBizCode());
workflowRequest.setInitiatorPersonId(business.getPromoterPersonId());
workflowRequest.setExecutorPersonId(todo.getExecutorPersonId());
return workflowCoreService.findProcessSingleTaskButtons(workflowRequest);
}
}