- 新增 PayRoll(工资)、Wms(仓储)、Prod(车速/缫丝/考勤/丝片检测/丝片台账/纤检日报/质量日报) 模块 - 新增对应 Domain 实体、Application DTO/Service、Api Controller 与前端页面 - 移除旧 Attendance 考勤模块(Controller/Service/Entity/DTO 及 5 个前端页面),由 Prod/Kaoqin 取代 - 调整路由、仪表盘、Lsjl 流丝记录实体与服务 - 更新业务种子数据与 DbSeeder - 补充工作进度文档 14-27
102 lines
3.8 KiB
C#
102 lines
3.8 KiB
C#
using F9WebAiTest.Application.Common;
|
|
using F9WebAiTest.Application.Dtos.PayRoll;
|
|
using F9WebAiTest.Application.Services.PayRoll;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace F9WebAiTest.Api.Controllers.PayRoll;
|
|
|
|
/// <summary>薪资配置-账期(CONFZQ):考勤统计的「前缫出勤天数」</summary>
|
|
[ApiController]
|
|
[Route("api/payroll/confzq")]
|
|
[Authorize]
|
|
public class ConfZqController : ControllerBase
|
|
{
|
|
private readonly IConfZqService _svc;
|
|
public ConfZqController(IConfZqService svc) => _svc = svc;
|
|
|
|
private IActionResult Fail(ServiceException ex) => StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code));
|
|
|
|
[HttpGet("")]
|
|
public async Task<IActionResult> List([FromQuery] int? year = null)
|
|
=> Ok(ApiResult<List<ConfZqDto>>.Ok(await _svc.GetListAsync(year)));
|
|
|
|
[HttpGet("{year:int}/{month:int}")]
|
|
public async Task<IActionResult> Get(int year, int month)
|
|
=> Ok(ApiResult<ConfZqDto>.Ok(await _svc.GetByYearMonthAsync(year, month)));
|
|
|
|
[HttpPost("")]
|
|
public async Task<IActionResult> Save([FromBody] ConfZqDto dto)
|
|
{
|
|
try { return Ok(ApiResult<object>.Ok(new { id = await _svc.SaveAsync(dto) }, "保存成功")); }
|
|
catch (ServiceException ex) { return Fail(ex); }
|
|
}
|
|
|
|
[HttpDelete("{id:long}")]
|
|
public async Task<IActionResult> Delete(long id)
|
|
{
|
|
try { await _svc.DeleteAsync(id); return Ok(ApiResult<object>.Ok(null, "删除成功")); }
|
|
catch (ServiceException ex) { return Fail(ex); }
|
|
}
|
|
}
|
|
|
|
/// <summary>薪资配置-职工(CONFEMPLOYEE):法定假小时数 / 是否学工</summary>
|
|
[ApiController]
|
|
[Route("api/payroll/confemployee")]
|
|
[Authorize]
|
|
public class ConfEmployeeController : ControllerBase
|
|
{
|
|
private readonly IConfEmployeeService _svc;
|
|
public ConfEmployeeController(IConfEmployeeService svc) => _svc = svc;
|
|
|
|
private IActionResult Fail(ServiceException ex) => StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code));
|
|
|
|
[HttpGet("")]
|
|
public async Task<IActionResult> List([FromQuery] long? employeeId = null, [FromQuery] long? worktypeId = null)
|
|
=> Ok(ApiResult<List<ConfEmployeeDto>>.Ok(await _svc.GetListAsync(employeeId, worktypeId)));
|
|
|
|
[HttpPost("")]
|
|
public async Task<IActionResult> Save([FromBody] ConfEmployeeDto dto)
|
|
{
|
|
try { return Ok(ApiResult<object>.Ok(new { id = await _svc.SaveAsync(dto) }, "保存成功")); }
|
|
catch (ServiceException ex) { return Fail(ex); }
|
|
}
|
|
|
|
[HttpDelete("{id:long}")]
|
|
public async Task<IActionResult> Delete(long id)
|
|
{
|
|
try { await _svc.DeleteAsync(id); return Ok(ApiResult<object>.Ok(null, "删除成功")); }
|
|
catch (ServiceException ex) { return Fail(ex); }
|
|
}
|
|
}
|
|
|
|
/// <summary>岗位胜任考核:考核结果决定加班费单价档位</summary>
|
|
[ApiController]
|
|
[Route("api/payroll/gwsrkh")]
|
|
[Authorize]
|
|
public class GwsrkhController : ControllerBase
|
|
{
|
|
private readonly IGwsrkhService _svc;
|
|
public GwsrkhController(IGwsrkhService svc) => _svc = svc;
|
|
|
|
private IActionResult Fail(ServiceException ex) => StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code));
|
|
|
|
[HttpGet("")]
|
|
public async Task<IActionResult> List([FromQuery] int year, [FromQuery] int month, [FromQuery] long depId = 0)
|
|
=> Ok(ApiResult<List<GwsrkhDto>>.Ok(await _svc.GetListAsync(year, month, depId)));
|
|
|
|
[HttpPost("")]
|
|
public async Task<IActionResult> Save([FromBody] GwsrkhDto dto)
|
|
{
|
|
try { return Ok(ApiResult<object>.Ok(new { id = await _svc.SaveAsync(dto) }, "保存成功")); }
|
|
catch (ServiceException ex) { return Fail(ex); }
|
|
}
|
|
|
|
[HttpDelete("{id:long}")]
|
|
public async Task<IActionResult> Delete(long id)
|
|
{
|
|
try { await _svc.DeleteAsync(id); return Ok(ApiResult<object>.Ok(null, "删除成功")); }
|
|
catch (ServiceException ex) { return Fail(ex); }
|
|
}
|
|
}
|