From 3c1cef7338c77c0921f4c308ad3349a72720ab18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Wed, 29 Nov 2023 14:52:09 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9git=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 9294111..3922885 100644 --- a/.gitignore +++ b/.gitignore @@ -80,3 +80,5 @@ dkms.conf /24Hour/Properties/PublishProfiles/FolderProfile1.pubxml /24Hour/Properties/PublishProfiles/FolderProfile1.pubxml.user /24Hour/wwwroot +/Dto/obj +/Dto/obj/Debug \ No newline at end of file From 09a7f207876a6f3213cb2005e23a15c4e98f2044 Mon Sep 17 00:00:00 2001 From: linyang <369845068@qq.com> Date: Thu, 30 Nov 2023 07:57:08 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=A1=88=E4=BB=B6=E7=99=BB=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dto/FindAjxxDto.cs | 111 +++++++++ Dto/FindSqrxxDto.cs | 111 +++++++++ Dto/RegisterDto.cs | 32 ++- Dto/SaveBhdlDjxxDto.cs | 211 ++++++++++++++++++ .../net6.0/Dto.csproj.BuildWithSkipAnalyzers | 0 .../net6.0/Dto.csproj.CoreCompileInputs.cache | 2 +- .../Controllers/TwentySystemController.cs | 159 ++++++++++++- .../Debug/net6.0/WebApplication1.deps.json | 11 + ...pplication1.csproj.CoreCompileInputs.cache | 2 +- 9 files changed, 622 insertions(+), 17 deletions(-) create mode 100644 Dto/FindAjxxDto.cs create mode 100644 Dto/FindSqrxxDto.cs create mode 100644 Dto/SaveBhdlDjxxDto.cs create mode 100644 Dto/obj/Debug/net6.0/Dto.csproj.BuildWithSkipAnalyzers diff --git a/Dto/FindAjxxDto.cs b/Dto/FindAjxxDto.cs new file mode 100644 index 0000000..2483137 --- /dev/null +++ b/Dto/FindAjxxDto.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Dto +{ + public class FindAjxxDto + { + public int endRow { get; set; } + public int firstPage { get; set; } + public bool hasNextPage { get; set; } + public bool hasPreviousPage { get; set; } + public bool isFirstPage { get; set; } + + public bool isLastPage { get; set; } + + public List list { get; set; } + + public int lastPage { get; set; } + public int navigateFirstPage { get; set; } + public int navigateLastPage { get; set; } + public int navigatePages { get; set; } + public List navigatepageNums { get; set; } + + public int nextPage { get; set; } + public int pageNum { get; set; } + public int pageSize { get; set; } + public int pages { get; set; } + + public int prePage { get; set; } + + public int size { get; set; } + + public int startRow { get; set; } + + public int total { get; set; } + } + + public class FindAjxxBaseDto + { + /// + /// 案件类型编码 + /// + public string ajlbbm { get; set; } + /// + /// 案件类型名称 + /// + public string ajlbmc { get; set; } + /// + /// 案件名称 + /// + public string ajmc { get; set; } + /// + /// 案情摘要 + /// + public string aqzy { get; set; } + /// + /// 部门受案号 + /// + public string bmsah { get; set; } + /// + /// 承办部门编码 + /// + public string cbbmbm { get; set; } + /// + /// 承办部门名称 + /// + public string cbbmmc { get; set; } + /// + /// 承办单位编码 + /// + public string cbdwbm { get; set; } + /// + /// 承办单位名称 + /// + public string cbdwmc { get; set; } + /// + /// 承办检察官 + /// + public string cbjcg { get; set; } + /// + /// 承办阶段编码 + /// + public string cbjcgbm { get; set; } + /// + /// 承办阶段名称 + /// + public string dqjdmc { get; set; } + /// + /// + /// + public string sfkcz { get; set; } + /// + /// 受理日期 + /// + public string slrq { get; set; } + /// + /// 移送单位名称 + /// + public string ysdwdm { get; set; } + /// + /// 移送单位名称 + /// + public string ysdwmc { get; set; } + + + } + +} \ No newline at end of file diff --git a/Dto/FindSqrxxDto.cs b/Dto/FindSqrxxDto.cs new file mode 100644 index 0000000..daa9964 --- /dev/null +++ b/Dto/FindSqrxxDto.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Dto +{ + public class FindSqrxxDto + { + public List content { get; set; } + public bool empty { get; set; } + public bool first { get; set; } + public bool last { get; set; } + + public int number { get; set; } + public int numberOfElements { get; set; } + + public PageableDto pageable { get; set; } + + public int size { get; set; } + + + public SortDto sort { get; set; } + + public int totalPages { get; set; } + + public int totalElements { get; set; } + } + + public class ContentDto + { + + /// + /// 创建时间 + /// + public string cjsj { get; set; } + /// + /// 等级单位代码 + /// + public string djdwbm { get; set; } + /// + /// 等级单位代码 + /// + public string djdwmc { get; set; } + /// + /// 居民身份证 + /// + public string jmsfzh { get; set; } + public object lxdh { get; set; } + public object lxdz { get; set; } + public string sfsc { get; set; } + public string sjbsbh { get; set; } + public string sjly { get; set; } + public string sqrbh { get; set; } + public string sqrlxdm { get; set; } + /// + /// 申请人类型 + /// + public string sqrlxmc { get; set; } + /// + /// 申请人身份代码 + /// + public string sqrsfdm { get; set; } + /// + /// 申请人身份 -律师 + /// + public string sqrsfmc { get; set; } + + /// + /// 申请人姓名 + /// + public string sqrxm { get; set; } + public string szlssws { get; set; } + public string tyshxydm { get; set; } + public object zbls { get; set; } + public string zhxgsj { get; set; } + /// + /// 证件类型号码 + /// + public string zjhm { get; set; } + /// + /// 证件类型代码 + /// + public string zjlxdm { get; set; } + /// + /// 证件类型名称 + /// + public string zjlxmc { get; set; } + public object zyzh { get; set; } + + } + + + public class PageableDto + { + public int offset { get; set; } + public int pageNumber { get; set; } + public int pageSize { get; set; } + public bool paged { get; set; } + public bool unpaged { get; set; } + + public SortDto sort { get; set; } + } + public class SortDto + { + public bool empty { get; set; } + public bool sorted { get; set; } + public bool unsorted { get; set; } + } +} diff --git a/Dto/RegisterDto.cs b/Dto/RegisterDto.cs index 6239db8..77a88c7 100644 --- a/Dto/RegisterDto.cs +++ b/Dto/RegisterDto.cs @@ -29,25 +29,25 @@ namespace Dto /// /// 当事人身份证 /// - public string PartyIdCard { get; set; } + public string PartyIdCard { get; set; } /// /// 当事人-委托人 /// - public int PartyConsignor { get; set; } + public string PartyConsignor { get; set; } /// /// 当事人-委托人关系 /// - public int PartyPrincipalRelationship { get; set; } + public string PartyPrincipalRelationship { get; set; } /// - /// 申请人-身份证 + /// 申请人-律师证件号码 /// - public string ProposerIdCard { get; set; } + public string ProposerZJHM { get; set; } /// /// 申请人类型 @@ -67,5 +67,27 @@ namespace Dto /// public string ProposerSCC { get; set; } + + /// + /// 委托人 + /// + public string Wtr { get; set; } + /// + /// 委托人与当事人关系 + /// + public string Wtrydsrgxdm { get; set; } + /// + /// 委托人与当事人关系 + /// + public string Wtrydsrgxmc { get; set; } + /// + /// 值班律师 + /// + public string Zbls { get; set; } + + + public string Lxdh { get; set; } + + public string Lxdz { get; set; } } } diff --git a/Dto/SaveBhdlDjxxDto.cs b/Dto/SaveBhdlDjxxDto.cs new file mode 100644 index 0000000..ee5f7bc --- /dev/null +++ b/Dto/SaveBhdlDjxxDto.cs @@ -0,0 +1,211 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Dto +{ + public class SaveBhdlDjxxDto + { + /// + /// 单位编码 + /// + public string ajcbdwbm { get; set; } + + /// + /// 单位名称 + /// + public string ajcbdwmc { get; set; } + + + /// + /// 案件名称 + /// + public string ajmc { get; set; } + + + + /// + /// + /// + public string bhdlbh { get; set; } + + /// + /// 部门受案号 + /// + public string bmsah { get; set; } + + + /// + /// 承办检察官 + /// + public string czr { get; set; } + + /// + /// 承办检察官编码 + /// + public string czrybm { get; set; } + + + /// + /// 单位编码 + /// + public string dwbm { get; set; } + + /// + /// 法律援助内容 + /// + public string flyznr { get; set; } + + /// + /// / + /// + // public string jwgkdjid { get; set; } + + /// + /// 是否案管登记 Y + /// + public string sfagdj { get; set; } + + + /// + /// 是否法律援助 + /// + public string sfflyz { get; set; } + + + /// + /// 申请人编号 + /// + public string sqrbh { get; set; } + + public string wfwgqkdm { get; set; } = null; + + public string wfwgqkmc { get; set; } = ""; + + public string wfwgqknr { get; set; } = null; + + + /// + /// 委托人 + /// + public string wtr { get; set; } + + /// + /// 委托人与当事人关系 代码 + /// + + public string wtrydsrgxdm { get; set; } + + /// + /// 委托人与当事人关系名称 + /// + public string wtrydsrgxmc { get; set; } + + /// + /// 值班律师 + /// + public string zbls { get; set; } + + /// + /// 责任人编码 + /// + public string zrrbm { get; set; } + + + public BhdlYxSqrInsertInputDto bhdlYxSqrInsertInputDto { get; set; } + } + + public class BhdlYxSqrInsertInputDto + { + /// + /// 登记单位编码 + /// + public string djdwbm { get; set; } + + /// + /// 登记单位名称 + /// + public string djdwmc { get; set; } + + + /// + /// 居民身份证号码 + /// + public string jmsfzh { get; set; } + + /// + /// 联系电话 + /// + public string lxdh { get; set; } + + + /// + /// 联系地址 + /// + public string lxdz { get; set; } + /// + /// + /// + + public bool sfgxlsk { get; set; } = false; + + + /// + /// 申请人类型d代码 1403187300001 -辩护人 + /// + public string sqrlxdm { get; set; } + + + /// + /// 申请人类型 + /// + public string sqrlxmc { get; set; } + + + /// + /// 身份代码 + /// + public string sqrsfdm { get; set; } + + + /// + /// 身份名称 + /// + public string sqrsfmc { get; set; } + + + /// + /// 姓名 + /// + public string sqrxm { get; set; } + + /// + /// 所在律师事务所 + /// + + public string szlssws { get; set; } + + /// + /// 律师事务所统一社会信用代码 + /// + public string tyshxydm { get; set; } + + /// + /// 证件号码 + /// + public string zjhm { get; set; } + + + /// + /// 证件类型代码 + /// + public string zjlxdm { get; set; } + + /// + /// 证件类型 + /// + public string zjlxmc { get; set; } + } +} diff --git a/Dto/obj/Debug/net6.0/Dto.csproj.BuildWithSkipAnalyzers b/Dto/obj/Debug/net6.0/Dto.csproj.BuildWithSkipAnalyzers new file mode 100644 index 0000000..e69de29 diff --git a/Dto/obj/Debug/net6.0/Dto.csproj.CoreCompileInputs.cache b/Dto/obj/Debug/net6.0/Dto.csproj.CoreCompileInputs.cache index b2e1945..95d3e8e 100644 --- a/Dto/obj/Debug/net6.0/Dto.csproj.CoreCompileInputs.cache +++ b/Dto/obj/Debug/net6.0/Dto.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -ccca575b8362d1b2377ddd7db4c9085ea077e8d3 +f9c18559eda95e06ad72c50817c8719331c1dbf8 diff --git a/WebApplication1/Controllers/TwentySystemController.cs b/WebApplication1/Controllers/TwentySystemController.cs index 3716222..a76e10e 100644 --- a/WebApplication1/Controllers/TwentySystemController.cs +++ b/WebApplication1/Controllers/TwentySystemController.cs @@ -366,7 +366,7 @@ namespace WebApplication1.Controllers pageSize = 10, pageNum = 1, blzt = 0, - dwbm = "410503", + dwbm = dto.UnitCode, bmsah = dto.Bmsah, ajmc = "", gjz = "", @@ -507,7 +507,7 @@ namespace WebApplication1.Controllers /// - /// ȼ + /// Ǽ /// /// /// @@ -516,7 +516,7 @@ namespace WebApplication1.Controllers { Result result = new Result(); #region ж - if (dto != null) + if (dto == null) { result.IsSucceed = false; result.Message = "ʧ"; @@ -558,7 +558,7 @@ namespace WebApplication1.Controllers result.Message = "ϵ绰Ϊ"; return result; } - if (string.IsNullOrEmpty(dto.ProposerIdCard)) + if (string.IsNullOrEmpty(dto.ProposerZJHM)) { result.IsSucceed = false; result.Message = "֤Ϊ"; @@ -567,19 +567,158 @@ namespace WebApplication1.Controllers #endregion - var findAjgldsrxx = new + UploadImageDto uploadImageDto = new UploadImageDto() { - bmsah = dto.Bmsah, - dwbm = dto.UnitCode, - gjz = dto.PartyIdCard, + pageSize = 10, pageNum = 1, - pageSize = 20 + blzt = 0, + dwbm = dto.UnitCode, + bmsah = dto.Bmsah, + ajmc = "", + gjz = "", + jsrq = null, + ksrq = null, + sqrxm = "", + sxlxdm = "", + zrrxm = "", }; - var request = await httpClient.PostAsJsonAsync("/bhdl-service/api/bhdlGl/findAjgldsrxx", findAjgldsrxx); + // Ϣ + var request = await httpClient.PostAsJsonAsync("/bhdl-service/api/bhdlGl/findBhdlGzbl", uploadImageDto); var findBhdlGzbl = await request.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); var resultGzbl = JsonConvert.DeserializeObject(findBhdlGzbl); + if (resultGzbl.success == false && resultGzbl.code != "0") + { + result.IsSucceed = false; + result.Message = "ݲ"; + return result; + } + + string bhdlbh = resultGzbl.data.coumment.FirstOrDefault()?.bhdlbh; + string lx = "2803,1303,2801,2802,2804,2805,2001,2031,2002,2003,2004,2005,2006,2007,2009,2010,2011,2012,2013,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2029,2032,2033,2034,2035,2036,2037,2039,2040,2041,2042,2043,2044,2048,2050,2051,2052,2053,2054,2055,2056,2058,2059,1602,2062,2077,2078,1603,1621,1622,1604,1638,1650,1608,1611,1614,1635,1626,1632,1625,1619,1634,1630,1631,1633,1636,1637,1801,1802,1803,1805,1806,1807,1808,1809,1810,1812,1813,1916,1919,1917,1918,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915,0708,0709,0710,0711,0712,0726,0722,0725,0727,0702,0703,0704,0705,0706,0724,0723,0720,0721,0713,0718,0719,0717,0701,0707,0714,0715,0716,1701,1702,1703,1704,1705,1706,1708,1709,1710,1711,1712,1713,1714,1715,1716,1718,1719,1720,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1736,1737,1738,1740,1741,1742,1743,1744,1745,1747,1748,1749,1750,1752,1753,1754,1756,1757,1758,1759,1760,1761,1762,1784,1789,1785,1786,1787,1788,2714,1768,2736,1769,2713,1770,2715,1771,1778,1772,1779,1773,1780,1774,1781,1775,1782,2734,2735,2732,2733,1790,1791,1792,2701,2702,2703,2704,2705,2706,2707,2708,2710,2711,2712,2716,2717,2718,2719,2721,2722,2723,2724,2726,2727,2728,2729,2730,2731,2737,0802,0803,0805,0806,0826,0818,0819,0808,0809,0810,0811,0812,0814,0815,0816,0817,0820,0821,0822,0823,0804,0813,0824,0825,0827,0828,1406,1401,1402,1403,1404,1405,1408,1409,1410,1411,1412,1413,1414,1415,1416,1107,1111,1112,1108,1302,1304,1305,2210,2211,2302,2303,2301,2401,2402,2119,2122,2123,2120,2601,2602,2603,2604,0301,3001,3002"; + var findAjxx = new + { + ajlbbms = lx.Split(",").ToList(), + dwbm = dto.UnitCode, + gjz = "", + bmsah = dto.Bmsah, + ajmc = "", + cbjcg = "", + zrrxm = "", + ksrq = "", + jsrq = "", + pageNum = 1, + pageSize = 10 + + }; + //Ϣ + var ajrequest = await httpClient.PostAsJsonAsync("/bhdl-service/api/bhdlGl/findAjxx", findAjxx); + var ajModel = await ajrequest.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); + var ajxxDto = JsonConvert.DeserializeObject>(ajModel); + if (ajxxDto.code != "0" && ajxxDto.success == false) + { + result.IsSucceed = false; + result.Message = "ݲ"; + return result; + } + foreach (var item in ajxxDto.data.list) + { + var findAjgldsrxx = new + { + bmsah = dto.Bmsah, + dwbm = dto.UnitCode, + gjz = dto.PartyIdCard, + pageNum = 1, + pageSize = 20 + }; + //Ϣ + var dsrrequest = await httpClient.PostAsJsonAsync("/bhdl-service/api/bhdlGl/findAjgldsrxx", findAjgldsrxx); + var dsrResult = await dsrrequest.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); + var dsrModel = JsonConvert.DeserializeObject>(dsrResult); + if (dsrModel.success == false && dsrModel.code != "0" && dsrModel.data.list.Count == 0) + { + result.IsSucceed = false; + result.Message = "ݲ"; + return result; + } + + var dsrModle = dsrModel.data.list.Where(x => x.zjhm == dto.PartyIdCard).FirstOrDefault(); + if (dsrModle == null) + { + result.IsSucceed = false; + result.Message = "ݲ"; + return result; + } + ///Ϣ + var findSqrxx = new + { + gjz = dto.ProposerZJHM, + pageNum = 0, + pageSize = 20 + }; + var sqrrequest = await httpClient.PostAsJsonAsync("/bhdl-service/api/bhdlDj/findSqrxx", findSqrxx); + var sqrRuslt = await sqrrequest.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); + var SqrDto = JsonConvert.DeserializeObject>(sqrRuslt); + if (SqrDto.success == false && SqrDto.code != "0" && SqrDto.data.content.Count == 0) + { + result.IsSucceed = false; + result.Message = "ʦݲ"; + return result; + } + var sqrModel = SqrDto.data.content.Where(x => x.zjhm == dto.ProposerZJHM).FirstOrDefault(); + if (sqrModel == null) + { + result.IsSucceed = false; + result.Message = "ʦݲ"; + return result; + } + + SaveBhdlDjxxDto saveBhdlDjxxDto = new SaveBhdlDjxxDto() + { + ajcbdwbm = dto.UnitCode, + ajcbdwmc = dto.UnitName, + ajmc = item.ajmc, + bhdlbh = bhdlbh, + bmsah = dto.Bmsah, + czr = item.cbjcg, + czrybm = item.cbjcgbm, + dwbm = dto.UnitCode, + flyznr = "", + sfagdj = "Y", + sfflyz = "N", + sqrbh = sqrModel.sqrbh, + wfwgqkdm = "", + wfwgqkmc = "", + wfwgqknr = "", + wtr = dto.Wtr, + wtrydsrgxdm = dto.Wtrydsrgxdm, + wtrydsrgxmc = dto.Wtrydsrgxmc, + zbls = dto.Zbls, + zrrbm = dsrModle.zrrbm, + bhdlYxSqrInsertInputDto = new BhdlYxSqrInsertInputDto() + { + djdwbm = sqrModel.djdwbm, + djdwmc = sqrModel.djdwmc, + jmsfzh = sqrModel.jmsfzh, + lxdh = dto.Lxdh, + lxdz = dto.Lxdz, + sfgxlsk = false, + sqrlxdm = sqrModel.sqrlxdm, + sqrlxmc = sqrModel.sqrlxmc, + sqrsfdm = sqrModel.sqrsfdm, + sqrsfmc = sqrModel.sqrsfmc, + sqrxm = sqrModel.sqrxm, + szlssws = sqrModel.szlssws, + tyshxydm = sqrModel.tyshxydm, + zjhm = sqrModel.zjhm, + zjlxdm = sqrModel.zjlxdm, + zjlxmc = sqrModel.zjlxmc, + } + }; + var addrequest = await httpClient.PostAsJsonAsync("/bhdl-service/api/bhdlDj/saveBhdlDjxx", saveBhdlDjxxDto); + var addRuslt = await addrequest.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); + } return result; } diff --git a/WebApplication1/bin/Debug/net6.0/WebApplication1.deps.json b/WebApplication1/bin/Debug/net6.0/WebApplication1.deps.json index a198b2e..0960ebd 100644 --- a/WebApplication1/bin/Debug/net6.0/WebApplication1.deps.json +++ b/WebApplication1/bin/Debug/net6.0/WebApplication1.deps.json @@ -8,6 +8,7 @@ ".NETCoreApp,Version=v6.0": { "WebApplication1/1.0.1.0": { "dependencies": { + "Dto": "1.0.0", "Microsoft.VisualStudio.Azure.Containers.Tools.Targets": "1.18.1", "Newtonsoft.Json": "13.0.3", "Swashbuckle.AspNetCore": "6.0.0" @@ -71,6 +72,11 @@ "fileVersion": "6.0.0.0" } } + }, + "Dto/1.0.0": { + "runtime": { + "Dto.dll": {} + } } } }, @@ -135,6 +141,11 @@ "sha512": "sha512-VusRaCFt2As3SXBJmUOGA40IGr6ao+vsvDi7jbCS4AFx69kUUm8zxIHeJVqGov3w4lQowVxv8gmonRXDRh1FvQ==", "path": "swashbuckle.aspnetcore.swaggerui/6.0.0", "hashPath": "swashbuckle.aspnetcore.swaggerui.6.0.0.nupkg.sha512" + }, + "Dto/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" } } } \ No newline at end of file diff --git a/WebApplication1/obj/Debug/net6.0/WebApplication1.csproj.CoreCompileInputs.cache b/WebApplication1/obj/Debug/net6.0/WebApplication1.csproj.CoreCompileInputs.cache index 7c542f7..0fc87ec 100644 --- a/WebApplication1/obj/Debug/net6.0/WebApplication1.csproj.CoreCompileInputs.cache +++ b/WebApplication1/obj/Debug/net6.0/WebApplication1.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -fc6a57648ae2715e3ffa56ead59576c5c6cfeb81 +2374669d97bc9eeebd97d909453e867df6a39cf9 From 2f57f9e6944fb7a1018340c709f7da7af9838d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Thu, 30 Nov 2023 10:21:25 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=9D=9E=E7=A9=BA?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/LawyerArchivesController.cs | 586 +++++++++--------- 1 file changed, 300 insertions(+), 286 deletions(-) diff --git a/24Hour/Controllers/Common/LawyerArchivesController.cs b/24Hour/Controllers/Common/LawyerArchivesController.cs index 746c372..93ff698 100644 --- a/24Hour/Controllers/Common/LawyerArchivesController.cs +++ b/24Hour/Controllers/Common/LawyerArchivesController.cs @@ -80,7 +80,6 @@ namespace _24Hour.Controllers.Common res.result = data; return res; } - /// /// 修改内网律师信息 /// @@ -815,8 +814,6 @@ namespace _24Hour.Controllers.Common }; return result; } - - /// /// 统计阅卷信息 /// @@ -989,7 +986,6 @@ namespace _24Hour.Controllers.Common }; return result; } - /// /// 按律师分类 /// @@ -1106,335 +1102,353 @@ namespace _24Hour.Controllers.Common [Route("ImportLawyerArchivesInfo")] public async Task ImportLawyerArchivesInfo(string path) { - if (System.IO.File.Exists(path) == false) - { - 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), - users = default(List) - }); - foreach (var userim in importdata.users) + try { - var user = await _db.Queryable() - .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) + if (System.IO.File.Exists(path) == false) { - userim.cardIdphoto = cardids; - userim.identityphoto = files; - userim.departmentPhoto = departments; - - _db.BeginTran(); - var num = await _db.Insertable(userim).ExecuteCommandAsync(); - _db.CommitTran(); + result.Message = "文件丢失"; + result.IsSucceed = false; + return result; } - 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; - 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(); + result.Message = "文件丢失"; + result.IsSucceed = false; + return result; } - } - foreach (var lawyersvc in importdata.lawyerservices) - { - var svc = await _db.Queryable() - .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() - .Where(x => x.cardId == lawyersvc.createuserId) - .Where(x => x.IsDeleted == 0) - .Where(x => x.isdeactivate == 0) - .Where(x => x.identity == "律师") - .FirstAsync(); + var json = System.IO.File.ReadAllText(zipjson); - lawyersvc.createuserId = lawyer.Id; - lawyersvc.annex = annexs; - lawyersvc.legalAidPhoto = legalAidPhotos; - lawyersvc.relationshipProofPhoto = relationshipProofPhotos; - lawyersvc.otherPhoto = otherPhotos; + var jsonstr = Encoding.UTF8.GetString(Convert.FromBase64String(json)); - _db.BeginTran(); - var num = await _db.Insertable(lawyersvc).ExecuteCommandAsync(); - _db.CommitTran(); + var importdata = jsonstr.ConvertToAnonymousType(new + { + lawyerservices = default(List), + users = default(List) + }); + foreach (var userim in importdata.users) + { + var user = await _db.Queryable() + .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() - .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(); + var svc = await _db.Queryable() + .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() + .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() + .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; return result; } - [HttpPost] [Route("ExportLawyerArchivesInfo")] public async Task ExportLawyerArchivesInfo(List ids) { - var lawyerarchives = await _db.Queryable() - .In(info => info.Id, ids) - .ToListAsync(); - var userids = lawyerarchives - .Select(x => x.createuserId) - .Distinct() - .ToList(); - var users = await _db.Queryable() - .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) + try { - var lawyerdir = Path.Combine(packegdir, "lawyerservices", item.Id); - if (Directory.Exists(lawyerdir) == false) Directory.CreateDirectory(lawyerdir); - + var lawyerarchives = await _db.Queryable() + .In(info => info.Id, ids) + .ToListAsync(); + var userids = lawyerarchives + .Select(x => x.createuserId) + .Distinct() + .ToList(); + var users = await _db.Queryable() + .In(x => x.Id, userids) + .ToListAsync(); - var files = item.annex.ConvertToModel>(); - var annecdir = Path.Combine(lawyerdir, "annexs"); - if (Directory.Exists(annecdir) == false) Directory.CreateDirectory(annecdir); - foreach (var file in files) + //把创建人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 { - var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\"); - if (System.IO.File.Exists(filepath)) + 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); + if (Directory.Exists(lawyerdir) == false) Directory.CreateDirectory(lawyerdir); + + + var files = item.annex.ConvertToModel>() ?? new List(); + 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)); - System.IO.File.Copy(filepath, targetfile); + var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\"); + 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>(); - var legalAidPhotoDir = Path.Combine(lawyerdir, "legalAidPhoto"); - if (Directory.Exists(legalAidPhotoDir) == false) Directory.CreateDirectory(legalAidPhotoDir); - foreach (var legalphotot in legalphotots) - { - var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + legalphotot.Replace("/", @"\"); - if (System.IO.File.Exists(filepath)) + var legalphotots = item.legalAidPhoto.ConvertToModel>() ?? new List(); + var legalAidPhotoDir = Path.Combine(lawyerdir, "legalAidPhoto"); + if (Directory.Exists(legalAidPhotoDir) == false) Directory.CreateDirectory(legalAidPhotoDir); + + foreach (var legalphotot in legalphotots) { - var targetfile = Path.Combine(legalAidPhotoDir, Path.GetFileName(filepath)); - System.IO.File.Copy(filepath, targetfile); + 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); + } } - } - var relationshipProofPhotos = item.relationshipProofPhoto.ConvertToModel>(); - var relationshipProofPhotoDir = Path.Combine(lawyerdir, "relationshipProofPhoto"); - if (Directory.Exists(relationshipProofPhotoDir) == false) Directory.CreateDirectory(relationshipProofPhotoDir); - foreach (var relationshipProofPhoto in relationshipProofPhotos) - { - var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + relationshipProofPhoto.Replace("/", @"\"); - if (System.IO.File.Exists(filepath)) + + var relationshipProofPhotos = item.relationshipProofPhoto.ConvertToModel>() ?? new List(); + var relationshipProofPhotoDir = Path.Combine(lawyerdir, "relationshipProofPhoto"); + if (Directory.Exists(relationshipProofPhotoDir) == false) Directory.CreateDirectory(relationshipProofPhotoDir); + + foreach (var relationshipProofPhoto in relationshipProofPhotos) { - var targetfile = Path.Combine(legalAidPhotoDir, Path.GetFileName(filepath)); - System.IO.File.Copy(filepath, targetfile); + 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); + } } - } - var otherPhotos = item.otherPhoto.ConvertToModel>(); - var otherPhotoDir = Path.Combine(lawyerdir, "otherPhoto"); - if (Directory.Exists(otherPhotoDir) == false) Directory.CreateDirectory(otherPhotoDir); - foreach (var otherPhoto in otherPhotos) - { - var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + otherPhoto.Replace("/", @"\"); - if (System.IO.File.Exists(filepath)) + var otherPhotos = item.otherPhoto.ConvertToModel>() ?? new List(); + var otherPhotoDir = Path.Combine(lawyerdir, "otherPhoto"); + if (Directory.Exists(otherPhotoDir) == false) Directory.CreateDirectory(otherPhotoDir); + foreach (var otherPhoto in otherPhotos) { - var targetfile = Path.Combine(legalAidPhotoDir, Path.GetFileName(filepath)); - System.IO.File.Copy(filepath, targetfile); + var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + otherPhoto.Replace("/", @"\"); + 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) - { - //["/CaseFile/card/2023-11-21/20231121200659497.jpg"] - var userdir = Path.Combine(packegdir, "users", item.cardId); - - //保存身份证图片 - var cardids = item.cardIdphoto.ConvertToModel>(); - var cardidDir = Path.Combine(userdir, "cardids"); - if (Directory.Exists(cardidDir) == false) Directory.CreateDirectory(cardidDir); - foreach (var file in cardids) + } + //存储用户的相关附件 + foreach (var item in users) { - var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\"); - if (System.IO.File.Exists(filepath)) + //["/CaseFile/card/2023-11-21/20231121200659497.jpg"] + var userdir = Path.Combine(packegdir, "users", item.cardId); + + //保存身份证图片 + var cardids = item.cardIdphoto.ConvertToModel>(); + 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>(); - var identityphotosDir = Path.Combine(userdir, "identityphotos"); - if (Directory.Exists(identityphotosDir) == false) Directory.CreateDirectory(identityphotosDir); - foreach (var file in identityphotos) - { - var filepath = Path.Combine(Environment.CurrentDirectory, "wwwroot") + file.Replace("/", @"\"); - if (System.IO.File.Exists(filepath)) + //保存工作证图片 律师职业证书 + var identityphotos = item.identityphoto.ConvertToModel>(); + var identityphotosDir = Path.Combine(userdir, "identityphotos"); + if (Directory.Exists(identityphotosDir) == false) Directory.CreateDirectory(identityphotosDir); + foreach (var file in identityphotos) { - 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>(); - 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("/", @"\"); - if (System.IO.File.Exists(filepath)) + var departmentPhotos = item.departmentPhoto.ConvertToModel>(); + var departmentPhotosDir = Path.Combine(userdir, "departmentPhotos"); + if (Directory.Exists(departmentPhotosDir) == false) Directory.CreateDirectory(departmentPhotosDir); + foreach (var file in departmentPhotos) { - 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); - Directory.Delete(packegdir, true); + ZipFile.CreateFromDirectory(packegdir, packegzipname); + Directory.Delete(packegdir, true); - result.result = $"/temp/{packegdirname}.zip"; - result.IsSucceed = true; - return result; + result.result = $"/temp/{packegdirname}.zip"; + result.IsSucceed = true; + return result; + } + catch(Exception ex) + { + result.IsSucceed = false; + result.Message = ex.Message; + return result; + } } - [HttpPost] [Route("UploadSignImage")] /// From de8e51c27c2725ff0a2699fa961054b8266bf0f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Thu, 30 Nov 2023 10:22:27 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9git=E8=BF=BD=E8=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- Dto/obj/Debug/net6.0/Dto.assets.cache | Bin 160 -> 0 bytes 2 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 Dto/obj/Debug/net6.0/Dto.assets.cache diff --git a/.gitignore b/.gitignore index 3922885..e36315b 100644 --- a/.gitignore +++ b/.gitignore @@ -81,4 +81,5 @@ dkms.conf /24Hour/Properties/PublishProfiles/FolderProfile1.pubxml.user /24Hour/wwwroot /Dto/obj -/Dto/obj/Debug \ No newline at end of file +/Dto/obj/Debug +/Dto/obj/Debug/net6.0/Dto.assets.cache diff --git a/Dto/obj/Debug/net6.0/Dto.assets.cache b/Dto/obj/Debug/net6.0/Dto.assets.cache deleted file mode 100644 index ad3f5618c14f357eb463acbeb5e987140e3a620f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 160 zcmWIWc6a1qU|IL0w0H#0A@xTGktB)=#|FRwH`wIrq>F*!RiJ+(N7keL9^rXRZi From 591ef7d91ac534ae2931147d3fd3fd79798958bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Thu, 30 Nov 2023 10:22:45 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9git=E8=BF=BD=E8=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e36315b..3b77df2 100644 --- a/.gitignore +++ b/.gitignore @@ -82,4 +82,4 @@ dkms.conf /24Hour/wwwroot /Dto/obj /Dto/obj/Debug -/Dto/obj/Debug/net6.0/Dto.assets.cache +/Dto/obj/Debug/net6.0 \ No newline at end of file From 30f34f880dc6dd1b54f156d4b914e527b66b1b17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Thu, 30 Nov 2023 10:23:52 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9dto=E7=9A=84?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E3=80=82=E6=B7=BB=E5=8A=A0=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 24Hour/24Hour.csproj | 5 ++-- 24Hour/TwentySystemProxyClient.cs | 39 ++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/24Hour/24Hour.csproj b/24Hour/24Hour.csproj index c7460f4..369ecfb 100644 --- a/24Hour/24Hour.csproj +++ b/24Hour/24Hour.csproj @@ -8,8 +8,8 @@ True e485308c-2f05-470b-b0a4-68f1ec2b3412 Linux - 1.0.1.16 - 1.0.1.16 + 1.0.1.17 + 1.0.1.17 @@ -28,6 +28,7 @@ + diff --git a/24Hour/TwentySystemProxyClient.cs b/24Hour/TwentySystemProxyClient.cs index 74a6009..cff895b 100644 --- a/24Hour/TwentySystemProxyClient.cs +++ b/24Hour/TwentySystemProxyClient.cs @@ -1,9 +1,11 @@ using com.sun.xml.@internal.xsom; +using Dto; using Elight.Entity.APPDto.Lawyer; using Elight.Utility; using Elight.Utility.Code; using Elight.Utility.Extensions; using Microsoft.AspNetCore.DataProtection; +using Microsoft.AspNetCore.Mvc; namespace _24Hour { @@ -20,6 +22,19 @@ namespace _24Hour httpCliet.DefaultRequestHeaders.Add("User-Agent", "HttpClientFactory-Sample"); httpCliet.DefaultRequestHeaders.ConnectionClose = true; } + + /// + /// 申请人资格资料 + /// + /// + [HttpPost("UploadImage")] + public async Task UploadImage(UploadDto dto) + { + var request = await httpCliet.PostAsJsonAsync($"/TwentySystem/UploadImage", dto); + var response = await request.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); + return response.ConvertToModel(); + } + public async Task>> GetCaseList(string? casename, string? bmsah, string? dwbm, DateTime? starttime, DateTime? endtime, int page, int size) { Result> Result = new(); @@ -91,7 +106,6 @@ namespace _24Hour } return Result; } - public async Task> GetArchivesInfo(string bmsah, string dwbm) { var result = new Result(); @@ -200,5 +214,28 @@ namespace _24Hour public string? sfkcz { get; set; } public string? qlzt { get; set; } } + class MyClass + { + /// + /// 部门受案号 + /// + public string bmsah { get; set; } + + /// + /// base64字符串 + /// + public string ImageStr { get; set; } + + /// + /// 1423000000100-律师执业证书, + /// 1423000000200-律师事务所证, + /// 1423000000300-授权委托书, + /// 1423000000400-法律援助公函, + /// 1423000000500-身份证件 , + /// 1423000000600-关系证明材料, + /// 1423000000700-其他 + /// + public string Code { get; set; } + } } }