fix 餐补查询代码调整

This commit is contained in:
2024-03-20 16:40:10 +08:00
parent 21fc2f78d3
commit 0e1f6cb4a0
36 changed files with 249 additions and 612 deletions

View File

@@ -0,0 +1,35 @@
using Dlhis.Canteen.MealSupplementRecord.Request;
using Dlhis.Canteen.MealSupplementRecord.Response;
using Dlhis.Canteen.MealSupplementRecord.Services;
using Kurisu.Core.DataAccess.Dto;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Dlhis.Canteen.MealSupplementRecord.Controller;
/// <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("page")]
public async Task<Pagination<MealSupplementRecordResponse>> MealSupplementRecordPageAsync([FromQuery] MealSupplementRecordRequest request)
{
return await _mealSupplementRecordService.GetPageAsync(request);
}
}

View File

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

View File

@@ -0,0 +1,64 @@
using Dlhis.Entity.Basic.Enums;
using SqlSugar.DbConvert;
using SqlSugar;
using Kurisu.AspNetCore.Utils.Extensions;
namespace Dlhis.Canteen.MealSupplementRecord.Response;
public class MealSupplementRecordResponse
{
/// <summary>
/// 唯一号
/// </summary>
public string UniqueId { get; set; }
/// <summary>
/// 工号
/// </summary>
public string Code { get; set; }
public string UserName { get; set; }
/// <summary>
/// 餐补状态
/// </summary>
public MealSupplementStatusEnumtype Status { get; set; }
/// <summary>
/// 餐补状态
/// </summary>
public string StatusDesc => 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,10 @@
using Dlhis.Canteen.MealSupplementRecord.Request;
using Dlhis.Canteen.MealSupplementRecord.Response;
using Kurisu.Core.DataAccess.Dto;
namespace Dlhis.Canteen.MealSupplementRecord.Services;
public interface IMealSupplementRecordService : IScopeDependency
{
Task<Pagination<MealSupplementRecordResponse>> GetPageAsync(MealSupplementRecordRequest request);
}

View File

@@ -0,0 +1,46 @@
using Dlhis.Canteen.MealSupplementRecord.Request;
using Dlhis.Canteen.MealSupplementRecord.Response;
using Dlhis.Canteen.MealSupplementRecord.Services;
using Dlhis.Entity.Basic.Entity;
using Dlhis.Entity.Canteen.Entities;
using Kurisu.AspNetCore.Utils.Extensions;
using Kurisu.Core.DataAccess.Dto;
using Kurisu.SqlSugar.Extensions;
using Kurisu.SqlSugar.Services;
namespace Dlhis.Canteen.MealSupplementRecord.Services.Implements;
public class MealSupplementRecordService : IMealSupplementRecordService
{
private readonly IDbContext _dbContext;
public MealSupplementRecordService(IDbContext dbContext)
{
_dbContext = dbContext;
}
public async Task<Pagination<MealSupplementRecordResponse>> GetPageAsync(MealSupplementRecordRequest request)
{
var page = await _dbContext.Queryable<MealSupplementRecordEntity>()
.LeftJoin<GainfoEntity>((x, ga) => x.Code == ga.Code)
.WhereIF(request.Search.IsPresent(), (x, ga) => x.Code == request.Search || ga.Name.Contains(request.Search))
.Select((x, ga) => new MealSupplementRecordResponse
{
Amount = x.Amount,
Code = x.Code,
Date = x.Date,
Factory = x.Factory,
Remark = x.Remark,
Result = x.Result,
Status = x.Status,
Sync = x.Sync,
UniqueId = x.UniqueId,
UserName = ga.Name,
Workplace = x.Workplace,
})
.ToPageListAsync(request);
return page;
}
}

View File

@@ -25,10 +25,11 @@ public class BalancesController : ControllerBase
} }
/// <summary> /// <summary>
/// 获取记录分页 /// 获取所有消费记录分页
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[Authorize(Roles = "admin,tenant-admin")]
[DataPermission] [DataPermission]
[HttpGet] [HttpGet]
public async Task<Pagination<BalanceRecordResponse>> GetPageAsync([FromQuery] BalanceRecordPageRequest request) public async Task<Pagination<BalanceRecordResponse>> GetPageAsync([FromQuery] BalanceRecordPageRequest request)
@@ -154,7 +155,7 @@ public class BalancesController : ControllerBase
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpGet("spendingDetails")] [HttpGet("spendingDetails")]
public async Task<Pagination<SpendingDetailResponse>> GetSpendingDetailsAsync([FromQuery]SpendingDetailRequest request) public async Task<Pagination<SpendingDetailResponse>> GetSpendingDetailsAsync([FromQuery] SpendingDetailRequest request)
{ {
return await _balanceService.GetSpendingDetailsAsync(request); return await _balanceService.GetSpendingDetailsAsync(request);
} }
@@ -182,36 +183,13 @@ public class BalancesController : ControllerBase
} }
/// <summary> /// <summary>
/// 查询餐补 /// 查询餐补入账记录
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("balanceRecordByUser")] [HttpGet("balanceOfMealSupplementRecordByUser")]
public async Task<Pagination<BalanceRecordByUserResponse>> BalanceRecordByUserAsync([FromQuery]BalanceRecordByUserRequest request) public async Task<Pagination<BalanceRecordByUserResponse>> BalanceRecordByUserAsync([FromQuery] BalanceRecordByUserRequest request)
{ {
return await _balanceService.BalanceRecordByUserAsync(request); return await _balanceService.GetBalanceOfMealSupplementRecordByUser(request);
} }
/// <summary>
/// 电子餐券申请记录查询
/// </summary>
/// <returns></returns>
[HttpGet("oaemealvoucher")]
public async Task<Pagination<OaEMealVoucherResponse>> GetOaEMealVoucherAsync([FromQuery] OaEMealVoucherRequest request)
{
return await _balanceService.GetOaEMealVoucherAsync(request);
}
/// <summary>
/// 电子餐券使用记录查询
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpGet("oaemealvoucherdetail")]
public async Task<Pagination<OaEMealVoucherDetailResponse>> GetOaEMealVoucherDetailAsync([FromQuery] OaEMealVoucherDetailRequest request)
{
return await _balanceService.GetOaEMealVoucherDetailAsync(request);
}
} }

