MoveFlowTempletManager.java
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:7k
源码类别:
OA系统
开发平台:
Java
- package com.gforce.gfoa;
- import com.gforce.currency.database.*;
- import java.util.*;
- /**
- * <p>Title: GForce Office Automation </p>
- * <p>Description: GForce Office Automation</p>
- * <p>Copyright: 版权所有 2003 (c) 西安吉力科技发展有限公司 Copyright (c) 2003 GForce Sceince & Technology Co.,LTD</p>
- * <p>Company: 西安吉力科技发展有限公司 (2003 GForce Sceince & Technology Co.,LTD)</p>
- * @author 王华
- * @version 2.0
- * Date 2003/12/06
- * 公文流转模板管理类
- */
- public class MoveFlowTempletManager
- extends RecordManager
- {
- public MoveFlowTempletManager()
- {
- }
- protected final static String TableName = "MoveFlowInfo"; //定义声明本类操作表名称
- protected final static String IDFieldName = "ID"; //定义声明主键或者可以确定唯一记录的字段名称为“ID”,必须为自增整型
- protected final static String[] NumericFieldsName =
- {
- "BuildUserID"}; //声明数值型字段名称
- protected final static String[] StringFieldsName =
- {
- "FlowName", "FlowContent", "WritableUserIDs", "WritableDepartIDs"}; //声明字符型字段名称
- protected final static String[] DatetimeFieldsName =
- {
- "BuildTime"}; //声明日期时间型字段名称
- protected final static String[] TextFieldsName =
- {}; //声明大字符串型字段名称
- /**
- * 根据字段名称获取插入数据时表单元素名称
- * @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 intRecordID 记录ID
- * @return 指定记录向量集
- */
- public static Vector getRecordByID(int intRecordID)
- {
- Vector vt = SQLManager.GetResultSet(
- "SELECT [ID], [FlowName], [BuildTime], [BuildUserID], [FlowContent], [WritableUserIDs], [WritableDepartIDs] FROM "
- + TableName + " WHERE ID = " + intRecordID + "");
- return vt;
- }
- /**
- * 获取符合指定条件的流转模板记录集
- * @param strBuildUserName 建立用户名称
- * @param strFlowName 流转模板名称
- * @param strWritableUserIDs 可写用户IDs
- * @param strWritableDepartIDs 可写部门IDs
- * @param strBuildTimeFrom 流转模板建立时间起始
- * @param strBuildTimeTo 流转模板建立时间终止
- * @param strFlowContent 流转模板描述
- * @param strOrderBy 排序字段
- * @param bIsDesc 是否降序排序
- * @return 制定记录向量集
- */
- public static Vector getRecordBySearch(String strBuildUserName, String strFlowName, String strWritableUserIDs
- , String strWritableDepartIDs,
- String strBuildTimeFrom, String strBuildTimeTo, String strFlowContent
- , String strOrderBy, boolean bIsDesc)
- {
- return getRecordBySearch(strBuildUserName,strFlowName,strWritableUserIDs,strWritableDepartIDs,strBuildTimeFrom,strBuildTimeTo,strFlowContent,strOrderBy,bIsDesc,true);
- }
- /**
- * 获取符合指定条件的流转模板记录集
- * @param strBuildUserName 建立用户名称
- * @param strFlowName 流转模板名称
- * @param strWritableUserIDs 可写用户IDs
- * @param strWritableDepartIDs 可写部门IDs
- * @param strBuildTimeFrom 流转模板建立时间起始
- * @param strBuildTimeTo 流转模板建立时间终止
- * @param strFlowContent 流转模板描述
- * @param strOrderBy 排序字段
- * @param bIsDesc 是否降序排序
- * @param bHiddenUsing 是否隐藏正在使用的流转模板
- * @return 制定记录向量集
- */
- public static Vector getRecordBySearch(String strBuildUserName, String strFlowName, String strWritableUserIDs
- , String strWritableDepartIDs,
- String strBuildTimeFrom, String strBuildTimeTo, String strFlowContent
- , String strOrderBy, boolean bIsDesc,boolean bHiddenUsing)
- {
- String strSQL = "Select a.[ID], a.[FlowName], a.[WritableUserIDs], a.[WritableDepartIDs], a.[BuildTime], c.[Name], a.[FlowContent] from ["
- + TableName + "] as a left outer join [UserInfo] as b on(a.BuildUserID=b.ID) left outer join [PersonnelInfo] as c on (b.PersonnelID=c.ID) where a.[ID]>0";
- if (strBuildUserName.trim().length() > 0)
- {
- strSQL += " and c.[Name] like '%" + strBuildUserName + "%'";
- }
- if (strFlowName.trim().length() > 0)
- {
- strSQL += " and a.[FlowName] like '%" + strFlowName + "%'";
- }
- if (strWritableUserIDs.trim().length() > 0)
- {
- strSQL += " and '%,' + a.[WritableUserIDs] + ',%' like '%," + strWritableUserIDs + ",%'";
- }
- if (strWritableDepartIDs.trim().length() > 0)
- {
- strSQL += " and '%,' + a.[WritableDepartIDs] + ',%' like '%," + strWritableDepartIDs + ",%'";
- }
- if (strBuildTimeFrom.trim().length() > 0)
- {
- strSQL += " and a.[BuildTime]>='" + strBuildTimeFrom + " 00:00:00.000'";
- }
- if (strBuildTimeTo.trim().length() > 0)
- {
- strSQL += " and a.[BuildTime]<='" + strBuildTimeTo + " 23:59:59.999'";
- }
- if (strFlowContent.trim().length() > 0)
- {
- strSQL += " and a.[FlowContent] like '%" + strFlowContent + "%'";
- }
- if(bHiddenUsing)
- {
- strSQL += " and (a.[ID] not in (Select MoveFlowID from DocTempletMoveFlow where IsUseful=1))";
- }
- if (strOrderBy.trim().length() > 0)
- {
- if (bIsDesc)
- {
- strSQL += " Order by " + strOrderBy + " desc";
- }
- else
- {
- strSQL += " Order by " + strOrderBy + "";
- }
- }
- Vector vt = SQLManager.GetResultSet(strSQL);
- return vt;
- }
- /**
- * 获取符合指定条件的公文模板记录集
- * @param strBuildUserName 建立用户名称
- * @param strFlowName 流转模板名称
- * @param strWritableUserIDs 可写用户IDs
- * @param strWritableDepartIDs 可写部门IDs
- * @param strBuildTimeFrom 流转模板建立时间起始
- * @param strBuildTimeTo 流转模板建立时间终止
- * @param strOrderBy 排序字段
- * @param bIsDesc 是否降序排序
- * @return 制定记录向量集
- */
- public static Vector getRecordBySearch(String strBuildUserName, String strFlowName, String strWritableUserIDs
- , String strWritableDepartIDs,
- String strBuildTimeFrom, String strBuildTimeTo, String strOrderBy
- , boolean bIsDesc)
- {
- Vector vt = getRecordBySearch(strBuildUserName, strFlowName, strWritableUserIDs, strWritableDepartIDs
- , strBuildTimeFrom, strBuildTimeTo, "", strOrderBy, bIsDesc);
- return vt;
- }
- }