|
|
@ -14,6 +14,7 @@ using Microsoft.Extensions.Logging;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using SqlSugar;
|
|
|
|
using SqlSugar;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -143,7 +144,8 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
MBL_NO = info.Main.MBlNo,
|
|
|
|
MBL_NO = info.Main.MBlNo,
|
|
|
|
TASK_BASE_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 = string.IsNullOrWhiteSpace(info.Main.TaskUserId) ? 1 : 0,
|
|
|
|
|
|
|
|
IS_PUBLIC = 1,
|
|
|
|
BOOK_ORDER_NO = info.Main.BookingOrderNo,
|
|
|
|
BOOK_ORDER_NO = info.Main.BookingOrderNo,
|
|
|
|
OUT_BUSI_NO = $"{info.Head.SenderId}_{info.Head.GID}",
|
|
|
|
OUT_BUSI_NO = $"{info.Head.SenderId}_{info.Head.GID}",
|
|
|
|
TASK_TITLE = info.Main.TaskTitle,
|
|
|
|
TASK_TITLE = info.Main.TaskTitle,
|
|
|
@ -166,7 +168,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
// 人员字段说明:
|
|
|
|
// 人员字段说明:
|
|
|
|
// TaskBaseInfo.CreateBy 创建人:谁创建的,只有一个人(可能是某个租户的管理员,因为任务可以由外部(邮件)创建,无法为每个人创建接口授权信息)
|
|
|
|
// TaskBaseInfo.CreateBy 创建人:谁创建的,只有一个人(可能是某个租户的管理员,因为任务可以由外部(邮件)创建,无法为每个人创建接口授权信息)
|
|
|
|
// TaskBaseInfo.TASK_REQ_USERID 制单人:只有一个人,使用任务创建报文中传入的TaskUserId
|
|
|
|
// TaskBaseInfo.TASK_REQ_USERID 制单人:只有一个人,使用任务创建报文中传入的TaskUserId
|
|
|
|
// TaskBaseAllocation.UserId 任务关系:任务属于谁,谁能够查看并处理,可能是多个人(可能是多个人一起处理);取值优先级:TaskBaseInfo.TASK_REQ_USERID>关联订单>TaskBaseInfo.CreateBy
|
|
|
|
// TaskBaseAllocation.UserId 任务关系:任务属于谁,谁能够查看并处理,可能是多个人(可能是多个人一起处理);取值优先级:info.Main.RecvUserInfoList>关联订单
|
|
|
|
// TaskBaseInfo.RealUserId 实际操作人:谁实际处理的,只有一个人
|
|
|
|
// TaskBaseInfo.RealUserId 实际操作人:谁实际处理的,只有一个人
|
|
|
|
|
|
|
|
|
|
|
|
// 创建人
|
|
|
|
// 创建人
|
|
|
@ -203,14 +205,20 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
UserName = x.RecvUserName
|
|
|
|
UserName = x.RecvUserName
|
|
|
|
}).ToList();
|
|
|
|
}).ToList();
|
|
|
|
await tenantDb.Insertable(allocationList).ExecuteCommandAsync();
|
|
|
|
await tenantDb.Insertable(allocationList).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 否则判断任务关联订单,如果能关联到,则判断任务设置的角色;如果有设置,则将任务挂载到订单的指定角色上;如果没关联到或者没有设置,则作为公共任务
|
|
|
|
// 否则判断任务关联订单,如果能关联到,则判断任务设置的角色;如果有设置,则将任务挂载到订单的指定角色上;如果没关联到或者没有设置,则作为公共任务
|
|
|
|
else
|
|
|
|
//else
|
|
|
|
{
|
|
|
|
//{
|
|
|
|
taskInfo.IS_PUBLIC = 1;
|
|
|
|
// // 1.查找任务的匹配设置
|
|
|
|
//
|
|
|
|
// var allotSet = await tenantDb.Queryable<TaskAllotSet>().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)
|
|
|
|
if (info.Main != null && info.Main.TruckInfo != null && info.Main.TruckInfo.NeedArriveTime.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -658,6 +666,128 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 任务台台账列表查询
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public async Task<DataResult<List<dynamic>>> GetPageAsync(PageRequest<QueryTaskManageDto> querySearch)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//序列化查询条件
|
|
|
|
|
|
|
|
List<IConditionalModel>? 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<TaskBaseInfo>()
|
|
|
|
|
|
|
|
.LeftJoin<TaskBCInfo>((t, bc) => t.Id == bc.TASK_ID)
|
|
|
|
|
|
|
|
.Where(whereList)
|
|
|
|
|
|
|
|
.Select<dynamic>((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,
|
|
|
|
|
|
|
|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_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<TaskBaseInfo>()
|
|
|
|
|
|
|
|
.Where(whereList)
|
|
|
|
|
|
|
|
.Select<dynamic>(t => new
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Id = t.Id.SelectAll()
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.ToQueryPageAsync(querySearch.PageCondition);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 私有方法
|
|
|
|
#region 私有方法
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|