⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wssearch.java

📁 一套完整的档案管理系统
💻 JAVA
字号:

package com.stsc.archive.jygl;
//
import java.io.IOException;
import java.util.Hashtable;
import java.util.Locale;
import java.util.Properties;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;

import java.io.IOException;
import java.util.Hashtable;
import java.util.Locale;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.util.MessageResources;
import com.stsc.util.STPoolDataSet;
import com.stsc.util.STResultSet;
import com.stsc.archive.jygl.*;
import com.stsc.archive.manage.* ;

		//取得用户权限
public final class Wssearch extends Action {

    public ActionForward perform(ActionMapping mapping,
				 ActionForm form,
				 HttpServletRequest request,
				 HttpServletResponse response)
	throws IOException, ServletException {
System.out.println("mapping.getAttribute(): = " + mapping.getAttribute());
System.out.println("mapping.getScope(): = " + mapping.getScope());
    
     String serialno         = "";      // 文件流水号
	 String title		     = "";      // 文件(案卷)题名
     String archivalcode	 = "";      // 存址号
     String applicant        = "";      //   申请人
	 String applytime        = "";      //   申请借阅时间
	 String reason           = "";      //   申请理由
	 String approver         = "";      //   审批人
	 String approvetime      = "";      //   审批时间
	 String approvesuggest   = "";      //   审批意见
	 String replier          = "";      //   答复人
	 String replytime        = "";      //   答复时间
	 String replysuggest     = "";      //   答复意见
	 String applystatus      = "";      //   申请的状态
    
	
	 //分页显示数据
	String sPageNo   ="";
	String sGoPageNo ="";
	
	int total = 0;
	int totalPage = 0;
	int curPage=0;
    int page_num=10;			
    int perpage = 0;
	int i=1; 	
	int gopage=1;
	 
	 
	 
	 int    borrowapplyid;
	 STPoolDataSet data = new STPoolDataSet();
	 STResultSet rs;
     JycxList jycxlist = new JycxList();
	 Properties dbBase = new Properties();
	 dbBase.setProperty("dsJndiName",Constants.DATABASE_KEY);
	// Extract attributes we will need
	Locale locale = getLocale(request);
	MessageResources messages = getResources();
	HttpSession session = request.getSession();

	// Validate the request parameters specified by the user
	ActionErrors errors = new ActionErrors();

   
	User userInfo = (User)(session.getAttribute(Constants.CURRENT_USER_KEY));
 
	String action = request.getParameter("action");
    String sql    = "";

   
	
	if(action.equals("Sqcl")){
	     sql="select fReadApply.* from  fReadApply,fApproveList Where (fReadApply.ApplyStatus ='未处理' or fReadApply.ApplyStatus ='审批完成') and  fReadApply.BorrowApplyID=fApproveList.BorrowApplyID  and fApproveList.EnterName='"+userInfo.getUserName()+"' and fApproveList.RoleID=2  order by fReadApply.BorrowApplyId ";
//	    sql="select fReadApply.* from  fReadApply,fApproveList Where fReadApply.ApplyStatus ='未处理' or fReadApply.ApplyStatus ='不同意' or fReadApply.ApplyStatus ='同意' and  fReadApply.BorrowApplyID=fApproveList.BorrowApplyID  and fApproveList.EnterName='"+userInfo.getUserName()+"' and fApproveList.RoleID=2  order by fReadApply.BorrowApplyId ";

		 System.out.println(" ################# sql===="+sql);
	}else if(action.equals("wsdf")){
	     sql="select fReadApply.* from  fReadApply,fApproveList Where fReadApply.ApplyStatus ='二次审批' and  fReadApply.BorrowApplyID=fApproveList.BorrowApplyID  and fApproveList.EnterName='"+userInfo.getUserName()+"' and fApproveList.RoleID=8  order by fReadApply.BorrowApplyId ";
	}else if(action.equals("wtjjysp")){
	     sql="select * from  fReadApply Where ApplyStatus ='未提交' and Applicant='"+userInfo.getUserName() +"' order by BorrowApplyId ";
	}else if(action.equals("clwjysp")){
	     sql="select * from  fReadApply Where (ApplyStatus ='已处理' or ApplyStatus ='未通过')  and Applicant='"+userInfo.getUserName() +"' order by BorrowApplyId ";
	}

    		 rs = data.getSTResult(sql, dbBase);
            total = rs.getRecCount();
			if((total%page_num)!=0){
			  totalPage=total/page_num+1; 
			}else{
			  totalPage=total/page_num;
			}
					
			
			while (rs!=null && rs.next()) 
			{
				 if(i>=1&&i<=page_num){  
					JyForm jyform = new JyForm();
					jyform.setborrowapplyid(rs.getInt("BorrowApplyid"));
					jyform.setserialno(rs.getString("SerialNo"));
					jyform.settitle(rs.getString("Title"));
					jyform.setarchivalcode(rs.getString("ArchivalCode"));
					jyform.setapplicant(rs.getString("Applicant"));
					jyform.setreason(rs.getString("Reason"));
					jyform.setapplytime(String.valueOf(rs.getDate("ApplyTime")));				
				    jyform.setapplystatus(rs.getString("ApplyStatus")); 
				   	jyform.setAction(action);
						//分页显示
					jycxlist.setGoPage(gopage);
					jycxlist.setTotal(total);
					jycxlist.setCurPage(gopage);
					jycxlist.setTotalPage(totalPage);
					jycxlist.addwsjyArchive(jyform);
				 }  					
			   i++;
			 }
     



	// Report any errors we have discovered back to the original form
	if (!errors.empty()) {
	    saveErrors(request, errors);
	    return (new ActionForward(mapping.getInput()));
	}
    session.setAttribute(Constants.JYCXLIST_KEY, jycxlist);
	// Forward control to the specified success URI
//System.out.println("mapping.findForward(\"success\")=" + mapping.findForward("success"));
	return (mapping.findForward("success"));

    }


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -