186 lines
5.1 KiB
C#
186 lines
5.1 KiB
C#
using Appointment.Entity;
|
|
using Appointment.IRepository;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Appointment.Api.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 预订接口
|
|
/// </summary>
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class ApptController : ControllerBase
|
|
{
|
|
IApptRepo _ApptRepo;
|
|
public ApptController(IApptRepo apptRepo)
|
|
{
|
|
_ApptRepo = apptRepo;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据时间段获取可使用的会议厅资源
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("UsableMeeting")]
|
|
public ApiResult<List<MeetingRes>> UsableMeeting(MeetingReq req)
|
|
{
|
|
return _ApptRepo.UsableMeetingList(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据日期与场次获取可使用会议厅资源
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("UsableMeetingByDay")]
|
|
public ApiResult<List<ResCode>> UsableMeetingByDay(UsableMeetingReq req)
|
|
{
|
|
return _ApptRepo.UsableMeeting(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取可使用的房间资源
|
|
/// </summary>
|
|
/// <param name="req">启始时间(默认从昨天开始)</param>
|
|
/// <returns></returns>
|
|
[HttpPost("UsableRoom")]
|
|
public ApiResult<List<UsableRoomRes>> UsableRoom(UsableRoomReq req)
|
|
{
|
|
return _ApptRepo.UsableRoom(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据时间段获取房类最小可用数
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("UsableRoomMin")]
|
|
public ApiResult<List<UsableRoomRes>> UsableRoomMin(UsableRoomReq req)
|
|
{
|
|
return _ApptRepo.UsableRoomMin(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取备注列表项
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost("RemarkLis")]
|
|
public ApiResult<List<string>> RemarkList()
|
|
{
|
|
return _ApptRepo.RemarkList();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 预订提交
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("Add")]
|
|
public ApiResult Add(ApptSummaryReq req)
|
|
{
|
|
return _ApptRepo.Add(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 预订审核
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("ApptAudit")]
|
|
public ApiResult ApptAudit(ApptAuditReq req)
|
|
{
|
|
return _ApptRepo.ApptAudit(req);
|
|
}
|
|
|
|
[HttpPost("CancelAudit")]
|
|
public ApiResult CancelAudit(ApptAuditReq req)
|
|
{
|
|
return _ApptRepo.CancelAudit(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 转审批
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("TransferAudit")]
|
|
public ApiResult TransferAudit(TransferAuditReq req)
|
|
{
|
|
return _ApptRepo.TransferAudit(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 抄送
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("ApptSend")]
|
|
public ApiResult ApptSend(ApptSendReq req)
|
|
{
|
|
return _ApptRepo.ApptSend(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键获取实体
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("GetModel")]
|
|
public ApiResult<ApptSummaryReq> GetModel(ApptSummaryReq req)
|
|
{
|
|
return _ApptRepo.GetModel(req.Id);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 我发起的预订列表列表
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("MyApptApplyPageReq")]
|
|
public ApiResult<PagerData<ApptSummaryReq>> MyApptApplyPageReq(MyApptApplyPageReq req)
|
|
{
|
|
return _ApptRepo.MyApptApplyPageReq(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取我待审核的
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("MyPartakePage")]
|
|
public ApiResult<PagerData<ApptSummaryReq>> MyPartakePage(MyApptAuditPageReq req)
|
|
{
|
|
return _ApptRepo.MyPartakePage(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取预订审核记录表
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("AuditorLogTree")]
|
|
public ApiResult<AuditorLogTreeRes> AuditorLogTree(CommIntReq req)
|
|
{
|
|
return _ApptRepo.AuditorLogTree(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 测试
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("Demo")]
|
|
public ApiResult Demo(CommPageReq req)
|
|
{
|
|
return _ApptRepo.Demo(req);
|
|
}
|
|
}
|
|
}
|