From 8b658a8b6c3a0f822a2fc43d28c9446dde6ffabd Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 28 Oct 2024 18:12:03 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9Excel=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskPlat/Dtos/TaskMessageInfoDto.cs | 10 + .../TaskShippingOrderCompareService.cs | 51 ++ .../DS.WMS.Core/Utils/ExportFileHelper.cs | 560 ++++++++++-------- .../Controllers/SeaExportController.cs | 27 + 4 files changed, 389 insertions(+), 259 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/TaskMessageInfoDto.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/TaskMessageInfoDto.cs index 8dd533df..9191913a 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/TaskMessageInfoDto.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/TaskMessageInfoDto.cs @@ -220,6 +220,16 @@ namespace DS.WMS.Core.TaskPlat.Dtos /// 箱信息列表 /// public List ContaList { get; set; } + + /// + /// 网站的账户(网站需要登录的需要提供) + /// + public string WebUser { get; set; } + + /// + /// 网站的密码(网站需要登录的需要提供) + /// + public string WebPassword { get; set; } } /// diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/ShippingOrderCompare/TaskShippingOrderCompareService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/ShippingOrderCompare/TaskShippingOrderCompareService.cs index cc1ed30b..bdf884a7 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/ShippingOrderCompare/TaskShippingOrderCompareService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/ShippingOrderCompare/TaskShippingOrderCompareService.cs @@ -5,6 +5,7 @@ using DS.Module.Core.Helpers; using DS.Module.DjyServiceStatus; using DS.Module.SqlSugar; using DS.Module.UserModule; +using DS.WMS.Core.Code.Dtos; using DS.WMS.Core.Code.Interface; using DS.WMS.Core.Code.Method; using DS.WMS.Core.Invoice.Dtos; @@ -12,6 +13,8 @@ using DS.WMS.Core.Map.Interface; using DS.WMS.Core.Map.Method; using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.Op.Entity; +using DS.WMS.Core.Sys.Interface; +using DS.WMS.Core.Sys.Method; using DS.WMS.Core.TaskPlat.Dtos; using DS.WMS.Core.TaskPlat.Entity; using DS.WMS.Core.TaskPlat.Interface; @@ -47,6 +50,8 @@ namespace DS.WMS.Core.TaskPlat.Method private readonly IMappingYardService _mappingYardService; private readonly IMappingCarrierService _mappingCarrierService; private readonly ICodePortService _codePortService; + private readonly ICodeThirdPartyService _codeThirdPartyService; + private readonly IConfigService _configService; private readonly string shippingOrderCompareUrl; private readonly string shippingOrderCompareResultUrl; @@ -66,6 +71,8 @@ namespace DS.WMS.Core.TaskPlat.Method _mappingYardService = _serviceProvider.GetRequiredService(); _mappingCarrierService = _serviceProvider.GetRequiredService(); _codePortService = _serviceProvider.GetRequiredService(); + _codeThirdPartyService = _serviceProvider.GetRequiredService(); + _configService = _serviceProvider.GetRequiredService(); shippingOrderCompareUrl = AppSetting.app(new string[] { "ShippingOrderCompare", "Url" }); shippingOrderCompareResultUrl = AppSetting.app(new string[] { "ShippingOrderCompare", "ResultUrl" }); @@ -196,6 +203,50 @@ namespace DS.WMS.Core.TaskPlat.Method mainInfo.ContaList = contaList.Adapt>(); } + CodeThirdPartyRes webAccountConfig = null; + + + bool isYGT = false; + bool isLuHai = false; + + var cfgYGT = _configService.GetConfig("ShipCompareAccountYGT", long.Parse(user.TenantId), false).GetAwaiter().GetResult()?.Data?.Value; + + if (!string.IsNullOrWhiteSpace(cfgYGT)) + { + var currArg = cfgYGT.Split(new char[] { ',' }).ToArray(); + + if (currArg.Contains(mainInfo.YardCode)) + { + isYGT = true; + + webAccountConfig = _codeThirdPartyService.GetCodeThirdPartyInfoWithCompany("yungangtong").GetAwaiter().GetResult()?.Data; + } + } + + //如果不是云港通,就试试陆海通 + if (!isYGT) + { + var cfgLuht = _configService.GetConfig("ShipCompareAccountLUHAI", long.Parse(user.TenantId), false).GetAwaiter().GetResult()?.Data?.Value; + + if (!string.IsNullOrWhiteSpace(cfgLuht)) + { + var currArg = cfgLuht.Split(new char[] { ',' }).ToArray(); + + if (currArg.Contains(mainInfo.YardCode)) + { + isYGT = true; + + webAccountConfig = _codeThirdPartyService.GetCodeThirdPartyInfoWithCompany("LuHaiTong").GetAwaiter().GetResult()?.Data; + } + } + } + + if (webAccountConfig != null) + { + mainInfo.WebUser = webAccountConfig.AppKey; + mainInfo.WebPassword = webAccountConfig.AppSecret; + } + var msgModel = GetMessageInfo(batchNo, mainInfo); Logger.Log(NLog.LogLevel.Info, "批次={no} 对应请求报文完成 msg={msg}", batchNo, JsonConvert.SerializeObject(msgModel)); diff --git a/ds-wms-service/DS.WMS.Core/Utils/ExportFileHelper.cs b/ds-wms-service/DS.WMS.Core/Utils/ExportFileHelper.cs index b3132120..f598c4a0 100644 --- a/ds-wms-service/DS.WMS.Core/Utils/ExportFileHelper.cs +++ b/ds-wms-service/DS.WMS.Core/Utils/ExportFileHelper.cs @@ -1,283 +1,325 @@ -using LanguageExt; +using iText.Kernel.Utils.Objectpathitems; +using iText.Kernel.XMP.Impl.XPath; +using LanguageExt; +using LanguageExt.TypeClasses; using Masuit.Tools.Strings; using Microsoft.AspNetCore.Identity; using NPOI.HPSF; using NPOI.HSSF.UserModel; +using NPOI.SS.Formula.Functions; using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; using System; using System.Collections.Generic; using System.ComponentModel; +using System.Data; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; +using System.Xml; using static iText.StyledXmlParser.Jsoup.Select.Evaluator; namespace DS.WMS.Core.Utils { + public class ExportFileHelper { + /// + /// Excel行高,Height的单位是1/20个点。例:设置高度为25个点 + /// + private static short rowHeight = 25 * 20; + + #region 导出Excel + + #region 导出 + /// + /// 导出 + /// + /// 数据源 + /// 列名 + /// 绝对路径 + /// sheet页名 + public static void Export(List dataList, Dictionary colDicts, string fileName, string sheetName = "Sheet1") + { + // 使用 NPOI 组件导出 Excel 文件 + + //XSSFWorkbook:是操作Excel2007的版本,扩展名是.xlsx + XSSFWorkbook workbook = new XSSFWorkbook(); + + //HSSFWorkbook:是操作Excel2003以前(包括2003)的版本,扩展名是.xls + //HSSFWorkbook workbook = new HSSFWorkbook(); + + //创建Sheet + ISheet sheet = workbook.CreateSheet(sheetName); + + + + //设置单元格样式 + ICellStyle style = SetCellStyle(workbook); + + //创建表格 + NPOICreateTable(dataList, colDicts, sheet, style, 0); + + // 将 Excel 文件保存到磁盘 + NPOISaveFile(workbook, fileName); + + // 释放资源 + //workbook.Dispose(); + } + #endregion + + #region 自定义框架,导出 + /// + /// 自定义顶部,导出 + /// + /// 数据源 + /// 拆分后列名 + /// 绝对路径,路径+文件名+后缀 + /// 新一行索引,开始 + /// + /// + public static void Export(List dataList, Dictionary colDicts, string fileName, int num, XSSFWorkbook workbook, ISheet sheet) + { + //设置单元格样式 + ICellStyle style = SetCellStyle(workbook); + + //创建表格 + NPOICreateTable(dataList, colDicts, sheet, style, num); + + // 将 Excel 文件保存到磁盘 + NPOISaveFile(workbook, fileName); - // /// - // /// 导出 - // /// - // /// - // /// - // /// - // /// - // public async Task Export(List dataLiist, Dictionary colDicts) + // 释放资源 + //workbook.Dispose(); + } + #endregion + + #endregion + + #region 获取用户选择保存路径 + + /// + /// 获取让用户选择保存文件的绝对路径 + /// + /// + //public static string GetSaveFileRoute(string filter, string fileName) + //{ + // SaveFileDialog dialog = new SaveFileDialog(); + // dialog.Filter = filter; + // dialog.FileName = fileName; + // if (dialog.ShowDialog() == true) // { - // string filePath = string.Empty; - - // /* - // 1、生成空Excel文件。 - // 2、根据colDicts提供的key来匹配字段列表的 - // 3、暂存文件,并返回完整文件名 - // */ - // try - // { - // string sheetName = ""; - // XSSFWorkbook workbook = new XSSFWorkbook(); - // ISheet sheet = workbook.CreateSheet(sheetName); - - // #region Excel模板打印 - // //var opt = App.GetOptions(); - // //var dirAbs = opt.basePath; - // //if (string.IsNullOrEmpty(dirAbs)) - // //{ - // // dirAbs = App.WebHostEnvironment.WebRootPath; - // //} - // var fileAbsPath = Path.Combine(dirAbs, printTemplate.FilePath); - // //_logger.LogInformation($"准备调用EXCEL生成:id:{id},文件:{printTemplate.FileName}"); - - - // var result = new FileStream(fileAbsPath, FileMode.Open); - // var excelwork = new HSSFWorkbook(result); - // var sheet = excelwork.GetSheetAt(0); - - - // var entity = await _bookingExcelTemplateRepository.AsQueryable() - // .Where(x => x.PId == templateId).OrderBy(x => x.Row).ToListAsync(); - // if (entity == null) - // { - - // throw Oops.Bah("当前模板未设置"); - - // } - - - // for (int _row = 1; _row <= entity.Max(x => x.Row); _row++) - // { - - // if (entity.Where(x => x.Row == _row).Count() > 0) - // { - // ////获取行 - // var row = sheet.GetRow(_row - 1); - // if (row != null) - // { - // for (int _cellNum = 1; _cellNum <= entity.Max(x => x.Column); _cellNum++) - // { - // if (entity.Where(x => x.Row == _row && x.Column == _cellNum).Count() > 0) - // { - // var name = entity.Where(x => x.Row == _row && x.Column == _cellNum).Select(x => x.Field).FirstOrDefault(); - - // if (name.Split('.')[0].ToLower() == "order") - // { - - // foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order)) - // { - // var _name = descriptor.Name.ToLower(); - // if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == _name) - // { - // var value = descriptor.GetValue(order) != null ? descriptor.GetValue(order).ToString() : ""; - // ICell cell = row.GetCell(_cellNum - 1); - // if (descriptor.PropertyType.FullName.Contains("DateTime")) - // { - // value = value != "" ? Convert.ToDateTime(value).ToString("yyyy-MM-dd") : ""; - // } - // if (cell != null) - // { - // row.Cells[_cellNum - 1].SetCellValue(value); - // } - // else - // { - // row.CreateCell(_cellNum - 1).SetCellValue(value); - // } - // } - // } - // } - - // if (name.Split('.')[0].ToLower() == "edi") - // { - - // foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(edi)) - // { - // var _name = descriptor.Name.ToLower(); - // if (name.Split('.')[0].ToLower() == "edi" && name.Split('.')[1].ToLower() == _name) - // { - // var value = descriptor.GetValue(edi) != null ? descriptor.GetValue(edi).ToString() : ""; - // ICell cell = row.GetCell(_cellNum - 1); - // if (descriptor.PropertyType.FullName.Contains("DateTime")) - // { - // value = value != "" ? Convert.ToDateTime(value).ToString("yyyy-MM-dd") : ""; - // } - // if (cell != null) - // { - // row.Cells[_cellNum - 1].SetCellValue(value); - // } - // else - // { - // row.CreateCell(_cellNum - 1).SetCellValue(value); - // } - // } - // } - - - // } - - // if (name.Split('.')[0].ToLower() == "userinfo") - // { - // ICell cell = row.GetCell(_cellNum - 1); - // var value = string.Empty; - // if (name.Split('.')[1].ToLower() == "username") - // { - // value = UserManager.Name; - // } - // if (name.Split('.')[1].ToLower() == "usertel") - // { - // value = UserManager.TEl; - // } - // if (name.Split('.')[1].ToLower() == "usermobile") - // { - // value = UserManager.Phone; - // } - // if (name.Split('.')[1].ToLower() == "useremail") - // { - // value = UserManager.Email; - // } - // if (name.Split('.')[1].ToLower() == "usertenant") - // { - // value = UserManager.TENANT_NAME; - // } - // if (cell != null) - // { - // row.Cells[_cellNum - 1].SetCellValue(value); - // } - // else - // { - // row.CreateCell(_cellNum - 1).SetCellValue(value); - // } - // } - // } - // } - // } - // else - // { - // ////创建行 - // var srow = NpoiExcelExportHelper._.CreateRow(sheet, _row - 1); - - // for (int _cellNum = 1; _cellNum <= entity.Max(x => x.Column); _cellNum++) - // { - // if (entity.Where(x => x.Row == _row && x.Column == _cellNum).Count() > 0) - // { - // var name = entity.Where(x => x.Row == _row && x.Column == _cellNum).Select(x => x.Field).FirstOrDefault(); - - // if (name.Split('.')[0].ToLower() == "order") - // { - // foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order)) - // { - // var _name = descriptor.Name.ToLower(); - // if (name.Split('.')[1].ToLower() == _name && name.Split('.')[0].ToLower() == "order") - // { - // var value = descriptor.GetValue(order) != null ? descriptor.GetValue(order).ToString() : ""; - // if (descriptor.PropertyType.FullName.Contains("DateTime")) - // { - // value = value != "" ? Convert.ToDateTime(value).ToString("yyyy-MM-dd") : ""; - // } - // srow.CreateCell(_cellNum - 1).SetCellValue(value); - // } - // } - // } - // if (name.Split('.')[0].ToLower() == "edi") - // { - // foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(edi)) - // { - // var _name = descriptor.Name.ToLower(); - // if (name.Split('.')[1].ToLower() == _name && name.Split('.')[0].ToLower() == "edi") - // { - // var value = descriptor.GetValue(edi) != null ? descriptor.GetValue(edi).ToString() : ""; - // if (descriptor.PropertyType.FullName.Contains("DateTime")) - // { - // value = value != "" ? Convert.ToDateTime(value).ToString("yyyy-MM-dd") : ""; - // } - // srow.CreateCell(_cellNum - 1).SetCellValue(value); - // } - // } - // } - - // if (name.Split('.')[0].ToLower() == "userinfo") - // { - - // var value = string.Empty; - // if (name.Split('.')[1].ToLower() == "username") - // { - // value = UserManager.Name; - // } - // if (name.Split('.')[1].ToLower() == "usertel") - // { - // value = UserManager.TEl; - // } - // if (name.Split('.')[1].ToLower() == "usermobile") - // { - // value = UserManager.Phone; - // } - // if (name.Split('.')[1].ToLower() == "useremail") - // { - // value = UserManager.Email; - // } - // if (name.Split('.')[1].ToLower() == "usertenant") - // { - // value = UserManager.TENANT_NAME; - // } - - // srow.CreateCell(_cellNum - 1).SetCellValue(value); - - // } - // } - // } - // } - - // } - // } - // var fileFullPath = Path.Combine(App.WebHostEnvironment.WebRootPath, App.GetOptions().Path);//服务器路径 - // if (!Directory.Exists(fileFullPath)) - // { - // Directory.CreateDirectory(fileFullPath); - // } - - // fileName = $"{DateTime.Now.Ticks}.xls";//名称 - // ////2023-4-3,根据河川操作要求,文件名只带提单号 - // //if (!string.IsNullOrEmpty(order.MBLNO)) - // //{ - // // fileName = $"{order.MBLNO}.xls";//名称 - // //} - // //else - // //{ - // // fileName = $"{order.Id}_{DateTime.Now.Ticks}.xls";//名称 - // //} - // _logger.LogInformation("导出excel:" + Path.Combine(fileFullPath, fileName)); - // var filestream = new FileStream(Path.Combine(fileFullPath, fileName), FileMode.OpenOrCreate, FileAccess.ReadWrite); - // excelwork.Write(filestream); - - // #endregion - // } - // catch (Exception ex) - // { - - // } - - // return filePath; + // return dialog.FileName; // } + // return ""; //} + + #endregion + + #region 保存文件 + + private static string NPOISaveFile(XSSFWorkbook workbook, string fileName) + { + try + { + // 将 Excel 文件保存到磁盘 + using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write)) + { + workbook.Write(fs); + } + + return ""; + } + catch (Exception err) + { + return err.Message; + } + } + + #endregion + + #region 创建表格 + + /// + /// 创建表格 + /// + /// 数据源 + /// 拆分后的列名 + /// Sheet页 + /// 样式 + /// 行索引 + private static void NPOICreateTable(List dataList, Dictionary colDicts, ISheet sheet, ICellStyle style, int num) + { + string[] strArry = colDicts.Select(b => b.Value).ToArray(); + + IRow row = null;//声明行 + + #region 创建列名 + + //在索引 num 的位置 创建一行 + row = sheet.CreateRow(num); + row.Height = rowHeight;//设置行高 + + //循环列名数组,创建单元格并赋值、样式 + for (int i = 0; i < strArry.Length; i++) + { + row.CreateCell(i).SetCellValue(strArry[i]); + row.GetCell(i).CellStyle = style; + } + + #endregion + + #region 创建行 + + //循环数据源 创建行 + for (int i = 0; i < dataList.Count; i++) + { + //创建行 + row = sheet.CreateRow(num + 1); + row.Height = rowHeight;//设置行高 + num++;//行索引自增 + + Dictionary> dataDict = new Dictionary>(); + + foreach (System.Reflection.PropertyInfo p in dataList[i].GetType().GetProperties()) + { + var value = p.GetValue(dataList[i]); + + + dataDict.Add(p.Name,new Tuple(value.ToString(), p.PropertyType.Name)); + } + + //循环数据源列集合,创建单元格 + foreach (var col in colDicts) + { + + //var pList = TypeDescriptor.GetProperties(T) + + string ValueType = "";//值类型 + string Value = "";//值 + //类型 和 值,赋值 + //if (dt.Rows[i][j].ToString() != null) + //{ + // ValueType = dt.Rows[i][j].GetType().ToString(); + // Value = dt.Rows[i][j].ToString(); + //} + var j = 0; + //根据不同数据类型,对数据处理。处理后创建单元格并赋值 和 样式 + switch (ValueType) + { + case "System.String"://字符串类型 + row.CreateCell(j).SetCellValue(Value); + break; + case "System.DateTime"://日期类型 + System.DateTime dateV; + System.DateTime.TryParse(Value, out dateV); + row.CreateCell(j).SetCellValue(dateV.ToString("yyyy-MM-dd")); + break; + case "System.Boolean"://布尔型 + bool boolV = false; + bool.TryParse(Value, out boolV); + row.CreateCell(j).SetCellValue(boolV); + break; + case "System.Int16"://整型 + case "System.Int32": + case "System.Int64": + case "System.Byte": + int intV = 0; + int.TryParse(Value, out intV); + row.CreateCell(j).SetCellValue(intV); + break; + case "System.Decimal"://浮点型 + case "System.Double": + double doubV = 0; + double.TryParse(Value, out doubV); + row.CreateCell(j).SetCellValue(doubV); + break; + case "System.DBNull"://空值处理 + row.CreateCell(j).SetCellValue(""); + break; + default: + row.CreateCell(j).SetCellValue(""); + break; + } + row.GetCell(j).CellStyle = style; + //设置宽度 + //sheet.SetColumnWidth(j, (Value.Length + 10) * 256); + } + } + + #endregion + + //循环列名数组,多所有列 设置 自动列宽 + for (int i = 0; i < strArry.Length; i++) + { + sheet.AutoSizeColumn(i); + } + } + + #endregion + + public string GetPropertyValue(T t, string field) + { + string value = "9"; + if (t == null) + { + return value; + } + PropertyInfo[] properties = t.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public); + + if (properties.Length <= 0) + { + return value; + } + var property = properties.Where(x => x.Name == field).FirstOrDefault(); + value = property.GetValue(t, null).ToString(); + + return value; + } + + + #region 设置单元格样式 + + public static ICellStyle SetCellStyle(XSSFWorkbook workbook) + { + #region 单元格样式 + + //创建一个样式 + ICellStyle style = workbook.CreateCellStyle(); + style.Alignment = HorizontalAlignment.Center;//水平对齐 + style.VerticalAlignment = VerticalAlignment.Center;//垂直对齐 + + style.BorderBottom = BorderStyle.Thin;//下边框为细线边框 + style.BorderLeft = BorderStyle.Thin;//左边框 + style.BorderRight = BorderStyle.Thin;//上边框 + style.BorderTop = BorderStyle.Thin;//右边框 + + #endregion + + return style; + } + #endregion } + + /// + /// 导出excel-中英文规则类 + /// + public class ExportRegular + { + /// + /// 属性名称(英文) + /// + public string PropertyName { get; set; } + /// + /// 数据类型 + /// + public string DataType { get; set; } + + /// + /// 导出名称(中文) + /// + public string ExportFieldName { get; set; } + } + } diff --git a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs index e4bfddce..8055831e 100644 --- a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs @@ -12,6 +12,7 @@ using DS.WMS.Core.Op.EDI; using DS.WMS.Core.Op.Interface; using DS.WMS.Core.Sys.Dtos; using DS.WMS.Core.Sys.Interface; +using DS.WMS.Core.Utils; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using NPOI.XWPF.UserModel; @@ -566,4 +567,30 @@ public class SeaExportController : ApiController return res; } + + /// + /// 导出 + /// + /// 业务Id + /// + [HttpGet] + [Route("ExportOrder")] + public async Task> ExportOrder([FromQuery] long id) + { + List list = new List { + new SeaExportRes{ + Id = 1, + MBLNO = "TEST", + } + }; + + Dictionary colDicts = new Dictionary { + { "Id","主键"}, { "MBLNO","提单号"} + }; + + ExportFileHelper.Export(list, colDicts, "text"); + + return DataResult.Success(""); + + } } \ No newline at end of file From 3ff5398ac23482561465edf7274c92b301295aa8 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 28 Oct 2024 18:30:52 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=A3=E8=B4=B9?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Op/Method/DJYChargeFee/DJYChargeFeeService.cs | 6 ++++-- .../Op/Method/SeaExportBookingOrClosingEDIService.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/DJYChargeFee/DJYChargeFeeService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/DJYChargeFee/DJYChargeFeeService.cs index 78eb3b18..9d9f55ee 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/DJYChargeFee/DJYChargeFeeService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/DJYChargeFee/DJYChargeFeeService.cs @@ -103,8 +103,6 @@ namespace DS.WMS.Core.Op.Method var orderInfo = orderList.FirstOrDefault(a => a.Id == id); - - var userInfo = db.Queryable().Filter(null, true).First(x => x.Id == orderInfo.OperatorId && x.TenantId == long.Parse(user.TenantId)); string djyUserId = userInfo?.DjyUserId; @@ -122,6 +120,8 @@ namespace DS.WMS.Core.Op.Method { detail.Status = "FAILURE"; detail.Message = $"当前操作OP={userInfo?.UserName}没有绑定大简云用户ID,请联系管理员"; + + Logger.Log(NLog.LogLevel.Info, $"当前操作OP={userInfo?.UserName}没有绑定大简云用户ID,请联系管理员"); continue; } @@ -132,6 +132,8 @@ namespace DS.WMS.Core.Op.Method { detail.Status = "FAILURE"; detail.Message = $"未配置大简云扣费授权,请在接口账户维护"; + + Logger.Log(NLog.LogLevel.Info, $"未配置大简云扣费授权,请在接口账户维护"); continue; } diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportBookingOrClosingEDIService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportBookingOrClosingEDIService.cs index 3c99878a..466d2e35 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportBookingOrClosingEDIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportBookingOrClosingEDIService.cs @@ -1868,7 +1868,7 @@ namespace DS.WMS.Core.Op.Method } }); - _logger.Info($"批次={batchNo} 扣费完成,结果{JsonConvert.SerializeObject(feeRlt)}"); + _logger.Info($"批次={batchNo} mblno={ }扣费完成,结果{JsonConvert.SerializeObject(feeRlt)}"); } } From 76d7dc599b77fa1175b2452df76caf5fc8dedb9f Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 28 Oct 2024 18:37:50 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=E4=BD=8D?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../舱位信息导出模板.xlsx | Bin 9966 -> 9943 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ds-wms-service/DS.WMS.OpApi/wwwroot/ExportTemplate/舱位信息导出模板.xlsx b/ds-wms-service/DS.WMS.OpApi/wwwroot/ExportTemplate/舱位信息导出模板.xlsx index 15fb70b04269460725eff928e69d6f9d25093b02..6ebf9283c8a7bc13632e45f70497812b5530f7cd 100644 GIT binary patch delta 4912 zcmY+IbyO43|Nciw!+;@dC|%N}G>RaSN=u7`(l8_kY#<0I0*)b_k`ki?N0*eu=#&QO zh7HLt{yyjTIp6R7<8_|%oaa9G{(0|vS7$<}Jc)o<5_<=LN+S?P$bqwW9@)R3Ar}1T z%ON}SP6ra#=jQG{?(O~64}A6TWz$=I5nP>)Qmg-1GR4rREaFe=xe}=qjZ(c{G4yO0 zWWx@X;W~g-cyp^*--K6=^f|g};T>V7YTSYLB!#O=IhCzwO;#<|rv0bKtZcuELLGID zMc_X5LfU8Z5)O|Z1X0&hYbQQV2vT2Lz5eYE;4`5LB}98a=`{%9OC+;%-5|!zq*L0~ z+L^32t5pLk@Nn8|O!*iz|0YP>K^5_F-Z&Q9UieL-%aZ)j3G|^b{uSekT4VM-nrh>G z%D^?v3wgmj=Itbp7NTzMrmkl`Yb(_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I7&q^&;dw~JFtrt+riwnv*e_zvuI@?9ig5G8kocS9 zx7jdPnF2Y#-kSNoqk zE`~|m2P}Ws1>8Nq1L7&kec$IlNMx|0@rE;X#pE?ZKN48|0^+Zn{YE~!5=;Po6?ip~1R1Xkc>e^yq^y6L#2tV=E;45c(0Ul|ur9ngxdB;QQ}y!U~|lcp!zn1aLC^ zZ{w+jhDMC`-$F-YdD Date: Mon, 28 Oct 2024 18:42:05 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=A3=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SeaExportBookingOrClosingEDIService.cs | 2 +- .../Controllers/SeaExportController.cs | 25 ------------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportBookingOrClosingEDIService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportBookingOrClosingEDIService.cs index 466d2e35..812d39ee 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportBookingOrClosingEDIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportBookingOrClosingEDIService.cs @@ -1868,7 +1868,7 @@ namespace DS.WMS.Core.Op.Method } }); - _logger.Info($"批次={batchNo} mblno={ }扣费完成,结果{JsonConvert.SerializeObject(feeRlt)}"); + _logger.Info($"批次={batchNo} mblno={ order.MBLNO }扣费完成,结果{JsonConvert.SerializeObject(feeRlt)}"); } } diff --git a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs index 8055831e..9256ce60 100644 --- a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs @@ -568,29 +568,4 @@ public class SeaExportController : ApiController return res; } - /// - /// 导出 - /// - /// 业务Id - /// - [HttpGet] - [Route("ExportOrder")] - public async Task> ExportOrder([FromQuery] long id) - { - List list = new List { - new SeaExportRes{ - Id = 1, - MBLNO = "TEST", - } - }; - - Dictionary colDicts = new Dictionary { - { "Id","主键"}, { "MBLNO","提单号"} - }; - - ExportFileHelper.Export(list, colDicts, "text"); - - return DataResult.Success(""); - - } } \ No newline at end of file