ErrandApplyManager.java
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:7k
源码类别:
OA系统
开发平台:
Java
- package com.gforce.gfoa;
- /**
- * <p>Title: 吉力科技办公自动化系统</p>
- * <p>Description: 吉力科技办公自动化系统</p>
- * <p>Copyright: 版权所有 2003 (c) 西安吉力科技发展有限公司 Copyright (c) 2003 GForce Sceince & Technology</p>
- * <p>Company: 西安吉力科技发展有限公司 (GForce Sceince & Technology)</p>
- * 出差申请管理类
- * @author 王江涛
- * @version 1.0
- */
- import com.gforce.currency.database.*;
- import com.gforce.currency.*;
- import com.gforce.currency.database.*;
- import java.util.*;
- public class ErrandApplyManager
- extends RecordManager
- {
- public ErrandApplyManager()
- {
- }
- protected final static String TableName = "ErrandApplyAndRecord"; //定义声明本类操作表名称
- protected final static String IDFieldName = "ID"; //定义声明主键或者可以确定唯一记录的字段名称为“ID”,必须为自增整型
- protected final static String[] NumericFieldsName = {"ApplyUserID", "ConfirmUserID","SysDirID"}; //声明数值型字段名称
- protected final static String[] DatetimeFieldsName ={"PlanStartTime","PlanEndTime","RealStartTime","RealEndTime","ApplyTime"}; //声明日期时间型字段名称
- protected final static String[] StringFieldsName = {"CompanyTo","CityTo","ErrandTitle",
- "Personnels"}; //声明字符型字段名称
- protected final static String[] TextFieldsName = {"ErrandContent","Remark"}; //声明大字符串型字段名称
- /* * 根据字段名称获取插入数据时表单元素名称
- * @param strFieldName 字段名称
- * @return 表单素名称
- */
- protected String InsertParament(String strFieldName)
- {
- return "" + strFieldName + ""; //可以根据需要加前缀、后缀
- }
- /**
- * 根据字段名称获取修改数据时表单元素名称
- * @param strFieldName 字段名称
- * @return 表单素名称
- */
- protected String UpdateParament(String strFieldName)
- {
- return "" + strFieldName + ""; //可以根据需要加前缀、后缀
- }
- /**
- * 获取本类操作表名称
- * @return 表名称
- */
- public String getTableName()
- { //获取本类操作表名称
- return TableName;
- }
- protected String getIDFieldName()
- { //获取主键或者可以确定唯一记录的字段名称
- return IDFieldName;
- }
- protected String[] getNumericFieldsName()
- { //获取数值型字段名称
- return NumericFieldsName;
- }
- protected String[] getStringFieldsName()
- { //获取字符型字段名称
- return StringFieldsName;
- }
- protected String[] getDatetimeFieldsName()
- { //获取日期时间型字段名称
- return DatetimeFieldsName;
- }
- protected String[] getTextFieldsName()
- { //获取大字符串型字段名称
- return TextFieldsName;
- }
- /**
- *获取指定用户ID的出差申请.(没有填写实际出差时间的记录)
- * @param iSysDirID 系统目录ID
- * @param strUserID 用户ID
- * @return 返回的数据向量集
- */
- public static Vector getByUserIDRecord(int iSysDirID,int strUserID)
- {
- //获得出差申请的多有记录和每条记录的“批准者姓名”。
- Vector vt = SQLManager.GetResultSet("SELECT a.*,c.Name FROM " + TableName +
- " as a left outer join UserInfo as b on (a.ConfirmUserID = b.ID) left outer join PersonnelInfo as c on (b.PersonnelID=c.ID)"+
- " WHERE (a.SysDirID = "+ iSysDirID +") And(a.ApplyUserID = " + strUserID+") And (a.RealStartTime is NULL) And (a.RealEndTime is NULl) order by a.ApplyTime desc,a.ID desc");
- return vt;
- }
- /**
- * 获取指定用户ID的出差记录.(已批准过出差申请的记录)
- * @param iSysDirID 系统目录ID
- * @param strUserID 用户ID
- * @return 返回的数据向量集
- */
- public static Vector getByUserIDPassRecord(int iSysDirID,int strUserID)
- {
- //获得出差记录的多有记录和每条记录的“批准者姓名”。
- Vector vt = SQLManager.GetResultSet("SELECT a.* FROM " + TableName +
- " as a WHERE (a.SysDirID = "+ iSysDirID +") And(a.ApplyUserID = " + strUserID + ") And a.ID in (select RecordID from ApproveRecord where ApproveType='出差申请' and RecordID not in (Select RecordID from ApproveRecord where ApproveType='出差申请' and ApproveTime is null) and not ApproveTime is null) order by a.ApplyTime desc,a.ID desc");
- return vt;
- }
- /**
- * 获取出差待批准的申请记录。(未批准的记录)
- * @param iSysDirID 系统目录ID
- * @return 数据向量集
- */
- public static Vector getCheckRecord(int iSysDirID)
- {
- //获得出差申请的多有记录和每条记录的“申请用户姓名”。
- Vector vt = SQLManager.GetResultSet("SELECT a.*,c.Name FROM " + TableName +
- " as a left outer join UserInfo as b on (a.ApplyUserID = b.ID) left outer join PersonnelInfo as c on (b.PersonnelID=c.ID) left outer join ApproveRecord as d on (d.RecordID=a.ID and d.ApproveType='出差申请' and not d.ApproveTime is null)" +
- " Where (a.SysDirID = "+ iSysDirID +")And d.ID is null order by a.ApplyTime desc,a.ID desc");
- return vt;
- }
- /**
- * 获取所有数据向量集
- * @param iSysDirID 系统目录ID
- * @return 数据向量集
- */
- public static Vector getAllRecord(int iSysDirID)
- {
- //获得出差申请的多有记录和每条记录的“批准者姓名”和“申请用户姓名”。
- Vector vt = SQLManager.GetResultSet("SELECT a.*,c.Name,e.Name FROM " + TableName +
- " as a left outer join UserInfo as b on (a.ConfirmUserID = b.ID) left outer join PersonnelInfo as c on (b.PersonnelID=c.ID)"+
- " left outer join UserInfo as d on (a.ApplyUserID = d.ID) left outer join PersonnelInfo as e on (d.PersonnelID=e.ID) Where a.SysDirID = "+ iSysDirID +" order by a.ApplyTime desc,a.ID desc");
- return vt;
- }
- /**
- * 获取指定记录ID的数据向量集
- * @param intRecordID 指定记录ID
- * @return 数据向量集
- */
- public static Vector getRecordByID(int intRecordID)
- {
- Vector vt = SQLManager.GetResultSet("SELECT a.*,c.Name,e.Name FROM " + TableName +
- " as a left outer join UserInfo as b on (a.ConfirmUserID = b.ID) left outer join PersonnelInfo as c on (b.PersonnelID=c.ID)"+
- " left outer join UserInfo as d on (a.ApplyUserID = d.ID) left outer join PersonnelInfo as e on (d.PersonnelID=e.ID)"+
- "Where a.ID = "+intRecordID);
- return vt;
- }
- }