Commit f9631355 authored by liudong1993's avatar liudong1993

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

parents 66376dbe a74cd15e
......@@ -33,5 +33,12 @@ namespace Edu.Common.Enum.Log
/// </summary>
[EnumField("试听")]
TrialLesson =4,
/// <summary>
/// 试听
/// </summary>
[EnumField("基础资料")]
BasicInfo =5,
}
}
......@@ -63,6 +63,36 @@ namespace Edu.Common
return timeStr;
}
/// <summary>
/// 获取时间格式yyyy-MM-dd HH:mm
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
public static string FormatTimeStr2(this object time)
{
string timeStr = "";
if (time != null)
{
try
{
var newTime = Convert.ToDateTime(time.ToString());
if (newTime.Year == DateTime.Now.Year)
{
timeStr = Convert.ToDateTime(time.ToString()).ToString("MM-dd HH:mm");
}
else
{
timeStr = Convert.ToDateTime(time.ToString()).ToString("yyyy-MM-dd HH:mm");
}
}
catch
{
}
}
return timeStr;
}
/// <summary>
/// 获取时间格式
/// </summary>
......
......@@ -28,6 +28,11 @@ namespace Edu.Model.Entity.Customer
/// </summary>
public StudentLogTypeEnum LogType { get; set; }
/// <summary>
/// 日志标题
/// </summary>
public string LogTitle { get; set; }
/// <summary>
/// 日志内容
/// </summary>
......
......@@ -10,5 +10,14 @@ namespace Edu.Model.ViewModel.Customer
/// </summary>
public class RB_Student_Visit_Extend : RB_Student_Visit
{
/// <summary>
/// 校区名称
/// </summary>
public string SchoolName { get; set; }
/// <summary>
/// 接待人姓名
/// </summary>
public string ReceptionPersionName { get; set; }
}
}
......@@ -155,8 +155,10 @@ namespace Edu.Module.User
bool IsInsert = false;
if (model.StuId == 0) { IsInsert = true; }
bool flag = studentRepository.SetStudentRepository(model);
if (flag) {
if (IsInsert && model.CustomerId > 0) {
if (flag)
{
if (IsInsert && model.CustomerId > 0)
{
var queryTargetWorkId = accountModule.GetWorkUserIdModule(model.CreateBy);
if (!string.IsNullOrEmpty(queryTargetWorkId))
{
......
using Edu.Model.Entity.Customer;
using Edu.Common.Enum;
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
......@@ -28,6 +29,19 @@ SELECT A.*
FROM RB_Student_Appointment AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.Group_Id), query.Group_Id);
}
if (query.StuId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.StuId), query.StuId);
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Student_Appointment_Extend.Id));
return GetPage<RB_Student_Appointment_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
......
using Edu.Model.Entity.Customer;
using Edu.Common.Enum;
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
......@@ -28,7 +29,19 @@ SELECT A.*
FROM RB_Student_Follow AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Follow_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Follow_Extend.Group_Id), query.Group_Id);
}
if (query.StuId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Follow_Extend.StuId), query.StuId);
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Student_Follow_Extend.Id));
return GetPage<RB_Student_Follow_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
}
......
......@@ -34,7 +34,7 @@ WHERE 1=1
{
if (query.StuId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Log_Extend.StuId), query.StuId);
//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));
......@@ -46,20 +46,22 @@ WHERE 1=1
/// </summary>
/// <param name="StuId">学员编号</param>
/// <param name="LogType">日志类型</param>
/// <param name="LogTitle">日志标题</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)
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()
{
LogId = 0,
StuId = StuId,
LogType = LogType,
CreateTime = DateTime.Now,
LogTitle= LogTitle,
LogContent = LogContent,
CreateTime = DateTime.Now,
CreateType = CreateType,
CreateBy = CreateBy,
Group_Id = Group_Id
......
using Edu.Model.Entity.Customer;
using Edu.Common.Enum;
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
......@@ -28,10 +29,19 @@ SELECT A.*
FROM RB_Student_Visit AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Visit_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Visit_Extend.Group_Id), query.Group_Id);
}
if (query.StuId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Visit_Extend.StuId), query.StuId);
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Student_Visit_Extend.Id));
return GetPage<RB_Student_Visit_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
}
......
using Edu.Common.Enum;
using Edu.Model.ViewModel.User;
using Edu.Repository.Customer;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -19,6 +20,11 @@ namespace Edu.Repository.User
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 学员日志仓储层对象
/// </summary>
private readonly RB_Student_LogRepository student_LogRepository = new RB_Student_LogRepository();
/// <summary>
/// 获取学生列表
/// </summary>
......@@ -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)
{
bool flag;
string logContent = "";
string logTitle = "";
int createBy = 0;
if (model.StuId > 0)
{
logTitle = "修改客户";
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_ViewModel.StuName),model.StuName.Trim() },
......@@ -217,8 +228,12 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
{nameof(RB_Student_ViewModel.StuContractMobile),model.StuContractMobile },
{nameof(RB_Student_ViewModel.StuIDCard),model.StuIDCard },
{nameof(RB_Student_ViewModel.StuIDCardAddress),model.StuIDCardAddress },
{nameof(RB_Student_ViewModel.CreateType),model.CreateType },
{nameof(RB_Student_ViewModel.CreateBy),model.CreateBy },
{nameof(RB_Student_ViewModel.StuStage),model.StuStage },
};
flag = base.Update(fileds, new WhereHelper(nameof(RB_Student_ViewModel.StuId), model.StuId));
createBy = model.UpdateBy;
}
else
{
......@@ -243,7 +258,19 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
UpdateTime = DateTime.Now,
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;
}
}
......
using Edu.Common.API;
using Edu.Cache.User;
using Edu.Common.API;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Customer;
using Edu.Module.Customer;
......@@ -95,7 +96,7 @@ namespace Edu.WebApi.Controllers.Customer
public ApiResult RemoveStudentAppointment()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.RemoveStudentAppointmentModule(Id);
var model = customerStudentModule.RemoveStudentAppointmentModule(Id,base.UserInfo.Id);
return ApiResult.Success(data: model);
}
......@@ -167,7 +168,7 @@ namespace Edu.WebApi.Controllers.Customer
public ApiResult RemoveStudentFollow()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.RemoveStudentFollowModule(Id);
var model = customerStudentModule.RemoveStudentFollowModule(Id,base.UserInfo.Id);
return ApiResult.Success(data: model);
}
......@@ -184,13 +185,24 @@ namespace Edu.WebApi.Controllers.Customer
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)
var data = customerStudentModule.GetStudentVisitPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> list = new List<object>();
foreach (var item in data)
{
string CreateByName = "";
if (item.CreateBy > 0)
{
// item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
list.Add(new
{
item.SchoolName,
item.ReceptionPersionName,
item.Remark,
item.Feedback,
CreateTime=Common.ConvertHelper.FormatTimeStr2(item.CreateTime),
CreateByName,
});
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
......@@ -245,8 +257,56 @@ namespace Edu.WebApi.Controllers.Customer
public ApiResult RemoveStudentVisit()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.RemoveStudentVisitModule(Id);
var model = customerStudentModule.RemoveStudentVisitModule(Id,base.UserInfo.Id);
return ApiResult.Success(data: model);
}
/// <summary>
/// 获取学员日志分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentLogPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Student_Log_Extend()
{
StuId = base.ParmJObj.GetInt("StuId"),
};
query.Group_Id = base.UserInfo.Group_Id;
var data = customerStudentModule.GetStudentLogPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> list = new List<object>();
foreach (var item in data)
{
string CreateByName = "";
if (item.CreateType > 1)
{
CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
else
{
CreateByName = UserReidsCache.GetAppletCustomerLoginInfo(item.CreateBy)?.CustomerName ?? "";
}
list.Add(new
{
item.LogId,
item.StuId,
item.LogType,
LogTypeName=item.LogType.ToName(),
item.LogTitle,
item.LogContent,
item.CreateType,
CreateTypeStr=item.CreateType==1?"系统用户":"同业用户",
CreateTimeStr=Common.ConvertHelper.FormatTimeStr2(item.CreateTime),
CreateByName
});
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
}
}
......@@ -708,13 +708,49 @@ namespace Edu.WebApi.Controllers.User
[HttpPost]
public ApiResult SetStudent()
{
var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_Student_ViewModel>(RequestParm.Msg.ToString());
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"),
StuStage=(StuStageEnum)base.ParmJObj.GetInt("StuStage"),
};
if (extModel.StuId == 0)
{
extModel.CreateType = 1;
}
extModel.Status = DateStateEnum.Normal;
extModel.StuStatus = 1;
extModel.CreateTime = DateTime.Now;
extModel.UpdateTime = DateTime.Now;
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;
extModel.CustomerId = 0;
extModel.IsDisable = 1;
if (studentModule.CheckStudentModule(extModel))
{
return ApiResult.Failed("此学员手机号已绑定同行!请重新录入!");
}
bool flag = studentModule.SetStudentModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......@@ -748,14 +784,20 @@ namespace Edu.WebApi.Controllers.User
StuContractMobile = base.ParmJObj.GetStringValue("StuContractMobile"),
StuIDCard = base.ParmJObj.GetStringValue("StuIDCard"),
StuIDCardAddress = base.ParmJObj.GetStringValue("StuIDCardAddress"),
StuStage =(StuStageEnum)base.ParmJObj.GetInt("StuStage"),
};
var customer = base.AppletCustomerInfo;
extModel.CreateType = 2;
if (extModel.StuId == 0)
{
extModel.StuStage = StuStageEnum.NewStu;
}
extModel.Status = DateStateEnum.Normal;
extModel.StuStatus = 1;
extModel.CreateBy = customer.CustomerId;
extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = customer.CustomerId;
extModel.UpdateTime = DateTime.Now;
var customer = base.AppletCustomerInfo;
extModel.CreateBy = 0;
extModel.UpdateBy = 0;
extModel.Group_Id = customer.GroupId;
extModel.CustomerId = customer.CustomerId;
extModel.IsDisable = 1;
......@@ -824,7 +866,7 @@ namespace Edu.WebApi.Controllers.User
extModel.StuTel,
extModel.StuIcon,
extModel.StuSex,
extModel.StuBirth,
StuBirth= Common.ConvertHelper.FormatDate(extModel.StuBirth),
StuBirthStr = Common.ConvertHelper.FormatDate(extModel.StuBirth),
extModel.ProviceId,
extModel.CityId,
......@@ -849,11 +891,27 @@ namespace Edu.WebApi.Controllers.User
extModel.StuIDCardAddress,
CreateTimeStr = Common.ConvertHelper.FormatDate(extModel.CreateTime),
newClassStatus,
classStatusName
classStatusName,
extModel.CreateType,
CreateTypeStr = extModel.CreateType == 1 ? "员工录入" : "同业录入",
extModel.StuStage,
StuStageName = extModel.StuStage.ToName(),
extModel.CreateBy,
};
return ApiResult.Success(data: obj);
}
/// <summary>
/// 获取客户状态列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStuStageList()
{
var list = Common.Plugin.EnumHelper.EnumToList(typeof(StuStageEnum));
return ApiResult.Success(data: list);
}
/// <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