法律事务项目源码梳理

登录页面:

form表单提交到loginAction, userid password 

<input type="hidden" name="exitFlag" id="exitFlag" value="<s:property value='exitFlag'/>"/>

调用loginAction 中 login方法

通过登录的id在我们的数据库中查找并验证密码

	                        if(user.getUserPassword().equals(this.password))//判断用户密码
				{
					Map session=ServletActionContext.getContext().getSession();	
					session.put("loginUser", user);
					session.put("userid", this.userid);
					session.put("username", user.getUserName());
					session.put("userdepid",user.getDepartment().getDepId());
					session.put("userdep",user.getDepartment().getDepName());
					session.put("userrole",user.getSystemRole().getSrName());
					session.put("role", user.getSystemRole().getSrreid());
					String remindString="欢迎使用";
					session.put("remind", remindString);
					//右下角弹出框,提示待办信息
					NotFinish(session);
					//获取一级权限
					GetUsersPrimaryFunction();
					return "success";
				} 
将用户信息存入session

NotFinish(session);

初始化部分分页字段:

<span style="white-space:pre">				</span>this.setCurrent_pagenum(1);
				this.setPageNum(10);
				this.setOrderbys("");
				this.setNotFinishNum(0);
				this.setNotFinishString("");
				int allNotFinishNum=0;//该用户待办委托单的总个数
通过用户ID 与节点类型查询:

<span style="white-space:pre">				</span>this.staffBeStoreList=this.getFlswDao().findBeFlswManage(user.getUserId(), this.getNODE());

getFlswDao().findBeFlswManage()

	public List findBeFlswManage(final String lawFlswRemark2,final String lawFlswNode) {
	try {
	ServletActionContext.getRequest().getSession().setAttribute("pagecount",getHibernateTemplate().find("from Flsw as model where model.lawFlswRemark2='"+lawFlswRemark2+"' and model.lawFlswNode='"+lawFlswNode+"'").size());
String queryString = "from Flsw as model where  model.lawFlswRemark2='"+lawFlswRemark2+"' and model.lawFlswNode='"+lawFlswNode+"'"+"and model.lawFlswNode!='*' and model.lawFlswNode!='**' and model.lawFlswNode!='***' and model.lawFlswNode!='****'";
	List results =getHibernateTemplate().find(queryString);
			
	return results;
		} catch (RuntimeException re) {
			log.error("find by property name failed", re);
			throw re;
		}	

	}

get HibernateTemplate().find(queryString);spring对hibernate的控制  回调函数的使用

Hibernate查询

from Flsw as model where model.lawFlswRemark2='"+lawFlswRemark2+"' and model.lawFlswNode='"+lawFlswNode+"'"

model为别名,查询Flsw表中lawFlswRemark2和lawFlswNode为给定值的记录的size赋值给pagecount并存入session

”from Flsw as model where  model.lawFlswRemark2='"+lawFlswRemark2+"' and model.lawFlswNode='"+lawFlswNode+"'"+"and model.lawFlswNode!='*' and model.lawFlswNode!='**' and model.lawFlswNode!='***' and model.lawFlswNode!='****'“

查询Flsw表中lawFlswRemark2和lawFlswNode为给定值的记录且要求lawFlswNode不为终结状态。并存入名为staffBeStoreList(员工待暂存)的Linklist对象。

Law_FLSW_Remark2:流转到人,下一个节点,处理这个flsw的用户Id;

lawFlswNode:当前节点(是否上报);

以上为查询:当前节点为020,且流转到当前用户的FLSW记录。

				if(this.getNotFinishNum() > 0)
				{
					//此类待办委托个数 > 0
					this.setNotFinishString("待重填委托:"+this.getNotFinishNum()+"个");
					session.put("inremindBeInputAgain", this.getNotFinishString());
					session.put("staffBeInputList", this.getStaffBeInputList());
					allNotFinishNum += this.getNotFinishNum();
				}
				else
				{
					session.put("inremindBeInputAgain", "");
				}

未完成数大于零,将

后续继续将所有的代办委托单(包括法律审图和法人委托);



<span style="color:#ff0000;"><strong>GetUsersPrimaryFunction();</strong></span>
GetUsersPrimaryFunction将查询的用户权限模块存入session.

在自定义标签中取出,并在top.jsp中调用标签

登录后进行框架页:

top.jsp

middle.jsp

bottom.jsp

工作流:关注节点

录入委托单:

<span style="white-space:pre">		</span>public String getInputMessage() {

		try {


			this.setLawEventId(Integer.toString(IDGenerator.getNextEventID()));//设置委托单ID
			HttpServletRequest request = ServletActionContext.getRequest();
			HttpSession session = request.getSession();//session
			users = (Users) session.getAttribute("loginUser");
			this.setUserCellphone(users.getUserCellphone());// 录入人联系方式
			this.setUserEmail(users.getUserEmail());// 录入人Email

			SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
		
			Calendar calendar = Calendar.getInstance();
			
			calendar.add(Calendar.DATE, 5);// 得到5天后的日期
			this.setLawFlswReTime(df.format(calendar.getTime()).toString());//计算出回复时间

		} catch (Exception e) {
			e.printStackTrace();
			return "fail";
		}

		return "success";
	}