View File

@@ -1,8 +1,11 @@
using Kurisu.Core.DataAccess.Dto; using Kurisu.Core.DataAccess.Dto;
namespace Dlhis.Canteen.Order.Request namespace Dlhis.Canteen.Order.Request;
public class BalanceRecordByUserRequest : PageDto
{ {
public class BalanceRecordByUserRequest : PageDto /// <summary>
{ /// 用户档案号
} /// </summary>
public string UserNo { get; set; }
} }

View File

@@ -1,12 +0,0 @@
using Kurisu.Core.DataAccess.Dto;
namespace Dlhis.Canteen.Dishes.Request
{
public class OaEMealVoucherDetailRequest : PageDto
{
/// <summary>
/// 餐券id
/// </summary>
public long? OaEMealVoucherId { get; set; }
}
}

View File

@@ -1,10 +0,0 @@
using Dlhis.Entity.Canteen.Enums;
using Kurisu.Core.DataAccess.Dto;
using System.ComponentModel.DataAnnotations;
namespace Dlhis.Canteen.Dishes.Request
{
public class OaEMealVoucherRequest : PageDto
{
}
}

View File

@@ -3,126 +3,20 @@ using SqlSugar.DbConvert;
using SqlSugar; using SqlSugar;
using Kurisu.AspNetCore.Utils.Extensions; using Kurisu.AspNetCore.Utils.Extensions;
namespace Dlhis.Canteen.Order.Response namespace Dlhis.Canteen.Order.Response;
public class BalanceRecordByUserResponse
{ {
public class BalanceRecordByUserResponse
{
/// <summary> /// <summary>
/// 流水号 /// 流水号
/// </summary> /// </summary>
public string No { get; set; } public string No { get; set; }
/// <summary> /// <summary>
/// 档案号/QRCode /// 金额
/// </summary>
public string UserNo { get; set; }
/// <summary>
/// 姓名
/// </summary>
public string Name { get; set; }
/// <summary>
/// 学工号
/// </summary>
public string UserCode { get; set; }
/// <summary>
/// 部门号
/// </summary>
public string DepartmentNo { get; set; }
/// <summary>
/// 来源
/// </summary>
public BalanceRecordSourceEnumType Source { get; set; }
/// <summary>
/// 来源CN
/// </summary>
public string SourceCN => Source.GetDescription();
/// <summary>
/// 收入/支出
/// </summary>
public BalanceRecordTypeEnumType Type { get; set; }
/// <summary>
/// 收入/支出
/// </summary>
public string TypeCN => Type.GetDescription();
/// <summary>
/// 金额 + - 表示
/// </summary> /// </summary>
public decimal Amount { get; set; } public decimal Amount { get; set; }
/// <summary>
/// 营业点
/// </summary>
public Guid? BusinessPlaceCode { get; set; }
/// <summary>
/// 餐别
/// </summary>
public Guid? BusinessShiftCode { get; set; }
/// <summary>
/// 餐次
/// </summary>
public ShiftEnumType? ShiftType { get; set; }
/// <summary>
/// 餐次CN
/// </summary>
public string ShiftTypeCN => ShiftType.GetDescription();
/// <summary>
/// 所属成本日期
/// </summary>
public DateTime CostDate { get; set; }
/// <summary>
/// 消费机器唯一信息
/// </summary>
public string DeviceUniqueNo { get; set; }
/// <summary>
/// 餐补月份
/// </summary>
public string SubsidiesFromMonth { get; set; }
/// <summary>
/// Ip
/// </summary>
public string IP { get; set; }
/// <summary>
/// 成本中心
/// </summary>
public string CostId { get; set; }
/// <summary>
/// 消费者所在基地
/// </summary>
public string OriginTenantId { get; set; }
/// <summary>
/// 成本计算是否允许跨基地范围
/// </summary>
public bool IsCostCrossTenant { get; set; }
/// <summary>
/// 数据状态
/// </summary>
public BalanceRecordStatusEnumType Status { get; set; }
/// <summary>
/// 数据状态CN
/// </summary>
public string StatusCN => Status.GetDescription();
/// <summary> /// <summary>
/// 消费时间 /// 消费时间
/// </summary> /// </summary>
@@ -132,18 +26,4 @@ namespace Dlhis.Canteen.Order.Response
/// 备注 /// 备注
/// </summary> /// </summary>
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 餐饮应用类型
/// </summary>
public CanteenApplicaitonTypeEnumType ApplicationType { get; set; }
/// <summary>
/// 餐饮应用类型CN
/// </summary>
public string ApplicationTypeCN => ApplicationType.GetDescription();
public string TenantId { get; set; }
}
} }

