|
|
|
@ -322,7 +322,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
// TaskBaseInfo.TASK_REQ_USERID 制单人:只有一个人,使用任务创建报文中传入的TaskUserId
|
|
|
|
|
// TaskBaseAllocation.UserId 任务关系:任务属于谁,谁能够查看并处理,可能是多个人(可能是多个人一起处理);取值优先级:info.Main.RecvUserInfoList>关联订单
|
|
|
|
|
// TaskBaseInfo.RealUserId 实际操作人:谁实际处理的,只有一个人(但是工作流过来的任务会由多个人处理)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 创建人
|
|
|
|
|
taskInfo.CreateBy = long.Parse(user.UserId);
|
|
|
|
|
taskInfo.CreateUserName = user.UserName;
|
|
|
|
@ -1662,13 +1662,13 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
|
|
|
|
|
// 格式化参数
|
|
|
|
|
TaskBaseTypeEnum? taskType = null;
|
|
|
|
|
if (Enum.TryParse(typeof(TaskBaseTypeEnum), querySearch.OtherQueryCondition?.TaskType, out object? temp))
|
|
|
|
|
if (Enum.TryParse(typeof(TaskBaseTypeEnum), querySearch.OtherQueryCondition.TaskType, out object? temp))
|
|
|
|
|
{
|
|
|
|
|
taskType = (TaskBaseTypeEnum)temp;
|
|
|
|
|
};
|
|
|
|
|
TaskStatLevelEnum? taskStatLevel = null;
|
|
|
|
|
//TaskStatLevelEnum? taskStatLevel = TaskStatLevelEnum.PUBLIC;
|
|
|
|
|
if (Enum.TryParse(typeof(TaskStatLevelEnum), querySearch.OtherQueryCondition?.TaskCategory, out object? tempStat))
|
|
|
|
|
if (Enum.TryParse(typeof(TaskStatLevelEnum), querySearch.OtherQueryCondition.TaskCategory, out object? tempStat))
|
|
|
|
|
{
|
|
|
|
|
taskStatLevel = (TaskStatLevelEnum)tempStat;
|
|
|
|
|
}
|
|
|
|
@ -1688,7 +1688,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
.LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
|
|
|
|
|
.LeftJoin<TaskBCInfo>((t, a, bc) => t.Id == bc.TASK_ID);
|
|
|
|
|
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition!.Status, userId);
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
|
|
|
|
|
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
@ -1781,7 +1781,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
|
|
|
|
|
.LeftJoin<TaskSiSubmitted>((t, a, bc) => t.Id == bc.TASK_ID);
|
|
|
|
|
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition!.Status, userId);
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
|
|
|
|
|
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
@ -1838,7 +1838,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
|
|
|
|
|
.LeftJoin<TaskPerBillBase>((t, a, bc) => t.Id == bc.TASK_PKID);
|
|
|
|
|
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition!.Status, userId);
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
|
|
|
|
|
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
@ -1865,7 +1865,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
|
|
|
|
|
.LeftJoin<TaskTruck>((t, a, bc) => t.Id == bc.TASK_ID);
|
|
|
|
|
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition!.Status, userId);
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
|
|
|
|
|
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
@ -1933,7 +1933,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
|
|
|
|
|
.LeftJoin<TaskCutDateChangeInfo>((t, a, bc) => t.Id == bc.TASK_ID);
|
|
|
|
|
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition!.Status, userId);
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
|
|
|
|
|
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
@ -1956,7 +1956,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
|
|
|
|
|
.LeftJoin<TaskRollingNomination>((t, a, bc) => t.Id == bc.TASK_ID);
|
|
|
|
|
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition!.Status, userId);
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
|
|
|
|
|
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
@ -1976,8 +1976,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
//bc.REMARK,
|
|
|
|
|
bc.TASK_BATCH_TOTAL,
|
|
|
|
|
bc.TASK_BATCH_PER_TOTAL
|
|
|
|
|
})
|
|
|
|
|
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
|
|
|
|
|
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
case TaskBaseTypeEnum.DRAFT:
|
|
|
|
@ -1985,7 +1984,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
|
|
|
|
|
.LeftJoin<TaskDraftInfo>((t, a, bc) => t.Id == bc.TASK_ID);
|
|
|
|
|
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition!.Status, userId);
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
|
|
|
|
|
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
@ -2001,8 +2000,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
bc.IS_EMAIL_SEND,
|
|
|
|
|
bc.SEND_EMAIL_DATE,
|
|
|
|
|
bc.NOTICE_DATE,
|
|
|
|
|
})
|
|
|
|
|
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
|
|
|
|
|
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
case TaskBaseTypeEnum.POD_DISCHARGE_FULL:
|
|
|
|
@ -2011,7 +2009,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
|
|
|
|
|
.LeftJoin<TaskPodDischargeGateoutFull>((t, a, bc) => t.Id == bc.TASK_ID);
|
|
|
|
|
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition!.Status, userId);
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
|
|
|
|
|
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
@ -2033,7 +2031,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
|
|
|
|
|
.LeftJoin<TaskCautionNotice>((t, a, bc) => t.Id == bc.TASK_ID);
|
|
|
|
|
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition!.Status, userId);
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
|
|
|
|
|
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
@ -2067,7 +2065,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
|
|
|
|
|
.LeftJoin<TaskRouteChangeAdvisory>((t, a, bc) => t.Id == bc.TASK_ID);
|
|
|
|
|
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition!.Status, userId);
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
|
|
|
|
|
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a, bc) => new
|
|
|
|
|
{
|
|
|
|
@ -2101,7 +2099,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
{
|
|
|
|
|
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId);
|
|
|
|
|
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition!.Status, userId);
|
|
|
|
|
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
|
|
|
|
|
|
|
|
|
|
result = await queryable.Select<dynamic>((t, a) => new
|
|
|
|
|
{
|
|
|
|
@ -2183,6 +2181,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
.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 ||
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(querySearch.BusinessNo), (t, a) => t.MBL_NO == querySearch.BusinessNo || t.CUSTOMNER_NO == querySearch.BusinessNo)
|
|
|
|
|
.GroupBy((t, a) => new { t.TASK_TYPE, t.STATUS, a.Status, t.IS_PUBLIC })
|
|
|
|
|
.Select((t, a) => new
|
|
|
|
|
{
|
|
|
|
@ -2644,17 +2643,18 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
List<IConditionalModel>? whereList,
|
|
|
|
|
TaskBaseTypeEnum? taskType,
|
|
|
|
|
TaskStatLevelEnum? taskStatLevel,
|
|
|
|
|
string status,
|
|
|
|
|
QueryTaskManageDto queryTaskManageDto,
|
|
|
|
|
long userId)
|
|
|
|
|
{
|
|
|
|
|
queryable.ClearFilter(typeof(IOrgId))
|
|
|
|
|
.Where(whereList)
|
|
|
|
|
.Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.ToString())
|
|
|
|
|
.WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskType.ToString())
|
|
|
|
|
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == status)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryTaskManageDto.BusinessNo), (t, a) => t.MBL_NO == queryTaskManageDto.BusinessNo || t.CUSTOMNER_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.Status == status)
|
|
|
|
|
&& a.Status == queryTaskManageDto.Status)
|
|
|
|
|
.OrderByDescending(t => t.Id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2665,17 +2665,18 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
List<IConditionalModel>? whereList,
|
|
|
|
|
TaskBaseTypeEnum? taskType,
|
|
|
|
|
TaskStatLevelEnum? taskStatLevel,
|
|
|
|
|
string status,
|
|
|
|
|
QueryTaskManageDto queryTaskManageDto,
|
|
|
|
|
long userId)
|
|
|
|
|
{
|
|
|
|
|
queryable.ClearFilter(typeof(IOrgId))
|
|
|
|
|
.Where(whereList)
|
|
|
|
|
.Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.ToString())
|
|
|
|
|
.WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskType.ToString())
|
|
|
|
|
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == status)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryTaskManageDto.BusinessNo), (t, a) => t.MBL_NO == queryTaskManageDto.BusinessNo || t.CUSTOMNER_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.Status == status)
|
|
|
|
|
&& a.Status == queryTaskManageDto.Status)
|
|
|
|
|
.OrderByDescending(t => t.Id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|