|
|
|
@ -1716,9 +1716,10 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
//throw new ArgumentException("TaskCategory");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var userId = long.Parse(user.UserId);
|
|
|
|
|
DataResult<List<dynamic>> result;
|
|
|
|
|
DataResult<List<dynamic>> result = new();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
switch (taskType)
|
|
|
|
|
{
|
|
|
|
|
case TaskBaseTypeEnum.BC:
|
|
|
|
@ -1732,9 +1733,6 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
|
Id = t.Id.SelectAll(),
|
|
|
|
|
TASK_USER_STATUS = a.Status,
|
|
|
|
|
TASK_USER_STATUS_NAME = a.StatusName,
|
|
|
|
|
TASK_USER_STATUS_TIME = a.StatusTime,
|
|
|
|
|
bc.BUSI_TYPE,
|
|
|
|
|
bc.SHIPPER,
|
|
|
|
|
bc.CONSIGNEE,
|
|
|
|
@ -1825,9 +1823,6 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
|
PK_ID = t.Id.SelectAll(),
|
|
|
|
|
TASK_USER_STATUS = a.Status,
|
|
|
|
|
TASK_USER_STATUS_NAME = a.StatusName,
|
|
|
|
|
TASK_USER_STATUS_TIME = a.StatusTime,
|
|
|
|
|
bc.CARRIER,
|
|
|
|
|
//bc.MBL_NO,
|
|
|
|
|
bc.TAKE_ISSUETYPE_NAME,
|
|
|
|
@ -1882,9 +1877,6 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
|
PK_ID = t.Id.SelectAll(),
|
|
|
|
|
TASK_USER_STATUS = a.Status,
|
|
|
|
|
TASK_USER_STATUS_NAME = a.StatusName,
|
|
|
|
|
TASK_USER_STATUS_TIME = a.StatusTime,
|
|
|
|
|
bc.TASK_PKID,
|
|
|
|
|
//bc.MBL_NO,
|
|
|
|
|
bc.INVOICE_NO,
|
|
|
|
@ -1909,9 +1901,6 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
|
PK_ID = t.Id.SelectAll(),
|
|
|
|
|
TASK_USER_STATUS = a.Status,
|
|
|
|
|
TASK_USER_STATUS_NAME = a.StatusName,
|
|
|
|
|
TASK_USER_STATUS_TIME = a.StatusTime,
|
|
|
|
|
bc.TASK_ID,
|
|
|
|
|
bc.BookingTruckId,
|
|
|
|
|
bc.BookingId,
|
|
|
|
@ -1977,9 +1966,6 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
|
PK_ID = t.Id.SelectAll(),
|
|
|
|
|
TASK_USER_STATUS = a.Status,
|
|
|
|
|
TASK_USER_STATUS_NAME = a.StatusName,
|
|
|
|
|
TASK_USER_STATUS_TIME = a.StatusTime,
|
|
|
|
|
bc.TASK_ID,
|
|
|
|
|
bc.CARRIER,
|
|
|
|
|
bc.VESSEL,
|
|
|
|
@ -2000,9 +1986,6 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
|
PK_ID = t.Id.SelectAll(),
|
|
|
|
|
TASK_USER_STATUS = a.Status,
|
|
|
|
|
TASK_USER_STATUS_NAME = a.StatusName,
|
|
|
|
|
TASK_USER_STATUS_TIME = a.StatusTime,
|
|
|
|
|
bc.TASK_ID,
|
|
|
|
|
bc.PLAN_TYPE,
|
|
|
|
|
bc.BATCH_NO,
|
|
|
|
@ -2028,9 +2011,6 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
|
PK_ID = t.Id.SelectAll(),
|
|
|
|
|
TASK_USER_STATUS = a.Status,
|
|
|
|
|
TASK_USER_STATUS_NAME = a.StatusName,
|
|
|
|
|
TASK_USER_STATUS_TIME = a.StatusTime,
|
|
|
|
|
bc.TASK_ID,
|
|
|
|
|
bc.CARRIER,
|
|
|
|
|
//bc.MBL_NO,
|
|
|
|
@ -2053,9 +2033,6 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
|
PK_ID = t.Id.SelectAll(),
|
|
|
|
|
TASK_USER_STATUS = a.Status,
|
|
|
|
|
TASK_USER_STATUS_NAME = a.StatusName,
|
|
|
|
|
TASK_USER_STATUS_TIME = a.StatusTime,
|
|
|
|
|
bc.TASK_ID,
|
|
|
|
|
bc.CARRIER,
|
|
|
|
|
bc.NOTICE_TYPE,
|
|
|
|
@ -2075,9 +2052,6 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
|
PK_ID = t.Id.SelectAll(),
|
|
|
|
|
TASK_USER_STATUS = a.Status,
|
|
|
|
|
TASK_USER_STATUS_NAME = a.StatusName,
|
|
|
|
|
TASK_USER_STATUS_TIME = a.StatusTime,
|
|
|
|
|
bc.TASK_ID,
|
|
|
|
|
bc.SOURCE_SYSTEM,
|
|
|
|
|
bc.SOURCE_BUSI_TYPE,
|
|
|
|
@ -2109,9 +2083,6 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
|
PK_ID = t.Id.SelectAll(),
|
|
|
|
|
TASK_USER_STATUS = a.Status,
|
|
|
|
|
TASK_USER_STATUS_NAME = a.StatusName,
|
|
|
|
|
TASK_USER_STATUS_TIME = a.StatusTime,
|
|
|
|
|
bc.TASK_ID,
|
|
|
|
|
bc.VESSEL,
|
|
|
|
|
bc.VOYNO,
|
|
|
|
@ -2143,16 +2114,60 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a) => new
|
|
|
|
|
{
|
|
|
|
|
PK_ID = t.Id.SelectAll(),
|
|
|
|
|
TASK_USER_STATUS = a.Status,
|
|
|
|
|
TASK_USER_STATUS_NAME = a.StatusName,
|
|
|
|
|
TASK_USER_STATUS_TIME = a.StatusTime
|
|
|
|
|
//TASK_USER_STATUS = a.Status,
|
|
|
|
|
//TASK_USER_STATUS_NAME = a.StatusName,
|
|
|
|
|
//TASK_USER_STATUS_TIME = a.StatusTime
|
|
|
|
|
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
if (result.Data?.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
var taskIdList = result.Data.Select(x => (long)x.Id).ToList();
|
|
|
|
|
|
|
|
|
|
var allRecvUserList = await tenantDb.Queryable<TaskBaseAllocation>()
|
|
|
|
|
.Where(x => taskIdList.Contains(x.TaskId))
|
|
|
|
|
.Select(x => new RecvUserInfo()
|
|
|
|
|
{
|
|
|
|
|
TaskId = x.TaskId,
|
|
|
|
|
RecvUserId = x.UserId,
|
|
|
|
|
RecvUserName = x.UserName,
|
|
|
|
|
RecvUserStatus = x.Status,
|
|
|
|
|
RecvUserStatusName = x.StatusName,
|
|
|
|
|
RecvUserStatusTime = x.StatusTime
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
if (allRecvUserList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in result.Data)
|
|
|
|
|
{
|
|
|
|
|
var recvUserList = allRecvUserList.Where(x => x.TaskId == item.Id).ToList();
|
|
|
|
|
|
|
|
|
|
var currentUserStatus = recvUserList.FirstOrDefault(x => x.RecvUserId == userId);
|
|
|
|
|
if (currentUserStatus != null)
|
|
|
|
|
{
|
|
|
|
|
var n = recvUserList.IndexOf(currentUserStatus);
|
|
|
|
|
if (n != 0)
|
|
|
|
|
{
|
|
|
|
|
recvUserList.RemoveAt(n);
|
|
|
|
|
recvUserList.Insert(0, currentUserStatus);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
item.TASK_USER_STATUS = currentUserStatus.RecvUserStatus;
|
|
|
|
|
item.TASK_USER_STATUS_NAME = currentUserStatus.RecvUserStatusName;
|
|
|
|
|
item.TASK_USER_STATUS_TIME = currentUserStatus.RecvUserStatusTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
item.RecvUserList = recvUserList;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取登陆人相关的任务统计信息
|
|
|
|
|
/// </summary>
|
|
|
|
@ -2212,7 +2227,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
.LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
|
|
|
|
|
.Where(whereList)
|
|
|
|
|
.Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.ToString())
|
|
|
|
|
.Where((t, a) => t.IS_PUBLIC == 1 || (t.IS_PUBLIC == 0 && a.Status != null && (a.UserId == userId))) // 2024-8-14 boss提出只显示自己需要审批的任务,自己创建的任务不显示,所以去掉t.CreateBy == userId ||
|
|
|
|
|
.Where((t, a) => t.IS_PUBLIC == 1 || (t.IS_PUBLIC == 0 && a.Status != null && (a.UserId == userId))) // 2024-8-14 只显示自己需要审批的任务,自己创建的任务不显示,所以去掉t.CreateBy == userId ||
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(querySearch.BusinessNo), (t, a) => t.MBL_NO == querySearch.BusinessNo || t.CUSTOMER_NO == querySearch.BusinessNo)
|
|
|
|
|
.GroupBy((t, a) => new { t.TASK_TYPE, t.STATUS, a.Status, t.IS_PUBLIC })
|
|
|
|
|
.Select((t, a) => new
|
|
|
|
@ -2685,7 +2700,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryTaskManageDto.BusinessNo), (t, a) => t.MBL_NO == queryTaskManageDto.BusinessNo || t.CUSTOMER_NO == queryTaskManageDto.BusinessNo)
|
|
|
|
|
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == queryTaskManageDto.Status)
|
|
|
|
|
.WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0
|
|
|
|
|
&& (a.UserId == userId) // 2024-8-14 boss提出只显示自己需要审批的任务,自己创建的任务不显示,所以去掉t.CreateBy == userId ||
|
|
|
|
|
&& (a.UserId == userId) // 2024-8-14 只显示自己需要审批的任务,自己创建的任务不显示,所以去掉t.CreateBy == userId ||
|
|
|
|
|
&& a.Status == queryTaskManageDto.Status)
|
|
|
|
|
.OrderByDescending(t => t.Id);
|
|
|
|
|
}
|
|
|
|
@ -2707,7 +2722,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryTaskManageDto.BusinessNo), (t, a) => t.MBL_NO == queryTaskManageDto.BusinessNo || t.CUSTOMER_NO == queryTaskManageDto.BusinessNo)
|
|
|
|
|
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == queryTaskManageDto.Status)
|
|
|
|
|
.WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0
|
|
|
|
|
&& (a.UserId == userId) // 2024-8-14 boss提出只显示自己需要审批的任务,自己创建的任务不显示,所以去掉t.CreateBy == userId ||
|
|
|
|
|
&& (a.UserId == userId) // 2024-8-14 只显示自己需要审批的任务,自己创建的任务不显示,所以去掉t.CreateBy == userId ||
|
|
|
|
|
&& a.Status == queryTaskManageDto.Status)
|
|
|
|
|
.OrderByDescending(t => t.Id);
|
|
|
|
|
}
|
|
|
|
|