fix AsAppointment

This commit is contained in:
2024-10-11 15:12:35 +08:00
parent aeffa95a96
commit e4946d7351
6 changed files with 24 additions and 10 deletions

View File

@@ -40,8 +40,10 @@ public class AppointmentsController : ControllerBase
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[AllowAnonymous]
[HttpPost("confirm")]
[Transactional]
[IgnoreTenant]
public async Task ConfirmAsync(AppointmentConfirmRequest request)
{
await _appointmentService.ConfirmAsync(request);
@@ -54,9 +56,7 @@ public class AppointmentsController : ControllerBase
/// <returns></returns>
[AllowAnonymous]
[HttpGet("today")]
public async Task<AppointmentDetailResponse> GetTodayByIdNoAsync(
[FromQuery] [StringLength(18, MinimumLength = 18, ErrorMessage = "身份证有误")] [Required(ErrorMessage = "身份证有误")]
string idNo)
public async Task<AppointmentDetailResponse> GetTodayByIdNoAsync(string idNo)
{
return await _appointmentService.GetTodayByIdNoAsync(idNo);
}

View File

@@ -4,7 +4,11 @@ namespace Dlhis.Basic.Appointment.Response;
public class AppointmentDetailResponse
{
/// <summary>
public long Id { get; set; }
public AppointmentPageResponse Mst { get; set; }
/// <summary>
/// 流水号
/// </summary>
public string No { get; set; }

View File

@@ -110,7 +110,7 @@ public class AppointmentService : IAppointmentService
}
catch (Exception)
{
throw new UserFriendlyException("凭证有误");
//ignore
}
var now = DateTime.Now;
@@ -118,7 +118,10 @@ public class AppointmentService : IAppointmentService
.LeftJoin<GainfoEntity>((x, ga) => ga.IdNo == idNo)
.Where((x, ga) => ga.IdNo == idNo)
.Where(x => (x.IsEnterDoorArea && SqlFunc.DateIsSame(x.DoorStart, now)) || (x.IsEnterWorkplace && SqlFunc.DateIsSame(x.WorkplaceStart, now)))
.Select<AppointmentDetailResponse>()
.Select(x => new AppointmentDetailResponse
{
Mst = SqlFunc.Subqueryable<VisitorAppointmentDetailEntity>().Where(p => p.No == x.No).First<AppointmentPageResponse>()
}, true)
.SingleAsync();
}

View File

@@ -60,8 +60,13 @@ public class DeviceGroupTreeResponse
[JsonIgnore]
public string TenantId { get; set; }
/// <summary>
/// 是否作为方可预约组
/// </summary>
public bool AsAppointment { get; set; }
/// <summary>
/// 下级
/// </summary>
public List<DeviceGroupTreeResponse> Next { get; set; } = new();
}
}

View File

@@ -94,7 +94,7 @@ public class GainfoGroupService : IGainfoGroupService
.Select(x => x.No)
.ToListAsync();
(userNos.Count != request.UserNos.Count).ThrowIfTrue("存在权限外人员,无法添加");
//(userNos.Count != request.UserNos.Count).ThrowIfTrue("存在权限外人员,无法添加");
var entities = userNos.Select(x => new GainfoGroupRelationshipEntity
{

View File

@@ -64,12 +64,14 @@ public class VisitorAppointmentDetailEntity : SugarBaseEntity
/// <summary>
/// 访客开始
/// </summary>
public DateTime DoorStart { get; set; }
[SugarColumn(IsNullable = true)]
public DateTime? DoorStart { get; set; }
/// <summary>
/// 访问结束
/// </summary>
public DateTime DoorEnd { get; set; }
[SugarColumn(IsNullable = true)]
public DateTime? DoorEnd { get; set; }
/// <summary>
/// 是否进入车间