2023-06-27

This commit is contained in:
2023-06-27 23:00:34 +08:00
parent c9f7be6f21
commit 81ac82f854
7 changed files with 84 additions and 13 deletions
@@ -3365,7 +3365,6 @@
</Compile>
<Compile Include="PHTGL\BiddingManagement\BidDocumentsReviewDetail.aspx.cs">
<DependentUpon>BidDocumentsReviewDetail.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PHTGL\BiddingManagement\BidDocumentsReviewDetail.aspx.designer.cs">
<DependentUpon>BidDocumentsReviewDetail.aspx</DependentUpon>
@@ -5,10 +5,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<title>
Spire.Office
</title>
<style>
@@ -130,12 +130,13 @@
type: 'post',
data: {
'UrlStr': url,
'PCUrl': <%=PCUrl%>,
'PCUrl': '<%=PCUrl%>',
},
dataType: 'json',
async: false,
success: function (json) {
if (json.code == 200 || json.code == '200') {
console.log(json)
if (json.code == 1 || json.code == '1') {
alert('保存成功');
} else {
this.error(json, '保存失败');
@@ -157,7 +158,8 @@
type = "mobile";
}
};
var urlString = <%=BLL.Funs.SGGLUrl%>+<%=PCUrl%>, ;
/*var urlString = "https://cloud.e-iceblue.cn/demo/sample.docx";*/
var urlString = "<%=BLL.Funs.SGGLUrl%>"+"<%=PCUrl%>";
var arrfn = urlString.split(".");
var strp = arrfn[arrfn.length - 1];
var documentTypeValue = null;
@@ -64,8 +64,10 @@ namespace FineUIPro.Web.AttachFile
if (!IsPostBack)
{
UserId = Request.Params["UserId"];
// UserId = "C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0";
CanSave = Request.Params["CanSave"];
PCUrl = Request.Params["PCUrl"];
// PCUrl = "https://sggl.sedin.com.cn/FileUpLoad/K350-ZBJH-001.doc";
UserName=BLL.Person_PersonsService.GetPersonsNameById(UserId);
CanSave = "true";
}
@@ -397,9 +397,9 @@ namespace FineUIPro.Web.CQMS.Plan
{
var ins = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanId(Grid1.SelectedRowID);
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/OnlineEditing.aspx?UserId={0}&PCUrl={1}", this.CurrUser.PersonId, ins.FilePath)));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/OnlineEditing.aspx?UserId={0}&PCUrl={1}", this.CurrUser.PersonId, ins.FilePath,"查看 -")));
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}|CQMSMainPlan", Grid1.SelectedRowID, "查看 -")));
PageContext.RegisterStartupScript(Window1.GetHideReference());
// PageContext.RegisterStartupScript(Window1.GetHideReference());
}
else
+60
View File
@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class SaveOnlineFileItem
{
/// <summary>
///
/// </summary>
public string md5
{
get;
set;
}
/// <summary>
///
/// </summary>
public string expires
{
get;
set;
}
/// <summary>
///
/// </summary>
public string disposition
{
get;
set;
}
/// <summary>
/// 文件名称
/// </summary>
public string filename
{
get;
set;
}
/// <summary>
/// 保存路径
/// </summary>
public string PCUrl
{
get;
set;
}
/// <summary>
/// 文件路径
/// </summary>
public string UrlStr
{
get;
set;
}
}
}
+1
View File
@@ -155,6 +155,7 @@
<Compile Include="APIItem\QuarterlyProjectQuality.cs" />
<Compile Include="APIItem\ReturnData.cs" />
<Compile Include="APIItem\SafetyBriefing.cs" />
<Compile Include="APIItem\SaveOnlineFileItem.cs" />
<Compile Include="APIItem\SHHSE\NewSYHSEData.cs" />
<Compile Include="APIItem\SHHSE\NewSYHSEDataHiddenDangerCheckItem.cs" />
<Compile Include="APIItem\SHHSE\NewSYHSEDataItem.cs" />
@@ -4,6 +4,7 @@ using System.Configuration;
using System.Drawing;
using System.IO;
using System.Net.Http;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Web;
@@ -144,11 +145,15 @@ namespace WebAPI.Controllers
/// <param name="toDoItem"></param>
/// <returns></returns>
[HttpPost]
public async Task DownloadDocument([FromBody] Model.ToDoItem toDoItem)
public async Task<Model.ResponeData> DownloadDocument([FromBody] Model.SaveOnlineFileItem toDoItem)
//public async Task<Model.ResponeData> DownloadDocument( string UrlStr, string PCUrl)
{
var responeData = new Model.ResponeData();
HttpClient _httpClient = new HttpClient();
try
{
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
// 发送 GET 请求以获取文件内容
var response = await _httpClient.GetAsync(toDoItem.UrlStr);
response.EnsureSuccessStatusCode();
@@ -166,15 +171,17 @@ namespace WebAPI.Controllers
{
await response.Content.CopyToAsync(fileStream);
}
Console.WriteLine("文件已成功下载并保存到本地。");
responeData.data = "文件已成功下载并保存到本地";
// Console.WriteLine("文件已成功下载并保存到本地。");
}
return responeData;
}
catch (Exception ex)
{
Console.WriteLine($"下载文件时出现错误:{ex.Message}");
responeData.code=0;
responeData.message = $"下载文件时出现错误:{ex.Message}";
return responeData;
}
}
#region