View File

@@ -1,65 +0,0 @@
using SqlSugar;
namespace Dlhis.Canteen.Order.Response
{
public class OaEMealVoucherDetailResponse
{
public long Id { get; set; }
public long VoucherId { get; set; }
public int Sequence { get; set; }
public string DinnerType { get; set; }
/// <summary>
/// 身份证
/// </summary>
public string IdNo { get; set; }
/// <summary>
/// 用餐人
/// </summary>
public string Name { get; set; }
/// <summary>
/// 手机号
/// </summary>
public string Phone { get; set; }
/// <summary>
/// 就餐开始
/// </summary>
public DateTime Start { get; set; }
/// <summary>
/// 就餐结束
/// </summary>
public DateTime End { get; set; }
/// <summary>
/// 就餐天数
/// </summary>
public int Days { get; set; }
/// <summary>
/// 金额
/// </summary>
public decimal Amount { get; set; }
/// <summary>
/// 二维码
/// </summary>
public string QrCode { get; set; }
/// <summary>
/// 状态
/// </summary>
public string Status { get; set; }
/// <summary>
/// 信息
/// </summary>
public string Message { get; set; }
}
}

View File

@@ -1,97 +0,0 @@
namespace Dlhis.Canteen.Order.Response;
public class OaEMealVoucherResponse
{
public long Id { get; set; }
/// <summary>
/// 标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 申请人工号
/// </summary>
public string UserCode { get; set; }
/// <summary>
/// 申请人名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 基地代码
/// </summary>
public string TenantId { get; set; }
/// <summary>
/// 基地名称
/// </summary>
public string TenantName { get; set; }
/// <summary>
/// 成本中心
/// </summary>
public string CostId { get; set; }
/// <summary>
/// 成本中心名称
/// </summary>
public string CostName { get; set; }
/// <summary>
/// 来宾公司
/// </summary>
public string Company { get; set; }
/// <summary>
/// 联系人
/// </summary>
public string Phone { get; set; }
/// <summary>
/// 来宾人数
/// </summary>
public int Num { get; set; }
/// <summary>
/// 就餐食堂
/// </summary>
public string Canteen { get; set; }
/// <summary>
/// 就餐事由
/// </summary>
public string Reason { get; set; }
/// <summary>
/// 就餐次
/// </summary>
public string CanteenShift { get; set; }
/// <summary>
/// oa流程id
/// </summary>
public string OaId { get; set; }
/// <summary>
/// 部门号
/// </summary>
public string DepartmentNo { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DepartmentName { get; set; }
/// <summary>
/// 申请日期
/// </summary>
public DateTime LogDate { get; set; }
/// <summary>
/// 数据创建时间
/// </summary>
public DateTime CreateTime { get; set; }
}

View File

@@ -35,8 +35,5 @@ public interface IBalanceService : IScopeDependency
Task<Pagination<DevicePageResponse>> GetConsumeDeviceAsync(GetConsumeDeviceRequest request); Task<Pagination<DevicePageResponse>> GetConsumeDeviceAsync(GetConsumeDeviceRequest request);
Task<Pagination<OaEMealVoucherResponse>> GetOaEMealVoucherAsync([FromQuery] OaEMealVoucherRequest request); Task<Pagination<BalanceRecordByUserResponse>> GetBalanceOfMealSupplementRecordByUser(BalanceRecordByUserRequest request);
Task<Pagination<OaEMealVoucherDetailResponse>> GetOaEMealVoucherDetailAsync([FromQuery] OaEMealVoucherDetailRequest request);
Task<Pagination<BalanceRecordByUserResponse>> BalanceRecordByUserAsync(BalanceRecordByUserRequest request);
} }

