Commit b6692c65 authored by 黄奎's avatar 黄奎

学员分解信息调整

parent 12269c0f
...@@ -41,4 +41,16 @@ namespace Edu.Common.Enum.User ...@@ -41,4 +41,16 @@ namespace Edu.Common.Enum.User
Other = 5, Other = 5,
} }
/// <summary>
/// 学员配置
/// </summary>
public enum StuConfigEnum
{
/// <summary>
/// 意向度
/// </summary>
[EnumField("意向度")]
PurposeType = 1,
}
} }
...@@ -31,4 +31,34 @@ namespace Edu.Common.Enum.User ...@@ -31,4 +31,34 @@ namespace Edu.Common.Enum.User
[EnumField("学员转介绍")] [EnumField("学员转介绍")]
TransIntroduction = 4, TransIntroduction = 4,
} }
/// <summary>
/// 学员电话关联人
/// </summary>
public enum StuTelTypeEnum
{
/// <summary>
/// 母亲
/// </summary>
[EnumField("母亲")]
Mother = 1,
/// <summary>
/// 父亲
/// </summary>
[EnumField("父亲")]
Father = 2,
/// <summary>
/// 内部介绍
/// </summary>
[EnumField("自己")]
Self = 3,
/// <summary>
/// 其他
/// </summary>
[EnumField("其他")]
Other = 4,
}
} }
...@@ -36,6 +36,8 @@ namespace Edu.Education ...@@ -36,6 +36,8 @@ namespace Edu.Education
new QuarzHelper().EduCreateScrollAppointmentTimer().GetAwaiter().GetResult(); new QuarzHelper().EduCreateScrollAppointmentTimer().GetAwaiter().GetResult();
new QuarzHelper().EduCreateScrollChapterTimer().GetAwaiter().GetResult();//预约章节自动生成 2022-02-14 new QuarzHelper().EduCreateScrollChapterTimer().GetAwaiter().GetResult();//预约章节自动生成 2022-02-14
new QuarzHelper().CheckPerparingTimer().GetAwaiter().GetResult(); new QuarzHelper().CheckPerparingTimer().GetAwaiter().GetResult();
new QuarzHelper().PushStuFollowUp().GetAwaiter().GetResult();//推送学员回访
} }
/// <summary> /// <summary>
......
...@@ -15,6 +15,7 @@ using Edu.Module.QYWeChat; ...@@ -15,6 +15,7 @@ using Edu.Module.QYWeChat;
using System.Web; using System.Web;
using Edu.Common.Plugin; using Edu.Common.Plugin;
using Edu.Common; using Edu.Common;
using Edu.Module.Customer;
namespace Edu.Education.Helper namespace Edu.Education.Helper
{ {
...@@ -375,6 +376,33 @@ namespace Edu.Education.Helper ...@@ -375,6 +376,33 @@ namespace Edu.Education.Helper
await scheduler.ScheduleJob(job, trigger); await scheduler.ScheduleJob(job, trigger);
} }
/// <summary>
/// 推送学员回访信息
/// </summary>
/// <returns></returns>
public async Task PushStuFollowUp()
{
string cronExpression = "0 0,5,10,15,20,25,30,35,40,45,50,55 * * * ?";//每5分钟执行的一次
NameValueCollection props = new NameValueCollection
{
{ "quartz.serializer.type", "binary" }
};
StdSchedulerFactory factory = new StdSchedulerFactory(props);
IScheduler scheduler = await factory.GetScheduler();
await scheduler.Start();
IJobDetail job = JobBuilder.Create<PushStuFollowUpJob>()
.WithIdentity("job12", "group12")
.Build();
ICronTrigger trigger = (ICronTrigger)TriggerBuilder.Create()
.WithIdentity("trigger12", "group12")
.WithCronSchedule(cronExpression)
.Build();
await scheduler.ScheduleJob(job, trigger);
}
} }
...@@ -445,7 +473,8 @@ namespace Edu.Education.Helper ...@@ -445,7 +473,8 @@ namespace Edu.Education.Helper
{ {
//查询改配置下当前周期 //查询改配置下当前周期
var list = oKRPeriodModule.GetCurrentPeriodList(dmodel.Group_Id); var list = oKRPeriodModule.GetCurrentPeriodList(dmodel.Group_Id);
if (list.Any()) { if (list.Any())
{
var model = list.FirstOrDefault(); var model = list.FirstOrDefault();
//看是否已到可生成下周期时间 //看是否已到可生成下周期时间
if (dmodel.BeforeType == 1) if (dmodel.BeforeType == 1)
...@@ -508,7 +537,8 @@ namespace Edu.Education.Helper ...@@ -508,7 +537,8 @@ namespace Edu.Education.Helper
LogHelper.Write("开始执行规则适配...."); LogHelper.Write("开始执行规则适配....");
OKRPeriodModule oKRPeriodModule = new OKRPeriodModule(); OKRPeriodModule oKRPeriodModule = new OKRPeriodModule();
var clist = oKRPeriodModule.GetOKRKeyResultList(new Model.ViewModel.OKR.RB_OKR_KeyResult_ViewModel() { IsUseRule = 1 }); var clist = oKRPeriodModule.GetOKRKeyResultList(new Model.ViewModel.OKR.RB_OKR_KeyResult_ViewModel() { IsUseRule = 1 });
foreach (var item in clist) { foreach (var item in clist)
{
oKRPeriodModule.UpdateOKRKeyresultRuleProgress(item); oKRPeriodModule.UpdateOKRKeyresultRuleProgress(item);
} }
} }
...@@ -565,7 +595,7 @@ namespace Edu.Education.Helper ...@@ -565,7 +595,7 @@ namespace Edu.Education.Helper
public Task Execute(IJobExecutionContext context) public Task Execute(IJobExecutionContext context)
{ {
try try
{ {
Console.WriteLine("开始执行未备课查询...."); Console.WriteLine("开始执行未备课查询....");
ClassModule classModule = new ClassModule(); ClassModule classModule = new ClassModule();
var query = classModule.GetNotPerparingTeachModule(); var query = classModule.GetNotPerparingTeachModule();
...@@ -580,7 +610,7 @@ namespace Edu.Education.Helper ...@@ -580,7 +610,7 @@ namespace Edu.Education.Helper
PushWorkChatHelper.PushToWorkChat(content, x.WorkUserId, "业务单据驳回通知"); PushWorkChatHelper.PushToWorkChat(content, x.WorkUserId, "业务单据驳回通知");
}); });
} }
else else
{ {
Console.WriteLine("所有老师完成明日备课...."); Console.WriteLine("所有老师完成明日备课....");
} }
...@@ -789,7 +819,8 @@ namespace Edu.Education.Helper ...@@ -789,7 +819,8 @@ namespace Edu.Education.Helper
/// 更新历史订单提成比例 /// 更新历史订单提成比例
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public bool UpdageHistoryOrderCommission() { public bool UpdageHistoryOrderCommission()
{
return new ClassModule().UpdateHistoryClassNo(); return new ClassModule().UpdateHistoryClassNo();
...@@ -797,4 +828,30 @@ namespace Edu.Education.Helper ...@@ -797,4 +828,30 @@ namespace Edu.Education.Helper
//return new OrderModule().UpdateClassOrderCommissionRate(); //return new OrderModule().UpdateClassOrderCommissionRate();
} }
} }
/// <summary>
/// 推送学员回访
/// </summary>
public class PushStuFollowUpJob : IJob
{
/// <summary>
/// 这里是作业调度每次定时执行方法
/// </summary>
/// <param name="context"></param>
public Task Execute(IJobExecutionContext context)
{
try
{
LogHelper.Write("推送学员回访 Start***");
CustomerStudentModule customerStudentModule = new CustomerStudentModule();
var flag= customerStudentModule.PushStudentFollowUpModule();
LogHelper.Write("推送学员回访 End*** Flag:" + flag);
}
catch (Exception ex)
{
LogHelper.Write(ex, "PushStuFollowUpJob");
}
return null;
}
}
} }
using Edu.Common.Enum;
using Edu.Common.Enum.User;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Customer
{
/// <summary>
/// 学生配置表实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Student_Config
{
/// <summary>
/// 主键编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 类型(1-意向度)
/// </summary>
public StuConfigEnum ConfigType { get; set; }
/// <summary>
/// 配置名称
/// </summary>
public string ConfigName { get; set; }
/// <summary>
/// 排序
/// </summary>
public int SortNum { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 删除状态(0-正常,1-删除)
/// </summary>
public DateStateEnum Status { get; set; }
}
}
...@@ -62,5 +62,25 @@ namespace Edu.Model.Entity.Customer ...@@ -62,5 +62,25 @@ namespace Edu.Model.Entity.Customer
/// 跟进类型(见枚举) /// 跟进类型(见枚举)
/// </summary> /// </summary>
public Common.Enum.User.AssistTypeEnum AssistType { get; set; } public Common.Enum.User.AssistTypeEnum AssistType { get; set; }
/// <summary>
/// 咨询课程【多选】
/// </summary>
public string ConsultCourseIds { get; set; }
/// <summary>
/// 咨询关键词
/// </summary>
public string ConsultKeyWords { get; set; }
/// <summary>
/// 下次回访时间
/// </summary>
public DateTime NextVisitDate { get; set; }
/// <summary>
/// 意向度
/// </summary>
public int PurposeType { get; set; }
} }
} }
...@@ -276,5 +276,10 @@ namespace Edu.Model.Entity.User ...@@ -276,5 +276,10 @@ namespace Edu.Model.Entity.User
/// 确认邀约咨询30分钟以上 1是 /// 确认邀约咨询30分钟以上 1是
/// </summary> /// </summary>
public int IsSureConsultTime { get; set; } public int IsSureConsultTime { get; set; }
/// <summary>
/// 电话关联人
/// </summary>
public StuTelTypeEnum TelType { get; set; }
} }
} }
using Edu.Model.Entity.Customer;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Customer
{
/// <summary>
/// 学员配置表扩展实体类
/// </summary>
[Serializable]
public class RB_Student_Config_Extend: RB_Student_Config
{
}
}
...@@ -59,5 +59,20 @@ namespace Edu.Model.ViewModel.Customer ...@@ -59,5 +59,20 @@ namespace Edu.Model.ViewModel.Customer
/// 查询指定日期跟进记录 /// 查询指定日期跟进记录
/// </summary> /// </summary>
public string QueryDate { get; set; } public string QueryDate { get; set; }
/// <summary>
/// 课程名称
/// </summary>
public List<string> CourseNameList { get; set; }
/// <summary>
/// 意向度名称
/// </summary>
public string PurposeTypeName { get; set; }
/// <summary>
/// 学员负责人
/// </summary>
public int StuCreateBy { get; set; }
} }
} }
...@@ -505,5 +505,15 @@ namespace Edu.Model.ViewModel.User ...@@ -505,5 +505,15 @@ namespace Edu.Model.ViewModel.User
/// 毕业状态(1-未毕业,2-已毕业); /// 毕业状态(1-未毕业,2-已毕业);
/// </summary> /// </summary>
public int QGuestState { get; set; } public int QGuestState { get; set; }
/// <summary>
/// 最新跟进时间
/// </summary>
public DateTime MaxFollowTime { get; set; }
/// <summary>
/// 排序(0-默认倒序,1-跟进时间倒序,2-跟进时间升序)
/// </summary>
public int QOrderBy { get; set; }
} }
} }
\ No newline at end of file
...@@ -295,7 +295,7 @@ namespace Edu.Module.Public ...@@ -295,7 +295,7 @@ namespace Edu.Module.Public
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.Plugin.LogHelper.Write(ex, "DelSurveyQuestionModule::param_" + Common.Plugin.JsonHelper.Serialize(model));
return false; return false;
} }
} }
...@@ -400,6 +400,7 @@ namespace Edu.Module.Public ...@@ -400,6 +400,7 @@ namespace Edu.Module.Public
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.Plugin.LogHelper.Write(ex, "SetStudentSurvey::param_" + Common.Plugin.JsonHelper.Serialize(model));
return 0; return 0;
} }
} }
......
...@@ -16,6 +16,8 @@ using Edu.Repository.Reserve; ...@@ -16,6 +16,8 @@ using Edu.Repository.Reserve;
using Edu.Repository.Sell; using Edu.Repository.Sell;
using Edu.Repository.System; using Edu.Repository.System;
using Edu.Repository.User; using Edu.Repository.User;
using Senparc.Weixin.Annotations;
using Senparc.Weixin.MP.AdvancedAPIs;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -157,6 +159,12 @@ namespace Edu.Module.User ...@@ -157,6 +159,12 @@ namespace Edu.Module.User
/// </summary> /// </summary>
private readonly RB_Order_ReturnComissionRepository returnComissionRepository = new RB_Order_ReturnComissionRepository(); private readonly RB_Order_ReturnComissionRepository returnComissionRepository = new RB_Order_ReturnComissionRepository();
/// <summary>
/// 学员配置仓储层
/// </summary>
private readonly RB_Student_ConfigRepository student_ConfigRepository = new RB_Student_ConfigRepository();
/// <summary> /// <summary>
/// 获取学生列表 /// 获取学生列表
/// </summary> /// </summary>
...@@ -459,9 +467,7 @@ namespace Edu.Module.User ...@@ -459,9 +467,7 @@ namespace Edu.Module.User
new Common.Message.MessageHelper().SendMessage(pushList); new Common.Message.MessageHelper().SendMessage(pushList);
} }
} }
} }
return flag; return flag;
} }
...@@ -2494,5 +2500,78 @@ namespace Edu.Module.User ...@@ -2494,5 +2500,78 @@ namespace Edu.Module.User
return list; return list;
} }
#region 学员配置表
/// <summary>
/// 获取学员配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Config_Extend> GetStudentConfigModule(RB_Student_Config_Extend query)
{
var list = student_ConfigRepository.GetStudentConfigListRepository(query);
return list;
}
/// <summary>
/// 新增修改学员配置
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStudentConfigModule(RB_Student_Config_Extend model)
{
bool flag = false;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Config_Extend.ConfigName),model.ConfigName},
{nameof(RB_Student_Config_Extend.SortNum),model.SortNum},
{nameof(RB_Student_Config_Extend.UpdateBy),model.UpdateBy},
{nameof(RB_Student_Config_Extend.UpdateTime),DateTime.Now }
};
flag = student_ConfigRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Config_Extend.Id), model.Id));
}
else
{
var newId = student_ConfigRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 根据Id删除学员配置
/// </summary>
/// <param name="Id"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public bool RemoveStudentConfigModule(int Id, UserInfo userInfo)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Config_Extend.Status),(int)DateStateEnum.Delete },
{nameof(RB_Student_Config_Extend.UpdateBy),userInfo.Id},
{nameof(RB_Student_Config_Extend.UpdateTime),DateTime.Now }
};
flag = student_ConfigRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Config_Extend.Id), Id));
return flag;
}
/// <summary>
/// 根据编号获取学员配置信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_Student_Config_Extend GetStudentConfigModule(int Id)
{
RB_Student_Config_Extend extModel = studentRepository.GetEntity<RB_Student_Config_Extend>(Id);
return extModel;
}
#endregion
} }
} }
using Edu.Common.Enum;
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Customer
{
/// <summary>
/// 学员配置表仓储层
/// </summary>
public class RB_Student_ConfigRepository : BaseRepository<RB_Student_Config>
{
/// <summary>
/// 获取学生配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Config_Extend> GetStudentConfigListRepository(RB_Student_Config_Extend query)
{
DynamicParameters parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Student_Config AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.Status={0} ", (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.Group_Id={0} ", query.Group_Id);
}
if (query.ConfigType > 0)
{
builder.AppendFormat(" AND A.ConfigType={0} ", (int)query.ConfigType);
}
if (!string.IsNullOrEmpty(query.ConfigName))
{
builder.AppendFormat(" AND A.ConfigName LIKE @ConfigName ");
parameters.Add("@ConfigName", "%" + query.ConfigName.Trim() + "%");
}
}
return Get<RB_Student_Config_Extend>(builder.ToString(), parameters).ToList();
}
}
}
...@@ -479,5 +479,23 @@ SELECT Avg(FollowCount) AS FollowEffectiveCount FROM ...@@ -479,5 +479,23 @@ SELECT Avg(FollowCount) AS FollowEffectiveCount FROM
dicList.Add("lastMonth", lastMonthList); dicList.Add("lastMonth", lastMonthList);
return dicList; return dicList;
} }
/// <summary>
/// 获取今天需要回访的学员
/// </summary>
/// <returns></returns>
public List<RB_Student_Follow_Extend> GetTodayFollowUpRepository()
{
string todayStr = Common.ConvertHelper.FormatDate(DateTime.Now);
todayStr = "2024-08-29";
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.StuId,IFNULL(B.StuName,'') AS StuName,A.CreateBy,B.CreateBy AS StuCreateBy
FROM rb_student_follow AS A LEFT JOIN rb_student AS B ON A.StuId=B.StuId
WHERE 1=1 AND A.`Status`=0 AND A.NextVisitDate='{0}'
", todayStr);
return Get<RB_Student_Follow_Extend>(builder.ToString()).ToList();
}
} }
} }
...@@ -269,7 +269,7 @@ WHERE 1=1 ...@@ -269,7 +269,7 @@ WHERE 1=1
var parameters = new DynamicParameters(); var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT t.*,g.GroupName,s.SName,IFNULL(a.Account,'') AS StudentAccount ,c.CustomerName,IFNULL(B.Name,'') AS AdvisorStatusName SELECT t.*,g.GroupName,s.SName,IFNULL(a.Account,'') AS StudentAccount,c.CustomerName,IFNULL(B.Name,'') AS AdvisorStatusName,sf.MaxFollowTime
FROM rb_student AS t LEFT JOIN rb_group AS g ON t.Group_Id=g.GId FROM rb_student AS t LEFT JOIN rb_group AS g ON t.Group_Id=g.GId
LEFT JOIN rb_school AS s ON t.School_Id=s.SId LEFT JOIN rb_school AS s ON t.School_Id=s.SId
LEFT JOIN rb_customer c on (c.CustomerId = t.StuSourceId AND t.CreateType=2) LEFT JOIN rb_customer c on (c.CustomerId = t.StuSourceId AND t.CreateType=2)
...@@ -281,6 +281,9 @@ FROM rb_student AS t LEFT JOIN rb_group AS g ON t.Group_Id=g.GId ...@@ -281,6 +281,9 @@ FROM rb_student AS t LEFT JOIN rb_group AS g ON t.Group_Id=g.GId
WHERE B.OrderState IN(1) WHERE B.OrderState IN(1)
GROUP BY A.Student_Id GROUP BY A.Student_Id
) AS org ON t.StuId=org.Student_Id ) AS org ON t.StuId=org.Student_Id
LEFT JOIN (
SELECT StuId,MAX(UpdateTime) AS MaxFollowTime FROM rb_student_follow WHERE Status=0 GROUP BY StuId
) AS sf ON t.StuId=sf.StuId
WHERE 1=1 WHERE 1=1
"); ");
if (query != null) if (query != null)
...@@ -501,7 +504,19 @@ WHERE 1=1 ...@@ -501,7 +504,19 @@ WHERE 1=1
builder.AppendFormat(" AND Exists (SELECT StuId FROM rb_student_follow WHERE `Status`=0 AND t.StuId=StuId AND CreateBy={0} AND CreateTime>='{1}' AND CreateTime<='{2} 23:59:59') ", query.CreateBy, query.FollowStartTime, query.FollowEndTime); builder.AppendFormat(" AND Exists (SELECT StuId FROM rb_student_follow WHERE `Status`=0 AND t.StuId=StuId AND CreateBy={0} AND CreateTime>='{1}' AND CreateTime<='{2} 23:59:59') ", query.CreateBy, query.FollowStartTime, query.FollowEndTime);
} }
} }
builder.AppendFormat(" ORDER BY t.{0} DESC ", nameof(RB_Student_ViewModel.StuId)); if (query.QOrderBy == 1)
{
builder.AppendFormat(" ORDER BY sf.MaxFollowTime DESC ");
}
else if (query.QOrderBy == 2)
{
builder.AppendFormat(" ORDER BY sf.MaxFollowTime ASC ");
}
else
{
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(); return GetPage<RB_Student_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
} }
...@@ -612,6 +627,10 @@ GROUP BY GuestId"; ...@@ -612,6 +627,10 @@ GROUP BY GuestId";
{ {
logContent += string.Format("电话:由【{0}】=>【{1}】,", oldModel.StuTel, model.StuTel); logContent += string.Format("电话:由【{0}】=>【{1}】,", oldModel.StuTel, model.StuTel);
} }
if (oldModel.TelType != model.TelType)
{
logContent += string.Format("电话关联人:由【{0}】=>【{1}】,", oldModel.TelType.ToName(), model.TelType.ToName());
}
if (oldModel.StuIcon != model.StuIcon) if (oldModel.StuIcon != model.StuIcon)
{ {
logContent += string.Format("头像:由【{0}】=>【{1}】,", oldModel.StuIcon, model.StuIcon); logContent += string.Format("头像:由【{0}】=>【{1}】,", oldModel.StuIcon, model.StuIcon);
...@@ -735,6 +754,7 @@ GROUP BY GuestId"; ...@@ -735,6 +754,7 @@ GROUP BY GuestId";
{nameof(RB_Student_ViewModel.WeChatNo),model.WeChatNo}, {nameof(RB_Student_ViewModel.WeChatNo),model.WeChatNo},
{nameof(RB_Student_ViewModel.StuType),model.StuType}, {nameof(RB_Student_ViewModel.StuType),model.StuType},
{nameof(RB_Student_ViewModel.StuRealMobile),model.StuRealMobile}, {nameof(RB_Student_ViewModel.StuRealMobile),model.StuRealMobile},
{nameof(RB_Student_ViewModel.TelType),model.TelType},
}; };
if (!string.IsNullOrEmpty(model.FileVoucher)) if (!string.IsNullOrEmpty(model.FileVoucher))
{ {
......
...@@ -6,6 +6,7 @@ using Edu.Common.API; ...@@ -6,6 +6,7 @@ using Edu.Common.API;
using Edu.Common.Enum.Course; using Edu.Common.Enum.Course;
using Edu.Common.Enum.Finance; using Edu.Common.Enum.Finance;
using Edu.Common.Enum.Sale; using Edu.Common.Enum.Sale;
using Edu.Common.Enum.User;
using Edu.Common.Plugin; using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course; using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.Grade; using Edu.Model.ViewModel.Grade;
...@@ -1153,6 +1154,8 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1153,6 +1154,8 @@ namespace Edu.WebApi.Controllers.Course
})); }));
} }
/// <summary> /// <summary>
/// 获取枚举列表 /// 获取枚举列表
/// </summary> /// </summary>
......
...@@ -38,12 +38,12 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -38,12 +38,12 @@ namespace Edu.WebApi.Controllers.Customer
public ApiResult GetStudentAppointmentPage() public ApiResult GetStudentAppointmentPage()
{ {
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString()); var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Student_Appointment_Extend() var query = new RB_Student_Appointment_Extend
{ {
StuId = base.ParmJObj.GetInt("StuId"), StuId = base.ParmJObj.GetInt("StuId"),
Id = base.ParmJObj.GetInt("Id"), Id = base.ParmJObj.GetInt("Id"),
Group_Id = base.UserInfo.Group_Id
}; };
query.Group_Id = base.UserInfo.Group_Id;
var data = customerStudentModule.GetStudentAppointmentPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query); var data = customerStudentModule.GetStudentAppointmentPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> list = new List<object>(); List<object> list = new List<object>();
foreach (var item in data) foreach (var item in data)
...@@ -156,6 +156,13 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -156,6 +156,13 @@ namespace Edu.WebApi.Controllers.Customer
item.CreateBy, item.CreateBy,
CreateTime = Common.ConvertHelper.FormatTimeStr2(item.CreateTime), CreateTime = Common.ConvertHelper.FormatTimeStr2(item.CreateTime),
CreateByName, CreateByName,
item.PurposeType,
item.PurposeTypeName,
CourseName=string.Join("、", item.CourseNameList),
item.ConsultCourseIds,
ConsultCourseIdList=Common.ConvertHelper.StringToList(item.ConsultCourseIds),
item.ConsultKeyWords,
NextVisitDate = Common.ConvertHelper.FormatDate(item.NextVisitDate)
}); });
} }
pageModel.Count = rowsCount; pageModel.Count = rowsCount;
...@@ -175,7 +182,24 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -175,7 +182,24 @@ namespace Edu.WebApi.Controllers.Customer
Id = base.ParmJObj.GetInt("Id"), Id = base.ParmJObj.GetInt("Id"),
StuId = base.ParmJObj.GetInt("StuId"), StuId = base.ParmJObj.GetInt("StuId"),
Remark = base.ParmJObj.GetStringValue("Remark"), Remark = base.ParmJObj.GetStringValue("Remark"),
PurposeType = base.ParmJObj.GetInt("PurposeType"),
ConsultKeyWords = base.ParmJObj.GetStringValue("ConsultKeyWords"),
NextVisitDate = base.ParmJObj.GetDateTime("NextVisitDate"),
ConsultCourseIds = "",
}; };
string consultCourseIdListStr = base.ParmJObj.GetStringValue("ConsultCourseIdList");
if (!string.IsNullOrEmpty(consultCourseIdListStr))
{
try
{
var tempIdList = Common.Plugin.JsonHelper.DeserializeObject<List<int>>(consultCourseIdListStr);
extModel.ConsultCourseIds=string.Join(",", tempIdList);
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "SetStudentFollow::ConsultCourseIdList_" + (consultCourseIdListStr));
}
}
extModel.CreateBy = base.UserInfo.Id; extModel.CreateBy = base.UserInfo.Id;
extModel.CreateTime = DateTime.Now; extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = base.UserInfo.Id; extModel.UpdateBy = base.UserInfo.Id;
...@@ -199,6 +223,10 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -199,6 +223,10 @@ namespace Edu.WebApi.Controllers.Customer
{ {
Id = base.ParmJObj.GetInt("Id"), Id = base.ParmJObj.GetInt("Id"),
StuId = base.ParmJObj.GetInt("StuId"), StuId = base.ParmJObj.GetInt("StuId"),
ConsultCourseIds=base.ParmJObj.GetStringValue("ConsultCourseIds"),
ConsultKeyWords=base.ParmJObj.GetStringValue("ConsultKeyWords"),
NextVisitDate=base.ParmJObj.GetDateTime("NextVisitDate"),
PurposeType=base.ParmJObj.GetInt("PurposeType"),
Remark = base.ParmJObj.GetStringValue("Remark"), Remark = base.ParmJObj.GetStringValue("Remark"),
}; };
string StuProfession = base.ParmJObj.GetStringValue("StuProfession"); string StuProfession = base.ParmJObj.GetStringValue("StuProfession");
...@@ -1051,5 +1079,18 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -1051,5 +1079,18 @@ namespace Edu.WebApi.Controllers.Customer
} }
#endregion #endregion
/// <summary>
/// 学员回访推送测试
/// </summary>
/// <returns></returns>
[HttpGet]
[HttpPost]
public ApiResult TestPush()
{
var flag= customerStudentModule.PushStudentFollowUpModule();
return ApiResult.Success(data: flag);
}
} }
} }
...@@ -422,6 +422,7 @@ namespace Edu.WebApi.Controllers.Public ...@@ -422,6 +422,7 @@ namespace Edu.WebApi.Controllers.Public
int MainId = base.ParmJObj.GetInt("MainId");//问卷Id int MainId = base.ParmJObj.GetInt("MainId");//问卷Id
//注意签到js需要添加对应参数(plug/index.js使用到 clientConfirm地方) //注意签到js需要添加对应参数(plug/index.js使用到 clientConfirm地方)
string newStr = pUrl + "?MainId=" + MainId + "&StuId=" + StudentId + "&Group_Id=" + userInfo.Group_Id + (!string.IsNullOrWhiteSpace(stuName) ? ("&StuName=" + StringHelper.UrlDecode(stuName)) : ""); string newStr = pUrl + "?MainId=" + MainId + "&StuId=" + StudentId + "&Group_Id=" + userInfo.Group_Id + (!string.IsNullOrWhiteSpace(stuName) ? ("&StuName=" + StringHelper.UrlDecode(stuName)) : "");
newStr += "&t=" + DateTime.Now.ToString("MMddHHmmssfff");
string nUrl = Common.Config.EducationUrl + newStr; string nUrl = Common.Config.EducationUrl + newStr;
Common.Plugin.LogHelper.WriteInfo("GetQrCodeImage::" + nUrl); Common.Plugin.LogHelper.WriteInfo("GetQrCodeImage::" + nUrl);
return ApiResult.Success("", Common.Plugin.QRCodeHelper.GetQrCode(nUrl)); return ApiResult.Success("", Common.Plugin.QRCodeHelper.GetQrCode(nUrl));
...@@ -447,9 +448,25 @@ namespace Edu.WebApi.Controllers.Public ...@@ -447,9 +448,25 @@ namespace Edu.WebApi.Controllers.Public
IsShow = 1, IsShow = 1,
MainId = base.ParmJObj.GetInt("MainId"), MainId = base.ParmJObj.GetInt("MainId"),
}; };
string Title = "";
if (model.MainId > 0)
{
Title = module.GetEducationSurveyMainModule(model.MainId)?.Title ?? "";
}
var list = module.GetAllList(model); var list = module.GetAllList(model);
var obj = list.Select(x => new { x.ID, SurveyType = (int)x.SurveyType, CheckInfo = new List<int>(), x.Title, x.Sort, SurveyTypeStr = EnumHelper.ToName(x.SurveyType), x.SurveyOptionsList, ScoreNum = 0, TextContent = "" }).ToList(); var subList = list.Select(x => new
return ApiResult.Success("", obj); {
x.ID,
SurveyType = (int)x.SurveyType,
CheckInfo = new List<int>(),
x.Title,
x.Sort,
SurveyTypeStr = EnumHelper.ToName(x.SurveyType),
x.SurveyOptionsList,
ScoreNum = 0,
TextContent = ""
}).ToList();
return ApiResult.Success("", new { Title, subList });
} }
......
using System; using Edu.Cache.User;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Edu.AOP;
using Edu.Cache.User;
using Edu.Cache.WeChat;
using Edu.Common.API; using Edu.Common.API;
using Edu.Common.Enum.Course; using Edu.Common.Enum.Course;
using Edu.Common.Enum.User; using Edu.Common.Enum.User;
using Edu.Common.Plugin; using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.Customer; using Edu.Model.ViewModel.Customer;
using Edu.Model.ViewModel.DataStatistics; using Edu.Model.ViewModel.DataStatistics;
using Edu.Model.ViewModel.Sell;
using Edu.Model.ViewModel.User; using Edu.Model.ViewModel.User;
using Edu.Module.Course;
using Edu.Module.OKR;
using Edu.Module.User; using Edu.Module.User;
using Edu.Repository.Course;
using Edu.WebApi.Filter; using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Edu.WebApi.Controllers.User namespace Edu.WebApi.Controllers.User
{ {
...@@ -2640,7 +2632,6 @@ namespace Edu.WebApi.Controllers.User ...@@ -2640,7 +2632,6 @@ namespace Edu.WebApi.Controllers.User
public ApiResult GetStudentCoursePageList() public ApiResult GetStudentCoursePageList()
{ {
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString()); var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Student_ViewModel() var query = new RB_Student_ViewModel()
{ {
CourseId = base.ParmJObj.GetInt("CourseId", 0), CourseId = base.ParmJObj.GetInt("CourseId", 0),
...@@ -2666,5 +2657,103 @@ namespace Edu.WebApi.Controllers.User ...@@ -2666,5 +2657,103 @@ namespace Edu.WebApi.Controllers.User
return ApiResult.Success(data: pageModel); return ApiResult.Success(data: pageModel);
} }
#endregion #endregion
#region 学员配置
/// <summary>
/// 获取学员配置列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentConfigList()
{
var query = new RB_Student_Config_Extend()
{
ConfigName = base.ParmJObj.GetStringValue("ConfigName"),
ConfigType = (StuConfigEnum)base.ParmJObj.GetInt("ConfigType")
};
query.Group_Id = base.UserInfo.Group_Id;
var data = studentModule.GetStudentConfigModule(query);
List<object> list = new List<object>();
foreach (var item in data)
{
list.Add(new
{
item.Id,
item.ConfigType,
ConfigTypeName = item.ConfigType.ToName(),
item.ConfigName,
item.SortNum,
});
}
return ApiResult.Success(data: list);
}
/// <summary>
/// 新增修改学员配置
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetStudentConfig()
{
var userInfo = base.UserInfo;
var model = new RB_Student_Config_Extend()
{
Id=base.ParmJObj.GetInt("Id"),
ConfigName = base.ParmJObj.GetStringValue("ConfigName"),
ConfigType = (StuConfigEnum)base.ParmJObj.GetInt("ConfigType"),
SortNum=base.ParmJObj.GetInt("SortNum"),
};
model.Group_Id = userInfo.Group_Id;
model.CreateBy = userInfo.Id;
model.CreateTime = DateTime.Now;
model.UpdateBy = userInfo.Id;
model.UpdateTime = DateTime.Now;
model.Status = Common.Enum.DateStateEnum.Normal;
bool flag = studentModule.SetStudentConfigModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号获取学员配置
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentConfig()
{
int Id = base.ParmJObj.GetInt("Id");
if (Id <= 0)
{
return ApiResult.Failed(message: "参数错误!");
}
var model = studentModule.GetStudentConfigModule(Id);
var dataObj = new
{
Id = model?.Id ?? 0,
ConfigType = model?.ConfigType ?? 0,
ConfigName = model?.ConfigName ?? "",
SortNum = model?.SortNum ?? 0,
};
return ApiResult.Success(data: model);
}
/// <summary>
/// 根据编号删除学员配置信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveStudentConfig()
{
int Id = base.ParmJObj.GetInt("Id");
if (Id <= 0)
{
return ApiResult.Failed(message: "参数错误!");
}
var flag = studentModule.RemoveStudentConfigModule(Id, base.UserInfo);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
} }
} }
...@@ -720,7 +720,8 @@ namespace Edu.WebApi.Controllers.User ...@@ -720,7 +720,8 @@ namespace Edu.WebApi.Controllers.User
StuChannel = base.ParmJObj.GetInt("StuChannel"), StuChannel = base.ParmJObj.GetInt("StuChannel"),
CreateType = (StuCreateTypeEnum)base.ParmJObj.GetInt("CreateType"), CreateType = (StuCreateTypeEnum)base.ParmJObj.GetInt("CreateType"),
StuSourceId = base.ParmJObj.GetInt("StuSourceId"), StuSourceId = base.ParmJObj.GetInt("StuSourceId"),
IsSureConsultTime = base.ParmJObj.GetInt("IsSureConsultTime") IsSureConsultTime = base.ParmJObj.GetInt("IsSureConsultTime"),
QOrderBy=base.ParmJObj.GetInt("QOrderBy"),
}; };
if (query.IsQueryMyStu == 1) if (query.IsQueryMyStu == 1)
{ {
...@@ -827,7 +828,10 @@ namespace Edu.WebApi.Controllers.User ...@@ -827,7 +828,10 @@ namespace Edu.WebApi.Controllers.User
item.AdvisorList, item.AdvisorList,
item.AdvisorWinRate, item.AdvisorWinRate,
item.FileVoucher, item.FileVoucher,
item.IsSureConsultTime item.IsSureConsultTime,
item.TelType,
TelTypeName = item.TelType.ToName(),
MaxFollowTime = Common.ConvertHelper.FormatDate(item.MaxFollowTime)
}); });
} }
pageModel.Count = rowsCount; pageModel.Count = rowsCount;
...@@ -1082,6 +1086,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -1082,6 +1086,7 @@ namespace Edu.WebApi.Controllers.User
StuNeeds = base.ParmJObj.GetInt("StuNeeds"), StuNeeds = base.ParmJObj.GetInt("StuNeeds"),
StuRealMobile = base.ParmJObj.GetStringValue("StuRealMobile"), StuRealMobile = base.ParmJObj.GetStringValue("StuRealMobile"),
FileVoucher = base.ParmJObj.GetStringValue("FileVoucher"), FileVoucher = base.ParmJObj.GetStringValue("FileVoucher"),
TelType = (StuTelTypeEnum)base.ParmJObj.GetInt("TelType"),
}; };
if (string.IsNullOrEmpty(extModel.StuRealMobile) && string.IsNullOrEmpty(extModel.QQ) && string.IsNullOrEmpty(extModel.WeChatNo)) if (string.IsNullOrEmpty(extModel.StuRealMobile) && string.IsNullOrEmpty(extModel.QQ) && string.IsNullOrEmpty(extModel.WeChatNo))
{ {
...@@ -1153,6 +1158,17 @@ namespace Edu.WebApi.Controllers.User ...@@ -1153,6 +1158,17 @@ namespace Edu.WebApi.Controllers.User
return ApiResult.Failed(message: "请选择客户阶段"); return ApiResult.Failed(message: "请选择客户阶段");
} }
/// <summary>
/// 获取学员电话类型
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStuTelType()
{
var list = EnumHelper.EnumToList(typeof(StuTelTypeEnum));
return ApiResult.Success(data: list.Select(x => new { x.Name, x.Id }));
}
/// <summary> /// <summary>
/// 检查学员手机号码是否存在 /// 检查学员手机号码是否存在
/// </summary> /// </summary>
...@@ -1519,10 +1535,12 @@ namespace Edu.WebApi.Controllers.User ...@@ -1519,10 +1535,12 @@ namespace Edu.WebApi.Controllers.User
extModel.DemandPoint, extModel.DemandPoint,
extModel.ResistPoint, extModel.ResistPoint,
extModel.ConsultingResults, extModel.ConsultingResults,
ConsultDate = extModel.ConsultDate.HasValue ? extModel.ConsultDate.Value.ToString("yyyy-MM-dd") : "", ConsultDate = Common.ConvertHelper.FormatDate(extModel.ConsultDate),
extModel.OrderCount, extModel.OrderCount,
extModel.IsSureConsultTime, extModel.IsSureConsultTime,
extModel.FileVoucher extModel.FileVoucher,
extModel.TelType,
TelTypeName = extModel.TelType.ToName(),
}; };
return ApiResult.Success(data: obj); return ApiResult.Success(data: obj);
} }
......
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