任务台匹配相关

usertest
zhangxiaofeng 4 months ago
parent a5667cd229
commit 6ad74beeca

@ -6,7 +6,7 @@ namespace DS.WMS.Core.TaskPlat.Dtos
public class TaskAllocationtSetSaveDto
{
/// <summary>
/// 分配对象编码 Operator=操作 VouchingClerk=单证 Sale=销售 Custom=报关员 FinancialStaff=财务 CustomerService=客服 Driver=司机 Dispatcher=派车调度人员
/// 分配对象编码 Operator=操作 VouchingClerk=单证 Sale=销售 CustomerService=客服
/// </summary>
public string AllocationTargetCode { get; set; }
@ -32,6 +32,15 @@ namespace DS.WMS.Core.TaskPlat.Dtos
}
public class TaskAllocationtSetQueryListDto
{
public List<TaskTypeInfoDto> OperatorTaskTypeList { get; set; }
public List<TaskTypeInfoDto> SaleTaskTypeList { get; set; }
public List<TaskTypeInfoDto> VouchingClerkTaskTypeList { get; set; }
public List<TaskTypeInfoDto> CustomerServiceTaskTypeList { get; set; }
//public List<TaskTypeInfoDto> CustomTaskTypeList { get; set; }
//public List<TaskTypeInfoDto> FinancialStaffTaskTypeList { get; set; }
//public List<TaskTypeInfoDto> DriverTaskTypeList { get; set; }
//public List<TaskTypeInfoDto> DispatcherTaskTypeList { get; set; }
///// <summary>
///// 船公司ID
///// </summary>
@ -46,14 +55,6 @@ namespace DS.WMS.Core.TaskPlat.Dtos
///// 船公司
///// </summary>
//public string? Carrier { get; set; }
public List<TaskTypeInfoDto> OperatorTaskTypeList { get; set; }
public List<TaskTypeInfoDto> VouchingClerkTaskTypeList { get; set; }
public List<TaskTypeInfoDto> SaleTaskTypeList { get; set; }
public List<TaskTypeInfoDto> CustomTaskTypeList { get; set; }
public List<TaskTypeInfoDto> FinancialStaffTaskTypeList { get; set; }
public List<TaskTypeInfoDto> CustomerServiceTaskTypeList { get; set; }
public List<TaskTypeInfoDto> DriverTaskTypeList { get; set; }
public List<TaskTypeInfoDto> DispatcherTaskTypeList { get; set; }
}
public class TaskAllocationtSetDto

@ -24,9 +24,19 @@ namespace DS.WMS.Core.TaskPlat.Dtos
public TaskSourceEnum TaskSource { get; set; }
/// <summary>
/// 船公司代号
/// 船公司代号列如MSK邮件解析通过此参数传入船公司Id
/// </summary>
public string CarrierId { get; set; }
public string? CarrierId { get; set; }
/// <summary>
/// 船公司主键列如1802321321421232132
/// </summary>
public long? CarrierPK { get; set; }
/// <summary>
/// 船公司名称(列如:马士基)
/// </summary>
public string? CarrierName { get; set; }
/// <summary>
/// 任务标题

@ -90,10 +90,20 @@ namespace DS.WMS.Core.TaskPlat.Entity
//public string? TASK_BASE_TYPE { get; set; }
/// <summary>
/// 船公司代号
/// 船公司Id
/// </summary>
[SugarColumn(ColumnDescription = "船公司代号", IsNullable = true, Length = 20)]
public string? CARRIER_ID { get; set; }
[SugarColumn(ColumnDescription = "船公司Id", IsNullable = true)]
public long? CARRIER_ID { get; set; }
/// <summary>
/// 船公司编码
/// </summary>
[SugarColumn(ColumnDescription = "船公司编码", IsNullable = true, Length = 20)]
public string? CARRIER_CODE { get; set; }
/// <summary>
/// 船公司名称
/// </summary>
[SugarColumn(ColumnDescription = "船公司名称", IsNullable = true, Length = 20)]
public string? CARRIER_NAME { get; set; }
/// <summary>
/// 主单号

