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 Dlhis.Entity.Canteen.Enums;
|
||||||
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
using Org.BouncyCastle.Asn1.X509.SigI;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Setting.Request;
|
namespace Dlhis.Canteen.Setting.Request;
|
||||||
|
|
||||||
public class CanteenSettingSaveRequest
|
public class CanteenSettingSaveRequest : IValidatableObject
|
||||||
{
|
{
|
||||||
public long? Id { get; set; }
|
public long? Id { get; set; }
|
||||||
|
|
||||||
@@ -16,7 +19,6 @@ public class CanteenSettingSaveRequest
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 配置生效范围
|
/// 配置生效范围
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required(ErrorMessage = "配置生效范围不能为空")]
|
|
||||||
public string UniqueValue { get; set; }
|
public string UniqueValue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -35,4 +37,12 @@ public class CanteenSettingSaveRequest
|
|||||||
/// 参数值
|
/// 参数值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Value { get; set; }
|
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("就餐配置项")]
|
[Description("就餐配置项")]
|
||||||
public enum CanteenSettingItemEnumType
|
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>
|
||||||
/// 营业点切换时间
|
/// 营业点切换时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("营业点切换时间(HH:00:00)")]
|
[Description("营业点切换时间(HH:00:00)")]
|
||||||
BusinessSwitchTime = 1,
|
BusinessSwitchTime = 100,
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------[200,300)--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 每日允许消费最高金额
|
/// 每日允许消费最高金额
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("每日允许消费最高金额(decimal)")]
|
[Description("每日允许消费最高金额(decimal)")]
|
||||||
DayCostMax,
|
DayCostMax = 200,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 每日超市允许消费最高金额
|
/// 每日超市允许消费最高金额
|
||||||
@@ -37,17 +29,18 @@ public enum CanteenSettingItemEnumType
|
|||||||
[Description("每日超市允许消费最高金额(decimal)")]
|
[Description("每日超市允许消费最高金额(decimal)")]
|
||||||
DayMarketCostMax,
|
DayMarketCostMax,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 允许就餐下发
|
|
||||||
/// </summary>
|
|
||||||
[Description("允许就餐下发(0/1)")]
|
|
||||||
AllowSendAtMeal,
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 电子券每天使用最多次数
|
/// 一次最高消费金额
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("电子券每天使用最多次数(int)")]
|
[Description("一次最高消费金额(decimal)")]
|
||||||
DayEVoucherUseCountMax,
|
OnceCostMax,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 初始金额
|
||||||
|
/// </summary>
|
||||||
|
[Description("初始金额(decimal)")]
|
||||||
|
InitBalance,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 补贴
|
/// 补贴
|
||||||
@@ -55,28 +48,35 @@ public enum CanteenSettingItemEnumType
|
|||||||
[Description("补贴(decimal)")]
|
[Description("补贴(decimal)")]
|
||||||
Subsidies,
|
Subsidies,
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------[300,400)----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 允许就餐下发
|
||||||
|
/// </summary>
|
||||||
|
[Description("允许就餐下发(0/1)")]
|
||||||
|
AllowSendAtMeal = 300,
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 允许一餐次多次消费
|
/// 允许一餐次多次消费
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("允许一餐次多次消费(0/1)")]
|
[Description("允许一餐次多次消费(0/1)")]
|
||||||
AllowRepeatInOneShift,
|
AllowRepeatInOneShift,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 一次最高消费金额
|
|
||||||
/// </summary>
|
|
||||||
[Description("一次最高消费金额(decimal)")]
|
|
||||||
OnceCostMax,
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 允许跨基地消费
|
/// 允许跨基地消费
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("允许跨基地消费(0/1)")]
|
[Description("允许跨基地消费(0/1)")]
|
||||||
AllowCrossTenant,
|
AllowCrossTenant,
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------[400,500)----------------------------------------------------------------------------------
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始金额
|
/// 电子券每天使用最多次数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("初始金额(decimal)")]
|
[Description("电子券每天使用最多次数(int)")]
|
||||||
InitBalance,
|
DayEVoucherUseCountMax = 400,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user