@@ -14,69 +14,6 @@ namespace BPA.KitChen.StoreManagementOrder.Application.BaseDto | |||||
public class DtoValidator | public class DtoValidator | ||||
{ | { | ||||
/// <summary> | |||||
/// 验证会员 | |||||
/// </summary> | |||||
/// <param name="id"></param> | |||||
/// <returns></returns> | |||||
public static ValidationResult Member(string id) | |||||
{ | |||||
var data = SqlSugarDb.Db.Queryable<BPA_MemberInfo>().First(x => x.Id == id&&x.IsDeleted==0); | |||||
return data == null ? new ValidationResult("会员不存在") : ValidationResult.Success; | |||||
} | |||||
/// <summary> | |||||
/// 验证会员标签的合法性 | |||||
/// </summary> | |||||
/// <param name="id"></param> | |||||
/// <returns></returns> | |||||
public static ValidationResult MemberTag(string id) | |||||
{ | |||||
var data = SqlSugarDb.Db.Queryable<BPA_MemberTag>().First(x=>x.Id==id); | |||||
return data == null ? new ValidationResult("会员标签不存在") : ValidationResult.Success; | |||||
} | |||||
/// <summary> | |||||
/// 验证会员标签的合法性 | |||||
/// </summary> | |||||
/// <param name="id"></param> | |||||
/// <returns></returns> | |||||
public static ValidationResult MemberTagList(List<string> ids) | |||||
{ | |||||
var data = SqlSugarDb.Db.Queryable<BPA_MemberTag>().Where(x => ids.Contains(x.Id) && x.IsDeleted == 0&&x.Status== CommonStatus.ENABLE).ToList(); | |||||
return data.Count<=0 ? new ValidationResult("会员标签不存在") : ValidationResult.Success; | |||||
} | |||||
/// <summary> | |||||
/// 会员平台 | |||||
/// </summary> | |||||
/// <param name="type"></param> | |||||
/// <returns></returns> | |||||
public static ValidationResult MemberPlatformType(int type) | |||||
{ | |||||
return !System.Enum.IsDefined(typeof(PlatformType), type) ? new ValidationResult("平台类型不存在") : ValidationResult.Success; | |||||
} | |||||
/// <summary> | |||||
/// 会员平台 | |||||
/// </summary> | |||||
/// <param name="type"></param> | |||||
/// <returns></returns> | |||||
public static ValidationResult Status(int type) | |||||
{ | |||||
return !System.Enum.IsDefined(typeof(CommonStatus), type) ? new ValidationResult("状态错误") : ValidationResult.Success; | |||||
} | |||||
/// <summary> | |||||
/// 优惠券使用 | |||||
/// </summary> | |||||
/// <param name="type"></param> | |||||
/// <returns></returns> | |||||
public static ValidationResult CouponUseType(int type) | |||||
{ | |||||
return !System.Enum.IsDefined(typeof(CouponUseType), type) ? new ValidationResult("状态错误") : ValidationResult.Success; | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,91 +0,0 @@ | |||||
using BPA.KitChen.StoreManagementOrder.Core.Entity.Base; | |||||
using SqlSugar; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.KitChen.StoreManagementOrder.Core.Entity | |||||
{ | |||||
/// <summary> | |||||
/// 会员 | |||||
/// </summary> | |||||
[SugarTable("BPA_MemberInfo")] | |||||
public class BPA_MemberInfo : IBaseGroupIdEntity | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
[SugarColumn(IsNullable = true)] | |||||
public string NickName { get; set; } | |||||
/// <summary> | |||||
/// 0=未知 1=男 2=女 | |||||
/// </summary> | |||||
public int Sex { get; set; } | |||||
/// <summary> | |||||
/// 头像 | |||||
/// </summary> | |||||
[SugarColumn(IsNullable = true)] | |||||
public string HeadImgUrl { get; set; } | |||||
/// <summary> | |||||
/// 国家 | |||||
/// </summary> | |||||
[SugarColumn(IsNullable = true)] | |||||
public string Country { get; set; } | |||||
/// <summary> | |||||
/// 省 | |||||
/// </summary> | |||||
[SugarColumn(IsNullable = true)] | |||||
public string Province { get; set; } | |||||
/// <summary> | |||||
/// 市 | |||||
/// </summary> | |||||
[SugarColumn(IsNullable = true)] | |||||
public string City { get; set; } | |||||
/// <summary> | |||||
/// 县(区) | |||||
/// </summary> | |||||
[SugarColumn(IsNullable = true)] | |||||
public string County { get; set; } | |||||
/// <summary> | |||||
/// 具体地址 | |||||
/// </summary> | |||||
[SugarColumn(IsNullable = true)] | |||||
public string Address { get; set; } | |||||
/// <summary> | |||||
/// 出生日期 | |||||
/// </summary> | |||||
public DateTime Birthday { get; set; } | |||||
/// <summary> | |||||
/// 电话 | |||||
/// </summary> | |||||
[SugarColumn(IsNullable = true)] | |||||
public string Phone { get; set; } | |||||
/// <summary> | |||||
/// 真实姓名 | |||||
/// </summary> | |||||
[SugarColumn(IsNullable = true)] | |||||
public string RealName { get; set; } | |||||
/// <summary> | |||||
/// 身份证号码 | |||||
/// </summary> | |||||
[SugarColumn(IsNullable = true)] | |||||
public string CardNum { get; set; } | |||||
/// <summary> | |||||
/// 等级 | |||||
/// </summary> | |||||
[SugarColumn(IsNullable = true)] | |||||
public string Level_Id { get; set; } | |||||
/// <summary> | |||||
/// 向外展示那个平台的信息 0:默认 1.微信 2.支付宝 | |||||
/// </summary> | |||||
public int ShowPlatformType { get; set; } | |||||
/// <summary> | |||||
/// 积分 | |||||
/// </summary> | |||||
public decimal Integral { get; set; } | |||||
} | |||||
} |
@@ -1,25 +0,0 @@ | |||||
using BPA.KitChen.StoreManagementOrder.Core.Entity.Base; | |||||
using SqlSugar; | |||||
namespace BPA.KitChen.StoreManagementOrder.Core.Entity | |||||
{ | |||||
/// <summary> | |||||
/// 会员标签 | |||||
/// </summary> | |||||
[SugarTable("BPA_MemberTag")] | |||||
public class BPA_MemberTag : IBaseGroupIdEntity | |||||
{ | |||||
/// <summary> | |||||
/// 会员标签名称 | |||||
/// </summary> | |||||
public string Name { get; set; } | |||||
/// <summary> | |||||
/// 排序 | |||||
/// </summary> | |||||
public int Sort { get; set; } | |||||
/// <summary> | |||||
/// 平台标签 0:默认 1.微信 2.支付宝 | |||||
/// </summary> | |||||
public int PlatformType { get; set; } | |||||
} | |||||
} |