Browse Source

Merge branch 'develop' of http://18t7i08736.yicp.fun:10018/Coder/24Hour.Service into develop

develop
林杨 2 years ago
parent
commit
1181fd9659
  1. 10
      .gitignore
  2. 5
      24Hour/24Hour.csproj
  3. 586
      24Hour/Controllers/Common/LawyerArchivesController.cs
  4. 39
      24Hour/TwentySystemProxyClient.cs
  5. 1
      Dto/obj/Debug/net6.0/Dto.AssemblyInfoInputs.cache
  6. 11
      Dto/obj/Debug/net6.0/Dto.GeneratedMSBuildEditorConfig.editorconfig
  7. BIN
      Dto/obj/Debug/net6.0/Dto.assets.cache
  8. BIN
      Dto/obj/Debug/net6.0/Dto.csproj.AssemblyReference.cache
  9. 64
      Dto/obj/Dto.csproj.nuget.dgspec.json
  10. 15
      Dto/obj/Dto.csproj.nuget.g.props
  11. 69
      Dto/obj/project.assets.json
  12. 8
      Dto/obj/project.nuget.cache

10
.gitignore vendored

@ -82,3 +82,13 @@ dkms.conf
/24Hour/wwwroot /24Hour/wwwroot
/Dto/obj /Dto/obj
/Dto/obj/Debug /Dto/obj/Debug
/Dto/obj/Debug/net6.0
/Dto/obj/Release
*.cs
/Dto/obj/Debug/net6.0/Dto.csproj.AssemblyReference.cache
/Dto/obj/Debug/net6.0/Dto.AssemblyInfoInputs.cache
/Dto/obj/Debug/net6.0/Dto.GeneratedMSBuildEditorConfig.editorconfig
/Dto/obj/Dto.csproj.nuget.dgspec.json
/Dto/obj/Dto.csproj.nuget.g.props
/Dto/obj/project.assets.json
/Dto/obj/project.nuget.cache

5
24Hour/24Hour.csproj

@ -8,8 +8,8 @@
<GenerateDocumentationFile>True</GenerateDocumentationFile> <GenerateDocumentationFile>True</GenerateDocumentationFile>
<UserSecretsId>e485308c-2f05-470b-b0a4-68f1ec2b3412</UserSecretsId> <UserSecretsId>e485308c-2f05-470b-b0a4-68f1ec2b3412</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<AssemblyVersion>1.0.1.16</AssemblyVersion> <AssemblyVersion>1.0.1.17</AssemblyVersion>
<Version>1.0.1.16</Version> <Version>1.0.1.17</Version>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@ -28,6 +28,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Dto\Dto.csproj" />
<ProjectReference Include="..\Elight.Entity\Elight.Entity.csproj" /> <ProjectReference Include="..\Elight.Entity\Elight.Entity.csproj" />
<ProjectReference Include="..\Elight.Logic\Elight.Logic.csproj" /> <ProjectReference Include="..\Elight.Logic\Elight.Logic.csproj" />
<ProjectReference Include="..\Elight.Utility\Elight.Utility.csproj" /> <ProjectReference Include="..\Elight.Utility\Elight.Utility.csproj" />

586
24Hour/Controllers/Common/LawyerArchivesController.cs

