diff --git a/CCFlow/CCFlow/DataUser/API/App_Start/SwaggerConfig.cs b/CCFlow/CCFlow/DataUser/API/App_Start/SwaggerConfig.cs index 30848724..da9263d7 100644 --- a/CCFlow/CCFlow/DataUser/API/App_Start/SwaggerConfig.cs +++ b/CCFlow/CCFlow/DataUser/API/App_Start/SwaggerConfig.cs @@ -28,6 +28,14 @@ namespace CCFlow.DataUser.API { foreach (ApiDescription apiDescription in apiExplorer.ApiDescriptions) { + var _key = "/" + apiDescription.RelativePath.TrimEnd('/'); + // ˽ӿ + if (_key.Contains("/WF/API/")) + { + int idx = _key.IndexOf("?", System.StringComparison.Ordinal); + _key = _key.Substring(0, idx); + } + swaggerDoc.paths.Remove(_key); if (Enumerable.OfType(apiDescription.GetControllerAndActionAttributes()).Any()) { string key = "/" + apiDescription.RelativePath; diff --git a/CCFlow/CCFlow/WF/CCForm/Ath.js b/CCFlow/CCFlow/WF/CCForm/Ath.js index 9c43a3d5..e8b125ec 100644 --- a/CCFlow/CCFlow/WF/CCForm/Ath.js +++ b/CCFlow/CCFlow/WF/CCForm/Ath.js @@ -674,7 +674,15 @@ function GetFileStream(mypk, FK_FrmAttachment) { function Down2018(mypk) { var nodeID = GetQueryString("FK_Node"); var workID = GetQueryString("WorkID"); - + + var FrmAttachmentDBs = new Entities("BP.Sys.FrmAttachmentDBs"); + FrmAttachmentDBs.Retrieve("MyPK", mypk); + + var fileName = FrmAttachmentDBs[0].FileName;//文件名 + var no = webUser.No;//当前登录人ID + var name = webUser.Name;//当前登录人Name + + var url = ""; if (plant == "CCFlow") { var handler = new HttpHandler("BP.WF.HttpHandler.WF_CCForm"); @@ -682,6 +690,7 @@ function Down2018(mypk) { handler.AddPara("FK_Node", nodeID); handler.AddPara("MyPK", mypk); var fileUrl = handler.DoMethodReturnString("AttachmentUpload_Down"); + if (typeof fileUrl === "string" && fileUrl.indexOf("/DataUser/") !=-1 && fileUrl.indexOf("url@") == 0) { var url = fileUrl.replace("url@", ""); window.open(window.location.origin + url); diff --git a/CCFlow/Components/BP.WF/HttpHandler/WF_CCForm.cs b/CCFlow/Components/BP.WF/HttpHandler/WF_CCForm.cs index c11b1c29..1687c0d8 100644 --- a/CCFlow/Components/BP.WF/HttpHandler/WF_CCForm.cs +++ b/CCFlow/Components/BP.WF/HttpHandler/WF_CCForm.cs @@ -18,6 +18,7 @@ using BP.WF.Template.SFlow; using BP.WF.Template.Frm; using Newtonsoft.Json.Linq; using System.Web.Configuration; +using System.Net; namespace BP.WF.HttpHandler { @@ -5694,6 +5695,7 @@ namespace BP.WF.HttpHandler string filepath = ""; if (dbAtt.AthSaveWay == AthSaveWay.IISServer) { + #region 解密下载 //1、先解密到本地 filepath = downDB.FileFullName + ".tmp"; @@ -5735,7 +5737,38 @@ namespace BP.WF.HttpHandler } #endregion } + #region 触发接口 BKGY + //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 = ""; + IPAddress[] addresses = Dns.GetHostAddresses(strHostName); + foreach (IPAddress addr in addresses) + { + if (addr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) + { + clientIPAddress += addr.ToString(); + break; + } + } + string url = "http://172.15.89.222:8080/Personnel/Personnelapi/LogRecording"; + string questbody = ""; + string result = ""; + questbody += "{\r \"OperateUser\": \""; + questbody += BP.Web.WebUser.No; + questbody += "\",\r \"Operate\": \""; + questbody += "下载了" + downDB.FileName + "文件"; + questbody += "\",\r \"OperateIp\": \""; + questbody += clientIPAddress; + questbody += "\",\r \"Flag\": \""; + questbody += "1"; + questbody += "\",\r}"; + + result = PubGlo.HttpPostConnect(url, questbody, "POST", true); + if (DataType.IsNullOrEmpty(result) == true) + return "err@请求失败"; + #endregion if (dbAtt.AthSaveWay == AthSaveWay.FTPServer) { //下载文件的临时位置 @@ -6071,6 +6104,38 @@ namespace BP.WF.HttpHandler } //新文件目录 copyToPath = copyToPath + "//" + db.FileName; + #region 触发接口 BKGY + //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 = ""; + IPAddress[] addresses = Dns.GetHostAddresses(strHostName); + foreach (IPAddress addr in addresses) + { + if (addr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) + { + clientIPAddress += addr.ToString(); + break; + } + } + + string urll = "http://172.15.89.222:8080/Personnel/Personnelapi/LogRecording"; + string questbody = ""; + string result = ""; + questbody += "{\r \"OperateUser\": \""; + questbody += BP.Web.WebUser.No; + questbody += "\",\r \"Operate\": \""; + questbody += "下载了" + db.FileName + "文件"; + questbody += "\",\r \"OperateIp\": \""; + questbody += clientIPAddress; + questbody += "\",\r \"Flag\": \""; + questbody += "1"; + questbody += "\",\r}"; + + result = PubGlo.HttpPostConnect(urll, questbody, "POST", true); + if (DataType.IsNullOrEmpty(result) == true) + return "err@请求失败"; + #endregion if (File.Exists(fileTempDecryPath) == true) {