|
@@ -1179,17 +1179,19 @@ public class OrderController : BaseController
|
|
[HttpGet("mayscreen")]
|
|
[HttpGet("mayscreen")]
|
|
public async Task<PagedDto<OrderVisitDetailDto>> MayScreenList([FromQuery] MayScreenListDto dto)
|
|
public async Task<PagedDto<OrderVisitDetailDto>> MayScreenList([FromQuery] MayScreenListDto dto)
|
|
{
|
|
{
|
|
- var query = _orderVisitedDetailRepository.Queryable()
|
|
|
|
|
|
+ var query = _orderVisitedDetailRepository.Queryable(false,true)
|
|
.Includes(x => x.OrderVisit)
|
|
.Includes(x => x.OrderVisit)
|
|
.Includes(x => x.OrderVisit, y => y.Order)
|
|
.Includes(x => x.OrderVisit, y => y.Order)
|
|
.Includes(x => x.OrderVisit, y => y.Employee)
|
|
.Includes(x => x.OrderVisit, y => y.Employee)
|
|
- .Where(x => x.OrderVisit.VisitState != EVisitState.None && x.OrderVisit.IsCanHandle);
|
|
|
|
|
|
+ .LeftJoin<OrderScreen>((x,s)=> x.Id == s.VisitDetailId && (int)s.Status < 2 && s.IsDeleted == false)
|
|
|
|
+ .Where((x,s)=> s.Id == null)
|
|
|
|
+ .Where((x, s) => x.OrderVisit.VisitState != EVisitState.None && x.OrderVisit.IsCanHandle);
|
|
if (_sessionContext.OrgId != null && !_sessionContext.OrgIsCenter)
|
|
if (_sessionContext.OrgId != null && !_sessionContext.OrgIsCenter)
|
|
{
|
|
{
|
|
query.WhereIF(!string.IsNullOrEmpty(dto.Keyword),
|
|
query.WhereIF(!string.IsNullOrEmpty(dto.Keyword),
|
|
- x => x.OrderVisit.Order.Title.Contains(dto.Keyword!) ||
|
|
|
|
- x.OrderVisit.Order.No.Contains(dto.Keyword!))
|
|
|
|
- .Where(x => x.VisitTarget == EVisitTarget.Org && x.VisitOrgCode.StartsWith(_sessionContext.OrgId) && (
|
|
|
|
|
|
+ (x, s) => x.OrderVisit.Order.Title.Contains(dto.Keyword!) ||
|
|
|
|
+ x.OrderVisit.Order.No.Contains(dto.Keyword!))
|
|
|
|
+ .Where((x, s) => x.VisitTarget == EVisitTarget.Org && x.VisitOrgCode.StartsWith(_sessionContext.OrgId) && (
|
|
SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "1" ||
|
|
SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "1" ||
|
|
SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "2" ||
|
|
SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "2" ||
|
|
SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "1" ||
|
|
SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "1" ||
|
|
@@ -1199,9 +1201,9 @@ public class OrderController : BaseController
|
|
else
|
|
else
|
|
{
|
|
{
|
|
query.WhereIF(!string.IsNullOrEmpty(dto.Keyword),
|
|
query.WhereIF(!string.IsNullOrEmpty(dto.Keyword),
|
|
- x => x.OrderVisit.Order.Title.Contains(dto.Keyword!) ||
|
|
|
|
- x.OrderVisit.Order.No.Contains(dto.Keyword!))
|
|
|
|
- .Where(x => x.VisitTarget == EVisitTarget.Org && (
|
|
|
|
|
|
+ (x, s) => x.OrderVisit.Order.Title.Contains(dto.Keyword!) ||
|
|
|
|
+ x.OrderVisit.Order.No.Contains(dto.Keyword!))
|
|
|
|
+ .Where((x, s) => x.VisitTarget == EVisitTarget.Org && (
|
|
SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "1" ||
|
|
SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "1" ||
|
|
SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "2" ||
|
|
SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "2" ||
|
|
SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "1" ||
|
|
SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "1" ||
|
|
@@ -1210,7 +1212,7 @@ public class OrderController : BaseController
|
|
}
|
|
}
|
|
|
|
|
|
var (total, items) = await query
|
|
var (total, items) = await query
|
|
- .OrderBy(x => x.CreationTime)
|
|
|
|
|
|
+ .OrderBy((x, s) => x.CreationTime)
|
|
.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
return new PagedDto<OrderVisitDetailDto>(total, _mapper.Map<IReadOnlyList<OrderVisitDetailDto>>(items));
|
|
return new PagedDto<OrderVisitDetailDto>(total, _mapper.Map<IReadOnlyList<OrderVisitDetailDto>>(items));
|
|
}
|
|
}
|