章节索引 :

com.example.emos.workflow.config.quart包声明MeetingRoomJob.java

public class MeetingRoomJob extends QuartzJobBean {
    @Autowired
    private RedisTemplate redisTemplate;

    @Override
    protected void executeInternal(JobExecutionContext ctx) throws JobExecutionException {
        Map map = ctx.getJobDetail().getJobDataMap();
        String uuid = map.get("uuid").toString();
        Date date = DateUtil.parse(map.get("expire").toString(), "yyyy-MM-dd HH:mm:ss");
        //生成当前唯一的视频会议房间ID
        for (; ; ) {
            long roomId = RandomUtil.randomLong(1L, 4294967295L);
            if (redisTemplate.hasKey("roomId-" + roomId)) {
                continue;
            } else {
                redisTemplate.opsForValue().set("roomId-" + roomId, uuid);
                redisTemplate.expireAt("roomId-" + roomId, date);

                redisTemplate.opsForValue().set(uuid, roomId);
                redisTemplate.expireAt(uuid, date);
                break;
            }
        }
    }
}

com.example.emos.workflow.config.quart包创建MeetingStatusJob类。

@Slf4j
@Component
public class MeetingStatusJob extends QuartzJobBean {
    @Autowired
    private MeetingService meetingService;

    @Autowired
    private AmectService amectService;

    @Autowired
    private AmectTypeService amectTypeService;

    @Transactional
    @Override
    protected void executeInternal(JobExecutionContext ctx) throws JobExecutionException {
        Map map = ctx.getJobDetail().getJobDataMap();
        String uuid = MapUtil.getStr(map, "uuid");
        Integer status = MapUtil.getInt(map, "status");
        String title = MapUtil.getStr(map, "title");
        String date = MapUtil.getStr(map, "date");
        String start = MapUtil.getStr(map, "start");
        String end = MapUtil.getStr(map, "end");
        String flag=MapUtil.getStr(map,"flag");

        //更新会议状态
        HashMap param = new HashMap();
        param.put("status", status);
        param.put("uuid", uuid);
        meetingService.updateMeetingStatus(param);
        log.debug("会议状态更新成功");

        if("end".equals(flag)){
            //生成缺席名单
            ArrayList<Integer> list = meetingService.searchMeetingUnpresent(uuid);
            if (list != null && list.size() > 0) {
                JSONArray array = new JSONArray();
                list.forEach(one -> {
                    array.put(one);
                });
                param = new HashMap() {{
                    put("uuid", uuid);
                    put("unpresent", JSONUtil.toJsonStr(array));
                }};
                meetingService.updateMeetingUnpresent(param);

                //查询缺席会议的罚款金额和ID
                map = amectTypeService.searchByType("缺席会议");
                BigDecimal money = (BigDecimal) map.get("money");
                Integer typeId = (Integer) map.get("id");

                //根据缺席名单生成罚款单
                TbAmect amect = new TbAmect();
                amect.setAmount(money);
                amect.setTypeId(typeId);
                amect.setReason("缺席" + date + " " + start + "~" + end + "的" + title);
                list.forEach(one -> {
                    amect.setUuid(IdUtil.simpleUUID());
                    amect.setUserId(one);
                    amectService.insert(amect);
                });
            }
        }
    }

}

com.example.emos.workflow.config.quart包创建MeetingWorkflowJob类。

@Slf4j
@Component
public class MeetingWorkflowJob extends QuartzJobBean {
    @Autowired
    private RuntimeService runtimeService;

    @Autowired
    private HistoryService historyService;

    @Autowired
    private MeetingService meetingService;

    @Autowired
    private WorkflowService workflowService;

    /**
     * 检查工作里的审批状态
     *
     * @param ctx
     * @throws JobExecutionException
     */
    @Override
    protected void executeInternal(JobExecutionContext ctx) throws JobExecutionException {
        Map map = ctx.getJobDetail().getJobDataMap();
        String uuid = map.get("uuid").toString();
        String instanceId = map.get("instanceId").toString();
        //判断会议审批是不是未结束
        ProcessInstance instance = runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).singleResult();
        if (instance != null) {
            map.put("processStatus", "未结束");
            workflowService.deleteProcessById(uuid, instanceId, "会议", "会议过期");
            HashMap param = new HashMap();
            param.put("uuid", uuid);
            param.put("status", 2); //更改会议状态为已拒绝
            meetingService.updateMeetingStatus(param); //更新会议状态
            log.debug("会议已失效");
        }
    }
}