View File

@@ -744,13 +744,14 @@ public class BalanceService : IBalanceService
return page; return page;
} }
public async Task<Pagination<BalanceRecordByUserResponse>> BalanceRecordByUserAsync(BalanceRecordByUserRequest request) public async Task<Pagination<BalanceRecordByUserResponse>> GetBalanceOfMealSupplementRecordByUser(BalanceRecordByUserRequest request)
{ {
var page = await _dbContext.Queryable<BalanceRecordEntity>() var page = await _dbContext.Queryable<BalanceRecordEntity>()
.WhereIF(request.Search.IsPresent(), b => b.UserNo == request.Search || b.UserCode == request.Search) .Where(x => x.Source == BalanceRecordSourceEnumType.LocalTenantSubsidies || x.Source == BalanceRecordSourceEnumType.OtherTenantSubsidies)
.Where(b => b.Source == BalanceRecordSourceEnumType.LocalTenantSubsidies || b.Source == BalanceRecordSourceEnumType.OtherTenantSubsidies) .Where(x => x.UserNo == request.UserNo)
.Select<BalanceRecordByUserResponse>() .Select<BalanceRecordByUserResponse>()
.ToPageListAsync(request); .ToPageListAsync(request);
return page; return page;
} }
@@ -851,27 +852,6 @@ public class BalanceService : IBalanceService
return list; return list;
} }
public async Task<Pagination<OaEMealVoucherResponse>> GetOaEMealVoucherAsync(OaEMealVoucherRequest request)
{
var page = await _dbContext.Queryable<OaEMealVoucherEntity>()
.WhereIF(request.Search.IsPresent(),x => x.UserCode.Contains(request.Search) || x.Name.Contains(request.Search))
.Select<OaEMealVoucherResponse>()
.ToPageListAsync(request);
return page;
}
public async Task<Pagination<OaEMealVoucherDetailResponse>> GetOaEMealVoucherDetailAsync(OaEMealVoucherDetailRequest request)
{
var page = await _dbContext.Queryable<OaEMealVoucherDetailEntity>()
.WhereIF(request.Search.IsPresent(),x => x.Name.Contains(request.Search))
.WhereIF(request.OaEMealVoucherId.HasValue, x => x.VoucherId == request.OaEMealVoucherId)
.Select<OaEMealVoucherDetailResponse>()
.ToPageListAsync(request);
return page;
}
/// <summary> /// <summary>
/// 获取当前年所有月 /// 获取当前年所有月
/// </summary> /// </summary>

