From 829eabf256e29392ca63f6da48829dba3b075dfe Mon Sep 17 00:00:00 2001 From: huanghongfeng <huanghongfeng@hnkhzn.com> Date: 星期五, 24 一月 2025 08:59:53 +0800 Subject: [PATCH] 资料,优化程序 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockInfoDetailService.cs | 37 ++++++++----------------------------- 1 files changed, 8 insertions(+), 29 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockInfoDetailService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockInfoDetailService.cs" index 7a7b802..1ad484f 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockInfoDetailService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockInfoDetailService.cs" @@ -1,4 +1,5 @@ -锘縰sing Magicodes.ExporterAndImporter.Core; +锘縰sing AutoMapper; +using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; using SqlSugar; using System; @@ -7,16 +8,21 @@ using System.Text; using System.Threading.Tasks; using WIDESEA_Core; +using WIDESEA_Core.BaseRepository; using WIDESEA_Core.BaseServices; using WIDESEA_Core.Helper; +using WIDESEA_IRecordService; using WIDESEA_IStockRepository; using WIDESEA_IStockService; +using WIDESEA_ITaskInfoRepository; using WIDESEA_Model.Models; namespace WIDESEA_StockService { public partial class StockInfoDetailService : ServiceBase<Dt_StockInfoDetail, IStockInfoDetailRepository>, IStockInfoDetailService { + + public bool ExistSerialNumber(string SerialNumber) { return BaseDal.QueryFirst(x => x.SerialNumber == SerialNumber) != null; @@ -27,33 +33,6 @@ return BaseDal.QueryFirst(x => SerialNumbers.Contains(x.SerialNumber)) != null; } - //瀵煎嚭 - public override WebResponseContent Export(PageDataOptions options) - { - WebResponseContent content = new WebResponseContent(); - try - { - string savePath = AppDomain.CurrentDomain.BaseDirectory + $"ExcelExport"; - IExporter exporter = new ExcelExporter(); - //娣诲姞鏉′欢 - string wheres = options.ValidatePageOptions(TProperties); - //鑾峰彇鎺掑簭瀛楁 - Dictionary<string, OrderByType> orderbyDic = options.GetPageDataSort(TProperties); - List<Dt_StockInfoDetail> entities = BaseDal.QueryData(wheres, orderbyDic); - - byte[] data = exporter.ExportAsByteArray(entities).Result; - - string fileName = "1.xlsx"; - - FileHelper.WriteFile(savePath, fileName, data); - - content = WebResponseContent.Instance.OK(data: savePath + "\\" + fileName); - } - catch (Exception ex) - { - content = WebResponseContent.Instance.Error(ex.Message); - } - return content; - } + } } -- Gitblit v1.9.3