コード例 #1
0
        /// <summary>
        /// 添加调用业务接口日志
        /// </summary>
        /// <param name="busServiceInfo"></param>
        /// <param name="param"></param>
        /// <param name="responseString"></param>
        private void AddBusinessInterfaceLog(BusinessServiceInfo busServiceInfo, string param, string responseString)
        {
            if (busServiceInfo.BusInterfaceLog != null)
            {
                busServiceInfo.BusInterfaceLog.Status         = busServiceInfo.ResultInfo.returnStatus;
                busServiceInfo.BusInterfaceLog.K2ID           = busServiceInfo.ProEventMsgInfo.K2ID;
                busServiceInfo.BusInterfaceLog.RequestMessage = param;

                busServiceInfo.BusInterfaceLog.ResponseString  = responseString;
                busServiceInfo.BusInterfaceLog.ResponseMessage = Newtonsoft.Json.JsonConvert.SerializeObject(busServiceInfo.ResultInfo);
                busServiceInfo.BusInterfaceLog.ResponseTime    = DateTime.Now;
            }

            if (busServiceInfo.InterfaceConfig != null)
            {
                busServiceInfo.BusInterfaceLog.InterfaceUrl = busServiceInfo.InterfaceConfig.Url;
            }
            if (busServiceInfo.BegInterfaceTime != null)
            {
                busServiceInfo.BusInterfaceLog.BegInterfaceTime = busServiceInfo.BegInterfaceTime;
            }
            if (busServiceInfo.EndInterfaceTime != null)
            {
                busServiceInfo.BusInterfaceLog.EndInterfaceTime = busServiceInfo.EndInterfaceTime;
            }

            if (busServiceInfo.ResultInfo != null)
            {
                busServiceInfo.BusInterfaceLog.LogID = busServiceInfo.ResultInfo.logId;
            }

            _interfaceLogService.AddBusInterfaceLog(busServiceInfo.BusInterfaceLog);
        }
コード例 #2
0
        /// <summary>
        /// 错误信息返回信息、记录错误日志
        /// </summary>
        /// <param name="proEventMsgInfo"></param>
        /// <param name="resResultInfo"></param>
        private void ReturnErrorInfo(ProcessEventMessage proEventMsgInfo, ResponseResultInfo resResultInfo)
        {
            resResultInfo.returnStatus = 500;
            resResultInfo.returnCode   = "E0001";
            var logItem = new Domain.Models.PrcServer_BusinessInterfaceLog()
            {
                Status           = 500,
                FormID           = proEventMsgInfo.FormId,
                ActivityName     = proEventMsgInfo.ActivityName,
                EventInterfaceId = proEventMsgInfo.EventInterfaceId.ToString(),
                RequstID         = proEventMsgInfo.RequstID,

                RequestTime     = DateTime.Now,
                Parameters      = Newtonsoft.Json.JsonConvert.SerializeObject(proEventMsgInfo),
                ResponseMessage = Newtonsoft.Json.JsonConvert.SerializeObject(resResultInfo),
                ResponseTime    = DateTime.Now,
                IsRetry         = 0
            };

            _interfaceLogService.AddBusInterfaceLog(logItem);
        }