cjy 3 months ago
commit 9e9157dd7e

@ -78,5 +78,12 @@ namespace DS.Module.Core
/// </summary> /// </summary>
/// <remarks>类型Param{T}</remarks> /// <remarks>类型Param{T}</remarks>
public const string ClientParam = "ClientParam"; public const string ClientParam = "ClientParam";
/// <summary>
/// 任务主键
/// </summary>
/// <remarks>类型Param{T}</remarks>
public const string TaskPKId = "TaskPKId";
} }
} }

@ -273,7 +273,7 @@ public static class SqlsugarInstall
}; };
//全局过滤租户 //全局过滤租户
dbProvider.QueryFilter.AddTableFilter<ITenantId>(m => m.TenantId == long.Parse(user.TenantId)); dbProvider.QueryFilter.AddTableFilter<ITenantId>(m => m.TenantId == user.GetTenantId());
//全局过滤机构Id //全局过滤机构Id
dbProvider.QueryFilter.AddTableFilter<IOrgId>(m => m.OrgId == user.OrgId); dbProvider.QueryFilter.AddTableFilter<IOrgId>(m => m.OrgId == user.OrgId);
//全局软删除过滤 //全局软删除过滤

@ -599,7 +599,8 @@ public class CommonService : ICommonService
public async Task<DataResult<List<RouteItem>>> GetClientUserPermissionByToken() public async Task<DataResult<List<RouteItem>>> GetClientUserPermissionByToken()
{ {
List<RouteItem> list = new List<RouteItem>(); List<RouteItem> list = new List<RouteItem>();
_logger.LogInformation("GetClientUserPermissionByToken临时日志user.UserId={userId}", user.UserId); _logger.LogInformation("GetClientUserPermissionByToken临时日志user.UserId={userId},user.TenantId={TenantId},user.GetTenantId={GetTenantId}", user.UserId, user.TenantId, user.GetTenantId());
var userId = long.Parse(user.UserId); var userId = long.Parse(user.UserId);
var userInfo = await db.Queryable<SysUser>().Where(x => x.Id == userId).FirstAsync(); var userInfo = await db.Queryable<SysUser>().Where(x => x.Id == userId).FirstAsync();
@ -1404,7 +1405,8 @@ public class CommonService : ICommonService
if (rule == null) return db.Queryable<T>(); if (rule == null) return db.Queryable<T>();
} }
else { else
{
rule = rules.Find(x => x.Id == ruleUser.RuleId); rule = rules.Find(x => x.Id == ruleUser.RuleId);
} }
} }

@ -1,4 +1,5 @@
using DS.Module.Core; using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.TaskPlat.Dtos; using DS.WMS.Core.TaskPlat.Dtos;
using System; using System;
@ -34,5 +35,12 @@ namespace DS.WMS.Core.TaskPlat.Interface
/// <param name="taskPKId">起运港未提箱主键</param> /// <param name="taskPKId">起运港未提箱主键</param>
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
Task<DataResult> SendEmailToCustomer(long taskPKId); Task<DataResult> SendEmailToCustomer(long taskPKId);
/// <summary>
/// 发送邮件通知给客户(任务自动机调取)
/// </summary>
/// <param name="dataContext">数据上下文</param>
/// <returns>返回回执</returns>
Task<DataResult> SendEmailToCustomerTask(TaskFlowDataContext dataContext);
} }
} }

