Ejemplo n.º 1
0
        /// <summary>
        /// 增加异常记录(以实体传值)
        /// </summary>
        /// <param name="conn">OracleConnection </param>
        /// <param name="model">FLOW_EXCEPTIONLOG</param>
        /// <returns></returns>
        public int Add(OracleConnection conn, FLOW_EXCEPTIONLOG model)
        {
            try
            {
                string insSql = "INSERT INTO FLOW_EXCEPTIONLOG (ID,FORMID,MODELCODE,CREATEDATE,CREATENAME,SUBMITINFO,LOGINFO,MODELNAME,OWNERID,OWNERNAME,OWNERCOMPANYID,OWNERCOMPANYNAME,OWNERDEPARMENTID,OWNERDEPARMENTNAME,OWNERPOSTID,OWNERPOSTNAME,AUDITSTATE) VALUES (:ID,:FORMID,:MODELCODE,:CREATEDATE,:CREATENAME,:SUBMITINFO,:LOGINFO,:MODELNAME,:OWNERID,:OWNERNAME,:OWNERCOMPANYID,:OWNERCOMPANYNAME,:OWNERDEPARMENTID,:OWNERDEPARMENTNAME,:OWNERPOSTID,:OWNERPOSTNAME,:AUDITSTATE)";
                OracleParameter[] pageparm =
                {               
                    new OracleParameter(":ID",OracleType.NVarChar,100), 
                    new OracleParameter(":FORMID",OracleType.NVarChar,100), 
                    new OracleParameter(":MODELCODE",OracleType.NVarChar,100), 
                    new OracleParameter(":CREATEDATE",OracleType.DateTime), 
                    new OracleParameter(":CREATENAME",OracleType.NVarChar,100), 
                    new OracleParameter(":SUBMITINFO",OracleType.NVarChar,4000), 
                    new OracleParameter(":LOGINFO",OracleType.Clob), 
                    new OracleParameter(":MODELNAME",OracleType.NVarChar,100), 
                    new OracleParameter(":OWNERID",OracleType.NVarChar,100), 
                    new OracleParameter(":OWNERNAME",OracleType.NVarChar,100), 
                    new OracleParameter(":OWNERCOMPANYID",OracleType.NVarChar,100), 
                    new OracleParameter(":OWNERCOMPANYNAME",OracleType.NVarChar,100), 
                    new OracleParameter(":OWNERDEPARMENTID",OracleType.NVarChar,100), 
                    new OracleParameter(":OWNERDEPARMENTNAME",OracleType.NVarChar,100), 
                    new OracleParameter(":OWNERPOSTID",OracleType.NVarChar,100), 
                    new OracleParameter(":OWNERPOSTNAME",OracleType.NVarChar,100), 
                    new OracleParameter(":AUDITSTATE",OracleType.NVarChar,100) 

                   

                };
                pageparm[0].Value = OracleDataProvider.GetValue(model.ID);//主键ID
                pageparm[1].Value = OracleDataProvider.GetValue(model.FORMID);//业务ID
                pageparm[2].Value = OracleDataProvider.GetValue(model.MODELCODE);//模块代码
                pageparm[3].Value = OracleDataProvider.GetValue(model.CREATEDATE);//创建日期
                pageparm[4].Value = OracleDataProvider.GetValue(model.CREATENAME);//创建人
                pageparm[5].Value = OracleDataProvider.GetValue(model.SUBMITINFO);//提交信息
                pageparm[6].Value = OracleDataProvider.GetValue(model.LOGINFO);//异常日志信息
                pageparm[7].Value = OracleDataProvider.GetValue(model.MODELNAME);//模块名称
                pageparm[8].Value = OracleDataProvider.GetValue(model.OWNERID);//单据所属人ID
                pageparm[9].Value = OracleDataProvider.GetValue(model.OWNERNAME);//单据所属人姓名
                pageparm[10].Value = OracleDataProvider.GetValue(model.OWNERCOMPANYID);//单据所属人公司ID
                pageparm[11].Value = OracleDataProvider.GetValue(model.OWNERCOMPANYNAME);//单据所属人公司名称
                pageparm[12].Value = OracleDataProvider.GetValue(model.OWNERDEPARMENTID);//单据所属人部门ID
                pageparm[13].Value = OracleDataProvider.GetValue(model.OWNERDEPARMENTNAME);//单据所属人部门名称
                pageparm[14].Value = OracleDataProvider.GetValue(model.OWNERPOSTID);//单据所属人岗位ID
                pageparm[15].Value = OracleDataProvider.GetValue(model.OWNERPOSTNAME);//单据所属人岗位名称
                pageparm[16].Value = OracleDataProvider.GetValue(model.AUDITSTATE);//审核状态;审核通过,审核不通过


                return ExecuteSQL(conn, insSql, pageparm);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 增加异常记录(以实体传值)
        /// </summary>
        /// <param name="conn">//OracleConnection </param>
        /// <param name="model">FLOW_EXCEPTIONLOG</param>
        /// <returns></returns>
        public int Add(FLOW_EXCEPTIONLOG model)
        {
            try
            {
                string insSql = "INSERT INTO FLOW_EXCEPTIONLOG (ID,FORMID,MODELCODE,CREATEDATE,CREATENAME,SUBMITINFO,LOGINFO,MODELNAME,OWNERID,OWNERNAME,OWNERCOMPANYID,OWNERCOMPANYNAME,OWNERDEPARMENTID,OWNERDEPARMENTNAME,OWNERPOSTID,OWNERPOSTNAME,AUDITSTATE) VALUES (:ID,:FORMID,:MODELCODE,:CREATEDATE,:CREATENAME,:SUBMITINFO,:LOGINFO,:MODELNAME,:OWNERID,:OWNERNAME,:OWNERCOMPANYID,:OWNERCOMPANYNAME,:OWNERDEPARMENTID,:OWNERDEPARMENTNAME,:OWNERPOSTID,:OWNERPOSTNAME,:AUDITSTATE)";
                Parameter[] pageparm =
                {
                    new Parameter(":ID",null),
                    new Parameter(":FORMID",null),
                    new Parameter(":MODELCODE",null),
                    new Parameter(":CREATEDATE",null),
                    new Parameter(":CREATENAME",null),
                    new Parameter(":SUBMITINFO",null),
                    new Parameter(":LOGINFO",null),
                    new Parameter(":MODELNAME",null),
                    new Parameter(":OWNERID",null),
                    new Parameter(":OWNERNAME",null),
                    new Parameter(":OWNERCOMPANYID",null),
                    new Parameter(":OWNERCOMPANYNAME",null),
                    new Parameter(":OWNERDEPARMENTID",null),
                    new Parameter(":OWNERDEPARMENTNAME",null),
                    new Parameter(":OWNERPOSTID",null),
                    new Parameter(":OWNERPOSTNAME",null),
                    new Parameter(":AUDITSTATE",null)

                };
                pageparm[0].ParameterValue = (model.ID);//主键ID
                pageparm[1].ParameterValue = (model.FORMID);//业务ID
                pageparm[2].ParameterValue = (model.MODELCODE);//模块代码
                pageparm[3].ParameterValue = (model.CREATEDATE);//创建日期
                pageparm[4].ParameterValue = (model.CREATENAME);//创建人
                pageparm[5].ParameterValue = (model.SUBMITINFO);//提交信息
                pageparm[6].ParameterValue = (model.LOGINFO);//异常日志信息
                pageparm[7].ParameterValue = (model.MODELNAME);//模块名称
                pageparm[8].ParameterValue = (model.OWNERID);//单据所属人ID
                pageparm[9].ParameterValue = (model.OWNERNAME);//单据所属人姓名
                pageparm[10].ParameterValue = (model.OWNERCOMPANYID);//单据所属人公司ID
                pageparm[11].ParameterValue = (model.OWNERCOMPANYNAME);//单据所属人公司名称
                pageparm[12].ParameterValue = (model.OWNERDEPARMENTID);//单据所属人部门ID
                pageparm[13].ParameterValue = (model.OWNERDEPARMENTNAME);//单据所属人部门名称
                pageparm[14].ParameterValue = (model.OWNERPOSTID);//单据所属人岗位ID
                pageparm[15].ParameterValue = (model.OWNERPOSTNAME);//单据所属人岗位名称
                pageparm[16].ParameterValue = (model.AUDITSTATE);//审核状态;审核通过,审核不通过

                return ExecuteSQL(insSql, pageparm);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 将异常信息记录到流程监控表里
        /// </summary>
        /// <param name="submitData">SubmitData</param>
        /// <param name="flowUser">FlowUser</param>
        public static void AddFlowMonitor(SubmitData submitData, FlowUser flowUser)
        {
            try
            {
                #region 提交信息
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("submitData.FlowSelectType =FlowSelectType." + submitData.FlowSelectType + ";");
                sb.AppendLine("submitData.FormID = \"" + submitData.FormID + "\";");
                sb.AppendLine("submitData.ModelCode = \"" + submitData.ModelCode + "\";");
                sb.AppendLine("submitData.ApprovalUser = new UserInfo();");
                sb.AppendLine("submitData.ApprovalUser.CompanyID = \"" + submitData.ApprovalUser.CompanyID + "\";");
                sb.AppendLine("submitData.ApprovalUser.DepartmentID = \"" + submitData.ApprovalUser.DepartmentID + "\";");
                sb.AppendLine("submitData.ApprovalUser.PostID = \"" + submitData.ApprovalUser.PostID + "\";");
                sb.AppendLine("submitData.ApprovalUser.UserID = \"" + submitData.ApprovalUser.UserID + "\";");
                sb.AppendLine("submitData.ApprovalUser.UserName = \"" + submitData.ApprovalUser.UserName + "\";");
                sb.AppendLine("submitData.NextStateCode = \"" + (submitData.NextStateCode != null ? submitData.NextStateCode : "空") + "\";");
                sb.AppendLine("submitData.NextApprovalUser = new UserInfo();");
                sb.AppendLine("submitData.NextApprovalUser.CompanyID = \"" + (submitData.NextApprovalUser != null ? submitData.NextApprovalUser.CompanyID : "空") + "\";");
                sb.AppendLine("submitData.NextApprovalUser.DepartmentID = \"" + (submitData.NextApprovalUser != null ? submitData.NextApprovalUser.DepartmentID : "空") + "\";");
                sb.AppendLine("submitData.NextApprovalUser.PostID = \"" + (submitData.NextApprovalUser != null ? submitData.NextApprovalUser.PostID : "空") + "\";");
                sb.AppendLine("submitData.NextApprovalUser.UserID = \"" + (submitData.NextApprovalUser != null ? submitData.NextApprovalUser.UserID : "空") + "\";");
                sb.AppendLine("submitData.NextApprovalUser.UserName = \"" + (submitData.NextApprovalUser != null ? submitData.NextApprovalUser.UserName : "******") + "\";");
                sb.AppendLine("submitData.SubmitFlag = SubmitFlag." + submitData.SubmitFlag + ";");
                // sb.AppendLine("submitData.XML = \"" + submitData.XML + "\";");
                sb.AppendLine("submitData.FlowType = FlowType." + submitData.FlowType.ToString() + ";");
                sb.AppendLine("submitData.ApprovalResult = ApprovalResult." + submitData.ApprovalResult.ToString() + ";");
                sb.AppendLine("submitData.ApprovalContent = \"" + submitData.ApprovalContent + "\";");

                #region 提交人信息
                sb.AppendLine("submitData.SumbitCompanyID = \"" + submitData.SumbitCompanyID + "\";");
                sb.AppendLine("submitData.SumbitDeparmentID = \"" + submitData.SumbitDeparmentID + "\";");
                sb.AppendLine("submitData.SumbitPostID = \"" + submitData.SumbitPostID + "\";");
                sb.AppendLine("submitData.SumbitUserID = \"" + submitData.SumbitUserID + "\";");
                sb.AppendLine("submitData.SumbitUserName = \"" + submitData.SumbitUserName + "\";");

                #endregion
                #endregion
                FLOW_EXCEPTIONLOG entity = new FLOW_EXCEPTIONLOG();

                entity.ID = Guid.NewGuid().ToString().Replace("-", "");//主键ID
                entity.FORMID = submitData.FormID;//业务ID
                entity.MODELCODE = submitData.ModelCode;//模块代码
                entity.CREATEDATE = DateTime.Now;//创建日期
                entity.CREATENAME = submitData.SumbitUserID == null ? submitData.ApprovalUser.UserName : submitData.SumbitUserName;//创建人
                entity.SUBMITINFO = sb.ToString();//提交信息
                entity.LOGINFO = flowUser.ErrorMsg;//异常日志信息
                entity.MODELNAME = flowUser.ModelName;//模块名称
                entity.OWNERID = submitData.ApprovalUser.UserID;//单据所属人ID
                entity.OWNERNAME = submitData.ApprovalUser.UserName;//单据所属人姓名
                entity.OWNERCOMPANYID = submitData.ApprovalUser.CompanyID;//单据所属人公司ID
                entity.OWNERCOMPANYNAME =(submitData.SumbitUserID == submitData.ApprovalUser.UserID)?flowUser.CompayName: submitData.ApprovalUser.CompanyName;//单据所属人公司名称
                entity.OWNERDEPARMENTID = submitData.ApprovalUser.DepartmentID;//单据所属人部门ID
                entity.OWNERDEPARMENTNAME = (submitData.SumbitUserID == submitData.ApprovalUser.UserID) ? flowUser.DepartmentName : submitData.ApprovalUser.DepartmentName;//单据所属人部门名称
                entity.OWNERPOSTID = submitData.ApprovalUser.PostID;//单据所属人岗位ID
                entity.OWNERPOSTNAME = (submitData.SumbitUserID == submitData.ApprovalUser.UserID) ? flowUser.PostName : submitData.ApprovalUser.PostName;//单据所属人岗位名称
                entity.AUDITSTATE = submitData.ApprovalResult == ApprovalResult.Pass ? "审核通过" : "审核不通过";//审核状态;审核通过,审核不通过
                FLOW_EXCEPTIONLOGDAL dal = new FLOW_EXCEPTIONLOGDAL();
                dal.Add( entity);
                Tracer.Debug("Formid=" + submitData.FormID + ";将异常信息记录到流程监控表里,成功!");
            }
            catch (Exception e)
            {
                Tracer.Debug("Formid=" + submitData.FormID + ";将异常信息记录到流程监控表里,出错:异常信息:" + e.ToString());
               // throw  e;
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 运维人员处理异常记录
 /// </summary>
 /// <param name="conn">//OracleConnection</param>
 /// <param name="model">FLOW_EXCEPTIONLOG</param>
 /// <returns></returns>
 public int Update(FLOW_EXCEPTIONLOG model)
 {
     try
     {
         string updSql = "UPDATE FLOW_EXCEPTIONLOG SET STATE=:STATE,UPDATEDATE=:UPDATEDATE,UPDATENAME=:UPDATENAME,REMARK=:REMARK WHERE   ID=:ID";
         Parameter[] pageparm =
         {
             new Parameter(":ID",null),
             new Parameter(":STATE",null),
             new Parameter(":UPDATEDATE",OracleType.DateTime),
             new Parameter(":UPDATENAME",null),
             new Parameter(":REMARK",null)
         };
         pageparm[0].ParameterValue = (model.ID);//主键ID
         pageparm[1].ParameterValue = (model.STATE);//状态:未处理;已处理
         pageparm[2].ParameterValue = (DateTime.Now);//处理日期
         pageparm[3].ParameterValue = (model.UPDATENAME);//处理人
         pageparm[4].ParameterValue = (model.REMARK);//备注
         return ExecuteSQL(updSql, pageparm);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message, e);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 运维人员处理异常记录
 /// </summary>
 /// <param name="conn">OracleConnection</param>
 /// <param name="model">FLOW_EXCEPTIONLOG</param>
 /// <returns></returns>
 public int Update(OracleConnection conn, FLOW_EXCEPTIONLOG model)
 {
     try
     {
         string updSql = "UPDATE FLOW_EXCEPTIONLOG SET STATE=:STATE,UPDATEDATE=:UPDATEDATE,UPDATENAME=:UPDATENAME,REMARK=:REMARK WHERE   ID=:ID";
         OracleParameter[] pageparm =
         {               
             new OracleParameter(":ID",OracleType.NVarChar,100), 
             new OracleParameter(":STATE",OracleType.NVarChar,100), 
             new OracleParameter(":UPDATEDATE",OracleType.DateTime), 
             new OracleParameter(":UPDATENAME",OracleType.NVarChar,100), 
             new OracleParameter(":REMARK",OracleType.NVarChar,4000) 
         };
         pageparm[0].Value = OracleDataProvider.GetValue(model.ID);//主键ID
         pageparm[1].Value = OracleDataProvider.GetValue(model.STATE);//状态:未处理;已处理
         pageparm[2].Value = OracleDataProvider.GetValue(DateTime.Now);//处理日期
         pageparm[3].Value = OracleDataProvider.GetValue(model.UPDATENAME);//处理人
         pageparm[4].Value = OracleDataProvider.GetValue(model.REMARK);//备注
         return ExecuteSQL(conn, updSql, pageparm);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message, e);
     }
 }