com.example.emos.workflow.config.quart包创建QuartzUtil类。

@Component
@Slf4j
public class QuartzUtil {

    @Resource
    private Scheduler scheduler;

    public void addJob(JobDetail jobDetail, String jobName, String jobGroupName, Date start) {
        try {
            Trigger trigger = TriggerBuilder.newTrigger().withIdentity(jobName, jobGroupName)
                    .withSchedule(SimpleScheduleBuilder.simpleSchedule().withMisfireHandlingInstructionFireNow())
                    .startAt(start).build();
            scheduler.scheduleJob(jobDetail, trigger);
            log.debug("成功添加" + jobName + "定时器");
        } catch (SchedulerException e) {
            log.error("定时器添加失败",e);
        }
    }

    public void deleteJob(String jobName, String jobGroupName) {
        TriggerKey triggerKey = TriggerKey.triggerKey(jobName, jobGroupName);
        try {
            scheduler.resumeTrigger(triggerKey);
            scheduler.unscheduleJob(triggerKey);
            scheduler.deleteJob(JobKey.jobKey(jobName, jobGroupName));
            log.debug("成功删除" + jobName + "定时器");
        } catch (SchedulerException e) {
            log.error("定时器删除失败",e);
        }

    }
}

com.example.emos.workflow.config包中创建DroolsConfiguration

@Configuration
public class DroolsConfiguration {

    private static final String RULES_PATH = "rules/";

    @Bean
    @ConditionalOnMissingBean(KieFileSystem.class)
    public KieFileSystem kieFileSystem() throws IOException {
        KieFileSystem kieFileSystem = getKieServices().newKieFileSystem();
        for (Resource file : getRuleFiles()) {
            kieFileSystem.write(ResourceFactory.newClassPathResource(RULES_PATH + file.getFilename(), "UTF-8"));
        }
        return kieFileSystem;
    }

    private Resource[] getRuleFiles() throws IOException {
        ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
        return resourcePatternResolver.getResources("classpath*:" + RULES_PATH + "**/*.*");
    }

    @Bean
    @ConditionalOnMissingBean(KieContainer.class)
    public KieContainer kieContainer() throws IOException {
        final KieRepository kieRepository = getKieServices().getRepository();
        kieRepository.addKieModule(kieRepository::getDefaultReleaseId);
        KieBuilder kieBuilder = getKieServices().newKieBuilder(kieFileSystem());
        kieBuilder.buildAll();
        return getKieServices().newKieContainer(kieRepository.getDefaultReleaseId());
    }

    private KieServices getKieServices() {
        return KieServices.Factory.get();
    }

    @Bean
    @ConditionalOnMissingBean(KieBase.class)
    public KieBase kieBase() throws IOException {
        return kieContainer().getKieBase();
    }

    @Bean
    @ConditionalOnMissingBean(KieSession.class)
    public KieSession kieSession() throws IOException {
        KieSession kieSession = kieContainer().newKieSession();
        return kieSession;
    }

    @Bean
    @ConditionalOnMissingBean(KModuleBeanFactoryPostProcessor.class)
    public KModuleBeanFactoryPostProcessor kiePostProcessor() {
        return new KModuleBeanFactoryPostProcessor();
    }
}

在WorkflowService 中补充抽象方法。

public interface WorkflowService {

    public boolean searchProcessStatus(String instanceId);

    public void deleteProcessById(String uuid, String instanceId, String type, String reason);

    public ArrayList searchProcessUsers(String instanceId);

    public HashMap searchTaskByPage(HashMap param);

    public HashMap searchApprovalContent(String instanceId, int userId,String[] role, String type, String status);

    public HashMap searchApprovalContent(String instanceId, int userId,String[] role, String type, String status);
}

WorkflowServiceImpl中添加如下代码

