/// <summary> /// 保存通过日志 /// </summary> /// <param name="currentStep"></param> /// <param name="RefID"></param> /// <param name="userID"></param> /// <param name="userName"></param> /// <param name="Content"></param> /// <param name="Conclusion"></param> /// <param name="RefIDType"></param> /// <returns></returns> private bool SaveApproveLog(ProcessStepEntityInfo currentStep, ProcessStepEntityInfo preStep, ProcessStepEntityInfo nextStep, long RefID, int userID, string userName, int nextUserID, string nextUserName, string Content = "", int RefIDType = 0) { //------流程流转日志--------- if (preStep == null)//上一步骤为空 写本次日志 { ProcessStepLogInfo logInfoCurrent = new ProcessStepLogInfo(currentStep, RefID, currentStep.Status, userID, userName, DateTime.Now, userID, userName, DateTime.Now, Content, 1, RefIDType); SaveLog(logInfoCurrent);//记录本次操作的日志,提交人、执行人都为当前用户 } else //上一步骤非空 update本次日志 { ProcessStepLogInfo logInfoCurrent = GetStepLogByRefID(currentStep.ProcessEntityID); logInfoCurrent.ExecutiveBy = userName; logInfoCurrent.ExecutiveByID = userID; logInfoCurrent.ExecutiveTime = DateTime.Now; logInfoCurrent.Content = Content; logInfoCurrent.Conclusion = 1; logInfoCurrent.RefIDType = RefIDType; logInfoCurrent.Status = currentStep.Status; UpdateLog(logInfoCurrent); } if (nextStep != null) //下一步骤非空, insert下一条日志的提交人 { ProcessStepLogInfo logInfoNext = new ProcessStepLogInfo(nextStep, RefID, userID, userName, DateTime.Now); logInfoNext.ExecutiveByID = nextUserID; logInfoNext.ExecutiveBy = nextUserName; SaveLog(logInfoNext); } return(true); }
/// <summary> /// 更新流程操作日志 /// </summary> /// <param name="logInfo"></param> public void UpdateLog(ProcessStepLogInfo logInfo) { SqlMapDAL.CreateNameQuery("UpdateLog") .SetParameter("ExecutiveByID", logInfo.ExecutiveByID) .SetParameter("ExecutiveBy", logInfo.ExecutiveBy) .SetParameter("ExecutiveTime", logInfo.ExecutiveTime) .SetParameter("Content", logInfo.Content) .SetParameter("Conclusion", logInfo.Conclusion) .SetParameter("RefIDType", logInfo.RefIDType) .SetParameter("StepName", logInfo.StepName) .SetParameter("StepNum", logInfo.StepNum) .SetParameter("Status", logInfo.Status) .SetParameter("logID", logInfo.logID) .ExecuteNonQuery(); }
/// <summary> /// 作废业务单据时要终止流程,此时记日志,审批结果为“作废” /// </summary> /// <param name="currentStep"></param> /// <param name="RefID"></param> /// <param name="userID"></param> /// <param name="userName"></param> /// <param name="Content"></param> /// <param name="RefIDType"></param> /// <returns></returns> public bool SaveNullifyLog(ProcessStepEntityInfo currentStep, long RefID, int userID, string userName, string Content, int RefIDType = 0) { ProcessStepLogInfo logInfoCurrent = GetStepLogByRefID(currentStep.ProcessEntityID); logInfoCurrent.ExecutiveBy = userName; logInfoCurrent.ExecutiveByID = userID; logInfoCurrent.ExecutiveTime = DateTime.Now; logInfoCurrent.Content = Content; logInfoCurrent.Conclusion = 2; logInfoCurrent.RefIDType = RefIDType; logInfoCurrent.Status = "已作废"; UpdateLog(logInfoCurrent); return(true); }
/// <summary> /// 添加一条流程操作日志 /// </summary> /// <param name="logInfo"></param> public void SaveLog(ProcessStepLogInfo logInfo) { SqlMapDAL.CreateNameQuery("SaveLog") .SetParameter("ProcessEntityID", logInfo.ProcessEntityID) .SetParameter("RefID", logInfo.RefID) .SetParameter("ExecutiveByID", logInfo.ExecutiveByID) .SetParameter("ExecutiveBy", logInfo.ExecutiveBy) .SetParameter("ExecutiveTime", logInfo.ExecutiveTime) .SetParameter("SubmitterID", logInfo.SubmitterID) .SetParameter("SubmitBy", logInfo.SubmitBy) .SetParameter("SubmitTime", logInfo.SubmitTime) .SetParameter("Content", logInfo.Content) .SetParameter("Conclusion", logInfo.Conclusion) .SetParameter("RefIDType", logInfo.RefIDType) .SetParameter("ProcessStepEntityID", logInfo.ProcessStepEntityID) .SetParameter("StepName", logInfo.StepName) .SetParameter("StepNum", logInfo.StepNum) .SetParameter("Status", logInfo.Status) .ExecuteNonQuery(); }
/// <summary> /// 保存打回日志 /// </summary> /// <param name="currentStep"></param> /// <param name="RefID"></param> /// <param name="userID"></param> /// <param name="userName"></param> /// <param name="Content"></param> /// <param name="Conclusion"></param> /// <param name="RefIDType"></param> /// <returns></returns> private bool SaveFailLog(ProcessStepEntityInfo currentStep, ProcessStepEntityInfo preStep, long RefID, int userID, string userName, string Content = "", int RefIDType = 0) { //------日志--------- ProcessStepLogInfo logInfoCurrent = GetStepLogByRefID(currentStep.ProcessEntityID);//该表单待更新的日志 logInfoCurrent.ExecutiveBy = userName; logInfoCurrent.ExecutiveByID = userID; logInfoCurrent.ExecutiveTime = DateTime.Now; logInfoCurrent.Content = Content; logInfoCurrent.Conclusion = 0; logInfoCurrent.RefIDType = RefIDType; logInfoCurrent.Status = preStep.Status; UpdateLog(logInfoCurrent); if (preStep != null) //上一步骤非空, insert 下一条日志的提交人 { ProcessStepLogInfo logInfoNext = new ProcessStepLogInfo(preStep, RefID, userID, userName, DateTime.Now); SaveLog(logInfoNext); } return(true); }