Commit 27d55a8f authored by liudong1993's avatar liudong1993

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

parents 61c26b3c 9045a879
......@@ -146,5 +146,10 @@ namespace Edu.Model.ViewModel.User
/// 账号表主键编号
/// </summary>
public int Account_Id { get; set; }
/// <summary>
/// 是否查询自己的客户(1-是)
/// </summary>
public int IsQueryMyStu { get; set; }
}
}
\ No newline at end of file
......@@ -187,6 +187,19 @@ namespace Edu.Module.User
return flag;
}
/// <summary>
/// 学员转交
/// </summary>
/// <param name="StuId">学员编号</param>
/// <param name="CreateBy">负责人</param>
/// <param name="OperateId">操作人</param>
/// <returns></returns>
public bool ForwardStudentModule(int StuId, int CreateBy,int OperateId)
{
return studentRepository.ForwardStudentRepository(StuId, CreateBy, OperateId);
}
/// <summary>
/// 根据学生编号获取学生实体类
/// </summary>
......
using Edu.Common.Enum;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.User;
using Edu.Repository.Customer;
using System;
......@@ -74,7 +75,7 @@ WHERE 1=1
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.AreaId), query.AreaId);
}
}
return Get<RB_Student_ViewModel>(builder.ToString(),parameters).ToList();
return Get<RB_Student_ViewModel>(builder.ToString(), parameters).ToList();
}
/// <summary>
......@@ -85,7 +86,7 @@ WHERE 1=1
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_ViewModel> GetStudentPageListRepository(int pageIndex,int pageSize,out long rowsCount,RB_Student_ViewModel query)
public List<RB_Student_ViewModel> GetStudentPageListRepository(int pageIndex, int pageSize, out long rowsCount, RB_Student_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
......@@ -200,17 +201,66 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
return Get<RB_Student_ViewModel>(builder.ToString(), parameters).ToList();
}
/// <summary>
/// 新增修改学员资料
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStudentRepository(RB_Student_ViewModel model)
{
bool flag;
string logContent = "";
string logTitle = "";
int createBy = 0;
if (model.StuId > 0)
{
logTitle = "修改客户";
var oldModel = base.GetEntity<RB_Student_ViewModel>(model.StuId);
if (oldModel.StuName != model.StuName)
{
logContent += string.Format("昵称:由【{0}】=>【{1}】,", oldModel.StuName, model.StuName);
}
if (oldModel.StuTel != model.StuTel)
{
logContent += string.Format("电话:由【{0}】=>【{1}】,", oldModel.StuTel, model.StuTel);
}
if (oldModel.StuIcon != model.StuIcon)
{
logContent += string.Format("头像:由【{0}】=>【{1}】,", oldModel.StuIcon, model.StuIcon);
}
if (oldModel.StuSex != model.StuSex)
{
logContent += string.Format("性别:由【{0}】=>【{1}】,", oldModel.StuSex==0?"男":"女", model.StuSex == 0 ? "男" : "女");
}
if (oldModel.StuBirth != model.StuBirth)
{
logContent += string.Format("出生日期:由【{0}】=>【{1}】,", Common.ConvertHelper.FormatDate(oldModel.StuBirth), Common.ConvertHelper.FormatDate(model.StuBirth));
}
if (oldModel.JapanBaseInfo != model.JapanBaseInfo)
{
logContent += string.Format("日语基础:由【{0}】=>【{1}】,", oldModel.JapanBaseInfo.ToName(), model.JapanBaseInfo.ToName());
}
if (oldModel.StuEducation != model.StuEducation)
{
logContent += string.Format("学历:由【{0}】=>【{1}】,", oldModel.StuEducation.ToName(), model.StuEducation.ToName());
}
if (oldModel.StuPurpose != model.StuPurpose)
{
logContent += string.Format("学习目的:由【{0}】=>【{1}】,", oldModel.StuPurpose.ToName(), model.StuPurpose.ToName());
}
if (oldModel.StuProfession != model.StuProfession)
{
logContent += string.Format("职业:由【{0}】=>【{1}】,", oldModel.StuProfession, model.StuProfession);
}
if (oldModel.StuStage != model.StuStage)
{
logContent += string.Format("客户阶段:由【{0}】=>【{1}】,", oldModel.StuStage.ToName(), model.StuStage.ToName());
}
if (oldModel.StuSource != model.StuSource)
{
logContent += string.Format("来源:由【{0}】=>【{1}】,", oldModel.StuSource.ToName(), model.StuSource.ToName());
}
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_ViewModel.StuName),model.StuName.Trim() },
......@@ -232,8 +282,6 @@ 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));
......@@ -273,12 +321,43 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
logContent = "创建了该客户";
logTitle = "创建客户";
}
student_LogRepository.AddStuLogRepository(model.StuId, Common.Enum.Log.StudentLogTypeEnum.BasicInfo, logTitle, logContent, createBy, CreateType: model.CreateType);
return flag;
}
/// <summary>
/// 学员转交
/// </summary>
/// <param name="StuId">学员编号</param>
/// <param name="CreateBy">负责人</param>
/// <param name="OperateId">操作人</param>
/// <returns></returns>
public bool ForwardStudentRepository(int StuId, int CreateBy, int OperateId)
{
string logTitle = "客户转交";
string logContent = "";
var oldModel = base.GetEntity(StuId);
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_ViewModel.CreateBy),CreateBy },
};
if (oldModel.CreateBy != CreateBy)
{
var empList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{
QIds = oldModel.CreateBy + "," + CreateBy
});
logContent = string.Format("复制人:由【{0}】=>【{1}】",
empList?.FirstOrDefault(qitem => qitem.CreateBy == oldModel.CreateBy)?.EmployeeName,
empList?.FirstOrDefault(qitem => qitem.CreateBy == CreateBy)?.EmployeeName
);
}
var flag = base.Update(fileds, new WhereHelper(nameof(RB_Student_ViewModel.StuId), StuId));
student_LogRepository.AddStuLogRepository(oldModel.StuId, Common.Enum.Log.StudentLogTypeEnum.BasicInfo, logTitle, logContent, OperateId);
return flag;
}
/// 获取同业下学生阶段人数统计
/// </summary>
/// <param name="customerId"></param>
......
......@@ -653,10 +653,15 @@ namespace Edu.WebApi.Controllers.User
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Student_ViewModel()
{
StuName=base.ParmJObj.GetStringValue("StuName"),
StuTel=base.ParmJObj.GetStringValue("StuTel"),
CreateBy=base.ParmJObj.GetInt("CreateBy"),
StuName = base.ParmJObj.GetStringValue("StuName"),
StuTel = base.ParmJObj.GetStringValue("StuTel"),
CreateBy = base.ParmJObj.GetInt("CreateBy"),
IsQueryMyStu = base.ParmJObj.GetInt("IsQueryMyStu"),
};
if (query.IsQueryMyStu == 1)
{
query.CreateBy = base.UserInfo.Id;
}
query.Group_Id = base.UserInfo.Group_Id;
var data = studentModule.GetStudentPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> list = new List<object>();
......@@ -811,6 +816,19 @@ namespace Edu.WebApi.Controllers.User
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 学员转交
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult ForwardStudent()
{
var StuId = base.ParmJObj.GetInt("StuId");
var CreateBy = base.ParmJObj.GetInt("CreateBy");
bool flag = studentModule.ForwardStudentModule(StuId, CreateBy, base.UserInfo.Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <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