View File

@@ -1,11 +1,11 @@
using Dlhis.Common.Request; using Dlhis.Common.ApiLog.Request;
using Dlhis.Common.Response; using Dlhis.Common.ApiLog.Response;
using Dlhis.Common.Services.Implements; using Dlhis.Common.ApiLog.Services.Implements;
using Kurisu.Core.DataAccess.Dto; using Kurisu.Core.DataAccess.Dto;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace Dlhis.Common.ApiLog namespace Dlhis.Common.ApiLog.Controller
{ {
/// <summary> /// <summary>
/// API日志控制器 /// API日志控制器

View File

@@ -1,7 +1,7 @@
using Kurisu.Core.DataAccess.Dto; using Kurisu.Core.DataAccess.Dto;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Dlhis.Common.Request namespace Dlhis.Common.ApiLog.Request
{ {
public class ApiLogRequest : PageDto public class ApiLogRequest : PageDto
{ {

View File

@@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Dlhis.Common.Response namespace Dlhis.Common.ApiLog.Response
{ {
public class ApiLogResponse public class ApiLogResponse
{ {

View File

@@ -1,6 +1,6 @@
using Dlhis.Common.Request; using Dlhis.Common.ApiLog.Request;
using Dlhis.Common.Response; using Dlhis.Common.ApiLog.Response;
using Dlhis.Common.Services.Implements; using Dlhis.Common.ApiLog.Services.Implements;
using Dlhis.Entity.Common; using Dlhis.Entity.Common;
using Kurisu.AspNetCore.Utils.Extensions; using Kurisu.AspNetCore.Utils.Extensions;
using Kurisu.Core.DataAccess.Dto; using Kurisu.Core.DataAccess.Dto;
@@ -8,7 +8,7 @@ using Kurisu.SqlSugar.Extensions;
using Kurisu.SqlSugar.Services; using Kurisu.SqlSugar.Services;
using SqlSugar; using SqlSugar;
namespace Dlhis.Common.Services namespace Dlhis.Common.ApiLog.Services
{ {
public class ApiLogService : IApiLogService public class ApiLogService : IApiLogService
{ {

View File

@@ -1,8 +1,8 @@
using Dlhis.Common.Request; using Dlhis.Common.ApiLog.Request;
using Dlhis.Common.Response; using Dlhis.Common.ApiLog.Response;
using Kurisu.Core.DataAccess.Dto; using Kurisu.Core.DataAccess.Dto;
namespace Dlhis.Common.Services.Implements namespace Dlhis.Common.ApiLog.Services.Implements
{ {
public interface IApiLogService : IScopeDependency public interface IApiLogService : IScopeDependency
{ {

View File

@@ -25,4 +25,8 @@
<PackageReference Include="Minio" Version="6.0.1" /> <PackageReference Include="Minio" Version="6.0.1" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Response\" />
</ItemGroup>
</Project> </Project>

View File

@@ -1,8 +1,6 @@
using Dlhis.Common.FileOperation.Request; using Dlhis.Common.FileOperation.Request;
using Dlhis.Common.FileOperation.Response; using Dlhis.Common.FileOperation.Response;
using Dlhis.Common.FileOperation.Services; using Dlhis.Common.FileOperation.Services;
using Dlhis.Common.Request;
using Dlhis.Common.Response;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Org.BouncyCastle.Asn1.Ocsp; using Org.BouncyCastle.Asn1.Ocsp;
@@ -10,8 +8,9 @@ using Org.BouncyCastle.Asn1.Ocsp;
namespace Dlhis.Common.FileOperation.Controllers; namespace Dlhis.Common.FileOperation.Controllers;
/// <summary> /// <summary>
/// 文件上传/下载 /// APK文件操作
/// </summary> /// </summary>
[Obsolete("作废重写")]
[Authorize] [Authorize]
[Route("api/[controller]")] [Route("api/[controller]")]
[ApiController] [ApiController]
@@ -28,7 +27,7 @@ public class ApkFileController : ControllerBase
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("minlo")] [HttpPost("minio")]
[RequestSizeLimit(300_000_000)] [RequestSizeLimit(300_000_000)]
public async Task<ApkFileResponse> FormSingleFileUpload([FromForm] ApkRequest request) public async Task<ApkFileResponse> FormSingleFileUpload([FromForm] ApkRequest request)
{ {
@@ -56,9 +55,6 @@ public class ApkFileController : ControllerBase
{ {
return await _apkFIileService.GetLastVersionAsync(productCode); return await _apkFIileService.GetLastVersionAsync(productCode);
} }
} }

View File

@@ -1,4 +1,4 @@
namespace Dlhis.Common.Request namespace Dlhis.Common.FileOperation.Request
{ {
public class ApkRequest public class ApkRequest
{ {
@@ -25,6 +25,6 @@
/// <summary> /// <summary>
/// 产品代码 /// 产品代码
/// </summary> /// </summary>
public string? ProductCode { get; set; } public string ProductCode { get; set; }
} }
} }

View File

@@ -4,8 +4,14 @@ namespace Dlhis.Common.FileOperation.Request;
public class UploadFileReuqest public class UploadFileReuqest
{ {
/// <summary>
/// 路由获取
/// </summary>
[FromRoute] [FromRoute]
public string Bucket { get; set; } public string Bucket { get; set; }
/// <summary>
/// 文件
/// </summary>
public IFormFile File { get; set; } public IFormFile File { get; set; }
} }

View File

@@ -1,6 +1,6 @@
using SqlSugar; using SqlSugar;
namespace Dlhis.Common.Response namespace Dlhis.Common.FileOperation.Response
{ {
public class ApkFile1Response public class ApkFile1Response
{ {

View File

@@ -1,4 +1,4 @@
namespace Dlhis.Common.Response namespace Dlhis.Common.FileOperation.Response
{ {
public class ApkFileFormLocalResponse public class ApkFileFormLocalResponse
{ {

View File

@@ -1,13 +1,13 @@
using Dlhis.Common.FileOperation.Services; using Dlhis.Common.ApiLog.Response;
using Dlhis.Common.Request; using Dlhis.Common.FileOperation.Request;
using Dlhis.Common.Response; using Dlhis.Common.FileOperation.Response;
using Dlhis.Entity.Common; using Dlhis.Entity.Common;
using Kurisu.AspNetCore.Utils.Extensions; using Kurisu.AspNetCore.Utils.Extensions;
using Kurisu.SqlSugar.Services; using Kurisu.SqlSugar.Services;
using Mapster; using Mapster;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace Dlhis.Common.Services.Implements; namespace Dlhis.Common.FileOperation.Services;
public class ApkFIileService : IApkFIileService public class ApkFIileService : IApkFIileService
{ {
@@ -173,6 +173,16 @@ public class ApkFIileService : IApkFIileService
string path = filePath + fileName; string path = filePath + fileName;
return new FileStreamResult(new FileStream(path, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName }; return new FileStreamResult(new FileStream(path, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
} }
Task<ApkFileResponse> IApkFIileService.FormSingleFileUpload(ApkRequest request)
{
throw new NotImplementedException();
}
public Task<ApkFileResponse> GetLastVersionAsync(string productCode)
{
throw new NotImplementedException();
}
} }

View File

@@ -1,7 +1,5 @@
using Dlhis.Common.FileOperation.Request; using Dlhis.Common.FileOperation.Request;
using Dlhis.Common.FileOperation.Response; using Dlhis.Common.FileOperation.Response;
using Dlhis.Common.Request;
using Dlhis.Common.Response;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace Dlhis.Common.FileOperation.Services; namespace Dlhis.Common.FileOperation.Services;
@@ -23,8 +21,6 @@ public interface IApkFIileService : IScopeDependency
Task<ApkFileResponse> GetLastVersionAsync(string productCode); Task<ApkFileResponse> GetLastVersionAsync(string productCode);
} }

View File

@@ -1,4 +1,4 @@
using Dlhis.Common.Request; using Dlhis.Common.FileOperation.Request;
namespace Dlhis.Common.FileOperation.Services; namespace Dlhis.Common.FileOperation.Services;

View File

@@ -1,8 +1,6 @@
using Dlhis.Common.FileOperation.Request; using Dlhis.Common.FileOperation.Request;
using Dlhis.Common.FileOperation.Response; using Dlhis.Common.FileOperation.Response;
using Dlhis.Common.FileOperation.Services; using Dlhis.Common.FileOperation.Services;
using Dlhis.Common.Request;
using Dlhis.Common.Response;
using Dlhis.Entity.Common; using Dlhis.Entity.Common;
using Kurisu.AspNetCore.Utils.Extensions; using Kurisu.AspNetCore.Utils.Extensions;
using Kurisu.SqlSugar.Services; using Kurisu.SqlSugar.Services;

View File

@@ -1,6 +1,5 @@
using Dlhis.Common.FileOperation.Configurations; using Dlhis.Common.FileOperation.Configurations;
using Dlhis.Common.FileOperation.Request; using Dlhis.Common.FileOperation.Request;
using Dlhis.Common.Request;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Minio; using Minio;
using Minio.DataModel.Args; using Minio.DataModel.Args;

View File

@@ -1,36 +0,0 @@
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

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

View File

@@ -1,62 +0,0 @@
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

@@ -1,40 +0,0 @@
using Dlhis.Common.Request;
using Dlhis.Common.Response;
using Microsoft.AspNetCore.Mvc;
namespace Dlhis.Common.Services;
public interface IApkFIileService : IScopeDependency
{
/// <summary>
/// 文件上传
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<ApkFile1Response> FormSingleFileUpload(ApkRequest request);
/// <summary>
/// 文件下载
/// </summary>
/// <returns></returns>
Task<string> RequestDownloadFile(string fileName);
/// <summary>
/// 本地上传
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<ApkFileFormLocalResponse> FormLocalFileUpload(ApkRequest request);
Task<ApkFileFormLocalResponse> LatestFile(string fileName);
/// <summary>
/// 本地下载
/// </summary>
/// <param name="fileName"></param>
/// <returns></returns>
IActionResult FormLocalDownloadFile(string fileName);
}

View File

@@ -1,11 +0,0 @@
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

@@ -1,31 +0,0 @@
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;
}
}
}