@Service
public class WorkflowServiceImpl implements WorkflowService {
    ……
    @Override
    public boolean searchProcessStatus(String instanceId) {
        ProcessInstance instance = runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).singleResult();
        if (instance != null) {
            //工作流未结束
            return false;
        } else {
            //工作流已经结束
            return true;
        }
    }

    @Override
    public void deleteProcessById(String uuid, String instanceId, String type, String reason) {
        long count = runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).count();
        if (count > 0) {
            runtimeService.deleteProcessInstance(instanceId, reason);    //删除工作流
        }
        count = historyService.createHistoricProcessInstanceQuery().processInstanceId(instanceId).count();
        if (count > 0) {
            historyService.deleteHistoricProcessInstance(instanceId);   //删除工作流历史
        }
        //判断是否是会议工作流,然后删除定时器
        if (type.equals("会议申请")) {
            quartzUtil.deleteJob(uuid, "会议开始任务组");
            quartzUtil.deleteJob(uuid, "会议结束任务组");
            quartzUtil.deleteJob(uuid, "会议工作流组");
            quartzUtil.deleteJob(uuid, "创建会议室ID任务组");
        }


    }

    @Override
    public ArrayList searchProcessUsers(String instanceId) {
        List<HistoricTaskInstance> taskList = historyService.createHistoricTaskInstanceQuery().processInstanceId(instanceId).finished().list();
        ArrayList<String> list = new ArrayList<>();
        taskList.forEach(one -> {
            list.add(one.getAssignee());
        });
        return list;
    }

    @Override
    public HashMap searchTaskByPage(HashMap param) {
        ArrayList<Approval> list = new ArrayList();
        int userId = (Integer) param.get("userId");
        JSONArray role = (JSONArray) param.get("role");
        int start = (Integer) param.get("start");
        int length = (Integer) param.get("length");
        String status = (String) param.get("status");
        String creatorName = MapUtil.getStr(param, "creatorName");
        String type = MapUtil.getStr(param, "type");
        String instanceId = MapUtil.getStr(param, "instanceId");
        Long totalCount = 0L;
        List<String> assignee = new ArrayList();
        assignee.add(userId + "");
        role.forEach(one -> {
            assignee.add(one.toString());
        });

        if ("待审批".equals(status)) {
            TaskQuery taskQuery = taskService.createTaskQuery().orderByTaskCreateTime().desc()
                    .includeProcessVariables().includeTaskLocalVariables().taskAssigneeIds(assignee);
            if (StrUtil.isNotBlank(creatorName)) {
                taskQuery.processVariableValueEquals("creatorName", creatorName);
            }
            if (StrUtil.isNotBlank(type)) {
                taskQuery.processVariableValueEquals("type", type);
            }
            if (StrUtil.isNotBlank(instanceId)) {
                taskQuery.processInstanceId(instanceId);
            }
            totalCount = taskQuery.count();
            List<Task> taskList = taskQuery.listPage(start, length);
            for (Task task : taskList) {
                Map map = task.getProcessVariables();
                Approval approval = createApproval(task.getProcessInstanceId(), status, map);
                approval.setTaskId(task.getId());
                list.add(approval);
            }
        } else {
            if ("已审批".equals(status)) {
                HistoricTaskInstanceQuery taskQuery = historyService.createHistoricTaskInstanceQuery()
                        .orderByHistoricTaskInstanceStartTime().desc()
                        .includeTaskLocalVariables().includeProcessVariables()
                        .taskAssigneeIds(assignee).finished().processUnfinished();
                if (StrUtil.isNotBlank(creatorName)) {
                    taskQuery.processVariableValueEquals("creatorName", creatorName);
                }
                if (StrUtil.isNotBlank(type)) {
                    taskQuery.processVariableValueEquals("type", type);
                }
                if (StrUtil.isNotBlank(instanceId)) {
                    taskQuery.processInstanceId(instanceId);
                }
                totalCount = taskQuery.count();
                List<HistoricTaskInstance> taskList = taskQuery.listPage(start, length);
                for (HistoricTaskInstance task : taskList) {
                    Map map = task.getProcessVariables();
                    Approval approval = createApproval(task.getProcessInstanceId(), status, map);
                    approval.setTaskId(task.getId());
                    list.add(approval);
                }
            } else if ("已结束".equals(status)) {
                HistoricTaskInstanceQuery taskQuery = historyService.createHistoricTaskInstanceQuery()
                        .orderByHistoricTaskInstanceStartTime().desc()
                        .includeTaskLocalVariables().includeProcessVariables()
                        .taskAssigneeIds(assignee).finished().processFinished();
                List<HistoricTaskInstance> taskList = taskQuery.listPage(start, length);
                for (HistoricTaskInstance task : taskList) {
                    Map map = task.getProcessVariables();
                    Approval approval = createApproval(task.getProcessInstanceId(), status, map);
                    approval.setTaskId(task.getId());
                    list.add(approval);
                }
            }
        }
        HashMap map = new HashMap();
        map.put("list", list);
        map.put("totalCount", totalCount);
        map.put("pageIndex", start);
        map.put("pageSize", length);
        return map;
    }

    @Override
    public HashMap searchApprovalContent(String instanceId, int userId, String[] role, String type, String status) {
        HashMap map = null;
        List<String> assignee = new ArrayList();
        assignee.add(userId + "");
        for (String one : role) {
            assignee.add(one);
        }
        if ("会议申请".equals(type)) {
            map = meetingService.searchMeetingByInstanceId(instanceId);
        } else if ("员工请假".equals(type)) {
            map = leaveService.searchLeaveByInstanceId(instanceId);
        } else if ("报销申请".equals(type)) {
            map = reimService.searchReimByInstanceId(instanceId);
        }
        Map variables;
        if (!"已结束".equals(status)) {
            variables = runtimeService.getVariables(instanceId);
        } else {
            HistoricTaskInstance instance = historyService.createHistoricTaskInstanceQuery()
                    .includeTaskLocalVariables().includeProcessVariables().processInstanceId(instanceId).taskAssigneeIds(assignee).processFinished().list().get(0);
            variables = instance.getProcessVariables();
        }
        if (variables != null && variables.containsKey("files")) {
            ArrayNode files = (ArrayNode) variables.get("files");
            map.put("files", files);
        }

//        map.put("list", variables.get("list"));
        ProcessInstance instance = runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).singleResult();
        if (instance != null) {
            map.put("result", "");
        } else {
            map.put("result", variables.get("result"));
        }
        return map;
    }
    
    private Approval createApproval(String processId, String status, Map map) {
        String type = (String) map.get("type");
        String createDate = (String) map.get("createDate");
        boolean filing = (Boolean) map.get("filing");

        Approval approval = new Approval();
        approval.setCreatorName(map.get("creatorName").toString());
        approval.setProcessId(processId);
        approval.setType(type);
        approval.setTitle(map.get("title").toString());
        approval.setStatus(status);
        approval.setCreateDate(createDate);
        approval.setFiling(filing);
        approval.setResult(MapUtil.getStr(map, "result"));
        return approval;
    }
    @Override
    public void approvalTask(HashMap param) {
        taskService.complete(taskId);
    }
}

