// 审核 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 String toSubmitTechReport() { String id = reptTime; TechReptDef tech = techReptDefService.get(Long.parseLong(id)); List dirList = paraDtlService.get(Dir.class); for (int i = 0; i < dirList.size(); i++) { Dir d = (Dir) dirList.get(i); if (d.getParaCode().equalsIgnoreCase("TECH")) { formMap.put("TECHPara", d.getCodeDesc()); } if (d.getParaCode().equalsIgnoreCase("PATT")) { formMap.put("PATTPara", d.getCodeDesc()); } } formMap.put("dirList", dirList); formMap.put("tech", tech); return "toSubmitTechReport"; }
// 初始详细信息界面 public String toPreviewTechReport() { if (formMap.get("id") != null) { id = Long.parseLong(((String[]) formMap.get("id"))[0] + ""); // 获取id } TechReptDef tech = techReptDefService.get(id); List dirList = paraDtlService.get(Dir.class); for (int i = 0; i < dirList.size(); i++) { Dir d = (Dir) dirList.get(i); if (d.getParaCode().equalsIgnoreCase("TECH")) { formMap.put("TECHPara", d.getCodeDesc()); } if (d.getParaCode().equalsIgnoreCase("PATT")) { formMap.put("PATTPara", d.getCodeDesc()); } } formMap.put("dirList", dirList); formMap.put("tech", tech); return "toPreviewTechReport"; }
// 初始审核界面 public String toAuditTechReport() { TechReptDef tech = techReptDefService.get(id); List dirList = paraDtlService.get(Dir.class); for (int i = 0; i < dirList.size(); i++) { Dir d = (Dir) dirList.get(i); if (d.getParaCode().equalsIgnoreCase("TECH")) { formMap.put("TECHPara", d.getCodeDesc()); } if (d.getParaCode().equalsIgnoreCase("PATT")) { formMap.put("PATTPara", d.getCodeDesc()); } } String workflowId = taskId + ""; formMap.put("workflowId", workflowId); List<String> comments = workFlowService.getComments(taskId + ""); formMap.put("comments", comments); formMap.put("dirList", dirList); formMap.put("tech", tech); return "toAuditTechReport"; }
@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; }