// 审核 public String auditTechReport() { String id = ((String[]) formMap.get("id"))[0] + ""; String workflowId = ((String[]) formMap.get("workflowId"))[0] + ""; // 存放workflowid String ifBackFlag = ((String[]) formMap.get("ifBackFlag"))[0] + ""; String checkContent = ((String[]) formMap.get("checkContent"))[0] + ""; if (ifBackFlag.equals("1")) { TechReptDef instance = techReptDefService.get(Long.parseLong(id)); // 更新审核人 List<ReptTechDtl> reptTechDtls = instance.getReptTechDtl(); for (int i = 0; i < reptTechDtls.size(); i++) { ReptTechDtl rtd = reptTechDtls.get(i); rtd.setGovernor(getCurUser().getName()); } techReptDefService.save(instance); if (checkContent == null) { checkContent = "批准审核"; } workFlowService.endTaskInstance( Long.parseLong(workflowId), getCurUser().getName(), checkContent); } else { if (checkContent == null) { checkContent = "驳回审核"; } workFlowService.endTaskInstance(Long.parseLong(workflowId), "驳回", getCurUser(), checkContent); } return "backToTop"; }
// 初始填报 public String submitTechReport() { // 添加更新时间和更新人 String id = ((String[]) formMap.get("id"))[0] + ""; TechReptDef instance = techReptDefService.get(Long.parseLong(id)); instance.setReptFlag(true); techReptDefService.save(instance); startWorkFlow(instance); return "backToTop"; }
// 新建流程并提交 public void startWorkFlow(TechReptDef instance) { Person person = getCurUser(); // 任务描述 String discription = "上报时间:" + DateUtil.dateToString(instance.getUpdDate(), DateUtil.FORMAT) + ",报表名称:" + instance.getName(); workFlowService.startProcessInstance( ProcessEnum.REPT_TECH.getDataSource(), instance.getId() + "", discription, person, "提交审核", person.getDept(), FunModule.ACCD); }
@Override public String load() { try { TechReptDef instance = new TechReptDef(); if (formMap.get("startDate") != null && !(((String[]) formMap.get("startDate"))[0]).equals("")) { instance.setStartDate( DateUtil.stringToDate(((String[]) formMap.get("startDate"))[0] + "", DateUtil.FORMAT)); } if (((formMap.get("endDate"))) != null && !(((String[]) formMap.get("endDate"))[0]).equals("")) { instance.setEndDate( DateUtil.stringToDate(((String[]) formMap.get("endDate"))[0] + "", DateUtil.FORMAT)); } // 更新人不能为空 instance.setReptFlag(true); // 列表中的一定是编辑过的 techReptDefService.findByInstance(instance, carrier); } catch (Exception e) { e.printStackTrace(); } return GRID; }