Commit b96b8d54 authored by 吴春's avatar 吴春

新增留学客户资料列表

parent 77aab2ac
......@@ -75,7 +75,7 @@ namespace Edu.Model.Entity.Sell
/// <summary>
/// 学习目的
/// </summary>
public int LearningGoals { get; set; }
public string LearningGoals { get; set; }
/// <summary>
/// 联系人
......
......@@ -135,7 +135,12 @@ namespace Edu.Model.Entity.User
/// <summary>
/// 学习目的
/// </summary>
public int StuPurpose { get; set; }
public string StuPurpose { get; set; }
/// <summary>
/// 客户类型,1-普通客户,2-会员客户
/// </summary>
public int StudentType { get; set; }
/// <summary>
/// 客人来源 (启用 +》 CreateType)
......
......@@ -169,7 +169,7 @@ namespace Edu.Model.ViewModel.DataStatistics
/// <summary>
/// 学习目的
/// </summary>
public int StuPurpose { get; set; }
public string StuPurpose { get; set; }
/// <summary>
/// 学习目的名称
......
......@@ -143,7 +143,7 @@ namespace Edu.Module.Course
/// 合同
/// </summary>
private readonly RB_Education_ContractRepository education_ContractRepository = new RB_Education_ContractRepository();
/// <summary>
/// 合同协调金额
/// </summary>
......@@ -298,7 +298,7 @@ namespace Edu.Module.Course
return list;
}
/// <summary>
/// 获取班级课程信息
......@@ -827,7 +827,7 @@ namespace Edu.Module.Course
public bool SetClassOrderCommonModule(RB_Order_ViewModel demodel, UserInfo userInfo, bool isEditOrder, out string message, out int ROrderId, bool IsFirstBatch = false)
{
bool flag = false; ROrderId = demodel.OrderId;
message = "";
message = "";
var orderModel = new RB_Order();
if (demodel.OrderId > 0)
{
......@@ -1257,7 +1257,7 @@ namespace Edu.Module.Course
demodel.Class_Price = courseModel.SellPrice;
if (demodel.EnterID <= 0 && demodel.CreateBy > 0)
{
if (userInfo.AccountType == AccountTypeEnum.Teacher && demodel.HelpEnterId ==0)
if (userInfo.AccountType == AccountTypeEnum.Teacher && demodel.HelpEnterId == 0)
{
demodel.HelpEnterId = demodel.CreateBy;
}
......@@ -1309,14 +1309,14 @@ namespace Edu.Module.Course
studentRepository.Update(stufileds, new WhereHelper(nameof(RB_Student_ViewModel.StuId), sItem.StuId));
student_AdvisorRepository.Insert(new Model.Entity.Customer.RB_Student_Advisor()
{
Id=0,
StuId=sItem.StuId,
AdvisorStatus=5,
AdvisorDate=Common.ConvertHelper.FormatDate(DateTime.Now),
AdvisorRemark="新增订单,系统自动添加!",
CreateBy=demodel.CreateBy,
CreateTime=DateTime.Now,
Group_Id=demodel.Group_Id,
Id = 0,
StuId = sItem.StuId,
AdvisorStatus = 5,
AdvisorDate = Common.ConvertHelper.FormatDate(DateTime.Now),
AdvisorRemark = "新增订单,系统自动添加!",
CreateBy = demodel.CreateBy,
CreateTime = DateTime.Now,
Group_Id = demodel.Group_Id,
});
}
}
......@@ -1350,7 +1350,7 @@ namespace Edu.Module.Course
Basics = visitorModel?.LevelType,
Education = GuestEducationEnum.N2,
GuestSource = demodel.OrderSource,
LearningGoals = 0,
LearningGoals = "",
Contact = "",
ContactMobile = "",
Status = 0,
......@@ -1398,7 +1398,7 @@ namespace Edu.Module.Course
Basics = oldGuestModel?.Basics,
Education = oldGuestModel?.Education ?? GuestEducationEnum.N2,
GuestSource = demodel.OrderSource,
LearningGoals = oldGuestModel?.LearningGoals ?? 0,
LearningGoals = oldGuestModel?.LearningGoals ?? "",
Contact = oldGuestModel?.Contact ?? "",
ContactMobile = oldGuestModel?.ContactMobile ?? "",
Status = 0,
......@@ -1512,7 +1512,7 @@ namespace Edu.Module.Course
Basics = "",
Education = item?.StuEducation ?? GuestEducationEnum.N2,
GuestSource = demodel.OrderSource,
LearningGoals = item?.StuPurpose ?? 0,
LearningGoals = item?.StuPurpose ?? "",
Contact = item?.StuContract ?? "",
ContactMobile = item?.StuContractMobile ?? "",
Status = 0,
......@@ -1540,7 +1540,7 @@ namespace Edu.Module.Course
QQ = item.QQ,
WeChatNo = item.WeChatNo,
TotalChapterNo = MaxChapterNo,
StudentId=item.StuId,
StudentId = item.StuId,
};
SetOrderGuestInfo(guestModel, out string Nmessage);
......@@ -1775,7 +1775,7 @@ namespace Edu.Module.Course
}
#endregion
return flag;
}
......@@ -1881,7 +1881,7 @@ namespace Edu.Module.Course
if (demodel.GuestNum == 1 && (orderModel.PreferPrice != demodel.PreferPrice || orderModel.DiscountMoney != demodel.DiscountMoney))
{
if (demodel.PreferPrice - demodel.DiscountMoney == orderModel.Income + orderModel.PlatformTax - orderModel.Refund && orderModel.Income >0)
if (demodel.PreferPrice - demodel.DiscountMoney == orderModel.Income + orderModel.PlatformTax - orderModel.Refund && orderModel.Income > 0)
{
//帐平
var glist = order_GuestRepository.GetOrderGuestListRepository(new RB_Order_Guest_ViewModel() { Group_Id = demodel.Group_Id, OrderId = demodel.OrderId, GuestState = GuestStateEnum.Normal });
......@@ -1915,12 +1915,13 @@ namespace Edu.Module.Course
int OrderId = orderRepository.Insert(demodel);
demodel.OrderId = OrderId;
flag = OrderId > 0;
if (flag) {
if (flag)
{
// 处理返佣信息
System.Threading.Tasks.Task.Run(() => SetReturnOrderCommission(demodel));
}
}
foreach (var item in StuList)
{
var guestModel = new RB_Order_Guest_ViewModel()
......@@ -1937,7 +1938,7 @@ namespace Edu.Module.Course
Basics = "",
Education = item?.StuEducation ?? GuestEducationEnum.N2,
GuestSource = demodel.OrderSource,
LearningGoals = item?.StuPurpose ?? 0,
LearningGoals = item?.StuPurpose ?? "",
Contact = item?.StuContract ?? "",
ContactMobile = item?.StuContractMobile ?? "",
Status = 0,
......@@ -2696,7 +2697,7 @@ namespace Edu.Module.Course
if (list != null && list.Count > 0)
{
string guestIds = string.Join(",", list.Select(qitem => qitem.Id));
string goalIds = string.Join(",", list.Select(qitem => qitem.LearningGoals));
string goalIds = string.Join(",", list?.Where(x=>!string.IsNullOrWhiteSpace(x.LearningGoals))?.Select(qitem => qitem.LearningGoals));
var goalList = learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend()
{
......@@ -2741,7 +2742,7 @@ namespace Edu.Module.Course
{
item.TargetClassName = sourceTargetList?.Where(qitem => qitem.OrderId == item.TargetOrderId)?.FirstOrDefault()?.ClassName;
}
item.LearningGoalsName = goalList?.FirstOrDefault(qitem => qitem.Id == item.LearningGoals)?.Name ?? "";
item.LearningGoalsName = !string.IsNullOrWhiteSpace(item.LearningGoals) ? (string.Join(",", goalList?.Where(qitem => item.LearningGoals.Contains(qitem.Id.ToString()))?.Select(x => x.Name)) ?? "") : "";
}
}
return list;
......@@ -2819,8 +2820,8 @@ namespace Edu.Module.Course
if (gModel.LearningGoals != dmodel.LearningGoals)
{
string oldName = learningGoalsRepository.GetLearningGoalsExtEntityRepository(gModel.LearningGoals)?.Name ?? "";
string newName = learningGoalsRepository.GetLearningGoalsExtEntityRepository(dmodel.LearningGoals)?.Name ?? "";
string oldName = !string.IsNullOrWhiteSpace(gModel.LearningGoals) ? (string.Join(",", learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend { QGoalIds = gModel.LearningGoals })?.Select(x => x.Name)) ?? "") : "";
string newName = !string.IsNullOrWhiteSpace(dmodel.LearningGoals) ? (string.Join(",", learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend { QGoalIds = dmodel.LearningGoals })?.Select(x => x.Name)) ?? "") : "";
LogContent += ",学习目的由【" + oldName + "】修改为【" + newName + "】";
}
gModel.LearningGoals = dmodel.LearningGoals;
......@@ -2918,10 +2919,10 @@ namespace Edu.Module.Course
else
{
#region 验证电话是否已是他人客户
if (!string.IsNullOrEmpty(dmodel.Mobile)&& dmodel.StudentId <= 0)
if (!string.IsNullOrEmpty(dmodel.Mobile) && dmodel.StudentId <= 0)
{
var slist = studentRepository.GetStudentListRepository(new RB_Student_ViewModel() { Group_Id = dmodel.Group_Id, StuTel = dmodel.Mobile,StuName=dmodel.GuestName.Trim(), School_Id = -1 });
if (slist.Where(x => x.CustomerId != ordermodel.CustomerId && x.StuName.Trim()==dmodel.GuestName.Trim()).Any())
var slist = studentRepository.GetStudentListRepository(new RB_Student_ViewModel() { Group_Id = dmodel.Group_Id, StuTel = dmodel.Mobile, StuName = dmodel.GuestName.Trim(), School_Id = -1 });
if (slist.Where(x => x.CustomerId != ordermodel.CustomerId && x.StuName.Trim() == dmodel.GuestName.Trim()).Any())
{
message = "学员'" + dmodel.GuestName + "'已被他人注册";
return false;
......@@ -3141,8 +3142,8 @@ namespace Edu.Module.Course
if (gModel.LearningGoals != dmodel.LearningGoals)
{
string oldName = learningGoalsRepository.GetLearningGoalsExtEntityRepository(gModel.LearningGoals)?.Name ?? "";
string newName = learningGoalsRepository.GetLearningGoalsExtEntityRepository(dmodel.LearningGoals)?.Name ?? "";
string oldName = !string.IsNullOrWhiteSpace(gModel.LearningGoals) ? (string.Join(",", learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend { QGoalIds = gModel.LearningGoals })?.Select(x => x.Name)) ?? "") : "";
string newName = !string.IsNullOrWhiteSpace(dmodel.LearningGoals) ? (string.Join(",", learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend { QGoalIds = dmodel.LearningGoals })?.Select(x => x.Name)) ?? "") : "";
LogContent += ",学习目的由【" + oldName + "】修改为【" + newName + "】";
}
gModel.LearningGoals = dmodel.LearningGoals;
......@@ -3385,11 +3386,11 @@ namespace Edu.Module.Course
/// <returns></returns>
public bool DelOrderGuestInfo(int guestId, UserInfo userInfo)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>()
Dictionary<string, object> keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Order_Guest_ViewModel.Status),1}
};
List<WhereHelper> wheres = new List<WhereHelper>()
List<WhereHelper> wheres = new List<WhereHelper>()
{
new WhereHelper()
{
......@@ -3676,11 +3677,11 @@ namespace Edu.Module.Course
if (teacherModel.AccountType != Common.Enum.User.AccountTypeEnum.Teacher) { return "所选账号不是教师端,无法关联"; }
NewName = teacherModel?.EmployeeName ?? "";
}
Dictionary<string, object> keyValues = new Dictionary<string, object>()
Dictionary<string, object> keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Order.HelpEnterId),helpEnterId}
};
List<WhereHelper> wheres = new List<WhereHelper>()
List<WhereHelper> wheres = new List<WhereHelper>()
{
new WhereHelper()
{
......@@ -3826,9 +3827,9 @@ namespace Edu.Module.Course
{
var orderModel = orderRepository.GetEntity(order.OrderId);
if (orderModel == null) { return false; }
Dictionary<string, object> keyValues = new Dictionary<string, object>() { };
string LogContent="";
string LogContent = "";
if (order.StudyBroadRebateMoney >= 0)
{
keyValues.Add(nameof(RB_Order_ViewModel.StudyBroadRebateMoney), order.StudyBroadRebateMoney);
......@@ -4161,7 +4162,8 @@ namespace Edu.Module.Course
}
}
//培训/留学订单 直接验证 订单的应收 大于等于实收
if (omodel.PreferPrice - omodel.DiscountMoney == money && money >0) {
if (omodel.PreferPrice - omodel.DiscountMoney == money && money > 0)
{
var studentMapping = student_OrderGuestRepository.GetList(new RB_Student_OrderGuest_ViewModel()
{
GuestId = guestId
......@@ -4853,7 +4855,7 @@ namespace Edu.Module.Course
foreach (var subItem in tempStuList)
{
var tempAdv = advList?.Where(qitem => qitem.StuId == subItem.Student_Id && qitem.AdvisorStatus == 5)?.FirstOrDefault();
if (tempAdv == null && subItem.Student_Id!=65)
if (tempAdv == null && subItem.Student_Id != 65)
{
Dictionary<string, object> stufileds = new Dictionary<string, object>()
{
......@@ -4891,7 +4893,7 @@ namespace Edu.Module.Course
if (list != null && list.Count > 0)
{
string guestIds = string.Join(",", list.Select(qitem => qitem.Id));
var checkList= class_CheckRepository.GetClassCheckList(new RB_Class_Check_ViewModel() { QOrderGuestIds = guestIds });
var checkList = class_CheckRepository.GetClassCheckList(new RB_Class_Check_ViewModel() { QOrderGuestIds = guestIds });
int index = 1;
foreach (var item in list)
{
......@@ -4913,7 +4915,7 @@ namespace Edu.Module.Course
ClassDate = classDate,
Status = 0,
ClassRoomId = 0,
Group_Id = lastCheck?.Group_Id?? 100000,
Group_Id = lastCheck?.Group_Id ?? 100000,
School_Id = 0,
TeacherId = 0,
OrderGuestId = item.Id,
......@@ -4934,7 +4936,7 @@ namespace Edu.Module.Course
{nameof(RB_Order_Guest.GuestState), (int)GuestStateEnum.Graduate},
};
flag = order_GuestRepository.Update(fileds, new WhereHelper(nameof(RB_Order_Guest.Id), item.Id));
Console.WriteLine(string.Format("已完成 {0}/{1} ",index,list.Count));
Console.WriteLine(string.Format("已完成 {0}/{1} ", index, list.Count));
index++;
}
}
......
......@@ -438,7 +438,7 @@ namespace Edu.Module.Course
Basics = "",
Education = item?.StuEducation ?? GuestEducationEnum.N2,
GuestSource = orderModel.OrderSource,
LearningGoals = item?.StuPurpose ?? 0,
LearningGoals = item?.StuPurpose ?? "",
Contact = item?.StuContract ?? "",
ContactMobile = item?.StuContractMobile ?? "",
Status = 0,
......
......@@ -273,7 +273,7 @@ namespace Edu.Module.Customer
/// <returns></returns>
public List<RB_Student_Follow_Extend> GetStudentFollowPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Student_Follow_Extend query)
{
var list= student_FollowRepository.GetStudentFollowPageRepository(pageIndex, pageSize, out rowsCount, query);
var list = student_FollowRepository.GetStudentFollowPageRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0)
{
List<int> courseIdList = new List<int>();
......@@ -287,7 +287,7 @@ namespace Edu.Module.Customer
}
List<Model.ViewModel.Course.RB_Course_ViewModel> courseList = new List<Model.ViewModel.Course.RB_Course_ViewModel>();
List<RB_Student_Config_Extend> configList = GetStudentConfigListModule();
if (courseIdList!=null &&courseIdList.Count > 0)
if (courseIdList != null && courseIdList.Count > 0)
{
string qCourseIds = string.Join(",", courseIdList);
courseList = GetCourseListModule(qCourseIds);
......@@ -360,12 +360,12 @@ namespace Edu.Module.Customer
if (oldModel.ConsultCourseIds != model.ConsultCourseIds)
{
List<int> courseIdList = new List<int>();
var tempOldList= Common.ConvertHelper.StringToList(oldModel.ConsultCourseIds);
var tempOldList = Common.ConvertHelper.StringToList(oldModel.ConsultCourseIds);
if (tempOldList != null && tempOldList.Count > 0)
{
courseIdList.AddRange(tempOldList);
}
var tempNewList= Common.ConvertHelper.StringToList(model.ConsultCourseIds);
var tempNewList = Common.ConvertHelper.StringToList(model.ConsultCourseIds);
if (tempNewList != null && tempNewList.Count > 0)
{
courseIdList.AddRange(tempNewList);
......@@ -377,7 +377,7 @@ namespace Edu.Module.Customer
var courseList = GetCourseListModule(string.Join(",", courseIdList));
foreach (var item in tempOldList)
{
oldCourseName += "、"+courseList?.FirstOrDefault(qitem => qitem.CourseId == item)?.CourseName ?? "";
oldCourseName += "、" + courseList?.FirstOrDefault(qitem => qitem.CourseId == item)?.CourseName ?? "";
}
foreach (var item in tempNewList)
{
......@@ -399,7 +399,7 @@ namespace Edu.Module.Customer
}
if (Common.ConvertHelper.FormatDate(oldModel.NextVisitDate) != Common.ConvertHelper.FormatDate(model.NextVisitDate))
{
logContent += string.Format("下次回访时间:由【{0}】=>【{1}】",Common.ConvertHelper.FormatDate(oldModel.NextVisitDate),Common.ConvertHelper.FormatDate(model.NextVisitDate));
logContent += string.Format("下次回访时间:由【{0}】=>【{1}】", Common.ConvertHelper.FormatDate(oldModel.NextVisitDate), Common.ConvertHelper.FormatDate(model.NextVisitDate));
}
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
......@@ -481,7 +481,7 @@ namespace Edu.Module.Customer
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStudentBaseInfoModule(RB_Student_Follow_Extend model, string StuProfession, int StuPurpose)
public bool SetStudentBaseInfoModule(RB_Student_Follow_Extend model, string StuProfession, string StuPurpose)
{
bool flag = false;
string logContent = "";
......@@ -578,8 +578,8 @@ namespace Edu.Module.Customer
var oldModel = studentRepository.GetEntity<RB_Student_ViewModel>(model.StuId);
if (oldModel.StuPurpose != StuPurpose)
{
string oldName = learningGoalsRepository.GetLearningGoalsExtEntityRepository(oldModel.StuPurpose)?.Name ?? "";
string newName = learningGoalsRepository.GetLearningGoalsExtEntityRepository(StuPurpose)?.Name ?? "";
string oldName =!string.IsNullOrWhiteSpace(oldModel.StuPurpose)?( string.Join(",", learningGoalsRepository.GetLearningGoalsListRepository(new RB_LearningGoals_Extend { QGoalIds = oldModel.StuPurpose })?.Select(x => x.Name)) ?? ""):"";
string newName = !string.IsNullOrWhiteSpace(StuPurpose) ? (string.Join(",", learningGoalsRepository.GetLearningGoalsListRepository(new RB_LearningGoals_Extend { QGoalIds = StuPurpose })?.Select(x => x.Name)) ?? ""): "";
logContent += string.Format("学习目的:由【{0}】=>【{1}】,", oldName, newName);
}
if (oldModel.StuProfession != StuProfession)
......@@ -594,7 +594,7 @@ namespace Edu.Module.Customer
flag = studentRepository.Update(fileds, new WhereHelper(nameof(RB_Student_ViewModel.StuId), model.StuId));
student_LogRepository.AddStuLogRepository(model.StuId, Common.Enum.Log.StudentLogTypeEnum.BasicInfo, logTitle, logContent, model.CreateBy, CreateType: 1);
}
return flag;
}
......@@ -1613,7 +1613,7 @@ namespace Edu.Module.Customer
/// <returns></returns>
public bool SetStudentVoucher(int stuId, string voucher, UserInfo userInfo)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>()
Dictionary<string, object> keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Student_ViewModel.FileVoucher), voucher},
};
......@@ -1654,11 +1654,11 @@ namespace Edu.Module.Customer
/// <returns></returns>
public bool SetStudentSureConsult(int stuId, int isSureConsultTime, UserInfo userInfo)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>()
Dictionary<string, object> keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Student_ViewModel.IsSureConsultTime), isSureConsultTime},
};
List<WhereHelper> wheres = new List<WhereHelper>()
List<WhereHelper> wheres = new List<WhereHelper>()
{
new WhereHelper ()
{
......@@ -1702,7 +1702,7 @@ namespace Edu.Module.Customer
{
List<int> empIdList = new List<int>();
var tempCreateByList = list.Select(qitem => qitem.CreateBy);
if (tempCreateByList != null && tempCreateByList.Count()>0)
if (tempCreateByList != null && tempCreateByList.Count() > 0)
{
empIdList.AddRange(tempCreateByList);
}
......@@ -1712,9 +1712,9 @@ namespace Edu.Module.Customer
empIdList.AddRange(tempStuCreateByList);
}
List<Employee_ViewModel> empList = new List<Employee_ViewModel>();
if(empIdList.Count() > 0)
if (empIdList.Count() > 0)
{
empList= accountRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", empIdList) });
empList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = string.Join(",", empIdList) });
}
foreach (var item in list)
......
......@@ -16,6 +16,7 @@ using Edu.Repository.Reserve;
using Edu.Repository.Sell;
using Edu.Repository.System;
using Edu.Repository.User;
using Senparc.CO2NET.Extensions;
using Senparc.Weixin.Annotations;
using Senparc.Weixin.MP.AdvancedAPIs;
using System;
......@@ -294,7 +295,7 @@ namespace Edu.Module.User
}
//学习目的
string goalIds = string.Join(",", list.Select(qitem => qitem.StuPurpose));
string goalIds = string.Join(",", list?.Where(qitem => !string.IsNullOrWhiteSpace(qitem.StuPurpose))?.Select(qitem => qitem.StuPurpose));
var goalList = learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend()
{
QGoalIds = goalIds
......@@ -369,7 +370,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 ?? "";
item.StuChannelName = channelList?.FirstOrDefault(qitem => qitem.Id == item.StuChannel)?.Name ?? "";
item.StuPurposeName = goalList?.FirstOrDefault(qitem => qitem.Id == item.StuPurpose)?.Name ?? "";
item.StuPurposeName =!string.IsNullOrWhiteSpace(item.StuPurpose)?( string.Join(",", goalList?.Where(qitem => item.StuPurpose.Contains(qitem.Id.ToString()))?.Select(x => x.Name)) ?? ""):"";
item.StuNeedsName = needList?.FirstOrDefault(qitem => qitem.Id == item.StuNeeds)?.Name ?? "";
item.AdvisorList = advisorList?.Where(qitem => qitem.StuId == item.StuId)?.ToList() ?? new List<RB_Student_Advisor_Extend>();
item.CreateByName = accountList?.FirstOrDefault(qitem => qitem.Id == item.CreateBy)?.AccountName ?? "";
......@@ -534,7 +535,7 @@ namespace Edu.Module.User
extModel.AssistList = assistList;
extModel.StuStageName = stageRepository.GetEntity(extModel.StuStage)?.StageName ?? "";
extModel.StuTypeName = student_TypeRepository.GetEntity(extModel.StuType)?.Name ?? "";
extModel.StuPurposeName = learningGoalsRepository.GetLearningGoalsExtEntityRepository(extModel.StuPurpose)?.Name ?? "";
extModel.StuPurposeName =!string.IsNullOrWhiteSpace(extModel.StuPurpose)?( string.Join(",", learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend { QGoalIds = extModel.StuPurpose }).Select(x => x.Name)) ?? ""):"";
extModel.StuChannelName = channelRepository.GetChannelExtEntityRepository(extModel.StuChannel)?.Name ?? "";
extModel.StuNeedsName = needsRepository.GetNeedsExtEntityRepository(extModel.StuNeeds)?.Name ?? "";
//if (extModel.CustomerId > 0)
......@@ -756,7 +757,7 @@ namespace Edu.Module.User
Id = model.CreateBy
})?.FirstOrDefault()?.AccountName ?? "";
string markdownContent = $"`同业查重通知` \n>**概要信息** \n>同业名称:{customerModel?.CustomerName ?? ""}({customerModel?.ContactNumber ?? ""})\n>查询内容:{searchContent} \n>关联学员:{model.StuName}\n>";
markdownContent += $"关联同事:{ createByName}\n> ";
markdownContent += $"关联同事:{createByName}\n> ";
Common.Message.PushMessageModel modelWork = new Common.Message.PushMessageModel()
{
CategoryId = PushMessageCategoryEnum.B2BCustomerStu,
......@@ -2305,7 +2306,7 @@ namespace Edu.Module.User
}
//学习目的
string goalIds = string.Join(",", list.Select(qitem => qitem.StuPurpose));
string goalIds = string.Join(",", list?.Where(qitem=> !string.IsNullOrWhiteSpace(qitem.StuPurpose))?.Select(qitem => qitem.StuPurpose));
var goalList = learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend()
{
QGoalIds = goalIds
......@@ -2362,7 +2363,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 ?? "";
item.StuChannelName = channelList?.FirstOrDefault(qitem => qitem.Id == item.StuChannel)?.Name ?? "";
item.StuPurposeName = goalList?.FirstOrDefault(qitem => qitem.Id == item.StuPurpose)?.Name ?? "";
item.StuPurposeName =!string.IsNullOrWhiteSpace(item.StuPurpose)?( string.Join(",", goalList?.Where(qitem => item.StuPurpose.Contains(qitem.Id.ToString())).Select(x => x.Name)) ?? ""):"";
item.StuNeedsName = needList?.FirstOrDefault(qitem => qitem.Id == item.StuNeeds)?.Name ?? "";
item.AdvisorList = advisorList?.Where(qitem => qitem.StuId == item.StuId)?.ToList() ?? new List<RB_Student_Advisor_Extend>();
item.CreateByName = accountList?.FirstOrDefault(qitem => qitem.Id == item.CreateBy)?.AccountName ?? "";
......@@ -2434,7 +2435,7 @@ namespace Edu.Module.User
}
//学习目的
string goalIds = string.Join(",", list.Select(qitem => qitem.StuPurpose));
string goalIds = string.Join(",", list?.Where(qitem => !string.IsNullOrWhiteSpace(qitem.StuPurpose))?.Select(qitem => qitem.StuPurpose));
var goalList = learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend()
{
QGoalIds = goalIds
......@@ -2491,7 +2492,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 ?? "";
item.StuChannelName = channelList?.FirstOrDefault(qitem => qitem.Id == item.StuChannel)?.Name ?? "";
item.StuPurposeName = goalList?.FirstOrDefault(qitem => qitem.Id == item.StuPurpose)?.Name ?? "";
item.StuPurposeName =!string.IsNullOrWhiteSpace(item.StuPurpose)?( string.Join(",", goalList?.Where(qitem => item.StuPurpose.Contains(qitem.Id.ToString()))?.Select(x => x.Name)) ?? ""):"";
item.StuNeedsName = needList?.FirstOrDefault(qitem => qitem.Id == item.StuNeeds)?.Name ?? "";
item.AdvisorList = advisorList?.Where(qitem => qitem.StuId == item.StuId)?.ToList() ?? new List<RB_Student_Advisor_Extend>();
item.CreateByName = accountList?.FirstOrDefault(qitem => qitem.Id == item.CreateBy)?.AccountName ?? "";
......
......@@ -109,7 +109,7 @@ namespace Edu.Module.User
//查询每月续费介绍情况
var ROList = student_RenewOrderRepository.GetStuMonthList(demodel.Group_Id);
//学习目的
string goalIds = string.Join(",", slist.Select(qitem => qitem.StuPurpose));
string goalIds = string.Join(",", slist?.Where(qitem => !string.IsNullOrWhiteSpace(qitem.StuPurpose))?.Select(qitem => qitem.StuPurpose));
var goalList = learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend()
{
QGoalIds = goalIds
......@@ -243,7 +243,7 @@ namespace Edu.Module.User
item.CreateByName = accountList?.FirstOrDefault(qitem => qitem.Id == item.CreateBy)?.AccountName ?? "";
item.StuChannelName = channelList?.FirstOrDefault(qitem => qitem.Id == item.StuChannel)?.Name ?? "";
item.StuPurposeName = goalList?.FirstOrDefault(qitem => qitem.Id == item.StuPurpose)?.Name ?? "";
item.StuPurposeName = !string.IsNullOrWhiteSpace(item.StuPurpose) ? (string.Join(",", goalList?.Where(qitem => item.StuPurpose.Contains(qitem.Id.ToString()))?.Select(x => x.Name)) ?? "") : "";
item.AdvisorList = advisorList?.Where(qitem => qitem.StuId == item.StuId)?.ToList();
var followModel = new StudentFollowStatic()
{
......@@ -336,8 +336,8 @@ namespace Edu.Module.User
var flist = followRepository.GetStudentFollowListRepository(new RB_Student_Follow_Extend { QStuIds = stuIds, Group_Id = demodel.Group_Id });
//查询续课 学员介绍
var xlist = student_OrderGuestRepository.GetStudentRenewRepository(demodel.Group_Id, stuIds);//续费
string goalIds = string.Join(",", slist.Select(qitem => qitem.StuPurpose));
string goalIds = string.Join(",", slist?.Where(qitem => !string.IsNullOrWhiteSpace(qitem.StuPurpose))?.Select(qitem => qitem.StuPurpose));
var goalList = learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend()
{
QGoalIds = goalIds
......@@ -379,9 +379,9 @@ namespace Edu.Module.User
}
item.AssistList = tempAssistList;
item.CreateByName = accountList?.FirstOrDefault(qitem => qitem.Id == item.CreateBy)?.AccountName ?? "";
item.StuPurposeName = goalList?.FirstOrDefault(qitem => qitem.Id == item.StuPurpose)?.Name ?? "";
item.StuPurposeName = !string.IsNullOrWhiteSpace(item.StuPurpose) ? (string.Join(",", goalList?.Where(qitem => item.StuPurpose.Contains(qitem.Id.ToString()))?.Select(x => x.Name)) ?? "") : "";
item.FollowList = flist?.Where(qitem => qitem.StuId == item.StuId)?.ToList();
var tempAppoint = appointmentList?.Where(qitem => qitem.StuId == item.StuId)?.FirstOrDefault();
var tempAppoint = appointmentList?.Where(qitem => qitem.StuId == item.StuId)?.FirstOrDefault();
//最新情况
string NewLesson = tempAppoint?.ChapterName ?? "";
var followModel = new StudentFollowStatic()
......
......@@ -300,7 +300,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.School_Id), query.School_Id);
}
if (query.StudentType > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.StudentType), query.StudentType);
}
if (query.QStudentType == 1)
{
builder.AppendFormat(" AND t.{0}=0 ", nameof(RB_Student_ViewModel.CustomerId));
......@@ -516,7 +519,7 @@ WHERE 1=1
{
builder.AppendFormat(" ORDER BY t.{0} DESC ", nameof(RB_Student_ViewModel.StuId));
}
return GetPage<RB_Student_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
......@@ -653,8 +656,8 @@ GROUP BY GuestId";
}
if (oldModel.StuPurpose != model.StuPurpose)
{
string oldName = learningGoalsRepository.GetLearningGoalsExtEntityRepository(oldModel.StuPurpose)?.Name ?? "";
string newName = learningGoalsRepository.GetLearningGoalsExtEntityRepository(model.StuPurpose)?.Name ?? "";
string oldName = !string.IsNullOrWhiteSpace(oldModel.StuPurpose) ? (string.Join(",", learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend { QGoalIds = oldModel.StuPurpose })?.Select(x => x.Name)) ?? "") : "";
string newName = !string.IsNullOrWhiteSpace(model.StuPurpose) ? (string.Join(",", learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend { QGoalIds = model.StuPurpose })?.Select(x => x.Name)) ?? "") : "";
logContent += string.Format("学习目的:由【{0}】=>【{1}】,", oldName, newName);
}
if (oldModel.StuProfession != model.StuProfession)
......@@ -1338,7 +1341,7 @@ LEFT JOIN rb_group AS g ON t.Group_Id=g.GId
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_ViewModel> GetStudentMonthListRepository( RB_Student_ViewModel query)
public List<RB_Student_ViewModel> GetStudentMonthListRepository(RB_Student_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
......@@ -1434,7 +1437,7 @@ where e.ClassScrollType=2 and c.OrderState=1
builder.AppendFormat(" AND t.{0} LIKE @StuTel ", nameof(RB_Student_ViewModel.StuRealMobile));
parameters.Add("StuTel", "%" + query.StuTel.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.KeyWords))
{
builder.AppendFormat(" AND (t.{0} LIKE @KeyWords OR t.{1} LIKE @KeyWords OR t.{2} LIKE @KeyWords) ", nameof(RB_Student_ViewModel.StuName), nameof(RB_Student_ViewModel.WeChatNo), nameof(RB_Student_ViewModel.StuRealMobile));
......@@ -1460,8 +1463,8 @@ where e.ClassScrollType=2 and c.OrderState=1
{
builder.AppendFormat(" AND DATE_FORMAT(t.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Student_ViewModel.CreateTime), query.QDate);
}
if (query.CategoryId > 0)
{
builder.AppendFormat(" AND C.{0}={1} ", nameof(RB_Student_ViewModel.CategoryId), query.CategoryId);
......@@ -1470,8 +1473,8 @@ where e.ClassScrollType=2 and c.OrderState=1
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.AdvisorStatus), query.AdvisorStatus);
}
}
builder.AppendFormat(" ORDER BY t.{0} DESC ", nameof(RB_Student_ViewModel.StuId));
return GetPage<RB_Student_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
......@@ -1487,14 +1490,14 @@ where e.ClassScrollType=2 and c.OrderState=1
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
builder.AppendFormat(@"
SELECT t.*
FROM rb_student AS t
WHERE 1=1
");
// builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.Status), (int)DateStateEnum.Normal);
// builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
......@@ -1557,7 +1560,7 @@ WHERE 1=1
}
}
var stuList = Get<RB_Student_ViewModel>(builder.ToString(), parameters).ToList();
return stuList;
}
......
......@@ -640,9 +640,9 @@ WHERE s.Group_Id ={group_Id} and o.JoinType=3 and s.`Status` =0 and sog.`Status`
{
where += $" and s.{nameof(RB_Student_ViewModel.AdvisorStatus)} ={demodel.AdvisorStatus}";
}
if (demodel.StuPurpose > 0)
if (!string.IsNullOrWhiteSpace(demodel.StuPurpose) && demodel.StuPurpose != "0")
{
where += $" and s.{nameof(RB_Student_ViewModel.StuPurpose)} ={demodel.StuPurpose}";
where += $" and FIND_IN_SET({demodel.StuPurpose},s.{nameof(RB_Student_ViewModel.StuPurpose)} )";
}
//if (demodel.School_Id > -1)
//{
......
......@@ -1401,7 +1401,7 @@ namespace Edu.WebApi.Controllers.Course
Basics = base.ParmJObj.GetStringValue("Basics"),
Education = (GuestEducationEnum)base.ParmJObj.GetInt("Education"),
GuestSource = (OrderSourceEnum)base.ParmJObj.GetInt("GuestSource"),
LearningGoals = base.ParmJObj.GetInt("LearningGoals"),
LearningGoals = base.ParmJObj.GetStringValue("LearningGoals"),
Contact = base.ParmJObj.GetStringValue("Contact"),
ContactMobile = base.ParmJObj.GetStringValue("ContactMobile"),
IDCard = base.ParmJObj.GetStringValue("IDCard"),
......
......@@ -230,7 +230,7 @@ namespace Edu.WebApi.Controllers.Customer
Remark = base.ParmJObj.GetStringValue("Remark"),
};
string StuProfession = base.ParmJObj.GetStringValue("StuProfession");
int StuPurpose = base.ParmJObj.GetInt("StuPurpose");
string StuPurpose = base.ParmJObj.GetStringValue("StuPurpose");
extModel.CreateBy = base.UserInfo.Id;
extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = base.UserInfo.Id;
......
......@@ -71,7 +71,7 @@ namespace Edu.WebApi.Controllers.User
StuStage = base.ParmJObj.GetInt("StuStage"),
StuType = base.ParmJObj.GetInt("StuType"),
WeChatNo = base.ParmJObj.GetStringValue("WeChatNo"),
StuPurpose = base.ParmJObj.GetInt("StuPurpose"),
StuPurpose = base.ParmJObj.GetStringValue("StuPurpose"),
HeadTeacherId = base.ParmJObj.GetInt("HeadTeacherId"),
QueryTpye = base.ParmJObj.GetInt("QueryTpye"),
AdvisorStatus = base.ParmJObj.GetInt("AdvisorStatus"),
......@@ -324,7 +324,7 @@ namespace Edu.WebApi.Controllers.User
StuStage = base.ParmJObj.GetInt("StuStage"),
StuType = base.ParmJObj.GetInt("StuType"),
WeChatNo = base.ParmJObj.GetStringValue("WeChatNo"),
StuPurpose = base.ParmJObj.GetInt("StuPurpose"),
StuPurpose = base.ParmJObj.GetStringValue("StuPurpose"),
HeadTeacherId = base.ParmJObj.GetInt("HeadTeacherId"),
QueryTpye = base.ParmJObj.GetInt("QueryTpye"),
AdvisorStatus = base.ParmJObj.GetInt("AdvisorStatus"),
......
......@@ -721,7 +721,8 @@ namespace Edu.WebApi.Controllers.User
CreateType = (StuCreateTypeEnum)base.ParmJObj.GetInt("CreateType"),
StuSourceId = base.ParmJObj.GetInt("StuSourceId"),
IsSureConsultTime = base.ParmJObj.GetInt("IsSureConsultTime"),
QOrderBy=base.ParmJObj.GetInt("QOrderBy"),
QOrderBy = base.ParmJObj.GetInt("QOrderBy"),
StudentType = base.ParmJObj.GetInt("StudentType", 1),
};
if (query.IsQueryMyStu == 1)
{
......@@ -806,7 +807,7 @@ namespace Edu.WebApi.Controllers.User
item.StuProfession,
item.StuEducation,
StuEducationName = item.StuEducation.ToName(),
item.StuPurpose,
StuPurpose = item.StuPurpose,
item.StuPurposeName,
item.VisitCount,
item.TrialLessonCount,
......@@ -1067,7 +1068,7 @@ namespace Edu.WebApi.Controllers.User
JapanBaseInfo = (GuestBasicsEnum)base.ParmJObj.GetInt("JapanBaseInfo"),
StuProfession = base.ParmJObj.GetStringValue("StuProfession"),
StuEducation = (GuestEducationEnum)base.ParmJObj.GetInt("StuEducation"),
StuPurpose = base.ParmJObj.GetInt("StuPurpose"),
StuPurpose = base.ParmJObj.GetStringValue("StuPurpose"),
StuSource = (OrderSourceEnum)base.ParmJObj.GetInt("StuSource"),
StuAddress = base.ParmJObj.GetStringValue("StuAddress"),
StuContract = base.ParmJObj.GetStringValue("StuContract"),
......@@ -1087,6 +1088,7 @@ namespace Edu.WebApi.Controllers.User
StuRealMobile = base.ParmJObj.GetStringValue("StuRealMobile"),
FileVoucher = base.ParmJObj.GetStringValue("FileVoucher"),
TelType = (StuTelTypeEnum)base.ParmJObj.GetInt("TelType"),
StudentType = base.ParmJObj.GetInt("StudentType", 1),
};
if (string.IsNullOrEmpty(extModel.StuRealMobile) && string.IsNullOrEmpty(extModel.QQ) && string.IsNullOrEmpty(extModel.WeChatNo))
{
......@@ -1348,7 +1350,7 @@ namespace Edu.WebApi.Controllers.User
JapanBaseInfo = (GuestBasicsEnum)base.ParmJObj.GetInt("JapanBaseInfo"),
StuProfession = base.ParmJObj.GetStringValue("StuProfession"),
StuEducation = (GuestEducationEnum)base.ParmJObj.GetInt("StuEducation"),
StuPurpose = base.ParmJObj.GetInt("StuPurpose"),
StuPurpose = base.ParmJObj.GetStringValue("StuPurpose"),
StuSource = (OrderSourceEnum)base.ParmJObj.GetInt("StuSource"),
StuAddress = base.ParmJObj.GetStringValue("StuAddress"),
StuContract = base.ParmJObj.GetStringValue("StuContract"),
......@@ -1359,6 +1361,7 @@ namespace Edu.WebApi.Controllers.User
QQ = base.ParmJObj.GetStringValue("QQ"),
StuType = base.ParmJObj.GetInt("StuType"),
StuRealMobile = base.ParmJObj.GetStringValue("StuRealMobile"),
StudentType = base.ParmJObj.GetInt("StuType", 1),
};
extModel.CreateType = StuCreateTypeEnum.CustomerInput;
extModel.Status = DateStateEnum.Normal;
......
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