|
@@ -2,6 +2,7 @@
|
|
|
using Aspose.Words;
|
|
|
using Aspose.Words.Drawing;
|
|
|
using Aspose.Words.Tables;
|
|
|
+using EyeSoft.Collections.Generic;
|
|
|
using EyeSoft.IO;
|
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
using MySqlX.XDevAPI.Relational;
|
|
@@ -3821,10 +3822,40 @@ FROM
|
|
|
filePath = fileDir + "/商邀相关文件/" + dto.fileName;
|
|
|
// 删除该文件
|
|
|
System.IO.File.Delete(filePath);
|
|
|
- id = await _sqlSugar.Updateable<Grp_InvitationOfficialActivities>()
|
|
|
- .Where(a => a.Id == dto.Id)
|
|
|
- .SetColumns(a => new Grp_InvitationOfficialActivities { Attachment = "" })
|
|
|
- .ExecuteCommandAsync();
|
|
|
+
|
|
|
+ var info = await _sqlSugar.Queryable<Grp_InvitationOfficialActivities>().Where(x => x.Id == dto.Id && x.IsDel == 0).FirstAsync();
|
|
|
+ if (info != null)
|
|
|
+ {
|
|
|
+ string[] files = new string[] { };
|
|
|
+ if (!string.IsNullOrEmpty(info.Attachment))
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ files = JsonConvert.DeserializeObject<string[]>(info.Attachment);
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+
|
|
|
+ files.AddRange(new string[] { info.Attachment });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (files.Length > 0)
|
|
|
+ {
|
|
|
+ var files1 = files.Where(x => !x.Equals(dto.fileName)).ToArray();
|
|
|
+
|
|
|
+ string filePath2 = string.Empty;
|
|
|
+ if (files1.Length > 0)
|
|
|
+ {
|
|
|
+ filePath2 = JsonConvert.SerializeObject( files1);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ id = await _sqlSugar.Updateable<Grp_InvitationOfficialActivities>()
|
|
|
+ .Where(a => a.Id == dto.Id)
|
|
|
+ .SetColumns(a => new Grp_InvitationOfficialActivities { Attachment = filePath2 })
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
if (id != 0)
|
|
|
{
|