102 lines
3.4 KiB
C#
102 lines
3.4 KiB
C#
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));
|
||
}
|
||
|
||
}
|
||
} |