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