Commit 8297ea29 authored by 黄奎's avatar 黄奎

页面修改

parent b1ced265
......@@ -15,6 +15,7 @@ using Edu.Model.ViewModel.System;
using Edu.Cache.Customer;
using Edu.Repository.StudyAbroad;
using Edu.Model.ViewModel.StudyAbroad;
using Edu.Common.Enum.System;
namespace Edu.Module.Customer
{
......@@ -95,6 +96,11 @@ namespace Edu.Module.Customer
/// </summary>
private readonly RB_StudyAbroadRepository studyAbroadRepository = new RB_StudyAbroadRepository();
/// <summary>
/// 学员仓储层对象
/// </summary>
private readonly RB_StudentRepository studentRepository = new RB_StudentRepository();
#region 学员约访
......@@ -263,6 +269,7 @@ namespace Edu.Module.Customer
bool flag = false;
string logContent = "";
string logTitle = "";
var assistList = student_AssistRepository.GetStudentAssistListRepository(new RB_Student_Assist_Extend() { StuId = model.StuId });
if (model.Id > 0)
{
var oldModel = GetStudentFollowModule(model.Id);
......@@ -280,7 +287,7 @@ namespace Edu.Module.Customer
else
{
#region 验证用户的类型
var assistList = student_AssistRepository.GetStudentAssistListRepository(new RB_Student_Assist_Extend() { StuId = model.StuId });
var assistModel = assistList.Where(x => x.AssistId == model.CreateBy).FirstOrDefault();
model.AssistType = assistModel?.AssistType ?? 0;
#endregion
......@@ -289,42 +296,57 @@ namespace Edu.Module.Customer
flag = newId > 0;
logTitle = "新增跟进";
logContent = model.Remark;
if (flag)
}
try
{
var smodel = studentRepository.GetEntity(model.StuId);
string markdownContent = $"`学员跟进通知` \n>**概要信息** \n>学员名称:{smodel?.StuName ?? ""}\n>跟进内容:{model.Remark} \n>";
Common.Message.PushMessageModel modelWork = new Common.Message.PushMessageModel()
{
//获取学生信息
//var smodel = studentRepository.GetEntity(model.StuId);
//if (smodel != null && smodel.StuStage == Common.Enum.User.StuStageEnum.NewStu)
//{
// Dictionary<string, object> keyValues = new Dictionary<string, object>() {
// { nameof(RB_Student_ViewModel.StuStage), Common.Enum.User.StuStageEnum.PreliminaryCommunication}
// };
// List<WhereHelper> wheres = new List<WhereHelper>() {
// new WhereHelper(){
// FiledName = nameof (RB_Student_ViewModel.StuId),
// FiledValue = model.StuId,
// OperatorEnum =OperatorEnum.Equal
// }
// };
// studentRepository.Update(keyValues, wheres);
// student_LogRepository.Insert(new Model.Entity.Customer.RB_Student_Log()
// {
// LogId = 0,
// CreateBy = model.CreateBy,
// CreateTime = DateTime.Now,
// CreateType = 1,
// Group_Id = model.Group_Id,
// LogContent = "首次跟进,客户阶段由'" + (Common.Enum.User.StuStageEnum.NewStu.ToName()) + "'自动转换为'" + (Common.Enum.User.StuStageEnum.PreliminaryCommunication.ToName()) + "'",
// LogTitle = "客户阶段变更",
// LogType = Common.Enum.Log.StudentLogTypeEnum.BasicInfo,
// StuId = model.StuId
// });
//}
CategoryId = PushMessageCategoryEnum.B2BCustomerStu,
Content = markdownContent,
CoverImg = "",
CreateByName = "系统",
JumpUrl = "",
WorkMsgType = "markdown",
SendTime = DateTime.Now,
SendType = 0,
Title = "新增学员跟进通知",
Platform = 5,
};
if (smodel != null && smodel.CreateBy > 0)
{
var queryTargetWorkId = accountRepository.GetWorkUserIdRepository(smodel.CreateBy);
if (!string.IsNullOrEmpty(queryTargetWorkId))
{
modelWork.ReceiveId = queryTargetWorkId;
Common.Message.MessageHelper.SendMessage(modelWork);
}
}
if (assistList != null && assistList.Count > 0)
{
foreach (var item in assistList)
{
var queryTargetWorkId = accountRepository.GetWorkUserIdRepository(item.AssistId);
if (!string.IsNullOrEmpty(queryTargetWorkId))
{
modelWork.ReceiveId = queryTargetWorkId;
Common.Message.MessageHelper.SendMessage(modelWork);
}
}
}
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "SetStudentFollowModule");
}
student_LogRepository.AddStuLogRepository(model.StuId, Common.Enum.Log.StudentLogTypeEnum.Follow, logTitle, logContent, model.CreateBy);
return flag;
}
/// <summary>
/// 根据编号获取学员跟进信息
/// </summary>
......
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