|
|
@ -2077,7 +2077,9 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
bc.PROCESS_DATE,
|
|
|
|
bc.PROCESS_DATE,
|
|
|
|
bc.PRICE_CALCULATION_DATE
|
|
|
|
bc.PRICE_CALCULATION_DATE
|
|
|
|
}).Distinct();
|
|
|
|
}).Distinct();
|
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
var sql = queryableTemp.ToSqlString();
|
|
|
|
var sql = queryableTemp.ToSqlString();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
result = await queryableTemp.ToQueryPageAsync(querySearch.PageCondition);
|
|
|
|
result = await queryableTemp.ToQueryPageAsync(querySearch.PageCondition);
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
@ -2620,9 +2622,9 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
|
|
|
|
|
|
|
s.CntrTotal,
|
|
|
|
s.CntrTotal,
|
|
|
|
}).Distinct();
|
|
|
|
}).Distinct();
|
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
var sql = queryableTemp.ToSqlString();
|
|
|
|
var sql = queryableTemp.ToSqlString();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
result = await queryableTemp.ToQueryPageAsync(querySearch.PageCondition);
|
|
|
|
result = await queryableTemp.ToQueryPageAsync(querySearch.PageCondition);
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
@ -2723,21 +2725,28 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
var taskTypeStr = taskType.ToString();
|
|
|
|
var taskTypeStr = taskType.ToString();
|
|
|
|
var taskStatusStr = TaskStatusEnum.Cancel.ToString();
|
|
|
|
var taskStatusStr = TaskStatusEnum.Cancel.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
long? parentId = null;
|
|
|
|
List<long>? orderParentIdList = null;
|
|
|
|
if (!string.IsNullOrEmpty(queryDto.BusinessNo))
|
|
|
|
if (!string.IsNullOrEmpty(queryDto.BusinessNo))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var parentIdTemp = await queryable.Context.Queryable<SeaExport>().ClearFilter(typeof(IOrgId)).Where(x => x.HBLNO == queryDto.BusinessNo).Select(x => x.ParentId).FirstAsync();
|
|
|
|
orderParentIdList = (await queryable.Context.Queryable<SeaExport>()
|
|
|
|
parentId = parentIdTemp == 0 ? null : parentIdTemp;
|
|
|
|
.ClearFilter(typeof(IOrgId))
|
|
|
|
|
|
|
|
.Where(x => x.ParentId != 0 && x.HBLNO.Contains(queryDto.BusinessNo))
|
|
|
|
|
|
|
|
.Select(x => x.ParentId)
|
|
|
|
|
|
|
|
.ToListAsync())
|
|
|
|
|
|
|
|
.Distinct().ToList(); ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var isHasOrderParentIdList = orderParentIdList != null;
|
|
|
|
|
|
|
|
|
|
|
|
queryable.Where(whereList)
|
|
|
|
queryable.Where(whereList)
|
|
|
|
.Where((t, a) => t.STATUS != taskStatusStr && t.Deleted == false)
|
|
|
|
.Where((t, a) => t.STATUS != taskStatusStr && t.Deleted == false)
|
|
|
|
.WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskTypeStr)
|
|
|
|
.WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskTypeStr)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.BusinessNo), (t, a, bc, s) => ((t.MBL_NO != null && queryDto.BusinessNo == t.MBL_NO) || (s.MBLNO != null && queryDto.BusinessNo == s.MBLNO))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.BusinessNo), (t, a, bc, s) => ((!string.IsNullOrEmpty(s.MBLNO) && s.MBLNO.Contains(queryDto.BusinessNo)) || (string.IsNullOrEmpty(s.MBLNO) && t.MBL_NO.Contains(queryDto.BusinessNo))) // 如果订单提单号不为空使用订单提单号查询,否则使用任务上的提单号查询
|
|
|
|
|| queryDto.BusinessNo == s.CustomerNo
|
|
|
|
|| s.CustomerNo.Contains(queryDto.BusinessNo)
|
|
|
|
|| queryDto.BusinessNo == s.BookingNo
|
|
|
|
|| s.BookingNo.Contains(queryDto.BusinessNo)
|
|
|
|
|| queryDto.BusinessNo == s.CustomerNum
|
|
|
|
|| s.CustomerNum.Contains(queryDto.BusinessNo)
|
|
|
|
|| (parentId != null && s.Id == parentId))
|
|
|
|
|| t.TASK_NO.Contains(queryDto.BusinessNo)
|
|
|
|
|
|
|
|
|| (isHasOrderParentIdList == true && orderParentIdList!.Contains(s.Id)))
|
|
|
|
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == queryDto.Status)
|
|
|
|
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == queryDto.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 只显示自己需要审批的任务,自己创建的任务不显示,所以去掉t.CreateBy == userId ||
|
|
|
|
&& (a.UserId == userId) // 2024-8-14 只显示自己需要审批的任务,自己创建的任务不显示,所以去掉t.CreateBy == userId ||
|
|
|
@ -2787,25 +2796,31 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
var userId = long.Parse(user.UserId);
|
|
|
|
var userId = long.Parse(user.UserId);
|
|
|
|
|
|
|
|
|
|
|
|
queryable.ClearFilter(typeof(IOrgId));
|
|
|
|
queryable.ClearFilter(typeof(IOrgId));
|
|
|
|
long? parentId = null;
|
|
|
|
List<long>? orderParentIdList = null;
|
|
|
|
|
|
|
|
|
|
|
|
var taskTypeStr = taskType.ToString();
|
|
|
|
var taskTypeStr = taskType.ToString();
|
|
|
|
var taskStatusStr = TaskStatusEnum.Cancel.ToString();
|
|
|
|
var taskStatusStr = TaskStatusEnum.Cancel.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(queryDto.BusinessNo))
|
|
|
|
if (!string.IsNullOrEmpty(queryDto.BusinessNo))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var parentIdTemp = await queryable.Context.Queryable<SeaExport>().ClearFilter(typeof(IOrgId)).Where(x => x.HBLNO == queryDto.BusinessNo).Select(x => x.ParentId).FirstAsync();
|
|
|
|
orderParentIdList = (await queryable.Context.Queryable<SeaExport>()
|
|
|
|
parentId = parentIdTemp == 0 ? null : parentIdTemp;
|
|
|
|
.ClearFilter(typeof(IOrgId))
|
|
|
|
|
|
|
|
.Where(x => x.ParentId != 0 && x.HBLNO.Contains(queryDto.BusinessNo))
|
|
|
|
|
|
|
|
.Select(x => x.ParentId)
|
|
|
|
|
|
|
|
.ToListAsync())
|
|
|
|
|
|
|
|
.Distinct().ToList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var isHasOrderParentIdList = orderParentIdList != null;
|
|
|
|
|
|
|
|
|
|
|
|
queryable.Where(whereList)
|
|
|
|
queryable.Where(whereList)
|
|
|
|
.Where((t, a) => t.STATUS != taskStatusStr && t.Deleted == false)
|
|
|
|
.Where((t, a) => t.STATUS != taskStatusStr && t.Deleted == false)
|
|
|
|
.WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskTypeStr)
|
|
|
|
.WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskTypeStr)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.BusinessNo), (t, a, s) => ((!string.IsNullOrEmpty(s.MBLNO) && queryDto.BusinessNo == s.MBLNO) || (string.IsNullOrEmpty(s.MBLNO) && queryDto.BusinessNo == t.MBL_NO))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.BusinessNo), (t, a, s) => ((!string.IsNullOrEmpty(s.MBLNO) && s.MBLNO.Contains(queryDto.BusinessNo)) || (string.IsNullOrEmpty(s.MBLNO) && t.MBL_NO.Contains(queryDto.BusinessNo))) // 如果订单提单号不为空使用订单提单号查询,否则使用任务上的提单号查询
|
|
|
|
|| queryDto.BusinessNo == s.CustomerNo
|
|
|
|
|| s.CustomerNo.Contains(queryDto.BusinessNo)
|
|
|
|
|| queryDto.BusinessNo == s.CustomerNum
|
|
|
|
|| s.CustomerNum.Contains(queryDto.BusinessNo)
|
|
|
|
|| queryDto.BusinessNo == s.BookingNo
|
|
|
|
|| s.BookingNo.Contains(queryDto.BusinessNo)
|
|
|
|
|| (parentId != null && s.Id == parentId))
|
|
|
|
|| t.TASK_NO.Contains(queryDto.BusinessNo)
|
|
|
|
|
|
|
|
|| (isHasOrderParentIdList == true && orderParentIdList!.Contains(s.Id)))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.PortLoadCode), (t, a, s) => queryDto.PortLoadCode == s.LoadPortCode)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.PortLoadCode), (t, a, s) => queryDto.PortLoadCode == s.LoadPortCode)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.PortDischargeCode), (t, a, s) => queryDto.PortDischargeCode == s.DischargePortCode)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.PortDischargeCode), (t, a, s) => queryDto.PortDischargeCode == s.DischargePortCode)
|
|
|
|
|
|
|
|
|
|
|
@ -2913,12 +2928,17 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
|
|
|
|
|
|
|
var userId = long.Parse(user.UserId);
|
|
|
|
var userId = long.Parse(user.UserId);
|
|
|
|
var cancelStr = TaskStatusEnum.Cancel.ToString();
|
|
|
|
var cancelStr = TaskStatusEnum.Cancel.ToString();
|
|
|
|
long? parentId = null;
|
|
|
|
List<long>? orderParentIdList = null;
|
|
|
|
if (!string.IsNullOrEmpty(queryDto.OtherQueryCondition.BusinessNo))
|
|
|
|
if (!string.IsNullOrEmpty(queryDto.OtherQueryCondition.BusinessNo))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var parentIdTemp = await tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId)).Where(x => x.HBLNO == queryDto.OtherQueryCondition.BusinessNo).Select(x => x.ParentId).FirstAsync();
|
|
|
|
orderParentIdList = (await tenantDb.Queryable<SeaExport>()
|
|
|
|
parentId = parentIdTemp == 0 ? null : parentIdTemp;
|
|
|
|
.ClearFilter(typeof(IOrgId))
|
|
|
|
|
|
|
|
.Where(x => x.ParentId != 0 && x.HBLNO.Contains(queryDto.OtherQueryCondition.BusinessNo))
|
|
|
|
|
|
|
|
.Select(x => x.ParentId)
|
|
|
|
|
|
|
|
.ToListAsync())
|
|
|
|
|
|
|
|
.Distinct().ToList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var isHasOrderParentIdList = orderParentIdList != null;
|
|
|
|
|
|
|
|
|
|
|
|
long[]? portLoadTaskIdList = [];
|
|
|
|
long[]? portLoadTaskIdList = [];
|
|
|
|
if (!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortLoadCode))
|
|
|
|
if (!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortLoadCode))
|
|
|
@ -2974,11 +2994,12 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
.LeftJoin<SeaExport>((a, t, s) => t.OUT_BS_NO == s.Id)
|
|
|
|
.LeftJoin<SeaExport>((a, t, s) => t.OUT_BS_NO == s.Id)
|
|
|
|
.Where(whereList)
|
|
|
|
.Where(whereList)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.BusinessNo),
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.BusinessNo),
|
|
|
|
(a, t, s) => ((!string.IsNullOrEmpty(s.MBLNO) && queryDto.OtherQueryCondition.BusinessNo == s.MBLNO) || (string.IsNullOrEmpty(s.MBLNO) && queryDto.OtherQueryCondition.BusinessNo == t.MBL_NO))
|
|
|
|
(a, t, s) => ((!string.IsNullOrEmpty(s.MBLNO) && s.MBLNO.Contains(queryDto.OtherQueryCondition.BusinessNo)) || (string.IsNullOrEmpty(s.MBLNO) && t.MBL_NO.Contains(queryDto.OtherQueryCondition.BusinessNo))) // 如果订单提单号不为空使用订单提单号查询,否则使用任务上的提单号查询
|
|
|
|
|| queryDto.OtherQueryCondition.BusinessNo == s.CustomerNo
|
|
|
|
|| s.CustomerNo.Contains(queryDto.OtherQueryCondition.BusinessNo)
|
|
|
|
|| queryDto.OtherQueryCondition.BusinessNo == s.BookingNo
|
|
|
|
|| s.BookingNo.Contains(queryDto.OtherQueryCondition.BusinessNo)
|
|
|
|
|| queryDto.OtherQueryCondition.BusinessNo == s.CustomerNum
|
|
|
|
|| s.CustomerNum.Contains(queryDto.OtherQueryCondition.BusinessNo)
|
|
|
|
|| (parentId != null && s.Id == parentId))
|
|
|
|
|| t.TASK_NO.Contains(queryDto.OtherQueryCondition.BusinessNo)
|
|
|
|
|
|
|
|
|| (isHasOrderParentIdList == true && orderParentIdList!.Contains(s.Id)))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortLoadCode), (t, a, s) => queryDto.OtherQueryCondition.PortLoadCode == s.LoadPortCode || portLoadTaskIdList.Contains(t.Id))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortLoadCode), (t, a, s) => queryDto.OtherQueryCondition.PortLoadCode == s.LoadPortCode || portLoadTaskIdList.Contains(t.Id))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortDischargeCode), (t, a, s) => queryDto.OtherQueryCondition.PortDischargeCode == s.DischargePortCode || portDischargeTaskIdList.Contains(t.Id))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortDischargeCode), (t, a, s) => queryDto.OtherQueryCondition.PortDischargeCode == s.DischargePortCode || portDischargeTaskIdList.Contains(t.Id))
|
|
|
|
.GroupBy((a, t) => new { t.TASK_TYPE, t.STATUS, a.Status, })
|
|
|
|
.GroupBy((a, t) => new { t.TASK_TYPE, t.STATUS, a.Status, })
|
|
|
@ -2989,7 +3010,9 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
TStatus = t.STATUS,
|
|
|
|
TStatus = t.STATUS,
|
|
|
|
AStatus = a.Status
|
|
|
|
AStatus = a.Status
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
var sql2 = underlingQueryable.ToSqlString();
|
|
|
|
var sql2 = underlingQueryable.ToSqlString();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
underlingGroupList = await underlingQueryable.ToListAsync();
|
|
|
|
underlingGroupList = await underlingQueryable.ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
#region 下属
|
|
|
|
#region 下属
|
|
|
@ -3069,16 +3092,16 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
.LeftJoin<SeaExport>((t, a, s) => t.OUT_BS_NO == s.Id)
|
|
|
|
.LeftJoin<SeaExport>((t, a, s) => t.OUT_BS_NO == s.Id)
|
|
|
|
.Where(whereList)
|
|
|
|
.Where(whereList)
|
|
|
|
.Where((t, a) => t.STATUS != cancelStr && t.Deleted == false)
|
|
|
|
.Where((t, a) => t.STATUS != cancelStr && t.Deleted == false)
|
|
|
|
.Where((t, a) => t.IS_PUBLIC == 1 || (t.IS_PUBLIC == 0 && a.Status != null && (a.UserId == userId))) // 2024-8-14 只显示自己需要审批的任务,自己创建的任务不显示,所以去掉t.CreateBy == userId ||
|
|
|
|
.Where((t, a) => t.IS_PUBLIC == 1 || (t.IS_PUBLIC == 0 && a.UserId == userId)) // 2024-8-14 只显示自己需要审批的任务,自己创建的任务不显示,所以去掉t.CreateBy == userId ||
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.BusinessNo),
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.BusinessNo),
|
|
|
|
(t, a, s) => ((!string.IsNullOrEmpty(s.MBLNO) && queryDto.OtherQueryCondition.BusinessNo == s.MBLNO) || (string.IsNullOrEmpty(s.MBLNO) && queryDto.OtherQueryCondition.BusinessNo == t.MBL_NO))
|
|
|
|
(t, a, s) => ((!string.IsNullOrEmpty(s.MBLNO) && s.MBLNO.Contains(queryDto.OtherQueryCondition.BusinessNo)) || (string.IsNullOrEmpty(s.MBLNO) && t.MBL_NO.Contains(queryDto.OtherQueryCondition.BusinessNo))) // 如果订单提单号不为空使用订单提单号查询,否则使用任务上的提单号查询
|
|
|
|
|| queryDto.OtherQueryCondition.BusinessNo == s.CustomerNo
|
|
|
|
|| s.CustomerNo.Contains(queryDto.OtherQueryCondition.BusinessNo)
|
|
|
|
|| queryDto.OtherQueryCondition.BusinessNo == s.BookingNo
|
|
|
|
|| s.BookingNo.Contains(queryDto.OtherQueryCondition.BusinessNo)
|
|
|
|
|| queryDto.OtherQueryCondition.BusinessNo == s.CustomerNum
|
|
|
|
|| s.CustomerNum.Contains(queryDto.OtherQueryCondition.BusinessNo)
|
|
|
|
|| (parentId != null && s.Id == parentId))
|
|
|
|
|| t.TASK_NO.Contains(queryDto.OtherQueryCondition.BusinessNo)
|
|
|
|
|
|
|
|
|| (isHasOrderParentIdList == true && orderParentIdList!.Contains(s.Id)))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortLoadCode), (t, a, s) => queryDto.OtherQueryCondition.PortLoadCode == s.LoadPortCode || portLoadTaskIdList.Contains(t.Id))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortLoadCode), (t, a, s) => queryDto.OtherQueryCondition.PortLoadCode == s.LoadPortCode || portLoadTaskIdList.Contains(t.Id))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortDischargeCode), (t, a, s) => queryDto.OtherQueryCondition.PortDischargeCode == s.DischargePortCode || portDischargeTaskIdList.Contains(t.Id))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortDischargeCode), (t, a, s) => queryDto.OtherQueryCondition.PortDischargeCode == s.DischargePortCode || portDischargeTaskIdList.Contains(t.Id))
|
|
|
|
|
|
|
|
|
|
|
|
.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 TaskGroupTotal()
|
|
|
|
.Select((t, a) => new TaskGroupTotal()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -3089,8 +3112,9 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
//IsExcept = t.IS_EXCEPT,
|
|
|
|
//IsExcept = t.IS_EXCEPT,
|
|
|
|
IsPublic = t.IS_PUBLIC
|
|
|
|
IsPublic = t.IS_PUBLIC
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
var sql = queryable.ToSqlString();
|
|
|
|
var sql = queryable.ToSqlString();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
var groupList = await queryable.ToListAsync();
|
|
|
|
var groupList = await queryable.ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
//var exceptList = groupList
|
|
|
|
//var exceptList = groupList
|
|
|
|