From b4b153d4386dd8f2846d994164e86a02ca8c065e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Thu, 21 Dec 2023 19:17:57 +0800 Subject: [PATCH] =?UTF-8?q?dto=E8=AE=BE=E7=BD=AE=E5=8F=AF=E7=A9=BA?= =?UTF-8?q?=EF=BC=8C=E5=A4=84=E7=90=862.0=E6=97=A0=E6=B3=95=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dto/ApplyMarKingDto.cs | 30 +-- Dto/UploadDto.cs | 1 + Dto/obj/Debug/net6.0/Dto.AssemblyInfo.cs | 7 +- .../net6.0/Dto.csproj.CoreCompileInputs.cache | 2 +- .../Controllers/TwentySystemController.cs | 200 ++++++++++-------- 5 files changed, 131 insertions(+), 109 deletions(-) diff --git a/Dto/ApplyMarKingDto.cs b/Dto/ApplyMarKingDto.cs index 20e5ad4..ea2fc70 100644 --- a/Dto/ApplyMarKingDto.cs +++ b/Dto/ApplyMarKingDto.cs @@ -11,54 +11,54 @@ namespace Dto /// /// 必要 /// - public string bhdlbh { get; set; } + public string? bhdlbh { get; set; } /// /// 部门受案号 /// - public string bmsah { get; set; } - public string clqkbm { get; set; } - public string clqkmc { get; set; } + public string? bmsah { get; set; } + public string? clqkbm { get; set; } + public string? clqkmc { get; set; } /// /// 承办人 /// - public string czr { get; set; } + public string? czr { get; set; } /// /// 承办人编码 /// - public string czrybm { get; set; } + public string? czrybm { get; set; } /// /// 单位编号 /// - public string dwbm { get; set; } - public string jwgksxid { get; set; } + public string? dwbm { get; set; } + public string? jwgksxid { get; set; } /// /// 申请人类型代码 /// - public string sqrlxdm { get; set; } + public string? sqrlxdm { get; set; } /// /// 申请人名称 /// - public string sqrmc { get; set; } + public string? sqrmc { get; set; } /// /// 申请日期 /// - public string sqrq { get; set; } + public string? sqrq { get; set; } /// /// 申请人身份代码 /// - public string sqrsfdm { get; set; } + public string? sqrsfdm { get; set; } /// /// 事项类型代码 /// - public string sxlxdm { get; set; } + public string? sxlxdm { get; set; } /// /// 事项类型名称 /// - public string sxlxmc { get; set; } + public string? sxlxmc { get; set; } /// /// 当事人 /// - public string zrrmc { get; set; } + public string? zrrmc { get; set; } } diff --git a/Dto/UploadDto.cs b/Dto/UploadDto.cs index 70b660b..822bf21 100644 --- a/Dto/UploadDto.cs +++ b/Dto/UploadDto.cs @@ -11,6 +11,7 @@ /// base64字符串 /// public string ImageStr { get; set; } + public string Bhdlbm { get; set; } /// /// 1423000000100-律师执业证书,1423000000200-律师事务所证, 1423000000300- 授权委托书, 1423000000400- 法律援助公函,1423000000500-身份证件 ,1423000000600-关系证明材料, 1423000000700- 其他 diff --git a/Dto/obj/Debug/net6.0/Dto.AssemblyInfo.cs b/Dto/obj/Debug/net6.0/Dto.AssemblyInfo.cs index 66a2324..571a848 100644 --- a/Dto/obj/Debug/net6.0/Dto.AssemblyInfo.cs +++ b/Dto/obj/Debug/net6.0/Dto.AssemblyInfo.cs @@ -1,9 +1,10 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 // //------------------------------------------------------------------------------ diff --git a/Dto/obj/Debug/net6.0/Dto.csproj.CoreCompileInputs.cache b/Dto/obj/Debug/net6.0/Dto.csproj.CoreCompileInputs.cache index f324ba8..1585df8 100644 --- a/Dto/obj/Debug/net6.0/Dto.csproj.CoreCompileInputs.cache +++ b/Dto/obj/Debug/net6.0/Dto.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -cc7e514c4ce4ef06a7f82aece20a70c7d8114bfe +6045bad44ea6ca22bfa9bf856af27786e542aa85 diff --git a/WebApplication1/Controllers/TwentySystemController.cs b/WebApplication1/Controllers/TwentySystemController.cs index 7efdbde..cdfcd16 100644 --- a/WebApplication1/Controllers/TwentySystemController.cs +++ b/WebApplication1/Controllers/TwentySystemController.cs @@ -387,101 +387,102 @@ namespace WebApplication1.Controllers result.Message = "ݲ"; return result; } - if (resultGzbl.data != null && resultGzbl.data.coumment != null && resultGzbl.data.coumment.Count > 0) + if (resultGzbl.data != null && resultGzbl.data.coumment != null) { - foreach (var item in resultGzbl.data.coumment) + //ļ + string fileName = dto.FileName.Split('.')[0]; + //׺ + string suffix = dto.FileName.Split('.')[1]; + string id = Guid.NewGuid().ToString().Replace("-", null); + //Ҫ + //item.bhdlbh + string dir = "yxsj/" + dto.UnitCode + "/bhdl-service/cl/" + dto.Bmsah + "/" + dto.Bhdlbm; + /// + // var base64Iamge = HttpUtility.UrlDecode(dto.ImageStr); + byte[] DocBytes = Convert.FromBase64String(dto.ImageStr); + var memoryStream = new MemoryStream(DocBytes); + System.IO.File.WriteAllBytes(id + "." + suffix, DocBytes); + var content = new MultipartFormDataContent(); + var fileContent = new StreamContent(memoryStream); + content.Add(fileContent, "file", id + "." + suffix); + + + + content.Add(new StringContent(dir), "dir"); + content.Add(new StringContent(id + "." + suffix), "name"); + content.Add(new StringContent("true"), "overrideOnExists"); + + + var responses = await httpClient.PostAsync("/wjfw-service/raw/file/save", content); + var sresponse = await responses.Content.ReadAsStringAsync(); + if (!string.IsNullOrEmpty(sresponse)) { - //ļ - string fileName = dto.FileName.Split('.')[0]; - //׺ - string suffix = dto.FileName.Split('.')[1]; - string id = Guid.NewGuid().ToString().Replace("-", null); - //Ҫ - //item.bhdlbh - string dir = "yxsj/" + dto.UnitCode + "/bhdl-service/cl/" + dto.Bmsah + "/" + item.bhdlbh; - /// - // var base64Iamge = HttpUtility.UrlDecode(dto.ImageStr); - byte[] DocBytes = Convert.FromBase64String(dto.ImageStr); - var memoryStream = new MemoryStream(DocBytes); - System.IO.File.WriteAllBytes(id + "." + suffix, DocBytes); - var content = new MultipartFormDataContent(); - var fileContent = new StreamContent(memoryStream); - content.Add(fileContent, "file", id + "." + suffix); - - - - content.Add(new StringContent(dir), "dir"); - content.Add(new StringContent(id + "." + suffix), "name"); - content.Add(new StringContent("true"), "overrideOnExists"); - - - var responses = await httpClient.PostAsync("/wjfw-service/raw/file/save", content); - var sresponse = await responses.Content.ReadAsStringAsync(); - if (!string.IsNullOrEmpty(sresponse)) + var fileResultDto = JsonConvert.DeserializeObject(sresponse); + if (fileResultDto.success == true && fileResultDto.code == "0") { - var fileResultDto = JsonConvert.DeserializeObject(sresponse); - if (fileResultDto.success == true && fileResultDto.code == "0") + SaveBhdlclxxDto saveBhdlclxxDto = new SaveBhdlclxxDto() { - SaveBhdlclxxDto saveBhdlclxxDto = new SaveBhdlclxxDto() - { - bhdlbh = item.bhdlbh, - bmsah = dto.Bmsah, - dwbm = dto.UnitCode, - dwmc = dto.UnitName, - sxbh = "", - }; - if (dto.Code == "1423000000100") - { - saveBhdlclxxDto.cllxdm = "1423000000100"; - saveBhdlclxxDto.cllxmc = "ʦִҵ֤"; - } - else if (dto.Code == "1423000000200") - { - saveBhdlclxxDto.cllxdm = "1423000000200"; - saveBhdlclxxDto.cllxmc = "ʦ֤"; - } - else if (dto.Code == "1423000000300") - { - saveBhdlclxxDto.cllxdm = "1423000000300"; - saveBhdlclxxDto.cllxmc = "Ȩί"; - } - else if (dto.Code == "1423000000400") - { - saveBhdlclxxDto.cllxdm = "1423000000400"; - saveBhdlclxxDto.cllxmc = "Ԯ"; - } - else if (dto.Code == "1423000000500") - { - saveBhdlclxxDto.cllxdm = "1423000000500"; - saveBhdlclxxDto.cllxmc = "֤"; - } - else if (dto.Code == "1423000000600") - { - saveBhdlclxxDto.cllxdm = "1423000000600"; - saveBhdlclxxDto.cllxmc = "ϵ֤"; - } - else if (dto.Code == "1423000000700") - { - saveBhdlclxxDto.cllxdm = "1423000000700"; - saveBhdlclxxDto.cllxmc = ""; - } - List bhdlClxxInputDTOLists = new List(); - bhdlClxxInputDTOLists.Add(new BhdlClxxInputDTOList() - { - clbh = id, - fwqwjmc = id + "." + suffix,// dto.FileName, - md5 = fileResultDto.data.storageResult.md5, - wjkzm = suffix, - wjlj = dir, - wjmc = fileName, - wjzjs = fileResultDto.data.size - }); - saveBhdlclxxDto.bhdlClxxInputDTOList = bhdlClxxInputDTOLists; - - var httpResponse = await httpClient.PostAsJsonAsync("/bhdl-service/api/bhdlCl/saveBhdlclxx", saveBhdlclxxDto); + bhdlbh = dto.Bhdlbm, + bmsah = dto.Bmsah, + dwbm = dto.UnitCode, + dwmc = dto.UnitName, + sxbh = "", + }; + if (dto.Code == "1423000000100") + { + saveBhdlclxxDto.cllxdm = "1423000000100"; + saveBhdlclxxDto.cllxmc = "ʦִҵ֤"; + } + else if (dto.Code == "1423000000200") + { + saveBhdlclxxDto.cllxdm = "1423000000200"; + saveBhdlclxxDto.cllxmc = "ʦ֤"; + } + else if (dto.Code == "1423000000300") + { + saveBhdlclxxDto.cllxdm = "1423000000300"; + saveBhdlclxxDto.cllxmc = "Ȩί"; + } + else if (dto.Code == "1423000000400") + { + saveBhdlclxxDto.cllxdm = "1423000000400"; + saveBhdlclxxDto.cllxmc = "Ԯ"; + } + else if (dto.Code == "1423000000500") + { + saveBhdlclxxDto.cllxdm = "1423000000500"; + saveBhdlclxxDto.cllxmc = "֤"; + } + else if (dto.Code == "1423000000600") + { + saveBhdlclxxDto.cllxdm = "1423000000600"; + saveBhdlclxxDto.cllxmc = "ϵ֤"; + } + else if (dto.Code == "1423000000700") + { + saveBhdlclxxDto.cllxdm = "1423000000700"; + saveBhdlclxxDto.cllxmc = ""; + } + List bhdlClxxInputDTOLists = new List(); + bhdlClxxInputDTOLists.Add(new BhdlClxxInputDTOList() + { + clbh = id, + fwqwjmc = id + "." + suffix,// dto.FileName, + md5 = fileResultDto.data.storageResult.md5, + wjkzm = suffix, + wjlj = dir, + wjmc = fileName, + wjzjs = fileResultDto.data.size + }); + saveBhdlclxxDto.bhdlClxxInputDTOList = bhdlClxxInputDTOLists; + + var httpResponse = await httpClient.PostAsJsonAsync("/bhdl-service/api/bhdlCl/saveBhdlclxx", saveBhdlclxxDto); + + try + { var resultDataDto = await httpResponse.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); - var dataDto = JsonConvert.DeserializeObject>(resultDataDto); + var dataDto = JsonConvert.DeserializeObject>>(resultDataDto); if (dataDto.success == true && dataDto.code == "0") { result.IsSucceed = true; @@ -493,8 +494,18 @@ namespace WebApplication1.Controllers result.Message = dataDto.message; } + } + catch (Exception ex) + { + result.IsSucceed = false; + result.Message = ex.Message; } + var filenam = id + "." + suffix; + if (System.IO.File.Exists(filenam)) + { + System.IO.File.Delete(filenam); + } } } } @@ -503,6 +514,7 @@ namespace WebApplication1.Controllers result.IsSucceed = false; result.Message = resultGzbl.message; } + return result; } @@ -819,10 +831,15 @@ namespace WebApplication1.Controllers var resultStringDto = JsonConvert.DeserializeObject(addRuslt); if (resultStringDto.success == false || resultStringDto.code != "0") { + result.IsSucceed = false; result.Message = resultStringDto.message; return result; } + if (string.IsNullOrEmpty(saveBhdlDjxxDto.bhdlbh)) + { + saveBhdlDjxxDto.bhdlbh = resultStringDto.data; + } result.IsSucceed = true; result.result = saveBhdlDjxxDto; return result; @@ -942,8 +959,11 @@ namespace WebApplication1.Controllers result.Message = "ݲ"; return result; } + if (resultGzbl.data.coumment.Count>0) + { + dto.bhdlbh = resultGzbl.data.coumment.FirstOrDefault()?.bhdlbh; + } - dto.bhdlbh = resultGzbl.data.coumment.FirstOrDefault()?.bhdlbh; dto.clqkbm = ""; dto.clqkmc = ""; dto.jwgksxid = "";