From 1c829a218ba8e4c2799838f0b34fcf61bca72676 Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Fri, 29 Nov 2024 11:34:19 +0800 Subject: [PATCH] null --- QZWebApi/Controllers/HomeController.cs | 23 ++++++++++++++++------- QZWebApi/Models/SqlSugarHelper.cs | 17 +++++++++++++++-- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/QZWebApi/Controllers/HomeController.cs b/QZWebApi/Controllers/HomeController.cs index 6b5d119..10a4b66 100644 --- a/QZWebApi/Controllers/HomeController.cs +++ b/QZWebApi/Controllers/HomeController.cs @@ -1,18 +1,27 @@ -using System; +using QZWebApi.Bus; +using System; using System.Collections.Generic; using System.Linq; using System.Web; -using System.Web.Mvc; +using System.Web.Http; + namespace QZWebApi.Controllers { - public class HomeController : Controller + public class HomeController : ApiController { - public ActionResult Index() + [HttpPost] + public string GetDecryptTjxx(GetDecryptTjxxInputDto input) { - ViewBag.Title = "Home Page"; - - return View(); + string resultMsg = TjSignUtil.Decrypt(input.DecryptValue, input.AesKey); + return resultMsg; } } + + public class GetDecryptTjxxInputDto + { + public string DecryptValue { get; set; } + + public string AesKey { get; set; } + } } diff --git a/QZWebApi/Models/SqlSugarHelper.cs b/QZWebApi/Models/SqlSugarHelper.cs index d893322..4b24676 100644 --- a/QZWebApi/Models/SqlSugarHelper.cs +++ b/QZWebApi/Models/SqlSugarHelper.cs @@ -167,6 +167,7 @@ namespace QZWebApi.Models tjjlPackages.fee = Convert.ToDouble(Convert.ToDecimal(dt2.Rows[0]["charge_price"].ToString()) * 100); } + var dt3 = WebDb.Ado.GetDataTable($"select summary from register_check_summary where register_check_id='{row["register_check_id"].ToString()}' "); if (dt3.Rows.Count > 0) { @@ -185,6 +186,10 @@ namespace QZWebApi.Models } tjjlPackages.summary = summary; } + else + { + tjjlPackages.summary = ""; + } //明细结果 @@ -227,8 +232,16 @@ namespace QZWebApi.Models tjjlPackages.items = jkTjxxBeanList; } + else + { + tjjlPackages.items = new List(); + } + + if (tjjlPackages.items != null && tjjlPackages.items.Any() && string.IsNullOrWhiteSpace(tjjlPackages.summary)) + { + tjjlPackagesList.Add(tjjlPackages); + } - tjjlPackagesList.Add(tjjlPackages); } } @@ -257,7 +270,7 @@ namespace QZWebApi.Models pdfUrl = pdfUrl.Replace(@"\", "/"); WebClient webClient = new WebClient(); - byte[] byteArray =webClient.DownloadData(pdfUrl); + byte[] byteArray = webClient.DownloadData(pdfUrl); result = Convert.ToBase64String(byteArray); }