fix list字段处理

This commit is contained in:
2024-10-14 10:23:03 +08:00
parent 53713902fe
commit 0ef687fa60
2 changed files with 40 additions and 6 deletions

View File

@@ -1,13 +1,14 @@
using Dlhis.Entity.Visitor.Enums;
using Kurisu.AspNetCore.Utils.Extensions;
namespace Dlhis.Basic.Appointment.Response;
public class AppointmentDetailResponse
{
public long Id { get; set; }
public AppointmentPageResponse Mst { get; set; }
/// <summary>
/// 流水号
/// </summary>
@@ -56,12 +57,12 @@ public class AppointmentDetailResponse
/// <summary>
/// 访客开始
/// </summary>
public DateTime DoorStart { get; set; }
public DateTime? DoorStart { get; set; }
/// <summary>
/// 访问结束
/// </summary>
public DateTime DoorEnd { get; set; }
public DateTime? DoorEnd { get; set; }
/// <summary>
/// 是否进入车间
@@ -71,7 +72,18 @@ public class AppointmentDetailResponse
/// <summary>
/// 申请车间区域
/// </summary>
public List<string> ApplyWorkplaceAreas { get; set; }
public List<string> ApplyWorkplaceAreas
{
get
{
return ApplyWorkplaceAreasString.IsPresent()
? ApplyWorkplaceAreasString.ToObject<List<string>>()
: new List<string>(0);
}
}
public string ApplyWorkplaceAreasString { get; set; }
/// <summary>
/// 车间访问开始

View File

@@ -54,7 +54,29 @@ public class AppointmentService : IAppointmentService
{
return await _dbContext.Queryable<VisitorAppointmentDetailEntity>()
.Where(x => x.No == no)
.Select<AppointmentDetailResponse>()
.Select(x => new AppointmentDetailResponse
{
Id = x.Id,
No = x.No,
UserNo = x.UserNo,
IdType = x.IdType,
IdNo = x.IdNo,
Name = x.Name,
Phone = x.Phone,
LicensePlate = x.LicensePlate,
IsEnterDoorArea = x.IsEnterDoorArea,
ApplyDoorArea = x.ApplyDoorArea,
DoorStart = x.DoorStart,
DoorEnd = x.DoorEnd,
IsEnterWorkplace = false,
ApplyWorkplaceAreasString = x.ApplyWorkplaceAreas.ToString(),
WorkplaceStart = x.WorkplaceStart,
WorkplaceEnd = x.WorkplaceEnd,
ImageUrl = x.ImageUrl,
Remark = x.Remark,
DoorStatus = x.DoorStatus,
WorkplaceStatus = VisitorAppointmentDetailStatusEnumType.Wait
})
.ToListAsync();
}