|
|
@ -26,6 +26,7 @@ using NPOI.SS.Formula.Functions; |
|
|
|
using SqlSugar; |
|
|
|
using SqlSugar; |
|
|
|
using SqlSugar.Extensions; |
|
|
|
using SqlSugar.Extensions; |
|
|
|
using System.Data; |
|
|
|
using System.Data; |
|
|
|
|
|
|
|
using System.IO; |
|
|
|
using System.IO.Compression; |
|
|
|
using System.IO.Compression; |
|
|
|
using System.Linq; |
|
|
|
using System.Linq; |
|
|
|
using System.Net.WebSockets; |
|
|
|
using System.Net.WebSockets; |
|
|
@ -1051,12 +1052,12 @@ namespace _24Hour.Controllers.Common |
|
|
|
{ |
|
|
|
{ |
|
|
|
foreach (var item in identityphotos) |
|
|
|
foreach (var item in identityphotos) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
var urlpath = item.Split('/'); |
|
|
|
|
|
|
|
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot", Path.Combine(urlpath)); |
|
|
|
|
|
|
|
|
|
|
|
var path = item.Replace(@"/", @"\"); |
|
|
|
|
|
|
|
var filepath = Environment.CurrentDirectory + @"\wwwroot" + path; |
|
|
|
|
|
|
|
if (System.IO.File.Exists(filepath)) |
|
|
|
if (System.IO.File.Exists(filepath)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var basestr = Convert.ToBase64String(System.IO.File.ReadAllBytes(filepath)); |
|
|
|
var basestr = Elight.Utility.Encrypt.DataEncryption.Decryptiones(filepath); |
|
|
|
await twentyClient.UploadImage(new UploadDto() |
|
|
|
await twentyClient.UploadImage(new UploadDto() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Bmsah = registerinfo.bmsah, |
|
|
|
Bmsah = registerinfo.bmsah, |
|
|
@ -1068,7 +1069,6 @@ namespace _24Hour.Controllers.Common |
|
|
|
ImageStr = basestr |
|
|
|
ImageStr = basestr |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
@ -2000,60 +2000,30 @@ namespace _24Hour.Controllers.Common |
|
|
|
var lawyerdir = Path.Combine(packegdir, "lawyerservices", item.Id); |
|
|
|
var lawyerdir = Path.Combine(packegdir, "lawyerservices", item.Id); |
|
|
|
if (Directory.Exists(lawyerdir) == false) Directory.CreateDirectory(lawyerdir); |
|
|
|
if (Directory.Exists(lawyerdir) == false) Directory.CreateDirectory(lawyerdir); |
|
|
|
|
|
|
|
|
|
|
|
var files = item.annex.ConvertToModel<List<string>>() ?? new List<string>(); |
|
|
|
var packetPhotoField = (string? photostring, string? dirname) => |
|
|
|
var annecdir = Path.Combine(lawyerdir, "annexs"); |
|
|
|
|
|
|
|
if (Directory.Exists(annecdir) == false) Directory.CreateDirectory(annecdir); |
|
|
|
|
|
|
|
foreach (var file in files.Where(x => x != null)) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\"); |
|
|
|
if (string.IsNullOrEmpty(photostring)) |
|
|
|
if (System.IO.File.Exists(filepath)) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
var targetfile = Path.Combine(annecdir, Path.GetFileName(filepath)); |
|
|
|
return; |
|
|
|
System.IO.File.Copy(filepath, targetfile, true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var legalphotots = item.legalAidPhoto.ConvertToModel<List<string>>() ?? new List<string>(); |
|
|
|
|
|
|
|
var legalAidPhotoDir = Path.Combine(lawyerdir, "legalAidPhoto"); |
|
|
|
|
|
|
|
if (Directory.Exists(legalAidPhotoDir) == false) Directory.CreateDirectory(legalAidPhotoDir); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var legalphotot in legalphotots.Where(x => x != null)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
logger.LogInformation(legalphotot); |
|
|
|
|
|
|
|
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + legalphotot.Replace("/", @"\"); |
|
|
|
|
|
|
|
if (System.IO.File.Exists(filepath)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var targetfile = Path.Combine(legalAidPhotoDir, Path.GetFileName(filepath)); |
|
|
|
|
|
|
|
System.IO.File.Copy(filepath, targetfile, true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var relationshipProofPhotos = item.relationshipProofPhoto.ConvertToModel<List<string>>() ?? new List<string>(); |
|
|
|
|
|
|
|
var relationshipProofPhotoDir = Path.Combine(lawyerdir, "relationshipProofPhoto"); |
|
|
|
|
|
|
|
if (Directory.Exists(relationshipProofPhotoDir) == false) Directory.CreateDirectory(relationshipProofPhotoDir); |
|
|
|
|
|
|
|
foreach (var relationshipProofPhoto in relationshipProofPhotos.Where(x => x != null)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + relationshipProofPhoto.Replace("/", @"\"); |
|
|
|
|
|
|
|
if (System.IO.File.Exists(filepath)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var targetfile = Path.Combine(legalAidPhotoDir, Path.GetFileName(filepath)); |
|
|
|
|
|
|
|
System.IO.File.Copy(filepath, targetfile, true); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
var photos = photostring.ConvertToModel<List<string>>() ?? new List<string>(); |
|
|
|
var otherPhotos = item.otherPhoto.ConvertToModel<List<string>>() ?? new List<string>(); |
|
|
|
var photoDirname = Path.Combine(lawyerdir, dirname); |
|
|
|
var otherPhotoDir = Path.Combine(lawyerdir, "otherPhoto"); |
|
|
|
if (Directory.Exists(photoDirname) == false) Directory.CreateDirectory(photoDirname); |
|
|
|
if (Directory.Exists(otherPhotoDir) == false) Directory.CreateDirectory(otherPhotoDir); |
|
|
|
foreach (var photo in photos.Where(x => x != null)) |
|
|
|
foreach (var otherPhoto in otherPhotos.Where(x => x != null)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + otherPhoto.Replace("/", @"\"); |
|
|
|
|
|
|
|
if (System.IO.File.Exists(filepath)) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
var targetfile = Path.Combine(legalAidPhotoDir, Path.GetFileName(filepath)); |
|
|
|
var urlpath = photo.Split('/'); |
|
|
|
System.IO.File.Copy(filepath, targetfile, true); |
|
|
|
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot", Path.Combine(urlpath)); |
|
|
|
|
|
|
|
if (System.IO.File.Exists(filepath)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var targetfile = Path.Combine(photoDirname, Path.GetFileName(filepath)); |
|
|
|
|
|
|
|
System.IO.File.Copy(filepath, targetfile, true); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
packetPhotoField(item?.annex, "annexs"); |
|
|
|
|
|
|
|
packetPhotoField(item?.legalAidPhoto, "legalAidPhoto"); |
|
|
|
|
|
|
|
packetPhotoField(item?.relationshipProofPhoto, "relationshipProofPhoto"); |
|
|
|
|
|
|
|
packetPhotoField(item?.otherPhoto, "otherPhoto"); |
|
|
|
} |
|
|
|
} |
|
|
|
//存储用户的相关附件 |
|
|
|
//存储用户的相关附件 |
|
|
|
foreach (var item in users) |
|
|
|
foreach (var item in users) |
|
|
@ -2067,7 +2037,8 @@ namespace _24Hour.Controllers.Common |
|
|
|
if (Directory.Exists(cardidDir) == false) Directory.CreateDirectory(cardidDir); |
|
|
|
if (Directory.Exists(cardidDir) == false) Directory.CreateDirectory(cardidDir); |
|
|
|
foreach (var file in cardids) |
|
|
|
foreach (var file in cardids) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\"); |
|
|
|
var urlpath = file.Split('/'); |
|
|
|
|
|
|
|
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot", Path.Combine(urlpath)); |
|
|
|
if (System.IO.File.Exists(filepath)) |
|
|
|
if (System.IO.File.Exists(filepath)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
System.IO.File.Copy(filepath, Path.Combine(cardidDir, Path.GetFileName(filepath)), true); |
|
|
|
System.IO.File.Copy(filepath, Path.Combine(cardidDir, Path.GetFileName(filepath)), true); |
|
|
@ -2079,7 +2050,9 @@ namespace _24Hour.Controllers.Common |
|
|
|
if (Directory.Exists(identityphotosDir) == false) Directory.CreateDirectory(identityphotosDir); |
|
|
|
if (Directory.Exists(identityphotosDir) == false) Directory.CreateDirectory(identityphotosDir); |
|
|
|
foreach (var file in identityphotos) |
|
|
|
foreach (var file in identityphotos) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\"); |
|
|
|
// var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\"); |
|
|
|
|
|
|
|
var urlpath = file.Split('/'); |
|
|
|
|
|
|
|
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot", Path.Combine(urlpath)); |
|
|
|
if (System.IO.File.Exists(filepath)) |
|
|
|
if (System.IO.File.Exists(filepath)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
System.IO.File.Copy(filepath, Path.Combine(identityphotosDir, Path.GetFileName(filepath)), true); |
|
|
|
System.IO.File.Copy(filepath, Path.Combine(identityphotosDir, Path.GetFileName(filepath)), true); |
|
|
@ -2091,7 +2064,9 @@ namespace _24Hour.Controllers.Common |
|
|
|
if (Directory.Exists(departmentPhotosDir) == false) Directory.CreateDirectory(departmentPhotosDir); |
|
|
|
if (Directory.Exists(departmentPhotosDir) == false) Directory.CreateDirectory(departmentPhotosDir); |
|
|
|
foreach (var file in departmentPhotos) |
|
|
|
foreach (var file in departmentPhotos) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\"); |
|
|
|
//var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\"); |
|
|
|
|
|
|
|
var urlpath = file.Split('/'); |
|
|
|
|
|
|
|
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot", Path.Combine(urlpath)); |
|
|
|
if (System.IO.File.Exists(filepath)) |
|
|
|
if (System.IO.File.Exists(filepath)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
System.IO.File.Copy(filepath, Path.Combine(departmentPhotosDir, Path.GetFileName(filepath)), true); |
|
|
|
System.IO.File.Copy(filepath, Path.Combine(departmentPhotosDir, Path.GetFileName(filepath)), true); |
|
|
|