准备录入界面的数据  委托单号 邮件 回复时间等;

在LawEventInput.jsp界面设置输入字段:

lawFlswName 委托单名

lawSwlxFlow 事务类型流

swlxId 事务种类

lawEventId  委托单编号

lawFlswReTime回复时间

 userCellphone联系方式

 userEmail邮箱

 lawFlswIntroduction委托内容 

lawFlswRemark备注

提交给FlswAddUpdateAction!flswAddUpdate

// 事务委托:用户单击“保存并进入下一页”按钮
	public String flswAddUpdate() {

		try {
			if (this.updateFlag.equals("update")) {
				// 暂时保存委托单

				// 因为有的用户没有录入联系方式、Email信息,所以,这里来确保这两个字段有值
				// 修改个人信息
				personInfoSave();

				// 获取用户
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				users = (Users) session.getAttribute("loginUser");
				// 获取第二页面 submittopeopleList 审核人; submittodep 提交到部门
				this.submittodep = users.getDepartment().getDepName();// 提交到用户的部门
				this.submittopeopleList = new LinkedList<Users>();存入部门领导表单
				// this.submittopeopleList=this.getUsersDao().findflowtopeople(users.getDepartment().getDepId(),
				// 3);//审核人
				// 更新 FLSW 委托单 基本信息,只更新3个字段
				flsw = this.getFlswDao().findById(this.getLawFlswId());
				if (null != flsw.getLeader()) {
					// 重填委托单时,填好后暂时保存,在重新填写提交时,提交给同一个领导
					this.submittopeopleList.add(flsw.getLeader());// 提交给同一个领导
				} else {
					// 一般暂时保存的,条件下,leader字段为空
					this.submittopeopleList = this.getUsersDao()
							.findflowtopeople3(
									users.getDepartment().getDepId(), 3);// 审核人
				}

				flsw.setLawFlswIntroduction(this.getLawFlswIntroduction());// 委托单名称
				// flsw.setLawFlswDescription(this.getLawFlswDescription());//事务描述
				flsw.setLawFlswRemark(this.getLawFlswRemark());// 备注
				flsw.setLawFlswReTime(this.getLawFlswReTime());// 要求回复时间
				flsw.setLawFlswName(this.getLawFlswName());
				flsw.setLawFlswRemark(this.getLawFlswRemark());
				this.getFlswDao().merge(flsw);
			} else if (this.updateFlag.equals("inputAgain")) {

				// 重填保存委托单
				// 因为有的用户没有录入联系方式、Email信息,所以,这里来确保这两个字段有值
				// 修改个人信息
				personInfoSave();

				// 获取用户
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				users = (Users) session.getAttribute("loginUser");
				// 获取第二页面 submittopeopleList 提交到人; submittodep 提交到部门
				this.submittodep = users.getDepartment().getDepName();// 提交到部门
				this.submittopeopleList = new LinkedList<Users>();// 提交到人

				// 更新 FLSW 委托单 基本信息,只更新4个字段
				flsw = this.getFlswDao().findById(this.getLawFlswId());
				if (null != flsw.getLeader()) {
					// 正常情况下,leader字段存储了第一次审批领导,这时,用户重填后,重新提交给同一个领导
					this.submittopeopleList.add(flsw.getLeader());// 提交给同一个领导
				} else {
					// 异常条件下,leader字段为空
					this.submittopeopleList = this.getUsersDao()
							.findflowtopeople3(
									users.getDepartment().getDepId(), 3);
				}
				flsw.setLawFlswIntroduction(this.getLawFlswIntroduction());// 委托单名称
				// flsw.setLawFlswDescription(this.getLawFlswDescription());//事务描述
				flsw.setLawFlswRemark(this.getLawFlswRemark());// 备注
				flsw.setLawFlswReTime(this.getLawFlswReTime());// 要求回复时间
				flsw.setLawFlswName(this.getLawFlswName());
				flsw.setLawFlswRemark(this.getLawFlswRemark());
				this.getFlswDao().merge(flsw);
				// 保存 FlowRecord + 更新flsw的Node、PreNode字段
				// 重填委托单时,单击“保存并进入下一页”后,则完成节点015,将进入下一个节点020,故先记录委托单从 030
				// 到010、从010到015的流程记录
				inputAgainFirstFlowRecord(flsw);

			} else {
				<span style="color:#ff0000;">// 新增保存委托单</span>

				// 因为有的用户没有录入联系方式、Email信息,所以,这里来确保这两个字段有值
				// 修改个人信息
				personInfoSave();

				// 保存 FLSW 委托单 基本信息+主管院领导审阅意见+前一个节点和现在节点

				// 获得委托单编号:206022A-2013-部门数字代码-流水号(3位)
				SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy");
				String ly_time1 = sdf1.format(new java.util.Date());
				// 获取用户
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				users = (Users) session.getAttribute("loginUser");
				String depNum = users.getDepartment().getDepRemark();// 获得部门数字代码

				// this.setLawFlswId(this.getSwlxId()+"-"+this.getLawEventId());//同时传递到第二页面
				this.setLawFlswId("206022A-" + ly_time1 + "-" + depNum + "-"
						+ this.getLawEventId());

				flsw.setLawFlswId(this.getLawFlswId());// 委托单编号
				flsw.setLawFlswEventId(this.getLawEventId());// 事件编号
				flsw.setLawFlswIntroduction(this.getLawFlswIntroduction());// 委托单名称
				flsw.setLawFlswReTime(this.getLawFlswReTime());// 要求回复时间
				flsw.setLawFlswName(this.getLawFlswName());
				flsw.setLawFlswRemark(this.getLawFlswRemark());


				this.swlx = this.swlxDao.findById(swlxId);
				flsw.setSwlx(swlx);// 事务类型
				// 获取用户
				HttpServletRequest request2 = ServletActionContext.getRequest();
				HttpSession session2 = request2.getSession();
				users = (Users) session2.getAttribute("loginUser");
				flsw.setDepartment(users.getDepartment());// 发起单位
				// 获取第二页面 submittopeopleList 提交到人; submittodep 提交到部门
				this.submittodep = users.getDepartment().getDepName();// 提交到部门
				this.submittopeopleList = new LinkedList<Users>();
				<span style="color:#ff0000;">this.submittopeopleList = this.getUsersDao().findflowtopeople3(
						users.getDepartment().getDepId(), 3);// 提交到人</span>
				flsw.setUsersByLawFlswUser(users);// 录入人
				// 获取发起人
				// this.users=this.usersDao.findById(this.getLawinitiator());
				flsw.setUsersByLawFlswCreator(users);// 发起人
				Date date = new Date();
				SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
				flsw.setLawFlswTime(df.format(date).toString());// 发起时间,即录入时间,即当前系统时间
				// flsw.setLawFlswDescription(this.getLawFlswDescription());//事务描述
				// flsw.setLawFlswRemark(this.getLawFlswRemark());//备注
				<span style="color:#ff0000;">flsw.setLawFlswRemark2(users.getUserId());// 用途:用户进入暂存委托列表时,得到此委托单;暂存委托单,用户新增委托单后,若在第二页单击“暂存委托单”</span>
				flsw.setLawOpinionYn("0");// 默认为委托单未审批,则Law_FLSW_Opinion
				// 主管院领导审阅意见 为空,不需赋值

				// this.getFlswDao().save(flsw);

				// this.getFlswDao().saveReturnString(flsw);

				flswSave = this.getFlswDao().findById(this.getLawFlswId());
				if (flswSave != null || this.getLawEventId() == null
						|| this.getLawEventId().equals("")) {
					// 委托单编号已经被别的用户抢先使用保存了,所以只能得到新的编号
					ajaxEventGetNew();
					this.setLawFlswId("206022A-" + ly_time1 + "-" + depNum
							+ "-" + this.getLawEventId());
					flsw.setLawFlswEventId(this.getLawEventId());// //新的委托单序号
					flsw.setLawFlswId(this.getLawFlswId());// 新的委托单编号
				}
				<span style="color:#ff0000;">this.getFlswDao().save(flsw);</span>

				// String s="";//标记委托单保存操作的结果:fail,保存失败;success,保存成功
				// s=this.getFlswDao().saveReturnString(flsw);//第一次保存,并得到保存操作的结果
				// while(s.equals("fail"))
				// {
				// //委托单编号已经被别的用户抢先使用保存了,所以只能得到新的编号
				// ajaxEventGetNew();
				// this.setLawFlswId("206022A-"+ly_time1+"-"+depNum+"-"+this.getLawEventId());
				// flsw.setLawFlswId(this.getLawFlswId());//委托单编号
				// //重新保存委托单,并得到其保存操作结果
				// s=this.getFlswDao().saveReturnString(flsw);
				// }

				// 保存 FlowRecord
				// 新增委托单时,单击“保存并进入下一页”后,则完成节点015,将进入下一个节点020,故先记录委托单从 $
				// 到010、从010到015的流程记录
				<span style="color:#ff0000;">inputFirstFlowRecord(flsw);</span>
			}

			/*
			 * 保存 附件 注意:这里每个委托单只上传一个附件;从第二页“返回上一页”,在不重新添加附件的情况下,单击“保存并进入下一页”,
			 * 此时,首先会把数据库中原有附件删除,再保存附件,因为此次没有选择附件,故最后,这个委托单在数据库中对应的附件为空
			 */
			if (this.getLawFileYN().equals("1")) {
				upLoadAttachment(flsw);
			} else {

				deleteAttachment();
			}
		} catch (Exception e) {
			e.printStackTrace();
			return "fail";
		}
		return "success";
	}

