Browse Source

加跟踪日志

master
yidi.wu 9 months ago
parent
commit
82651891b9
  1. 13
      北京北汽/Controller/SCP_ASK_CONTROLLER.cs
  2. 6
      北京北汽/Controller/SCP_ASN_CONTROLLER.cs
  3. 8
      北京北汽/Controller/SCP_BARCODE_CONTROLLER _SYJB.cs
  4. 5
      北京北汽/Controller/SCP_BARCODE_CONTROLLER.cs
  5. 5
      北京北汽/Controller/SCP_RECEIVE_CONTROLLER.cs
  6. 2
      北京北汽/Controller/SCP_TB_PRICE_CONTROLLER.cs
  7. 32
      北京北汽/SCP/Business/PageBase.cs
  8. 4
      北京北汽/SCP/Properties/AssemblyInfo.cs
  9. 6
      北京北汽/Utils/LogHelper.cs

13
北京北汽/Controller/SCP_ASK_CONTROLLER.cs

@ -131,7 +131,7 @@ namespace CK.SCP.Controller
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_List", ex.Message.ToString());
if (ex.InnerException != null)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_List", ex.InnerException.Message.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_List(*)", LogHelper.GetExceptionMessage(ex).Message);
}
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
@ -476,6 +476,10 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_ASN_View_List", ex.ToString());
if (ex.InnerException != null)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Get_V_TB_ASK_ASN_View_List(*)", LogHelper.GetExceptionMessage(ex).Message);
}
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
@ -1639,6 +1643,7 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_DETAIL_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
@ -1647,6 +1652,12 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_DETAIL_List", ex.ToString());
if (ex.InnerException != null)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_DETAIL_List(*)", LogHelper.GetExceptionMessage(ex).Message);
}
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)

6
北京北汽/Controller/SCP_ASN_CONTROLLER.cs

@ -134,7 +134,7 @@ namespace CK.SCP.Controller
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Get_V_TB_ASN_List", ex.Message);
if (ex.InnerException != null)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Get_V_TB_ASN_List", ex.InnerException.Message);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Get_V_TB_ASN_List(*)", LogHelper.GetExceptionMessage(ex).Message);
}
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
@ -2011,6 +2011,10 @@ namespace CK.SCP.Controller
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Save_TB_ASN_DETAIL", ex.ToString());
if (ex.InnerException != null)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Save_TB_ASN_DETAIL(*)", LogHelper.GetExceptionMessage(ex).Message);
}
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)

8
北京北汽/Controller/SCP_BARCODE_CONTROLLER _SYJB.cs

@ -136,6 +136,10 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "CreateBarcodeList", ex.ToString());
if (ex.InnerException != null)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "CreateBarcodeList(*)", LogHelper.GetExceptionMessage(ex).Message);
}
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
@ -292,6 +296,10 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "GetBarcodeRule", ex.ToString());
if (ex.InnerException != null)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "GetBarcodeRule(*)", LogHelper.GetExceptionMessage(ex).Message);
}
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)

5
北京北汽/Controller/SCP_BARCODE_CONTROLLER.cs

@ -316,6 +316,11 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "Get_TS_BARCODE_List", ex.ToString());
if (ex.InnerException != null)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "Get_TS_BARCODE_List(*)", LogHelper.GetExceptionMessage(ex).Message);
}
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)

5
北京北汽/Controller/SCP_RECEIVE_CONTROLLER.cs

@ -1354,6 +1354,11 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_RECIVECE_CONTROLLER), "Get_V_TB_ARRIVE_List", ex.ToString());
if (ex.InnerException != null)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_RECIVECE_CONTROLLER), "Get_V_TB_ARRIVE_List(*)", LogHelper.GetExceptionMessage(ex).Message);
}
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)

2
北京北汽/Controller/SCP_TB_PRICE_CONTROLLER.cs

@ -250,7 +250,7 @@ namespace CK.SCP.Controller
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_PRICE_CONTROLLER), "Get_TB_PRICE_List", ex.Message.ToString());
if (ex.InnerException != null)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_PRICE_CONTROLLER), "Get_TB_PRICE_List", ex.InnerException.Message.ToString());
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_PRICE_CONTROLLER), "Get_TB_PRICE_List(*)", LogHelper.GetExceptionMessage(ex).Message);
}
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}

32
北京北汽/SCP/Business/PageBase.cs

@ -32,6 +32,7 @@ using SCP.Common;
using System.Drawing.Imaging;
using System.Drawing;
using System.Net.NetworkInformation;
using System.Text.RegularExpressions;
namespace SCP
{
@ -584,7 +585,7 @@ namespace SCP
}
DateTime now = DateTime.Now;
online.User = user;
online.IPAdddress = Request.UserHostAddress;
online.IPAdddress = GetExternalIpAddress();//Request.UserHostAddress;
online.LoginTime = now;
online.UpdateTime = now;
@ -2047,6 +2048,33 @@ namespace SCP
}
}
return partCodeList;
}
}
public string GetExternalIpAddress()
{
try
{
WebClient client = new WebClient
{
Encoding = System.Text.Encoding.UTF8
};
string responseIpHtml = client.DownloadString("http://ip.chinaz.com/");//站长之家 //https://api.ipify.org
string regMatch = @"<dd class=""fz24"">([\s\S]+?)<\/dd>";
Match mc = Regex.Match(responseIpHtml, regMatch, RegexOptions.Singleline);
if (mc.Success && mc.Groups.Count > 1)
{
responseIpHtml = mc.Groups[1].Value;
return responseIpHtml;
}
else
{
return Request.UserHostAddress;
}
}
catch (Exception)
{
return Request.UserHostAddress;
}
}
}
}

4
北京北汽/SCP/Properties/AssemblyInfo.cs

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值,
// 方法是按如下所示使用 "*":
[assembly: AssemblyVersion("1.23.1023.1")]
[assembly: AssemblyFileVersion("1.23.1023.1")]
[assembly: AssemblyVersion("1.23.1222.1")]
[assembly: AssemblyFileVersion("1.23.1222.1")]

6
北京北汽/Utils/LogHelper.cs

@ -102,6 +102,12 @@ namespace CK.SCP.Utils
}
public static Exception GetExceptionMessage(this Exception ex)
{
if (ex.InnerException == null) return ex;
return ex.InnerException.GetExceptionMessage();
}
}

Loading…
Cancel
Save