|
|
|
|
@ -9,13 +9,16 @@ import io.swagger.annotations.ApiImplicitParams; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import liquibase.pro.packaged.S; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.flowable.engine.HistoryService; |
|
|
|
|
import org.flowable.engine.ProcessEngine; |
|
|
|
|
import org.flowable.engine.ProcessEngines; |
|
|
|
|
import org.flowable.engine.TaskService; |
|
|
|
|
import org.flowable.task.api.Task; |
|
|
|
|
import org.flowable.task.api.history.HistoricTaskInstance; |
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springblade.plugin.workflow.core.constant.WfProcessConstant; |
|
|
|
|
import org.springblade.plugin.workflow.core.utils.ObjectUtil; |
|
|
|
|
import org.springblade.plugin.workflow.core.utils.WfTaskUtil; |
|
|
|
|
@ -51,6 +54,7 @@ public class WfProcessController { |
|
|
|
|
private final IWfCopyService copyService; |
|
|
|
|
// private final LimsInvoked limsInvoked;
|
|
|
|
|
|
|
|
|
|
private final HistoryService historyService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("processList") |
|
|
|
|
@ -132,7 +136,9 @@ public class WfProcessController { |
|
|
|
|
|
|
|
|
|
@GetMapping("/getOneTodo") |
|
|
|
|
public R<Map<String, String>> getOneTodo(String processInstanceId, String userCode) throws Exception { |
|
|
|
|
if (processInstanceId == null || userCode == null) { throw new Exception("必填参数不能为空"); } |
|
|
|
|
if (processInstanceId == null || userCode == null) { |
|
|
|
|
throw new Exception("必填参数不能为空"); |
|
|
|
|
} |
|
|
|
|
Task task = processService.selectProcessInstanceId(processInstanceId, userCode); |
|
|
|
|
Map<String, String> map = new HashMap<>(9); |
|
|
|
|
map.put("id", task.getId()); |
|
|
|
|
@ -235,305 +241,56 @@ public class WfProcessController { |
|
|
|
|
@ApiImplicitParam(name = "processInsId", value = "流程实例id", required = true), |
|
|
|
|
}) |
|
|
|
|
public R<Map<String, Object>> detail(String taskId, String processInsId) throws ExecutionException, InterruptedException { |
|
|
|
|
if (ObjectUtil.isAnyEmpty(taskId, processInsId)) { return R.fail("参数错误"); } |
|
|
|
|
|
|
|
|
|
Future<Map<String, Object>> formFuture = formService.getFormByTaskId(taskId); |
|
|
|
|
Future<List<WfButton>> buttonFuture = buttonService.getButtonByTaskId(taskId); |
|
|
|
|
Future<WfProcess> processFuture = processService.detail(taskId, WfTaskUtil.getTaskUser(), WfTaskUtil.getCandidateGroup()); |
|
|
|
|
Future<List<WfProcess>> flowFuture = processService.historyFlowList(processInsId, null, null); |
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
|
|
Map<String, Object> formMap = formFuture.get(); |
|
|
|
|
String taskDefinitionKey = processFuture.get().getTaskDefinitionKey(); |
|
|
|
|
|
|
|
|
|
// if ("drawTaskBlueprint".equals(taskDefinitionKey)) {
|
|
|
|
|
// Map<String, Object> allAppFormMap = JSON.parseObject((String)formMap.get("allAppForm"), Map.class);
|
|
|
|
|
// List<Map<String, Object>> groupList = (List<Map<String, Object>>) allAppFormMap.get("group");
|
|
|
|
|
// List<Map<String, Object>> newGroupList = new ArrayList<>(groupList.size());
|
|
|
|
|
// ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
|
|
|
|
|
// TaskService taskService = processEngine.getTaskService();
|
|
|
|
|
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
|
|
|
|
// if (task != null) {
|
|
|
|
|
// for (Map<String, Object> columnsMap : groupList) {
|
|
|
|
|
// List<Map<String, Object>> columnList = (List<Map<String, Object>>) columnsMap.get("column");
|
|
|
|
|
// for (Map<String, Object> columnMap : columnList) {
|
|
|
|
|
// String prop = (String) columnMap.get("prop");
|
|
|
|
|
// if ("experieNum11".equals(prop)) { columnMap.put("value", "01923"); }
|
|
|
|
|
// if ("experieNum12".equals(prop)) { columnMap.put("value", "01923"); }
|
|
|
|
|
// if ("experieNum13".equals(prop)) { columnMap.put("value", "01923"); }
|
|
|
|
|
// if ("experieNum21".equals(prop)) { columnMap.put("value", "01923"); }
|
|
|
|
|
// if ("experieNum22".equals(prop)) { columnMap.put("value", "01923"); }
|
|
|
|
|
// if ("experieNum23".equals(prop)) { columnMap.put("value", "01923"); }
|
|
|
|
|
// if ("experieNum31".equals(prop)) { columnMap.put("value", "01923"); }
|
|
|
|
|
// if ("experieNum32".equals(prop)) { columnMap.put("value", "01923"); }
|
|
|
|
|
// if ("experieNum33".equals(prop)) { columnMap.put("value", "01923"); }
|
|
|
|
|
// }
|
|
|
|
|
// columnsMap.put("column", columnList);
|
|
|
|
|
// newGroupList.add(columnsMap);
|
|
|
|
|
// }
|
|
|
|
|
// allAppFormMap.put("group", newGroupList);
|
|
|
|
|
// formMap.put("allAppForm", JSON.toJSONString(allAppFormMap));
|
|
|
|
|
// formMap.put("allForm", transToAlternativeJson(JSON.toJSONString(allAppFormMap)));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// TODO 有空把代码抽一下.....
|
|
|
|
|
if ("branchExperiment1".equals(taskDefinitionKey) || "branchExperiment2".equals(taskDefinitionKey) || "branchExperiment3".equals(taskDefinitionKey) |
|
|
|
|
|| "doExperimentBy11".equals(taskDefinitionKey) || "doExperimentBy12".equals(taskDefinitionKey) || "doExperimentBy13".equals(taskDefinitionKey) |
|
|
|
|
|| "doExperimentBy21".equals(taskDefinitionKey) || "doExperimentBy22".equals(taskDefinitionKey) || "doExperimentBy23".equals(taskDefinitionKey) |
|
|
|
|
|| "doExperimentBy31".equals(taskDefinitionKey) || "doExperimentBy32".equals(taskDefinitionKey) || "doExperimentBy33".equals(taskDefinitionKey)) { |
|
|
|
|
Map<String, Object> allAppFormMap = JSON.parseObject((String)formMap.get("allAppForm"), Map.class); |
|
|
|
|
List<Map<String, Object>> groupList = (List<Map<String, Object>>) allAppFormMap.get("group"); |
|
|
|
|
List<Map<String, Object>> newGroupList = new ArrayList<>(groupList.size()); |
|
|
|
|
if (ObjectUtil.isAnyEmpty(processInsId)) { |
|
|
|
|
return R.fail("参数错误"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 科室一组长分配任务
|
|
|
|
|
// if ("branchExperiment1".equals(taskDefinitionKey)) {
|
|
|
|
|
// for (Map<String, Object> columnsMap : groupList) {
|
|
|
|
|
// List<Map<String, Object>> columns = (List<Map<String, Object>>) columnsMap.get("column");
|
|
|
|
|
// List<Examine> examineList = limsInvoked.getExamineListByProcessInsIdAndTaskId(processInsId, 1L);
|
|
|
|
|
// for (Map<String, Object> columnMap : columns) {
|
|
|
|
|
// if (examineList != null && examineList.size() > 0) {
|
|
|
|
|
// Examine examine1 = new Examine();
|
|
|
|
|
// Examine examine2 = new Examine();
|
|
|
|
|
// Examine examine3 = new Examine();
|
|
|
|
|
// for (Examine examine : examineList) {
|
|
|
|
|
// if (examine.getExamineOrder().equals(1)) { examine1 = examine; }
|
|
|
|
|
// if (examine.getExamineOrder().equals(2)) { examine2 = examine; }
|
|
|
|
|
// if (examine.getExamineOrder().equals(3)) { examine3 = examine; }
|
|
|
|
|
// }
|
|
|
|
|
// String prop = (String) columnMap.get("prop");
|
|
|
|
|
// if ("simpleName1".equals(prop)) { columnMap.put("value", examine1.getSimpleName()); }
|
|
|
|
|
// if ("simpleCount1".equals(prop)) { columnMap.put("value", examine1.getSimpleCount()); }
|
|
|
|
|
// if ("experieNum1".equals(prop)) { columnMap.put("value", examine1.getExperieNum()); }
|
|
|
|
|
// if ("examineItem1".equals(prop)) { columnMap.put("value", examine1.getExamineItemId()); }
|
|
|
|
|
// if ("examineWay1".equals(prop)) { columnMap.put("value", examine1.getExamineWayId()); }
|
|
|
|
|
// if ("examineBasis1".equals(prop)) { columnMap.put("value", examine1.getExamineBasisId()); }
|
|
|
|
|
// if ("demandCompletionTime1".equals(prop)) { columnMap.put("value", sdf.format(examine1.getDemandCompletionTime())); }
|
|
|
|
|
//
|
|
|
|
|
// if ("simpleName2".equals(prop)) { columnMap.put("value", examine2.getSimpleName()); }
|
|
|
|
|
// if ("simpleCount2".equals(prop)) { columnMap.put("value", examine2.getSimpleCount()); }
|
|
|
|
|
// if ("experieNum2".equals(prop)) { columnMap.put("value", examine2.getExperieNum()); }
|
|
|
|
|
// if ("examineItem2".equals(prop)) { columnMap.put("value", examine2.getExamineItemId()); }
|
|
|
|
|
// if ("examineWay2".equals(prop)) { columnMap.put("value", examine2.getExamineWayId()); }
|
|
|
|
|
// if ("examineBasis2".equals(prop)) { columnMap.put("value", examine2.getExamineBasisId()); }
|
|
|
|
|
// if ("demandCompletionTime2".equals(prop)) { columnMap.put("value", sdf.format(examine2.getDemandCompletionTime())); }
|
|
|
|
|
//
|
|
|
|
|
// if ("simpleName3".equals(prop)) { columnMap.put("value", examine3.getSimpleName()); }
|
|
|
|
|
// if ("simpleCount3".equals(prop)) { columnMap.put("value", examine3.getSimpleCount()); }
|
|
|
|
|
// if ("experieNum3".equals(prop)) { columnMap.put("value", examine3.getExperieNum()); }
|
|
|
|
|
// if ("examineItem3".equals(prop)) { columnMap.put("value", examine3.getExamineItemId()); }
|
|
|
|
|
// if ("examineWay3".equals(prop)) { columnMap.put("value", examine3.getExamineWayId()); }
|
|
|
|
|
// if ("examineBasis3".equals(prop)) { columnMap.put("value", examine3.getExamineBasisId()); }
|
|
|
|
|
// if ("demandCompletionTime3".equals(prop)) { columnMap.put("value", sdf.format(examine3.getDemandCompletionTime())); }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// columnsMap.put("column", columns);
|
|
|
|
|
// newGroupList.add(columnsMap);
|
|
|
|
|
// }
|
|
|
|
|
// allAppFormMap.put("group", newGroupList);
|
|
|
|
|
// formMap.put("allAppForm", JSON.toJSONString(allAppFormMap));
|
|
|
|
|
// formMap.put("allForm", transToAlternativeJson(JSON.toJSONString(allAppFormMap)));
|
|
|
|
|
// }
|
|
|
|
|
// 科室二组长分配任务
|
|
|
|
|
// if ("branchExperiment2".equals(taskDefinitionKey)) {
|
|
|
|
|
// for (Map<String, Object> columnsMap : groupList) {
|
|
|
|
|
// List<Map<String, Object>> columns = (List<Map<String, Object>>) columnsMap.get("column");
|
|
|
|
|
// List<Examine> examineList = limsInvoked.getExamineListByProcessInsIdAndTaskId(processInsId, 2L);
|
|
|
|
|
// for (Map<String, Object> columnMap : columns) {
|
|
|
|
|
// if (examineList != null && examineList.size() > 0) {
|
|
|
|
|
// Examine examine1 = new Examine();
|
|
|
|
|
// Examine examine2 = new Examine();
|
|
|
|
|
// Examine examine3 = new Examine();
|
|
|
|
|
// for (Examine examine : examineList) {
|
|
|
|
|
// if (examine.getExamineOrder().equals(1)) { examine1 = examine; }
|
|
|
|
|
// if (examine.getExamineOrder().equals(2)) { examine2 = examine; }
|
|
|
|
|
// if (examine.getExamineOrder().equals(3)) { examine3 = examine; }
|
|
|
|
|
// }
|
|
|
|
|
// String prop = (String) columnMap.get("prop");
|
|
|
|
|
// if ("simpleName1".equals(prop)) { columnMap.put("value", examine1.getSimpleName()); }
|
|
|
|
|
// if ("simpleCount1".equals(prop)) { columnMap.put("value", examine1.getSimpleCount()); }
|
|
|
|
|
// if ("experieNum1".equals(prop)) { columnMap.put("value", examine1.getExperieNum()); }
|
|
|
|
|
// if ("examineItem1".equals(prop)) { columnMap.put("value", examine1.getExamineItemId()); }
|
|
|
|
|
// if ("examineWay1".equals(prop)) { columnMap.put("value", examine1.getExamineWayId()); }
|
|
|
|
|
// if ("examineBasis1".equals(prop)) { columnMap.put("value", examine1.getExamineBasisId()); }
|
|
|
|
|
// if ("demandCompletionTime1".equals(prop)) { columnMap.put("value", sdf.format(examine1.getDemandCompletionTime())); }
|
|
|
|
|
//
|
|
|
|
|
// if ("simpleName2".equals(prop)) { columnMap.put("value", examine2.getSimpleName()); }
|
|
|
|
|
// if ("simpleCount2".equals(prop)) { columnMap.put("value", examine2.getSimpleCount()); }
|
|
|
|
|
// if ("experieNum2".equals(prop)) { columnMap.put("value", examine2.getExperieNum()); }
|
|
|
|
|
// if ("examineItem2".equals(prop)) { columnMap.put("value", examine2.getExamineItemId()); }
|
|
|
|
|
// if ("examineWay2".equals(prop)) { columnMap.put("value", examine2.getExamineWayId()); }
|
|
|
|
|
// if ("examineBasis2".equals(prop)) { columnMap.put("value", examine2.getExamineBasisId()); }
|
|
|
|
|
// if ("demandCompletionTime2".equals(prop)) { columnMap.put("value", sdf.format(examine2.getDemandCompletionTime())); }
|
|
|
|
|
//
|
|
|
|
|
// if ("simpleName3".equals(prop)) { columnMap.put("value", examine3.getSimpleName()); }
|
|
|
|
|
// if ("simpleCount3".equals(prop)) { columnMap.put("value", examine3.getSimpleCount()); }
|
|
|
|
|
// if ("experieNum3".equals(prop)) { columnMap.put("value", examine3.getExperieNum()); }
|
|
|
|
|
// if ("examineItem3".equals(prop)) { columnMap.put("value", examine3.getExamineItemId()); }
|
|
|
|
|
// if ("examineWay3".equals(prop)) { columnMap.put("value", examine3.getExamineWayId()); }
|
|
|
|
|
// if ("examineBasis3".equals(prop)) { columnMap.put("value", examine3.getExamineBasisId()); }
|
|
|
|
|
// if ("demandCompletionTime3".equals(prop)) { columnMap.put("value", sdf.format(examine3.getDemandCompletionTime())); }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// columnsMap.put("column", columns);
|
|
|
|
|
// newGroupList.add(columnsMap);
|
|
|
|
|
// }
|
|
|
|
|
// allAppFormMap.put("group", newGroupList);
|
|
|
|
|
// formMap.put("allAppForm", JSON.toJSONString(allAppFormMap));
|
|
|
|
|
// formMap.put("allForm", transToAlternativeJson(JSON.toJSONString(allAppFormMap)));
|
|
|
|
|
// }
|
|
|
|
|
// 科室三组长分配任务
|
|
|
|
|
// if ("branchExperiment3".equals(taskDefinitionKey)) {
|
|
|
|
|
// List<Examine> examineList = limsInvoked.getExamineListByProcessInsIdAndTaskId(processInsId, 3L);
|
|
|
|
|
// if (examineList != null && examineList.size() > 0) {
|
|
|
|
|
// Examine examine1 = new Examine();
|
|
|
|
|
// Examine examine2 = new Examine();
|
|
|
|
|
// Examine examine3 = new Examine();
|
|
|
|
|
// for (Examine examine : examineList) {
|
|
|
|
|
// if (examine.getExamineOrder().equals(1)) { examine1 = examine; }
|
|
|
|
|
// if (examine.getExamineOrder().equals(2)) { examine2 = examine; }
|
|
|
|
|
// if (examine.getExamineOrder().equals(3)) { examine3 = examine; }
|
|
|
|
|
// }
|
|
|
|
|
// for (Map<String, Object> columnsMap : groupList) {
|
|
|
|
|
// List<Map<String, Object>> columns = (List<Map<String, Object>>) columnsMap.get("column");
|
|
|
|
|
// for (Map<String, Object> columnMap : columns) {
|
|
|
|
|
// String prop = (String) columnMap.get("prop");
|
|
|
|
|
// if ("simpleName1".equals(prop)) { columnMap.put("value", examine1.getSimpleName()); }
|
|
|
|
|
// if ("simpleCount1".equals(prop)) { columnMap.put("value", examine1.getSimpleCount()); }
|
|
|
|
|
// if ("experieNum1".equals(prop)) { columnMap.put("value", examine1.getExperieNum()); }
|
|
|
|
|
// if ("examineItem1".equals(prop)) { columnMap.put("value", examine1.getExamineItemId()); }
|
|
|
|
|
// if ("examineWay1".equals(prop)) { columnMap.put("value", examine1.getExamineWayId()); }
|
|
|
|
|
// if ("examineBasis1".equals(prop)) { columnMap.put("value", examine1.getExamineBasisId()); }
|
|
|
|
|
// if ("demandCompletionTime1".equals(prop)) { columnMap.put("value", sdf.format(examine1.getDemandCompletionTime())); }
|
|
|
|
|
// Future<Map<String, Object>> formFuture = formService.getFormByTaskId(taskId);
|
|
|
|
|
// Future<List<WfButton>> buttonFuture = buttonService.getButtonByTaskId(taskId);
|
|
|
|
|
// Future<WfProcess> processFuture = processService.detail(taskId, WfTaskUtil.getTaskUser(), WfTaskUtil.getCandidateGroup());
|
|
|
|
|
// Future<List<WfProcess>> flowFuture = processService.historyFlowList(processInsId, null, null);
|
|
|
|
|
// SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
|
|
|
|
|
//
|
|
|
|
|
// if ("simpleName2".equals(prop)) { columnMap.put("value", examine2.getSimpleName()); }
|
|
|
|
|
// if ("simpleCount2".equals(prop)) { columnMap.put("value", examine2.getSimpleCount()); }
|
|
|
|
|
// if ("experieNum2".equals(prop)) { columnMap.put("value", examine2.getExperieNum()); }
|
|
|
|
|
// if ("examineItem2".equals(prop)) { columnMap.put("value", examine2.getExamineItemId()); }
|
|
|
|
|
// if ("examineWay2".equals(prop)) { columnMap.put("value", examine2.getExamineWayId()); }
|
|
|
|
|
// if ("examineBasis2".equals(prop)) { columnMap.put("value", examine2.getExamineBasisId()); }
|
|
|
|
|
// if ("demandCompletionTime2".equals(prop)) { columnMap.put("value", sdf.format(examine2.getDemandCompletionTime())); }
|
|
|
|
|
// Map<String, Object> formMap = formFuture.get();
|
|
|
|
|
// String taskDefinitionKey = processFuture.get().getTaskDefinitionKey();
|
|
|
|
|
//
|
|
|
|
|
// if ("simpleName3".equals(prop)) { columnMap.put("value", examine3.getSimpleName()); }
|
|
|
|
|
// if ("simpleCount3".equals(prop)) { columnMap.put("value", examine3.getSimpleCount()); }
|
|
|
|
|
// if ("experieNum3".equals(prop)) { columnMap.put("value", examine3.getExperieNum()); }
|
|
|
|
|
// if ("examineItem3".equals(prop)) { columnMap.put("value", examine3.getExamineItemId()); }
|
|
|
|
|
// if ("examineWay3".equals(prop)) { columnMap.put("value", examine3.getExamineWayId()); }
|
|
|
|
|
// if ("examineBasis3".equals(prop)) { columnMap.put("value", examine3.getExamineBasisId()); }
|
|
|
|
|
// if ("demandCompletionTime3".equals(prop)) { columnMap.put("value", sdf.format(examine3.getDemandCompletionTime())); }
|
|
|
|
|
// if ("branchExperiment1".equals(taskDefinitionKey) || "branchExperiment2".equals(taskDefinitionKey) || "branchExperiment3".equals(taskDefinitionKey)
|
|
|
|
|
// || "doExperimentBy11".equals(taskDefinitionKey) || "doExperimentBy12".equals(taskDefinitionKey) || "doExperimentBy13".equals(taskDefinitionKey)
|
|
|
|
|
// || "doExperimentBy21".equals(taskDefinitionKey) || "doExperimentBy22".equals(taskDefinitionKey) || "doExperimentBy23".equals(taskDefinitionKey)
|
|
|
|
|
// || "doExperimentBy31".equals(taskDefinitionKey) || "doExperimentBy32".equals(taskDefinitionKey) || "doExperimentBy33".equals(taskDefinitionKey)) {
|
|
|
|
|
// Map<String, Object> allAppFormMap = JSON.parseObject((String) formMap.get("allAppForm"), Map.class);
|
|
|
|
|
// List<Map<String, Object>> groupList = (List<Map<String, Object>>) allAppFormMap.get("group");
|
|
|
|
|
// List<Map<String, Object>> newGroupList = new ArrayList<>(groupList.size());
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// columnsMap.put("column", columns);
|
|
|
|
|
// newGroupList.add(columnsMap);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// allAppFormMap.put("group", newGroupList);
|
|
|
|
|
// formMap.put("allAppForm", JSON.toJSONString(allAppFormMap));
|
|
|
|
|
// formMap.put("allForm", transToAlternativeJson(JSON.toJSONString(allAppFormMap)));
|
|
|
|
|
// }
|
|
|
|
|
// 科室一的实验员做试验
|
|
|
|
|
// if ("doExperimentBy11".equals(taskDefinitionKey) || "doExperimentBy12".equals(taskDefinitionKey) || "doExperimentBy13".equals(taskDefinitionKey)) {
|
|
|
|
|
// // 拿当前检验员
|
|
|
|
|
// ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
|
|
|
|
|
// TaskService taskService = processEngine.getTaskService();
|
|
|
|
|
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
|
|
|
|
// if (task != null) {
|
|
|
|
|
// String assignee = task.getAssignee();
|
|
|
|
|
// // 拿当前任务书下、这个检验员对应的检验对象
|
|
|
|
|
// Examine resultExamine = new Examine();
|
|
|
|
|
// List<Examine> examineList = limsInvoked.getExamineListByProcessInsIdAndTaskId(processInsId, 1L);
|
|
|
|
|
// for (Examine examine : examineList) { if (assignee.equals(examine.getExamineBy())) { resultExamine = examine; } }
|
|
|
|
|
// for (Map<String, Object> columnsMap : groupList) {
|
|
|
|
|
// List<Map<String, Object>> columnList = (List<Map<String, Object>>) columnsMap.get("column");
|
|
|
|
|
// for (Map<String, Object> columnMap : columnList) {
|
|
|
|
|
// String prop = (String) columnMap.get("prop");
|
|
|
|
|
// if ("simpleName".equals(prop)) { columnMap.put("value", resultExamine.getSimpleName()); }
|
|
|
|
|
// if ("simpleCount".equals(prop)) { columnMap.put("value", resultExamine.getSimpleCount()); }
|
|
|
|
|
// if ("experieNum".equals(prop)) { columnMap.put("value", resultExamine.getExperieNum()); }
|
|
|
|
|
// if ("examineItemId".equals(prop)) { columnMap.put("value", resultExamine.getExamineItemId()); }
|
|
|
|
|
// if ("examineWayId".equals(prop)) { columnMap.put("value", resultExamine.getExamineWayId()); }
|
|
|
|
|
// if ("examineBasisId".equals(prop)) { columnMap.put("value", resultExamine.getExamineBasisId()); }
|
|
|
|
|
// // if ("examineBasisContent".equals(prop)) { columnMap.put("value", resultExamine.getExamineBasisId()); }
|
|
|
|
|
// }
|
|
|
|
|
// columnsMap.put("column", columnList);
|
|
|
|
|
// newGroupList.add(columnsMap);
|
|
|
|
|
// }
|
|
|
|
|
// allAppFormMap.put("group", newGroupList);
|
|
|
|
|
// formMap.put("allAppForm", JSON.toJSONString(allAppFormMap));
|
|
|
|
|
// formMap.put("allForm", transToAlternativeJson(JSON.toJSONString(allAppFormMap)));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// 科室二实验员做试验
|
|
|
|
|
// if ("doExperimentBy21".equals(taskDefinitionKey) || "doExperimentBy22".equals(taskDefinitionKey) || "doExperimentBy23".equals(taskDefinitionKey)) {
|
|
|
|
|
// ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
|
|
|
|
|
// TaskService taskService = processEngine.getTaskService();
|
|
|
|
|
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
|
|
|
|
// if (task != null) {
|
|
|
|
|
// String assignee = task.getAssignee();
|
|
|
|
|
// Examine resultExamine = new Examine();
|
|
|
|
|
// List<Examine> examineList = limsInvoked.getExamineListByProcessInsIdAndTaskId(processInsId, 2L);
|
|
|
|
|
// for (Examine examine : examineList) { if (assignee.equals(examine.getExamineBy())) { resultExamine = examine; } }
|
|
|
|
|
// for (Map<String, Object> columnsMap : groupList) {
|
|
|
|
|
// List<Map<String, Object>> columnList = (List<Map<String, Object>>) columnsMap.get("column");
|
|
|
|
|
// for (Map<String, Object> columnMap : columnList) {
|
|
|
|
|
// String prop = (String) columnMap.get("prop");
|
|
|
|
|
// if ("simpleName".equals(prop)) { columnMap.put("value", resultExamine.getSimpleName()); }
|
|
|
|
|
// if ("simpleCount".equals(prop)) { columnMap.put("value", resultExamine.getSimpleCount()); }
|
|
|
|
|
// if ("experieNum".equals(prop)) { columnMap.put("value", resultExamine.getExperieNum()); }
|
|
|
|
|
// if ("examineItemId".equals(prop)) { columnMap.put("value", resultExamine.getExamineItemId()); }
|
|
|
|
|
// if ("examineWayId".equals(prop)) { columnMap.put("value", resultExamine.getExamineWayId()); }
|
|
|
|
|
// if ("examineBasisId".equals(prop)) { columnMap.put("value", resultExamine.getExamineBasisId()); }
|
|
|
|
|
// // if ("examineBasisContent".equals(prop)) { columnMap.put("value", resultExamine.getExamineBasisId()); }
|
|
|
|
|
// }
|
|
|
|
|
// columnsMap.put("column", columnList);
|
|
|
|
|
// newGroupList.add(columnsMap);
|
|
|
|
|
// }
|
|
|
|
|
// allAppFormMap.put("group", newGroupList);
|
|
|
|
|
// formMap.put("allAppForm", JSON.toJSONString(allAppFormMap));
|
|
|
|
|
// formMap.put("allForm", transToAlternativeJson(JSON.toJSONString(allAppFormMap)));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// 科室三实验员做试验
|
|
|
|
|
// if ("doExperimentBy31".equals(taskDefinitionKey) || "doExperimentBy32".equals(taskDefinitionKey) || "doExperimentBy33".equals(taskDefinitionKey)) {
|
|
|
|
|
// ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
|
|
|
|
|
// TaskService taskService = processEngine.getTaskService();
|
|
|
|
|
// Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
|
|
|
|
// if (task != null) {
|
|
|
|
|
// String assignee = task.getAssignee();
|
|
|
|
|
// Examine resultExamine = new Examine();
|
|
|
|
|
// List<Examine> examineList = limsInvoked.getExamineListByProcessInsIdAndTaskId(processInsId, 3L);
|
|
|
|
|
// for (Examine examine : examineList) { if (assignee.equals(examine.getExamineBy())) { resultExamine = examine; } }
|
|
|
|
|
// for (Map<String, Object> columnsMap : groupList) {
|
|
|
|
|
// List<Map<String, Object>> columnList = (List<Map<String, Object>>) columnsMap.get("column");
|
|
|
|
|
// for (Map<String, Object> columnMap : columnList) {
|
|
|
|
|
// String prop = (String) columnMap.get("prop");
|
|
|
|
|
// if ("simpleName".equals(prop)) { columnMap.put("value", resultExamine.getSimpleName()); }
|
|
|
|
|
// if ("simpleCount".equals(prop)) { columnMap.put("value", resultExamine.getSimpleCount()); }
|
|
|
|
|
// if ("experieNum".equals(prop)) { columnMap.put("value", resultExamine.getExperieNum()); }
|
|
|
|
|
// if ("examineItemId".equals(prop)) { columnMap.put("value", resultExamine.getExamineItemId()); }
|
|
|
|
|
// if ("examineWayId".equals(prop)) { columnMap.put("value", resultExamine.getExamineWayId()); }
|
|
|
|
|
// if ("examineBasisId".equals(prop)) { columnMap.put("value", resultExamine.getExamineBasisId()); }
|
|
|
|
|
// // if ("examineBasisContent".equals(prop)) { columnMap.put("value", resultExamine.getExamineBasisId()); }
|
|
|
|
|
// }
|
|
|
|
|
// columnsMap.put("column", columnList);
|
|
|
|
|
// newGroupList.add(columnsMap);
|
|
|
|
|
// }
|
|
|
|
|
// allAppFormMap.put("group", newGroupList);
|
|
|
|
|
// formMap.put("allAppForm", JSON.toJSONString(allAppFormMap));
|
|
|
|
|
// formMap.put("allForm", transToAlternativeJson(JSON.toJSONString(allAppFormMap)));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
if (StringUtil.isBlank(taskId)) { // 不传taskId的情况下,取最后一个创建的任务
|
|
|
|
|
List<HistoricTaskInstance> list = historyService.createHistoricTaskInstanceQuery() |
|
|
|
|
.processInstanceId(processInsId) |
|
|
|
|
.orderByHistoricTaskInstanceStartTime() |
|
|
|
|
.desc() |
|
|
|
|
.list(); |
|
|
|
|
if (list.isEmpty()) { |
|
|
|
|
return R.fail("查询不到任务详情"); |
|
|
|
|
} |
|
|
|
|
taskId = list.get(0).getId(); |
|
|
|
|
} |
|
|
|
|
Map<String, Object> result = new HashMap<>(4); |
|
|
|
|
result.put("form", formMap); |
|
|
|
|
Future<WfProcess> processFuture = processService.detail(taskId, WfTaskUtil.getTaskUser(), WfTaskUtil.getCandidateGroup()); |
|
|
|
|
Future<Map<String, Object>> formFuture = formService.getFormByTaskId(taskId); |
|
|
|
|
Future<List<WfProcess>> flowFuture = processService.historyFlowList(processInsId, null, null); |
|
|
|
|
Future<List<WfButton>> buttonFuture = buttonService.getButtonByTaskId(taskId); |
|
|
|
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
result.put("process", processFuture.get()); |
|
|
|
|
result.put("form", formFuture.get()); |
|
|
|
|
result.put("flow", flowFuture.get()); |
|
|
|
|
result.put("button", buttonFuture.get()); |
|
|
|
|
result.put("process", processFuture.get()); |
|
|
|
|
return R.data(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 转换为前端可解析的对象结构数据 |
|
|
|
|
* |
|
|
|
|
* @param str |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
|