fix 修复已知问题

This commit is contained in:
2024-07-31 10:15:17 +08:00
parent e79e7acb97
commit e0770140b4
35 changed files with 695 additions and 556 deletions

View File

@@ -14,7 +14,6 @@ using Dlhis.ScheduledTask.TaskAssignment.Dto;
using Kurisu.AspNetCore.CustomClass;
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
using Mapster;
namespace Dlhis.ScheduledTask.TaskAssignment.Services.Implements;
@@ -112,8 +111,8 @@ public class AssignmentService : IAssignmentService
dto.Info = item.TimePeriods.Select(t => new TimePeriodToDeviceResponse
{
Id = t.CardType,
Name = t.CardType == 2 ? "行政卡" : "车间卡",
Enable = true,
Name = t.CardName,
Enable = item.EnableTimePeriod,
Sections = t.Sections.Select(s => new TimePeriodWeekDaySection
{
DayOfWeek = s.DayOfWeek,
@@ -121,7 +120,7 @@ public class AssignmentService : IAssignmentService
{
Enable = p.Enable,
Start = p.Enable ? p.Start : new TimeOnly(00, 00, 00),
End = p.Enable ? p.End : new TimeOnly(00, 00, 00),
End = p.Enable ? p.End : new TimeOnly(00, 00, 00)
}).ToList()
}).ToList()
});
@@ -387,8 +386,13 @@ public class AssignmentService : IAssignmentService
var templateCodes = devices.Select(x => x.TemplateCode).Distinct().ToList();
var deviceCodes = devices.Select(x => x.Code).Distinct().ToList();
var settings = await _dbContext.Queryable<DeviceTimePeriodEntity>()
.LeftJoin<BasicTypeEntity>((x, type) => x.CardType.ToString() == type.Code && type.Type == "timeperiod")
.Where(x => (x.AssignType == DeviceTimePeriodAssignEnumType.Template && templateCodes.Contains(x.Value))
|| (x.AssignType == DeviceTimePeriodAssignEnumType.Device && deviceCodes.Contains(x.Value)))
.Select((x, type) => new DeviceTimePeriodDto()
{
CardName = type.Display
}, true)
.ToListAsync();