Пример #1
0
    public virtual ERP_CallbackResultType NotifyStartAdvance(string erpFormCode, bool isSubmit)
    {
        Logger.logger.DebugFormat("NotifyStartAdvance_erpFormCode:{0},{1}", erpFormCode, isSubmit);
        try
        {
            string[] toErpString           = CallbackStatus.Split(',');
            ERP_CallbackResultInfo erpback = InvokeService_ERP.InvokeServiceAdvance(new CallbackInfo()
            {
                FormCode   = erpFormCode,
                FormType   = GetErpFormType().ToString(),
                Status     = !isSubmit?"":toErpString[2],
                ArrayParam = isSubmit ? new List <string>() : new List <string>()
                {
                    "CHECK_STATUS"
                }                                                                                  //
            });

            Logger.logger.DebugFormat("erpback:{0}", erpback.Log);
            return(erpback.ResultType);
        }
        catch (Exception ex)
        {
            Logger.logger.DebugFormat("NO:ex:{0}\r\n{1}", ex.Message, ex.StackTrace);
            return(ERP_CallbackResultType.ERP服务器异常);
        }
    }
Пример #2
0
    /// <summary>
    /// 可以继续覆盖重写
    /// </summary>
    /// <param name="k2_workflowId"></param>
    /// <param name="dataFields"></param>
    /// <returns></returns>
    public override Pkurg.PWorldBPM.FinallyDisposeServices.ExecuteResultInfo DoServiceEvent(int k2_workflowId, SerializableDictionary <string, string> dataFields)
    {
        Logger.logger.DebugFormat("Params:{0},{1}", k2_workflowId, dataFields.Keys.Count);
        foreach (KeyValuePair <string, string> item in dataFields)
        {
            Logger.logger.DebugFormat("df:{0}-{1}", item.Key, item.Value);
        }
        Pkurg.PWorldBPM.FinallyDisposeServices.ExecuteResultInfo info = new Pkurg.PWorldBPM.FinallyDisposeServices.ExecuteResultInfo();
        try
        {
            string   erpFormCode  = GetErpFormIdByWorkflowId(k2_workflowId, dataFields);
            string[] toErpString  = CallbackStatus.Split(',');
            string   resultString = dataFields["IsPass"] == "1" ? toErpString[0] : toErpString[1];
            Logger.logger.DebugFormat("Proc:{0},{1}", erpFormCode, resultString);
            if (BeforeNotify(k2_workflowId, dataFields))
            {
                ERP_CallbackResultInfo resultInfo = InvokeService_ERP.InvokeServiceAdvance(new CallbackInfo()
                {
                    FormCode = erpFormCode,
                    FormType = GetErpFormType().ToString(),
                    Status   = resultString
                });

                AfterNotify(k2_workflowId, dataFields, resultInfo);
                if (resultInfo.ResultType == ERP_CallbackResultType.调用成功)
                {
                    info.IsSuccess = true;
                }
                else
                {
                    info.IsSuccess     = false;
                    info.ExecException = "接口调用成功,erp接口返回失败:" + resultInfo.resultXml;
                }
            }
            else
            {
                info.IsSuccess = false;
            }
        }
        catch (Exception ex)
        {
            info.ExecException = ex.StackTrace;
            info.IsSuccess     = false;
        }
        Logger.logger.DebugFormat("Result:{0}", info.IsSuccess);
        Logger.logger.DebugFormat("Result-e:{0}", info.ExecException);
        if (!IsDebug)
        {
            DoSendEmail(k2_workflowId);
        }

        return(info);
    }