编写Web方法之前,需要创建若干Form类

@Data
public class SearchProcessStatusForm {
    @NotBlank(message = "instanceId不能为空")
    private String instanceId;

    @NotBlank(message = "code不能为空")
    private String code;

    @NotBlank(message = "tcode不能为空")
    @Pattern(regexp = "^[0-9]{6}$",message = "tcode必须是6位数字")
    private String tcode;
}
@Data
public class DeleteProcessByIdForm {
    @NotBlank(message = "instanceId不能为空")
    private String instanceId;

    @NotBlank(message = "type不能为空")
    private String type;

    @NotBlank(message = "reason不能为空")
    private String reason;

    @NotBlank(message = "code不能为空")
    private String code;

    private String uuid;

    @NotBlank(message = "tcode不能为空")
    @Pattern(regexp = "^[0-9]{6}$",message = "tcode必须是6位数字")
    private String tcode;
}

@Data
public class SearchProcessUsersForm {
    @NotBlank(message = "instanceId不能为空")
    private String instanceId;

    @NotBlank(message = "code不能为空")
    private String code;

    @NotBlank(message = "tcode不能为空")
    @Pattern(regexp = "^[0-9]{6}$",message = "tcode必须是6位数字")
    private String tcode;
}

@Data
public class SearchApprovalContentForm {
    @NotBlank(message = "instanceId不能为空")
    @Pattern(regexp = "^[0-9A-Za-z\\-]{36}$", message = "instanceId内容不正确")
    private String instanceId;

