DocTempletMoveFlowManager.java
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:11k
源码类别:
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 2.0
- * DATE : 2003-12-18
- * 公文流转模板管理类
- */
- import com.gforce.currency.database.*;
- import java.util.*;
- import com.gforce.currency.*;
- public class DocTempletMoveFlowManager extends RecordManager
- {
- public DocTempletMoveFlowManager()
- {}
- protected final static String TableName = "DocTempletMoveFlow";//定义声明本类操作表名称
- protected final static String IDFieldName = "ID"; //定义声明主键或者可以确定唯一记录的字段名称为“ID”,必须为自增整型
- protected final static String[] NumericFieldsName = {"DocTempletID","MoveFlowID","UpdateUserID",
- "IsUseful"}; //声明数值型字段名称
- protected final static String[] DatetimeFieldsName = {"UpdateTime","StopUseTime",
- "StarUseTime"}; //声明日期时间型字段名称
- protected final static String[] StringFieldsName = {"Name","DocTempletTableName","UpdateFromIP",
- "WritableUserIDs","WritableDepartIDs","ReadOnlyUserIDs",
- "ReadOnlyDepartIDs"}; //声明字符型字段名称
- 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;
- }
- /**
- * 获取符合指定条件的公文流转模板记录集
- * @param strID 公文流转模板信息唯一标识
- * @param strName 公文流转模板名称
- * @param strDocTempletID 公文模板ID
- * @param strDocTempletName 公文模板名称
- * @param strSysDirID SysDirID
- * @param strDocTempletTableName 公文模板表名称
- * @param strMoveFlowID 流转模板ID
- * @param strMoveFlowName 流转模板名称
- * @param strUpdateUserID 最后更新用户ID
- * @param strUpdateTimeFrom 最后更新时间起始
- * @param strUpdateTimeTo 最后更新时间终止
- * @param strUpdateFromIP 最后更新来源IP
- * @param strApproveUserID 审核用户ID
- * @param strIsUseful 是否可用
- * @param strWritableUserIDs 可写用户IDs
- * @param strWritableDepartIDs 可写部门IDs
- * @param strReadOnlyUserIDs 只读用户IDs
- * @param strReadOnlyDepartIDs 只读部门IDs
- * @param strOrderBy 排序字段
- * @param strIsDesc 是否降序排序
- * @param strIsAutoBuild 公文模板是否自动生成
- * @param strconfig 配置管理参数
- * @return 符合条件记录向量集
- */
- public static Vector getRecordBySearch(String strID,String strName,String strDocTempletID,String strDocTempletName,String strSysDirID,
- String strDocTempletTableName,String strMoveFlowID,String strMoveFlowName,
- String strUpdateUserID,String strUpdateTimeFrom,String strUpdateTimeTo,String strUpdateFromIP,
- String strApproveUserID,String strIsUseful,String strWritableUserIDs,
- String strWritableDepartIDs,String strReadOnlyUserIDs,
- String strReadOnlyDepartIDs,String strOrderBy,String strIsDesc,
- String strIsAutoBuild,String strconfig)
- {
- String strSQL = "SELECT a.[ID],a.[Name],a.[DocTempletID],a.[DocTempletTableName],a.[MoveFlowID],a.[UpdateUserID]," +
- "a.[UpdateTime],a.[UpdateFromIP],a.[ApproveUserID],a.[ApproveTime],a.[StopUseTime],a.[StarUseTime]," +
- "a.[IsUseful],a.[WritableUserIDs],a.[WritableDepartIDs],a.[ReadOnlyUserIDs],a.[ReadOnlyDepartIDs]," +
- "b.[TempletName],b.[SysDirID],c.[FlowName],e.[Name],b.[IsAutoBuild] FROM [" + TableName + "] as a left outer join [" +
- strDocTempletTableName+ "] as b on (a.DocTempletID = b.ID) left outer join [MoveFlowInfo] as c on " +
- "(a.MoveFlowID = c.ID) left outer join [UserInfo] as d on (a.UpdateUserID = d.ID) " +
- "left outer join [PersonnelInfo] as e on (d.PersonnelID=e.ID) WHERE a.[ID] > 0";
- if (strID.trim().length()>0)
- {
- strSQL += " and (a.[ID] IN (" + strID + "))";
- }
- if (strName.trim().length()>0)
- {
- strSQL += " and a.[Name] LIKE '%" + strName + "%'";
- }
- if (strDocTempletID.trim().length()>0)
- {
- strSQL += " and (a.[DocTempletID] IN ("+ strDocTempletID +"))";
- }
- if (strDocTempletName.trim().length()>0)
- {
- strSQL += " and b.[TempletName] LIKE '%" + strDocTempletName + "%'";
- }
- if (strSysDirID.trim().length()>0)
- {
- strSQL += " and b.[SysDirID] = '" + strSysDirID + "'";
- }
- if (strIsAutoBuild.trim().length()>0)
- {
- if (strIsAutoBuild.equalsIgnoreCase("True"))
- strSQL += " and b.[IsAutoBuild] = 1";
- else if (strIsAutoBuild.equalsIgnoreCase("False"))
- strSQL += " and b.[IsAutoBuild] = 0";
- }
- if (strMoveFlowID.trim().length()>0)
- {
- strSQL += " and (a.[MoveFlowID] IN ("+ strMoveFlowID +"))";
- }
- if (strMoveFlowName.trim().length()>0)
- {
- strSQL += " and c.[FlowName] LIKE '%" + strMoveFlowName + "%'";
- }
- if (strUpdateUserID.trim().length()>0)
- {
- strSQL += " and (a.[UpdateUserID] IN ("+ strUpdateUserID +"))";
- }
- if (strUpdateTimeFrom.trim().length()>0)
- {
- strSQL += " and a.[UpdateTime]>='" + strUpdateTimeFrom + " 00:00:00.000'";
- }
- if (strUpdateTimeTo.trim().length()>0)
- {
- strSQL += " and a.[UpdateTime]<='" + strUpdateTimeTo + " 23:59:59.999'";
- }
- if (strUpdateFromIP.trim().length()>0)
- {
- strSQL += " and a.[UpdateFromIP] LIKE '%" + strUpdateFromIP + "%'";
- }
- if (strApproveUserID.trim().length()>0)
- {
- strSQL += " and (a.[ApproveUserID] IN ("+ strApproveUserID +"))";
- }
- if (strIsUseful.trim().length()>0)
- {
- if (strIsUseful.equalsIgnoreCase("True"))
- strSQL += " and a.[IsUseful] = 1";
- else if (strIsUseful.equalsIgnoreCase("False"))
- strSQL += " and a.[IsUseful] = 0";
- }
- 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 (strconfig.trim().length()>0)
- {
- if (strconfig.equalsIgnoreCase("3"))
- {
- strSQL += " and a.[IsUseful] = 1";
- }
- else if (strconfig.equalsIgnoreCase("2"))
- {
- strSQL += " and a.[ApproveUserID] IS NOT NULL and a.[IsUseful] = 0";
- }
- else if (strconfig.equalsIgnoreCase("1"))
- {
- strSQL += " and a.[ApproveUserID] IS NULL";
- }
- else
- {}
- }
- if (strOrderBy.trim().length() > 0)
- {
- if (strIsDesc.equalsIgnoreCase("True"))
- strSQL += " Order by " + strOrderBy + " desc";
- else
- strSQL += " Order by " + strOrderBy + "";
- }
- Vector vt = SQLManager.GetResultSet(strSQL);
- return vt;
- }
- /**
- * 获取符合指定条件的公文流转模板记录集(重载getRecordBySearch方法,按ID主键返回)
- * @param strID 公文流转模板信息唯一标识
- * @param strDocTempletTableName 公文模板表名称
- * @return 符合条件记录向量集
- */
- public static Vector getRecordBySearch(String strID,String strDocTempletTableName)
- {
- Vector vt = getRecordBySearch(strID,"","","","",strDocTempletTableName,"","","","","","","","","","","","","","","","");
- return vt;
- }
- /**
- * 公文流转模板审批
- * @param ApproveUserID 审批用户ID
- * @param ApproveTime 审批时间
- * @param iID 公文流转模板ID
- * @return 成功返回记录ID,失败返回错误代码
- */
- public static int Approve(int ApproveUserID,String ApproveTime,int iID)
- {
- String strSQL="Update " + TableName + " set ApproveUserID=" + ApproveUserID + ",ApproveTime='" +
- ApproveTime + "' where ID=" + iID;
- return SQLManager.ExcuteSQL(strSQL);
- }
- /**
- * 公文流转模板停用
- * @param iID 公文流转模板ID
- * @param StopUseTime 停用时间
- * @return 成功返回记录ID,失败返回错误代码
- */
- public static int Stop(int iID,String StopUseTime)
- {
- String strSQL = "Update " + TableName + " set IsUseful=0,StopUseTime='"+ StopUseTime +"' where ID=" + iID;
- return SQLManager.ExcuteSQL(strSQL);
- }
- /**
- * 公文流转模板启用
- * @param iID 公文流转模板ID
- * @param StarUseTime 启用时间
- * @return 成功返回记录ID,失败返回错误代码
- */
- public static int Start(int iID,String StarUseTime)
- {
- String strSQL = "Update " + TableName + " set IsUseful=1,StarUseTime='"+ StarUseTime +"' where ID=" + iID;
- return SQLManager.ExcuteSQL(strSQL);
- }
- /**
- * 删除审批标记
- * @param iID 公文流转模板ID
- * @return 成功返回记录ID,失败返回错误代码
- */
- public static int UnApprove(int iID)
- {
- String strSQL="Update " + TableName + " set ApproveUserID=null,ApproveTime=null where ID=" + iID;
- return SQLManager.ExcuteSQL(strSQL);
- }
- }