diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/QueryTaskManageDto.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/QueryTaskManageDto.cs new file mode 100644 index 00000000..e3ff66e7 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/QueryTaskManageDto.cs @@ -0,0 +1,78 @@ +namespace DS.WMS.Core.TaskPlat.Dtos +{ + /// + /// 我的任务查询 + /// + public sealed class QueryTaskManageDto + { + /// + /// 提单号 + /// + /// + public string MBlNo { get; set; } + + /// + /// 开船日期起始 + /// + /// + public string ETDBegin { get; set; } + + /// + /// 开船日期结束 + /// + /// + public string ETDEnd { get; set; } + + /// + /// 任务起始日期 + /// + /// 2022-12-01 + public string TaskDateBegin { get; set; } + + /// + /// 任务起始结束 + /// + /// + public string TaskDateEnd { get; set; } + + /// + /// 任务类型 + /// + /// + public string TaskType { get; set; } + + /// + /// 任务来源 + /// + /// + public string TaskSource { get; set; } + + /// + /// 任务分类 + /// + /// + public string TaskCategory { get; set; } + + /// + /// 接收人 + /// + /// + public string TaskRecvName { get; set; } + + /// + /// 任务状态 + /// + /// + public string Status { get; set; } + + /// + /// 任务主键 + /// + public string PKId { get; set; } + + /// + /// 大简云用户Id + /// + public string DJYUserId { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Entity/TaskAllotSet.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Entity/TaskAllotSet.cs new file mode 100644 index 00000000..3110b1da --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Entity/TaskAllotSet.cs @@ -0,0 +1,66 @@ +using DS.Module.Core.Data; +using SqlSugar; + +namespace DS.WMS.Core.TaskPlat.Entity +{ + /// + /// 任务分配设置表 + /// + [SugarTable("task_allot_set", "任务分配设置表")] + public class TaskAllotSet : BaseModelV2 + { + /// + /// 任务类型 + /// + [SugarColumn(ColumnDescription = "任务类型编码", IsNullable = false, Length = 40)] + public string TaskType { get; set; } + + /// + /// 是否分配至操作 + /// + [SugarColumn(ColumnDescription = "是否分配至操作", IsNullable = false)] + public bool AllotOperator { get; set; } + + /// + /// 是否分配至单证 + /// + [SugarColumn(ColumnDescription = "是否分配至单证", IsNullable = false)] + public bool AllotVouchingClerk { get; set; } + + /// + /// 是否分配至销售 + /// + [SugarColumn(ColumnDescription = "是否分配至销售", IsNullable = false)] + public bool AllotSale { get; set; } + + /// + /// 是否分配至报关员 + /// + [SugarColumn(ColumnDescription = "是否分配至报关员", IsNullable = false)] + public bool AllotCustom { get; set; } + + /// + /// 是否分配至财务 + /// + [SugarColumn(ColumnDescription = "是否分配至财务", IsNullable = false)] + public bool AllotFinancialStaff { get; set; } + + /// + /// 是否分配至客服 + /// + [SugarColumn(ColumnDescription = "是否分配至客服", IsNullable = false)] + public bool AllotCustomerService { get; set; } + + /// + /// 是否分配至司机 + /// + [SugarColumn(ColumnDescription = "是否分配至司机", IsNullable = false)] + public bool AllotDriver { get; set; } + + /// + /// 是否分配至派车调度人员 + /// + [SugarColumn(ColumnDescription = "是否分配至派车调度人员", IsNullable = false)] + public bool AllotDispatcher { get; set; } + } +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageService.cs index c24b8811..7eb57732 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageService.cs @@ -1,17 +1,16 @@ using DS.Module.Core; -using DS.Module.DjyServiceStatus; using DS.WMS.Core.TaskPlat.Dtos; using Microsoft.AspNetCore.Http; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace DS.WMS.Core.TaskPlat.Interface { public interface ITaskManageService { + /// + /// 任务台台账列表查询 + /// + Task>> GetPageAsync(PageRequest querySearch); + /// /// 创建任务 /// 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 a4c6bac1..567c2288 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs @@ -14,6 +14,7 @@ using Microsoft.Extensions.Logging; using Newtonsoft.Json; using SqlSugar; using System.Runtime.InteropServices; +using DS.Module.Core.Extensions; namespace DS.WMS.Core.TaskPlat.Method { @@ -143,7 +144,8 @@ namespace DS.WMS.Core.TaskPlat.Method MBL_NO = info.Main.MBlNo, TASK_BASE_TYPE = info.Main.TaskType.ToString(), CARRIER_ID = info.Main.CarrierId?.Trim(), - IS_PUBLIC = string.IsNullOrWhiteSpace(info.Main.TaskUserId) ? 1 : 0, + //IS_PUBLIC = string.IsNullOrWhiteSpace(info.Main.TaskUserId) ? 1 : 0, + IS_PUBLIC = 1, BOOK_ORDER_NO = info.Main.BookingOrderNo, OUT_BUSI_NO = $"{info.Head.SenderId}_{info.Head.GID}", TASK_TITLE = info.Main.TaskTitle, @@ -166,7 +168,7 @@ namespace DS.WMS.Core.TaskPlat.Method // 人员字段说明: // TaskBaseInfo.CreateBy 创建人:谁创建的,只有一个人(可能是某个租户的管理员,因为任务可以由外部(邮件)创建,无法为每个人创建接口授权信息) // TaskBaseInfo.TASK_REQ_USERID 制单人:只有一个人,使用任务创建报文中传入的TaskUserId - // TaskBaseAllocation.UserId 任务关系:任务属于谁,谁能够查看并处理,可能是多个人(可能是多个人一起处理);取值优先级:TaskBaseInfo.TASK_REQ_USERID>关联订单>TaskBaseInfo.CreateBy + // TaskBaseAllocation.UserId 任务关系:任务属于谁,谁能够查看并处理,可能是多个人(可能是多个人一起处理);取值优先级:info.Main.RecvUserInfoList>关联订单 // TaskBaseInfo.RealUserId 实际操作人:谁实际处理的,只有一个人 // 创建人 @@ -203,14 +205,20 @@ namespace DS.WMS.Core.TaskPlat.Method UserName = x.RecvUserName }).ToList(); await tenantDb.Insertable(allocationList).ExecuteCommandAsync(); - } // 否则判断任务关联订单,如果能关联到,则判断任务设置的角色;如果有设置,则将任务挂载到订单的指定角色上;如果没关联到或者没有设置,则作为公共任务 - else - { - taskInfo.IS_PUBLIC = 1; - // - } + //else + //{ + // // 1.查找任务的匹配设置 + // var allotSet = await tenantDb.Queryable().Where(x => x.TaskType == info.Main.TaskType.ToString()).FirstAsync(); + // if (allotSet != null) + // { + // // 2. 根据提单号查找订单\根据订舱编号查找订单\... + // // 3. 查找订单之后,获取匹配设置参数,得到人员Id列表; + // // 4. 获取任务Id + // // 5. 存关系 + // } + //} if (info.Main != null && info.Main.TruckInfo != null && info.Main.TruckInfo.NeedArriveTime.HasValue) { @@ -658,6 +666,128 @@ namespace DS.WMS.Core.TaskPlat.Method } + + /// + /// 任务台台账列表查询 + /// + public async Task>> GetPageAsync(PageRequest querySearch) + { + var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId); + + //序列化查询条件 + List? whereList = null; + if (!string.IsNullOrEmpty(querySearch.QueryCondition)) + { + whereList = tenantDb.Utilities.JsonToConditionalModels(querySearch.QueryCondition); + } + + TaskBaseTypeEnum? taskType = null; + if (Enum.TryParse(typeof(TaskBaseTypeEnum), querySearch.OtherQueryCondition?.TaskType, out object? temp)) + { + taskType = (TaskBaseTypeEnum)temp; + }; + switch (taskType) + { + case TaskBaseTypeEnum.BC: + { + var result = await tenantDb.Queryable() + .LeftJoin((t, bc) => t.Id == bc.TASK_ID) + .Where(whereList) + .Select((t, bc) => new + { + Id = t.Id.SelectAll(), + bc.BUSI_TYPE, + bc.SHIPPER, + bc.CONSIGNEE, + bc.NOTIFYPARTY, + bc.BC_MODIFY_TIMES, + bc.BC_MODIFY_DATE, + //bc.MBL_NO, + bc.VESSEL, + bc.VOYNO, + bc.CARRIER, + bc.PLACERECEIPT, + bc.PORTLOAD, + bc.CLOSING_DATE, + bc.VGM_CUTOFF_TIME, + bc.ETA, + //bc.ETD, + bc.POD_ETA, + bc.CUT_SINGLE_TIME, + bc.PORTDISCHARGE, + bc.PLACEDELIVERY, + bc.SHIPPING_METHOD, + bc.SERVICE, + bc.PRETRANS_MODE, + bc.DESCRIPTION, + bc.ISSUEPLACE, + bc.COLLECTION_TERMINAL, + bc.CONTRACTNO, + bc.PREPARDAT, + bc.SHIP_AGENT, + bc.YARD, + bc.YARD_CONTACT_USR, + bc.YARD_CONTACT_TEL, + bc.FST_CUSTOMER_SER_USRNAME, + bc.FST_CUSTOMER_SER_TEL, + bc.FST_CUSTOMER_SER_EMAIL, + bc.REMARK1, + bc.CY_CUTOFF_TIME, + bc.CARRIERID, + bc.LANECODE, + bc.LANENAME, + bc.CARRIAGE_TYPE, + bc.CARRIAGE_TYPE_NAME, + bc.BOOKING_SLOT_TYPE, + bc.BOOKING_SLOT_TYPE_NAME, + bc.CTN_STAT, + bc.WEEK_AT, + bc.DETENSION_FREE_DAYS, + bc.SI_CUT_DATE, + bc.MANIFEST_CUT_DATE, + bc.MDGF_CUT_DATE, + bc.TRANSFER_PORT_1, + bc.TRANSFER_PORT_2, + bc.SECOND_VESSEL, + bc.SECOND_VOYNO, + bc.SECOND_ETD, + bc.SECOND_ETA, + //bc.STATUS, + bc.FILE_MD5, + bc.LAST_TOBOOKING_DATE, + bc.FROM_EMAIL, + bc.RECV_EMAIL, + bc.BOOKING_ORDER_ID, + bc.BOOKING_SLOT_ID, + bc.BOOKING_COMFIRM_DATE, + bc.BATCH_NO, + bc.CUSTOM_SI_CUT_DATE, + bc.IS_SET_AUTO_EMAIL, + bc.IS_SEND_EMAIL, + bc.DIFF_NUM, + bc.AUTO_SEND_USER, + bc.PROCESS_STATUS, + bc.PROCESS_RESULT, + bc.PROCESS_DATE, + bc.PRICE_CALCULATION_DATE + }) + .ToQueryPageAsync(querySearch.PageCondition); + return result; + } + default: + { + var result = await tenantDb.Queryable() + .Where(whereList) + .Select(t => new + { + Id = t.Id.SelectAll() + }) + .ToQueryPageAsync(querySearch.PageCondition); + return result; + } + } + } + #region 私有方法 /// diff --git a/ds-wms-service/DS.WMS.Gateway/Program.cs b/ds-wms-service/DS.WMS.Gateway/Program.cs index 6a57c248..db276ae8 100644 --- a/ds-wms-service/DS.WMS.Gateway/Program.cs +++ b/ds-wms-service/DS.WMS.Gateway/Program.cs @@ -41,7 +41,7 @@ if (!policyName.IsNullOrEmpty()) // if (app.Environment.IsDevelopment()) // { - var apis = new List { "WmsMainAPI", "WmsAdminAPI", "WmsOpAPI", "WmsFeeAPI", "WmsCheckAPI", "WmsFinanceAPI", "WmsPrintAPI", "TestApi" }; + var apis = new List { "WmsMainAPI", "WmsAdminAPI", "WmsOpAPI", "WmsFeeAPI", "WmsCheckAPI", "WmsFinanceAPI", "WmsPrintAPI", "WmsTaskAPI", "TestApi" }; app .UseSwagger() diff --git a/ds-wms-service/DS.WMS.Gateway/ocelot.json b/ds-wms-service/DS.WMS.Gateway/ocelot.json index 49d632c6..434de900 100644 --- a/ds-wms-service/DS.WMS.Gateway/ocelot.json +++ b/ds-wms-service/DS.WMS.Gateway/ocelot.json @@ -216,6 +216,21 @@ "ReRouteIsCaseSensitive": false, "UseServiceDiscovery": false }, + { + "DownstreamPathTemplate": "/WmsTaskAPI/swagger.json", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 3006 + } + ], + "UpstreamPathTemplate": "/WmsTaskAPI/swagger.json", + "UpstreamHttpMethod": [ + "Get", + "Post" + ] + }, { "DownstreamPathTemplate": "/taskApi/{url}", "DownstreamScheme": "http", diff --git a/ds-wms-service/DS.WMS.PrintApi/Model/PrintDataResult.cs b/ds-wms-service/DS.WMS.PrintApi/Model/PrintDataResult.cs index 0543d72b..eeab31ac 100644 --- a/ds-wms-service/DS.WMS.PrintApi/Model/PrintDataResult.cs +++ b/ds-wms-service/DS.WMS.PrintApi/Model/PrintDataResult.cs @@ -5,7 +5,7 @@ /// /// 是否成功 /// - public bool Successed { get; set; } + public bool Succeeded { get; set; } /// /// 返回消息 @@ -26,7 +26,7 @@ { return new PrintDataResult() { - Successed = false, + Succeeded = false, Message = message }; } @@ -35,7 +35,7 @@ { return new PrintDataResult() { - Successed = true, + Succeeded = true, Data = data }; } diff --git a/ds-wms-service/DS.WMS.TaskApi/.config/dotnet-tools.json b/ds-wms-service/DS.WMS.TaskApi/.config/dotnet-tools.json new file mode 100644 index 00000000..608e342b --- /dev/null +++ b/ds-wms-service/DS.WMS.TaskApi/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "8.0.7", + "commands": [ + "dotnet-ef" + ] + } + } +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManageController.cs b/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManageController.cs index 1c2e4305..791524a4 100644 --- a/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManageController.cs +++ b/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManageController.cs @@ -66,6 +66,17 @@ public class TaskManageController : ApiController return result; } + + /// + /// 任务台台账列表查询 + /// + [HttpPost("GetPageAsync")] + public async Task>> GetPageAsync(PageRequest querySearch) + { + var result = await taskManageService.GetPageAsync(querySearch); + return result; + } + // /TaskManage/CreateBCTaskJob // /TaskManage/CreateDRAFTTaskJob // /TaskManage/CreateAdvisoryTaskJob diff --git a/ds-wms-service/DS.WMS.TaskApi/Properties/PublishProfiles/FolderProfile.pubxml b/ds-wms-service/DS.WMS.TaskApi/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 00000000..fd341e91 --- /dev/null +++ b/ds-wms-service/DS.WMS.TaskApi/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,22 @@ + + + + + true + false + true + Release + Any CPU + FileSystem + bin\Release\net8.0\publish\ + FileSystem + <_TargetId>Folder + + net8.0 + win-x64 + 8dae16a3-e249-4c86-beec-da8429fd837c + false + + \ No newline at end of file