任务台台账查询支持提单号及委托编号

usertest
zhangxiaofeng 3 months ago
parent ed40e478c6
commit 4f1d23c371

@ -5,6 +5,11 @@
/// </summary> /// </summary>
public sealed class QueryTaskManageDto public sealed class QueryTaskManageDto
{ {
/// <summary>
/// 业务编号(提单号或委托编号)
/// </summary>
public string BusinessNo { get; set; }
/// <summary> /// <summary>
/// 提单号 /// 提单号
/// </summary> /// </summary>

@ -6,5 +6,11 @@
/// 查询条件 /// 查询条件
/// </summary> /// </summary>
public string QueryCondition { get; set; } = string.Empty; public string QueryCondition { get; set; } = string.Empty;
/// <summary>
/// 业务编号(提单号或委托编号)
/// </summary>
public string BusinessNo { get; set; }
} }
} }

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

@ -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>D:\Code\ds8-solution-pro\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>

Loading…
Cancel
Save