Commit c37ac1b9 authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents 6481b4b0 fa8e3d9f
......@@ -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>
......
......@@ -55,5 +55,11 @@ namespace Edu.Common.Enum.Course
/// </summary>
[EnumField("博士后")]
N9 = 9,
/// <summary>
/// 在职
/// </summary>
[EnumField("在职")]
N10 = 10,
}
}
......@@ -201,5 +201,10 @@ namespace Edu.Model.Entity.User
/// 微信号
/// </summary>
public string WeChatNo { get; set; }
/// <summary>
/// 客户类型
/// </summary>
public int StuType { get; set; }
}
}
......@@ -225,6 +225,11 @@ namespace Edu.Model.ViewModel.User
/// </summary>
public string StuStageName { get; set; }
/// <summary>
/// 客户类型名称
/// </summary>
public string StuTypeName { get; set; }
/// <summary>
/// 归属类型(1-全部,2-我负责的,3-我协同的)
/// </summary>
......
......@@ -80,6 +80,11 @@ namespace Edu.Module.User
/// </summary>
private readonly RB_StageRepository stageRepository = new RB_StageRepository();
/// <summary>
/// 学员类型仓储层对象
/// </summary>
private readonly RB_Student_TypeRepository student_TypeRepository = new RB_Student_TypeRepository();
/// <summary>
/// 获取学生列表
/// </summary>
......@@ -100,7 +105,6 @@ namespace Edu.Module.User
/// <returns></returns>
public List<RB_Student_ViewModel> GetStudentPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Student_ViewModel query)
{
var list = studentRepository.GetStudentPageListRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0)
{
......@@ -109,9 +113,11 @@ namespace Edu.Module.User
{
Group_Id = list[0].Group_Id
});
//学员类型列表
var stuTypeList = student_TypeRepository.GetStudentTypeListRepository(new RB_Student_Type_Extend());
string stuIds = string.Join(",", list.Select(qitem => qitem.StuId));
//学员跟进
var followList= followRepository.GetStudentFollowListRepository(new Model.ViewModel.Customer.RB_Student_Follow_Extend()
var followList= followRepository.GetStudentFollowListRepository(new RB_Student_Follow_Extend()
{
QStuIds = stuIds
});
......@@ -189,8 +195,6 @@ namespace Edu.Module.User
CustomerIds = string.Join(",", transIdList)
});
}
foreach (var item in list)
{
......@@ -224,6 +228,7 @@ namespace Edu.Module.User
}
item.StuStageName = stageList?.FirstOrDefault(qitem => qitem.Id == item.StuStage)?.StageName ?? "";
item.StuTypeName = stuTypeList?.FirstOrDefault(qitem => qitem.Id == item.StuType)?.Name ?? "";
}
}
return list;
......@@ -233,14 +238,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 +275,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;
}
......@@ -308,6 +324,20 @@ namespace Edu.Module.User
return flag;
}
/// <summary>
/// 获取协助人员列表
/// </summary>
/// <param name="StuId"></param>
/// <returns></returns>
public List<RB_Student_Assist_Extend> GetStuAssistListModule(int StuId)
{
var list = student_AssistRepository.GetStudentAssistListRepository(new RB_Student_Assist_Extend()
{
StuId = StuId
});
return list;
}
/// <summary>
/// 学员转交
......@@ -337,6 +367,7 @@ namespace Edu.Module.User
});
extModel.AssistList = assistList;
extModel.StuStageName = stageRepository.GetEntity(extModel.StuStage)?.StageName ?? "";
extModel.StuTypeName = student_TypeRepository.GetEntity(extModel.StuType)?.Name ?? "";
}
return extModel;
}
......
......@@ -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>
......@@ -158,11 +163,25 @@ WHERE 1=1
builder.AppendFormat(" AND t.{0} LIKE @StuTel ", nameof(RB_Student_ViewModel.StuTel));
parameters.Add("StuTel", "%" + query.StuTel.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.QQ))
{
builder.AppendFormat(" AND t.{0} LIKE @QQ ", nameof(RB_Student_ViewModel.QQ));
parameters.Add("QQ", "%" + query.QQ.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.WeChatNo))
{
builder.AppendFormat(" AND t.{0} LIKE @WeChatNo ", nameof(RB_Student_ViewModel.WeChatNo));
parameters.Add("WeChatNo", "%" + query.WeChatNo.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.KeyWords))
{
builder.AppendFormat(" AND (t.{0} LIKE @KeyWords OR t.{1} LIKE @KeyWords) ", nameof(RB_Student_ViewModel.StuName), nameof(RB_Student_ViewModel.StuTel));
parameters.Add("KeyWords", "%" + query.KeyWords.Trim() + "%");
}
if (query.StuType > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.StuType), query.StuType);
}
if (query.ProviceId > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.ProviceId), query.ProviceId);
......@@ -394,6 +413,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() },
......@@ -413,6 +438,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)
......@@ -577,7 +603,7 @@ WHERE 1=1 AND YEARWEEK(date_format(t.CreateTime, '%Y-%m-%d')) = YEARWEEK(now())
}
/// <summary>
/// 跟进电话号码获取学员信息
/// 根据电话号码、QQ、微信号获取学员信息
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
......@@ -597,10 +623,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.QQ.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();
......
......@@ -112,7 +112,9 @@ namespace Edu.WebApi.Controllers.Customer
model.UpdateTime = DateTime.Now;
model.Group_Id = base.UserInfo.Group_Id;
model.School_Id = base.UserInfo.School_Id;
model.ApproveState = 1;
model.ApproveId= base.UserInfo.Id;
model.ApproveTime = DateTime.Now;
var flag = customerModule.SetCustomerModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......
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