zoukankan      html  css  js  c++  java
  • 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;
    }
    
  • 相关阅读:
    面试题:Spring的理解
    静态块与静态变量
    构造方法与构造块的执行顺序(区别于static)
    子类调用父类的构造函数几种情况
    使用json遇到的问题
    页面加载,使用ajax查询某个类别,并且给它们添加(拼接)连接
    对某个商品的上下架状态进行改变
    SSH后台管理系统,实现查询+分页
    跟上Java8
    java中值传递和引用传递
  • 原文地址:https://www.cnblogs.com/lhxBlogs/p/15091903.html
Copyright © 2011-2022 走看看