📄 oaswitchmanager.java
字号:
package com.sure.oa.oaswitch;
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.LobUtils;
import java.sql.SQLException;
import java.sql.Connection;
import java.util.Vector;
import java.util.List;
import java.util.Iterator;
import java.sql.Blob;
/**
* <p>Title: RoadOA</p>
* <p>Description: 项目</p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: sure</p>
* @author mengzy
* @version 1.0
* 文件种类:docKind 0:导入交换平台 1:导入OA
* 状 态:status 0:未完成导入 1:已完成导入
*/
public class oaswitchManager {
public oaswitchManager() {
}
/**
* 根据docID获得一个公文的主信息
* @param docId
* @return
* @throws SQLException
* @throws DBPoolException
* @throws NotFoundException
*/
public oaswitch getDoc(int docId) throws SQLException,
DBPoolException, NotFoundException {
Connection cn = DBManager.getConnection();
try {
String where = "Where docId = " + docId ;
Vector beans = oaswitchPersistent.load(cn, where);
oaswitch bean = (oaswitch)beans.firstElement();
return bean;
} catch (SQLException sqle) {
throw new NotFoundException();
} finally {
cn.close();
}
}
/**
* 获得待导入公文列表
*/
public Vector getUnNormalList(int docKind) throws SQLException,NotFoundException,DBPoolException {
Connection cn = DBManager.getConnection();
try{
String where = "where docKind="+docKind+" and status=0 order by docID desc";
Vector v = oaswitchPersistent.load(cn, where);
return v;
}finally {
cn.close();
}
}
/**
* 保存发文主信息
* @param u
*/
public int saveDoc(oaswitch u) throws SQLException,DBPoolException, UpdateException, NotFoundException {
Connection cn = DBManager.getConnection();
int docId = u.getDocId().intValue();
int retval = 0;
try{
oaswitchPersistent doc = new oaswitchPersistent(u);
if (docId == 0){
}else{
doc.setRecordExists(true);
}
doc.persist(cn);
retval = doc.getBean().getDocId().intValue();
}finally {
cn.close();
}
return retval;
}
/**
* 仅仅更改状态
* @param u
*/
public static void updateStatus(oaswitch u) throws SQLException,
DBPoolException, UpdateException{
Connection cn = DBManager.getConnection();
try{
oaswitchPersistent doc = new oaswitchPersistent(u, true);
doc.persist(cn);
}finally{
cn.close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -