• Activiti7开发(五)-我的审批历史


    查看本人审批过的历史

    public AjaxResult historyFromData(@RequestParam(value = "businessKey",required = false) String businessKey,@RequestParam("applyType") String applyType) {
            return AjaxResult.success(formHistoryDataService.historyDataShow(businessKey,applyType));
    }
    
    public List<HistoryDataDTO> historyDataShow(String businessKey,String applyType) {
            List<HistoryDataDTO> returnHistoryFromDataDTOS=new ArrayList<>();
            List<ActWorkflowFormData> actWorkflowFormData = actWorkflowFormDataService.selectActWorkflowFormDataByBusinessKey(businessKey,applyType);
            //根据任务名分组
            Map<String, List<ActWorkflowFormData>> collect = actWorkflowFormData.stream().collect(Collectors.groupingBy(ActWorkflowFormData::getBusinessKey));
            //把结果封装到HistoryDataDTO中
            collect.entrySet().forEach(
                    entry -> {
                        HistoryDataDTO returnHistoryFromDataDTO = new HistoryDataDTO();
                        returnHistoryFromDataDTO.setTaskNodeName(entry.getValue().get(0).getTaskNodeName());
                        returnHistoryFromDataDTO.setCreateName(entry.getValue().get(0).getCreateName());
                        returnHistoryFromDataDTO.setCreatedDate(sdf.format(entry.getValue().get(0).getCreateTime()));
                        returnHistoryFromDataDTO.setFormHistoryDataDTO(entry.getValue().stream().map(awfd->new HistoryFormDataDTO(awfd.getControlName(),awfd.getControlValue())).collect(Collectors.toList()));
                        returnHistoryFromDataDTOS.add(returnHistoryFromDataDTO);
                    }
            );
            //排序
            List<HistoryDataDTO> collect1 = returnHistoryFromDataDTOS.stream().sorted((x, y) -> x.getCreatedDate().compareTo(y.getCreatedDate())).collect(Collectors.toList());
    
            return collect1;
    }
    
  • 相关阅读:
    第四单元博客总结——暨OO课程总结
    OO--第三单元规格化设计 博客作业
    关于博客园主——他死了
    编译错误总集
    密码是我QQ签名
    P1600 天天爱跑步
    天气之子——天空上是另一个世界
    可持久化01trie树——模板
    P1270 “访问”美术馆——不太一样的树形DP
    P1099 树网的核——模拟+树形结构
  • 原文地址:https://www.cnblogs.com/lhxBlogs/p/15091903.html
Copyright © 2020-2023  润新知