/** * 完成任务 * * @param taskId 任务ID * @param procInsId 流程实例ID,如果为空,则不保存任务提交意见 * @param comment 任务提交意见的内容 * @param vars 任务流程变量,如下 vars.keys=flag,pass vars.values=1,true vars.types=S,B @see * com.thinkgem.jeesite.modules.act.utils.PropertyType */ @RequestMapping(value = "complete") @ResponseBody public String complete(Act act) { actTaskService.complete( act.getTaskId(), act.getProcInsId(), act.getComment(), act.getVars().getVariableMap()); return "true"; // adminPath + "/act/task"; }
/** * 启动流程 * * @param procDefKey 流程定义KEY * @param businessTable 业务表表名 * @param businessId 业务表编号 */ @RequestMapping(value = "start") @ResponseBody public String start(Act act, String table, String id, Model model) throws Exception { actTaskService.startProcess( act.getProcDefKey(), act.getBusinessId(), act.getBusinessTable(), act.getTitle()); return "true"; // adminPath + "/act/task"; }
/** * 获取流转历史列表 * * @param procInsId 流程实例 * @param startAct 开始活动节点名称 * @param endAct 结束活动节点名称 */ @RequestMapping(value = "histoicFlow") public String histoicFlow(Act act, String startAct, String endAct, Model model) { if (StringUtils.isNotBlank(act.getProcInsId())) { List<Act> histoicFlowList = actTaskService.histoicFlowList(act.getProcInsId(), startAct, endAct); model.addAttribute("histoicFlowList", histoicFlowList); } return "modules/act/actTaskHistoricFlow"; }
/** * 签收任务 * * @param taskId 任务ID */ @RequestMapping(value = "claim") @ResponseBody public String claim(Act act) { String userId = UserUtils.getUser().getLoginName(); // ObjectUtils.toString(UserUtils.getUser().getId()); actTaskService.claim(act.getTaskId(), userId); return "true"; // adminPath + "/act/task"; }
/** * 获取流程表单 * * @param taskId 任务ID * @param taskName 任务名称 * @param taskDefKey 任务环节标识 * @param procInsId 流程实例ID * @param procDefId 流程定义ID */ @RequestMapping(value = "form") public String form(Act act, HttpServletRequest request, Model model) { // 获取流程XML上的表单KEY String formKey = actTaskService.getFormKey(act.getProcDefId(), act.getTaskDefKey()); // 获取流程实例对象 if (act.getProcInsId() != null) { act.setProcIns(actTaskService.getProcIns(act.getProcInsId())); } return "redirect:" + ActUtils.getFormUrl(formKey, act); // // 传递参数到视图 // model.addAttribute("act", act); // model.addAttribute("formUrl", formUrl); // return "modules/act/actTaskForm"; }