    @NotNull(message = "userId不能为空")
    @Min(value = 1, message = "userId不能小于1")
    private Integer userId;

    @NotEmpty(message = "role不能为空")
    private String[] role;

    @NotBlank(message = "type不能为空")
    @Pattern(regexp = "^员工请假$|^会议申请$|^报销申请$", message = "type内容不正确")
    private String type;

    @NotBlank(message = "status不能为空")
    @Pattern(regexp = "^待审批$|^已审批$|^已结束$", message = "status内容不正确")
    private String status;

    @NotBlank(message = "code不能为空")
    private String code;

    @NotBlank(message = "tcode不能为空")
    @Pattern(regexp = "^[0-9]{6}$",message = "tcode必须是6位数字")
    private String tcode;
}

@Data
public class SearchTaskByPageForm {

    @NotNull(message = "userId不能为空")
    @Min(value = 1, message = "userId不能小于1")
    private Integer userId;

    @NotEmpty(message = "role不能为空")
    private String[] role;

    @NotNull(message = "page不能为空")
    @Min(value = 1, message = "page不能小于1")
    private Integer page;

    @NotNull(message = "length不能为空")
    @Range(min = 10, max = 100, message = "length必须在10~100之间")
    private Integer length;

    @Pattern(regexp = "^员工请假$|^会议申请$|^报销申请$", message = "type内容不正确")
    private String type;

    @NotBlank(message = "status不能为空")
    @Pattern(regexp = "^待审批$|^已审批$|^已结束$", message = "status内容不正确")
    private String status;

    @Pattern(regexp = "^[\\e4e00-\\u9fa5]{2,20}$", message = "creatorName内容不正确")
    private String creatorName;

    @Pattern(regexp = "^[0-9A-Za-z\\-]{36}$", message = "instanceId内容不正确")
    private String instanceId;

    @NotBlank(message = "code不能为空")
    private String code;

    @NotBlank(message = "tcode不能为空")
    @Pattern(regexp = "^[0-9]{6}$",message = "tcode必须是6位数字")
    private String tcode;

}

@Data
public class StartLeaveProcessForm {
    @NotNull(message = "creatorId不能为空")
    @Min(value = 1, message = "creatorId不能小于1")
    private Integer creatorId;

    @NotBlank(message = "creatorName不能为空")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{2,15}$", message = "creatorName内容不正确")
    private String creatorName;

    @NotBlank(message = "title不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9fa5]{2,30}$", message = "title内容不正确")
    private String title;

    @NotNull(message = "gmId不能为空")
    @Min(value = 1, message = "gmId不能小于1")
    private Integer gmId;

    @NotNull(message = "managerId不能为空")
    @Min(value = 1, message = "managerId不能小于1")
    private Integer managerId;

    @NotNull(message = "days不能为空")
    private Double days;

    @NotBlank(message = "url不能为空")
    private String url;

    @NotBlank(message = "code不能为空")
    private String code;

    @NotBlank(message = "tcode不能为空")
    @Pattern(regexp = "^[0-9]{6}$",message = "tcode必须是6位数字")
    private String tcode;
}

@Data
public class StartReimProcessForm {
    @NotNull(message = "creatorId不能为空")
    @Min(value = 1, message = "creatorId不能小于1")
    private Integer creatorId;

    @NotBlank(message = "creatorName不能为空")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{2,15}$", message = "creatorName内容不正确")
    private String creatorName;

    @NotBlank(message = "title不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9fa5]{2,30}$", message = "title内容不正确")
    private String title;

    @NotNull(message = "gmId不能为空")
    @Min(value = 1, message = "gmId不能小于1")
    private Integer gmId;

    @NotNull(message = "managerId不能为空")
    @Min(value = 1, message = "managerId不能小于1")
    private Integer managerId;

    @NotBlank(message = "url不能为空")
    private String url;

    @NotBlank(message = "code不能为空")
    private String code;

