Commit 3496dc0c authored by liudong1993's avatar liudong1993

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

parents 23e15b9b 215aa8aa
using Edu.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Common.Enum.Log
{
/// <summary>
/// 学员日志类型
/// </summary>
public enum StudentLogTypeEnum
{
/// <summary>
/// 到访
/// </summary>
[EnumField("到访")]
Visit = 1,
/// <summary>
/// 约访
/// </summary>
[EnumField("约访")]
Appointment = 2,
/// <summary>
/// 跟进
/// </summary>
[EnumField("跟进")]
Follow = 3,
/// <summary>
/// 试听
/// </summary>
[EnumField("试听")]
TrialLesson =4,
}
}
using Edu.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Common.Enum.User
{
/// <summary>
/// 客户阶段
/// </summary>
public enum StuStageEnum
{
/// <summary>
/// 新客户
/// </summary>
[EnumField("新客户")]
NewStu = 1,
/// <summary>
/// 初步沟通
/// </summary>
[EnumField("初步沟通")]
PreliminaryCommunication = 2,
/// <summary>
/// 商机测试
/// </summary>
[EnumField("商机测试")]
BusinessTest = 3,
/// <summary>
/// 成交
/// </summary>
[EnumField("成交")]
Clinch = 4,
/// <summary>
/// 多次成交
/// </summary>
[EnumField("多次成交")]
MultipleClinch = 5,
/// <summary>
/// 已输单
/// </summary>
[EnumField("已输单")]
OutputOrder = 6,
/// <summary>
/// 无效
/// </summary>
[EnumField("无效")]
InvalidStu = 7,
}
}
using Edu.Common.Enum;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Customer
{
/// <summary>
/// 学员约访表实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Student_Appointment
{
/// <summary>
/// 约访编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 学员编号
/// </summary>
public int StuId { get; set; }
/// <summary>
/// 约访地点
/// </summary>
public string AppointmentPoint { get; set; }
/// <summary>
/// 约访时间
/// </summary>
public DateTime AppointmentTime { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 反馈
/// </summary>
public string Feedback { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { 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>
/// 删除状态(0-正常,1-禁用)
/// </summary>
public DateStateEnum Status { get; set; }
}
}
using Edu.Common.Enum;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Customer
{
/// <summary>
/// 学员跟进实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Student_Follow
{
/// <summary>
/// 跟进编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 学员编号
/// </summary>
public int StuId { get; set; }
/// <summary>
/// 跟进内容
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { 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>
/// 删除状态(0-正常,1-禁用)
/// </summary>
public DateStateEnum Status { get; set; }
}
}
using Edu.Common.Enum.Log;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Customer
{
/// <summary>
/// 学员日志实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Student_Log
{
/// <summary>
/// 日志编号
/// </summary>
public int LogId { get; set; }
/// <summary>
/// 学员编号
/// </summary>
public int StuId { get; set; }
/// <summary>
/// 日志类型(见枚举)
/// </summary>
public StudentLogTypeEnum LogType { get; set; }
/// <summary>
/// 日志内容
/// </summary>
public string LogContent { get; set; }
/// <summary>
/// 创建人类型(1-系统用户,2-同行用户)
/// </summary>
public int CreateType { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
}
}
using Edu.Common.Enum;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Customer
{
/// <summary>
/// 学员到访表实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Student_Visit
{
/// <summary>
/// 到访编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 学员编号
/// </summary>
public int StuId { get; set; }
/// <summary>
/// 到访校区
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 日期
/// </summary>
public DateTime Date { get; set; }
/// <summary>
/// 到访时间
/// </summary>
public string VisitTime { get; set; }
/// <summary>
/// 接待人
/// </summary>
public int ReceptionPersion { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 反馈
/// </summary>
public string Feedback { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { 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>
/// 删除状态(0-正常,1-禁用)
/// </summary>
public DateStateEnum Status { get; set; }
}
}
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using Edu.Common.Enum.User;
using System;
using VT.FW.DB;
......@@ -165,5 +166,15 @@ namespace Edu.Model.Entity.User
/// 身份证居住地
/// </summary>
public string StuIDCardAddress { get; set; }
/// <summary>
/// 录入方式(1-员工录入,2-同业录入)
/// </summary>
public int CreateType { get; set; }
/// <summary>
/// 客户阶段(见枚举)
/// </summary>
public StuStageEnum StuStage { get; set; }
}
}
using Edu.Model.Entity.Customer;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Customer
{
/// <summary>
/// 学员约访表扩展实体类
/// </summary>
public class RB_Student_Appointment_Extend: RB_Student_Appointment
{
}
}
using Edu.Model.Entity.Customer;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Customer
{
/// <summary>
/// 学员跟进扩展实体类
/// </summary>
public class RB_Student_Follow_Extend : RB_Student_Follow
{
}
}
using Edu.Model.Entity.Customer;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Customer
{
/// <summary>
/// 学员日志扩展实体类
/// </summary>
public class RB_Student_Log_Extend : RB_Student_Log
{
}
}
using Edu.Model.Entity.Customer;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Customer
{
/// <summary>
/// 学员到访表扩展实体类
/// </summary>
public class RB_Student_Visit_Extend : RB_Student_Visit
{
}
}
......@@ -8,7 +8,7 @@ namespace Edu.Model.ViewModel.User
/// 学生视图实体类
/// </summary>
[Serializable]
public class RB_Student_ViewModel : Model.Entity.User.RB_Student
public class RB_Student_ViewModel : Entity.User.RB_Student
{
/// <summary>
/// 创建人姓名
......
using Edu.Common.Enum;
using Edu.Model.ViewModel.Customer;
using Edu.Repository.Customer;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Module.Customer
{
/// <summary>
/// 客户学员处理类对象
/// </summary>
public class CustomerStudentModule
{
/// <summary>
/// 学员约访表仓储层对象
/// </summary>
private readonly RB_Student_AppointmentRepository student_AppointmentRepository = new RB_Student_AppointmentRepository();
/// <summary>
/// 学员跟进仓储层对象
/// </summary>
private readonly RB_Student_FollowRepository student_FollowRepository = new RB_Student_FollowRepository();
/// <summary>
/// 学员到访表仓储层对象
/// </summary>
private readonly RB_Student_VisitRepository student_VisitRepository = new RB_Student_VisitRepository();
/// <summary>
/// 学员日志仓储层对象
/// </summary>
private readonly RB_Student_LogRepository student_LogRepository = new RB_Student_LogRepository();
#region 学员约访
/// <summary>
/// 获取学员约访分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Appointment_Extend> GetStudentAppointmentPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Student_Appointment_Extend query)
{
return student_AppointmentRepository.GetStudentAppointmentPageRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 新增学员约访
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStudentAppointmentModule(RB_Student_Appointment_Extend model)
{
bool flag = false;
string logContent = "";
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Appointment_Extend.AppointmentPoint),model.AppointmentPoint },
{nameof(RB_Student_Appointment_Extend.AppointmentTime),model.AppointmentTime },
{nameof(RB_Student_Appointment_Extend.Remark),model.Remark },
{nameof(RB_Student_Appointment_Extend.Feedback),model.Feedback },
};
flag = student_AppointmentRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Appointment_Extend.Id), model.Id));
}
else
{
var newId = student_AppointmentRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
student_LogRepository.AddStuLogRepository(model.StuId, Common.Enum.Log.StudentLogTypeEnum.Appointment, logContent, model.CreateBy);
return flag;
}
/// <summary>
/// 根据编号获取学员约访信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_Student_Appointment_Extend GetStudentAppointmentModule(object Id)
{
var extModel = student_AppointmentRepository.GetEntity<RB_Student_Appointment_Extend>(Id);
return extModel;
}
/// <summary>
/// 删除学员约访
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public bool RemoveStudentAppointmentModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Student_Appointment_Extend.Status),(int)DateStateEnum.Delete}
};
flag = student_AppointmentRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Appointment_Extend.Id), Id));
return flag;
}
#endregion
#region 学员跟进
/// <summary>
/// 获取学员跟进分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Follow_Extend> GetStudentFollowPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Student_Follow_Extend query)
{
return student_FollowRepository.GetStudentFollowPageRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 新增修改学员跟进
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStudentFollowModule(RB_Student_Follow_Extend model)
{
bool flag = false;
string logContent = "";
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Follow_Extend.Remark),model.Remark }
};
flag = student_FollowRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Follow_Extend.Id), model.Id));
}
else
{
var newId = student_FollowRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
student_LogRepository.AddStuLogRepository(model.StuId, Common.Enum.Log.StudentLogTypeEnum.Follow, logContent, model.CreateBy);
return flag;
}
/// <summary>
/// 根据编号获取学员跟进信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_Student_Follow_Extend GetStudentFollowModule(object Id)
{
var extModel = student_FollowRepository.GetEntity<RB_Student_Follow_Extend>(Id);
return extModel;
}
/// <summary>
/// 根据跟进编号删除学员跟进信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public bool RemoveStudentFollowModule(object Id)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Follow_Extend.Status), (int)DateStateEnum.Delete}
};
return student_FollowRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Follow_Extend.Id), Id));
}
#endregion
#region 学员到访
/// <summary>
/// 获取学员到访分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Visit_Extend> GetStudentVisitPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Student_Visit_Extend query)
{
return student_VisitRepository.GetStudentVisitPageRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 新增修改学员到访
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStudentVisitModule(RB_Student_Visit_Extend model)
{
bool flag = false;
string logContent = "";
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Visit_Extend.School_Id),model.School_Id },
{nameof(RB_Student_Visit_Extend.Date),model.Date },
{nameof(RB_Student_Visit_Extend.VisitTime),model.VisitTime },
{nameof(RB_Student_Visit_Extend.ReceptionPersion),model.ReceptionPersion },
{nameof(RB_Student_Visit_Extend.Remark),model.Remark },
{nameof(RB_Student_Visit_Extend.Feedback),model.Feedback },
};
flag = student_VisitRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Visit_Extend.Id), model.Id));
}
else
{
var newId = student_VisitRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
student_LogRepository.AddStuLogRepository(model.StuId, Common.Enum.Log.StudentLogTypeEnum.Visit, logContent, model.CreateBy);
return flag;
}
/// <summary>
/// 根据编号获取学员到访信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public RB_Student_Visit_Extend GetStudentVisitModule(object id)
{
var extModel = student_VisitRepository.GetEntity<RB_Student_Visit_Extend>(id);
return extModel;
}
/// <summary>
/// 根据到访编号删除学员到访信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public bool RemoveStudentVisitModule(object Id)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Visit_Extend.Status), (int)DateStateEnum.Delete}
};
return student_VisitRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Visit_Extend.Id), Id));
}
#endregion
}
}
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Customer
{
/// <summary>
/// 学员约访表仓储层
/// </summary>
public class RB_Student_AppointmentRepository : BaseRepository<RB_Student_Appointment>
{
/// <summary>
/// 获取学员约访分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Appointment_Extend> GetStudentAppointmentPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Student_Appointment_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Student_Appointment AS A
WHERE 1=1
");
return GetPage<RB_Student_Appointment_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
}
}
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Customer
{
/// <summary>
/// 学员跟进仓储层
/// </summary>
public class RB_Student_FollowRepository : BaseRepository<RB_Student_Follow>
{
/// <summary>
/// 获取学员跟进分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Follow_Extend> GetStudentFollowPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Student_Follow_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Student_Follow AS A
WHERE 1=1
");
return GetPage<RB_Student_Follow_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
}
}
using Edu.Common.Enum.Log;
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Customer
{
/// <summary>
/// 学员日志仓储层
/// </summary>
public class RB_Student_LogRepository : BaseRepository<RB_Student_Log>
{
/// <summary>
/// 获取学员日志分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Log_Extend> GetStudentLogPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Student_Log_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Student_Log AS A
WHERE 1=1
");
if (query != null)
{
if (query.StuId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Log_Extend.StuId), query.StuId);
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Student_Log_Extend.LogId));
return GetPage<RB_Student_Log_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
/// <summary>
/// 新增学员日志
/// </summary>
/// <param name="StuId">学员编号</param>
/// <param name="LogType">日志类型</param>
/// <param name="LogContent">日志内容</param>
/// <param name="CreateBy">创建人</param>
/// <param name="CreateType">创建人类型(1-系统用户,2-同行用户)</param>
/// <param name="Group_Id">集团编号</param>
/// <returns></returns>
public bool AddStuLogRepository(int StuId, StudentLogTypeEnum LogType, string LogContent, int CreateBy, int CreateType = 1, int Group_Id = 100000)
{
var newModel = new RB_Student_Log_Extend()
{
LogId = 0,
StuId = StuId,
LogType = LogType,
CreateTime = DateTime.Now,
LogContent = LogContent,
CreateType = CreateType,
CreateBy = CreateBy,
Group_Id = Group_Id
};
var newId = base.Insert(newModel);
newModel.LogId = newId;
return newId > 0;
}
}
}
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Customer
{
/// <summary>
/// 学员到访表仓储层
/// </summary>
public class RB_Student_VisitRepository : BaseRepository<RB_Student_Visit>
{
/// <summary>
/// 获取学员到访分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Visit_Extend> GetStudentVisitPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Student_Visit_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Student_Visit AS A
WHERE 1=1
");
if (query != null)
{
}
return GetPage<RB_Student_Visit_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
}
}
......@@ -140,6 +140,7 @@ WHERE 1=1
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.AreaId), query.AreaId);
}
}
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();
}
......
using Edu.Common.API;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Customer;
using Edu.Module.Customer;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Edu.WebApi.Controllers.Customer
{
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class CustomerStudentController : BaseController
{
/// <summary>
/// 客户学员处理类对象
/// </summary>
private readonly CustomerStudentModule customerStudentModule = new CustomerStudentModule();
/// <summary>
/// 学员约访分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentAppointmentPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Student_Appointment_Extend()
{
StuId = base.ParmJObj.GetInt("StuId"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = customerStudentModule.GetStudentAppointmentPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
if (item.CreateBy > 0)
{
// item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 添加修改约访
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetStudentAppointment()
{
var extModel = new RB_Student_Appointment_Extend()
{
Id = base.ParmJObj.GetInt("Id"),
StuId = base.ParmJObj.GetInt("StuId"),
AppointmentPoint = base.ParmJObj.GetStringValue("AppointmentPoint"),
AppointmentTime = base.ParmJObj.GetDateTime("AppointmentTime"),
Remark = base.ParmJObj.GetStringValue("Remark"),
Feedback = base.ParmJObj.GetStringValue("Feedback")
};
extModel.CreateBy = base.UserInfo.Id;
extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = base.UserInfo.Group_Id;
bool flag = customerStudentModule.SetStudentAppointmentModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号获取约访
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentAppointment()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.GetStudentAppointmentModule(Id);
return ApiResult.Success(data: model);
}
/// <summary>
/// 根据编号删除学员约访
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveStudentAppointment()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.RemoveStudentAppointmentModule(Id);
return ApiResult.Success(data: model);
}
/// <summary>
/// 学员跟进分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentFollowPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Student_Follow_Extend()
{
StuId = base.ParmJObj.GetInt("StuId"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = customerStudentModule.GetStudentFollowPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
if (item.CreateBy > 0)
{
// item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 新增修改学员跟进
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetStudentFollow()
{
var extModel = new RB_Student_Follow_Extend()
{
Id = base.ParmJObj.GetInt("Id"),
StuId = base.ParmJObj.GetInt("StuId"),
Remark = base.ParmJObj.GetStringValue("Remark"),
};
extModel.CreateBy = base.UserInfo.Id;
extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = base.UserInfo.Group_Id;
bool flag = customerStudentModule.SetStudentFollowModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号获取跟进信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentFollow()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.GetStudentFollowModule(Id);
return ApiResult.Success(data: model);
}
/// <summary>
/// 根据编号删除学员跟进信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveStudentFollow()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.RemoveStudentFollowModule(Id);
return ApiResult.Success(data: model);
}
/// <summary>
/// 学员到访分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentVisitPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Student_Visit_Extend()
{
StuId = base.ParmJObj.GetInt("StuId"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = customerStudentModule.GetStudentVisitPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
if (item.CreateBy > 0)
{
// item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 新增修改学员到访
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetStudentVisit()
{
var extModel = new RB_Student_Visit_Extend()
{
Id = base.ParmJObj.GetInt("Id"),
StuId = base.ParmJObj.GetInt("StuId"),
School_Id=base.ParmJObj.GetInt("School_Id"),
Date=base.ParmJObj.GetDateTime("Date"),
VisitTime=base.ParmJObj.GetStringValue("VisitTime"),
ReceptionPersion=base.ParmJObj.GetInt("ReceptionPersion"),
Remark = base.ParmJObj.GetStringValue("Remark"),
Feedback=base.ParmJObj.GetStringValue("Feedback"),
};
extModel.Status = Common.Enum.DateStateEnum.Normal;
extModel.CreateBy = base.UserInfo.Id;
extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = base.UserInfo.Group_Id;
bool flag = customerStudentModule.SetStudentVisitModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号获取到访信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentVisit()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.GetStudentVisitModule(Id);
return ApiResult.Success(data: model);
}
/// <summary>
/// 跟进编号删除学员到访信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveStudentVisit()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.RemoveStudentVisitModule(Id);
return ApiResult.Success(data: model);
}
}
}
......@@ -651,19 +651,36 @@ namespace Edu.WebApi.Controllers.User
public ApiResult GetStudentPageList()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Student_ViewModel>(RequestParm.Msg.ToString());
var query = new RB_Student_ViewModel()
{
};
query.Group_Id = base.UserInfo.Group_Id;
var list = studentModule.GetStudentPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
var data = studentModule.GetStudentPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> list = new List<object>();
foreach (var item in data)
{
if (item.CreateBy > 0)
{
item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
if (item.UpdateBy > 0)
list.Add(new
{
item.UpdateByName = UserReidsCache.GetUserLoginInfo(item.UpdateBy)?.AccountName ?? "";
}
item.StuId,
item.StuName,
item.StuTel,
item.StuIcon,
item.StuSex,
StuSexStr = item.StuSex == 0 ? "男" : "女",
StuBirth = Common.ConvertHelper.FormatDate(item.StuBirth),
item.StuStage,
StuStageName = item.StuStage.ToName(),
CreateTimeStr = Common.ConvertHelper.FormatTime(item.CreateTime),
item.CreateByName,
item.CreateType,
CreateTypeStr = item.CreateType == 1 ? "员工录入" : "同业录入",
});
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
......@@ -711,26 +728,26 @@ namespace Edu.WebApi.Controllers.User
{
var extModel = new RB_Student_ViewModel()
{
StuId=base.ParmJObj.GetInt("StuId"),
StuName=base.ParmJObj.GetStringValue("StuName"),
StuTel=base.ParmJObj.GetStringValue("StuTel"),
StuIcon=base.ParmJObj.GetStringValue("StuIcon"),
StuSex=base.ParmJObj.GetInt("StuSex"),
StuBirth=base.ParmJObj.GetDateTime("StuBirth"),
ProviceId=base.ParmJObj.GetInt("ProviceId"),
CityId=base.ParmJObj.GetInt("CityId"),
AreaId=base.ParmJObj.GetInt("AreaId"),
Interest=base.ParmJObj.GetInt("Interest"),
JapanBaseInfo=(GuestBasicsEnum)base.ParmJObj.GetInt("JapanBaseInfo"),
StuProfession=base.ParmJObj.GetStringValue("StuProfession"),
StuEducation=(GuestEducationEnum)base.ParmJObj.GetInt("StuEducation"),
StuPurpose=(GuestLearningGoalsEnum)base.ParmJObj.GetInt("StuPurpose"),
StuSource=(OrderSourceEnum)base.ParmJObj.GetInt("StuSource"),
StuAddress=base.ParmJObj.GetStringValue("StuAddress"),
StuContract=base.ParmJObj.GetStringValue("StuContract"),
StuContractMobile=base.ParmJObj.GetStringValue("StuContractMobile"),
StuIDCard=base.ParmJObj.GetStringValue("StuIDCard"),
StuIDCardAddress=base.ParmJObj.GetStringValue("StuIDCardAddress"),
StuId = base.ParmJObj.GetInt("StuId"),
StuName = base.ParmJObj.GetStringValue("StuName"),
StuTel = base.ParmJObj.GetStringValue("StuTel"),
StuIcon = base.ParmJObj.GetStringValue("StuIcon"),
StuSex = base.ParmJObj.GetInt("StuSex"),
StuBirth = base.ParmJObj.GetDateTime("StuBirth"),
ProviceId = base.ParmJObj.GetInt("ProviceId"),
CityId = base.ParmJObj.GetInt("CityId"),
AreaId = base.ParmJObj.GetInt("AreaId"),
Interest = base.ParmJObj.GetInt("Interest"),
JapanBaseInfo = (GuestBasicsEnum)base.ParmJObj.GetInt("JapanBaseInfo"),
StuProfession = base.ParmJObj.GetStringValue("StuProfession"),
StuEducation = (GuestEducationEnum)base.ParmJObj.GetInt("StuEducation"),
StuPurpose = (GuestLearningGoalsEnum)base.ParmJObj.GetInt("StuPurpose"),
StuSource = (OrderSourceEnum)base.ParmJObj.GetInt("StuSource"),
StuAddress = base.ParmJObj.GetStringValue("StuAddress"),
StuContract = base.ParmJObj.GetStringValue("StuContract"),
StuContractMobile = base.ParmJObj.GetStringValue("StuContractMobile"),
StuIDCard = base.ParmJObj.GetStringValue("StuIDCard"),
StuIDCardAddress = base.ParmJObj.GetStringValue("StuIDCardAddress"),
};
var customer = base.AppletCustomerInfo;
extModel.Status = DateStateEnum.Normal;
......@@ -760,8 +777,8 @@ namespace Edu.WebApi.Controllers.User
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Student_ViewModel()
{
KeyWords=base.ParmJObj.GetStringValue("KeyWords"),
StuId=base.ParmJObj.GetInt("StuId"),
KeyWords = base.ParmJObj.GetStringValue("KeyWords"),
StuId = base.ParmJObj.GetInt("StuId"),
};
var customer = base.AppletCustomerInfo;
query.Group_Id = customer.GroupId;
......@@ -808,7 +825,7 @@ namespace Edu.WebApi.Controllers.User
extModel.StuIcon,
extModel.StuSex,
extModel.StuBirth,
StuBirthStr=Common.ConvertHelper.FormatDate(extModel.StuBirth),
StuBirthStr = Common.ConvertHelper.FormatDate(extModel.StuBirth),
extModel.ProviceId,
extModel.CityId,
extModel.AreaId,
......@@ -816,7 +833,7 @@ namespace Edu.WebApi.Controllers.User
extModel.StuStatus,
extModel.Interest,
extModel.JapanBaseInfo,
JapanBaseInfoName= extModel.JapanBaseInfo.ToName(),
JapanBaseInfoName = extModel.JapanBaseInfo.ToName(),
extModel.CustomerId,
extModel.StuProfession,
extModel.StuEducation,
......@@ -830,7 +847,7 @@ namespace Edu.WebApi.Controllers.User
extModel.StuContractMobile,
extModel.StuIDCard,
extModel.StuIDCardAddress,
CreateTimeStr=Common.ConvertHelper.FormatDate(extModel.CreateTime),
CreateTimeStr = Common.ConvertHelper.FormatDate(extModel.CreateTime),
newClassStatus,
classStatusName
};
......@@ -889,17 +906,17 @@ namespace Edu.WebApi.Controllers.User
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new Employee_ViewModel()
{
Dept_Id=base.ParmJObj.GetInt("Dept_Id"),
EmployeeName=base.ParmJObj.GetStringValue("EmployeeName"),
EndBirthDate=base.ParmJObj.GetStringValue("EndBirthDate"),
EndEntryTime=base.ParmJObj.GetStringValue("EndEntryTime"),
EndLeaveTime=base.ParmJObj.GetStringValue("EndLeaveTime"),
LeaveStatus=(LeaveStatusEnum)base.ParmJObj.GetInt("LeaveStatus"),
Post_Id=base.ParmJObj.GetInt("Post_Id"),
School_Id=base.ParmJObj.GetInt("School_Id"),
StartBirthDate=base.ParmJObj.GetStringValue("StartBirthDate"),
StartEntryTime=base.ParmJObj.GetStringValue("StartEntryTime"),
StartLeaveTime=base.ParmJObj.GetStringValue("StartLeaveTime"),
Dept_Id = base.ParmJObj.GetInt("Dept_Id"),
EmployeeName = base.ParmJObj.GetStringValue("EmployeeName"),
EndBirthDate = base.ParmJObj.GetStringValue("EndBirthDate"),
EndEntryTime = base.ParmJObj.GetStringValue("EndEntryTime"),
EndLeaveTime = base.ParmJObj.GetStringValue("EndLeaveTime"),
LeaveStatus = (LeaveStatusEnum)base.ParmJObj.GetInt("LeaveStatus"),
Post_Id = base.ParmJObj.GetInt("Post_Id"),
School_Id = base.ParmJObj.GetInt("School_Id"),
StartBirthDate = base.ParmJObj.GetStringValue("StartBirthDate"),
StartEntryTime = base.ParmJObj.GetStringValue("StartEntryTime"),
StartLeaveTime = base.ParmJObj.GetStringValue("StartLeaveTime"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = employeeModule.GetEmployeePageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
......@@ -1058,7 +1075,8 @@ namespace Edu.WebApi.Controllers.User
}
}
}
else if (extModel.LeaveStatus != LeaveStatusEnum.Departure) {
else if (extModel.LeaveStatus != LeaveStatusEnum.Departure)
{
//新增用户情况
var configmodel = departmentModule.GetWeChatConfigModel(base.UserInfo.Group_Id);
if (configmodel != null && configmodel.Enable == 1 && configmodel.DeptEmpEnable == 1)
......@@ -1439,9 +1457,9 @@ namespace Edu.WebApi.Controllers.User
{
DeptId = base.ParmJObj.GetInt("DeptId"),
DeptName = base.ParmJObj.GetStringValue("DeptName"),
DeptTier=base.ParmJObj.GetInt("DeptTier"),
ParentId=base.ParmJObj.GetInt("ParentId"),
Status=(DateStateEnum)base.ParmJObj.GetInt("Status"),
DeptTier = base.ParmJObj.GetInt("DeptTier"),
ParentId = base.ParmJObj.GetInt("ParentId"),
Status = (DateStateEnum)base.ParmJObj.GetInt("Status"),
};
query.School_Id = -1;
var School_Id = base.ParmJObj.GetStringValue("School_Id");
......@@ -1870,7 +1888,7 @@ namespace Edu.WebApi.Controllers.User
var AccountType = (AccountTypeEnum)base.ParmJObj.GetInt("AccountType");
var Remark = base.ParmJObj.GetStringValue("Remark");
var targetAccountType = (AccountTypeEnum)base.ParmJObj.GetInt("TargetAccountType");
if (AccountId <= 0|| base.ParmJObj.GetInt("AccountType")<=0)
if (AccountId <= 0 || base.ParmJObj.GetInt("AccountType") <= 0)
{
return ApiResult.ParamIsNull(message: "请选择用户");
}
......@@ -1878,7 +1896,7 @@ namespace Edu.WebApi.Controllers.User
{
return ApiResult.ParamIsNull(message: "请选择用户目标职能!");
}
var flag = managerModule.SetEmployeeTypeModule(targetAccountType, AccountId, AccountType,Remark,base.UserInfo);
var flag = managerModule.SetEmployeeTypeModule(targetAccountType, AccountId, AccountType, Remark, base.UserInfo);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
......
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