@ -80,7 +80,6 @@ namespace _24Hour.Controllers.Common
res.result = data; res.result = data;
return res; return res;
} }
/// <summary> /// <summary>
/// 修改内网律师信息 /// 修改内网律师信息
/// </summary> /// </summary>
@ -815,8 +814,6 @@ namespace _24Hour.Controllers.Common
}; };
return result; return result;
} }
/// <summary> /// <summary>
/// 统计阅卷信息 /// 统计阅卷信息
/// </summary> /// </summary>
@ -989,7 +986,6 @@ namespace _24Hour.Controllers.Common
}; };
return result; return result;
} }
/// <summary> /// <summary>
/// 按律师分类 /// 按律师分类
/// </summary> /// </summary>
@ -1106,335 +1102,353 @@ namespace _24Hour.Controllers.Common
[Route("ImportLawyerArchivesInfo")] [Route("ImportLawyerArchivesInfo")]
public async Task<Result> ImportLawyerArchivesInfo(string path) public async Task<Result> ImportLawyerArchivesInfo(string path)
{ {
if (System.IO.File.Exists(path) == false) try
{
result.Message = "文件丢失";
result.IsSucceed = false;
return result;
}
var dir = Path.Combine(Environment.CurrentDirectory, "wwwroot", "CaseFile", "imports");
var userdir = Path.Combine(dir, "users");
var lawyersvcs = Path.Combine(dir, "lawyersvcs");
var extratname = Path.GetFileNameWithoutExtension(path);
var extratdirpath = Path.Combine(dir, extratname);
ZipFile.ExtractToDirectory(path, extratdirpath, true);
var zipusers = Path.Combine(extratdirpath, "users");
var ziplawyersvcs = Path.Combine(extratdirpath, "lawyerservices");
var zipjson = Path.Combine(extratdirpath, "data");
if (System.IO.File.Exists(zipjson) == false)
{
result.Message = "文件丢失";
result.IsSucceed = false;
return result;
}
var json = System.IO.File.ReadAllText(zipjson);
var jsonstr = Encoding.UTF8.GetString(Convert.FromBase64String(json));
var importdata = jsonstr.ConvertToAnonymousType(new
{
lawyerservices = default(List<App_LawyerServicesModel>),
users = default(List<App_Sys_UserModel>)
});
foreach (var userim in importdata.users)
{ {
var user = await _db.Queryable<App_Sys_UserModel>() if (System.IO.File.Exists(path) == false)
.Where(x => x.cardId == userim.cardId)
.Where(x => x.IsDeleted == 0)
.Where(x => x.isdeactivate == 0)
.Where(x => x.identity == "律师")
.FirstAsync();
var identityphotopath = Path.Combine(zipusers, userim.cardId, "identityphotos");
var files = new DirectoryInfo(identityphotopath)
.GetFiles()
.Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
.Replace(@"\", @"/"))
.ToList()
.ConvertToJsonStr();
var departmentPhotos = Path.Combine(zipusers, userim.cardId, "departmentPhotos");
var departments = new DirectoryInfo(departmentPhotos)
.GetFiles()
.Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
.Replace(@"\", @"/"))
.ToList()
.ConvertToJsonStr();
var cardidphotos = Path.Combine(zipusers, userim.cardId, "cardids");
var cardids = new DirectoryInfo(cardidphotos)
.GetFiles()
.Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
.Replace(@"\", @"/"))
.ToList()
.ConvertToJsonStr();
if (user == null)
{ {
userim.cardIdphoto = cardids; result.Message = "文件丢失";
userim.identityphoto = files; result.IsSucceed = false;
userim.departmentPhoto = departments; return result;
_db.BeginTran();
var num = await _db.Insertable(userim).ExecuteCommandAsync();
_db.CommitTran();
} }
else var dir = Path.Combine(Environment.CurrentDirectory, "wwwroot", "CaseFile", "imports");
var userdir = Path.Combine(dir, "users");
var lawyersvcs = Path.Combine(dir, "lawyersvcs");
var extratname = Path.GetFileNameWithoutExtension(path);
var extratdirpath = Path.Combine(dir, extratname);
ZipFile.ExtractToDirectory(path, extratdirpath, true);
var zipusers = Path.Combine(extratdirpath, "users");
var ziplawyersvcs = Path.Combine(extratdirpath, "lawyerservices");
var zipjson = Path.Combine(extratdirpath, "data");
if (System.IO.File.Exists(zipjson) == false)
{ {
user.cardIdphoto = cardids; result.Message = "文件丢失";
user.identityphoto = files; result.IsSucceed = false;
user.departmentPhoto = departments; return result;
_db.BeginTran();
var num = await _db.Updateable(user)
.UpdateColumns(x => new
{
x.cardIdphoto,
x.identityphoto,
x.departmentPhoto
})
.IgnoreColumns(ignoreAllNullColumns: true)
.ExecuteCommandAsync();
_db.CommitTran();
} }
} var json = System.IO.File.ReadAllText(zipjson);
foreach (var lawyersvc in importdata.lawyerservices)
{
var svc = await _db.Queryable<App_LawyerServicesModel>()
.Where(x => x.Id == lawyersvc.Id).FirstAsync();
var annexphoto = Path.Combine(ziplawyersvcs, lawyersvc.Id, "annexs");
var annexs = new DirectoryInfo(annexphoto)
.GetFiles()
.Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
.Replace(@"\", @"/"))
.ToList()
.ConvertToJsonStr();
var legalAidPhoto = Path.Combine(ziplawyersvcs, lawyersvc.Id, "legalAidPhoto");
var legalAidPhotos = new DirectoryInfo(legalAidPhoto)
.GetFiles()
.Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
.Replace(@"\", @"/"))
.ToList()
.ConvertToJsonStr();
var relationshipProofPhoto = Path.Combine(ziplawyersvcs, lawyersvc.Id, "relationshipProofPhoto");
var relationshipProofPhotos = new DirectoryInfo(relationshipProofPhoto)
.GetFiles()
.Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
.Replace(@"\", @"/"))
.ToList()
.ConvertToJsonStr();
var otherPhoto = Path.Combine(ziplawyersvcs, lawyersvc.Id, "otherPhoto");
var otherPhotos = new DirectoryInfo(otherPhoto)
.GetFiles()
.Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
.Replace(@"\", @"/"))
.ToList()
.ConvertToJsonStr();
if (svc == null)
{
var lawyer = await _db.Queryable<App_Sys_UserModel>()
.Where(x => x.cardId == lawyersvc.createuserId)
.Where(x => x.IsDeleted == 0)
.Where(x => x.isdeactivate == 0)
.Where(x => x.identity == "律师")
.FirstAsync();
lawyersvc.createuserId = lawyer.Id; var jsonstr = Encoding.UTF8.GetString(Convert.FromBase64String(json));
lawyersvc.annex = annexs;
lawyersvc.legalAidPhoto = legalAidPhotos;
lawyersvc.relationshipProofPhoto = relationshipProofPhotos;
lawyersvc.otherPhoto = otherPhotos;
_db.BeginTran(); var importdata = jsonstr.ConvertToAnonymousType(new
var num = await _db.Insertable(lawyersvc).ExecuteCommandAsync(); {
_db.CommitTran(); lawyerservices = default(List<App_LawyerServicesModel>),
users = default(List<App_Sys_UserModel>)
});
foreach (var userim in importdata.users)
{
var user = await _db.Queryable<App_Sys_UserModel>()
.Where(x => x.cardId == userim.cardId)
.Where(x => x.IsDeleted == 0)
.Where(x => x.isdeactivate == 0)
.Where(x => x.identity == "律师")
.FirstAsync();
var identityphotopath = Path.Combine(zipusers, userim.cardId, "identityphotos");
var files = new DirectoryInfo(identityphotopath)
.GetFiles()
.Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
.Replace(@"\", @"/"))
.ToList()
.ConvertToJsonStr();
var departmentPhotos = Path.Combine(zipusers, userim.cardId, "departmentPhotos");
var departments = new DirectoryInfo(departmentPhotos)
.GetFiles()
.Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
.Replace(@"\", @"/"))
.ToList()
.ConvertToJsonStr();
var cardidphotos = Path.Combine(zipusers, userim.cardId, "cardids");
var cardids = new DirectoryInfo(cardidphotos)
.GetFiles()
.Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
.Replace(@"\", @"/"))
.ToList()
.ConvertToJsonStr();
if (user == null)
{
userim.cardIdphoto = cardids;
userim.identityphoto = files;
userim.departmentPhoto = departments;
_db.BeginTran();
var num = await _db.Insertable(userim).ExecuteCommandAsync();
_db.CommitTran();
}
else
{
user.cardIdphoto = cardids;
user.identityphoto = files;
user.departmentPhoto = departments;
_db.BeginTran();
var num = await _db.Updateable(user)
.UpdateColumns(x => new
{
x.cardIdphoto,
x.identityphoto,
x.departmentPhoto
})
.IgnoreColumns(ignoreAllNullColumns: true)
.ExecuteCommandAsync();
_db.CommitTran();
}
} }
else foreach (var lawyersvc in importdata.lawyerservices)
{ {
var lawyer = await _db.Queryable<App_Sys_UserModel>() var svc = await _db.Queryable<App_LawyerServicesModel>()
.Where(x => x.cardId == lawyersvc.createuserId) .Where(x => x.Id == lawyersvc.Id).FirstAsync();
.Where(x => x.IsDeleted == 0)
.Where(x => x.isdeactivate == 0) var annexphoto = Path.Combine(ziplawyersvcs, lawyersvc.Id, "annexs");
.Where(x => x.identity == "律师") var annexs = new DirectoryInfo(annexphoto)
.FirstAsync(); .GetFiles()
.Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
svc.createuserId = lawyer.Id; .Replace(@"\", @"/"))
svc.annex = annexs; .ToList()
svc.legalAidPhoto = legalAidPhotos; .ConvertToJsonStr();
svc.relationshipProofPhoto = relationshipProofPhotos;
svc.otherPhoto = otherPhotos;
_db.BeginTran(); var legalAidPhoto = Path.Combine(ziplawyersvcs, lawyersvc.Id, "legalAidPhoto");
var num = await _db.Updateable(svc) var legalAidPhotos = new DirectoryInfo(legalAidPhoto)
.UpdateColumns(x => new .GetFiles()
{ .Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
x.annex, .Replace(@"\", @"/"))
x.createuserId, .ToList()
x.relationshipProofPhoto, .ConvertToJsonStr();
x.otherPhoto,
x.legalAidPhoto var relationshipProofPhoto = Path.Combine(ziplawyersvcs, lawyersvc.Id, "relationshipProofPhoto");
}) var relationshipProofPhotos = new DirectoryInfo(relationshipProofPhoto)
.IgnoreColumns(ignoreAllNullColumns: true) .GetFiles()
.ExecuteCommandAsync(); .Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
_db.CommitTran(); .Replace(@"\", @"/"))
.ToList()
.ConvertToJsonStr();
var otherPhoto = Path.Combine(ziplawyersvcs, lawyersvc.Id, "otherPhoto");
var otherPhotos = new DirectoryInfo(otherPhoto)
.GetFiles()
.Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName)
.Replace(@"\", @"/"))
.ToList()
.ConvertToJsonStr();
if (svc == null)
{
var lawyer = await _db.Queryable<App_Sys_UserModel>()
.Where(x => x.cardId == lawyersvc.createuserId)
.Where(x => x.IsDeleted == 0)
.Where(x => x.isdeactivate == 0)
.Where(x => x.identity == "律师")
.FirstAsync();
lawyersvc.createuserId = lawyer.Id;
lawyersvc.annex = annexs;
lawyersvc.legalAidPhoto = legalAidPhotos;
lawyersvc.relationshipProofPhoto = relationshipProofPhotos;
lawyersvc.otherPhoto = otherPhotos;
_db.BeginTran();
var num = await _db.Insertable(lawyersvc).ExecuteCommandAsync();
_db.CommitTran();
}
else
{
var lawyer = await _db.Queryable<App_Sys_UserModel>()
.Where(x => x.cardId == lawyersvc.createuserId)
.Where(x => x.IsDeleted == 0)
.Where(x => x.isdeactivate == 0)
.Where(x => x.identity == "律师")
.FirstAsync();
svc.createuserId = lawyer.Id;
svc.annex = annexs;
svc.legalAidPhoto = legalAidPhotos;
svc.relationshipProofPhoto = relationshipProofPhotos;
svc.otherPhoto = otherPhotos;
_db.BeginTran();
var num = await _db.Updateable(svc)
.UpdateColumns(x => new
{
x.annex,
x.createuserId,
x.relationshipProofPhoto,
x.otherPhoto,
x.legalAidPhoto
})
.IgnoreColumns(ignoreAllNullColumns: true)
.ExecuteCommandAsync();
_db.CommitTran();
}
} }
} }
catch(Exception ex)
{
result.Message = ex.Message;
result.IsSucceed = false;
return result;
}
result.IsSucceed = true; result.IsSucceed = true;
return result; return result;
} }
[HttpPost] [HttpPost]
[Route("ExportLawyerArchivesInfo")] [Route("ExportLawyerArchivesInfo")]
public async Task<Result> ExportLawyerArchivesInfo(List<string> ids) public async Task<Result> ExportLawyerArchivesInfo(List<string> ids)
{ {
var lawyerarchives = await _db.Queryable<App_LawyerServicesModel>() try
.In(info => info.Id, ids)
.ToListAsync();
var userids = lawyerarchives
.Select(x => x.createuserId)
.Distinct()
.ToList();
var users = await _db.Queryable<App_Sys_UserModel>()
.In(x => x.Id, userids)
.ToListAsync();
//把创建人Id变为创建人的身份证
lawyerarchives.All(x =>
{
x.createuserId = users.FirstOrDefault(q => q.Id == x.createuserId).cardId;
return true;
});
var packegdirname = DateTime.Now.Ticks.ToString();
var dir = Path.Combine(Environment.CurrentDirectory, "wwwroot", "temp");
var packegdir = Path.Combine(dir, packegdirname);
var packegzipname = Path.ChangeExtension(packegdir, ".zip");
if (Directory.Exists(packegdir) == false) Directory.CreateDirectory(packegdir);
var jsonfilepath = Path.Combine(packegdir, "data");
var jsonstr = new
{
lawyerservices = lawyerarchives,
users = users
}.ConvertToJsonStr().ConvertToBase64();
System.IO.File.WriteAllText(jsonfilepath, jsonstr);
//存储预约申请的相关附件
foreach (var item in lawyerarchives)
{ {
var lawyerdir = Path.Combine(packegdir, "lawyerservices", item.Id); var lawyerarchives = await _db.Queryable<App_LawyerServicesModel>()
if (Directory.Exists(lawyerdir) == false) Directory.CreateDirectory(lawyerdir); .In(info => info.Id, ids)
.ToListAsync();
var userids = lawyerarchives
.Select(x => x.createuserId)
.Distinct()
.ToList();
var users = await _db.Queryable<App_Sys_UserModel>()
.In(x => x.Id, userids)
.ToListAsync();
var files = item.annex.ConvertToModel<List<string>>(); //把创建人Id变为创建人的身份证
var annecdir = Path.Combine(lawyerdir, "annexs"); lawyerarchives.All(x =>
if (Directory.Exists(annecdir) == false) Directory.CreateDirectory(annecdir); {
foreach (var file in files) x.createuserId = users.FirstOrDefault(q => q.Id == x.createuserId).cardId;
return true;
});
var packegdirname = DateTime.Now.Ticks.ToString();
var dir = Path.Combine(Environment.CurrentDirectory, "wwwroot", "temp");
var packegdir = Path.Combine(dir, packegdirname);
var packegzipname = Path.ChangeExtension(packegdir, ".zip");
if (Directory.Exists(packegdir) == false) Directory.CreateDirectory(packegdir);
var jsonfilepath = Path.Combine(packegdir, "data");
var jsonstr = new
{ {
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\"); lawyerservices = lawyerarchives,
if (System.IO.File.Exists(filepath)) users = users
}.ConvertToJsonStr().ConvertToBase64();
System.IO.File.WriteAllText(jsonfilepath, jsonstr);
//存储预约申请的相关附件
foreach (var item in lawyerarchives)
{
var lawyerdir = Path.Combine(packegdir, "lawyerservices", item.Id);
if (Directory.Exists(lawyerdir) == false) Directory.CreateDirectory(lawyerdir);
var files = item.annex.ConvertToModel<List<string>>() ?? new List<string>();
var annecdir = Path.Combine(lawyerdir, "annexs");
if (Directory.Exists(annecdir) == false) Directory.CreateDirectory(annecdir);
foreach (var file in files)
{ {
var targetfile = Path.Combine(annecdir, Path.GetFileName(filepath)); var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\");
System.IO.File.Copy(filepath, targetfile); if (System.IO.File.Exists(filepath))
{
var targetfile = Path.Combine(annecdir, Path.GetFileName(filepath));
System.IO.File.Copy(filepath, targetfile);
}
} }
}
var legalphotots = item.legalAidPhoto.ConvertToModel<List<string>>(); var legalphotots = item.legalAidPhoto.ConvertToModel<List<string>>() ?? new List<string>();
var legalAidPhotoDir = Path.Combine(lawyerdir, "legalAidPhoto"); var legalAidPhotoDir = Path.Combine(lawyerdir, "legalAidPhoto");
if (Directory.Exists(legalAidPhotoDir) == false) Directory.CreateDirectory(legalAidPhotoDir); if (Directory.Exists(legalAidPhotoDir) == false) Directory.CreateDirectory(legalAidPhotoDir);
foreach (var legalphotot in legalphotots)
{ foreach (var legalphotot in legalphotots)
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + legalphotot.Replace("/", @"\");
if (System.IO.File.Exists(filepath))
{ {
var targetfile = Path.Combine(legalAidPhotoDir, Path.GetFileName(filepath)); var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + legalphotot.Replace("/", @"\");
System.IO.File.Copy(filepath, targetfile); if (System.IO.File.Exists(filepath))
{
var targetfile = Path.Combine(legalAidPhotoDir, Path.GetFileName(filepath));
System.IO.File.Copy(filepath, targetfile);
}
} }
}
var relationshipProofPhotos = item.relationshipProofPhoto.ConvertToModel<List<string>>();
var relationshipProofPhotoDir = Path.Combine(lawyerdir, "relationshipProofPhoto"); var relationshipProofPhotos = item.relationshipProofPhoto.ConvertToModel<List<string>>() ?? new List<string>();
if (Directory.Exists(relationshipProofPhotoDir) == false) Directory.CreateDirectory(relationshipProofPhotoDir); var relationshipProofPhotoDir = Path.Combine(lawyerdir, "relationshipProofPhoto");
foreach (var relationshipProofPhoto in relationshipProofPhotos) if (Directory.Exists(relationshipProofPhotoDir) == false) Directory.CreateDirectory(relationshipProofPhotoDir);
{
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + relationshipProofPhoto.Replace("/", @"\"); foreach (var relationshipProofPhoto in relationshipProofPhotos)
if (System.IO.File.Exists(filepath))
{ {
var targetfile = Path.Combine(legalAidPhotoDir, Path.GetFileName(filepath)); var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + relationshipProofPhoto.Replace("/", @"\");
System.IO.File.Copy(filepath, targetfile); if (System.IO.File.Exists(filepath))
{
var targetfile = Path.Combine(legalAidPhotoDir, Path.GetFileName(filepath));
System.IO.File.Copy(filepath, targetfile);
}
} }
}
var otherPhotos = item.otherPhoto.ConvertToModel<List<string>>(); var otherPhotos = item.otherPhoto.ConvertToModel<List<string>>() ?? new List<string>();
var otherPhotoDir = Path.Combine(lawyerdir, "otherPhoto"); var otherPhotoDir = Path.Combine(lawyerdir, "otherPhoto");
if (Directory.Exists(otherPhotoDir) == false) Directory.CreateDirectory(otherPhotoDir); if (Directory.Exists(otherPhotoDir) == false) Directory.CreateDirectory(otherPhotoDir);
foreach (var otherPhoto in otherPhotos) foreach (var otherPhoto in otherPhotos)
{
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + otherPhoto.Replace("/", @"\");
if (System.IO.File.Exists(filepath))
{ {
var targetfile = Path.Combine(legalAidPhotoDir, Path.GetFileName(filepath)); var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + otherPhoto.Replace("/", @"\");
System.IO.File.Copy(filepath, targetfile); if (System.IO.File.Exists(filepath))
{
var targetfile = Path.Combine(legalAidPhotoDir, Path.GetFileName(filepath));
System.IO.File.Copy(filepath, targetfile);
}
} }
}
} }
//存储用户的相关附件 //存储用户的相关附件
foreach (var item in users) foreach (var item in users)
{
//["/CaseFile/card/2023-11-21/20231121200659497.jpg"]
var userdir = Path.Combine(packegdir, "users", item.cardId);
//保存身份证图片
var cardids = item.cardIdphoto.ConvertToModel<List<string>>();
var cardidDir = Path.Combine(userdir, "cardids");
if (Directory.Exists(cardidDir) == false) Directory.CreateDirectory(cardidDir);
foreach (var file in cardids)
{ {
var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\"); //["/CaseFile/card/2023-11-21/20231121200659497.jpg"]
if (System.IO.File.Exists(filepath)) var userdir = Path.Combine(packegdir, "users", item.cardId);
//保存身份证图片
var cardids = item.cardIdphoto.ConvertToModel<List<string>>();
var cardidDir = Path.Combine(userdir, "cardids");
if (Directory.Exists(cardidDir) == false) Directory.CreateDirectory(cardidDir);
foreach (var file in cardids)
{ {
System.IO.File.Copy(filepath, Path.Combine(cardidDir, Path.GetFileName(filepath))); var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\");
if (System.IO.File.Exists(filepath))
{
System.IO.File.Copy(filepath, Path.Combine(cardidDir, Path.GetFileName(filepath)));
}
} }
} //保存工作证图片 律师职业证书
//保存工作证图片 律师职业证书 var identityphotos = item.identityphoto.ConvertToModel<List<string>>();
var identityphotos = item.identityphoto.ConvertToModel<List<string>>(); var identityphotosDir = Path.Combine(userdir, "identityphotos");
var identityphotosDir = Path.Combine(userdir, "identityphotos"); 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("/", @"\");
if (System.IO.File.Exists(filepath))
{ {
System.IO.File.Copy(filepath, Path.Combine(identityphotosDir, Path.GetFileName(filepath))); var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\");
if (System.IO.File.Exists(filepath))
{
System.IO.File.Copy(filepath, Path.Combine(identityphotosDir, Path.GetFileName(filepath)));
}
} }
}
var departmentPhotos = item.departmentPhoto.ConvertToModel<List<string>>(); var departmentPhotos = item.departmentPhoto.ConvertToModel<List<string>>();
var departmentPhotosDir = Path.Combine(userdir, "departmentPhotos"); var departmentPhotosDir = Path.Combine(userdir, "departmentPhotos");
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("/", @"\");
if (System.IO.File.Exists(filepath))
{ {
System.IO.File.Copy(filepath, Path.Combine(departmentPhotosDir, Path.GetFileName(filepath))); var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\");
if (System.IO.File.Exists(filepath))
{
System.IO.File.Copy(filepath, Path.Combine(departmentPhotosDir, Path.GetFileName(filepath)));
}
} }
} }
}
ZipFile.CreateFromDirectory(packegdir, packegzipname); ZipFile.CreateFromDirectory(packegdir, packegzipname);
Directory.Delete(packegdir, true); Directory.Delete(packegdir, true);
result.result = $"/temp/{packegdirname}.zip"; result.result = $"/temp/{packegdirname}.zip";
result.IsSucceed = true; result.IsSucceed = true;
return result; return result;
}
catch(Exception ex)
{
result.IsSucceed = false;
result.Message = ex.Message;
return result;
}
} }
[HttpPost] [HttpPost]
[Route("UploadSignImage")] [Route("UploadSignImage")]
/// <summary> /// <summary>

39
24Hour/TwentySystemProxyClient.cs

@ -1,9 +1,11 @@
using com.sun.xml.@internal.xsom; using com.sun.xml.@internal.xsom;
using Dto;
using Elight.Entity.APPDto.Lawyer; using Elight.Entity.APPDto.Lawyer;
using Elight.Utility; using Elight.Utility;
using Elight.Utility.Code; using Elight.Utility.Code;
using Elight.Utility.Extensions; using Elight.Utility.Extensions;
using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Mvc;
namespace _24Hour namespace _24Hour
{ {
@ -20,6 +22,19 @@ namespace _24Hour
httpCliet.DefaultRequestHeaders.Add("User-Agent", "HttpClientFactory-Sample"); httpCliet.DefaultRequestHeaders.Add("User-Agent", "HttpClientFactory-Sample");
httpCliet.DefaultRequestHeaders.ConnectionClose = true; httpCliet.DefaultRequestHeaders.ConnectionClose = true;
} }
/// <summary>
/// 申请人资格资料
/// </summary>
/// <returns></returns>
[HttpPost("UploadImage")]
public async Task<Result> UploadImage(UploadDto dto)
{
var request = await httpCliet.PostAsJsonAsync($"/TwentySystem/UploadImage", dto);
var response = await request.EnsureSuccessStatusCode().Content.ReadAsStringAsync();
return response.ConvertToModel<Result>();
}
public async Task<Result<QueryResult<CaseInfo>>> GetCaseList(string? casename, string? bmsah, string? dwbm, DateTime? starttime, DateTime? endtime, int page, int size) public async Task<Result<QueryResult<CaseInfo>>> GetCaseList(string? casename, string? bmsah, string? dwbm, DateTime? starttime, DateTime? endtime, int page, int size)
{ {
Result<QueryResult<CaseInfo>> Result = new(); Result<QueryResult<CaseInfo>> Result = new();
@ -91,7 +106,6 @@ namespace _24Hour
} }
return Result; return Result;
} }
public async Task<Result<JZJBXXDto>> GetArchivesInfo(string bmsah, string dwbm) public async Task<Result<JZJBXXDto>> GetArchivesInfo(string bmsah, string dwbm)
{ {
var result = new Result<JZJBXXDto>(); var result = new Result<JZJBXXDto>();
@ -200,5 +214,28 @@ namespace _24Hour
public string? sfkcz { get; set; } public string? sfkcz { get; set; }
public string? qlzt { get; set; } public string? qlzt { get; set; }
} }
class MyClass
{
/// <summary>
/// 部门受案号
/// </summary>
public string bmsah { get; set; }
/// <summary>
/// base64字符串
/// </summary>
public string ImageStr { get; set; }
/// <summary>
/// 1423000000100-律师执业证书,
/// 1423000000200-律师事务所证,
/// 1423000000300-授权委托书,
/// 1423000000400-法律援助公函,
/// 1423000000500-身份证件 ,
/// 1423000000600-关系证明材料,
/// 1423000000700-其他
/// </summary>
public string Code { get; set; }
}
} }
} }

1
Dto/obj/Debug/net6.0/Dto.AssemblyInfoInputs.cache

@ -1 +0,0 @@
24467ac260176f765658abbc64d2580ba42c4bc0

11
Dto/obj/Debug/net6.0/Dto.GeneratedMSBuildEditorConfig.editorconfig

@ -1,11 +0,0 @@
is_global = true
build_property.TargetFramework = net6.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Dto
build_property.ProjectDir = C:\core\24Hour.Service\Dto\

BIN
Dto/obj/Debug/net6.0/Dto.assets.cache

Binary file not shown.

BIN
Dto/obj/Debug/net6.0/Dto.csproj.AssemblyReference.cache

Binary file not shown.

64
Dto/obj/Dto.csproj.nuget.dgspec.json

@ -1,64 +0,0 @@
{
"format": 1,
"restore": {
"C:\\core\\24Hour.Service\\Dto\\Dto.csproj": {}
},
"projects": {
"C:\\core\\24Hour.Service\\Dto\\Dto.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\core\\24Hour.Service\\Dto\\Dto.csproj",
"projectName": "Dto",
"projectPath": "C:\\core\\24Hour.Service\\Dto\\Dto.csproj",
"packagesPath": "C:\\Users\\Administrator\\.nuget\\packages\\",
"outputPath": "C:\\core\\24Hour.Service\\Dto\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Administrator\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\游戏文件夹\\Dll": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.306\\RuntimeIdentifierGraph.json"
}
}
}
}
}

15
Dto/obj/Dto.csproj.nuget.g.props

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Administrator\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.6.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Administrator\.nuget\packages\" />
</ItemGroup>
</Project>

69
Dto/obj/project.assets.json

@ -1,69 +0,0 @@
{
"version": 3,
"targets": {
"net6.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net6.0": []
},
"packageFolders": {
"C:\\Users\\Administrator\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\core\\24Hour.Service\\Dto\\Dto.csproj",
"projectName": "Dto",
"projectPath": "C:\\core\\24Hour.Service\\Dto\\Dto.csproj",
"packagesPath": "C:\\Users\\Administrator\\.nuget\\packages\\",
"outputPath": "C:\\core\\24Hour.Service\\Dto\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Administrator\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\游戏文件夹\\Dll": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.306\\RuntimeIdentifierGraph.json"
}
}
}
}

8
Dto/obj/project.nuget.cache

@ -1,8 +0,0 @@
{
"version": 2,
"dgSpecHash": "aBP4DpXaMgoARxZa7jC+2/OpB8f0apQvutUjpKvCZq5BqhIvN/WzLcvuunyUhHgo503i8NiV6jJvit7a9mkSCQ==",
"success": true,
"projectFilePath": "C:\\core\\24Hour.Service\\Dto\\Dto.csproj",
"expectedPackageFiles": [],
"logs": []
}
Loading…
Cancel
Save