diff --git a/CCFlow/.vs/CCFlowCloud/v17/.suo b/CCFlow/.vs/CCFlowCloud/v17/.suo index 06931fc2..f0f4640f 100644 Binary files a/CCFlow/.vs/CCFlowCloud/v17/.suo and b/CCFlow/.vs/CCFlowCloud/v17/.suo differ diff --git a/CCFlow/Components/BP.WF/Dev2Interface.cs b/CCFlow/Components/BP.WF/Dev2Interface.cs index d6d32ce1..209dad13 100644 --- a/CCFlow/Components/BP.WF/Dev2Interface.cs +++ b/CCFlow/Components/BP.WF/Dev2Interface.cs @@ -6782,6 +6782,7 @@ namespace BP.WF BP.Port.Emp emp = new Emp(); foreach (string empID in strs) { + emp = new Emp(); if (DataType.IsNullOrEmpty(empID) == true) continue; diff --git a/CCFlow/Components/BP.WF/HttpHandler/WF_CCForm.cs b/CCFlow/Components/BP.WF/HttpHandler/WF_CCForm.cs index b02250fa..a6e01425 100644 --- a/CCFlow/Components/BP.WF/HttpHandler/WF_CCForm.cs +++ b/CCFlow/Components/BP.WF/HttpHandler/WF_CCForm.cs @@ -5660,12 +5660,40 @@ namespace BP.WF.HttpHandler // return AttachmentUpload_Down(true); return AttachmentUpload_Down(); } + #region 获取ip(包括获取本机ip) + public static string GetIP4Address() + { + string IP4Address = String.Empty; + foreach (IPAddress IPA in Dns.GetHostAddresses(HttpContext.Current.Request.UserHostAddress)) + { + if (IPA.AddressFamily.ToString() == "InterNetwork") + { + IP4Address = IPA.ToString(); + break; + } + } + if (IP4Address != String.Empty) + { + return IP4Address; + } + foreach (IPAddress IPA in Dns.GetHostAddresses(Dns.GetHostName())) + { + if (IPA.AddressFamily.ToString() == "InterNetwork") + { + IP4Address = IPA.ToString(); + break; + } + } + return IP4Address; + } + #endregion /// /// 下载 /// /// public string AttachmentUpload_Down() { + //获取文件是否加密 bool fileEncrypt = BP.Difference.SystemConfig.isEnableAthEncrypt; FrmAttachmentDB downDB = new FrmAttachmentDB(); @@ -5690,7 +5718,7 @@ namespace BP.WF.HttpHandler gwf.Update(); } } - + string ip = GetIP4Address(); bool isEncrypt = downDB.GetParaBoolen("IsEncrypt"); string filepath = ""; @@ -5742,8 +5770,6 @@ namespace BP.WF.HttpHandler //string clientIP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; string strHostName = System.Net.Dns.GetHostName(); //string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString(); - string clientIPAddress = this.Address; - string ip = HttpContext.Current.Request.Headers["X-Forwarded-For"]; string url = "http://172.15.89.222:8080/Personnel/Personnelapi/LogRecording"; string questbody = ""; string result = ""; @@ -5752,7 +5778,7 @@ namespace BP.WF.HttpHandler questbody += "\",\r \"Operate\": \""; questbody += "下载了" + downDB.FileName + "文件"; questbody += "\",\r \"OperateIp\": \""; - questbody += clientIPAddress; + questbody += ip; questbody += "\",\r \"Flag\": \""; questbody += "1"; questbody += "\",\r}"; @@ -6097,10 +6123,8 @@ namespace BP.WF.HttpHandler //新文件目录 copyToPath = copyToPath + "//" + db.FileName; #region 触发接口 BKGY - //string clientIP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; + string ip = GetIP4Address();//获取ip地址 string strHostName = System.Net.Dns.GetHostName(); - //string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString(); - string clientIPAddress = this.Address; string urll = "http://172.15.89.222:8080/Personnel/Personnelapi/LogRecording"; string questbody = ""; string result = ""; @@ -6109,7 +6133,7 @@ namespace BP.WF.HttpHandler questbody += "\",\r \"Operate\": \""; questbody += "下载了" + db.FileName + "文件"; questbody += "\",\r \"OperateIp\": \""; - questbody += clientIPAddress; + questbody += ip; questbody += "\",\r \"Flag\": \""; questbody += "1"; questbody += "\",\r}";