| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using static SKIT.FlurlHttpClient.Wechat.Api.Models.ProductOfflineGetSameCityTemplateResponse.Types.Template.Types; |
| | | |
| | | namespace cylsg.Application.CyOS |
| | | { |
| | |
| | | Name = x.Name, |
| | | Keyid = x.Keyid, |
| | | Remark = x.Remark, |
| | | }).WithCache(3600).ToListAsync(); |
| | | }).WithCache(60).ToListAsync(); |
| | | } |
| | | /// <summary> |
| | | /// 获取科目列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | |
| | | [AllowAnonymous] |
| | | public async Task<List<OaSubjectSet>> getKeMuList() |
| | | { |
| | | return await _client.Queryable<OaSubjectSet>().Where(x => x.Status == true && x.FirmId == _oAServices.firmId && x.SubjectType == "贷").Select(x => new OaSubjectSet |
| | |
| | | SubjectName = x.SubjectName, |
| | | Keyid = x.Keyid, |
| | | Remark = x.Remark, |
| | | }).WithCache(3600).ToListAsync(); |
| | | }).WithCache(60).ToListAsync(); |
| | | } |
| | | /// <summary> |
| | | /// 获取流水号 |
| | |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | //[AllowAnonymous] |
| | | public async Task<object> GeCorporateClients() |
| | | { |
| | | return await _client.Queryable<OA_CorporateClients>() |
| | |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | public async Task<List<OaStaff>> Getdrivers() |
| | | { |
| | | return await _client.Queryable<OaStaff>().Where(x => x.Status == "在职" && x.FirmId == _oAServices.firmId && x.BF_IsDriver).Select(x => new OaStaff |
| | | return await _client.Queryable<OaStaff>().Includes(x=>x.Car).Where(x => x.Status == "在职" && x.FirmId == _oAServices.firmId && x.BF_IsDriver).Select(x => new OaStaff |
| | | { |
| | | Name = x.Name, |
| | | MemberId = x.MemberId, |
| | | Keyid = x.Keyid, |
| | | Car=x.Car |
| | | |
| | | }).WithCache(1800).ToListAsync(); |
| | | }).ToListAsync(); |
| | | } |
| | | |
| | | |
| | |
| | | [AllowAnonymous] |
| | | public async Task<List<OaStaff>> GetDriversOfWithin7days() |
| | | { |
| | | var list = await _client.Queryable<OA_DeliverPlan>().Where(x => SqlFunc.ToDate(x.DeliverTime) < DateTime.Now.AddDays(8).Date && SqlFunc.ToDate(x.DeliverTime) >= DateTime.Now.Date).GroupBy(x => x.DriverId).Select(x => x.DriverId).ToListAsync(); |
| | | return await _client.Queryable<OaStaff>().In(list).Where(x => x.Status == "在职" && x.FirmId == _oAServices.firmId && x.BF_IsDriver).Select(x => new OaStaff |
| | | |
| | | var list = await _client.Queryable<OA_DeliverPlanPaiche>().Where(x =>( x.DeliverTime.Value.Date < DateTime.Now.AddDays(8).Date) && (x.DeliverTime.Value.Date >= DateTime.Now.Date)).Select(x => x.DriverId).ToListAsync(); |
| | | return await _client.Queryable<OaStaff>().Includes(x=>x.Car).Where(x=>list.Contains(x.Keyid)).Where(x => x.Status == "在职" && x.FirmId == _oAServices.firmId && x.BF_IsDriver).Select(x => new OaStaff |
| | | { |
| | | Name = x.Name, |
| | | MemberId = x.MemberId, |
| | | Keyid = x.Keyid, |
| | | Car=x.Car |
| | | |
| | | }).WithCache(1800).ToListAsync(); |
| | | })/*.WithCache(30)*/.ToListAsync(); //Includes(x => x.Car)加缓存会报错 |
| | | //// return await _client.Queryable<OA_DeliverPlan>() |
| | | ////.LeftJoin<OaStaff>((dp, os) => dp.DriverId == os.Keyid) |
| | | ////.Where((dp, os) => SqlFunc.ToDate(dp.DeliverTime) < DateTime.Now.AddDays(8).Date |