|
|
@@ -4958,7 +4958,7 @@ FROM
|
|
|
string group_unique_name = $"{groupInfo.TeamName}_{Guid.NewGuid().ToString("N").Substring(0, 10)}";
|
|
|
|
|
|
//访问路径
|
|
|
- var serverPath = $"http://132.232.92.186:24/Office/Word/VisaClientData/Downloads/{group_unique_name}/";
|
|
|
+ var serverPath = $"http://119.45.113.139:24/Office/Word/VisaClientData/Downloads/{group_unique_name}/";
|
|
|
|
|
|
//模板存储位置
|
|
|
var tempPath = $"D:/FTP/File/OA2023/Office/Word/VisaClientData/Template/";
|
|
|
@@ -8464,7 +8464,7 @@ FROM
|
|
|
string group_unique_name = $"{visaBasicData.groupInfo.TeamName}";
|
|
|
|
|
|
//访问路径
|
|
|
- var serverPath = $"http://132.232.92.186:24/Office/Word/VisaClientData/Downloads/{group_unique_name}/";
|
|
|
+ var serverPath = $"http://119.45.113.139:24/Office/Word/VisaClientData/Downloads/{group_unique_name}/";
|
|
|
|
|
|
// 服务器存储文件位置
|
|
|
var fileServerPath = $"D:/FTP/File/OA2023/Office/Word/VisaClientData/Downloads/{group_unique_name}/";
|
|
|
@@ -8592,7 +8592,7 @@ FROM
|
|
|
string group_unique_name = $"{visaBasicData.groupInfo.TeamName}";
|
|
|
|
|
|
//访问路径
|
|
|
- var serverPath = $"http://132.232.92.186:24/Office/Word/VisaClientData/Downloads/{group_unique_name}/";
|
|
|
+ var serverPath = $"http://119.45.113.139:24/Office/Word/VisaClientData/Downloads/{group_unique_name}/";
|
|
|
|
|
|
// 服务器存储文件位置
|
|
|
var fileServerPath = $"D:/FTP/File/OA2023/Office/Word/VisaClientData/Downloads/{group_unique_name}/";
|
|
|
@@ -9541,7 +9541,7 @@ FROM
|
|
|
}
|
|
|
|
|
|
// 文件下载地址
|
|
|
- downloadUrl = saveUrl.Replace(@"\", @"/").Replace("D:/FTP/File/OA2023", "http://132.232.92.186:24");
|
|
|
+ downloadUrl = saveUrl.Replace(@"\", @"/").Replace("D:/FTP/File/OA2023", "http://119.45.113.139:24");
|
|
|
return (true, saveUrl, downloadUrl);
|
|
|
}
|
|
|
|
|
|
@@ -9843,7 +9843,7 @@ FROM
|
|
|
var groupName = dataBody.groupInfo?.TeamName ?? $"";
|
|
|
|
|
|
//访问路径
|
|
|
- var serverPath = $"http://132.232.92.186:24/Office/Word/VisaClientData/Downloads/{groupName}/派遣函/";
|
|
|
+ var serverPath = $"http://119.45.113.139:24/Office/Word/VisaClientData/Downloads/{groupName}/派遣函/";
|
|
|
|
|
|
// 服务器存储文件位置
|
|
|
var fileServerPath = $"D:/FTP/File/OA2023/Office/Word/VisaClientData/Downloads/{groupName}/派遣函/";
|
|
|
@@ -9856,7 +9856,7 @@ FROM
|
|
|
// 转换为下载地址
|
|
|
string downloadUrl = fullPath
|
|
|
.Replace(@"\", "/")
|
|
|
- .Replace("D:/FTP/File/OA2023", "http://132.232.92.186:24", StringComparison.OrdinalIgnoreCase);
|
|
|
+ .Replace("D:/FTP/File/OA2023", "http://119.45.113.139:24", StringComparison.OrdinalIgnoreCase);
|
|
|
|
|
|
return (true, fullPath, downloadUrl);
|
|
|
}
|
|
|
@@ -11743,7 +11743,7 @@ FROM
|
|
|
Grp_DecreasePayments gdpRes = _DecreasePayments.Where(s => s.Id == entity.CId).FirstOrDefault();
|
|
|
if (gdpRes != null)
|
|
|
{
|
|
|
- //var urlBase = $"http://132.232.92.186:24/Office/GrpFile/http://132.232.92.186:24/Office/GrpFile/%E5%9B%A2%E7%BB%84%E5%A2%9E%E5%87%8F%E6%AC%BE%E9%A1%B9%E7%9B%B8%E5%85%B3%E6%96%87%E4%BB%B6/";
|
|
|
+ //var urlBase = $"http://119.45.113.139:24/Office/GrpFile/http://119.45.113.139:24/Office/GrpFile/%E5%9B%A2%E7%BB%84%E5%A2%9E%E5%87%8F%E6%AC%BE%E9%A1%B9%E7%9B%B8%E5%85%B3%E6%96%87%E4%BB%B6/";
|
|
|
//if (!string.IsNullOrEmpty(gdpRes.FilePath))
|
|
|
//{
|
|
|
// _detail.FileUrl = $"{urlBase}{gdpRes.FilePath}";
|
|
|
@@ -12266,7 +12266,7 @@ FROM
|
|
|
public async Task<IActionResult> FeeAuditOtherFileDownlaod([Range(1, int.MaxValue, ErrorMessage = "请传入有效的ID")] int id)
|
|
|
{
|
|
|
//网站域名
|
|
|
- const string baseUrl = "http://132.232.92.186:24/Office/GrpFile/%E5%9B%A2%E7%BB%84%E5%A2%9E%E5%87%8F%E6%AC%BE%E9%A1%B9%E7%9B%B8%E5%85%B3%E6%96%87%E4%BB%B6/";
|
|
|
+ const string baseUrl = "http://119.45.113.139:24/Office/GrpFile/%E5%9B%A2%E7%BB%84%E5%A2%9E%E5%87%8F%E6%AC%BE%E9%A1%B9%E7%9B%B8%E5%85%B3%E6%96%87%E4%BB%B6/";
|
|
|
|
|
|
var otherInfo = await _decreasePaymentsRep._sqlSugar
|
|
|
.Queryable<Grp_DecreasePayments>()
|
|
|
@@ -27429,7 +27429,7 @@ end as 'country'
|
|
|
var io = new IOOperatorHelper();
|
|
|
var byts = io.ConvertZipStream(Zips);
|
|
|
io.ByteToFile(byts, AppSettingsHelper.Get("ExcelBasePath") + $"\\ExportLocalGuidePriceDetail\\{group.TeamName}_地接费用明细.zip");
|
|
|
- //http://132.232.92.186:24/Office/Word/EnterExitCost/File/
|
|
|
+ //http://119.45.113.139:24/Office/Word/EnterExitCost/File/
|
|
|
jw = JsonView(true, "success", new { url = AppSettingsHelper.Get("OfficeBaseUrl") + $"\\Office\\Excel\\ExportLocalGuidePriceDetail\\{group.TeamName}_地接费用明细.zip" });
|
|
|
}
|
|
|
else
|
|
|
@@ -38780,7 +38780,8 @@ ORDER BY
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- return Ok(JsonView(false, $"上传失败:{ex.Message}"));
|
|
|
+ _logger.LogError(ex, "ConferenceAffairsChildImageUpload失败 | childId={ChildId} FileCount={FileCount}", Dto?.childId, Dto?.Files?.Count);
|
|
|
+ return Ok(JsonView(false, $"上传失败:{ex.GetType().Name}: {ex.Message}", new { StackTrace = ex.ToString() }));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -39671,6 +39672,8 @@ ORDER BY
|
|
|
[HttpPost]
|
|
|
public async Task<IActionResult> ConferenceAffairsFileDown(ConferenceAffairsFileDownDto Dto)
|
|
|
{
|
|
|
+ try
|
|
|
+ {
|
|
|
var FileType = new[]
|
|
|
{
|
|
|
new { Id = 0 , Name = "成本下载" },
|
|
|
@@ -39781,15 +39784,56 @@ ORDER BY
|
|
|
designer.SetDataSource(dt1);
|
|
|
|
|
|
designer.Process();
|
|
|
- designer.Workbook.Save(outputPath);
|
|
|
+
|
|
|
+ // 确保输出目录存在(如 total/ 未创建会导致保存失败)
|
|
|
+ var outputDir = Path.GetDirectoryName(outputPath);
|
|
|
+ if (!string.IsNullOrEmpty(outputDir) && !Directory.Exists(outputDir))
|
|
|
+ {
|
|
|
+ Directory.CreateDirectory(outputDir);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 目标文件若为只读则先清除只读属性,否则 Save 会报 UnauthorizedAccessException
|
|
|
+ var outputFileName = $"{di.TeamName}_{fileTypeName}.xlsx";
|
|
|
+ if (System.IO.File.Exists(outputPath) && (System.IO.File.GetAttributes(outputPath) & FileAttributes.ReadOnly) != 0)
|
|
|
+ {
|
|
|
+ System.IO.File.SetAttributes(outputPath, System.IO.File.GetAttributes(outputPath) & ~FileAttributes.ReadOnly);
|
|
|
+ }
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ designer.Workbook.Save(outputPath);
|
|
|
+ }
|
|
|
+ catch (UnauthorizedAccessException saveEx)
|
|
|
+ {
|
|
|
+ // 常见原因:同名文件正被 Excel 打开占用。
|
|
|
+ // 降级:改用带时间戳的文件名另存,保证本次导出可用;响应结构保持 FileName/FilePath 不变,FilePath 仍为可访问 URL。
|
|
|
+ outputFileName = $"{di.TeamName}_{fileTypeName}_{DateTime.Now:yyyyMMddHHmmss}.xlsx";
|
|
|
+ outputPath = $"{AppSettingsHelper.Get("ExcelBasePath")}ConferenceAffairs/output/total/{outputFileName}";
|
|
|
+ networkPath = outputPath.Replace(AppSettingsHelper.Get("ExcelBasePath"), AppSettingsHelper.Get("ExcelBaseUrl") + AppSettingsHelper.Get("ExcelFtpPath"));
|
|
|
+ try
|
|
|
+ {
|
|
|
+ designer.Workbook.Save(outputPath);
|
|
|
+ }
|
|
|
+ catch (Exception retryEx)
|
|
|
+ {
|
|
|
+ throw new UnauthorizedAccessException(
|
|
|
+ $"无权写入导出目录/文件:{outputPath}。请检查 IIS 应用池对 ExcelBasePath 的写入权限,或确认同名文件未被 Excel 打开占用。原始错误:{saveEx.Message};重试错误:{retryEx.Message}", retryEx);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
jw = JsonView(true, "操作成功!", new
|
|
|
{
|
|
|
- FileName = $"{di.TeamName}_{fileTypeName}.xlsx",
|
|
|
+ FileName = outputFileName,
|
|
|
FilePath = networkPath
|
|
|
});
|
|
|
|
|
|
return Ok(jw);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ _logger.LogError(ex, "ConferenceAffairsFileDown失败 | GroupId={GroupId} FileTypeId={FileTypeId}", Dto?.GroupId, Dto?.FileTypeId);
|
|
|
+ return Ok(JsonView(false, $"导出失败:{ex.GetType().Name}: {ex.Message}", new { StackTrace = ex.ToString() }));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|