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

📄 recvdocformmanager.java

📁 OA典型例子
💻 JAVA
字号:
package com.sure.oa.recvdoc;

import com.sure.businessmodel.Page;
import com.sure.businessmodel.UpdateException;
import com.sure.businesslogic.AlreadyExistsException;
import com.sure.businesslogic.NotFoundException;
import com.sure.dataabstraction.DBManager;
import com.sure.dataabstraction.DBPoolException;
import com.sure.util.StringUtils;
import com.sure.oa.attachment.*;
import com.sure.oa.orgnization.*;
import com.sure.oa.senddoc.*;
import com.sure.util.*;
import java.sql.SQLException;
import java.sql.Connection;
import java.util.*;
import java.io.*;
/**
 * <p>Title: OA</p>
 * <p>Description: 国办项目</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: sure</p>
 * @author mengzy
 * @version 1.0
 */

public class RecvDocFormManager {

  public RecvDocFormManager() {
  }

  /**
   * 根据发文ID得到所有的收文记录
   * @param sendDocId
   * @return
   * @throws SQLException
   * @throws NotFoundException
   * @throws DBPoolException
   */
  public static Vector getAllRecvDocBySendDocId(int sendDocId) throws SQLException, NotFoundException,DBPoolException,Exception {
    Vector rtnVector = new Vector();
    Connection cn = DBManager.getConnection();
    try{
      String where = " where sendDocId = " + sendDocId;
      rtnVector = RecvDocFormPersistent.load(cn, where);
    }catch(Exception ex){
      throw ex;
    }finally{
      cn.close();
    }
    return rtnVector;
  }


  /**
   *保存收文的主信息
   */
  public static void  saveDocExists(RecvDocForm doc) throws Exception{
    Connection cn = DBManager.getConnection();
    try{
      RecvDocFormPersistent recvDocFormPersistent = new RecvDocFormPersistent(doc);
      recvDocFormPersistent.setRecordExists(true);
      recvDocFormPersistent.persist(cn);
    }catch(Exception ex){
      throw ex;
    }finally{
      cn.close();
    }
  }

  /**
   * 根据docID获得一个收文的主信息
   */
  public static  RecvDocForm getDoc(int docId) throws SQLException,DBPoolException, NotFoundException {
      Connection cn = DBManager.getConnection();
      try {
          String where = "Where docId = " + docId ;
          Vector beans = RecvDocFormPersistent.load(cn, where);
          RecvDocForm bean = (RecvDocForm)beans.firstElement();
          return bean;
      }catch (SQLException sqle) {
          throw new  NotFoundException();
      } finally {
          cn.close();
      }
  }

  public static  RecvDocForm getDoc(String docId) throws SQLException,DBPoolException, NotFoundException {
      return  getDoc(Integer.parseInt(docId));
  }

  /**
   * 获得待签收收文列表
   */
  public Page getRecvDocList(int start, String unitId,String cxtj) throws SQLException,NotFoundException,DBPoolException {
      Connection cn = DBManager.getConnection();
      try{
          String where = "where docId in(select docId from recvPermission where status=0 and unitId="+unitId+") "+cxtj+"  order by sendTime desc";
          Page p = RecvDocFormPersistent.load(cn, start, 15, where);
          return p;
      }finally {
          cn.close();
      }
  }

  /**
   * 获得已签收收文列表
   */
  public Page getRecvDocSignList(int start, String unitId,String cxtj) throws SQLException,NotFoundException,DBPoolException {
      Connection cn = DBManager.getConnection();
      try{
          String where = "where docId in(select docId from recvPermission where status=2 and unitId="+unitId+") "+cxtj+" order by sendTime desc";
          Page p = RecvDocFormPersistent.load(cn, start, 15, where);
          return p;
      }finally {
          cn.close();
      }
  }

  /**
    * 获得拒收文件列表
    */
   public Page getBackFileList(int start, String unitId,String cxtj) throws SQLException,NotFoundException,DBPoolException {
       Connection cn = DBManager.getConnection();
       try{
           String where = "where docId in(select docId from recvPermission where status=4 and unitId="+unitId+") "+cxtj+" order by sendTime desc";
           Page p = RecvDocFormPersistent.load(cn, start, 15, where);
           return p;
       }finally {
           cn.close();
       }
   }

  /**
   *保存收文的主信息
   */
  public static void  saveDoc(RecvDocForm doc) throws SQLException{
  }

  /**
   * 获得某个单位的待签收收文列表
   */
  public  static  Vector  getUnsignPage(String unitId){
    Vector v=new Vector();
    return  v;
  }

  /**
   * 获得某个单位的已签收收文列表
   */
  public  static  Vector  getSignedPage(String unitId){
    Vector v=new Vector();
    return  v;
  }

  /**
   * 获得某个单位的外单位退文列表
   */
  public  static  Vector  getTuiPage(String unitId){
    Vector v=new Vector();
    return  v;
  }

  /**
   * 获得某个单位的本单位退文列表
   */
  public  static  Vector  getInerTuiPage(String unitId){
    Vector v=new Vector();
    return  v;
  }

  /**
   * 收文签收(收文主表置位,收文日志信息更新,收文授权表更新)
   */
  public  static  int  signDoc(String docId,String userId,Date signTime){
    int val=1;
    return  val;
  }

  /**
    * 收文退回(收文主表置位,收文日志信息更新,收文授权表更新)
    */
   public  static  int  TuiHuiDoc(String docId,String userId,Date signTime){
     int val=1;
     return  val;
   }


   /**
    * 获得某个单位在某个时间段内接受某单位的收文
    */
   public static  Vector  getRecvList(String sendUnitId,String unitId,String year,String month,String day) throws SQLException, NotFoundException,DBPoolException {
        Connection cn = DBManager.getConnection();
        try{
            String where = "where docId in(select docId from recvPermission where unitId="+unitId+") and sendUnitId="+sendUnitId+"  ";
            if (!year.equals("")){
               where=where+"and year(sendtime)='"+year+"'  ";
            }
            if (!month.equals("")){
               where=where+"and month(sendtime)='"+month+"'  ";
            }
            if (!day.equals("")){
               where=where+"and day(sendtime)='"+day+"'  ";
            }
            Vector v = RecvDocFormPersistent.load(cn,where);
            return  v;
        }finally {
            cn.close();
        }
  }


}

⌨️ 快捷键说明

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