fix 过滤
This commit is contained in:
@@ -25,6 +25,7 @@ public class DevicePermissionManuallyService : IDevicePermissionManuallyService
|
||||
return await _dbContext.Queryable<DevicePermissionManuallyEntity>()
|
||||
.LeftJoin<DeviceEntity>((x, d) => x.DeviceCode == d.Code)
|
||||
.LeftJoin<GainfoEntity>((x, d, g) => x.UserNo == g.No)
|
||||
.WhereIF(requestDto.Search.IsPresent(), (x, d, g) => g.Code == requestDto.Search || g.Name.Contains(requestDto.Search))
|
||||
.Select((x, d, g) => new DevicePermissionManuallyResponse
|
||||
{
|
||||
Id = x.Id,
|
||||
|
||||
@@ -6,6 +6,7 @@ using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using Dlhis.Entity.Common.Enums;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Dlhis.Jip.Api;
|
||||
using Dlhis.Jip.Api.Requests;
|
||||
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||
@@ -80,7 +81,7 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
var maximumConsecutiveDtos = await MaximumConsecutiveUserCodesAsync(request.UserCodes, 10, request.Date);
|
||||
//张三(工号)已连续排班10天,超10休1规定,禁止排班,请处理
|
||||
maximumConsecutiveDtos.ThrowIfExists(maximumConsecutiveDtos.Select(x => $"{x.UserCode}已经连续排班10天({x.Start}-{x.End}),超10休1规定,禁止排班").Join("\r\n"));
|
||||
|
||||
|
||||
var toInserts = request.UserCodes.Select(x => new WorkGridScheduleEntity
|
||||
{
|
||||
WorkGridCode = request.WorkGridCode,
|
||||
@@ -177,6 +178,7 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
.WhereIF(request.UserCode.IsPresent(), log => log.UserUniqueNo == request.UserCode)
|
||||
.WhereIF(request.UserCode.IsEmpty(), log => SqlFunc.Subqueryable<WorkGridUserEntity>().Where(p => p.WorkGridCode == workGrid.Code && p.UserCode == log.UserUniqueNo).Any())
|
||||
.Where(log => log.WorkGridInfo.StartsWith(filterString))
|
||||
.Where((log, d) => d.Type == DeviceTypeEnumType.Attendance || (d.Type == DeviceTypeEnumType.Door && d.AsAttendance))
|
||||
.OrderBy(log => log.RaiseDateTime)
|
||||
.Select((log, d, ga) => new WorkGridScheduleAttendancePageResponse
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user