diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index ce1523aa..b23cf0f0 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -1392,5 +1392,12 @@ public static class MultiLanguageConst [Description("导入失败")] public const string BookingSlotImportFail = "BookingSlot_Import_Fail"; + /// + /// 作废成功 + /// + [Description("作废成功")] + public const string BookingSlotDeleteSucc = "BookingSlot_DeleteSucc"; + + #endregion } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs index 345cbeaf..83ba5dfe 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs @@ -172,7 +172,7 @@ namespace DS.WMS.Core.Op.Interface /// 新舱位详情 /// 舱位ID /// - Task> MeasureDiffCautionTask(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto, long slotId); + Task MeasureDiffCautionTask(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto, long slotId); /// /// 订舱编号检索舱位信息 @@ -180,7 +180,7 @@ namespace DS.WMS.Core.Op.Interface /// 订舱编号 /// 船公司ID /// - Task QueryBookingSlot(string slotBookingNo, string CarrierId); + Task> QueryBookingSlot(string slotBookingNo, string CarrierId); /// /// 获取舱位详情列表 @@ -194,14 +194,14 @@ namespace DS.WMS.Core.Op.Interface /// /// /// - Task GetMergeList(QueryMergeSlotDto model); + Task> GetMergeList(QueryMergeSlotDto model); /// /// 生成合票订舱订单 /// /// 生成订舱订单请求 /// 返回回执 - Task MergeCreateBookingOrder(BookingGenerateDto model); + Task> MergeCreateBookingOrder(BookingGenerateDto model); /// /// 导出舱位为Excel @@ -209,5 +209,12 @@ namespace DS.WMS.Core.Op.Interface /// 请求参数 /// Task> ExportOrder(BookingSlotBasePageInput input); + + /// + /// 作废舱位(可以批量) + /// + /// 舱位主键数组 + /// 返回回执 + Task Delete(long[] ids); } } diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BookingLabel/BookingLabelService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BookingLabel/BookingLabelService.cs index 2e20744d..f2777790 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/BookingLabel/BookingLabelService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/BookingLabel/BookingLabelService.cs @@ -71,7 +71,7 @@ namespace DS.WMS.Core.Op.Method recordList.ForEach(async p => { - await tenantDb.Deleteable().ExecuteCommandAsync(); + await tenantDb.Deleteable(p).ExecuteCommandAsync(); }); if (input.LabelIdArray != null && input.LabelIdArray.Length > 0) 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 616cce15..619f4bb0 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 @@ -1742,7 +1742,7 @@ namespace DS.WMS.Core.Op.Method /// /// /// - public async Task GetMergeList(QueryMergeSlotDto model) + public async Task> GetMergeList(QueryMergeSlotDto model) { BookingSlotMergeResultDto rlt = new BookingSlotMergeResultDto(); @@ -1839,7 +1839,7 @@ namespace DS.WMS.Core.Op.Method // 查询可用舱位及箱子列表 - return rlt; + return DataResult.Success(rlt); } #endregion @@ -2723,7 +2723,7 @@ namespace DS.WMS.Core.Op.Method /// 订舱编号 /// 船公司ID /// - public async Task QueryBookingSlot(string slotBookingNo, string CarrierId) + public async Task> QueryBookingSlot(string slotBookingNo, string CarrierId) { long id = 0; @@ -2743,7 +2743,7 @@ namespace DS.WMS.Core.Op.Method //_logger.LogInformation($"订舱编号检索舱位信息失败,原因:{ex.Message}"); } - return id; + return DataResult.Success(id); } #endregion @@ -2774,7 +2774,7 @@ namespace DS.WMS.Core.Op.Method /// /// 生成订舱订单请求 /// 返回回执 - public async Task MergeCreateBookingOrder(BookingGenerateDto model) + public async Task> MergeCreateBookingOrder(BookingGenerateDto model) { return null; } @@ -2786,9 +2786,9 @@ namespace DS.WMS.Core.Op.Method /// 新舱位详情 /// 舱位ID /// - public async Task> MeasureDiffCautionTask(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto, long slotId) + public async Task MeasureDiffCautionTask(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto, long slotId) { - return DataResult.Success(string.Empty); + return DataResult.Successed(string.Empty); } /// @@ -3692,6 +3692,76 @@ namespace DS.WMS.Core.Op.Method return DataResult>.FailedData(data); } #endregion + + #region 作废舱位(可以批量) + /// + /// 作废舱位(可以批量) + /// + /// 舱位主键数组 + /// 返回回执 + public async Task Delete(long[] ids) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + + foreach (long id in ids) + { + var slot = await tenantDb.Queryable().FirstAsync(x => x.Id == id); + if (slot == null) + { + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotBaseInfoNull))); + } + + slot.Deleted = true; + slot.DeleteBy = long.Parse(user.UserId); + slot.DeleteUserName = user.UserName; + slot.DeleteTime = DateTime.Now; + + await tenantDb.Updateable(slot).ExecuteCommandAsync(); + + var ctnList = tenantDb.Queryable().Where(x=>x.SlotId == id).ToList(); + + ctnList.ForEach(async t => + { + t.Deleted = true; + t.DeleteTime = DateTime.Now; + t.DeleteBy = long.Parse(user.UserId); + t.DeleteUserName = user.UserName; + + await tenantDb.Updateable(t).ExecuteCommandAsync(); + }); + + var alloc = tenantDb.Queryable().Where(a => a.BookingSlotId == id && a.Deleted == false).ToList(); + + if (alloc.Count > 0) + { + alloc.ForEach(async t => + { + t.Deleted = true; + t.DeleteTime = DateTime.Now; + t.DeleteBy = long.Parse(user.UserId); + t.DeleteUserName = user.UserName; + + await tenantDb.Updateable(t).ExecuteCommandAsync(); + }); + } + + //更新库存 + await _bookingSlotStockService.BookingSlotStock(new BookingSlotStockUpdateModel + { + BookingSlotType = slot.BookingSlotType, + CarrierCode = slot.CarrierCode, + ContractNo = slot.ContractNo, + Vessel = slot.Vessel, + Voyno = slot.Voyno, + PortLoadId = slot.PortLoadCode, + PortDischargeId = slot.PortDischargeCode, + TenantId = long.Parse(user.TenantId) + }); + } + + return DataResult.Successed(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotDeleteSucc))); + } + #endregion } public static class LetterIndexUtil diff --git a/ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs index ca8cd038..92554da8 100644 --- a/ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs @@ -283,7 +283,7 @@ namespace DS.WMS.OpApi.Controllers [Route("MeasureDiffCautionTask")] public async Task MeasureDiffCautionTask([FromBody] ParserBCInfoDto bcSrcDto) { - return null;// await _bookingSlotService.MeasureDiffCautionTask(bcSrcDto, null, 0); + return await _bookingSlotService.MeasureDiffCautionTask(bcSrcDto, null, 0); } #endregion @@ -298,7 +298,7 @@ namespace DS.WMS.OpApi.Controllers [Route("QueryBookingSlot")] public async Task> QueryBookingSlot([FromQuery] string slotBookingNo, [FromQuery] string CarrierId) { - return null;// await _bookingSlotService.QueryBookingSlot(slotBookingNo, CarrierId); + return await _bookingSlotService.QueryBookingSlot(slotBookingNo, CarrierId); } #endregion @@ -312,7 +312,7 @@ namespace DS.WMS.OpApi.Controllers [Route("GetSlotList")] public async Task>> GetSlotList([FromBody] long[] ids) { - return null;// await _bookingSlotService.GetSlotList(ids); + return await _bookingSlotService.GetSlotList(ids); } #endregion @@ -326,7 +326,7 @@ namespace DS.WMS.OpApi.Controllers [Route("GetMergeList")] public async Task> GetMergeList([FromBody] QueryMergeSlotDto model) { - return null;// await _bookingSlotService.GetMergeList(model); + return await _bookingSlotService.GetMergeList(model); } #endregion @@ -340,7 +340,21 @@ namespace DS.WMS.OpApi.Controllers [Route("MergeCreateBookingOrder")] public async Task> MergeCreateBookingOrder([FromBody] BookingGenerateDto model) { - return null;// await _bookingSlotService.MergeCreateBookingOrder(model); + return await _bookingSlotService.MergeCreateBookingOrder(model); + } + #endregion + + #region 作废舱位(可以批量) + /// + /// 作废舱位(可以批量) + /// + /// 舱位主键数组 + /// 返回回执 + [HttpPost] + [Route("Delete")] + public async Task Delete([FromBody] long[] ids) + { + return await _bookingSlotService.Delete(ids); } #endregion } diff --git a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user index edd5342f..860a0654 100644 --- a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -6,7 +6,7 @@ <_PublishTargetUrl>D:\Code\PublishCopy\ds8-opapi - True|2024-07-24T04:56:48.1663545Z||;True|2024-07-24T08:47:26.1616069+08:00||;True|2024-07-24T08:42:02.7606608+08:00||;True|2024-07-24T08:41:18.4678459+08:00||;False|2024-07-24T08:40:29.5381703+08:00||;False|2024-07-24T08:39:20.2230656+08:00||;True|2024-07-23T15:56:16.8305907+08:00||;True|2024-07-22T16:42:12.1933090+08:00||;True|2024-07-19T18:28:29.1420269+08:00||;True|2024-07-19T15:45:49.1068004+08:00||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; + True|2024-07-24T07:38:29.2442086Z||;True|2024-07-24T14:48:12.2303919+08:00||;True|2024-07-24T14:18:05.5309704+08:00||;True|2024-07-24T12:56:48.1663545+08:00||;True|2024-07-24T08:47:26.1616069+08:00||;True|2024-07-24T08:42:02.7606608+08:00||;True|2024-07-24T08:41:18.4678459+08:00||;False|2024-07-24T08:40:29.5381703+08:00||;False|2024-07-24T08:39:20.2230656+08:00||;True|2024-07-23T15:56:16.8305907+08:00||;True|2024-07-22T16:42:12.1933090+08:00||;True|2024-07-19T18:28:29.1420269+08:00||;True|2024-07-19T15:45:49.1068004+08:00||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; \ No newline at end of file