// 保存 FlowRecord
// 新增委托单时,单击“保存并进入下一页”后,则完成节点015,将进入下一个节点020,故先记录委托单从 $
// 到010、从010到015的流程记录

<span style="color:#ff0000;">inputFirstFlowRecord(flsw);</span>
public String inputFirstFlowRecord(Flsw f1) {
		try {

			// 从 * 到010的流程记录

			fr = new FlowRecord();
			fr.setFlsw(f1);
			fn = this.getFlowNodeDao().findById(FIRST_FLOWNODE);
			fr.setFlowNode(fn);
			fr.setLawFrAct("0");//执行
			fr.setLawLastYn("0");//不是该委托单最后一条记录
			fr.setLawOpinionBoxYn("0");
			this.getFlowRecordDao().save(fr);
			// 从010到015的流程记录
			fr = new FlowRecord();
			fr.setFlsw(f1);
			fn = this.getFlowNodeDao().findById(SECOND_FLOWNODE);
			fr.setFlowNode(fn);
			fr.setLawFrAct("0");
			fr.setLawLastYn("1");
			fr.setLawOpinionBoxYn("0");
			this.getFlowRecordDao().save(fr);
			// 对Flsw的Node、PreNode进行修改
			f1.setLawFlswNode(fn.getLawFnNexNode());
			f1.setLawFlswPreNode(fn.getLawFnNode());
			// FlowRecord表中同一个委托单的FlowRecord,将最后一个fr的Id保存在flsw中
			// 以方便对FlowRecord表中的Last字段进行清除
			f1.setLawFlswRemark1(fr.getLawFrId().toString());
			this.getFlswDao().merge(f1);

		} catch (Exception e) {
			e.printStackTrace();
			return "fail";
		}
		return "success";
	}

