diff --git a/ds-wms-service/DS.WMS.Core/Op/Entity/BookingSlot/BookingSlotBase.cs b/ds-wms-service/DS.WMS.Core/Op/Entity/BookingSlot/BookingSlotBase.cs index eb3baa9b..550be2a9 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Entity/BookingSlot/BookingSlotBase.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Entity/BookingSlot/BookingSlotBase.cs @@ -429,5 +429,8 @@ namespace DS.WMS.Core.Op.Entity /// [SqlSugar.SugarColumn(ColumnDescription = "提单类型(MBL-Master单,HBL-House单)", Length = 20, IsNullable = true)] public string BLIssueType { get; set; } + + + } } diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs index b8fc1aa6..589c57f6 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs @@ -1014,7 +1014,7 @@ namespace DS.WMS.Core.Op.Method BookingSlotBase model = null; //接口方法直接调用save、delete等方法会报错,可能因为非token授权登录导致,故重写一遍保存、删除代码 - if (dto.OpType == "add" || dto.OpType == "update" || dto.OpType == "del" || dto.OpType == "cancellation" || dto.OpType == "back") + if (dto.OpType == "add" || dto.OpType == "update" || dto.OpType == "del" || dto.OpType == "cancellation" || dto.OpType == "back" || dto.OpType == "backcreate") { //翻译船公司 if (!string.IsNullOrWhiteSpace(dto.DataObj.CarrierCode) && string.IsNullOrWhiteSpace(dto.DataObj.CarrierCode)) @@ -1504,6 +1504,20 @@ namespace DS.WMS.Core.Op.Method //await InsLog("Cancellation", model.Id, "取消舱位"); } else if (dto.OpType == "back") + { + /* + back-返还舱位 + 1、(如果有对应舱位)删除舱位与订单的关系 + */ + var slotNO = dto.DataObj.SlotBookingNo; + model = await tenantDb.Queryable().FirstAsync(x => x.SlotBookingNo == slotNO); + + if(model != null) + { + + } + } + else if (dto.OpType == "backcreate") { /* back-返还舱位 @@ -3511,7 +3525,7 @@ namespace DS.WMS.Core.Op.Method //var sql = select.OrderByDescending(u => u.CreatedTime).ToSqlString(); - var entities = await select.OrderByDescending(u => u.Id).ToListAsync(); + var entities = await select.OrderByDescending(a => a.Id).ToListAsync(); var data = entities.Adapt>(); @@ -3647,20 +3661,24 @@ namespace DS.WMS.Core.Op.Method } - string fileRoot = AppSetting.app(new string[] { "FileSettings", "BasePath" }); - string relativePath = AppSetting.app(new string[] { "FileSettings", "RelativePath" }); + var basePath = AppSetting.app(new string[] { "ExportFileSettings", "BasePath" }); + var relativePath = AppSetting.app(new string[] { "ExportFileSettings", "RelativePath" }); + var dirAbs = string.Empty; + var fileRelaPath = string.Empty; + var fileAbsPath = string.Empty; + if (string.IsNullOrEmpty(basePath)) + { + dirAbs = Path.Combine(_environment.WebRootPath ?? "", relativePath); + } + else + { + dirAbs = Path.Combine(basePath, relativePath); + } - var tempDic = Path.Combine(fileRoot, relativePath, DateTime.Now.Ticks.ToString()); - Directory.CreateDirectory(tempDic); - var fileAbsPath = Path.Combine(tempDic, ""); + if (!Directory.Exists(dirAbs)) + Directory.CreateDirectory(dirAbs); - //var opt = App.GetOptions(); - //var dirAbs = opt.basePath; - //if (string.IsNullOrEmpty(dirAbs)) - //{ - // dirAbs = App.WebHostEnvironment.WebRootPath; - //} - //var fileAbsPath = Path.Combine(dirAbs, "upload/printtemplate/舱位信息导出模板.xlsx"); + fileAbsPath = Path.Combine(dirAbs, "舱位信息导出模板.xlsx"); if (!File.Exists(fileAbsPath)) { //舱位台账导出模板【舱位台账导出模板】文件不存在 diff --git a/ds-wms-service/DS.WMS.OpApi/appsettings.json b/ds-wms-service/DS.WMS.OpApi/appsettings.json index f86ebc6e..02708c16 100644 --- a/ds-wms-service/DS.WMS.OpApi/appsettings.json +++ b/ds-wms-service/DS.WMS.OpApi/appsettings.json @@ -120,7 +120,7 @@ "Port": 465, "UseSSL": true, "Receivers": "daisusu@dongshengsoft.com", - "Content" : "" + "Content": "" } }, "FeeService": { @@ -139,5 +139,10 @@ "MQQueueNameDingCang": "djy.output.dingcang.ds6", "MQExchangeNameFangCang": "djy.output.dingcang.ds6", "MQQueueNameFangCang": "djy.output.dingcang.ds6_fangcang" + }, + "ExportFileSettings": { + "BasePath": "", //基础路径,不配置则使用当前系统目录 + "RelativePath": "ExportTemplate", + "FileType": [ ".xls", ".xlsx" ] } } diff --git a/ds-wms-service/DS.WMS.OpApi/wwwroot/ExportTemplate/舱位信息导出模板.xlsx b/ds-wms-service/DS.WMS.OpApi/wwwroot/ExportTemplate/舱位信息导出模板.xlsx new file mode 100644 index 00000000..3a998242 Binary files /dev/null and b/ds-wms-service/DS.WMS.OpApi/wwwroot/ExportTemplate/舱位信息导出模板.xlsx differ diff --git a/ds-wms-service/DS.WMS.OpApi/wwwroot/templates/舱位信息导出模板.xlsx b/ds-wms-service/DS.WMS.OpApi/wwwroot/templates/舱位信息导出模板.xlsx new file mode 100644 index 00000000..3a998242 Binary files /dev/null and b/ds-wms-service/DS.WMS.OpApi/wwwroot/templates/舱位信息导出模板.xlsx differ diff --git a/ds-wms-service/DS.WMS.OpApi/舱位导出_20241020-202011.xlsx b/ds-wms-service/DS.WMS.OpApi/舱位导出_20241020-202011.xlsx new file mode 100644 index 00000000..742d0eef Binary files /dev/null and b/ds-wms-service/DS.WMS.OpApi/舱位导出_20241020-202011.xlsx differ