自定义审批处理页面原创
2人赞赏了该文章
169次浏览
未经作者许可,禁止转载编辑于2024年05月13日 10:17:02
需求:当平台审批处理页面无法满足需求时,可以自定义处理页面
一、PC端审批处理页面
1.继承模版“wf_pcprocesspagetpl”
2.bos设计开发
3.初始化代码案例
public void afterCreateNewData(EventObject e) { super.afterCreateNewData(e); Map<String, Map<String, String>> reTaskInfo = (Map) SerializationUtils.fromJsonString(this.getPageCache().get("relateTaskInfos"), Map.class); this.getView().setVisible(Boolean.FALSE, new String[]{"patentaudit", "schemeaudit", "priceaudit", "expertaudit"}); if (reTaskInfo != null) { Iterator var3 = reTaskInfo.entrySet().iterator(); while (var3.hasNext()) { Map.Entry<String, Map<String, String>> entry = (Map.Entry) var3.next(); Map<String, String> item = (Map) entry.getValue(); String identityKey = (String) item.get("bizIdentifyKey"); if (identityKey != null && identityKey.length() > 0) { this.getView().setVisible(Boolean.TRUE, new String[]{identityKey.substring(5)}); } } } //审批记录 this.updateRecrod(); } public void registerListener(EventObject e) { this.addClickListeners(new String[]{"mdnb_submit", "addcomment", "updaterecord"}); } private void updateRecrod() { List<IApprovalRecordGroup> allApprovalRecord = WorkflowServiceHelper.getAllApprovalRecord(this.getPageCache().get("businesskey")); ApprovalRecord approvalRecord = (ApprovalRecord) this.getControl("approvalrecordap"); Map<String, Object> parameters = new HashMap(); parameters.put("hideMoreChat", ""); parameters.put("isPC", "true"); parameters.put("approvalIsNew", Boolean.TRUE); approvalRecord.setParameters(parameters); approvalRecord.setArData(allApprovalRecord); }
二、移动端审批处理页面
1.继承模版“wf_pcprocesspagetpl”
2.bos设计开发
3.初始化可参考:kd.bos.workflow.taskcenter.plugin.ApprovalPageMobPlugin
三、处理流程任务
public static final String AUDIT_MESSAGE = "auditMessage"; public static final String AUDIT_NUMBER = "auditNumber"; public static final String AUDIT_TYPE = "auditType"; //taskid String taskId = String.valueOf(WorkflowServiceHelper.getTaskIdByBusinessKeyAndUserId("businessKey", "userId")); //同意 Map<String, Object> variable = new HashMap(); variable.put(AUDIT_MESSAGE, ResManager.loadKDString(String.valueOf(auditBuffer), "WfPcProcesspage_0", "bos-wf-unittest", new Object[0])); variable.put(AUDIT_NUMBER, "Consent"); variable.put(AUDIT_TYPE, WFDecisionOption.AUDIT_TYPE_APPROVE); variables.put(Long.valueOf(taskId), variable); WorkflowServiceHelper.batchCompleteCompositeTasks(variables); //终止 Map<String, Object> variable = new HashMap(); variable.put(AUDIT_MESSAGE, ResManager.loadKDString(String.valueOf(auditBuffer), "WfPcProcesspage_1", "bos-wf-unittest", new Object[0])); variable.put(AUDIT_NUMBER, WFDecisionOption.AUDIT_TYPE_TERMINATE); variable.put(AUDIT_TYPE, WFDecisionOption.AUDIT_TYPE_TERMINATE); variable.put("dynType", "auditAbort"); variables.put(Long.valueOf(taskId), variable); WorkflowServiceHelper.batchCompleteCompositeTasks(variables);
推荐阅读