This commit is contained in:
夏菊 2025-09-15 19:12:00 +08:00
parent 033a73c280
commit 8409c7bc71
3 changed files with 40 additions and 10 deletions

View File

@ -5,6 +5,7 @@ using System.Text;
using System.Collections; using System.Collections;
using System.IO; using System.IO;
using System.Web; using System.Web;
using System.Text.RegularExpressions;
namespace BLL namespace BLL
{ {
@ -44,6 +45,7 @@ namespace BLL
} }
} }
/// <summary> /// <summary>
/// 获取多附件数据流类 /// 获取多附件数据流类
/// </summary> /// </summary>
@ -61,18 +63,30 @@ namespace BLL
{ {
if (strs.Count() > i) if (strs.Count() > i)
{ {
//string physicalpath = Funs.AttachRootPath;
string physicalpath = Funs.RootPath; string physicalpath = Funs.RootPath;
//HttpContext.Current.Request.PhysicalApplicationPath; string fpath = strs[i];
string fullPath = physicalpath + strs[i]; string fullPath = physicalpath + fpath;
if (!File.Exists(fullPath)) if (!File.Exists(fullPath))
{ {
byte[] fileContext = item; byte[] fileContext = item;
int index = fullPath.LastIndexOf("\\"); string fileName = Regex.Match(fullPath, @"[^/\\?]+(\?.*)?$").Value;
string filePath = fullPath.Substring(0, index); string filePath = fullPath.Replace(fileName, "");
//int index = fullPath.LastIndexOf("\\");
//string filePath = fullPath.Substring(0, index) ;
//string filePath = index > 0 ? fullPath.Substring(0, index) : fullPath;
if (!Directory.Exists(filePath)) try
{ {
Directory.CreateDirectory(filePath); if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"附件【{filePath}】获取异常!");
//continue;
} }
//string savePath = fullPath + fileName; //string savePath = fullPath + fileName;
@ -93,6 +107,7 @@ namespace BLL
} }
} }
/// <summary> /// <summary>
/// 数据和附件插入到多附件表 /// 数据和附件插入到多附件表
/// </summary> /// </summary>

View File

@ -13,6 +13,8 @@ namespace BLL
#region #region
/// <summary> /// <summary>
/// 督查检查整改上报 /// 督查检查整改上报
/// </summary> /// </summary>
@ -23,12 +25,12 @@ namespace BLL
{ {
try try
{ {
// CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient();
var upCheckReport = from x in db.View_DCGL_CheckRectifyListFromSUB var upCheckReport = from x in db.View_DCGL_CheckRectifyListFromSUB
where x.RealEndDate.HasValue && x.CheckRectifyId == checkRectifyId where x.RealEndDate.HasValue && x.CheckRectifyId == checkRectifyId
select new Model.DCGLCheckRectifyItem select new Model.DCGLCheckRectifyItem
{ {
CheckRectifyId = x.CheckRectifyId, CheckRectifyId = x.CheckRectifyId,
NoticeItemId = x.NoticeItemId,
CheckRectifyCode = x.CheckRectifyCode, CheckRectifyCode = x.CheckRectifyCode,
ProjectId = x.ProjectId, ProjectId = x.ProjectId,
UnitId = x.UnitId, UnitId = x.UnitId,
@ -42,13 +44,15 @@ namespace BLL
OrderEndDate = x.OrderEndDate, OrderEndDate = x.OrderEndDate,
OrderEndPerson = x.OrderEndPerson, OrderEndPerson = x.OrderEndPerson,
RealEndDate = x.RealEndDate, RealEndDate = x.RealEndDate,
Verification = x.Verification, //Verification = x.Verification,
Situation = x.Situation,
AttachFileId = x.AttachFileId2, AttachFileId = x.AttachFileId2,
ToKeyId = x.ToKeyId2, ToKeyId = x.ToKeyId2,
AttachSource = x.AttachSource2, AttachSource = x.AttachSource2,
AttachUrl = x.AttachUrl2, AttachUrl = x.AttachUrl2,
////附件转为字节传送 FilePath = Funs.SGGLUrl
FileContext = FileStructService.GetMoreFileStructByAttachUrl(x.AttachUrl2), //////附件转为字节传送
//FileContext = FileStructService.GetMoreFileStructByAttachUrl(x.AttachUrl2),
}; };
string baseurl = SysConstSetService.CNCECPath + "/api/HSSEData/UpDCGLCheckRectifyTable"; string baseurl = SysConstSetService.CNCECPath + "/api/HSSEData/UpDCGLCheckRectifyTable";
@ -91,6 +95,8 @@ namespace BLL
return code; return code;
} }
} }
#endregion #endregion

View File

@ -264,6 +264,15 @@
set; set;
} }
/// <summary>
/// 附件路径域名地址
/// </summary>
public string FilePath
{
get;
set;
}
/// <summary> /// <summary>
/// 附件路径 /// 附件路径
/// </summary> /// </summary>