fix 请求参数变更
This commit is contained in:
@@ -11,9 +11,6 @@ namespace Dlhis.Entity.Visitor.Entity;
|
||||
[SugarTable(TableName = "VisitorAppointmentDetail", TableDescription = "访客预约")]
|
||||
public class VisitorAppointmentDetailEntity : SugarBaseEntity
|
||||
{
|
||||
[SugarColumn(IsNullable = false, ColumnDescription = "pid")]
|
||||
public long AppointmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 流水号
|
||||
/// </summary>
|
||||
@@ -26,6 +23,16 @@ public class VisitorAppointmentDetailEntity : SugarBaseEntity
|
||||
[SugarColumn(IsNullable = false, ColumnDescription = "用户No")]
|
||||
public string UserNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 证件类型
|
||||
/// </summary>
|
||||
public string IdType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 证件号
|
||||
/// </summary>
|
||||
public string IdNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客名称
|
||||
/// </summary>
|
||||
|
||||
@@ -26,19 +26,55 @@ public class VisitorAppointmentEntity : SugarBaseEntity
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来访人公司
|
||||
/// 来访人来源/公司
|
||||
/// </summary>
|
||||
public string Company { get; set; }
|
||||
public string Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 申请时间
|
||||
/// </summary>
|
||||
public DateTime ApplyTime { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 预约区域
|
||||
/// 预约门禁区域
|
||||
/// </summary>
|
||||
public string ApplyArea { get; set; }
|
||||
public string ApplyDoorArea { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 访客开始
|
||||
/// </summary>
|
||||
public DateTime DoorStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访问结束
|
||||
/// </summary>
|
||||
public DateTime DoorEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否进入车间
|
||||
/// </summary>
|
||||
public bool IsEnterWorkplace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 申请车间区域
|
||||
/// </summary>
|
||||
public string ApplyWorkplaceArea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 车间访问开始
|
||||
/// </summary>
|
||||
public DateTime? WorkplaceStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 车间访问结束
|
||||
/// </summary>
|
||||
public DateTime? WorkplaceEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 预约厂区
|
||||
@@ -49,24 +85,4 @@ public class VisitorAppointmentEntity : SugarBaseEntity
|
||||
/// 申请事由
|
||||
/// </summary>
|
||||
public string Reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客开始
|
||||
/// </summary>
|
||||
public DateTime Start { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访问结束
|
||||
/// </summary>
|
||||
public DateTime End { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否进入车间
|
||||
/// </summary>
|
||||
public bool IsEnterWorkplace { get; set; }
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public class AppointmentsController : ControllerBase
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 接受预约申请
|
||||
/// 接收预约申请
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -14,9 +14,15 @@ public class AppointmentReceiveItemDto
|
||||
/// 手机号
|
||||
/// </summary>
|
||||
[StringLength(11, MinimumLength = 11)]
|
||||
[Required(ErrorMessage = "手机号必填")]
|
||||
[Required]
|
||||
public string Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 证件类型
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string IdType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 证件号/工号
|
||||
/// </summary>
|
||||
|
||||
@@ -9,37 +9,73 @@ public class AppointmentReceiveRequest : IValidatableObject
|
||||
/// <summary>
|
||||
/// 流水号
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "流水号必填")]
|
||||
[Required(ErrorMessage = "流程不可为空")]
|
||||
public string No { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "标题必填")]
|
||||
[Required(ErrorMessage = "标题不可为空")]
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 对接人工号
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "对接人工号必填")]
|
||||
[Required(ErrorMessage = "对接人工号不可为空")]
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 预约区域
|
||||
/// 预约门岗区域
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "申请预约区域必填")]
|
||||
public string ApplyArea { get; set; }
|
||||
[Required(ErrorMessage = "预约门岗区域不可为空")]
|
||||
public string ApplyDoorArea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来访人公司
|
||||
/// 来访人来源/公司
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "来源公司不可为空")]
|
||||
public string Company { get; set; }
|
||||
[Required(ErrorMessage = "来源/公司不可为空")]
|
||||
public string Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 申请时间
|
||||
/// </summary>
|
||||
public DateTime ApplyTime { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客开始
|
||||
/// </summary>
|
||||
public DateTime DoorStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访问结束
|
||||
/// </summary>
|
||||
public DateTime DoorEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否进入车间
|
||||
/// </summary>
|
||||
public bool IsEnterWorkplace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 申请车间区域
|
||||
/// </summary>
|
||||
public string ApplyWorkplaceArea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 车间访问开始
|
||||
/// </summary>
|
||||
public DateTime? WorkplaceStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 车间访问结束
|
||||
/// </summary>
|
||||
public DateTime? WorkplaceEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 预约厂区
|
||||
@@ -53,31 +89,6 @@ public class AppointmentReceiveRequest : IValidatableObject
|
||||
[Required(ErrorMessage = "申请事由不能为空")]
|
||||
public string Reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客开始
|
||||
/// </summary>
|
||||
public DateTime Start { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访问结束
|
||||
/// </summary>
|
||||
public DateTime End { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否进入车间
|
||||
/// </summary>
|
||||
public bool IsEnterWorkplace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 车间区域
|
||||
/// </summary>
|
||||
public string WorkplaceArea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 明细
|
||||
/// </summary>
|
||||
@@ -86,9 +97,14 @@ public class AppointmentReceiveRequest : IValidatableObject
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (Start >= End)
|
||||
if (DoorStart >= DoorEnd)
|
||||
{
|
||||
yield return new ValidationResult("来访时间不能大于等于离开时间", new[] { nameof(Start), nameof(End) });
|
||||
yield return new ValidationResult("门禁来访时间不能大于等于离开时间", new[] { nameof(DoorStart), nameof(DoorEnd) });
|
||||
}
|
||||
|
||||
if (IsEnterWorkplace)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,15 +36,18 @@ public class AppointmentService : IAppointmentService
|
||||
No = request.No,
|
||||
Title = request.Title,
|
||||
Code = request.Code,
|
||||
Company = request.Company,
|
||||
ApplyTime = request.ApplyTime,
|
||||
ApplyArea = request.ApplyArea,
|
||||
Source = request.Source,
|
||||
Date = request.Date,
|
||||
ApplyDoorArea = request.ApplyDoorArea,
|
||||
Factory = request.Factory,
|
||||
Reason = request.Reason,
|
||||
Start = request.Start,
|
||||
End = request.End,
|
||||
DoorStart = request.DoorStart,
|
||||
DoorEnd = request.DoorEnd,
|
||||
Remark = request.Remark,
|
||||
IsEnterWorkplace = request.IsEnterWorkplace,
|
||||
ApplyWorkplaceArea = request.ApplyWorkplaceArea,
|
||||
WorkplaceStart = request.WorkplaceStart,
|
||||
WorkplaceEnd = request.WorkplaceEnd
|
||||
});
|
||||
|
||||
foreach (var item in request.Items)
|
||||
@@ -60,7 +63,7 @@ public class AppointmentService : IAppointmentService
|
||||
Type = GainfoUserTypeEnumType.External,
|
||||
IdNo = item.IdNo,
|
||||
Name = item.Name,
|
||||
Source = request.Company,
|
||||
Source = request.Source,
|
||||
Phone = item.Phone
|
||||
};
|
||||
await _dbContext.InsertAsync(gainfo);
|
||||
@@ -69,7 +72,7 @@ public class AppointmentService : IAppointmentService
|
||||
{
|
||||
if (gainfo.Type == GainfoUserTypeEnumType.External)
|
||||
{
|
||||
gainfo.Source = request.Company;
|
||||
gainfo.Source = request.Source;
|
||||
gainfo.Phone = item.Phone;
|
||||
|
||||
await _dbContext.UpdateAsync(gainfo);
|
||||
@@ -81,8 +84,9 @@ public class AppointmentService : IAppointmentService
|
||||
var detail = new VisitorAppointmentDetailEntity
|
||||
{
|
||||
UserNo = gainfo.No,
|
||||
AppointmentId = id,
|
||||
No = request.No,
|
||||
IdType = item.IdType,
|
||||
IdNo = item.IdNo,
|
||||
Name = item.Name,
|
||||
Phone = item.Phone,
|
||||
Remark = item.Remark,
|
||||
|
||||
@@ -17,7 +17,7 @@ public class EMealVoucherController : ControllerBase
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 接收
|
||||
/// 接收电子餐券
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
[HttpPost("receive")]
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"Scheduled",
|
||||
"Sys",
|
||||
"Visitor",
|
||||
"Message"
|
||||
"Message",
|
||||
"External"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -88,6 +88,17 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"UpstreamPathTemplate": "/api/external/{url}",
|
||||
"DownstreamPathTemplate": "/api/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "192.168.199.30",
|
||||
"Port": 30882
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"UpstreamPathTemplate": "/{url}/swagger/v1/swagger.json",
|
||||
"DownstreamPathTemplate": "/{url}/swagger/v1/swagger.json",
|
||||
|
||||
Reference in New Issue
Block a user