DocumentTempletManager.java
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:9k
源码类别:
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/01
- * 公文模板管理类
- */
- public class DocumentTempletManager extends RecordManager
- {
- public DocumentTempletManager()
- {
- }
- protected final static String TableName = "DocumentTemplet"; //定义声明本类操作表名称
- protected final static String IDFieldName = "ID"; //定义声明主键或者可以确定唯一记录的字段名称为“ID”,必须为自增整型
- protected final static String[] NumericFieldsName = {"BuildUserID","SysDirID","IsAutoBuild"}; //声明数值型字段名称
- protected final static String[] StringFieldsName = {"TempletName","TempletNumber","EnglishAb",
- "WritableUserIDs","WritableDepartIDs",
- "ReadOnlyUserIDs","ReadOnlyDepartIDs",
- "FormEvent"}; //声明字符型字段名称
- protected final static String[] DatetimeFieldsName = {"BuildTime"}; //声明日期时间型字段名称
- protected final static String[] TextFieldsName = {"PrintHTMLCode","TypesetHTMLCode","JavaScriptCode"}; //声明大字符串型字段名称
- /**
- * 根据字段名称获取插入数据时表单元素名称
- * @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],[TempletName],[BuildTime],[BuildUserID],[TempletNumber],[EnglishAb],[WritableUserIDs],[WritableDepartIDs],[ReadOnlyUserIDs],[ReadOnlyDepartIDs],[PrintHTMLCode],[SysDirID],[IsAutoBuild],[TypesetHTMLCode],[FormEvent],[JavaScriptCode] FROM " + TableName + " WHERE ID = " + intRecordID + "");
- return vt;
- }
- /**
- * 获取符合指定条件的公文模板记录集
- * @param strBuildUserID 创建用户ID
- * @param iSysDirID 系统目录ID
- * @param strIsAutoBuild 是否自动生成
- * @param strTempletName 模板名称
- * @param strTempletNumber 模板编号
- * @param strEnglishAb 英文缩写
- * @param strWritableUserIDs 可写用户IDs
- * @param strWritableDepartIDs 可写部门IDs
- * @param strReadOnlyUserIDs 只读用户IDs
- * @param strReadOnlyDepartIDs 只读部门IDs
- * @param strFormEvent 表单事件
- * @param strPrintHTMLCode 打印HTML代码
- * @param strTypesetHTMLCode 排版格式HTML代码
- * @param strJavaScriptCode 嵌套JavaScript代码
- * @param strBuildTimeFrom 建立时间起始
- * @param strBuildTimeTo 建立时间截至
- * @param strOrderBy 排序字段
- * @param bIsDesc 是否降序排序
- * @return 符合条件记录向量集
- */
- public static Vector getRecordBySearch(String strBuildUserName, int iSysDirID, String strIsAutoBuild, String strTempletName, String strTempletNumber,
- String strEnglishAb, String strWritableUserIDs, String strWritableDepartIDs, String strReadOnlyUserIDs, String strReadOnlyDepartIDs,
- String strFormEvent, String strPrintHTMLCode, String strTypesetHTMLCode, String strJavaScriptCode,
- String strBuildTimeFrom, String strBuildTimeTo, String strOrderBy, boolean bIsDesc)
- {
- return getRecordBySearch(strBuildUserName,iSysDirID,strIsAutoBuild,strTempletName,strTempletNumber,strEnglishAb,strWritableUserIDs,strWritableDepartIDs,strReadOnlyUserIDs,strReadOnlyDepartIDs,strFormEvent,strPrintHTMLCode,strTypesetHTMLCode,strJavaScriptCode,strBuildTimeFrom,strBuildTimeTo,strOrderBy,bIsDesc,true);
- }
- /**
- * 获取符合指定条件的公文模板记录集
- * @param strBuildUserID 创建用户ID
- * @param iSysDirID 系统目录ID
- * @param strIsAutoBuild 是否自动生成
- * @param strTempletName 模板名称
- * @param strTempletNumber 模板编号
- * @param strEnglishAb 英文缩写
- * @param strWritableUserIDs 可写用户IDs
- * @param strWritableDepartIDs 可写部门IDs
- * @param strReadOnlyUserIDs 只读用户IDs
- * @param strReadOnlyDepartIDs 只读部门IDs
- * @param strFormEvent 表单事件
- * @param strPrintHTMLCode 打印HTML代码
- * @param strTypesetHTMLCode 排版格式HTML代码
- * @param strJavaScriptCode 嵌套JavaScript代码
- * @param strBuildTimeFrom 建立时间起始
- * @param strBuildTimeTo 建立时间截至
- * @param strOrderBy 排序字段
- * @param bIsDesc 是否降序排序
- * @param bHiddenUsing 是否隐藏正在使用的模板
- * @return 符合条件记录向量集
- */
- public static Vector getRecordBySearch(String strBuildUserName, int iSysDirID, String strIsAutoBuild, String strTempletName, String strTempletNumber,
- String strEnglishAb, String strWritableUserIDs, String strWritableDepartIDs, String strReadOnlyUserIDs, String strReadOnlyDepartIDs,
- String strFormEvent, String strPrintHTMLCode, String strTypesetHTMLCode, String strJavaScriptCode,
- String strBuildTimeFrom, String strBuildTimeTo, String strOrderBy, boolean bIsDesc,boolean bHiddenUsing)
- {
- String strSQL = "Select a.[ID],a.[SysDirID],a.[IsAutoBuild],a.[TempletName],a.[TempletNumber],a.[EnglishAb],a.[WritableUserIDs],a.[WritableDepartIDs], a.[ReadOnlyUserIDs], a.[ReadOnlyDepartIDs], a.[FormEvent], a.[BuildTime], a.[PrintHTMLCode], a.[TypesetHTMLCode], a.[JavaScriptCode], c.[Name] 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 1=1";
- if(strBuildUserName.trim().length()>0)
- strSQL += " and c.[Name] like '%" + strBuildUserName + "%'";
- if (iSysDirID > 0)
- strSQL += " and a.[SysDirID] = " + iSysDirID + "";
- if (strIsAutoBuild.trim().length() > 0)
- strSQL += " and a.[IsAutoBuild] like '%" + strIsAutoBuild + "%'";
- if (strTempletName.trim().length() > 0)
- strSQL += " and a.[TempletName] like '%" + strTempletName + "%'";
- if (strTempletNumber.trim().length() > 0)
- strSQL += " and a.[TempletNumber] like '%" + strTempletNumber + "%'";
- if (strEnglishAb.trim().length() > 0)
- strSQL += " and a.[EnglishAb] like '%" + strEnglishAb + "%'";
- if (strWritableUserIDs.trim().length() > 0)
- strSQL += " and a.[WritableUserIDs] like '%" + strWritableUserIDs + "%'";
- if (strWritableDepartIDs.trim().length() > 0)
- strSQL += " and a.[WritableDepartIDs] like '%" + strWritableDepartIDs + "%'";
- if (strReadOnlyUserIDs.trim().length() > 0)
- strSQL += " and a.[ReadOnlyUserIDs] like '%" + strReadOnlyUserIDs + "%'";
- if (strReadOnlyDepartIDs.trim().length() > 0)
- strSQL += " and a.[ReadOnlyDepartIDs] like '%" + strReadOnlyDepartIDs + "%'";
- if (strFormEvent.trim().length() > 0)
- strSQL += " and a.[FormEvent] like '%" + strFormEvent + "%'";
- 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 (strPrintHTMLCode.trim().length() > 0)
- strSQL += " and a.[PrintHTMLCode] like '%" + strPrintHTMLCode + "%'";
- if (strTypesetHTMLCode.trim().length() > 0)
- strSQL += " and a.[TypesetHTMLCode] like '%" + strTypesetHTMLCode + "%'";
- if (strJavaScriptCode.trim().length() > 0)
- strSQL += " and a.[JavaScriptCode] like '%" + strJavaScriptCode + "%'";
- if(bHiddenUsing)
- strSQL += " and (a.[ID] not in (Select DocTempletID from DocTempletMoveFlow where IsUseful=1 and DocTempletTableName='" + TableName + "'))";
- if (strOrderBy.trim().length() > 0)
- {
- if (bIsDesc)
- strSQL += " Order by " + strOrderBy + " desc";
- else
- strSQL += " Order by " + strOrderBy + "";
- }
- Vector vt = SQLManager.GetResultSet(strSQL);
- return vt;
- }
- }