    @NotBlank(message = "tcode不能为空")
    @Pattern(regexp = "^[0-9]{6}$",message = "tcode必须是6位数字")
    private String tcode;
}

@RestController
@RequestMapping("/workflow")
public class WorkFlowController {

    ……

    /**
     * 查询工作流是否完成
     */
    @PostMapping("/searchProcessStatus")
    public R searchProcessStatus(@Valid @RequestBody SearchProcessStatusForm form) {
       
        boolean bool = workflowService.searchProcessStatus(form.getInstanceId());
        if (bool == false) {
            //工作流未结束
            return R.ok().put("result", "未结束");
        } else {
            //工作流已经结束
            return R.ok().put("result", "已结束");
        }
    }

    /**
     * 删除工作流
     */
    @PostMapping("/deleteProcessById")
    public R deleteProcessById(@Valid @RequestBody DeleteProcessByIdForm form) {
        
        workflowService.deleteProcessById(form.getUuid(), form.getInstanceId(), form.getType(), form.getReason());
        return R.ok();

    }

    /**
     * 查询已经结束工作流实例中所有的用户
     */
    @PostMapping("/searchProcessUsers")
    public R searchProcessUsers(@Valid @RequestBody SearchProcessUsersForm form) {
       
        ArrayList list = workflowService.searchProcessUsers(form.getInstanceId());
        return R.ok().put("result", list);
    }

    @PostMapping("/searchTaskByPage")
    public R searchTaskByPage(@Valid @RequestBody SearchTaskByPageForm form) {
        
        int page = form.getPage();
        int length = form.getLength();
        int start = (page - 1) * length;
        HashMap param = JSONUtil.parse(form).toBean(HashMap.class);
        param.remove("page");
        param.put("start", start);
        HashMap map = workflowService.searchTaskByPage(param);
        return R.ok().put("page", map);
    }

    @PostMapping("/searchApprovalContent")
    public R searchApprovalContent(@Valid @RequestBody SearchApprovalContentForm form) {
        
        HashMap map = workflowService.searchApprovalContent(form.getInstanceId(), form.getUserId(), form.getRole(), form.getType(), form.getStatus());
        return R.ok().put("content", map);
    }
    
   @PostMapping("/searchApprovalBpmn")
    public void searchApprovalBpmn(@Valid @RequestBody SearchApprovalBpmnForm form, HttpServletResponse response) {
        response.setContentType("image/jpg");
        TaskService taskService = processEngine.getTaskService();
        Task task = taskService.createTaskQuery().processInstanceId(form.getInstanceId()).singleResult();
        BpmnModel bpmnModel;
        List activeActivityIds;
        if (task != null) {
            //流程定义
            bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId());
            activeActivityIds = runtimeService.getActiveActivityIds(task.getExecutionId());
        } else {
            HistoricTaskInstance taskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(form.getInstanceId()).list().get(0);
            bpmnModel = repositoryService.getBpmnModel(taskInstance.getProcessDefinitionId());
            activeActivityIds = new ArrayList<>();
        }

