protected override void AfterExecute(TEntityCustomLog log) { if (QtyLoaded != null) { try { TWaitting.Instance.ShowWaitForm("更新批次系统提料数量"); // 更新批次系统中的提料数量 List <TTableRSFactPWOMaterialTrack> datas = DAL.TDBHelper.GetMaterialTrack( skuID, orderNo, Tools.ConvertToInt32(orderLineNo)); if (datas != null && datas.Count > 0) { datas[0].QtyLoaded = QtyLoaded.IntValue; DAL.TDBHelper.UpdateMaterialTrack(datas[0]); } TWaitting.Instance.CloseWaitForm(); } catch (Exception error) { TWaitting.Instance.CloseWaitForm(); MSGHelp.Instance.ShowErrorMessage(error); } } }
protected void CopyFrom(TEntityCustomLog data) { LogID = data.LogID; PartitioningKey = data.PartitioningKey; TimeWritten = data.TimeWritten; ExCode = data.ExCode; CorrelationID = data.CorrelationID; WSDLParameterID = data.WSDLParameterID; RetryCycle = data.RetryCycle; ExChangeXML = data.ExChangeXML; Properties = data.Properties; ErrCode = data.ErrCode; ErrText = data.ErrText; LinkedLogID = data.LinkedLogID; Retried = data.Retried; NextRetryTime = data.NextRetryTime; }
protected override void AfterExecute(TEntityCustomLog log) { if (log.ErrCode == 0) { string[] splitString = log.ErrText.Split(','); string recvBatchNo = splitString[49].Replace("\"", ""); string strSQL = "UPDATE IRAPRIMCS..utb_MaterialStore " + "SET RecvBatchNo=@RecvBatchNo " + "WHERE SKUID=@SKUID"; IList <IDataParameter> paramList = new List <IDataParameter>(); paramList.Add(new IRAPProcParameter("@RecvBatchNo", DbType.String, recvBatchNo)); paramList.Add(new IRAPProcParameter("@SKUID", DbType.String, skuID)); try { using (IRAPSQLConnection conn = new IRAPSQLConnection(SysParams.Instance.DBConnectionString)) { conn.Update(strSQL, paramList); } } catch (Exception error) { MSGHelp.Instance.ShowErrorMessage( string.Format( "将SKUID[{0}]的RecvBatchNo更新为[{1}]的操作未成功,原因:[{2}]", skuID, recvBatchNo, error.Message)); } } else { MSGHelp.Instance.ShowErrorMessage( string.Format( "执行未成功,不能进行后续处理,结果:[{0}]", log.ErrText)); } }
public TEntityPICK08(TEntityCustomLog source) : this() { CopyFrom(source); }
public TEntityIMTR01(TEntityCustomLog source) : this() { CopyFrom(source); }
public TEntityMORV00(TEntityCustomLog source) : this() { CopyFrom(source); }
/// <summary> /// 处理当前的日志 /// </summary> public void Do() { if (ShowEditorDialogs()) { string newXMLString = (ExChange[0] as IXMLNodeObject).GetXMLString(); TEntityCustomLog logWait4Exec = null; if (ErrCode != 0 && !Retried) { // 当前日志的最新待重试记录 try { TWaitting.Instance.ShowWaitForm("获取最新待重试记录"); logWait4Exec = DAL.TDBHelper.GetLastUnsuccessedLogWithLinkedLogID(LinkedLogID); } catch (Exception error) { TWaitting.Instance.CloseWaitForm(); MSGHelp.Instance.ShowErrorMessage(error); return; } } else { logWait4Exec = this; } if (logWait4Exec == null) { Exception error = new Exception(); error.Data["ErrCode"] = 999999; error.Data["ErrText"] = "当前待处理的日志已经被批量作业处理成功"; TWaitting.Instance.CloseWaitForm(); MSGHelp.Instance.ShowErrorMessage(error); } else { using (IRAPSQLConnection conn = new IRAPSQLConnection(SysParams.Instance.DBConnectionString)) { try { TWaitting.Instance.ShowWaitForm("更新日志记录"); logWait4Exec.ExChangeXML = (ExChange[0] as IXMLNodeObject).GetXMLString(); IList <IDataParameter> paramList = new List <IDataParameter>(); paramList.Add(new IRAPProcParameter("@ExChangeXML", DbType.Xml, newXMLString)); paramList.Add(new IRAPProcParameter("@LogID", DbType.Int64, LogID)); conn.Update( "UPDATE IRAP..stb_Log_WebServiceShuttling " + "SET ExChangeXML=@ExChangeXML " + "WHERE LogID=@LogID", paramList); } catch (Exception error) { error.Data["ErrCode"] = 999999; error.Data["ErrText"] = string.Format( "更新日志记录时发生异常:[{0}]", error.Message); TWaitting.Instance.CloseWaitForm(); MSGHelp.Instance.ShowErrorMessage(error); return; } int errCode = 0; string errText = ""; try { TWaitting.Instance.ShowWaitForm("调用 WebService"); IList <IDataParameter> paramList = new List <IDataParameter>(); paramList.Add(new IRAPProcParameter("@CommunityID", DbType.Int32, 60010)); paramList.Add(new IRAPProcParameter("@SysLogID", DbType.Int64, 1)); paramList.Add(new IRAPProcParameter("@WSSLogID", DbType.Int64, logWait4Exec.LogID)); paramList.Add(new IRAPProcParameter("@ErrCode", DbType.Int32, ParameterDirection.Output, 4)); paramList.Add(new IRAPProcParameter("@ErrText", DbType.String, ParameterDirection.Output, 400)); IRAPError error = conn.CallProc("IRAP..ssp_BackgroundJob_WSRetry", ref paramList); errCode = error.ErrCode; errText = error.ErrText; if (errCode != 0) { MSGHelp.Instance.ShowErrorMessage(errText); return; } } catch (Exception error) { error.Data["ErrCode"] = 999999; error.Data["ErrText"] = string.Format( "执行 IRAP..ssp_BackgroundJob_WSRetry 时发生异常:[{0}]", error.Message); TWaitting.Instance.CloseWaitForm(); MSGHelp.Instance.ShowErrorMessage(error); return; } try { TWaitting.Instance.ShowWaitForm("获取执行结果"); IList <TEntityCustomLog> datas = conn.CallTableFunc <TEntityCustomLog>( string.Format( "SELECT TOP 1 * FROM IRAP..stb_Log_WebServiceShuttling " + "WHERE LinkedLogID={0} ORDER BY LogID DESC", logWait4Exec.LinkedLogID), new List <IDataParameter>()); if (datas.Count > 0) { logWait4Exec = datas[0]; } else { logWait4Exec = null; } if (logWait4Exec != null) { if (logWait4Exec.ErrCode == 0) { //MSGHelp.Instance.ShowNormalMessage("手工处理成功,稍后进行后续处理"); AfterExecute(logWait4Exec); } else { MSGHelp.Instance.ShowErrorMessage( logWait4Exec.ErrCode, logWait4Exec.ErrText); } } else { MSGHelp.Instance.ShowErrorMessage("未获取到执行的结果"); } } catch (Exception error) { MSGHelp.Instance.ShowErrorMessage(error); } } } } }
protected virtual void AfterExecute(TEntityCustomLog log) { }