Commit 60c1b9c3 authored by 黄奎's avatar 黄奎

新增客户日志修改

parent 147924e0
...@@ -33,5 +33,12 @@ namespace Edu.Common.Enum.Log ...@@ -33,5 +33,12 @@ namespace Edu.Common.Enum.Log
/// </summary> /// </summary>
[EnumField("试听")] [EnumField("试听")]
TrialLesson =4, TrialLesson =4,
/// <summary>
/// 试听
/// </summary>
[EnumField("基础资料")]
BasicInfo =5,
} }
} }
...@@ -28,6 +28,11 @@ namespace Edu.Model.Entity.Customer ...@@ -28,6 +28,11 @@ namespace Edu.Model.Entity.Customer
/// </summary> /// </summary>
public StudentLogTypeEnum LogType { get; set; } public StudentLogTypeEnum LogType { get; set; }
/// <summary>
/// 日志标题
/// </summary>
public string LogTitle { get; set; }
/// <summary> /// <summary>
/// 日志内容 /// 日志内容
/// </summary> /// </summary>
......
...@@ -46,20 +46,22 @@ WHERE 1=1 ...@@ -46,20 +46,22 @@ WHERE 1=1
/// </summary> /// </summary>
/// <param name="StuId">学员编号</param> /// <param name="StuId">学员编号</param>
/// <param name="LogType">日志类型</param> /// <param name="LogType">日志类型</param>
/// <param name="LogTitle">日志标题</param>
/// <param name="LogContent">日志内容</param> /// <param name="LogContent">日志内容</param>
/// <param name="CreateBy">创建人</param> /// <param name="CreateBy">创建人</param>
/// <param name="CreateType">创建人类型(1-系统用户,2-同行用户)</param> /// <param name="CreateType">创建人类型(1-系统用户,2-同行用户)</param>
/// <param name="Group_Id">集团编号</param> /// <param name="Group_Id">集团编号</param>
/// <returns></returns> /// <returns></returns>
public bool AddStuLogRepository(int StuId, StudentLogTypeEnum LogType, string LogContent, int CreateBy, int CreateType = 1, int Group_Id = 100000) public bool AddStuLogRepository(int StuId, StudentLogTypeEnum LogType,string LogTitle, string LogContent, int CreateBy, int CreateType = 1, int Group_Id = 100000)
{ {
var newModel = new RB_Student_Log_Extend() var newModel = new RB_Student_Log_Extend()
{ {
LogId = 0, LogId = 0,
StuId = StuId, StuId = StuId,
LogType = LogType, LogType = LogType,
CreateTime = DateTime.Now, LogTitle= LogTitle,
LogContent = LogContent, LogContent = LogContent,
CreateTime = DateTime.Now,
CreateType = CreateType, CreateType = CreateType,
CreateBy = CreateBy, CreateBy = CreateBy,
Group_Id = Group_Id Group_Id = Group_Id
......
using Edu.Common.Enum; using Edu.Common.Enum;
using Edu.Model.ViewModel.User; using Edu.Model.ViewModel.User;
using Edu.Repository.Customer;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -19,6 +20,11 @@ namespace Edu.Repository.User ...@@ -19,6 +20,11 @@ namespace Edu.Repository.User
/// </summary> /// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository(); private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 学员日志仓储层对象
/// </summary>
private readonly RB_Student_LogRepository student_LogRepository = new RB_Student_LogRepository();
/// <summary> /// <summary>
/// 获取学生列表 /// 获取学生列表
/// </summary> /// </summary>
...@@ -194,8 +200,13 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an ...@@ -194,8 +200,13 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
public bool SetStudentRepository(RB_Student_ViewModel model) public bool SetStudentRepository(RB_Student_ViewModel model)
{ {
bool flag; bool flag;
string logContent = "";
string logTitle = "";
int createBy = 0;
if (model.StuId > 0) if (model.StuId > 0)
{ {
logTitle = "修改客户";
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{nameof(RB_Student_ViewModel.StuName),model.StuName.Trim() }, {nameof(RB_Student_ViewModel.StuName),model.StuName.Trim() },
...@@ -222,6 +233,7 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an ...@@ -222,6 +233,7 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
{nameof(RB_Student_ViewModel.StuStage),model.StuStage }, {nameof(RB_Student_ViewModel.StuStage),model.StuStage },
}; };
flag = base.Update(fileds, new WhereHelper(nameof(RB_Student_ViewModel.StuId), model.StuId)); flag = base.Update(fileds, new WhereHelper(nameof(RB_Student_ViewModel.StuId), model.StuId));
createBy = model.UpdateBy;
} }
else else
{ {
...@@ -246,7 +258,19 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an ...@@ -246,7 +258,19 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
UpdateTime = DateTime.Now, UpdateTime = DateTime.Now,
Password = Common.DES.Encrypt(Common.Config.DefaultPwd) Password = Common.DES.Encrypt(Common.Config.DefaultPwd)
}); });
if (model.CreateType == 1)
{
createBy = model.CreateBy;
}
else
{
createBy = model.CustomerId;
}
logContent = "创建了该客户";
logTitle = "创建客户";
} }
student_LogRepository.AddStuLogRepository(model.StuId, Common.Enum.Log.StudentLogTypeEnum.BasicInfo, logTitle, logContent, createBy, CreateType: model.CreateType);
return flag; return flag;
} }
} }
......
...@@ -95,7 +95,7 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -95,7 +95,7 @@ namespace Edu.WebApi.Controllers.Customer
public ApiResult RemoveStudentAppointment() public ApiResult RemoveStudentAppointment()
{ {
var Id = base.ParmJObj.GetInt("Id"); var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.RemoveStudentAppointmentModule(Id); var model = customerStudentModule.RemoveStudentAppointmentModule(Id,base.UserInfo.Id);
return ApiResult.Success(data: model); return ApiResult.Success(data: model);
} }
...@@ -167,7 +167,7 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -167,7 +167,7 @@ namespace Edu.WebApi.Controllers.Customer
public ApiResult RemoveStudentFollow() public ApiResult RemoveStudentFollow()
{ {
var Id = base.ParmJObj.GetInt("Id"); var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.RemoveStudentFollowModule(Id); var model = customerStudentModule.RemoveStudentFollowModule(Id,base.UserInfo.Id);
return ApiResult.Success(data: model); return ApiResult.Success(data: model);
} }
...@@ -245,7 +245,7 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -245,7 +245,7 @@ namespace Edu.WebApi.Controllers.Customer
public ApiResult RemoveStudentVisit() public ApiResult RemoveStudentVisit()
{ {
var Id = base.ParmJObj.GetInt("Id"); var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.RemoveStudentVisitModule(Id); var model = customerStudentModule.RemoveStudentVisitModule(Id,base.UserInfo.Id);
return ApiResult.Success(data: model); return ApiResult.Success(data: model);
} }
......
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