路线是通过:

private static final String FIRST_FLOWNODE ="0010";

 private static final String SECOND_FLOWNODE ="0015";

这两个静态变量指定路线 即FlowNode的主键


转到InputSubmit.jsp  进入流转界面  提交给领导。

<s:select name="submittopeople" style="width:100px" label="提交到人" labelposition="left" theme="simple" list="submittopeopleList" listKey="userId" listValue="userRname" ></s:select>                                            

从submittopeopleList中选出想要流转的领导。

action="lawEventInput/FlswSubmitAction?ACT=1"
调用:FlswSubmitAction!flswSubmit()

spring管理的Action为单例,所以可以直接调用this.getLawFlswId();

<span style="white-space:pre">		</span>public String flswSubmit() {
		try {

			// 得到flsw
			flsw = this.getFlswDao().findById(this.getLawFlswId());
			// 对FlowRecord表中的Last字段进行清除
			clearLast(flsw);
			// 对Flsw流转到人,下一个节点,处理这个flsw的用户Id
			flsw.setLawFlswRemark2(this.getSubmittopeople());
			// 通过Node、PreNode、Act,查找包含唯一fn的list ,Act=FIRST_ACT
			fn = (FlowNode) this.getFlowNodeDao().findByThreeProperty(
					flsw.getLawFlswNode(), flsw.getLawFlswPreNode(),
					this.getACT()).get(0);
			fr.setFlsw(flsw);
			fr.setFlowNode(fn);
			fr.setLawFrAct(this.getACT());
			fr.setLawLastYn("1");
			fr.setLawOpinionBoxYn("0");
			this.getFlowRecordDao().save(fr);
			// 对Flsw的Node、PreNode进行修改
			flsw.setLawFlswNode(fn.getLawFnNexNode());
			flsw.setLawFlswPreNode(fn.getLawFnNode());
			// FlowRecord表中同一个委托单的FlowRecord,将最后一个fr的Id保存在flsw中
			// 以方便下一次对FlowRecord表中的Last字段进行清除
			flsw.setLawFlswRemark1(fr.getLawFrId().toString());
			this.getFlswDao().merge(flsw);

			/*
			 * 删除集成系统的待办信息
			 */
			// deleteTasks(this.getLawFlswId());
			/*
			 * 添加代办
			 */
			String addTask = addTasks(this.getLawFlswId(), this.getSubmittopeople());
			if (addTask.equals("addFail")) {
				/*
				 * 说明插入了重复键导致add失败,则进行update操作。
				 * 办公系统,deleteTasks只是隐性删除,并没有真正删除,所以先删除后新增的方法不行。 更新代办
				 */
				updateTasks(this.getLawFlswId(), this.getSubmittopeople());
			}
		} catch (Exception e) {
			e.printStackTrace();
			return "fail";
		}
		return "success";
	}
// 对FlowRecord表中的Last字段进行清除
clearLast(flsw);

// 通过Node、PreNode、Act,查找包含唯一fn的list ,Act=FIRST_ACT
fn = (FlowNode) this.getFlowNodeDao().findByThreeProperty
(flsw.getLawFlswNode(), flsw.getLawFlswPreNode(),this.getACT()).get(0);

通过Node,PreNode,Act,查找包含唯一fn的list,ACT=FIRST_ACT


部门领导审核:

部门领导登录时读取未完结的的所有待办事务:通过节点与用户ID读取数据库:

lawFlswRemark2 可以理解为当前办理人;

