| | |
| | | throw Oops.Oh("没有权限"); |
| | | } |
| | | |
| | | Expression<Func<OA_DeliverPlan, bool>> SearchList = (x) => true; |
| | | Expression<Func<OA_DeliverPlanPaiche, bool>> SearchList = (x) => true; |
| | | SearchList = SearchList.And(x => x.FirmId == _OAServices.firmId); |
| | | SearchList = SearchList.And(x => x.Creater == Permissions.MemberId);//只看自己 |
| | | SearchList = SearchList.And(x => x.BusinessManagerId == Permissions.KeyId);//只看自己 客户经理是自己 |
| | | SearchList = SearchList.And(x => x.ShifouDelivery !=2);//过滤有效 |
| | | if (Param.DeliverKeyID!=null) |
| | | { |
| | |
| | | } |
| | | if (Param.TimeStart != null) |
| | | { |
| | | SearchList = SearchList.And(x => x.CreateTime > Param.TimeStart); |
| | | SearchList = SearchList.And(x => x.DeliverTime >= Param.TimeStart.Value.Date); |
| | | } |
| | | if (Param.TimeEnd != null) |
| | | { |
| | | SearchList = SearchList.And(x => x.CreateTime < Param.TimeEnd.Value.AddDays(1)); |
| | | SearchList = SearchList.And(x => x.DeliverTime < Param.TimeEnd.Value.Date.AddDays(1)); |
| | | } |
| | | if (Param.DeliveredState != null) |
| | | { |
| | |
| | | |
| | | //强制增加员工过滤 |
| | | RefAsync<int> totle = 0; |
| | | var data = await _SugarClient.Queryable<OA_DeliverPlan>().Includes(x => x.Driver) |
| | | var data = await _SugarClient.Queryable<OA_DeliverPlanPaiche>().Includes(x => x.Driver).Includes(x=>x.DeliverPlans) |
| | | .Where(SearchList).OrderByDescending(x => x.CreateTime.Value.Date).OrderBy(x=>SqlFunc.Asc(x.Sort)).ToPageListAsync(Param.page.PageIndex, Param.page.PageSize, totle); |
| | | |
| | | Param.page.TotalCount = totle; |
| | |
| | | /// </summary> |
| | | /// <param name="KeyId"></param> |
| | | /// <returns></returns> |
| | | public async Task<OA_DeliverPlan> GetDeliverPlanInfo(Guid KeyId) |
| | | public async Task<OA_DeliverPlanPaiche> GetDeliverPlanInfo(Guid KeyId) |
| | | { |
| | | |
| | | if (!await CheckRols()) |
| | | { |
| | | throw Oops.Oh("没有权限"); |
| | | } |
| | | return await _SugarClient.Queryable<OA_DeliverPlan>().Includes(x => x.Attachments).Includes(x=>x.Driver).Includes(x=>x.Manager) |
| | | .Where(x => x.Creater == Permissions.MemberId && x.Keyid == KeyId && x.ShifouDelivery != 2).FirstAsync(); |
| | | return await _SugarClient.Queryable<OA_DeliverPlanPaiche>().Includes(x => x.Attachments).Includes(x=>x.Driver).Includes(x=>x.DeliverPlans) |
| | | .Where(x => x.BusinessManagerId == Permissions.KeyId && x.Keyid == KeyId && x.ShifouDelivery != 2).FirstAsync(); |
| | | |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// 数据列表 |
| | | /// </summary> |
| | | public List<OA_DeliverPlan> Data { get; set; } |
| | | public List<OA_DeliverPlanPaiche> Data { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 页面参数 |