- 新增 PayRoll(工资)、Wms(仓储)、Prod(车速/缫丝/考勤/丝片检测/丝片台账/纤检日报/质量日报) 模块 - 新增对应 Domain 实体、Application DTO/Service、Api Controller 与前端页面 - 移除旧 Attendance 考勤模块(Controller/Service/Entity/DTO 及 5 个前端页面),由 Prod/Kaoqin 取代 - 调整路由、仪表盘、Lsjl 流丝记录实体与服务 - 更新业务种子数据与 DbSeeder - 补充工作进度文档 14-27
231 lines
8.0 KiB
C#
231 lines
8.0 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>薪资配置-工艺庄口(挡车车头产量计算的丝量/单价/系数基准)</summary>
|
|
[ApiController]
|
|
[Route("api/payroll/confgyzk")]
|
|
[Authorize]
|
|
public class ConfGyzkController : ControllerBase
|
|
{
|
|
private readonly IConfGyzkService _svc;
|
|
public ConfGyzkController(IConfGyzkService svc) => _svc = svc;
|
|
|
|
[HttpGet("list")]
|
|
public async Task<IActionResult> GetList([FromQuery] int? year = null, [FromQuery] int? month = null)
|
|
=> Ok(ApiResult<List<ConfGyzkListItemDto>>.Ok(await _svc.GetListAsync(year, month)));
|
|
|
|
[HttpGet("{id}")]
|
|
public async Task<IActionResult> GetForEdit(long id)
|
|
{
|
|
try { return Ok(ApiResult<ConfGyzkSaveDto>.Ok(await _svc.GetForEditAsync(id))); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpPost("save")]
|
|
public async Task<IActionResult> Save([FromBody] ConfGyzkSaveDto dto)
|
|
{
|
|
try
|
|
{
|
|
var id = await _svc.SaveAsync(dto);
|
|
return Ok(ApiResult<object>.Ok(new { id }, "保存成功"));
|
|
}
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpDelete("{id}")]
|
|
public async Task<IActionResult> Delete(long id)
|
|
{
|
|
try
|
|
{
|
|
await _svc.DeleteAsync(id);
|
|
return Ok(ApiResult<object>.Ok(null, "删除成功"));
|
|
}
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
}
|
|
|
|
// ==================== 薪资配置-工种 ====================
|
|
|
|
/// <summary>薪资配置-工种/岗位(标准上班时长、标准出勤天数及各项金额)</summary>
|
|
[ApiController]
|
|
[Route("api/payroll/confgz")]
|
|
[Authorize]
|
|
public class ConfGzController : ControllerBase
|
|
{
|
|
private readonly IConfGzService _svc;
|
|
public ConfGzController(IConfGzService svc) => _svc = svc;
|
|
|
|
[HttpGet("list")]
|
|
public async Task<IActionResult> GetList() => Ok(ApiResult<List<ConfGzListItemDto>>.Ok(await _svc.GetListAsync()));
|
|
|
|
[HttpGet("{id}")]
|
|
public async Task<IActionResult> GetForEdit(long id)
|
|
{
|
|
try { return Ok(ApiResult<ConfGzSaveDto>.Ok(await _svc.GetForEditAsync(id))); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpPost("save")]
|
|
public async Task<IActionResult> Save([FromBody] ConfGzSaveDto dto)
|
|
{
|
|
try
|
|
{
|
|
var id = await _svc.SaveAsync(dto);
|
|
return Ok(ApiResult<object>.Ok(new { id }, "保存成功"));
|
|
}
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpDelete("{id}")]
|
|
public async Task<IActionResult> Delete(long id)
|
|
{
|
|
try
|
|
{
|
|
await _svc.DeleteAsync(id);
|
|
return Ok(ApiResult<object>.Ok(null, "删除成功"));
|
|
}
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
}
|
|
|
|
// ==================== 薪资配置-挡车/车头岗位 ====================
|
|
|
|
/// <summary>薪资配置-挡车/车头岗位(按绪数档的岗位基数金额、车头工金额)</summary>
|
|
[ApiController]
|
|
[Route("api/payroll/confdcg")]
|
|
[Authorize]
|
|
public class ConfDcgController : ControllerBase
|
|
{
|
|
private readonly IConfDcgService _svc;
|
|
public ConfDcgController(IConfDcgService svc) => _svc = svc;
|
|
|
|
[HttpGet("list")]
|
|
public async Task<IActionResult> GetList() => Ok(ApiResult<List<ConfDcgListItemDto>>.Ok(await _svc.GetListAsync()));
|
|
|
|
[HttpGet("{id}")]
|
|
public async Task<IActionResult> GetForEdit(long id)
|
|
{
|
|
try { return Ok(ApiResult<ConfDcgSaveDto>.Ok(await _svc.GetForEditAsync(id))); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpPost("save")]
|
|
public async Task<IActionResult> Save([FromBody] ConfDcgSaveDto dto)
|
|
{
|
|
try
|
|
{
|
|
var id = await _svc.SaveAsync(dto);
|
|
return Ok(ApiResult<object>.Ok(new { id }, "保存成功"));
|
|
}
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpDelete("{id}")]
|
|
public async Task<IActionResult> Delete(long id)
|
|
{
|
|
try
|
|
{
|
|
await _svc.DeleteAsync(id);
|
|
return Ok(ApiResult<object>.Ok(null, "删除成功"));
|
|
}
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
}
|
|
|
|
// ==================== 挡车纤度奖扣 ====================
|
|
|
|
/// <summary>挡车纤度奖扣(按规格 + 纤度配置野纤的奖励/扣款)</summary>
|
|
[ApiController]
|
|
[Route("api/payroll/dcxdjk")]
|
|
[Authorize]
|
|
public class DcxdjkController : ControllerBase
|
|
{
|
|
private readonly IDcxdjkService _svc;
|
|
public DcxdjkController(IDcxdjkService svc) => _svc = svc;
|
|
|
|
[HttpGet("list")]
|
|
public async Task<IActionResult> GetList([FromQuery] string guige = "")
|
|
=> Ok(ApiResult<List<DcxdjkListItemDto>>.Ok(await _svc.GetListAsync(guige ?? string.Empty)));
|
|
|
|
[HttpGet("{id}")]
|
|
public async Task<IActionResult> GetForEdit(long id)
|
|
{
|
|
try { return Ok(ApiResult<DcxdjkSaveDto>.Ok(await _svc.GetForEditAsync(id))); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpPost("save")]
|
|
public async Task<IActionResult> Save([FromBody] DcxdjkSaveDto dto)
|
|
{
|
|
try
|
|
{
|
|
var id = await _svc.SaveAsync(dto);
|
|
return Ok(ApiResult<object>.Ok(new { id }, "保存成功"));
|
|
}
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpDelete("{id}")]
|
|
public async Task<IActionResult> Delete(long id)
|
|
{
|
|
try
|
|
{
|
|
await _svc.DeleteAsync(id);
|
|
return Ok(ApiResult<object>.Ok(null, "删除成功"));
|
|
}
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
}
|
|
|
|
// ==================== 薪资价格配置 ====================
|
|
|
|
/// <summary>薪资价格配置(如「薪资.前缫」下的挡车工/车头工计件等级奖扣单价)</summary>
|
|
[ApiController]
|
|
[Route("api/payroll/xzjg")]
|
|
[Authorize]
|
|
public class XzjgController : ControllerBase
|
|
{
|
|
private readonly IXzjgService _svc;
|
|
public XzjgController(IXzjgService svc) => _svc = svc;
|
|
|
|
[HttpGet("list")]
|
|
public async Task<IActionResult> GetList([FromQuery] string group = "")
|
|
=> Ok(ApiResult<List<XzjgListItemDto>>.Ok(await _svc.GetListAsync(group ?? string.Empty)));
|
|
|
|
[HttpGet("{id}")]
|
|
public async Task<IActionResult> GetForEdit(long id)
|
|
{
|
|
try { return Ok(ApiResult<XzjgSaveDto>.Ok(await _svc.GetForEditAsync(id))); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpPost("save")]
|
|
public async Task<IActionResult> Save([FromBody] XzjgSaveDto dto)
|
|
{
|
|
try
|
|
{
|
|
var id = await _svc.SaveAsync(dto);
|
|
return Ok(ApiResult<object>.Ok(new { id }, "保存成功"));
|
|
}
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpDelete("{id}")]
|
|
public async Task<IActionResult> Delete(long id)
|
|
{
|
|
try
|
|
{
|
|
await _svc.DeleteAsync(id);
|
|
return Ok(ApiResult<object>.Ok(null, "删除成功"));
|
|
}
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
}
|