@ -97,6 +97,13 @@ namespace DS.WMS.Core.TaskPlat.Method
list = queryList.Select(a => a.Pol.Adapt<TaskPOLContainerNotPickUpShowDto>()).ToList(); list = queryList.Select(a => a.Pol.Adapt<TaskPOLContainerNotPickUpShowDto>()).ToList();
} }
List<long> noList = new List<long>();
for (int i = 0; i < 2000; i++)
{
noList.Add(SnowFlakeSingle.Instance.NextId());
}
return DataResult<List<TaskPOLContainerNotPickUpShowDto>>.Success(list); return DataResult<List<TaskPOLContainerNotPickUpShowDto>>.Success(list);
} }
#endregion #endregion
@ -109,7 +116,13 @@ namespace DS.WMS.Core.TaskPlat.Method
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
public async Task<DataResult<SeaExportOrderExtension>> SearchAndMarkBookingOrder(long taskPKId) public async Task<DataResult<SeaExportOrderExtension>> SearchAndMarkBookingOrder(long taskPKId)
{ {
return null; var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var entity = tenantDb.Queryable<TaskPolContainerNotPickup>().Filter(null, true).First(a => a.TASK_ID == taskPKId);
return await _seaExportService.SearchOrderInfo(entity.MBL_NO);
} }
#endregion #endregion
@ -121,6 +134,10 @@ namespace DS.WMS.Core.TaskPlat.Method
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
public async Task<DataResult> SendEmailToCustomer(long taskPKId) public async Task<DataResult> SendEmailToCustomer(long taskPKId)
{ {
//先匹配订单记录(这里可能关联的是拆票或者合票订单,如果是拆票需要所有拆票记录都要发邮件通知)
var searchInfo = SearchAndMarkBookingOrder(taskPKId).GetAwaiter().GetResult().Data;
//BusinessTaskMail? mailConfig = null; //BusinessTaskMail? mailConfig = null;
//if (context.AdditionalData.TryGetValue(nameof(BusinessTaskMail) + "." + nameof(BusinessTaskMail.Id), out var id)) //if (context.AdditionalData.TryGetValue(nameof(BusinessTaskMail) + "." + nameof(BusinessTaskMail.Id), out var id))
//{ //{
@ -147,8 +164,38 @@ namespace DS.WMS.Core.TaskPlat.Method
// //return; // //return;
//} //}
//var model = new MailTemplateModel<TaskPOLContainerNotPickUpShowDto>(order)
//{
// BusinessId = context.TaskInfo.BusinessId,
// BusinessType = context.TaskInfo.BusinessType,
//};
//MailService mailService = new MailService(context.ServiceProvider);
//var result3 = await mailService.SendAsync(mailConfig, model);
//if (!result3.Succeeded)
//{
// await LogService.WriteLogAsync(context.TaskInfo, result.Message);
// return;
//}
//await SetTaskCompleteAsync(context.TaskInfo,
// context.ServiceProvider.GetRequiredService<ITaskService>(), LogService);
return null; return null;
} }
#endregion #endregion
#region 发送邮件通知给客户(任务自动机调取)
/// <summary>
/// 发送邮件通知给客户(任务自动机调取)
/// </summary>
/// <param name="dataContext">数据上下文</param>
/// <returns>返回回执</returns>
public async Task<DataResult> SendEmailToCustomerTask(TaskFlowDataContext dataContext)
{
var taskPKId = dataContext.Get<Nullable<long>>(TaskFlowDataNameConst.TaskPKId) ?? throw new ArgumentException($"缺少参数:{nameof(TaskFlowDataNameConst.TaskPKId)}");
return await SendEmailToCustomer(taskPKId);
}
#endregion
} }
} }

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<NameOfLastUsedPublishProfile>E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>D:\Code\ds8-solution-pro\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<NameOfLastUsedPublishProfile>D:\Source\Repos\DS8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID> <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath> <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
</PropertyGroup> </PropertyGroup>

@ -0,0 +1,54 @@
using DS.Module.Core;
using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Interface;
using DS.WMS.Core.TaskPlat.Method;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.TaskApi.Controllers
{
/// <summary>
/// 起运港未提箱
/// </summary>
public class TaskManagePOLCtnNotPickUpController : ApiController
{
private readonly ITaskPOLContainerNotPickUpService _taskPOLContainerNotPickUpService;
/// <summary>
///
/// </summary>
/// <param name="taskManageCutDateChangeService"></param>
public TaskManagePOLCtnNotPickUpController(ITaskPOLContainerNotPickUpService taskPOLContainerNotPickUpService)
{
_taskPOLContainerNotPickUpService = taskPOLContainerNotPickUpService;
}
#region 通过任务主键获取起运港未提箱详情
/// <summary>
/// 通过任务主键获取起运港未提箱详情
/// </summary>
/// <param name="taskPKId">起运港未提箱任务主键</param>
/// <returns>返回回执</returns>
[HttpGet]
[Route("GetInfoByTaskId")]
public async Task<DataResult<List<TaskPOLContainerNotPickUpShowDto>>> GetInfoByTaskId([FromQuery] long taskPKId)
{
return await _taskPOLContainerNotPickUpService.GetInfoByTaskId(taskPKId);
}
#endregion
#region 发送邮件通知给客户
/// <summary>
/// 发送邮件通知给客户
/// </summary>
/// <param name="taskPKId">起运港未提箱主键</param>
/// <returns>返回回执</returns>
[HttpGet]
[Route("SendEmailToCustomer")]
public async Task<DataResult> SendEmailToCustomer(long taskPKId)
{
return await _taskPOLContainerNotPickUpService.SendEmailToCustomer(taskPKId);
}
#endregion
}
}
Loading…
Cancel
Save