fix 过滤

This commit is contained in:
2025-03-11 11:04:37 +08:00
parent a2bad07677
commit aab4dea152
2 changed files with 4 additions and 1 deletions

View File

@@ -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
{