public List findBeFlswManage(final String lawFlswRemark2,final String lawFlswNode) {
		try {
			ServletActionContext.getRequest().getSession().setAttribute("pagecount",getHibernateTemplate().find("from Flsw as model where model.lawFlswRemark2='"+lawFlswRemark2+"' and model.lawFlswNode='"+lawFlswNode+"'").size());
			String queryString = "from Flsw as model where  model.lawFlswRemark2='"+lawFlswRemark2+"' and model.lawFlswNode='"+lawFlswNode+"'"+"and model.lawFlswNode!='*' and model.lawFlswNode!='**' and model.lawFlswNode!='***' and model.lawFlswNode!='****'";
			List results =getHibernateTemplate().find(queryString);
			
			return results;
		} catch (RuntimeException re) {
			log.error("find by property name failed", re);
			throw re;
		}	
领导点击待批准委托:http://localhost:8080/LawEvent/frame/flswFlow/BeDepartmentCheckAction?NODE=030&current_pagenum=1&pageNum=15

030节点 为领导审批    <bean name="BeDepartmentCheckAction" class="com.action.lawEventFlow.LawEventFlowAction"> 

method:"beCheckFlswManage"

/*
	 * Node=030
	 * 领导人批准
	 */
	//各部门领导待批准委托单	
	@SuppressWarnings("unchecked")
	public String beCheckFlswManage() 
	{
		
		HttpServletRequest request = ServletActionContext.getRequest(); 
		HttpSession session = request.getSession();
		Users us = (Users)session.getAttribute("loginUser");
		this.flswList = new LinkedList<Flsw>();
		this.flswList = this.getFlswDao().findBeFlswManage(us.getUserId(), this.getNODE(), (current_pagenum-1)*pageNum,pageNum,this.getOrderbys());
		ServletActionContext.getRequest().setAttribute("flswList", flswList);
		ServletActionContext.getRequest().getSession().setAttribute("current_pagenum",current_pagenum);
		if (flswList.size() > 0)
			return "success";
		else
			return "fail";
	}
将flswList 存入request,将current_pagenum存入session。转入BeDepartmentCheck.jsp

<a href="flswFlow/DepartmentCheckAction?backFlag=BeDepartmentCheckAction&lawFlswId=<s:property value='lawFlswId'/>">审批</a> 

审批按钮链接至  departementCheckAction  

backFlag=BeDepartmentCheckAction设置返回标记 

lawFlswId委托单ID

进入此ACTION准备领导审核页面

<span style="white-space:pre">		</span>public String staffExecute() {
		try{
			
			//获得附件,lawFileList
//			this.lawFileList = new LinkedList<LawFile>();
//			this.lawFileList =this.getLawFileDao().findByProperty("lawEventName", this.getLawFlswId());
			//获得附件,lawFileList
			this.setFilelRemark1("1");//添加的委托单的类型,"1",员工录入委托单时添加;"2",法律事务科审核时添加
			this.lawFileList = new LinkedList<LawFile>();
			this.lawFileList =this.getLawFileDao().inputedFile(this.getLawFlswId(), this.getFilelRemark1());
			//获得附件,lawFileList2
			this.setFilelRemark1("2");//添加的委托单的类型,"1",员工录入委托单时添加;"2",法律事务科审核时添加
			this.lawFileList2 = new LinkedList<LawFile>();
			this.lawFileList2 =this.getLawFileDao().inputedFile(this.getLawFlswId(), this.getFilelRemark1());
			
			
			
			flsw=this.getFlswDao().findById(this.getLawFlswId());
			this.lawFlswName=flsw.getLawFlswName();
			this.swlxName=flsw.getSwlx().getLawSwlxName();

			this.userName=flsw.getUsersByLawFlswUser().getUserName();//获得委托人
			this.depName=flsw.getDepartment().getDepName();//部门名
			this.creatorName=flsw.getUsersByLawFlswCreator().getUserName();//发起人
			this.lawFlswTime=flsw.getLawFlswTime();//发起时间
			this.lawFlswIntroduction=flsw.getLawFlswIntroduction();//委托内容
			this.lawFlswRemark=flsw.getLawFlswRemark();//
			this.lawFlswReTime = flsw.getLawFlswReTime();
			this.userCellphone = flsw.getUsersByLawFlswUser().getUserCellphone();
			this.userEmail = flsw.getUsersByLawFlswUser().getUserEmail();
			if(flsw.getLawOpinionYn().equals("1")){
				this.lawFlswOpinion=flsw.getLawFlswOpinion();
			}else{
				this.lawFlswOpinion="未审阅";
			}
			//以下是获得流转记录
			//根据已知的委托单,将FlowRecord表中同一个委托单的FlowRecord按id顺序排序,并且有意见框,所有frList
			//本flsw的,按时间顺序,有意见框,所有fr
			this.frList=new LinkedList<FlowRecord>();
			this.frList=this.getFlowRecordDao().findByFlswOpinionDESC(flsw.getLawFlswId(),"1");
			String opinionStr="";
			Users us=new Users();
			int p=0;
			for(;p<this.frList.size();p++)
			{
//				if(null==this.frList.get(p).getLawFrLeader()){
//					opinionStr=opinionStr+"审核时间:"+""+"   审核人:"+""+"   审核部门:"+""+"\n";
//				}
//				else{
//					us=this.getUsersDao().findById(this.frList.get(p).getLawFrLeader());
//					opinionStr=opinionStr+"审核时间:"+this.frList.get(p).getLawFrDate()+"   审核人:"+us.getUserName()+"   审核部门:"+us.getDepartment().getDepName()+"\n";
//				}
				//opinionStr=opinionStr+"审核意见:"+this.frList.get(p).getLawFrOpinion()+"\n"+"\n";

				/*法律事务科、员工、领导提意见所在的节点分别为060、070、080  ,时将意见分成了意见条,不再用feedback表示,而是存在Opinion表中
				 * 所以这里要将这些意见条整合起来,故这里仍然Law_OpinionBox_YN=1,即有意见框,只是意见不存储在FlowRecord的Law_FR_Opinion内
				 * 注意:这里固定了法律事务科、员工、领导提意见所在的节点分别为060、070、080 ,固定了领导审核的节点为030
				 * 先判断是不是:060、070、080、030 ;若不是,则为员工撤回
				 * 然后根据判断结果给opinion赋值
				 * LawDepCheck_NODE="060"
				 * StaffExecute_NODE="070"
				 * DepStaffNotPass_NODE="080"
				 * DepartmentCheck_NODE="030"
				 */
				if(this.frList.get(p).getFlowNode().getLawFnNode().equals(LawDepCheck_NODE)){
					//这条fr是 法律事务科提的意见
					//首先根据,根据lawOpinionFlswId和lawOpinionType来查找opiList,查找opinionList,将list转换成Sting
					if(null==this.frList.get(p).getLawFrLeader()){
						opinionStr=opinionStr+"审核时间:"+""+"   审核人:"+""+"   审核部门:"+""+"\n";
					}
					else{
						us=this.getUsersDao().findById(this.frList.get(p).getLawFrLeader());
						opinionStr=opinionStr+"审核时间:"+this.frList.get(p).getLawFrDate()+"   审核人:"+us.getUserName()+"   审核部门:"+us.getDepartment().getDepName()+"\n";
					}
					//下面是获得意见
					this.setLawOpinionType("1");
					this.opiRecordList = new LinkedList<Opinion>();
					this.opiRecordList =this.getOpinionDao().savedOpiList(this.getLawFlswId(), this.getLawOpinionType());
					opinionStr=opinionStr+"审核意见:"+"\n";
					Iterator it=this.opiRecordList.iterator();
					while(it.hasNext()){
						opinion=(Opinion)it.next();
						opinionStr=opinionStr+"    "+opinion.getLawOpinionNumber().toString()+"、"+opinion.getLawOpinionContent()+"\n";
					}
					opinionStr=opinionStr+"\n";
				}
				else if(this.frList.get(p).getFlowNode().getLawFnNode().equals(StaffExecute_NODE)){
					//这条fr是 员工的执行情况
					//首先根据,根据lawOpinionFlswId和lawOpinionType来查找opiList,查找opinionList,将list转换成Sting
					if(null==this.frList.get(p).getLawFrLeader()){
						opinionStr=opinionStr+"执行时间:"+""+"   执行人:"+""+"   执行部门:"+""+"\n";
					}
					else{
						us=this.getUsersDao().findById(this.frList.get(p).getLawFrLeader());
						opinionStr=opinionStr+"执行时间:"+this.frList.get(p).getLawFrDate()+"   执行人:"+us.getUserName()+"   执行部门:"+us.getDepartment().getDepName()+"\n";
					}
					//下面是获得意见
					this.setLawOpinionType("2");
					this.opiRecordList = new LinkedList<Opinion>();
					this.opiRecordList =this.getOpinionDao().savedOpiList(this.getLawFlswId(), this.getLawOpinionType());
					opinionStr=opinionStr+"执行情况:"+"\n";
					Iterator it=this.opiRecordList.iterator();
					while(it.hasNext()){
						opinion=(Opinion)it.next();
						//注意,remark1存储员工的选择:执行/不执行
						opinionStr=opinionStr+"    针对法律意见"+opinion.getLawOpinionNumber().toString()+":"+opinion.getLawOpinionRemark1()+"    "+opinion.getLawOpinionContent()+"\n";
					}
					opinionStr=opinionStr+"\n";
				}
				else if(this.frList.get(p).getFlowNode().getLawFnNode().equals(DepStaffNotPass_NODE)){
					//这条fr是领导针对员工不执行申请的审核意见
					//首先根据,根据lawOpinionFlswId和lawOpinionType来查找opiList,查找opinionList,将list转换成Sting
					if(null==this.frList.get(p).getLawFrLeader()){
						opinionStr=opinionStr+"审核时间:"+""+"   审核人:"+""+"   审核部门:"+""+"\n";
					}
					else{
						us=this.getUsersDao().findById(this.frList.get(p).getLawFrLeader());
						opinionStr=opinionStr+"审核时间:"+this.frList.get(p).getLawFrDate()+"   审核人:"+us.getUserName()+"   审核部门:"+us.getDepartment().getDepName()+"\n";
					}
					//下面是获得意见
					this.setLawOpinionType("3");
					this.opiRecordList = new LinkedList<Opinion>();
					this.opiRecordList =this.getOpinionDao().savedOpiList(this.getLawFlswId(), this.getLawOpinionType());
					opinionStr=opinionStr+"审核意见:"+"\n";
					Iterator it=this.opiRecordList.iterator();
					while(it.hasNext()){
						opinion=(Opinion)it.next();
						//只有在员工不执行哪条意见时,领导才对哪条意见的执行情况作批复
						//注意,remark1存储员工的选择:执行/不执行 ;remark2存储领导的选择:同意/不同意
						if(opinion.getOpinion().getLawOpinionRemark1().equals("不执行")){
							opinionStr=opinionStr+" 针对执行情况"+opinion.getLawOpinionNumber().toString()+":"+opinion.getLawOpinionRemark2()+"    "+opinion.getLawOpinionContent()+"\n";
						}
					}
					opinionStr=opinionStr+"\n";
				}
				else if(this.frList.get(p).getFlowNode().getLawFnNode().equals(DepartmentCheck_NODE)){
					//这条fr是 普通的有意见框的意见,只有一条意见,这是员工提交后领导审核的意见
					if(null==this.frList.get(p).getLawFrLeader()){
						opinionStr=opinionStr+"审核时间:"+""+"   审核人:"+""+"   审核部门:"+""+"\n";
					}
					else{
						us=this.getUsersDao().findById(this.frList.get(p).getLawFrLeader());
						opinionStr=opinionStr+"审核时间:"+this.frList.get(p).getLawFrDate()+"   审核人:"+us.getUserName()+"   审核部门:"+us.getDepartment().getDepName()+"\n";
					}
					//下面是获得意见
					opinionStr=opinionStr+"审核意见:"+this.frList.get(p).getLawFrOpinion()+"\n"+"\n";
				}
				else if(this.frList.get(p).getFlowNode().getLawFnNode().equals("090")){
					//这条fr是 员工的必须执行情况
					//首先根据,根据lawOpinionFlswId和lawOpinionType来查找opiList,查找opinionList,将list转换成Sting
					
					
						us=this.getUsersDao().findById(this.frList.get(p).getLawFrLeader());
						opinionStr=opinionStr+"执行时间:"+this.frList.get(p).getLawFrDate()+"   执行人:"+us.getUserName()+"   执行部门:"+us.getDepartment().getDepName()+"\n";
					//   System.out.println("OOOOOOOOOOOOOOOOOOOO");
					//下面是获得意见
					this.setLawOpinionType("4");//员工必须执行的意见类型为4
					this.opiRecordList = new LinkedList<Opinion>();
					this.opiRecordList =this.getOpinionDao().savedOpiList(this.getLawFlswId(), this.getLawOpinionType());
					opinionStr=opinionStr+"执行情况:"+"\n";
					Iterator it=this.opiRecordList.iterator();
					while(it.hasNext()){
						opinion=(Opinion)it.next();
						//注意,remark1存储员工的选择:执行/不执行
						opinionStr=opinionStr+"    针对法律意见"+opinion.getLawOpinionNumber().toString()+":"+opinion.getLawOpinionRemark1()+"    "+opinion.getLawOpinionContent()+"\n";
					}
					opinionStr=opinionStr+"\n";
				}		
				else {
					//这条fr是 普通的有意见框的意见,只有一条意见,这是员工撤回的理由
					if(null==this.frList.get(p).getLawFrLeader()){
						opinionStr=opinionStr+"撤回时间:"+""+"   撤回人:"+""+"   撤回部门:"+""+"\n";
					}
					else{
						us=this.getUsersDao().findById(this.frList.get(p).getLawFrLeader());
						opinionStr=opinionStr+"撤回时间:"+this.frList.get(p).getLawFrDate()+"   撤回人:"+us.getUserName()+"   撤回部门:"+us.getDepartment().getDepName()+"\n";
					}
					//下面是获得意见
					opinionStr=opinionStr+"撤回理由:"+this.frList.get(p).getLawFrOpinion()+"\n"+"\n";
				}
				
			}
			if(0==p){
				opinionStr="无审核记录";
			}
			this.lawFlswFlowRecord=opinionStr;//获得流转记录
			this.feedback=flsw.getLawFlswRemark3();//若部门领导暂时保存了“审批意见”,则放在LawFlswRemark3字段
			//获得法律事务科审批意见、员工意见
			//根据lawOpinionFlswId和lawOpinionType来查找opiList
			//因为本函数,是所有进入审批页面共用,但只有StaffExecute.jsp、LawDepCheck.jsp页面有意见,故有以下判断
			if(this.backFlag.equals("BeStaffExecuteAction") || this.backFlag.equals("BeDepStaffNotPassAction")){
				//这里LawOpinionType,只能从jsp页面传过来,两种情况,分别传“1”、“2”
				this.opiList = new LinkedList<Opinion>();
				this.opiList =this.getOpinionDao().savedOpiList(this.getLawFlswId(), "2");
			}
			//注意,原来未做这一改动的系统,法律事务科已审核,员工还未执行的委托单,这时是没有员工执行空意见的,这样就会出现错误
			//下面是规避方法,若法律事务科意见list和员工执行意见list的size不相等,则得如方案一样,在此处保护性的先保存员工执行空意见
			if(this.backFlag.equals("BeStaffExecuteAction")){
				
				this.opiStaffList=new LinkedList<Opinion>();
				this.opiStaffList =this.getOpinionDao().savedOpiList(this.getLawFlswId(), "1");	//获得法律事务科意见
				if(null==this.opiList || this.opiList.size() != this.opiStaffList.size()){
					//保护性的先保存员工执行空意见
					Iterator itStaff=this.opiStaffList.iterator();
					while(itStaff.hasNext()){
						opinion=(Opinion)itStaff.next();
						//保存员工执行空意见
						//nexOpinion=opinion;
						
						nexOpinion.setLawOpinionFlswId(opinion.getLawOpinionFlswId());
						nexOpinion.setLawOpinionNumber(opinion.getLawOpinionNumber());
						nexOpinion.setLawOpinionDate(opinion.getLawOpinionDate());//给出意见时间,即当前系统时间
						nexOpinion.setUsers(opinion.getUsers());
						
						nexOpinion.setLawOpinionType("2");//员工执行空意见
						nexOpinion.setLawOpinionContent("");//空意见
						nexOpinion.setLawOpinionRemark1("执行");//员工初始进入执行页面时,执不执行下拉框,显示执行
						
						nexOpinion.setOpinion(opinion);//目的,实现员工编辑状态进入功能
						this.getOpinionDao().save(nexOpinion);//保存空意见,注意,一定要先保存了opinion后,才能保存nexOpinion
						
					}
					
					//保护性保存员工空意见后,重新获得opiList
					this.opiList = new LinkedList<Opinion>();
					this.opiList =this.getOpinionDao().savedOpiList(this.getLawFlswId(), this.getLawOpinionType());
					
				}
			}
			
			

			// this.setFeedback("同意"); // 2013.3.18
			//“审批意见”中,一出来“同意”二字就得填好
		}catch(Exception e){
			e.printStackTrace();
			return "fail";
		}
		return "success";
	}
this.frList=this.getFlowRecordDao().findByFlswOpinionDESC(flsw.getLawFlswId(),"1");
findByFlswOpinionDESC():

String queryString = "from FlowRecord as fr where fr.flsw.lawFlswId='"+lawFlswId+"' and fr.lawOpinionBoxYn='"+lawOpinionBoxYn+"' order by fr.lawFrId";

通过委托单ID与lawOpinionBoxYn=1 来从流转记录取记录,并按照FlowRecord_ID排序。

以上代码载入了Flsw委托单的信息,并载入了记录的信息。

跳转到/LawEventFlow/DepartmentCheck.jsp

 

法务部给出意见并判断是否为三重一大,流转到录入部门。

lawDepCheckForm.action="flswFlow/LawDepPassAction?ACT=0";

<span style="white-space:pre">		</span>public String lawDepPass() {
		try{
			
			flsw=this.getFlswDao().findById(this.getLawFlswId());
			Users us =flsw.getUsersByLawFlswUser();//flsw录入人员
			department=us.getDepartment();
			this.flowtodep=department.getDepName();//flsw审核后,返回给录入人员,以便录入人员进行执行
			this.usersList=new LinkedList<Users>();
			//this.usersList=this.getUsersDao().findflowtopeople(department.getDepId(), YG_SystemRole);//获取与录入人员同部门,并且是普通员工的用户,即流转到人员
			//返回录入人员
			this.usersList.add(us);
			
			//通过Node、PreNode、Act,查找包含唯一fn的list ,Act=1传递过来
			flowNode=(FlowNode)this.getFlowNodeDao().findByThreeProperty(flsw.getLawFlswNode(), flsw.getLawFlswPreNode(), this.getACT()).get(0);
			this.lawFnId=flowNode.getLawFnId();
			//下面是保存opinion和 附件
			//保存opinion
			String opinionType="1";//意见类型   有三个值:“1”:法律事务科意见   “2”:员工意见   “3”:领导意见
			saveOpinion(opinionType);
			//保存 附件
//			if(this.getLawFileYN().equals("1")){
//				upLoadAttachment(flsw);
//			}
//			else{
//				deleteAttachment();
//			}
			
			
			/*
			 * 保存 附件
			 * 注意:这里每个委托单只上传一个附件;从第二页“返回上一页”,在不重新添加附件的情况下,单击“保存并进入下一页”,
			 * 此时,首先会把数据库中原有附件删除,再保存附件,因为此次没有选择附件,故最后,这个委托单在数据库中对应的附件为空
			 */
			if(this.getLawFileYN().equals("1")){
				upLoadAttachmentSameInput(flsw);
			}
			else{
				
				deleteAttachment();
			}
			
			
		}
		catch(Exception e){
			e.printStackTrace();
			return "fail";
			
		}
		return "success";
	}	
return后

<action name="LawDepPassAction" class="LawDepPassAction" method="lawDepPass">


<result name="success">/LawEventFlow/FlowConfirm.jsp</result>
</action>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值