feat 外包人员,框架升级
This commit is contained in:
@@ -35,8 +35,4 @@
|
||||
<Folder Include="OaEMealVoucher\Services\Implements\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.8.5" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using Dlhis.Canteen.MealSupplementRecord.Request;
|
||||
using Dlhis.Canteen.MealSupplementRecord.Response;
|
||||
using Dlhis.Canteen.MealSupplementRecord.Services;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
|
||||
namespace Dlhis.Canteen.MealSupplementRecord.Request;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.MealSupplementRecord.Request;
|
||||
|
||||
@@ -43,4 +43,4 @@ public class MealSupplementRecordRequest : PageDto, IValidatableObject
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using Dlhis.Canteen.MealSupplementRecord.Request;
|
||||
using Dlhis.Canteen.MealSupplementRecord.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.MealSupplementRecord.Services;
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ using Dlhis.Entity.Basic.Enums;
|
||||
using Dlhis.Entity.Canteen.Entities;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Dlhis.Sys.Api;
|
||||
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
using Kurisu.AspNetCore.Utils;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Canteen.MealSupplementRecord.Services.Implements;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
using Dlhis.Canteen.Dishes.Request;
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Dlhis.Canteen.Order.Services;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Controllers;
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Dlhis.Canteen.Order.Services;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Canteen.Dishes.Controllers;
|
||||
namespace Dlhis.Canteen.Order.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 充值/消费
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Dlhis.Canteen.Order.Services;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.Core.Result;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
@@ -90,7 +90,6 @@ public class OrdersController : ControllerBase
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 取消订单
|
||||
/// </summary>
|
||||
@@ -129,4 +128,4 @@ public class OrdersController : ControllerBase
|
||||
{
|
||||
return await _bookingOrderService.GetBookingPageAsync(request);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Request
|
||||
{
|
||||
|
||||
@@ -1,26 +1,25 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Request
|
||||
namespace Dlhis.Canteen.Order.Request;
|
||||
|
||||
public class BalanceRecordAnalysisRequest : PageDto, IValidatableObject
|
||||
{
|
||||
public class BalanceRecordAnalysisRequest : PageDto, IValidatableObject
|
||||
public DateTimePeriod SearchDateTimePeriod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 营业点
|
||||
/// </summary>
|
||||
public Guid? BusinessPlaceCode { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
public DateTimePeriod SearchDateTimePeriod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 营业点
|
||||
/// </summary>
|
||||
public Guid? BusinessPlaceCode { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
if (SearchDateTimePeriod != null && SearchDateTimePeriod.End.HasValue)
|
||||
{
|
||||
if (SearchDateTimePeriod != null && SearchDateTimePeriod.End.HasValue)
|
||||
{
|
||||
SearchDateTimePeriod.End = SearchDateTimePeriod.End.Value.AddDays(1).AddSeconds(-1);
|
||||
}
|
||||
|
||||
yield break;
|
||||
SearchDateTimePeriod.End = SearchDateTimePeriod.End.Value.AddDays(1).AddSeconds(-1);
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,38 +1,36 @@
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Dishes.Request
|
||||
namespace Dlhis.Canteen.Order.Request;
|
||||
|
||||
public class BalanceRecordPageByCostIdRequest :PageDto
|
||||
{
|
||||
public class BalanceRecordPageByCostIdRequest :PageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 成本中心
|
||||
/// </summary>
|
||||
public string CostId { get; set; }
|
||||
/// <summary>
|
||||
/// 成本中心
|
||||
/// </summary>
|
||||
public string CostId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 学工号
|
||||
/// </summary>
|
||||
public string UserCode { get; set; }
|
||||
/// <summary>
|
||||
/// 学工号
|
||||
/// </summary>
|
||||
public string UserCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始日期
|
||||
/// </summary>
|
||||
public DateTime? StartDatetime { get; set; }
|
||||
/// <summary>
|
||||
/// 开始日期
|
||||
/// </summary>
|
||||
public DateTime? StartDatetime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束日期
|
||||
/// </summary>
|
||||
public DateTime? EndDatetime { get; set; }
|
||||
/// <summary>
|
||||
/// 结束日期
|
||||
/// </summary>
|
||||
public DateTime? EndDatetime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门号
|
||||
/// </summary>
|
||||
public string DepartmentNo { get; set; }
|
||||
/// <summary>
|
||||
/// 部门号
|
||||
/// </summary>
|
||||
public string DepartmentNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 人事范围
|
||||
/// </summary>
|
||||
public string OriginTenantId { get; set; }
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 人事范围
|
||||
/// </summary>
|
||||
public string OriginTenantId { get; set; }
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Dishes.Request;
|
||||
namespace Dlhis.Canteen.Order.Request;
|
||||
|
||||
public class BalanceRecordPageByDeviceUniqueNoRequest : PageDto
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Request;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Dishes.Request;
|
||||
namespace Dlhis.Canteen.Order.Request;
|
||||
|
||||
public class BalanceRecordPageRequest : PageDto, IValidatableObject
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Dishes.Request
|
||||
namespace Dlhis.Canteen.Order.Request
|
||||
{
|
||||
public class BalanceRecordSummaryRequest : PageDto
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Request;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Dishes.Request;
|
||||
namespace Dlhis.Canteen.Order.Request;
|
||||
|
||||
public class GetConsumeDeviceRequest : PageDto
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Request;
|
||||
|
||||
@@ -28,5 +28,5 @@ public class OrderBookingPageRequest : PageDto
|
||||
/// 餐次
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(ShiftEnumType))]
|
||||
public ShiftEnumType? ShiftTpe { get; set; }
|
||||
public ShiftEnumType? ShiftType { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Request
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Response;
|
||||
|
||||
@@ -19,4 +19,4 @@ public class BalanceRecordAnalysisResponse
|
||||
/// 总人数
|
||||
/// </summary>
|
||||
public int Total { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Response;
|
||||
@@ -109,4 +109,4 @@ public class BalanceRecordDetailPageResponse
|
||||
/// 人事范围
|
||||
/// </summary>
|
||||
public string Werks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Response;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
using Dlhis.Canteen.Setting.Services;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Services;
|
||||
@@ -70,6 +70,7 @@ public abstract class BaseOrderService
|
||||
{
|
||||
gainfo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.Code == jinkoCode).FirstAsync();
|
||||
}
|
||||
|
||||
_settings = await _canteenSettingService.GetUserSettingAsync(gainfo.No, tenantId);
|
||||
}
|
||||
|
||||
@@ -93,4 +94,4 @@ public abstract class BaseOrderService
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using Dlhis.Canteen.Dishes.Request;
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Services;
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using Dlhis.Canteen.Dishes.Request;
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Services;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Dlhis.Canteen.Dishes.Request;
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Services;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.Core.Result;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Services;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Dlhis.Basic.Api;
|
||||
using Dlhis.Canteen.Dishes.Request;
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Dlhis.Canteen.Setting.Services;
|
||||
@@ -9,12 +8,12 @@ using Dlhis.Entity.Canteen.Enums;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Dlhis.Sys.Api;
|
||||
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
using Kurisu.AspNetCore.Utils;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Dlhis.Entity.Canteen.Entities;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.Core.DataAccess.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.Extensions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Services.Implements;
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@ using Dlhis.Entity.Canteen.Entities;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.AspNetCore.Utils;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
using Dlhis.Canteen.Setting.Services;
|
||||
using Dlhis.Basic.Api;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
using SqlSugar;
|
||||
using Mapster;
|
||||
|
||||
@@ -171,7 +171,7 @@ public class BookingOrderService : BaseOrderService, IBookingOrderService
|
||||
.Where(p => p.BookingDate <= request.BookingPeriod.End)
|
||||
.Any()
|
||||
)
|
||||
.WhereIF(request.ShiftTpe.HasValue, x => x.ShiftType == request.ShiftTpe)
|
||||
.WhereIF(request.ShiftType.HasValue, x => x.ShiftType == request.ShiftType)
|
||||
.Select((x, ga, dept) => new OrderBookingResponse
|
||||
{
|
||||
No = x.No,
|
||||
|
||||
@@ -7,18 +7,16 @@ using Dlhis.Entity.Canteen.Enums;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Kurisu.AspNetCore.Utils;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
using SqlSugar;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Dlhis.Canteen.Dishes;
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Kurisu.Core.Result;
|
||||
using Org.BouncyCastle.Asn1.Ocsp;
|
||||
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Services.Implements;
|
||||
|
||||
@@ -108,18 +106,18 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
|
||||
//获取人员余额
|
||||
var data = await DbContext.Queryable<GainfoEntity>()
|
||||
.LeftJoin<DepartmentEntity>((ga, department) => ga.DepartmentNo == department.No)
|
||||
.LeftJoin<GainfoMealEntity>((ga, department, mealUser) => ga.No == mealUser.UserNo)
|
||||
.Where(ga => ga.Id == gainfo.Id)
|
||||
.Select((ga, department, mealUser) => new OrderResultResponse
|
||||
{
|
||||
UserCode = ga.Code,
|
||||
UserName = ga.Name,
|
||||
DepartmentNo = ga.DepartmentNo,
|
||||
DepartmentName = department.Name,
|
||||
CurrentBalance = mealUser.Balance
|
||||
})
|
||||
.SingleAsync();
|
||||
.LeftJoin<DepartmentEntity>((ga, department) => ga.DepartmentNo == department.No)
|
||||
.LeftJoin<GainfoMealEntity>((ga, department, mealUser) => ga.No == mealUser.UserNo)
|
||||
.Where(ga => ga.Id == gainfo.Id)
|
||||
.Select((ga, department, mealUser) => new OrderResultResponse
|
||||
{
|
||||
UserCode = ga.Code,
|
||||
UserName = ga.Name,
|
||||
DepartmentNo = ga.DepartmentNo,
|
||||
DepartmentName = department.Name,
|
||||
CurrentBalance = mealUser.Balance
|
||||
})
|
||||
.SingleAsync();
|
||||
|
||||
return new DefaultApiResult<OrderResultResponse>
|
||||
{
|
||||
@@ -132,9 +130,9 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
private async Task<bool> ToCheckAsync(string thirdNo)
|
||||
{
|
||||
var order = await DbContext.Queryable<CanteenOrderEntity>()
|
||||
.Where(x => x.ThirdNo == thirdNo)
|
||||
.OrderBy(x => x.CreateTime, OrderByType.Desc)
|
||||
.FirstAsync();
|
||||
.Where(x => x.ThirdNo == thirdNo)
|
||||
.OrderBy(x => x.CreateTime, OrderByType.Desc)
|
||||
.FirstAsync();
|
||||
|
||||
if (order == null)
|
||||
{
|
||||
@@ -152,10 +150,6 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
|
||||
private async Task HandleOfflineAsync(ConsumeRequest request, GainfoEntity gainfo)
|
||||
{
|
||||
var device = await DbContext.Queryable<DeviceEntity>()
|
||||
.Where(x => x.UniqueNo == request.DeviceUniqueNo)
|
||||
.FirstAsync();
|
||||
|
||||
var registry = await DbContext.Queryable<DeviceRegistryEntity>()
|
||||
.Where(x => x.DeviceUniqueNo == request.DeviceUniqueNo)
|
||||
.FirstAsync();
|
||||
@@ -179,7 +173,6 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
{
|
||||
Start = x.Start,
|
||||
End = x.End
|
||||
|
||||
}.IsPresent1(request.CostDateTime));
|
||||
|
||||
var costDate = await GetCostDateAsync(shift, request.CostDateTime);
|
||||
@@ -263,17 +256,16 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
gainfoMeal.Balance += order.Amount;
|
||||
|
||||
await DbContext.Updateable<GainfoMealEntity>()
|
||||
.SetColumns(x => x.Balance == gainfoMeal.Balance)
|
||||
.SetColumns(x => x.Version == x.Version + 1)
|
||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||
.Where(x => x.UserNo == order.UserNo && x.Version == gainfoMeal.Version)//必须与查询时的version一致
|
||||
.ExecuteCommandThrowVersionAsync();
|
||||
.SetColumns(x => x.Balance == gainfoMeal.Balance)
|
||||
.SetColumns(x => x.Version == x.Version + 1)
|
||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||
.Where(x => x.UserNo == order.UserNo && x.Version == gainfoMeal.Version) //必须与查询时的version一致
|
||||
.ExecuteCommandThrowVersionAsync();
|
||||
}
|
||||
|
||||
//写入记录
|
||||
var balanceRecord = order.Adapt<BalanceRecordEntity>();
|
||||
await DbContext.InsertAsync(balanceRecord);
|
||||
|
||||
}, 5);
|
||||
}
|
||||
|
||||
@@ -312,7 +304,6 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
{
|
||||
Start = x.Start,
|
||||
End = x.End
|
||||
|
||||
}.IsPresent1(request.CostDateTime));
|
||||
shift.ThrowIfNull("非就餐时间,无法消费");
|
||||
|
||||
@@ -374,10 +365,10 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
}
|
||||
|
||||
await DbContext.Updateable<CanteenOrderEntity>()
|
||||
.SetColumns(x => x.OrderStatus == CanteenOrderStatusEnumType.Success)
|
||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||
.Where(x => x.Id == orderId)
|
||||
.ExecuteCommandAsync();
|
||||
.SetColumns(x => x.OrderStatus == CanteenOrderStatusEnumType.Success)
|
||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||
.Where(x => x.Id == orderId)
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task<Pagination<OrderAggregationResponse>> GetOrdersAggregationAsync(PageDto page)
|
||||
@@ -391,39 +382,36 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
}
|
||||
|
||||
var pageResult = await DbContext.Queryable<CanteenOrderEntity>().Where(x => x.UserNo == gainfo.No)
|
||||
.LeftJoin<BusinessPlaceEntity>((x, bplace) => x.BusinessPlaceCode == bplace.Code)
|
||||
.Where(x => x.ApplicationType == CanteenApplicaitonTypeEnumType.Booking)
|
||||
.OrderBy(x => x.CreateTime, OrderByType.Desc)
|
||||
.Select((x, bplace) => new OrderAggregationResponse
|
||||
{
|
||||
No = x.No,
|
||||
BusinessPlaceName = bplace.Name,
|
||||
CreateTime = x.CreateTime,
|
||||
Remark = x.Remark,
|
||||
OrderStatus = x.OrderStatus,
|
||||
})
|
||||
.ToPageListAsync(page);
|
||||
.LeftJoin<BusinessPlaceEntity>((x, bplace) => x.BusinessPlaceCode == bplace.Code)
|
||||
.Where(x => x.ApplicationType == CanteenApplicaitonTypeEnumType.Booking)
|
||||
.OrderBy(x => x.CreateTime, OrderByType.Desc)
|
||||
.Select((x, bplace) => new OrderAggregationResponse
|
||||
{
|
||||
No = x.No,
|
||||
BusinessPlaceName = bplace.Name,
|
||||
CreateTime = x.CreateTime,
|
||||
Remark = x.Remark,
|
||||
OrderStatus = x.OrderStatus,
|
||||
})
|
||||
.ToPageListAsync(page);
|
||||
|
||||
var nos = pageResult.Data.Select(x => x.No).ToList();
|
||||
var dtos = await DbContext.Queryable<CanteenOrderDetailEntity>()
|
||||
.LeftJoin<DishesEntity>((x, d) => x.DishesCode == d.CustomCode)
|
||||
.Where(x => nos.Contains(x.OrderNo))
|
||||
.Select((x, d) => new DishesDto
|
||||
{
|
||||
No = x.OrderNo,
|
||||
DishesCode = x.DishesCode,
|
||||
Name = d.Name,
|
||||
ImageUrl = d.ImageUrl,
|
||||
Number = x.Number,
|
||||
Price = x.Price,
|
||||
})
|
||||
.ToListAsync();
|
||||
.LeftJoin<DishesEntity>((x, d) => x.DishesCode == d.CustomCode)
|
||||
.Where(x => nos.Contains(x.OrderNo))
|
||||
.Select((x, d) => new DishesDto
|
||||
{
|
||||
No = x.OrderNo,
|
||||
DishesCode = x.DishesCode,
|
||||
Name = d.Name,
|
||||
ImageUrl = d.ImageUrl,
|
||||
Number = x.Number,
|
||||
Price = x.Price,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
|
||||
pageResult.Data.ForEach(item =>
|
||||
{
|
||||
item.Dishes = dtos.Where(x => x.No == item.No).ToList();
|
||||
});
|
||||
pageResult.Data.ForEach(item => { item.Dishes = dtos.Where(x => x.No == item.No).ToList(); });
|
||||
|
||||
return pageResult;
|
||||
}
|
||||
@@ -432,19 +420,19 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
public async Task UpdateOffline(UpdateOfflineRequest outRequest)
|
||||
{
|
||||
var orders = await DbContext.Queryable<CanteenOrderEntity>().Where(x => x.IsOffline)
|
||||
.Where(x => x.Status == BalanceRecordStatusEnumType.Valid)
|
||||
.Where(x => x.OrderStatus == CanteenOrderStatusEnumType.Success)
|
||||
.Where(x => x.ApplicationType == CanteenApplicaitonTypeEnumType.Device)
|
||||
.Where(x => SqlFunc.IsNullOrEmpty(x.BusinessShiftCode))
|
||||
.WhereIF(outRequest.No.IsPresent(), x => x.No == outRequest.No)
|
||||
.ToListAsync();
|
||||
.Where(x => x.Status == BalanceRecordStatusEnumType.Valid)
|
||||
.Where(x => x.OrderStatus == CanteenOrderStatusEnumType.Success)
|
||||
.Where(x => x.ApplicationType == CanteenApplicaitonTypeEnumType.Device)
|
||||
.Where(x => SqlFunc.IsNullOrEmpty(x.BusinessShiftCode))
|
||||
.WhereIF(outRequest.No.IsPresent(), x => x.No == outRequest.No)
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var item in orders)
|
||||
{
|
||||
var request = item.RequestJson.ToObject<ConsumeRequest>();
|
||||
var device = await DbContext.Queryable<DeviceEntity>()
|
||||
.Where(x => x.UniqueNo == request.DeviceUniqueNo)
|
||||
.FirstAsync();
|
||||
.Where(x => x.UniqueNo == request.DeviceUniqueNo)
|
||||
.FirstAsync();
|
||||
|
||||
var registry = await DbContext.Queryable<DeviceRegistryEntity>()
|
||||
.Where(x => x.DeviceUniqueNo == request.DeviceUniqueNo)
|
||||
@@ -469,7 +457,6 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
{
|
||||
Start = x.Start,
|
||||
End = x.End
|
||||
|
||||
}.IsPresent1(request.CostDateTime));
|
||||
|
||||
var costDate = await GetCostDateAsync(shift, request.CostDateTime);
|
||||
@@ -521,7 +508,6 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 验证参数
|
||||
/// </summary>
|
||||
@@ -543,9 +529,9 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
|
||||
//超市营业点
|
||||
var supermarketCodes = await DbContext.Queryable<BusinessPlaceEntity>()
|
||||
.Where(x => x.Catalog == CanteenBusinessPlaceCatalogEnumType.Supermarket)
|
||||
.Select(x => x.Code)
|
||||
.ToListAsync();
|
||||
.Where(x => x.Catalog == CanteenBusinessPlaceCatalogEnumType.Supermarket)
|
||||
.Select(x => x.Code)
|
||||
.ToListAsync();
|
||||
|
||||
//一天消费金额
|
||||
var dayCostMax = await GetSettingAsync<decimal>(order.TenantId, CanteenSettingItemEnumType.DayCostMax);
|
||||
@@ -618,17 +604,16 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
}
|
||||
|
||||
await DbContext.Updateable<GainfoMealEntity>()
|
||||
.SetColumns(x => x.Balance == gainfoMeal.Balance)
|
||||
.SetColumns(x => x.Version == x.Version + 1)
|
||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||
.Where(x => x.UserNo == order.UserNo && x.Version == gainfoMeal.Version)//必须与查询时的version一致
|
||||
.ExecuteCommandThrowVersionAsync();
|
||||
.SetColumns(x => x.Balance == gainfoMeal.Balance)
|
||||
.SetColumns(x => x.Version == x.Version + 1)
|
||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||
.Where(x => x.UserNo == order.UserNo && x.Version == gainfoMeal.Version) //必须与查询时的version一致
|
||||
.ExecuteCommandThrowVersionAsync();
|
||||
}
|
||||
|
||||
//写入记录
|
||||
var balanceRecord = order.Adapt<BalanceRecordEntity>();
|
||||
await DbContext.InsertAsync(balanceRecord);
|
||||
|
||||
}, 5);
|
||||
}
|
||||
|
||||
@@ -638,10 +623,10 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
var nos = await DbContext.Queryable<BalanceRecordEntity>().Where(x => x.UserCode == request.UserCode).Select(x => x.No).ToListAsync();
|
||||
|
||||
var orders = await DbContext.Queryable<CanteenOrderEntity>()
|
||||
.Where(x => x.IsOffline)
|
||||
.Where(x => !nos.Contains(x.No))
|
||||
.Where(x => x.UserCode == request.UserCode)
|
||||
.ToListAsync();
|
||||
.Where(x => x.IsOffline)
|
||||
.Where(x => !nos.Contains(x.No))
|
||||
.Where(x => x.UserCode == request.UserCode)
|
||||
.ToListAsync();
|
||||
|
||||
|
||||
var gainfoMeal = await DbContext.Queryable<GainfoMealEntity>().Where(x => x.UserNo == gainfo.No).FirstAsync();
|
||||
@@ -674,17 +659,16 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
gainfoMeal.Balance += order.Amount;
|
||||
|
||||
await DbContext.Updateable<GainfoMealEntity>()
|
||||
.SetColumns(x => x.Balance == gainfoMeal.Balance)
|
||||
.SetColumns(x => x.Version == x.Version + 1)
|
||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||
.Where(x => x.UserNo == order.UserNo && x.Version == gainfoMeal.Version)//必须与查询时的version一致
|
||||
.ExecuteCommandThrowVersionAsync();
|
||||
.SetColumns(x => x.Balance == gainfoMeal.Balance)
|
||||
.SetColumns(x => x.Version == x.Version + 1)
|
||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||
.Where(x => x.UserNo == order.UserNo && x.Version == gainfoMeal.Version) //必须与查询时的version一致
|
||||
.ExecuteCommandThrowVersionAsync();
|
||||
//写入记录
|
||||
var balanceRecord = order.Adapt<BalanceRecordEntity>();
|
||||
balanceRecord.Id = 0;
|
||||
await DbContext.InsertAsync(balanceRecord);
|
||||
|
||||
}, 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
|
||||
namespace Dlhis.Canteen.Dishes;
|
||||
namespace Dlhis.Canteen.Order;
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Startup;
|
||||
using Microsoft.IdentityModel.Logging;
|
||||
|
||||
namespace Dlhis.Canteen;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Dlhis.Canteen.Setting.Request;
|
||||
using Dlhis.Canteen.Setting.Response;
|
||||
using Dlhis.Canteen.Setting.Services;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Setting.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Org.BouncyCastle.Asn1.X509.SigI;
|
||||
|
||||
namespace Dlhis.Canteen.Setting.Request;
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
namespace Dlhis.Canteen.Setting.Request
|
||||
{
|
||||
public class CanteenSettingSetEnableRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
namespace Dlhis.Canteen.Setting.Request;
|
||||
|
||||
public bool Enable { get; set; }
|
||||
}
|
||||
}
|
||||
public class CanteenSettingSetEnableRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public bool Enable { get; set; }
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using Dlhis.Canteen.Setting.Request;
|
||||
using Dlhis.Canteen.Setting.Response;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Setting.Services;
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
using Dlhis.Canteen.Setting.Response;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
|
||||
namespace Dlhis.Canteen.Setting.Services.Implements;
|
||||
@@ -42,10 +42,7 @@ public class CanteenSettingService : ICanteenSettingService
|
||||
|
||||
var userNos = page.Data.Where(x => x.UniqueType == CanteenSettingUnqiueEnumType.Person).Select(x => x.UniqueValue).Distinct().ToList();
|
||||
var gainfos = await _context.Queryable<GainfoEntity>().Where(x => userNos.Contains(x.No)).ToListAsync();
|
||||
page.Data.ForEach(x =>
|
||||
{
|
||||
x.UniqueValueDesc = gainfos.FirstOrDefault(item => item.No == x.UniqueValue)?.Name;
|
||||
});
|
||||
page.Data.ForEach(x => { x.UniqueValueDesc = gainfos.FirstOrDefault(item => item.No == x.UniqueValue)?.Name; });
|
||||
|
||||
return page;
|
||||
}
|
||||
@@ -71,7 +68,6 @@ public class CanteenSettingService : ICanteenSettingService
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task SetEnableAsync(CanteenSettingSetEnableRequest request)
|
||||
{
|
||||
var entity = await _context.Queryable<CanteenSettingEntity>().FirstAsync(x => x.Id == request.Id);
|
||||
@@ -85,10 +81,10 @@ public class CanteenSettingService : ICanteenSettingService
|
||||
public async Task<Dictionary<CanteenSettingItemEnumType, string>> GetUserSettingAsync(string userNo, string tenantId)
|
||||
{
|
||||
var settings = await _context.Queryable<CanteenSettingEntity>()
|
||||
.Where(x => x.Enable)
|
||||
.Where(x => x.TenantId == tenantId)
|
||||
.Where(x => (x.UniqueType == CanteenSettingUnqiueEnumType.Person && x.UniqueValue == userNo) || x.UniqueType == CanteenSettingUnqiueEnumType.Tenant)
|
||||
.ToListAsync();
|
||||
.Where(x => x.Enable)
|
||||
.Where(x => x.TenantId == tenantId)
|
||||
.Where(x => (x.UniqueType == CanteenSettingUnqiueEnumType.Person && x.UniqueValue == userNo) || x.UniqueType == CanteenSettingUnqiueEnumType.Tenant)
|
||||
.ToListAsync();
|
||||
|
||||
//从基地 -> 个人,确保下面循环做到覆盖,并且以个人配置为主
|
||||
settings = settings.OrderBy(x => x.UniqueType).ToList();
|
||||
@@ -113,10 +109,10 @@ public class CanteenSettingService : ICanteenSettingService
|
||||
public async Task<TimeOnly?> GetBusinessSwitchTimeAsync(string tenantId)
|
||||
{
|
||||
var setting = await _context.Queryable<CanteenSettingEntity>()
|
||||
.Where(x => x.Enable)
|
||||
.Where(x => x.TenantId == tenantId)
|
||||
.Where(x => x.Item == CanteenSettingItemEnumType.BusinessSwitchTime)
|
||||
.FirstAsync();
|
||||
.Where(x => x.Enable)
|
||||
.Where(x => x.TenantId == tenantId)
|
||||
.Where(x => x.Item == CanteenSettingItemEnumType.BusinessSwitchTime)
|
||||
.FirstAsync();
|
||||
|
||||
try
|
||||
{
|
||||
@@ -135,18 +131,17 @@ public class CanteenSettingService : ICanteenSettingService
|
||||
//Tenant只有一条数据, Person对应UniqueValue唯一 , Catalog不作为唯一判断
|
||||
|
||||
var exists = await _context.Queryable<CanteenSettingEntity>()
|
||||
.Where(x => x.UniqueType == request.UniqueType)
|
||||
.Where(x => x.Catalog == request.Catalog)
|
||||
.Where(x => x.Item == request.Item)
|
||||
.WhereIF(request.UniqueType != CanteenSettingUnqiueEnumType.Tenant, x => x.UniqueValue == request.UniqueValue)
|
||||
.WhereIF(request.Id.HasValue, x => x.Id != request.Id)
|
||||
.AnyAsync();
|
||||
.Where(x => x.UniqueType == request.UniqueType)
|
||||
.Where(x => x.Catalog == request.Catalog)
|
||||
.Where(x => x.Item == request.Item)
|
||||
.WhereIF(request.UniqueType != CanteenSettingUnqiueEnumType.Tenant, x => x.UniqueValue == request.UniqueValue)
|
||||
.WhereIF(request.Id.HasValue, x => x.Id != request.Id)
|
||||
.AnyAsync();
|
||||
|
||||
exists.ThrowIfTrue("配置项重复,请检查.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 检验参数
|
||||
/// </summary>
|
||||
@@ -174,14 +169,15 @@ public class CanteenSettingService : ICanteenSettingService
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (type == CanteenSettingItemEnumType.BusinessSwitchTime)
|
||||
{
|
||||
var timeOnly = value.Adapt<TimeOnly>();
|
||||
return timeOnly.Minute == 0 && timeOnly.Second == 0;
|
||||
}
|
||||
|
||||
//mapster
|
||||
value.Adapt<T>();
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -222,4 +218,4 @@ public class CanteenSettingService : ICanteenSettingService
|
||||
|
||||
result.ThrowIfFalse($"{request.Item.GetDescription()},参数值为[{value}],格式错误");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,10 @@
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
|
||||
namespace Dlhis.Canteen;
|
||||
|
||||
public class SqlSugarPack : BaseAppPack
|
||||
{
|
||||
public override bool IsBeforeUseRouting { get; }
|
||||
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSqlSugar();
|
||||
|
||||
Reference in New Issue
Block a user