From 6f6fba90d38bafc29be6f4b4da5be484440bb53c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Wed, 27 Dec 2023 17:59:19 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=9B=9E=E4=BC=A02.0=E6=97=B6=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=8C=87=E5=AE=9A=E5=9B=BE=E7=89=87=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=B8=BAjpg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 24Hour/Controllers/Common/LawyerArchivesController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/24Hour/Controllers/Common/LawyerArchivesController.cs b/24Hour/Controllers/Common/LawyerArchivesController.cs index 1a4604e..165546c 100644 --- a/24Hour/Controllers/Common/LawyerArchivesController.cs +++ b/24Hour/Controllers/Common/LawyerArchivesController.cs @@ -1059,10 +1059,12 @@ namespace _24Hour.Controllers.Common if (System.IO.File.Exists(filepath)) { var basestr = Elight.Utility.Encrypt.DataEncryption.Decryptiones(filepath); + var filename = Path.GetFileName(filepath); + filename = Path.ChangeExtension(filename, ".jpg"); await twentyClient.UploadImage(new UploadDto() { Bmsah = registerinfo.bmsah, - FileName = Path.GetFileName(filepath), + FileName = filename, Code = typecode, Bhdlbm = registerinfo.bhdlbh, UnitCode = registerinfo.dwbm, From 709bc35e1ff933f671b8116d04985fd7d1775223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Wed, 27 Dec 2023 18:00:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=B0=86=E5=BE=8B=E5=B8=88=E4=BA=8B?= =?UTF-8?q?=E5=8A=A1=E6=89=80=E8=AF=81=E6=98=8E=E7=A7=BB=E5=8A=A8=E5=88=B0?= =?UTF-8?q?=E5=BE=8B=E5=B8=88=E9=A2=84=E7=BA=A6=E6=9C=8D=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E5=BE=8B=E6=89=80=E8=AF=81=E5=90=8D=E4=B8=8E=E9=A2=84=E7=BA=A6?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Elight.Entity/AppMode/App_LawyerServicesModel.cs | 5 ++++- Elight.Entity/SystemModel/App_Sys_UserModel.cs | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Elight.Entity/AppMode/App_LawyerServicesModel.cs b/Elight.Entity/AppMode/App_LawyerServicesModel.cs index 2bf1817..b6ade7f 100644 --- a/Elight.Entity/AppMode/App_LawyerServicesModel.cs +++ b/Elight.Entity/AppMode/App_LawyerServicesModel.cs @@ -165,7 +165,10 @@ namespace Elight.Entity /// [DataMember] public string? legalAidPhoto { get; set; } - + /// + /// 单位证明 律师事务所证明 + /// + public string? departmentPhoto { get; set; } /// /// 关系证明图片 /// diff --git a/Elight.Entity/SystemModel/App_Sys_UserModel.cs b/Elight.Entity/SystemModel/App_Sys_UserModel.cs index c5fd23d..8b81cd6 100644 --- a/Elight.Entity/SystemModel/App_Sys_UserModel.cs +++ b/Elight.Entity/SystemModel/App_Sys_UserModel.cs @@ -37,10 +37,6 @@ namespace Elight.Entity /// [DataMember] public string? departmentName { get; set; } - /// - /// 单位证明 律师事务所证明 - /// - public string? departmentPhoto { get; set; } /// /// 单位同意信用代码 From bb8cb030094ea0ca4b6c5005a6e2d4abd36f6c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Wed, 27 Dec 2023 18:17:59 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E5=BE=8B=E5=B8=88?= =?UTF-8?q?=E4=BA=8B=E5=8A=A1=E6=89=80=E8=AF=81=E6=98=8E=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E8=87=B3=E5=BE=8B=E5=B8=88=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/LawyerArchivesController.cs | 42 +++--- 24Hour/Controllers/LoginController.cs | 2 - .../system/SystemControllerController.cs | 124 +++++++++--------- 3 files changed, 87 insertions(+), 81 deletions(-) diff --git a/24Hour/Controllers/Common/LawyerArchivesController.cs b/24Hour/Controllers/Common/LawyerArchivesController.cs index 165546c..86fa6c7 100644 --- a/24Hour/Controllers/Common/LawyerArchivesController.cs +++ b/24Hour/Controllers/Common/LawyerArchivesController.cs @@ -1079,7 +1079,7 @@ namespace _24Hour.Controllers.Common await UploadPhoto(lawyer.identityphoto, "1423000000100"); - await UploadPhoto(lawyer.departmentPhoto, "1423000000200"); + await UploadPhoto(lawyersvc.departmentPhoto, "1423000000200"); await UploadPhoto(lawyersvc.annex, "1423000000300"); await UploadPhoto(lawyersvc.legalAidPhoto, "1423000000400"); await UploadPhoto(lawyer.cardIdphoto, "1423000000500"); @@ -1824,7 +1824,7 @@ namespace _24Hour.Controllers.Common { userim.cardIdphoto = cardids; userim.identityphoto = files; - userim.departmentPhoto = departments; + userim.unitCode = _userdata.unitCode; userim.identity = "律师"; userim.IsDeleted = 0; @@ -1836,7 +1836,6 @@ namespace _24Hour.Controllers.Common { user.cardIdphoto = cardids; user.identityphoto = files; - user.departmentPhoto = departments; user.unitCode = _userdata.unitCode; user.identity = "律师"; user.IsDeleted = 0; @@ -1846,7 +1845,6 @@ namespace _24Hour.Controllers.Common { x.cardIdphoto, x.identityphoto, - x.departmentPhoto, x.unitCode, x.identity, x.IsDeleted @@ -1894,6 +1892,14 @@ namespace _24Hour.Controllers.Common .ToList() .ConvertToJsonStr(); + var departmentPhoto = Path.Combine(ziplawyersvcs, lawyersvc.Id, "departmentPhoto"); + var departmentPhotos = new DirectoryInfo(departmentPhoto) + .GetFiles() + .Select(x => "/CaseFile/imports/" + Path.GetRelativePath(dir, x.FullName) + .Replace(@"\", @"/")) + .ToList() + .ConvertToJsonStr(); + if (svc == null) { var lawyer = await _db.Queryable() @@ -1908,6 +1914,7 @@ namespace _24Hour.Controllers.Common lawyersvc.legalAidPhoto = legalAidPhotos; lawyersvc.relationshipProofPhoto = relationshipProofPhotos; lawyersvc.otherPhoto = otherPhotos; + lawyersvc.departmentPhoto = departmentPhotos; lawyersvc.IsAssigned = false; _db.BeginTran(); var num = await _db.Insertable(lawyersvc).ExecuteCommandAsync(); @@ -2027,6 +2034,7 @@ namespace _24Hour.Controllers.Common packetPhotoField(item?.legalAidPhoto, "legalAidPhoto"); packetPhotoField(item?.relationshipProofPhoto, "relationshipProofPhoto"); packetPhotoField(item?.otherPhoto, "otherPhoto"); + packetPhotoField(item?.departmentPhoto, "departmentPhoto"); } //存储用户的相关附件 foreach (var item in users) @@ -2062,19 +2070,19 @@ namespace _24Hour.Controllers.Common } } - var departmentPhotos = item.departmentPhoto.ConvertToModel>(); - var departmentPhotosDir = Path.Combine(userdir, "departmentPhotos"); - if (Directory.Exists(departmentPhotosDir) == false) Directory.CreateDirectory(departmentPhotosDir); - foreach (var file in departmentPhotos) - { - //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)) - { - System.IO.File.Copy(filepath, Path.Combine(departmentPhotosDir, Path.GetFileName(filepath)), true); - } - } + ////var departmentPhotos = item.departmentPhoto.ConvertToModel>(); + ////var departmentPhotosDir = Path.Combine(userdir, "departmentPhotos"); + ////if (Directory.Exists(departmentPhotosDir) == false) Directory.CreateDirectory(departmentPhotosDir); + ////foreach (var file in departmentPhotos) + ////{ + //// //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)) + //// { + //// System.IO.File.Copy(filepath, Path.Combine(departmentPhotosDir, Path.GetFileName(filepath)), true); + //// } + ////} } logger.LogInformation("step4"); ZipFile.CreateFromDirectory(packegdir, packegzipname); diff --git a/24Hour/Controllers/LoginController.cs b/24Hour/Controllers/LoginController.cs index 0b48346..5841b14 100644 --- a/24Hour/Controllers/LoginController.cs +++ b/24Hour/Controllers/LoginController.cs @@ -446,7 +446,6 @@ namespace _24Hour.Controllers unitCode = date.unitCode, token = tokenString, openId = date.wechatId, - departmentPhoto = date.departmentPhoto, identityphoto = date.identityphoto, cardIdphoto = date.cardIdphoto, departmentName = date.departmentName, @@ -522,7 +521,6 @@ namespace _24Hour.Controllers data.Password = Elight.Utility.Encrypt.Md5.Encrypt32($"{UserModel.Password}").ToLower(); data.cardIdphoto = UserModel.cardIdphoto; data.identityphoto = UserModel.identityphoto; - data.departmentPhoto = UserModel.departmentPhoto; var num = await _db.Updateable(data).IgnoreColumns(true).ExecuteCommandAsync(); _db.CommitTran(); if (num > 0) diff --git a/24Hour/Controllers/system/SystemControllerController.cs b/24Hour/Controllers/system/SystemControllerController.cs index fac2e69..c0b144c 100644 --- a/24Hour/Controllers/system/SystemControllerController.cs +++ b/24Hour/Controllers/system/SystemControllerController.cs @@ -695,74 +695,74 @@ namespace _24Hour.Controllers.system /// /// /// - [HttpGet] - [Route("EditDepartmentPhoto")] - public async Task EditDepartmentPhoto(string photo) - { - try - { - _db.BeginTran(); - var userlist = await _db.Queryable().Where(q => q.IsDeleted == 0 && q.Id == _userdata.Id).ToListAsync(); - userlist.ForEach(q => - { - //头像地址 - q.departmentPhoto = photo; - }); - var num = await _db.Updateable(userlist).ExecuteCommandAsync(); - _db.CommitTran(); - if (num > 0) - { - result.IsSucceed = true; - result.result = "替换成功"; - } - } - catch (System.Exception ex) - { - _db.RollbackTran(); - result.IsSucceed = false; - result.Message = ex.Message; - LogService.WriteLog(ex, "用户部门证件替换"); - } - _logs.WriteSysLogadd("用户管理", "用户部门证件替换", result, _db); - return result; - } + //[HttpGet] + //[Route("EditDepartmentPhoto")] + //public async Task EditDepartmentPhoto(string photo) + //{ + // try + // { + // _db.BeginTran(); + // var userlist = await _db.Queryable().Where(q => q.IsDeleted == 0 && q.Id == _userdata.Id).ToListAsync(); + // userlist.ForEach(q => + // { + // //头像地址 + // q.departmentPhoto = photo; + // }); + // var num = await _db.Updateable(userlist).ExecuteCommandAsync(); + // _db.CommitTran(); + // if (num > 0) + // { + // result.IsSucceed = true; + // result.result = "替换成功"; + // } + // } + // catch (System.Exception ex) + // { + // _db.RollbackTran(); + // result.IsSucceed = false; + // result.Message = ex.Message; + // LogService.WriteLog(ex, "用户部门证件替换"); + // } + // _logs.WriteSysLogadd("用户管理", "用户部门证件替换", result, _db); + // return result; + //} /// /// 根据律师id修改律师事务所证明图片 /// /// /// /// - [HttpPost] - [Route("EditLawyerDepartmentPhoto")] - public async Task EditLawyerDepartmentPhoto(EditLawyerInput input) - { - try - { - _db.BeginTran(); - var userlist = await _db.Queryable().Where(q => q.IsDeleted == 0 && q.Id ==input.lawyerid).ToListAsync(); - userlist.ForEach(q => - { - //头像地址 - q.departmentPhoto = input.photo.ConvertToJsonStr(); - }); - var num = await _db.Updateable(userlist).ExecuteCommandAsync(); - _db.CommitTran(); - if (num > 0) - { - result.IsSucceed = true; - result.result = "替换成功"; - } - } - catch (System.Exception ex) - { - _db.RollbackTran(); - result.IsSucceed = false; - result.Message = ex.Message; - LogService.WriteLog(ex, "用户部门证件替换"); - } - _logs.WriteSysLogadd("用户管理", "用户部门证件替换", result, _db); - return result; - } + //[HttpPost] + //[Route("EditLawyerDepartmentPhoto")] + //public async Task EditLawyerDepartmentPhoto(EditLawyerInput input) + //{ + // try + // { + // _db.BeginTran(); + // var userlist = await _db.Queryable().Where(q => q.IsDeleted == 0 && q.Id ==input.lawyerid).ToListAsync(); + // userlist.ForEach(q => + // { + // //头像地址 + // q.departmentPhoto = input.photo.ConvertToJsonStr(); + // }); + // var num = await _db.Updateable(userlist).ExecuteCommandAsync(); + // _db.CommitTran(); + // if (num > 0) + // { + // result.IsSucceed = true; + // result.result = "替换成功"; + // } + // } + // catch (System.Exception ex) + // { + // _db.RollbackTran(); + // result.IsSucceed = false; + // result.Message = ex.Message; + // LogService.WriteLog(ex, "用户部门证件替换"); + // } + // _logs.WriteSysLogadd("用户管理", "用户部门证件替换", result, _db); + // return result; + //} public class EditLawyerInput { public string[] photo { get; set; }