zhengzhou-byd-lms/DOAN.Admin.WebApi/Controllers/Bydlms/BydClockInRecordController.cs
2025-02-22 14:31:52 +08:00

102 lines
3.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.AspNetCore.Mvc;
using DOAN.Model.Bydlms.Dto;
using DOAN.Model.Bydlms;
using DOAN.Service.Bydlms.IBydlmsService;
using DOAN.Admin.WebApi.Filters;
//创建时间2025-02-19
namespace DOAN.Admin.WebApi.Controllers.Bydlms
{
/// <summary>
/// 考勤打卡记录
/// </summary>
[Verify]
[Route("bydlms/BydClockInRecord")]
public class BydClockInRecordController : BaseController
{
/// <summary>
/// 考勤打卡记录接口
/// </summary>
private readonly IBydClockInRecordService _BydClockInRecordService;
public BydClockInRecordController(IBydClockInRecordService BydClockInRecordService)
{
_BydClockInRecordService = BydClockInRecordService;
}
/// <summary>
/// 查询考勤打卡记录列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "bydclockinrecord:list")]
public IActionResult QueryBydClockInRecord([FromQuery] BydClockInRecordQueryDto parm)
{
var response = _BydClockInRecordService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询考勤打卡记录详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "bydclockinrecord:query")]
public IActionResult GetBydClockInRecord(string Id)
{
var response = _BydClockInRecordService.GetInfo(Id);
var info = response.Adapt<BydClockInRecordDto>();
return SUCCESS(info);
}
/// <summary>
/// 添加考勤打卡记录
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "bydclockinrecord:add")]
[Log(Title = "考勤打卡记录", BusinessType = BusinessType.INSERT)]
public IActionResult AddBydClockInRecord([FromBody] BydClockInRecordDto parm)
{
var modal = parm.Adapt<BydClockInRecord>().ToCreate(HttpContext);
var response = _BydClockInRecordService.AddBydClockInRecord(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新考勤打卡记录
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "bydclockinrecord:edit")]
[Log(Title = "考勤打卡记录", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateBydClockInRecord([FromBody] BydClockInRecordDto parm)
{
var modal = parm.Adapt<BydClockInRecord>().ToUpdate(HttpContext);
var response = _BydClockInRecordService.UpdateBydClockInRecord(modal);
return ToResponse(response);
}
/// <summary>
/// 删除考勤打卡记录
/// </summary>
/// <returns></returns>
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "bydclockinrecord:delete")]
[Log(Title = "考勤打卡记录", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteBydClockInRecord([FromRoute]string ids)
{
var idArr = Tools.SplitAndConvert<string>(ids);
return ToResponse(_BydClockInRecordService.Delete(idArr));
}
}
}