fix 配置值范围整理,保存配置处理
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System;
|
||||
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;
|
||||
|
||||
public class CanteenSettingSaveRequest
|
||||
public class CanteenSettingSaveRequest : IValidatableObject
|
||||
{
|
||||
public long? Id { get; set; }
|
||||
|
||||
@@ -16,7 +19,6 @@ public class CanteenSettingSaveRequest
|
||||
/// <summary>
|
||||
/// 配置生效范围
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "配置生效范围不能为空")]
|
||||
public string UniqueValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -35,4 +37,12 @@ public class CanteenSettingSaveRequest
|
||||
/// 参数值
|
||||
/// </summary>
|
||||
public string Value { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (UniqueType != CanteenSettingUnqiueEnumType.Tenant && UniqueValue.IsEmpty())
|
||||
{
|
||||
yield return new ValidationResult($"配置{UniqueType.GetDescription()}值不能为空", new string[] { nameof(UniqueValue) });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,28 +8,20 @@ namespace Dlhis.Entity.Canteen.Enums;
|
||||
[Description("就餐配置项")]
|
||||
public enum CanteenSettingItemEnumType
|
||||
{
|
||||
//# BusinessSwitchTime varchar(255) not null comment '营业点切换时间 HH:00:00',
|
||||
//# DayCostMax decimal(16, 2) not null comment '每日允许消费最高金额(存在普通模式)',
|
||||
//# DayMarketCostMax decimal(16, 2) not null comment '每日超市允许消费最高金额',
|
||||
//# AllowSendAtMeal bit not null comment '允许就餐下发',
|
||||
//# DayEVoucherUseCountMax int not null comment '电子券每天使用最多次数',
|
||||
//# Subsidies decimal(16, 2) not null comment '补贴',
|
||||
//# AllowRepeatInOneShift bit not null comment '允许一餐次多次消费',
|
||||
//# OnceCostMax decimal(16, 2) not null comment '一次最高消费金额',
|
||||
//# AllowCrossTenant bit not null comment '允许跨基地消费',
|
||||
//# InitBalance decimal(16, 2) not null comment '初始金额',
|
||||
|
||||
/// <summary>
|
||||
/// 营业点切换时间
|
||||
/// </summary>
|
||||
[Description("营业点切换时间(HH:00:00)")]
|
||||
BusinessSwitchTime = 1,
|
||||
BusinessSwitchTime = 100,
|
||||
|
||||
|
||||
//----------------------------------------------------------------[200,300)--------------------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// 每日允许消费最高金额
|
||||
/// </summary>
|
||||
[Description("每日允许消费最高金额(decimal)")]
|
||||
DayCostMax,
|
||||
DayCostMax = 200,
|
||||
|
||||
/// <summary>
|
||||
/// 每日超市允许消费最高金额
|
||||
@@ -37,17 +29,18 @@ public enum CanteenSettingItemEnumType
|
||||
[Description("每日超市允许消费最高金额(decimal)")]
|
||||
DayMarketCostMax,
|
||||
|
||||
/// <summary>
|
||||
/// 允许就餐下发
|
||||
/// </summary>
|
||||
[Description("允许就餐下发(0/1)")]
|
||||
AllowSendAtMeal,
|
||||
|
||||
/// <summary>
|
||||
/// 电子券每天使用最多次数
|
||||
/// 一次最高消费金额
|
||||
/// </summary>
|
||||
[Description("电子券每天使用最多次数(int)")]
|
||||
DayEVoucherUseCountMax,
|
||||
[Description("一次最高消费金额(decimal)")]
|
||||
OnceCostMax,
|
||||
|
||||
/// <summary>
|
||||
/// 初始金额
|
||||
/// </summary>
|
||||
[Description("初始金额(decimal)")]
|
||||
InitBalance,
|
||||
|
||||
/// <summary>
|
||||
/// 补贴
|
||||
@@ -55,28 +48,35 @@ public enum CanteenSettingItemEnumType
|
||||
[Description("补贴(decimal)")]
|
||||
Subsidies,
|
||||
|
||||
|
||||
//--------------------------------------------------------------------[300,400)----------------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// 允许就餐下发
|
||||
/// </summary>
|
||||
[Description("允许就餐下发(0/1)")]
|
||||
AllowSendAtMeal = 300,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 允许一餐次多次消费
|
||||
/// </summary>
|
||||
[Description("允许一餐次多次消费(0/1)")]
|
||||
AllowRepeatInOneShift,
|
||||
|
||||
/// <summary>
|
||||
/// 一次最高消费金额
|
||||
/// </summary>
|
||||
[Description("一次最高消费金额(decimal)")]
|
||||
OnceCostMax,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 允许跨基地消费
|
||||
/// </summary>
|
||||
[Description("允许跨基地消费(0/1)")]
|
||||
AllowCrossTenant,
|
||||
|
||||
|
||||
//--------------------------------------------------------------------[400,500)----------------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// 初始金额
|
||||
/// 电子券每天使用最多次数
|
||||
/// </summary>
|
||||
[Description("初始金额(decimal)")]
|
||||
InitBalance,
|
||||
[Description("电子券每天使用最多次数(int)")]
|
||||
DayEVoucherUseCountMax = 400,
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user