diff --git a/Myshipping.Application/Service/BookingTruck/BookingTruckService.cs b/Myshipping.Application/Service/BookingTruck/BookingTruckService.cs index be19c04d..f9c13cbf 100644 --- a/Myshipping.Application/Service/BookingTruck/BookingTruckService.cs +++ b/Myshipping.Application/Service/BookingTruck/BookingTruckService.cs @@ -56,6 +56,7 @@ namespace Myshipping.Application private readonly SqlSugarRepository _bookingExcelTemplateRepository; private readonly SqlSugarRepository _sysUserRepository; private readonly ITaskManageExternalService _taskManageExternalService; + private readonly ISysUserService _sysUserService; const string PRINT_LIST_TYPE_KEY = "booking_truck_print_list"; const string PRINT_DATASOURCE_KEY = "booking_order"; @@ -69,6 +70,7 @@ namespace Myshipping.Application SqlSugarRepository djyUserConfigConfig, SqlSugarRepository bookingExcelTemplateRepository, SqlSugarRepository sysUserRepository, + ISysUserService sysUserService, ITaskManageExternalService taskManageExternalService) { _cache = cache; @@ -84,6 +86,7 @@ namespace Myshipping.Application _djyUserConfigConfig = djyUserConfigConfig; _bookingExcelTemplateRepository = bookingExcelTemplateRepository; _sysUserRepository = sysUserRepository; + _sysUserService = sysUserService; } /// @@ -259,7 +262,7 @@ namespace Myshipping.Application try { - var model = InnerCreateTruckFromBookingOrder(bookingId); + var model = await InnerCreateTruckFromBookingOrder(bookingId); result.succ = true; result.ext = model; @@ -445,7 +448,7 @@ namespace Myshipping.Application } - private BookingTruckShowDto InnerCreateTruckFromBookingOrder(long bookingId) + private async Task InnerCreateTruckFromBookingOrder(long bookingId) { BookingTruckShowDto model = null; @@ -466,11 +469,22 @@ namespace Myshipping.Application model.MBLNo = orderInfo.MBLNO; model.Vessel = orderInfo.VESSEL; model.VoyNo = orderInfo.VOYNO; + model.YARDCONTRACT = orderInfo.YARDCONTRACT; + model.YARDCONTRACTTEL = orderInfo.YARDCONTRACTTEL; + model.TruckTime = DateTime.Now; model.FromName = UserManager.Name; model.FromTel = UserManager.TEl; model.FromMail = UserManager.Email; + var userPosInfo = await _sysUserService.QueryUserByPos("", "PCDD"); + + if(userPosInfo.Count > 0) + { + model.DispatcherId = userPosInfo.FirstOrDefault().SysEmpId; + model.DispatcherName = userPosInfo.FirstOrDefault().SysEmpName; + } + if (orderInfo.KGS.HasValue) { //计算总吨数 @@ -542,7 +556,7 @@ namespace Myshipping.Application try { - var model = InnerCreateTruckFromBookingOrder(bookingId); + var model = await InnerCreateTruckFromBookingOrder(bookingId); result.succ = true; result.ext = model; @@ -568,7 +582,7 @@ namespace Myshipping.Application try { - var model = InnerCreateTruckFromBookingOrder(bookingId); + var model = await InnerCreateTruckFromBookingOrder(bookingId); result.succ = true; diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 1aeba5b0..9671aa48 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -15274,6 +15274,14 @@ 所属租户 + + + 通过职位获取用户信息 + + + 职位代码 PCDD-调度 + 返回用户详情 + 用户数据范围 diff --git a/Myshipping.Core/Service/User/ISysUserService.cs b/Myshipping.Core/Service/User/ISysUserService.cs index c7f7d9f4..4584aea4 100644 --- a/Myshipping.Core/Service/User/ISysUserService.cs +++ b/Myshipping.Core/Service/User/ISysUserService.cs @@ -32,4 +32,11 @@ public interface ISysUserService void CheckDataScopeByUserId(long userId); void CheckDataScope(long orgId); Task> GetTenantUser(string name,long? tenantId); + /// + /// 通过职位获取用户信息 + /// + /// + /// 职位代码 PCDD-调度 + /// 返回用户详情 + Task> QueryUserByPos(string name, string pos); }