Commit 3052f66f authored by liudong1993's avatar liudong1993

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

parents e27d05bf 85e87afe
......@@ -450,5 +450,10 @@ namespace Edu.Model.ViewModel.User
/// 查询未跟进学员
/// </summary>
public int IsQueryNotFollow { get; set; }
/// <summary>
/// 查询未跟进的线索
/// </summary>
public int IsQueryNotAppointment { get; set; }
}
}
\ No newline at end of file
......@@ -52,6 +52,7 @@ namespace Edu.Module.Goods
public bool SetActivitySurveyGuestModule(RB_ActivitySurvey_Guest_Extend model)
{
bool flag = false;
bool isAdd = model.Id>0;
foreach (var item in model.GuestIdList)
{
//var oldModel = activitySurvey_GuestRepository.GetActivitySurveyGuestListRepository(new RB_ActivitySurvey_Guest_Extend()
......@@ -62,7 +63,7 @@ namespace Edu.Module.Goods
//model.Id = oldModel?.Id ?? 0;
model.GuestId = item.GuestId;
if (model.Id > 0)
if (isAdd)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
......@@ -76,7 +77,6 @@ namespace Edu.Module.Goods
else
{
var newId = activitySurvey_GuestRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
}
......
......@@ -1376,12 +1376,13 @@ namespace Edu.Module.User
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="CreateBy"></param>
/// <param name="UserType">1-课程顾问,2-老师</param>
/// <returns></returns>
public List<object> GetTodayConnectPageModule(int pageIndex, int pageSize, out long rowsCount, int CreateBy)
public List<object> GetTodayConnectPageModule(int pageIndex, int pageSize, out long rowsCount, int CreateBy,int UserType=0)
{
List<object> result = new List<object>();
var list = student_AppointmentRepository.GetTodayConnectPageRepository(pageIndex, pageSize, out rowsCount, Common.ConvertHelper.FormatDate(DateTime.Now), CreateBy);
var list = student_AppointmentRepository.GetTodayConnectPageRepository(pageIndex, pageSize, out rowsCount, Common.ConvertHelper.FormatDate(DateTime.Now), CreateBy, UserType: UserType);
if (list != null && list.Count > 0)
{
//客户阶段列表
......@@ -1497,9 +1498,10 @@ namespace Edu.Module.User
rowsCount = 0;
var query = new RB_Student_ViewModel()
{
IsQueryNotFollow = 1,
IsQueryMyStu = 1,
CreateBy = UserId
IsQueryNotAppointment = 1,
BelongType = 1,
CreateBy = UserId,
QStudentStatus=1,
};
List<object> result = new List<object>();
var list = studentRepository.GetStudentPageListRepository(pageIndex, pageSize, out rowsCount, query);
......@@ -1731,8 +1733,9 @@ namespace Edu.Module.User
var query = new RB_Student_ViewModel()
{
IsQueryNotFollow = 1,
IsQueryMyStu = 1,
CreateBy = UserId
BelongType = 1,
CreateBy = UserId,
QStudentStatus = 1,
};
List<object> result = new List<object>();
var list = studentRepository.GetStudentPageListRepository(pageIndex, pageSize, out rowsCount, query);
......@@ -2150,9 +2153,27 @@ namespace Edu.Module.User
item.ClassNo,
item.ClassSchoolId,
item.SchoolName,
item.SaleRemarkList,
item.GuestList,
item.ContractList,
SaleRemarkList = item?.SaleRemarkList.Select(qitem => new
{
qitem.Content,
qitem.CreateByName,
CreateTime = Common.ConvertHelper.FormatTime(qitem.CreateTime)
}),
GuestList = item?.GuestList.Select(qitem => new {
qitem.Id,
qitem.GuestName,
qitem.ClassName,
qitem.ClassNo,
qitem.CourseName,
qitem.GuestState,
qitem.GuestStateStr,
qitem.ContractId,
qitem.ContractStatusStr,
qitem.ContractNo,
qitem.TotalHours,
qitem.CompleteHours,
qitem.ValidClassHours,
}),
item.CourseName,
item.CourseImg,
item.CourseSubject,
......
......@@ -107,19 +107,21 @@ WHERE 1=1
return Get<RB_Student_Appointment_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 今日需联系学员(之前预约的跟进学员或本周期内需要跟进的学员)
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name=""></param>
/// <param name="date">日期</param>
/// <param name="CreateBy">创建人</param>
/// <param name="UserType">1-课程顾问,2-老师</param>
/// <returns></returns>
public List<RB_Student_ViewModel> GetTodayConnectPageRepository(int pageIndex,int pageSize,out long rowsCount,string date,int CreateBy)
public List<RB_Student_ViewModel> GetTodayConnectPageRepository(int pageIndex,int pageSize,out long rowsCount,string date,int CreateBy,int UserType=0)
{
StringBuilder builder = new StringBuilder();
string where1="", where2="";
string where1="", where2="",tempWhere="";
if (!string.IsNullOrEmpty(date))
{
//指定日期的约访统计
......@@ -129,7 +131,7 @@ WHERE 1=1
date);
}
if (CreateBy > 0)
{
where1 += string.Format(" AND B.{0}={1} ", nameof(RB_Student_Appointment_Extend.CreateBy), CreateBy);
......@@ -140,6 +142,16 @@ WHERE 1=1
", CreateBy);
}
//课程顾问
if (UserType == 1)
{
tempWhere += string.Format(@" AND DATE_FORMAT(CreateTime, '%Y%m' )=DATE_FORMAT(NOW() , '%Y%m' ) ");
}
else if (UserType == 2)
{
tempWhere += string.Format(@" AND WEEK(CreateTime,1)=WEEK(NOW(),1) ");
}
builder.AppendFormat(@"
SELECT *
FROM
......@@ -150,10 +162,10 @@ FROM
UNION ALL
SELECT A.*
FROM rb_student AS A
LEFT JOIN (SELECT StuId,COUNT(1) AS FollowCount FROM rb_student_follow WHERE WEEK(CreateTime,1)=WEEK(NOW(),1) GROUP BY StuId ) AS B ON A.StuId=B.StuId
LEFT JOIN (SELECT StuId,COUNT(1) AS FollowCount FROM rb_student_follow WHERE 1=1 {2} GROUP BY StuId ) AS B ON A.StuId=B.StuId
WHERE 1=1 AND IFNULL(B.FollowCount,0)=0 {1}
) AS A
", where1,where2);
) AS A WHERE A.School_Id NOT IN(1,6,9) AND A.`Status`=0 AND A.StuStage<>7 AND A.AdvisorStatus<>7
", where1,where2,tempWhere);
return GetPage<RB_Student_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
}
......
......@@ -458,7 +458,11 @@ WHERE 1=1
nameof(RB_Student_ViewModel.StuSourceId),
query.StuSourceId);
}
//查询未未跟进的线索
if (query.IsQueryNotAppointment == 1)
{
builder.AppendFormat(" AND Exists(SELECT StuId FROM RB_Student_Appointment WHERE `Status`=0 AND t.StuId=StuId AND IFNULL(Feedback,'')='') ");
}
//查询未跟进学员
if (query.IsQueryNotFollow == 1)
{
......
......@@ -3338,8 +3338,19 @@ namespace Edu.WebApi.Controllers.User
/// </summary>
public ApiResult GetTodayConnect()
{
var userId = 0;
//userId = base.UserInfo.Id;
int UserType = 0;
if (base.UserInfo.IsCourseConsultant == 1)
{
UserType = 1;
}
else if (base.UserInfo.AccountType == AccountTypeEnum.Teacher)
{
UserType = 2;
}
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var list = studentModule.GetTodayConnectPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, base.UserInfo.Id);
var list = studentModule.GetTodayConnectPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, userId,UserType:UserType);
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
......@@ -3351,8 +3362,10 @@ namespace Edu.WebApi.Controllers.User
/// <returns></returns>
public ApiResult MyClue()
{
var userId = 0;
userId = base.UserInfo.Id;
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var list = studentModule.GetMyClueModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, base.UserInfo.Id);
var list = studentModule.GetMyClueModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, userId);
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
......@@ -3365,6 +3378,7 @@ namespace Edu.WebApi.Controllers.User
public ApiResult MyStudent()
{
var userId = 0;
userId = 2855;
//userId = base.UserInfo.Id;
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var list = studentModule.GetMyStudentModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, userId);
......
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