        Map map = bpmnModel.getItemDefinitions();
        DefaultProcessDiagramGenerator diagramGenerator = new DefaultProcessDiagramGenerator();
        //绘制bpmnModel代表的流程的流程图
        String os = System.getProperty("os.name").toLowerCase();
        String font = "SimSun";
        if (os.startsWith("win")) {
            font = "宋体";
        }
        try (InputStream in = diagramGenerator.generateDiagram(bpmnModel, "jpg", activeActivityIds, activeActivityIds,
                font, font, font,
                processEngine.getProcessEngineConfiguration().getProcessEngineConfiguration().getClassLoader(), 1.0);
             BufferedInputStream bin = new BufferedInputStream(in);
             OutputStream out = response.getOutputStream();
             BufferedOutputStream bout = new BufferedOutputStream(out);
        ) {
            IOUtils.copy(bin, bout);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
        @PostMapping("/startLeaveProcess")
    public R startLeaveProcess(@Valid @RequestBody StartLeaveProcessForm form) {
        HashMap param = JSONUtil.parse(form).toBean(HashMap.class);
        param.put("filing", false);
        param.put("type", "员工请假");
        param.put("createDate", DateUtil.today());
        String instanceId = workflowService.startLeaveProcess(param);
        return R.ok().put("instanceId", instanceId);
    }

    @PostMapping("/startReimProcess")
    public R startReimProcess(@Valid @RequestBody StartReimProcessForm form) {

        HashMap param = JSONUtil.parse(form).toBean(HashMap.class);
        param.put("filing", false);
        param.put("type", "报销申请");
        param.put("createDate", DateUtil.today());

        param.remove("code");

        String instanceId = workflowService.startReimProcess(param);
        return R.ok().put("instanceId", instanceId);
    }
}
第一章 搭建开发环境
1-1 导学 1-2 搭建开发环境 1-3 MacOS环境的程序安装 1-4 本课程学习方法介绍 1-5 本章总结
第二章 运行项目工程
2-1 本章介绍 2-2 运行工作流项目 2-3 运行后端SpringBoot项目 2-4 运行移动端和前端项目 2-5 前后端项目分析 2-6 前端页面布局设计 2-7 本章总结
第三章 用户管理模块
3-1 本章介绍 3-2 用户登陆系统的流程说明 3-3 编写用户登陆程序(后端) 3-4 编写用户登陆程序(前端) 3-5 修改密码和退出登陆(后端) 3-6 修改密码和退出登陆(前端) 3-7 查询用户分页数据(后端) 3-8 查询用户分页数据(前端) 3-9 添加新用户(后端) 3-10 添加新用户(前端) 3-11 修改用户信息(后端) 3-12 修改用户信息(前端) 3-13 删除非管理员帐户(后端) 3-14 删除非管理员帐户(前端) 3-15 本章总结
第四章 角色管理
4-1 本章介绍 4-2 查询角色分页数据(后端) 4-3 查询角色分页数据(前端) 4-4 添加新角色(后端) 4-5 添加新角色(前端) 4-6 修改角色信息(后端) 4-7 修改角色信息(前端) 4-8 删除非内置角色(后端) 4-9 删除非内置角色(前端) 4-10 本章总结
第五章 部门管理
5-1 本章介绍 5-2 查询部门分页数据(后端) 5-3 查询部门分页数据(前端) 5-4 添加新部门(后端) 5-5 添加新部门(前端) 5-6 修改部门信息(后端) 5-7 修改部门信息(前端) 5-8 删除无用户的部门(后端) 5-9 删除无用户的部门(前端) 5-10 本章总结
第六章 会议室管理
6-1 本章介绍 6-2 查询会议室分页数据(后端) 6-3 查询会议室分页数据(前端) 6-4 添加新会议室(后端) 6-5 添加新会议室(前端) 6-6 修改会议室信息(后端) 6-7 修改会议室信息(前端) 6-8 删除空闲的会议室(后端) 6-9 删除空闲会议室(前端) 6-10 本章总结
第七章 线下会议管理
7-1 本章介绍 7-2 线下会议日程表(持久层) 7-3 线下会议日程表(业务层&Web层) 7-4 分析线下会议日程表前端设计 7-5 线下会议日程表(前端) 7-6 分析会议申请的执行流程 7-7 用异步线程开启线下会议审批流程 7-8 创建线下会议申请(后端) 7-9 创建线下会议申请(前端) 7-10 线下会议周日历(后端) 7-11 线下会议周日历(前端) 7-12 周日历弹窗浏览会议详情(前端) 7-13 删除线下会议申请(后端) 7-14 删除线下会议申请(前端) 7-15 本章总结 附-1 查询线上会议分页数据(后端) 附-2 查询线上会议分页数据(前端) 附-3 申请线上会议(前端) 附-4 删除线上会议申请(前端)
第八章 会议审批
8-1 章节介绍 8-2 查询会议申请分页数据(后端) 8-3 查询会议申请分页数据(前端) 8-4 查询审批任务详情信息(后端) 8-5 查询审批任务详情信息(前端) 8-6 加载BPMN实时进度图 8-7 审批会议申请(后端) 8-8 审批会议申请(前端) 8-9 本章总结
第九章 TRTC在线视频会议
9-1 本章介绍 9-2 获取用户签名和视频会议室RoomID 9-3 查询参会人,生成视频墙(后端) 9-4 生成视频会议室视频墙(前端) 9-5 如何创建TRTC视频推流 9-6 推送本地视频流,订阅远端视频流 9-7 实现入会签到功能 9-8 实时更新上线参会人列表 9-9 动态显示参会人语音强弱 9-10 挂断TRTC,退出视频会议 9-11 大屏显示某个远端视频 9-12 本地屏幕共享,广播推流 9-13 本章总结
第十章 罚款管理
10-1 本章介绍 10-2 查询罚款分页数据(后端) 10-3 查询罚款分页数据(前端) 10-4 添加新罚款记录(后端) 10-5 添加新罚款记录(前端) 10-6 修改罚款单(后端) 10-7 修改罚款单(前端) 10-8 删除罚款单(后端) 10-9 删除罚款单(前端) 10-10 了解微信Native支付罚款流程 10-11 设置内网穿透,用于接收付款结果 10-12 创建支付订单(持久层&业务层) 10-13 创建支付订单(Web层) 10-14 创建支付订单(前端) 10-15 接收付款结果(后端) 10-16 配置SpringBoot支持WebSo 10-17 推送付款结果 10-18 接收付款结果(前端) 10-19 主动查询付款结果(后端) 10-20 主动查询付款结果(前端) 10-21 本章总结 附-1 查询图表数据(后端) 附-2 显示图表数据(前端)
第十一章 罚款类型管理
11-1 本章介绍 11-2 查询罚款类别分页数据(后端) 11-3 查询罚款类别分页数据(前端) 11-4 添加新罚款类型(后端) 11-5 添加新罚款类型(前端) 11-6 修改罚款类型信息(后端) 11-7 修改罚款类型信息(前端) 11-8 删除罚款类型记录(后端) 11-9 删除罚款类型记录(前端) 11-10 本章总结
第十二章 请假管理
12-1 本章介绍 12-2 查询请假分页数据(后端) 12-3 查询请假分页数据(前端) 12-4 用异步线程开启请假审批 12-5 我要请假(后端) 12-6 我要请假(前端) 12-7 用异步线程关闭请假审批工作流实例 12-8 删除请假申请(后端) 12-9 删除请假申请(前端) 12-10 审批员工请假 12-11 生成请假单(后端) 12-12 生成请假单(前端) 12-13 封装腾讯云存储服务 12-14 执行请假归档(后端) 12-15 上传归档文件(前端) 12-16 执行请假归档(前端) 12-17 本章总结
第十三章 报销管理
13-1 本章介绍 13-2 查询报销分页数据(后端) 13-3 查询报销分页数据(前端) 13-4 用异步线程开启报销审批 13-5 创建报销申请(后端) 13-6 创建报销申请(前端) 13-7 生成PDF报销单(后端) 13-8 生成PDF报销单(前端) 13-9 审批报销申请 13-10 删除报销申请(后端) 13-11 删除报销申请(前端) 13-12 本章总结
第十四章 部署Emos项目
14-1 本章介绍 14-2 选购云主机 14-3 安装Docker环境 14-4 Docker中安装程序 14-5 在Docker中部署Java项目 14-6 在Docker中部署前端项目 14-7 本章总结 附录1 为云主机配置域名
第十五章 扩展功能
15-1 微信扫码登陆(后端生成二维码图片) 15-2 微信扫码登陆(前端加载二维码) 15-3 微信扫码登陆(微信小程序) 15-4 NFC扫码功能简介 15-5 NFC扫码识别
第十六章 员工离职
16-1 员工离职(一) 16-2 员工离职(二) 16-3 调试员工离职功能
第十七章 工作流
17-1 Activiti简介 17-2 创建工作流项目 17-3 BPMN入门 17-4 任务审批 16-5 会议审批工作流(一) 16-6 会议审批工作流(二) 16-7 审批工作流
附录
附录1 创建SpringBoot项目 附录2 集成常用工具库 附录3 整合权限验证与授权 附录4 允许跨域请求 附录5 封装全局异常 附录6 全局处理异常 附录7 开启Java异步执行 附录8 抵御XSS攻击 附录9 创建分页数据封装类