Commit fb2df615 authored by 黄奎's avatar 黄奎

新增验证

parent fe8707c2
......@@ -78,7 +78,7 @@ namespace Edu.Cache
/// </summary>
public static string AppletB2B_Login_Info_
{
get { return "AppletB2B_Login_"; }
get { return "AppletB2B_Edu_Login_"; }
}
}
......
......@@ -98,6 +98,11 @@ namespace Edu.Common.API
/// </summary>
public int AdminId { get; set; }
/// <summary>
/// 审批状态 1-审批通过,2-拒绝
/// </summary>
public int ApproveState { get; set; }
/// <summary>
/// 同行对应的销售编号
/// </summary>
......
......@@ -201,5 +201,10 @@ namespace Edu.Model.Entity.User
/// 微信号
/// </summary>
public string WeChatNo { get; set; }
/// <summary>
/// 客户类型
/// </summary>
public int StuType { get; set; }
}
}
......@@ -233,14 +233,26 @@ namespace Edu.Module.User
/// 检查学员是否存在资料库
/// </summary>
/// <param name="model"></param>
/// <param name="Type">1-电话,2-QQ,3-微信号</param>
/// <returns></returns>
public bool CheckStudentModule(RB_Student_ViewModel model)
public bool CheckStudentModule(RB_Student_ViewModel model,int Type)
{
List<WhereHelper> where = new List<WhereHelper>()
{
new WhereHelper(nameof(RB_Student_ViewModel.Group_Id),model.Group_Id),
new WhereHelper(nameof(RB_Student_ViewModel.StuTel),model.StuTel),
};
if (Type == 1)
{
where.Add(new WhereHelper(nameof(RB_Student_ViewModel.StuTel), model.StuTel));
}
if (Type == 2)
{
where.Add(new WhereHelper(nameof(RB_Student_ViewModel.QQ), model.QQ));
}
if (Type == 3)
{
where.Add(new WhereHelper(nameof(RB_Student_ViewModel.WeChatNo), model.WeChatNo));
}
if (model.StuId > 0)
{
where.Add(new WhereHelper()
......@@ -258,10 +270,9 @@ namespace Edu.Module.User
/// </summary>
/// <param name="Tel"></param>
/// <returns></returns>
public RB_Student_ViewModel GetStuByTelModule(string Tel)
public RB_Student_ViewModel CheckExistsStuModule(RB_Student_ViewModel query)
{
var model = studentRepository.GetStuByTelRepository(new RB_Student_ViewModel() { StuTel = Tel });
var model = studentRepository.GetStuByTelRepository(query);
return model;
}
......
......@@ -42,6 +42,11 @@ namespace Edu.Repository.User
/// </summary>
private readonly RB_CustomerRepository customerRepository = new RB_CustomerRepository();
/// <summary>
/// 客户类型仓储层对象
/// </summary>
private readonly RB_Student_TypeRepository student_TypeRepository = new RB_Student_TypeRepository();
/// <summary>
/// 获取学生列表
/// </summary>
......@@ -390,6 +395,12 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
{
logContent += string.Format("微信号:由【{0}】=>【{1}】,", oldModel.WeChatNo, model.WeChatNo);
}
if (oldModel.StuType != model.StuType)
{
string oldName = student_TypeRepository.GetEntity(oldModel.StuType)?.Name;
string newName = student_TypeRepository.GetEntity(model.StuType)?.Name;
logContent += string.Format("客户类型:由【{0}】=>【{1}】,", oldName, newName);
}
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_ViewModel.StuName),model.StuName.Trim() },
......@@ -409,6 +420,7 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
{nameof(RB_Student_ViewModel.CustomerId),model.CustomerId},
{nameof(RB_Student_ViewModel.QQ),model.QQ},
{nameof(RB_Student_ViewModel.WeChatNo),model.WeChatNo},
{nameof(RB_Student_ViewModel.StuType),model.StuType},
};
//教育后台操作
if (model.OperateType == 1)
......@@ -573,7 +585,7 @@ WHERE 1=1 AND YEARWEEK(date_format(t.CreateTime, '%Y-%m-%d')) = YEARWEEK(now())
}
/// <summary>
/// 跟进电话号码获取学员信息
/// 根据电话号码、QQ、微信号获取学员信息
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
......@@ -593,10 +605,20 @@ WHERE 1=1
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrWhiteSpace(query.StuTel))
{
builder.AppendFormat(" AND t.{0}='{1}' ", nameof(RB_Student_ViewModel.StuTel), query.StuTel);
builder.AppendFormat(" AND t.{0}=@StuTel ", nameof(RB_Student_ViewModel.StuTel));
parameters.Add("StuTel", query.StuTel.Trim());
}
if (!string.IsNullOrWhiteSpace(query.QQ))
{
builder.AppendFormat(" AND t.{0}=@QQ ", nameof(RB_Student_ViewModel.QQ));
parameters.Add("QQ", query.StuTel.Trim());
}
if (!string.IsNullOrWhiteSpace(query.WeChatNo))
{
builder.AppendFormat(" AND t.{0}=@WeChatNo ", nameof(RB_Student_ViewModel.WeChatNo));
parameters.Add("WeChatNo", query.WeChatNo.Trim());
}
}
return Get<RB_Student_ViewModel>(builder.ToString(), parameters)?.FirstOrDefault();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment