From 8c2221374b1f4039eac34e11a80e8c6da2642f04 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Wed, 11 Jan 2023 15:37:47 +0800 Subject: [PATCH] =?UTF-8?q?API=E6=8E=88=E6=9D=83=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 28 ++++++++----------- Myshipping.Core/Myshipping.Core.xml | 8 ++++++ .../Service/DjyApiAuth/DjyApiAuthService.cs | 16 ++++++++++- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index b4de3130..f35f5004 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -1877,24 +1877,18 @@ namespace Myshipping.Application return HttpUtility.UrlEncode(fileName, Encoding.GetEncoding("UTF-8")); } - ///// - ///// 下载打印文件(PDF直接预览) - ///// - ///// 查看ID - ///// - //[HttpGet("/BookingOrder/ViewPrintPdf/{vid}"), AllowAnonymous] - //public void ViewPrintPdf(string vid) + //[HttpGet("/BookingOrder/TestExcel"), AllowAnonymous] + //public async Task TestExcel() //{ - // if (_cache.Exists(vid)) - // { - // var fileFullName = _cache.Get(vid); - // var readMem = new ReadOnlyMemory(File.ReadAllBytes(fileFullName)); - // _httpContextAccessor.HttpContext.Response.BodyWriter.WriteAsync(readMem); - // } - // else - // { - // throw Oops.Bah("下载链接失效,请重新打印"); - // } + // var excelwork = new HSSFWorkbook(new FileStream(@"E:\whm\proj_git\BookingHeChuan\Myshipping.Web.Entry\bin\Debug\net6.0\wwwroot\Upload\PrintTemplate\373472276209733.xls", FileMode.Open)); + // var sheet = excelwork.GetSheetAt(0); + + // sheet.GetRow(0).GetCell(0).SetCellValue(Guid.NewGuid().ToString()); + // sheet.GetRow(0).GetCell(1).SetCellValue(DateTime.Now.Ticks); + + // var filestream = new FileStream(Path.Combine(@"E:\whm\proj_git\BookingHeChuan\Myshipping.Web.Entry\bin\Debug\net6.0\wwwroot\Upload\PrintTemplate", "result.xls"), FileMode.Create); + // excelwork.Write(filestream); + // filestream.Close(); //} /// diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 52457906..bbda1aba 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -9323,6 +9323,14 @@ + + + 启用禁用 + + + 可用:false,禁用:true + + 生成新秘钥 diff --git a/Myshipping.Core/Service/DjyApiAuth/DjyApiAuthService.cs b/Myshipping.Core/Service/DjyApiAuth/DjyApiAuthService.cs index 88a3a9bd..787447c9 100644 --- a/Myshipping.Core/Service/DjyApiAuth/DjyApiAuthService.cs +++ b/Myshipping.Core/Service/DjyApiAuth/DjyApiAuthService.cs @@ -99,7 +99,7 @@ namespace Myshipping.Core.Service /// /// /// - [HttpPost("/DjyApiAuth/secretReset")] + [HttpPost("/DjyApiAuth/SecretReset")] public async Task SecretReset(long id) { var entity = _rep.AsQueryable().Filter(null, true).First(x => x.Id == id); @@ -108,6 +108,20 @@ namespace Myshipping.Core.Service return entity.ApiSecret; } + /// + /// 启用禁用 + /// + /// + /// 可用:false,禁用:true + /// + [HttpPost("/DjyApiAuth/SetDisable")] + public async Task SetDisable(long id, bool disable) + { + var entity = _rep.AsQueryable().Filter(null, true).First(x => x.Id == id); + entity.IsDisable = disable; + await _rep.UpdateAsync(entity); + } + /// /// 生成新秘钥 ///