fix 重置消费类型处理
This commit is contained in:
@@ -56,20 +56,15 @@ public class OrderAddRequest : IValidatableObject
|
||||
//处理金额
|
||||
Amount = Type == BalanceRecordTypeEnumType.In ? Math.Abs(Amount) : -Math.Abs(Amount);
|
||||
|
||||
|
||||
//在线就以API时间为准
|
||||
if (!IsOffline)
|
||||
{
|
||||
CostDateTime = DateTime.Now;
|
||||
}
|
||||
|
||||
if (Type == BalanceRecordTypeEnumType.Out)
|
||||
{
|
||||
//处理消费类型
|
||||
if ((int)Source >= (int)BalanceRecordSourceEnumType.Wechat)
|
||||
{
|
||||
yield return new ValidationResult($"不支持来源{Source.GetDescription()}", new[] { nameof(Source) });
|
||||
}
|
||||
|
||||
//在线就以API时间为准
|
||||
if (!IsOffline)
|
||||
{
|
||||
CostDateTime = DateTime.Now;
|
||||
}
|
||||
|
||||
if (DeviceUniqueNo.IsEmpty())
|
||||
{
|
||||
yield return new ValidationResult("设备唯一号不能为空", new[] { nameof(DeviceUniqueNo) });
|
||||
@@ -77,10 +72,12 @@ public class OrderAddRequest : IValidatableObject
|
||||
}
|
||||
else if (Type == BalanceRecordTypeEnumType.In)
|
||||
{
|
||||
if ((int)Source < (int)BalanceRecordSourceEnumType.Wechat)
|
||||
{
|
||||
yield return new ValidationResult($"不支持来源{Source.GetDescription()}", new[] { nameof(Source) });
|
||||
}
|
||||
//if ((int)Source < (int)BalanceRecordSourceEnumType.Wechat)
|
||||
//{
|
||||
// yield return new ValidationResult($"不支持来源{Source.GetDescription()}", new[] { nameof(Source) });
|
||||
//}
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,23 +9,31 @@ namespace Dlhis.Entity.Canteen.Enums;
|
||||
public enum BalanceRecordSourceEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 卡消费
|
||||
/// 卡
|
||||
/// </summary>
|
||||
[Description("卡消费")]
|
||||
[Description("卡")]
|
||||
Card = 100,
|
||||
|
||||
/// <summary>
|
||||
/// 人脸消费
|
||||
/// 人脸
|
||||
/// </summary>
|
||||
[Description("人脸消费")]
|
||||
[Description("人脸")]
|
||||
Face,
|
||||
|
||||
/// <summary>
|
||||
/// 二维码消费
|
||||
/// 二维码
|
||||
/// </summary>
|
||||
[Description("二维码消费")]
|
||||
[Description("二维码")]
|
||||
QrCode,
|
||||
|
||||
/// <summary>
|
||||
/// 现金
|
||||
/// </summary>
|
||||
[Description("现金")]
|
||||
Cash,
|
||||
|
||||
//*********************************************************************************************************
|
||||
|
||||
/// <summary>
|
||||
/// 来自微信
|
||||
/// </summary>
|
||||
@@ -44,11 +52,13 @@ public enum BalanceRecordSourceEnumType
|
||||
[Description("银联")]
|
||||
UnionPay,
|
||||
|
||||
//*********************************************************************************************************
|
||||
|
||||
/// <summary>
|
||||
/// 来自本基地补贴
|
||||
/// </summary>
|
||||
[Description("本基地补贴")]
|
||||
LocalTenantSubsidies,
|
||||
LocalTenantSubsidies = 300,
|
||||
|
||||
/// <summary>
|
||||
/// 来自其他基地补贴
|
||||
|
||||
Reference in New Issue
Block a user