@ -30,6 +30,12 @@ namespace DS.WMS.Core.TaskPlat.Interface
/// <param name="taskId">任务Id</param>
/// <param name="fileCategory">附件分类代码</param>
Task<(string fileFullPath, string fileName)> GetTaskFileInfo(long taskId, string fileCategory);
Task<DataResult<MatchTaskResultDto>> MatchTask(List<long>? taskIdList);
/// <summary>
/// 根据订单及配置,将所有或指定的公共任务匹配到个人
/// </summary>
/// <param name="taskIdList">任务Id列表当传入时则只匹配列表中指定的任务</param>
/// <returns>涉及当前登陆人的匹配结果</returns>
Task<DataResult<MatchTaskResultDto>> MatchTask(List<long>? taskIdList = null);
}
}

@ -209,7 +209,7 @@ namespace DS.WMS.Core.TaskPlat.Method
{
if (isLoad)
{
await sysCacheService.SetCommonCode(JsonConvert.SerializeObject(list), Sys.Method.SysCacheCategoryEnum.TaskAllocationtSet, "DS8");
await sysCacheService.SetCommonCode(list, Sys.Method.SysCacheCategoryEnum.TaskAllocationtSet, "DS8");
}
return DataResult<List<TaskAllocationtSetDto>>.Success(list);

@ -1395,7 +1395,7 @@ namespace DS.WMS.Core.TaskPlat.Method
else if (bcTaskInfo.TASK_TYPE == TaskBaseTypeEnum.BC_MODIFY.ToString())
{
//CMA没有变更附件所以转发邮件时默认用原文件转发
if (bcTaskInfo.CARRIER_ID.Equals("CMA", StringComparison.OrdinalIgnoreCase))
if (bcTaskInfo.CARRIER_CODE.Equals("CMA", StringComparison.OrdinalIgnoreCase))
{
fileInfo = tenantDb.Queryable<TaskFileInfo>().Where(a => a.TASK_PKID == taskBCInfo.TASK_ID && a.FILE_CATEGORY.Contains("BC_MODIFY"))
.OrderByDescending(a => a.CreateTime).First();

@ -315,7 +315,7 @@ namespace DS.WMS.Core.TaskPlat.Method
/// </summary>
/// <param name="taskIdList">任务Id列表当传入时则只匹配列表中指定的任务</param>
/// <returns>涉及当前登陆人的匹配结果</returns>
public async Task<DataResult<MatchTaskResultDto>> MatchTask(List<long>? taskIdList)
public async Task<DataResult<MatchTaskResultDto>> MatchTask(List<long>? taskIdList = null)
{
MatchTaskResultDto result = new MatchTaskResultDto();
@ -343,7 +343,7 @@ namespace DS.WMS.Core.TaskPlat.Method
}
// 需要查询的订单的提单号的集合,用于一次性将需要查询的订单查询出来;
List<string> waitQuerySeaExportWithMblnoList = new();
HashSet<string> waitQuerySeaExportWithMblnoList = new();
// 后续如果需要查询舱位可以再补充字段如List<string> waitQuerySlotWithMblnoList = new();
@ -352,7 +352,7 @@ namespace DS.WMS.Core.TaskPlat.Method
foreach (var item in taskList)
{
// 查找配置规则
var targetAllotSet = allotSetList.Data.Where(x => x.TaskTypeCode == item.TASK_TYPE && x.CarrierCode == item.CARRIER_ID).OrderBy(x => x.Id).FirstOrDefault();
var targetAllotSet = allotSetList.Data.Where(x => x.TaskTypeCode == item.TASK_TYPE && x.CarrierId == item.CARRIER_ID).OrderBy(x => x.Id).FirstOrDefault();
if (targetAllotSet == null)
{
targetAllotSet = allotSetList.Data.Where(x => x.TaskTypeCode == item.TASK_TYPE).OrderBy(x => x.Id).FirstOrDefault();

@ -32,6 +32,7 @@ namespace DS.WMS.Core.TaskPlat.Method
private readonly ICodeCtnService codeCtnService;
private readonly ICodePortService codePortService;
private readonly IMappingPortService mappingPortService;
private readonly IMappingCarrierService mappingCarrierService;
// 按需构建
@ -42,11 +43,13 @@ namespace DS.WMS.Core.TaskPlat.Method
IWebHostEnvironment environment,
ICodeCtnService codeCtnService,
ICodePortService codePortService,
IMappingPortService mappingPortService) : base(user, logger, saasDbService, serviceProvider, environment)
IMappingPortService mappingPortService,
IMappingCarrierService mappingCarrierService) : base(user, logger, saasDbService, serviceProvider, environment)
{
this.codeCtnService = codeCtnService;
this.codePortService = codePortService;
this.mappingPortService = mappingPortService;
this.mappingCarrierService = mappingCarrierService;
}
#region 对工作流提供的接口
@ -285,7 +288,7 @@ namespace DS.WMS.Core.TaskPlat.Method
MBL_NO = info.Main.MBlNo,
TASK_TYPE = info.Main.TaskType.ToString(),
//TASK_BASE_TYPE = info.Main.TaskType.ToString(),
CARRIER_ID = info.Main.CarrierId?.Trim(),
//CARRIER_ID = info.Main.CarrierId?.Trim(),
//IS_PUBLIC = string.IsNullOrWhiteSpace(info.Main.TaskUserId) ? 1 : 0,
IS_PUBLIC = 1,
BOOK_ORDER_NO = info.Main.BookingOrderNo,
@ -311,6 +314,27 @@ namespace DS.WMS.Core.TaskPlat.Method
taskInfo.TASK_TYPE_NAME = ((TaskBaseTypeEnum)taskTypeTemp).EnumDescription();
}
// 如果船公司主键不为空则直接保存船公司主键、Code、Name等信息
if (info.Main.CarrierPK != null)
{
taskInfo.CARRIER_ID = info.Main.CarrierPK;
taskInfo.CARRIER_CODE = info.Main.CarrierId;
taskInfo.CARRIER_NAME = info.Main.CarrierName;
}
// 如果船公司主键为空但是Code不为空则通过映射查出船公司信息并保存
else if (!string.IsNullOrEmpty(info.Main.CarrierId))
{
// 船公司转换
var allMapCarrierList = (await mappingCarrierService.GetAllList())?.Data ?? new List<MappingCarrierRes>();
MappingCarrierRes? carrierInfo = allMapCarrierList.Where(t => t.MapCode.Equals(info.Main.CarrierId, StringComparison.OrdinalIgnoreCase) && t.Module == MappingModuleConst.CONST_MAPPING_CARRIER_MODULE).FirstOrDefault();
if (carrierInfo != null)
{
taskInfo.CARRIER_ID = carrierInfo.LinkId;
taskInfo.CARRIER_CODE = carrierInfo.MapCode;
taskInfo.CARRIER_NAME = carrierInfo.MapName;
}
}
// 人员字段说明:
// TaskBaseInfo.CreateBy 创建人:谁创建的,只有一个人(可能是某个租户的管理员,因为任务可以由外部(邮件)创建,无法为每个人创建接口授权信息)
// TaskBaseInfo.TASK_REQ_USERID 制单人只有一个人使用任务创建报文中传入的TaskUserId
@ -2126,6 +2150,8 @@ namespace DS.WMS.Core.TaskPlat.Method
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
//await MatchTask();
var userId = long.Parse(user.UserId);
//任务列表分组统计
var groupList = await tenantDb.Queryable<TaskBaseInfo>()

@ -84,5 +84,8 @@
"Url": "http://47.104.73.97:7115/api/TaskDraftCompare/ExcuteDraftCompare",
"ResultUrl": "http://47.104.73.97:7115/api/TaskDraftCompare/DraftCompareResult",
"ReadUrl": "http://47.104.73.97:7115/api/TaskDraftCompare/ExcuteDraftFileRead"
},
"RedisInfo": {
"RedisConfig": "127.0.0.1:6379,password=,defaultDatabase=15"
}
}

Loading…
Cancel
Save