班前会

This commit is contained in:
2026-02-28 16:09:10 +08:00
parent 470aac50f3
commit bcb1adf1c0
14 changed files with 293 additions and 177 deletions
+47
View File
@@ -122,6 +122,49 @@ namespace BLL
/// <param name="attachUrl">附件路径</param>
/// <returns></returns>
public static void FileMoreInsert(List<byte[]> fileContextList, string attachUrl)
{
if (fileContextList.Count > 0)
{
string[] strs = attachUrl.Trim().Split(',');
int i = 0;
string physicalpath = ConfigurationManager.AppSettings["localRoot"];
foreach (var item in fileContextList)
{
//HttpContext.Current.Request.PhysicalApplicationPath;
string fullPath = (physicalpath + strs[i]).Replace('/', '\\');
if (!File.Exists(fullPath))
{
byte[] fileContext = item;
int index = fullPath.LastIndexOf("\\");
string filePath = fullPath.Substring(0, index);
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
//string savePath = fullPath + fileName;
//文件读写模式
System.IO.FileMode fileMode = System.IO.FileMode.Create;
//写入文件
using (System.IO.FileStream fs = new System.IO.FileStream(fullPath, fileMode, System.IO.FileAccess.Write))
{
fs.Write(fileContext, 0, fileContext.Length);
}
}
i++;
}
}
}
/// <summary>
/// 获取多附件数据流类
/// </summary>
/// <param name="attachUrl">附件路径</param>
/// <returns></returns>
public static void FileMoreInsertOld(List<byte[]> fileContextList, string attachUrl)
{
if (fileContextList != null && fileContextList.Count() > 0)
{
@@ -223,12 +266,14 @@ namespace BLL
/// </summary>
public static void InsertAttachFilesRecord(string attachFileId, string dataId, string attachSource, string attachUrl, List<byte[]> fileContext)
{
BLL.ErrLogInfo.WriteLog($"数据和附件插入到多附件表:1");
if (!string.IsNullOrEmpty(attachFileId))
{
//多附件
var attachFile = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == dataId);
if (attachFile == null)
{
BLL.ErrLogInfo.WriteLog($"数据和附件插入到多附件表:2attachFile == null");
////插入附件文件
BLL.FileInsertService.FileMoreInsert(fileContext, attachUrl);
@@ -244,8 +289,10 @@ namespace BLL
}
else
{
BLL.ErrLogInfo.WriteLog($"数据和附件插入到多附件表:2attachFile != null");
if (attachFile.AttachUrl != attachUrl)
{
BLL.ErrLogInfo.WriteLog($"数据和附件插入到多附件表:2attachFile != null attachFile.AttachUrl != attachUrl");
/////删除附件文件
//BLL.UploadAttachmentService.DeleteFile(ConfigurationManager.AppSettings["localRoot"], attachFile.AttachUrl);
////插入附件文件