fix 餐补查询及日志删除

This commit is contained in:
cheche
2024-03-20 15:27:37 +08:00
parent 1ce60bedc2
commit a90d4e66a7
14 changed files with 334 additions and 10 deletions

View File

@@ -0,0 +1,36 @@
using Dlhis.Common.Request;
using Dlhis.Common.Response;
using Dlhis.Common.Services;
using Kurisu.Core.DataAccess.Dto;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Dlhis.Common.MealSupplementRecord
{
/// <summary>
/// 餐补控制器
/// </summary>
[Authorize]
[Route("api/[controller]")]
[ApiController]
public class MealSupplementRecordController
{
private readonly IMealSupplementRecordService _mealSupplementRecordService;
public MealSupplementRecordController(IMealSupplementRecordService mealSupplementRecordService)
{
_mealSupplementRecordService = mealSupplementRecordService;
}
/// <summary>
/// 餐补分页
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpGet("mealSupplementRecordPage")]
public async Task<Pagination<MealSupplementRecordResponse>> MealSupplementRecordPageAsync([FromQuery]MealSupplementRecordRequest request)
{
return await _mealSupplementRecordService.MealSupplementRecordPageAsync(request);
}
}
}

View File

@@ -0,0 +1,9 @@
using Kurisu.Core.DataAccess.Dto;
namespace Dlhis.Common.Request
{
public class MealSupplementRecordRequest : PageDto
{
}
}

View File

@@ -0,0 +1,62 @@
using Dlhis.Entity.Basic.Enums;
using SqlSugar.DbConvert;
using SqlSugar;
using Kurisu.AspNetCore.Utils.Extensions;
namespace Dlhis.Common.Response
{
public class MealSupplementRecordResponse
{
/// <summary>
/// 唯一号
/// </summary>
public string UniqueId { get; set; }
/// <summary>
/// 工号
/// </summary>
public string Code { get; set; }
/// <summary>
/// 餐补状态
/// </summary>
public MealSupplementStatusEnumtype Status { get; set; }
/// <summary>
/// 餐补状态CN
/// </summary>
public string StatusCN => Status.GetDescription();
/// <summary>
/// 考勤日期
/// </summary>
public DateTime Date { get; set; }
/// <summary>
/// 工作地
/// </summary>
public string Workplace { get; set; }
/// <summary>
/// 厂区
/// </summary>
public string Factory { get; set; }
public string Remark { get; set; }
/// <summary>
/// 餐补
/// </summary>
public decimal Amount { get; set; }
/// <summary>
/// 处理结果
/// </summary>
public string Result { get; set; }
/// <summary>
/// 状态同步
/// </summary>
public bool Sync { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
using Dlhis.Common.Request;
using Dlhis.Common.Response;
using Kurisu.Core.DataAccess.Dto;
namespace Dlhis.Common.Services
{
public interface IMealSupplementRecordService : IScopeDependency
{
Task<Pagination<MealSupplementRecordResponse>> MealSupplementRecordPageAsync(MealSupplementRecordRequest request);
}
}

View File

@@ -0,0 +1,31 @@
using Dlhis.Common.Request;
using Dlhis.Common.Response;
using Dlhis.Entity.Basic.Entity;
using Kurisu.AspNetCore.Utils.Extensions;
using Kurisu.Core.DataAccess.Dto;
using Kurisu.SqlSugar.Extensions;
using Kurisu.SqlSugar.Services;
namespace Dlhis.Common.Services.Implements
{
public class MealSupplementRecordService : IMealSupplementRecordService
{
private readonly IDbContext _dbContext;
public MealSupplementRecordService(IDbContext dbContext)
{
_dbContext = dbContext;
}
public async Task<Pagination<MealSupplementRecordResponse>> MealSupplementRecordPageAsync(MealSupplementRecordRequest request)
{
var page = await _dbContext.Queryable<MealSupplementRecordEntity>()
.WhereIF(request.Search.IsPresent(), x => x.Code.Contains(request.Search))
.Select<MealSupplementRecordResponse>()
.ToPageListAsync(request);
return page;
}
}
}