예제 #1
0
        /// <summary>
        /// 添加调用业务服务错误日志
        /// </summary>
        /// <param name="k2ID"></param>
        /// <param name="busServiceInfo"></param>
        /// <param name="errorCode"></param>
        /// <param name="param"></param>
        /// <param name="responseString"></param>
        public void AddBusErrorLog(BusinessServiceInfo busServiceInfo, int errorCode = 0, string param = "", string responseString = "")
        {
            busServiceInfo.ResultInfo.returnStatus = 500;
            busServiceInfo.ResultInfo.returnCode   = errorCode == 999 ? "E0999" : "E000" + errorCode;

            AddBusinessInterfaceLog(busServiceInfo, param, responseString);
        }
예제 #2
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);
        }
예제 #3
0
        /// <summary>
        /// 初始化 调用业务系统总模型
        /// </summary>
        /// <param name="proEventMsgInfo"></param>
        /// <param name="pushBusInfo"></param>
        /// <returns></returns>
        private BusinessServiceInfo InitBusinessServiceInfo(ProcessEventMessage proEventMsgInfo, PushBusInterfaceModel pushBusInfo)
        {
            var busServiceInfo = new BusinessServiceInfo()
            {
                ProEventMsgInfo = proEventMsgInfo,
                ResultInfo      = new ResponseResultInfo(),

                BusInterfaceLog = new Domain.Models.PrcServer_BusinessInterfaceLog()
                {
                    FormID           = proEventMsgInfo.FormId,
                    K2ID             = proEventMsgInfo.K2ID,
                    ActivityName     = proEventMsgInfo.ActivityName,
                    ActionResult     = pushBusInfo.actionResult,
                    EventInterfaceId = proEventMsgInfo.EventInterfaceId.ToString(),

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

            return(busServiceInfo);
        }