新增工资/仓储/生产日报等模块,移除旧考勤模块
- 新增 PayRoll(工资)、Wms(仓储)、Prod(车速/缫丝/考勤/丝片检测/丝片台账/纤检日报/质量日报) 模块 - 新增对应 Domain 实体、Application DTO/Service、Api Controller 与前端页面 - 移除旧 Attendance 考勤模块(Controller/Service/Entity/DTO 及 5 个前端页面),由 Prod/Kaoqin 取代 - 调整路由、仪表盘、Lsjl 流丝记录实体与服务 - 更新业务种子数据与 DbSeeder - 补充工作进度文档 14-27
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
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>薪资计算-挡车/车头产量计算(对应 F9 薪资-挡车车头产量计算 CALCLDCCT)</summary>
|
||||
[ApiController]
|
||||
[Route("api/payroll/calcldcct")]
|
||||
[Authorize]
|
||||
public class CalcLdcctController : ControllerBase
|
||||
{
|
||||
private readonly ICalcLdcctService _svc;
|
||||
public CalcLdcctController(ICalcLdcctService svc) => _svc = svc;
|
||||
|
||||
/// <summary>列表(账期起止 + 部门 + 工种 + 姓名/庄口关键字)</summary>
|
||||
[HttpGet("list")]
|
||||
public async Task<IActionResult> GetPaged([FromQuery] DateTime start, [FromQuery] DateTime end,
|
||||
[FromQuery] long? depId = null, [FromQuery] long? worktypeId = null,
|
||||
[FromQuery] string like = "", [FromQuery] int pageIndex = 1, [FromQuery] int pageSize = 50)
|
||||
=> Ok(ApiResult<PageResult<CalcLdcctListItemDto>>.Ok(
|
||||
await _svc.GetPagedAsync(pageIndex, pageSize, start, end, depId, worktypeId, like ?? string.Empty)));
|
||||
|
||||
/// <summary>一键计算(挡车工):整账期 + 部门 + 工种全量覆盖</summary>
|
||||
[HttpPost("calc-dcg")]
|
||||
public async Task<IActionResult> CalcDcg([FromBody] CalcLdcctCalcDto dto)
|
||||
{
|
||||
try { return Ok(ApiResult<CalcLdcctResultDto>.Ok(await _svc.CalcDcgAsync(dto), "计算完成")); }
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
|
||||
/// <summary>一键计算(车头工):依赖已存的挡车工产量</summary>
|
||||
[HttpPost("calc-ctg")]
|
||||
public async Task<IActionResult> CalcCtg([FromBody] CalcLdcctCalcDto dto)
|
||||
{
|
||||
try { return Ok(ApiResult<CalcLdcctResultDto>.Ok(await _svc.CalcCtgAsync(dto), "计算完成")); }
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
|
||||
/// <summary>保存人工微调结果(整账期 + 部门 + 工种全量覆盖)</summary>
|
||||
[HttpPost("save")]
|
||||
public async Task<IActionResult> Save([FromBody] CalcLdcctSaveDto dto)
|
||||
{
|
||||
try
|
||||
{
|
||||
var count = await _svc.SaveAsync(dto);
|
||||
return Ok(ApiResult<object>.Ok(new { count }, "保存成功"));
|
||||
}
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
|
||||
/// <summary>删除整账期 + 部门 + 工种的计算结果</summary>
|
||||
[HttpDelete]
|
||||
public async Task<IActionResult> Delete([FromQuery] DateTime start, [FromQuery] DateTime end,
|
||||
[FromQuery] long depId, [FromQuery] long worktypeId)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _svc.DeleteAsync(start, end, depId, worktypeId);
|
||||
return Ok(ApiResult<object>.Ok(null, "删除成功"));
|
||||
}
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
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); }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
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)); }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user