|
@@ -1887,7 +1887,8 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
;
|
|
|
|
|
|
query = query
|
|
|
- .Includes(x => x.OrderSupervises.OrderByDescending(d => d.CreationTime).Take(2).ToList());
|
|
|
+ .Includes(x => x.OrderSupervises.OrderByDescending(d => d.CreationTime).Take(2).ToList())
|
|
|
+ .Includes(x => x.OrderVisits, d => d.OrderVisitDetails.Where(c => c.VisitTarget == EVisitTarget.Org).Take(1).ToList());
|
|
|
|
|
|
return query;
|
|
|
}
|
|
@@ -5686,22 +5687,22 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
return user;
|
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
+ #endregion
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 部门退回中心统计
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
+ /// <summary>
|
|
|
+ /// 部门退回中心统计
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
|
|
|
- public ISugarQueryable<OrgSendBackAuditListVo> OrgSendBackAuditList(OrgSendBackAuditListDto dto)
|
|
|
+ public ISugarQueryable<OrgSendBackAuditListVo> OrgSendBackAuditList(OrgSendBackAuditListDto dto)
|
|
|
{
|
|
|
var query = _orderSendBackAuditRepository.Queryable()
|
|
|
.Where(x => x.State == ESendBackAuditState.End && x.ApplyOrgId != OrgSeedData.CenterId && x.SendBackOrgId == OrgSeedData.CenterId)
|
|
|
.WhereIF(dto.StartTime.HasValue && dto.EndTime.HasValue, x => x.AuditTime >= dto.StartTime && x.AuditTime <= dto.EndTime)
|
|
|
.GroupBy(x => new { x.ApplyOrgId, x.ApplyOrgName })
|
|
|
.Select(x => new OrgSendBackAuditListVo
|
|
|
- {
|
|
|
+ {
|
|
|
OrgId = x.ApplyOrgId,
|
|
|
OrgName = x.ApplyOrgName,
|
|
|
Num = SqlFunc.AggregateCount(1)
|
|
@@ -5709,8 +5710,8 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
return query;
|
|
|
}
|
|
|
|
|
|
- public ISugarQueryable<OrderSendBackAudit> OrgSendBackAuditDetail(OrgSendBackAuditListDto dto)
|
|
|
- {
|
|
|
+ public ISugarQueryable<OrderSendBackAudit> OrgSendBackAuditDetail(OrgSendBackAuditListDto dto)
|
|
|
+ {
|
|
|
var query = _orderSendBackAuditRepository.Queryable()
|
|
|
.Includes(x => x.Order)
|
|
|
.Where(x => x.State == ESendBackAuditState.End && x.ApplyOrgId != OrgSeedData.CenterId && x.SendBackOrgId == OrgSeedData.CenterId)
|
|
@@ -5724,6 +5725,6 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
.OrderByIF(dto is { SortField: "auditTime", SortRule: 0 }, x => x.AuditTime, OrderByType.Asc)
|
|
|
.OrderByIF(dto is { SortField: "auditTime", SortRule: 1 }, x => x.AuditTime, OrderByType.Desc)
|
|
|
;
|
|
|
- return query;
|
|
|
- }
|
|
|
+ return query;
|
|
|
+ }
|
|
|
}
|