天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 2496|回复: 0

[Iscript] 表单显示流程处理历史实例【Iscript-表单显示流程处理历史】

[复制链接]
purple 发表于 2013-2-6 11:42:18 | 显示全部楼层 |阅读模式
本帖最后由 kimi 于 2013-12-8 18:08 编辑

  1. function testhis(){
  2. var message="<table cellSpacing='0' cellPadding='1' width='100%' align='center' style='border:solid #cccccc;border-width:2px 0px 0px 2px;'><tbody><tr style='line-height:22px;'><td width=25%'  style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;' >办理人(部门)</td><td width='50%' style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'  >办理意见</td><td width='25%' style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;' >办理时间</td></tr>";           
  3. var applicationId=getApplication();//获取应用id
  4. var docid=getId();//获取文档id
  5. var doc=getCurrentDocument();//获取当前文档对象
  6. var flowStateId=doc.getStateid();//当前流程实例ID
  7. var hisProcess =  new Packages.cn.myapps.core.workflow.storage.runtime.ejb.RelationHISProcessBean(applicationId);  //流程历史处理类                       
  8. var hisList = hisProcess.doAllQueryByDocIdAndFlowStateId(docid, flowStateId);//根据文档id与流程实例id返回对应的流程历史集合
  9. println(hisList.size()+"     ====流程历史集合====");
  10. for(var iter = hisList.iterator();hisList!=null && iter.hasNext();){
  11.     var relHis = iter.next();
  12.     if (relHis.getActorhiss().size() > 0) {
  13.             println(relHis.getActorhiss().size()+" =====总共审批人数=====");
  14.         for(var iterator = relHis.getActorhiss().iterator(); iterator.hasNext();) {
  15.            println("1111111111");
  16.                    var actorHis = iterator.next();
  17.             //流程处理人部门信息
  18.             var depprocess=getDepartmentProcess();//部门处理类
  19.             var userid = actorHis.getActorid();//用户id
  20.             var user =  getUserById(userid);//用户对象
  21.             var dname ="";
  22.             if(user!= null ){
  23.                 var depart = depprocess.doView(user.defaultDepartment);//部门对象
  24.                 if(depart != null){
  25.                     dname = depart.getName();//部门名称
  26.                 }
  27.             }                    

  28.             // 流程处理人
  29.             var agname="";
  30.             if(actorHis.getAgentname()!=null && actorHis.getAgentname().trim().length()>0){
  31.                 agname=actorHis.getAgentname()+"("+actorHis.getName()+")"+"("+dname+")";
  32.             }
  33.                         else{
  34.                     agname=actorHis.getName()+"("+dname+")";
  35.             }
  36.             println(agname+"   ======审批人名称===");                       
  37.             // 审批意见
  38.             var attitude = "";
  39.             if (actorHis.getAttitude() != null&& actorHis.getAttitude().length() > 0) {
  40.                 attitude = actorHis.getAttitude();
  41.             }else{
  42.                     attitude="&nbsp";
  43.             }
  44.             // 审批时间
  45.             var pocesstime = "";
  46.             var dateutil=new Packages.cn.myapps.util.DateUtil();
  47.             if (actorHis.getProcesstime() != null) {
  48.                 pocesstime = dateutil.getDateTimeStr(actorHis.getProcesstime());               
  49.             }else{
  50.                     pocesstime = dateutil.getDateTimeStr(relHis.getActiontime());
  51.             }                                      
  52.             message += "<tr style='line-height:22px;'><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+agname+"</td><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+attitude+"</td><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+pocesstime+"</td></tbody></tr>";
  53.                 }
  54.     }
  55.         else{
  56.           message += "<tr style='line-height:22px;'><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+relHis.getAuditor()+"</td><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+relHis.getActiontime()+"</td><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+relHis.getAttitude()+"</td></tbody></tr>";  
  57.     }                       
  58. }
  59. return message;
  60. }
复制代码
调用语句:

  1. #include "flowHis";//flowHis函数库名称
  2. testhis();
复制代码

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-12 16:13

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表