/// <summary> /// 写日志记录 /// </summary> /// <param name="note"></param> /// <param name="logType"></param> /// <param name="ticketSysNo"></param> /// <param name="companyCode"></param> /// <returns></returns> public static int CreateLog(string note, BizLogType logType, int ticketSysNo, string companyCode) { return(ObjectFactory <ICommonBizInteract> .Instance.CreateOperationLog(note , logType , ticketSysNo , companyCode)); }
public virtual int InsertOperationLog(string note, BizLogType logType, int ticketSysNo, string companyCode, string ipAddress) { DataCommand dc = DataCommandManager.GetDataCommand("InsertOperationLog"); dc.SetParameterValueAsCurrentUserSysNo("@OperationUserSysNo"); dc.SetParameterValue("@OperationIP", ipAddress); dc.SetParameterValue("@TicketType", logType); dc.SetParameterValue("@TicketSysNo", ticketSysNo); dc.SetParameterValue("@Note", note); dc.SetParameterValue("@CompanyCode", companyCode); dc.SetParameterValue("@StoreCompanyCode", companyCode); dc.SetParameterValue("@LanguageCode", "zh-CN"); int sysNo = dc.ExecuteScalar <int>(); return(sysNo); }
public static void WriteLog(SOInfo soInfo, BizLogType OperationType, string operationName) { SOLogInfo logInfo = new SOLogInfo { OptType = OperationType, OperationName = operationName, OptIP = string.Empty,//TODO:ServiceContext.Current.ClientIP, OptTime = DateTime.Now, SOSysNo = soInfo.SOSysNo, UserSysNo = 0,//ServiceContext.Current.UserSysNo, CompanyCode = soInfo.CompanyCode }; SOLogNote notInfo = new SOLogNote { ActionName = logInfo.OperationName, SOSysNo = soInfo.SOSysNo, PayType = soInfo.Payment.PayTypeID, RecvSysNo = soInfo.ReceiveAreaSysNo, RecvAddress = soInfo.ReceiveAddress, CustomerSysNo = soInfo.CustomerSysNo, ShipType = soInfo.ShipType.ShipTypeSysNo, SOItems = (from item in soInfo.SOItemList select new SOLogItemEntity { ProductSysNo = 1, Qty = 1, Price = 0 }).ToList() }; logInfo.Note = SerializationUtility.XmlSerialize(notInfo); logInfo.OptIP = string.Empty; //TODO: ServiceContext.Current.ClientIP; logInfo.OptTime = DateTime.Now; logInfo.UserSysNo = 1; // ServiceContext.Current.UserSysNo; DataCommand command = DataCommandManager.GetDataCommand("SO_Insert_SOLog"); command.SetParameterValue <SOLogInfo>(logInfo, true, false); command.ExecuteNonQuery(); }
public virtual int CreateOperationLog(string note, BizLogType logType, int ticketSysNo, string companyCode) { return(ObjectFactory <LogProcessor> .Instance.CreateOperationLog(note, logType, ticketSysNo, companyCode, ServiceContext.Current.ClientIP)); }
public virtual int CreateOperationLog(string note, BizLogType logType, int ticketSysNo, string companyCode, string ipAddress) { return(ObjectFactory <ILogDA> .Instance.InsertOperationLog(note, logType, ticketSysNo, companyCode, ipAddress)); }
public virtual void WriteLog(BizLogType OperationType, string operationName) { ObjectFactory <SOLogProcessor> .Instance.WriteSOLog(OperationType, operationName, CurrentSO); }
private void CreateOperationLog(PriceChangeMaster item, string action, BizLogType logType) { ExternalDomainBroker.CreateOperationLog(string.Format("用户:\"{0}\"{1}了编号为\"{2}\"类型为\"{3}\"的变价单", (string.IsNullOrEmpty(ServiceContext.Current.UserDisplayName) ? "Job" : ServiceContext.Current.UserDisplayName), action, item.SysNo, item.PriceType.ToDisplayText()) , logType, item.SysNo, "8601"); }
public virtual int CreateOperationLog(string note, BizLogType logType, int ticketSysNo, string companyCode) { return(ObjectFactory <LogAppService> .Instance.CreateOperationLog(note, logType, ticketSysNo, companyCode)); }
public RefundResult Refund(RefundEntity entity) { BizLogType RefoundLogType = BizLogType.RMA_Refund_Refund; if (entity.OrderType.GetValueOrDefault() == SOIncomeOrderType.AO) { RefoundLogType = BizLogType.AO_Refund_Refund; } BizLogType RefountType = BizLogType.AO_Refund_Refund; ExternalDomainBroker.CreateOperationLog("支付宝退款开始构建请求参数", RefoundLogType, entity.RefundSysNo, entity.CompanyCode); RefundResult responseResult = null; #region 无密退款 ////////////////////////////////////////////请求参数//////////////////////////////////////////// //服务器异步通知页面路径 string notify_url = string.Empty; //需http://格式的完整路径,不允许加?id=123这类自定义参数 //退款批次号 string batch_no = DateTime.Now.ToString("yyyyMMddHHmmssfff"); //必填,每进行一次即时到账批量退款,都需要提供一个批次号,必须保证唯一性 //退款请求时间 string refund_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //必填,格式为:yyyy-MM-dd hh:mm:ss //退款总笔数 string batch_num = "1"; //必填,即参数detail_data的值中,“#”字符出现的数量加1,最大支持1000笔(即“#”字符出现的最大数量999个) //单笔数据集 string detail_data = ""; NetPayInfo netpayInfo = ObjectFactory <NetPayProcessor> .Instance.GetValidBySOSysNo(entity.SOSysNo); if (netpayInfo != null && !string.IsNullOrWhiteSpace(netpayInfo.ExternalKey)) { //退款详细数据 detail_data += BuildDetailDataString(netpayInfo.ExternalKey.TrimEnd(), entity.RefundAmt.ToString("f2"), "支付宝无线支付退款"); } //必填,格式详见“4.3 单笔数据集参数说明” //////////////////////////////////////////////////////////////////////////////////////////////// #endregion #region 请求参数 : //////////////////////////////////////////////请求参数//////////////////////////////////////////// ////服务器异步通知页面路径 //string notify_url = string.Empty; ////需http://格式的完整路径,不允许加?id=123这类自定义参数 ////卖家支付宝帐户 //string seller_email = "*****@*****.**"; ////卖家UserID: //string seller_user_id = Config.Partner; ////退款当天日期 //string refund_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); ////必填,格式:年[4位]-月[2位]-日[2位] 小时[2位 24小时制]:分[2位]:秒[2位],如:2007-10-01 13:13:13 ////批次号 //string batch_no = DateTime.Now.ToString("yyyyMMddHHmmssfff"); ////必填,格式:当天日期[8位]+序列号[3至24位],如:201008010000001 ////退款笔数 //string batch_num = entity.Count.ToString() ; ////必填,参数detail_data的值中,“#”字符出现的数量加1,最大支持1000笔(即“#”字符出现的数量999个) //string detail_data = ""; //foreach (var item in entity) //{ // NetPayInfo netpayInfo = ObjectFactory<NetPayProcessor>.Instance.GetValidBySOSysNo(item.SOSysNo); // if (netpayInfo!=null&&!string.IsNullOrWhiteSpace(netpayInfo.ExternalKey)) // { // //退款详细数据 // detail_data += BuildDetailDataString(netpayInfo.ExternalKey.TrimEnd(), item.RefundAmt.ToString("f2"), "支付宝无线支付退款"); // } //} ////必填,具体格式请参见接口技术文档 //if (string.IsNullOrWhiteSpace(detail_data)) //{ // return responseResult = new RefundResult() // { // Result = false, // Message = "报错:无有效退款订单" // }; //} //else //{ // detail_data=detail_data.Remove(detail_data.Length - 1); //} ////////////////////////////////////////////////////////////////////////////////////////////////// #endregion //把请求参数打包成数组 SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>(); sParaTemp.Add("partner", Config.Partner); sParaTemp.Add("_input_charset", Config.Input_charset.ToLower()); sParaTemp.Add("service", "refund_fastpay_by_platform_nopwd"); sParaTemp.Add("notify_url", notify_url); sParaTemp.Add("batch_no", batch_no); sParaTemp.Add("refund_date", refund_date); sParaTemp.Add("batch_num", batch_num); sParaTemp.Add("detail_data", detail_data); ExternalDomainBroker.CreateOperationLog("开支请求支付宝退款。", RefoundLogType, entity.RefundSysNo, entity.CompanyCode); //建立请求 string sHtmlText = Submit.BuildRequest(sParaTemp); ExternalDomainBroker.CreateOperationLog(sHtmlText, RefoundLogType, entity.RefundSysNo, entity.CompanyCode); //请在这里加上商户的业务逻辑程序代码 //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— XmlDocument xmlDoc = new XmlDocument(); try { xmlDoc.LoadXml(sHtmlText); string strXmlResponse = xmlDoc.SelectSingleNode("/alipay").InnerText; string result = xmlDoc.SelectSingleNode("/alipay/is_success").InnerText; if (result == "F") { string resultNote = string.Format("用户[{0}]对订单号:{1} 调用了退款接口.调用结果;{2} 调用返回信息:{3} PostUrl:{4} 退款金额:{5}", ServiceContext.Current.UserSysNo, entity.SOSysNo, "False", strXmlResponse, Submit.GATEWAY_NEW, entity.RefundAmt.ToString()); ExternalDomainBroker.CreateOperationLog(resultNote, RefoundLogType, entity.RefundSysNo, entity.CompanyCode); Exception refundException = new Exception(strXmlResponse); return(responseResult = new RefundResult() { Result = false, Message = strXmlResponse }); } else { string resultNote = string.Format("用户[{0}]对订单号:{1} 调用了退款接口.调用结果;{2} 调用返回信息:{3} PostUrl:{4} 退款金额:{5}", ServiceContext.Current.UserSysNo, entity.SOSysNo, "True", strXmlResponse, Submit.GATEWAY_NEW, entity.RefundAmt.ToString()); ExternalDomainBroker.CreateOperationLog(resultNote, RefoundLogType, entity.RefundSysNo, entity.CompanyCode); return(responseResult = new RefundResult() { Result = true, ExternalKey = strXmlResponse }); } } catch (Exception exp) { string resultNote = string.Format("用户[{0}]对订单号:{1} 调用了退款接口.调用结果;{2} 调用返回信息:{3} PostUrl:{4} 退款金额:{5}", ServiceContext.Current.UserSysNo, entity.SOSysNo, "False", exp.Message, Submit.GATEWAY_NEW, entity.RefundAmt.ToString()); ExternalDomainBroker.CreateOperationLog(resultNote, RefoundLogType, entity.RefundSysNo, entity.CompanyCode); return(responseResult = new RefundResult() { Result = false, Message = exp.Message }); } //——请根据您的业务逻辑来编写程序(以上代码仅作参考)—— }
/// <summary> /// 记录biz日志 /// </summary> /// <param name="note">日志内容</param> /// <param name="logType">日志类型</param> /// <param name="ticketSysNo">单据号</param> /// <param name="companyCode">公司编码</param> /// <returns>影响行数</returns> internal static int WriteBizLog(string note, BizLogType logType, int ticketSysNo, string companyCode) { return(CommonBizInteract.CreateOperationLog(note, logType, ticketSysNo, companyCode)); }
/// <summary> /// 添加操作日志 /// </summary> /// <param name="note"></param> /// <param name="logType"></param> /// <param name="ticketSysNo"></param> /// <param name="companyCode"></param> internal static void CreateOperationLog(string note, BizLogType logType, int ticketSysNo, string companyCode) { CommonBizInteract.CreateOperationLog(note, logType, ticketSysNo, companyCode); }
/// <summary> /// 添加操作日志 /// </summary> /// <param name="note"></param> /// <param name="logType"></param> /// <param name="ticketSysNo"></param> /// <param name="companyCode"></param> internal static void CreateOperationLog(string note, BizLogType logType, int ticketSysNo, string companyCode) { ObjectFactory <ICommonBizInteract> .Instance.CreateOperationLog(note, logType, ticketSysNo, companyCode); }