From 8f9c402fd17e06ed28f97a092b4a955e2e33630b Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 24 Jul 2024 17:41:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=E4=BD=8D?= =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Op/Method/BookingSlot/BookingSlotService.cs | 8 ++++---- .../Properties/PublishProfiles/FolderProfile.pubxml.user | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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 7ff2e31b..621d959d 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 @@ -3720,28 +3720,28 @@ namespace DS.WMS.Core.Op.Method var ctnList = tenantDb.Queryable().Where(x=>x.SlotId == id).ToList(); - ctnList.ForEach(async t => + ctnList.ForEach(t => { t.Deleted = true; t.DeleteTime = DateTime.Now; t.DeleteBy = long.Parse(user.UserId); t.DeleteUserName = user.UserName; - await tenantDb.Updateable(t).ExecuteCommandAsync(); + tenantDb.Updateable(t).ExecuteCommand(); }); var alloc = tenantDb.Queryable().Where(a => a.BookingSlotId == id && a.Deleted == false).ToList(); if (alloc.Count > 0) { - alloc.ForEach(async t => + alloc.ForEach(t => { t.Deleted = true; t.DeleteTime = DateTime.Now; t.DeleteBy = long.Parse(user.UserId); t.DeleteUserName = user.UserName; - await tenantDb.Updateable(t).ExecuteCommandAsync(); + tenantDb.Updateable(t).ExecuteCommand(); }); } 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 860a0654..f23f532f 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-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||; + True|2024-07-24T08:01:13.8217949Z||;True|2024-07-24T15:56:15.7589616+08:00||;True|2024-07-24T15:38:29.2442086+08:00||;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 From 633b14289cbd8116632984545423609bf2f7fcd8 Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Wed, 24 Jul 2024 17:57:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=8E=A5=E6=94=B6?= =?UTF-8?q?=E3=80=81=E5=88=9B=E5=BB=BA=E8=B0=83=E6=95=B4=E4=B8=BA=E5=A4=9A?= =?UTF-8?q?=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/TaskPlat/Dtos/RecvUserInfo.cs | 18 +++++++ .../Dtos/TaskManageOrderMessageMainInfo.cs | 13 +++-- .../TaskPlat/Entity/TaskBaseAllocation.cs | 37 +++++++++++++ .../TaskPlat/Method/TaskManageService.cs | 52 ++++++++++++++----- 4 files changed, 102 insertions(+), 18 deletions(-) create mode 100644 ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/RecvUserInfo.cs create mode 100644 ds-wms-service/DS.WMS.Core/TaskPlat/Entity/TaskBaseAllocation.cs diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/RecvUserInfo.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/RecvUserInfo.cs new file mode 100644 index 00000000..1ca03597 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/RecvUserInfo.cs @@ -0,0 +1,18 @@ +namespace DS.WMS.Core.TaskPlat.Dtos +{ + /// + /// 任务接收人信息 + /// + public class RecvUserInfo + { + /// + /// 接收人信息主键 + /// + public long RecvUserId { get; set; } + + /// + /// 接收人信息姓名 + /// + public string RecvUserName { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/TaskManageOrderMessageMainInfo.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/TaskManageOrderMessageMainInfo.cs index 03b3cd32..7b6889c0 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/TaskManageOrderMessageMainInfo.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/TaskManageOrderMessageMainInfo.cs @@ -56,25 +56,30 @@ namespace DS.WMS.Core.TaskPlat.Dtos public int IsException { get; set; } = 0; /// - /// 任务对应操作人ID + /// 任务对应操作人ID(任务制单人) /// public string TaskUserId { get; set; } /// - /// 任务对应操作人名称 + /// 任务对应操作人名称(任务制单人) /// public string TaskUserName { get; set; } /// - /// 任务对应接收操作人ID + /// 任务对应接收操作人ID(任务接收人) /// public string RecvUserId { get; set; } /// - /// 任务对应接收操作人名称 + /// 任务对应接收操作人名称(任务接收人) /// public string RecvUserName { get; set; } + /// + /// 任务接收人列表 + /// + public List RecvUserInfoList { get; set; } + /// /// 任务对应接收操作人ID(大简云账户体系) /// diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Entity/TaskBaseAllocation.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Entity/TaskBaseAllocation.cs new file mode 100644 index 00000000..3235be40 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Entity/TaskBaseAllocation.cs @@ -0,0 +1,37 @@ +using DS.Module.Core.Data; +using SqlSugar; + +namespace DS.WMS.Core.TaskPlat.Entity +{ + /// + /// 任务归属关系表 + /// + [SugarTable("task_base_allocation", "任务归属关系表")] + public class TaskBaseAllocation : BaseModelV2 + { + /// + /// 任务主键 + /// + [SugarColumn(ColumnDescription = "任务主键", IsNullable = false)] + public long TaskId { get; set; } + + /// + /// 所属人员主键 + /// + [SugarColumn(ColumnDescription = "所属人员主键", IsNullable = false)] + public long UserId { get; set; } + + /// + /// 所属人员姓名 + /// + [SugarColumn(ColumnDescription = "所属人员姓名", IsNullable = false, Length = 255)] + public string UserName { get; set; } + + /// + /// 所属机构主键 + /// + [SugarColumn(ColumnDescription = "所属机构主键", IsNullable = true)] + public long? OrgId { get; set; } + } + +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs index 8c47d9d0..a4c6bac1 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs @@ -64,13 +64,17 @@ namespace DS.WMS.Core.TaskPlat.Method _logger.LogInformation("接收到任务状态修改报文 任务主键={id} 状态设置={status}", taskInfo.Id, taskStatusEnum.ToString()); taskInfo.STATUS = taskStatusEnum.ToString(); + taskInfo.RealUserId = long.Parse(user.UserId); + taskInfo.RealUserName = user.UserName; await tenantDb.Updateable(taskInfo).UpdateColumns(x => new { x.UpdateBy, x.UpdateTime, x.UpdateUserName, - x.STATUS + x.STATUS, + x.RealUserId, + x.RealUserName }).ExecuteCommandAsync(); return DataResult.Successed(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.DataUpdateSuccess))); @@ -156,37 +160,57 @@ namespace DS.WMS.Core.TaskPlat.Method BATCH_STATIC = info.Main.BatchStatic, DJYUserId = info.Head.DJYUserId, OUT_BS_NO = info.Head.BSNO, + CreateTime = DateTime.Now, }; - long taskReqUserId = 0; + // 人员字段说明: + // TaskBaseInfo.CreateBy 创建人:谁创建的,只有一个人(可能是某个租户的管理员,因为任务可以由外部(邮件)创建,无法为每个人创建接口授权信息) + // TaskBaseInfo.TASK_REQ_USERID 制单人:只有一个人,使用任务创建报文中传入的TaskUserId + // TaskBaseAllocation.UserId 任务关系:任务属于谁,谁能够查看并处理,可能是多个人(可能是多个人一起处理);取值优先级:TaskBaseInfo.TASK_REQ_USERID>关联订单>TaskBaseInfo.CreateBy + // TaskBaseInfo.RealUserId 实际操作人:谁实际处理的,只有一个人 + + // 创建人 + taskInfo.CreateBy = long.Parse(user.UserId); + taskInfo.CreateUserName = user.UserName; + + // 制单人 + long taskReqUserId = 0; if (!string.IsNullOrWhiteSpace(info.Main.TaskUserId)) { if (long.TryParse(info.Main.TaskUserId, out taskReqUserId)) { taskInfo.TASK_REQ_USERID = taskReqUserId; + taskInfo.TASK_REQ_USERNAME = info.Main.TaskUserName; } } - // 忽略 - taskInfo.CreateBy = long.Parse(user.UserId); - taskInfo.CreateTime = DateTime.Now; - - //taskInfo.CreatedUserId = userTendInfo.userId; - //taskInfo.CreatedUserName = userTendInfo.userName; - //taskInfo.TenantId = userTendInfo.tendId; - //taskInfo.TenantName = userTendInfo.tenantName; + _logger.LogInformation("批次={no} 获取登录人详情 recvUserId={recvUserId} UserId={UserId}", batchNo, + info.Main.RecvUserId, + user.UserId); - if (info.Main.TaskType == TaskBaseTypeEnum.TRUCK_DISPATCH || info.Main.TaskType == TaskBaseTypeEnum.CAUTION_NOTICE) + // 任务所属人员列表 + // 如果明确指出接收人(接收人列表),则将任务作为个人任务 + if (info.Main.RecvUserInfoList?.Count > 0) { + _logger.LogInformation("批次={no} 接收人列表 recvUserList={recvUserList} ", batchNo, + JsonConvert.SerializeObject(info.Main.RecvUserInfoList)); + taskInfo.IS_PUBLIC = 0; + var allocationList = info.Main.RecvUserInfoList.Select(x => new TaskBaseAllocation + { + TaskId = taskInfo.Id, + UserId = x.RecvUserId, + UserName = x.RecvUserName + }).ToList(); + await tenantDb.Insertable(allocationList).ExecuteCommandAsync(); + } + // 否则判断任务关联订单,如果能关联到,则判断任务设置的角色;如果有设置,则将任务挂载到订单的指定角色上;如果没关联到或者没有设置,则作为公共任务 else { taskInfo.IS_PUBLIC = 1; + // } - _logger.LogInformation("批次={no} 获取登录人详情 userid={userid} UserId={UserId}", batchNo, - info.Main.RecvUserId, - user.UserId); if (info.Main != null && info.Main.TruckInfo != null && info.Main.TruckInfo.NeedArriveTime.HasValue) { From 471ee2693bcf95a369e15a709ea4c7ca637b3f84 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 24 Jul 2024 18:11:30 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingSlot/IBookingSlotService.cs | 15 ++++ .../Method/BookingSlot/BookingSlotService.cs | 86 ++++++++++++++++++- .../BookingSlotServiceController.cs | 28 ++++-- .../DS.WMS.OpApi/Logs/internal-nlog.txt | 14 +++ .../PublishProfiles/FolderProfile.pubxml.user | 2 +- 5 files changed, 133 insertions(+), 12 deletions(-) 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 83ba5dfe..4259edc9 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 @@ -3,6 +3,7 @@ using DS.Module.Core.Data; using DS.Module.DjyServiceStatus; using DS.WMS.Core.Op.Dtos; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; @@ -38,6 +39,13 @@ namespace DS.WMS.Core.Op.Interface /// 返回详情 Task> Detail(long id); + // + /// 分页查询可用的舱位及箱子列表 + /// + /// 可选:舱位查询条件 + /// 可选:分页信息 + Task>> GetAvailableSlots(BookingSlotBaseDto input, PageWithTotal pageInfo); + /// /// 查询可用的舱位及箱子列表 /// @@ -216,5 +224,12 @@ namespace DS.WMS.Core.Op.Interface /// 舱位主键数组 /// 返回回执 Task Delete(long[] ids); + + /// + /// 查询指定舱位可用的箱子列表 + /// + /// 舱位主键 + /// 可用的箱子列表 + Task>> GetAvailableCtnsBySlot(long slotId); } } 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 621d959d..af8d4634 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 @@ -1849,8 +1849,7 @@ namespace DS.WMS.Core.Op.Method /// /// 可选:舱位查询条件 /// 可选:分页信息 - public async Task> GetAvailableSlots([FromQuery] BookingSlotBaseDto input, - [FromQuery] PageWithTotal pageInfo) + public async Task>> GetAvailableSlots(BookingSlotBaseDto input,PageWithTotal pageInfo) { var result = await GetAvailableSlots(input, null, pageInfo); @@ -1861,7 +1860,7 @@ namespace DS.WMS.Core.Op.Method TotalCount = pageInfo.Total, Items = result, }; - return pageResult; + return DataResult>.Success(pageResult); } #endregion @@ -1873,7 +1872,6 @@ namespace DS.WMS.Core.Op.Method /// 筛选条件2:舱位主键列表 /// 筛选条件3:分页 /// 可用的舱位列表(含可用的箱子列表) - [NonAction] public async Task> GetAvailableSlots(BookingSlotBaseDto slotInput = null, List slotIdListInput = null, PageWithTotal pageInfo = null) @@ -3762,6 +3760,86 @@ namespace DS.WMS.Core.Op.Method return DataResult.Successed(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotDeleteSucc))); } #endregion + + /// + /// 查询指定舱位可用的箱子列表 + /// + /// 舱位主键 + /// 可用的箱子列表 + public async Task>> GetAvailableCtnsBySlot(long slotId) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + + if (await tenantDb.Queryable().AnyAsync(x => x.Id == slotId && x.IsCancellation == false) == false) + { + //获取舱位失败,舱位不存在或已作废 + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotCreateRecordDeletedOrNoExists))); + } + + // 1. 【舱位基础表】与【箱子表】做关联,并根据【舱位主键】、【箱型】做分组,统计出【总的箱量】,作为queryable1 + var queryable1 = tenantDb.Queryable((bas, ctn) => bas.Id == ctn.SlotId) + .Where(bas => bas.IsCancellation == false && bas.Id == slotId) + .GroupBy((bas, ctn) => new + { + bas.Id, + ctn.CtnCode + }) + .Select((bas, ctn) => new + { + id = bas.Id, + ctnCode = ctn.CtnCode, + numAll = SqlFunc.AggregateSum(ctn.CtnNum) + }) + .MergeTable(); + + // 2. 【已引入舱位表】与【已使用的箱子表】做关联,并根据【舱位主键】、【箱型】做分组,统计出【已使用的箱量】,作为queryable2 + var queryable2 = tenantDb.Queryable((alc, ctn) => alc.Id == ctn.SlotAllocId) + .Where((alc, ctn) => alc.BookingSlotId == slotId) + .GroupBy((alc, ctn) => new + { + alc.BookingSlotId, + ctn.CtnCode + }) + .Select((alc, ctn) => new + { + id = alc.BookingSlotId, + ctnCode = ctn.CtnCode, + numUse = SqlFunc.AggregateSum(ctn.CtnNum) + }) + .MergeTable(); + + // 3. 将queryable1 左连接 queryable2,使用【总的箱量】减去【已使用的箱量】,得到【剩余的箱量】,添加【剩余的箱量】> 0 的条件,作为queryable3 + var queryable3 = queryable1.LeftJoin(queryable2, (q1, q2) => q1.id == q2.id && q1.ctnCode == q2.ctnCode) + .Select((q1, q2) => new + { + q1.id, + q1.ctnCode, + numResidue = SqlFunc.IsNull(q1.numAll - q2.numUse, q1.numAll) + }) + .MergeTable() + .Where(r => r.numResidue > 0); + + // 4. 执行ToList(),得到可用的【舱位主键】、【箱型】、【箱量】列表 + var canUselist = await queryable3.ToListAsync(); + + List ctnCodeCache = new List(); + + var allCtnCodeList = await _codeCtnService.GetAllList(); + + if (allCtnCodeList.Succeeded) + { + ctnCodeCache = allCtnCodeList.Data; + } + + List result = canUselist.Select(c => new BookingSlotCtnDto() + { + CtnCode = c.ctnCode, + CtnNum = c.numResidue, + CtnAll = ctnCodeCache.FirstOrDefault(e => $"{e.CtnSize}{e.CtnType}" == c.ctnCode)?.CtnName ?? throw new Exception($"舱位信息中存在未收录的箱型:{c.ctnCode},需要在箱型字典中补充"), + }).ToList(); + + return DataResult>.Success(result); + } } 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 92554da8..9e08504e 100644 --- a/ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs @@ -59,17 +59,17 @@ namespace DS.WMS.OpApi.Controllers #region 查询可用的舱位及箱子列表 /// - /// 查询可用的舱位及箱子列表 + /// 分页查询可用的舱位及箱子列表 /// - /// 筛选条件1:舱位信息、箱型 - /// 筛选条件2:舱位主键列表 - /// 筛选条件3:分页 + /// 可选:舱位查询条件 + /// 可选:分页信息 /// 可用的舱位列表(含可用的箱子列表) - [HttpPost] + [HttpGet] [Route("GetAvailableSlots")] - public async Task>> GetAvailableSlots([FromBody] BookingSlotBaseDto slotInput ) + public async Task>> GetAvailableSlots([FromQuery] BookingSlotBaseDto input, + [FromQuery] PageWithTotal pageInfo) { - return await _bookingSlotService.GetAvailableSlots(slotInput, null, null); + return await _bookingSlotService.GetAvailableSlots(input, pageInfo); } #endregion @@ -357,5 +357,19 @@ namespace DS.WMS.OpApi.Controllers return await _bookingSlotService.Delete(ids); } #endregion + + #region 查询指定舱位可用的箱子列表 + /// + /// 查询指定舱位可用的箱子列表 + /// + /// 舱位主键 + /// 可用的箱子列表 + [HttpGet] + [Route("GetAvailableCtnsBySlot")] + public async Task>> GetAvailableCtnsBySlot(long slotId) + { + return await _bookingSlotService.GetAvailableCtnsBySlot(slotId); + } + #endregion } } diff --git a/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt index 5e899ea5..a041aec7 100644 --- a/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt +++ b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt @@ -782,3 +782,17 @@ 2024-07-24 14:14:41.8726 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config 2024-07-24 14:14:41.8726 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile 2024-07-24 14:14:41.8863 Info Configuration initialized. +2024-07-24 17:43:01.5160 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-24 17:43:01.5361 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-24 17:43:01.5361 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-24 17:43:01.5528 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-24 17:43:01.5595 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-24 17:43:01.5595 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-24 17:43:01.5595 Info Configuration initialized. +2024-07-24 17:52:22.4155 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-24 17:52:22.4304 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-24 17:52:22.4304 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-24 17:52:22.4474 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-24 17:52:22.4474 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-24 17:52:22.4592 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-24 17:52:22.4592 Info Configuration initialized. 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 f23f532f..b53da925 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-24T08:01:13.8217949Z||;True|2024-07-24T15:56:15.7589616+08:00||;True|2024-07-24T15:38:29.2442086+08:00||;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||; + True|2024-07-24T10:10:14.9409342Z||;True|2024-07-24T17:52:10.3966338+08:00||;True|2024-07-24T16:01:13.8217949+08:00||;True|2024-07-24T15:56:15.7589616+08:00||;True|2024-07-24T15:38:29.2442086+08:00||;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