if (n > 1) {
// 有分支节点,提交到选择节点的页面
message = "选择节点";
for(int it=0;it<n;it++){
TwflDirection tempdirection = (TwflDirection) directionset.toArray()[it];
TwflNode tonode = tempdirection.getToNode();
// 处理历史记录
TfeeFeehistory history = new TfeeFeehistory();
history.setTfeeFeeapply(feeapply);
history.setDomessage("");
history.setDodate(new java.sql.Timestamp(System.currentTimeMillis()));
history.setNode(curnode);
history.setUserid(curuser.getUserid());
history.setUsername(curuser.getUsername());
String mark = "";
// 处理人职务
TsysPosition position = tonode.getTsysPosition();
// 获取处理人
TsysUser hotman = SystemFunction.getPositionUser(session, position,feeapply.getDepartmentid());
System.out.println("------------++++------------"+hotman+"---"+it);
// 获取不到处理人 则跳过此节点处理
if (hotman == null) {
// 跳过此节点处理下一节点
// 历史记录
mark = "节点" + tonode.getNodename() + "处未找到对应的处理人,跳过了此节点!";
history.setMark(mark);
session.save(history);
nodeid = tonode.getNodeid();
message = "跳过节点";
return "tonext";
}
//如果费用已经被审批 跳过领导节点
if(tonode.isLeadercheck()&&feeapply.getCheckstatus()==1)
{
feeapply.setLeaders(feeapply.getLeaders()+hotman.getUserid()+",");
String depposions=null; //记录标识 区分部门审批费用
if(posionid>0&&dodepid>0)
depposions=dodepid+"-"+posionid+",";
if(depposions!=null)
feeapply.setDeppositions(feeapply.getDeppositions()+depposions);
mark = "节点" + tonode.getNodename() + "因流程已经被审批通过,跳过了该领导审批节点!";
history.setMark(mark);
session.save(history);
session.save(feeapply);
nodeid = tonode.getNodeid();
// 添加消息提醒
// @param docstatus int docstatus==1 急件 docstatus==2 办件 docstatus==3 阅件
String subject = feeapply.getUsername() + "的" + feeapply.getTfeeType().getTypename() + "申请 审批通过提醒";
String flowstep = tonode.getNodename();
String url = "../feeapply/feeapplyDoView.action?feeapplyid=" + feeapply.getFeeapplyid();
int waitid = WaitWork.Sendwait(session, hotman, subject, url, 3, curuser.getUsername(), flowstep, "");
InfoSend.SendInfoToUser(session,hotman,subject,7,0);
return "tonext";
}
session.save(feeapply);
message = "提交到 " + tonode.getNodename() + " " + hotman.getUsername() + " 成功";
return "success"+it;
}
return "success";
//return "toselect";