feat 本地上传

This commit is contained in:
cheche
2024-01-26 09:27:09 +08:00
parent b371a5b73e
commit 3b0f923c46
8 changed files with 174 additions and 21 deletions

View File

@@ -8,7 +8,6 @@ namespace Dlhis.Canteen.Order.Request
/// <summary>
/// 成本中心
/// </summary>
[Required(ErrorMessage = "成本中心号不能为空")]
public string CostId { get; set; }
/// <summary>

View File

@@ -8,7 +8,6 @@ namespace Dlhis.Canteen.Order.Request
/// <summary>
/// 成本中心
/// </summary>
[Required(ErrorMessage = "成本中心号不能为空")]
public string CostId { get; set; }
/// <summary>

View File

@@ -3,9 +3,12 @@ using Dlhis.Canteen.Order.Response;
using Dlhis.Entity.Basic.Entity;
using Dlhis.Entity.Canteen.Entities;
using Dlhis.Entity.Canteen.Enums;
using Dlhis.Entity.Device.Entities;
using Dlhis.Entity.Device.Enums;
using Kurisu.AspNetCore.UnifyResultAndValidation;
using Kurisu.AspNetCore.Utils.Extensions;
using Kurisu.Core.DataAccess.Dto;
using Kurisu.Core.DataAccess.Entity;
using Kurisu.Core.User.Abstractions;
using Kurisu.SqlSugar.Attributes;
using Kurisu.SqlSugar.Extensions;
@@ -81,6 +84,7 @@ public class BalanceService : IBalanceService
.WhereIF(!request.UserCode.IsEmpty(), record => record.UserCode == request.UserCode)
.WhereIF(!request.DepartmentNo.IsEmpty(), record => record.DepartmentNo == request.DepartmentNo)
.WhereIF(!request.OriginTenantId.IsEmpty(), record => record.OriginTenantId == request.OriginTenantId)
.WhereIF(!request.CostId.IsEmpty(), record => record.CostId == request.CostId)
.WhereIF(request.StartDatetime.HasValue, record => record.CostDateTime >= request.StartDatetime)
.WhereIF(request.EndDatetime.HasValue, record => record.CostDateTime <= request.EndDatetime)
.Where(record => record.Type == BalanceRecordTypeEnumType.Out)
@@ -519,27 +523,41 @@ public class BalanceService : IBalanceService
throw new UserFriendlyException("操作失败,请重试");
}
private async Task<Dictionary<string, string>> GetShiftCode()
[IgnoreTenant]
public async Task<Dictionary<string, string>> GetShiftCode()
{
var shiftCodeDict = new Dictionary<string, string>();
_dbContext.Client.QueryFilter.ClearAndBackup<ITenantId>();
try
{
var shiftCodeDict = new Dictionary<string, string>();
var shifts = await _dbContext.Queryable<CanteenBusinessShiftEntity>().ToListAsync();
//guid
var breakfastCode = shifts.Where(x=>x.CustomCode == "shift-breakfast").Select(x => x.Code).First().ToString();
var shifts = await _dbContext.Queryable<CanteenBusinessShiftEntity>().ToListAsync();
//guid
var breakfastCode = shifts.Where(x => x.CustomCode == "shift-breakfast").Select(x => x.Code).First().ToString();
var lunchCode = shifts.Where(x => x.CustomCode == "shift-lunch").Select(x => x.Code).First().ToString();
var lunchCode = shifts.Where(x => x.CustomCode == "shift-lunch").Select(x => x.Code).First().ToString();
var dinnerCode = shifts.Where(x => x.CustomCode == "shift-dinner").Select(x => x.Code).First().ToString();
var dinnerCode = shifts.Where(x => x.CustomCode == "shift-dinner").Select(x => x.Code).First().ToString();
var lateNightCode = shifts.Where(x => x.CustomCode == "shift-midnightsnack").Select(x => x.Code).First().ToString();
var lateNightCode = shifts.Where(x => x.CustomCode == "shift-midnightsnack").Select(x => x.Code).First().ToString();
shiftCodeDict.Add("Breakfast", breakfastCode.ToString());
shiftCodeDict.Add("Lunch", lunchCode.ToString());
shiftCodeDict.Add("Dinner", dinnerCode.ToString());
shiftCodeDict.Add("LateNight", lateNightCode.ToString());
shiftCodeDict.Add("Breakfast", breakfastCode.ToString());
shiftCodeDict.Add("Lunch", lunchCode.ToString());
shiftCodeDict.Add("Dinner", dinnerCode.ToString());
shiftCodeDict.Add("LateNight", lateNightCode.ToString());
return shiftCodeDict;
return shiftCodeDict;
}
catch (Exception ex)
{
_logger.LogError(ex, $"生成{DeviceTaskEnumType.UploadRecord.GetDescription()}任务失败:" + ex.Message);
return null;
}
finally
{
_dbContext.Client.QueryFilter.Restore();
}
}
}