xiejun
2023-08-12 a19d26e88360c9760b2286bac4dfb1710fd2fa21
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/business/service/impl/FlowBusinessServiceImpl.java
@@ -82,9 +82,9 @@
         .includeProcessVariables().active().orderByTaskCreateTime().desc();
      // 构建列表数据
      buildFlowTaskList(bladeFlow, flowList, claimUserQuery, FlowEngineConstant.STATUS_CLAIM);
      buildFlowTaskList(bladeFlow, flowList, claimRoleWithTenantIdQuery, FlowEngineConstant.STATUS_CLAIM);
      buildFlowTaskList(bladeFlow, flowList, claimRoleWithoutTenantIdQuery, FlowEngineConstant.STATUS_CLAIM);
      buildFlowTaskList(bladeFlow, flowList, claimUserQuery, FlowEngineConstant.STATUS_CLAIM, page);
      buildFlowTaskList(bladeFlow, flowList, claimRoleWithTenantIdQuery, FlowEngineConstant.STATUS_CLAIM, page);
      buildFlowTaskList(bladeFlow, flowList, claimRoleWithoutTenantIdQuery, FlowEngineConstant.STATUS_CLAIM, page);
      // 计算总数
      long count = claimUserQuery.count() + claimRoleWithTenantIdQuery.count() + claimRoleWithoutTenantIdQuery.count();
@@ -107,7 +107,7 @@
         .includeProcessVariables().orderByTaskCreateTime().desc();
      // 构建列表数据
      buildFlowTaskList(bladeFlow, flowList, todoQuery, FlowEngineConstant.STATUS_TODO);
      buildFlowTaskList(bladeFlow, flowList, todoQuery, FlowEngineConstant.STATUS_TODO,page);
      // 计算总数
      long count = todoQuery.count();
@@ -181,6 +181,16 @@
            flow.setProcessIsFinished(FlowEngineConstant.STATUS_UNFINISHED);
         }
         flow.setStatus(FlowEngineConstant.STATUS_FINISH);
         //流程变量
         Map<String,Object> variables = historicProcessInstance.getProcessVariables();
         flow.setVariables(variables);
         //businessKey
         if (Func.isNotEmpty(historicProcessInstance)) {
            flow.setBusinessId(businessKey.length>1 && StringUtils.isNotEmpty(businessKey[1])?businessKey[1]:"1");
         }
         flowList.add(flow);
      });
@@ -299,8 +309,9 @@
    * @param flowList  流程列表
    * @param taskQuery 任务查询类
    * @param status    状态
    * @param page
    */
   private void buildFlowTaskList(BladeFlow bladeFlow, List<BladeFlow> flowList, TaskQuery taskQuery, String status) {
   private void buildFlowTaskList(BladeFlow bladeFlow, List<BladeFlow> flowList, TaskQuery taskQuery, String status, IPage<BladeFlow> page) {
//      if (bladeFlow.getCategory() != null) {
      if (StringUtils.isNotEmpty(bladeFlow.getCategory())) {
         taskQuery.processCategoryIn(Func.toStrList(bladeFlow.getCategory()));
@@ -314,7 +325,9 @@
      if (bladeFlow.getEndDate() != null) {
         taskQuery.taskCreatedBefore(bladeFlow.getEndDate());
      }
      taskQuery.list().forEach(task -> {
      int firstResult = (int) ((page.getCurrent()-1)* page.getSize());
      int maxResult = (int) page.getSize();
      taskQuery.listPage(firstResult,maxResult).forEach(task -> {
         BladeFlow flow = new BladeFlow();
         flow.setTaskId(task.getId());
         flow.setTaskDefinitionKey(task.getTaskDefinitionKey());