Commit 79ef765a authored by liudong1993's avatar liudong1993

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

parents 1cd93831 9d2c3611
......@@ -45,5 +45,11 @@ namespace Edu.Common.Enum.User
/// </summary>
[EnumField("第三方平台")]
ThirdPartyPlatform = 6,
/// <summary>
/// 其他
/// </summary>
[EnumField("其他")]
Other = 7,
}
}
\ No newline at end of file
......@@ -82,5 +82,10 @@ namespace Edu.Model.Entity.Customer
/// 删除状态(0-正常,1-禁用)
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 是否到访(1-已到访,0-未到访)
/// </summary>
public int IsVisit { get; set; }
}
}
......@@ -19,5 +19,41 @@ namespace Edu.Model.ViewModel.Customer
/// 接待人姓名
/// </summary>
public string ReceptionPersionName { get; set; }
/// <summary>
/// 接待人电话
/// </summary>
public string ReceptionPersionTel { get; set; }
/// <summary>
/// 查询日期
/// </summary>
public string QueryDate { get; set; }
/// <summary>
/// 学员名称
/// </summary>
public string StuName { get; set; }
/// <summary>
/// 学员电话
/// </summary>
public string StuTel { get; set; }
/// <summary>
/// 到访状态字符串
/// </summary>
public string IsVisitStr
{
get
{
string str = "未到访";
if (this.IsVisit == 1)
{
str = "已到访";
}
return str;
}
}
}
}
......@@ -61,6 +61,11 @@ namespace Edu.Model.ViewModel.Reserve
/// </summary>
public string VisitorName { get; set; }
/// <summary>
/// 学员名称
/// </summary>
public string StuName { get; set; }
/// <summary>
/// 教师名称
/// </summary>
......
......@@ -197,5 +197,10 @@ namespace Edu.Model.ViewModel.User
/// 是否查询当天访客
/// </summary>
public int IsQCurrentDay { get; set; }
/// <summary>
/// 是否添加到访记录
/// </summary>
public int IsCreateVisit { get; set; }
}
}
\ No newline at end of file
......@@ -3793,6 +3793,51 @@ namespace Edu.Module.Course
return new { mondayList, tuesdayList, wednesdayList, thursdayList, fridayList, saturdayList, sundayList };
}
/// <summary>
/// 获取指定日期的试听课
/// </summary>
/// <param name="StartTime"></param>
/// <param name="EndTime"></param>
/// <returns></returns>
public object GetDateTrialLessonModule(string StartTime,string EndTime)
{
List<object> list = new List<object>();
var reserveQuery = new RB_Reserve_Class_Extend()
{
StartClassDate = StartTime,
EndClassDate = EndTime,
};
var reserveList = reserve_ClassRepository.GetReserveClassListRepository(reserveQuery);
var visitorList = new List<RB_Visitor_Reserve_Extend>();
if (reserveList != null && reserveList.Count > 0)
{
string reserveClassIds = string.Join(",", reserveList.Select(qitem => qitem.ReserveClassId));
visitorList = visitor_ReserveRepository.GetVisitorReserveListRepository(new Model.ViewModel.Reserve.RB_Visitor_Reserve_Extend()
{
Q_ReserveClassIds = reserveClassIds
});
}
foreach (var item in reserveList)
{
list.Add(new
{
ClassId = item.ReserveClassId,
ClassName = "试听课",
CourseName = item.ClassContent,
item.RoomName,
item.TeacherName,
ClassDate=Common.ConvertHelper.FormatDate(item.ClassDate),
TimeStr = Common.ConvertHelper.GetTimeStr(item.ClassDate),
StartTime = item.ClassTime,
item.EndTime,
GuestList = visitorList?.Where(qitem => qitem.ReserveClassId == item.ReserveClassId)?.Select(qitem => new { GuestName = qitem.VisitorName })
});
}
return list;
}
/// <summary>
/// 获取教师课时统计
/// </summary>
......
......@@ -51,6 +51,11 @@ namespace Edu.Module.Customer
/// </summary>
private readonly RB_Student_OrderGuestRepository student_OrderGuestRepository = new RB_Student_OrderGuestRepository();
/// <summary>
/// 学员协助人员仓储层对象
/// </summary>
private readonly RB_Student_AssistRepository student_AssistRepository = new RB_Student_AssistRepository();
#region 学员约访
......@@ -286,6 +291,37 @@ namespace Edu.Module.Customer
return list;
}
/// <summary>
/// 获取到访列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Visit_Extend> GetStudentVisitListModule(RB_Student_Visit_Extend query)
{
var list = student_VisitRepository.GetStudentVisitListRepository(query);
if (list != null && list.Count > 0)
{
string sids = string.Join(",", list.Select(qitem => qitem.School_Id));
string empIds = string.Join(",", list.Select(qitem => qitem.ReceptionPersion));
var schoolList = schoolRepository.GetSchoolListRepository(new Model.ViewModel.User.RB_School_ViewModel()
{
QSIds = sids
});
var empList = accountRepository.GetEmployeeListRepository(new Model.ViewModel.User.Employee_ViewModel()
{
QIds = empIds
});
foreach (var item in list)
{
item.SchoolName = schoolList?.FirstOrDefault(qitem => qitem.SId == item.School_Id)?.SName ?? "";
item.ReceptionPersionName = empList?.FirstOrDefault(qitem => qitem.Id == item.ReceptionPersion)?.EmployeeName ?? "";
item.ReceptionPersionTel = empList?.FirstOrDefault(qitem => qitem.Id == item.ReceptionPersion)?.EmployeeTel ?? "";
}
}
return list;
}
/// <summary>
/// 新增修改学员到访
/// </summary>
......@@ -362,11 +398,12 @@ namespace Edu.Module.Customer
/// <param name="Id"></param>
/// <param name="OperateId"></param>
/// <returns></returns>
public bool SetStudentVisitFeedbackModule(string Feedback, int Id, int OperateId)
public bool SetStudentVisitFeedbackModule(string Feedback, int Id, int OperateId,int IsVisit)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Visit_Extend.Feedback),Feedback },
{nameof(RB_Student_Visit_Extend.IsVisit),IsVisit },
};
var oldModel = GetStudentVisitModule(Id);
string logTitle = "修改到访";
......@@ -375,6 +412,7 @@ namespace Edu.Module.Customer
{
logContent += string.Format("反馈信息:由【{0}】=>【{1}】", oldModel.Feedback, Feedback);
}
bool flag = student_VisitRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Visit_Extend.Id), Id));
student_LogRepository.AddStuLogRepository(oldModel.StuId, Common.Enum.Log.StudentLogTypeEnum.Visit, logTitle, logContent, OperateId);
return flag;
......@@ -447,5 +485,129 @@ namespace Edu.Module.Customer
return list;
}
/// <summary>
/// 新增修改协助人员
/// </summary>
/// <param name="StuId"></param>
/// <param name="AssistList"></param>
/// <returns></returns>
public bool SetStudentAssistModule(int StuId, List<RB_Student_Assist_Extend> AssistList,int Uid)
{
bool flag = true;
string logTitle = "协助人员";
string logContent = "";
var oldAssistList = student_AssistRepository.GetStudentAssistListRepository(new Model.ViewModel.Customer.RB_Student_Assist_Extend()
{
StuId = StuId
});
List<int> ids1 = new List<int>();
if (AssistList != null)
{
ids1 = Common.Plugin.StringHelper.StringToListInt(string.Join(",", AssistList.Select(qitem => qitem.AssistId)));
}
if (oldAssistList != null)
{
List<int> ids2 = Common.Plugin.StringHelper.StringToListInt(string.Join(",", oldAssistList.Select(qitem => qitem.AssistId)));
if (ids2 != null && ids2.Count > 0)
{
ids1.AddRange(ids2);
}
}
string aids = string.Join(",", ids1);
List<Employee_ViewModel> empList = new List<Employee_ViewModel>();
if (!string.IsNullOrEmpty(aids))
{
empList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{
QIds = aids
});
}
//以前没有协同人员【直接新增】
if (oldAssistList == null || (oldAssistList != null && oldAssistList.Count == 0))
{
foreach (var item in oldAssistList)
{
student_AssistRepository.Insert(new Model.Entity.Customer.RB_Student_Assist()
{
AssistId = item.AssistId,
AssistType = item.AssistType,
StuId = StuId
});
logContent += string.Format("新增协同人员:" + empList?.FirstOrDefault(qitem => qitem.Id == item.AssistId)?.EmployeeName);
}
}
else
{
//现在没有协同人员了【直接删除以前的协同人员】
if (AssistList == null || (AssistList != null && AssistList.Count == 0))
{
student_AssistRepository.DeleteStudentAssistRepository(StuId);
foreach (var item in oldAssistList)
{
logContent += string.Format("删除协同人员:" + empList?.FirstOrDefault(qitem => qitem.Id == item.AssistId)?.EmployeeName);
}
}
//找出差异的数据
var deleteList = oldAssistList.Where(qitem => !AssistList.Any(oldItem => qitem.Id == oldItem.Id)).ToList();
foreach (var dItem in deleteList)
{
if (dItem.Id > 0)
{
logContent += string.Format("删除协同人员:" + empList?.FirstOrDefault(qitem => qitem.Id == dItem.AssistId)?.EmployeeName);
student_AssistRepository.Delete(dItem.Id);
}
}
foreach (var item in AssistList)
{
item.StuId = StuId;
if (item.Id == 0)
{
logContent += string.Format("新增协同人员:" + empList?.FirstOrDefault(qitem => qitem.Id == item.AssistId)?.EmployeeName);
student_AssistRepository.Insert(item);
}
else
{
var oldModel = oldAssistList?.FirstOrDefault(qitem => qitem.Id == item.Id);
if ((oldModel?.AssistId ?? 0) != item.AssistId)
{
logContent += string.Format("修改协同人员:【0】=>【{1}】",
empList?.FirstOrDefault(qitem => qitem.Id == (oldModel?.AssistId ?? 0))?.EmployeeName,
empList?.FirstOrDefault(qitem => qitem.Id == item.AssistId)?.EmployeeName
);
}
student_AssistRepository.Update(item);
}
}
}
student_LogRepository.AddStuLogRepository(StuId, Common.Enum.Log.StudentLogTypeEnum.BasicInfo, logTitle, logContent, Uid);
return flag;
}
/// <summary>
/// 获取学员协助人员列表
/// </summary>
/// <param name="StuId"></param>
/// <returns></returns>
public List<RB_Student_Assist_Extend> GeStudentAssistListModule(int StuId)
{
var list= student_AssistRepository.GetStudentAssistListRepository(new RB_Student_Assist_Extend()
{
StuId = StuId
});
string aIds = string.Join(",", list.Select(qitem => qitem.AssistId));
List<RB_Account_ViewModel> accountList = new List<RB_Account_ViewModel>();
if (!string.IsNullOrEmpty(aIds))
{
accountList = accountRepository.GetAccountListExtRepository(new RB_Account_ViewModel() { QIds = aIds });
}
foreach (var item in list)
{
item.AssistName = accountList?.FirstOrDefault(qitem => qitem.Id == item.AssistId)?.AccountName ?? "";
}
return list;
}
}
}
......@@ -249,7 +249,16 @@ namespace Edu.Module.User
/// <returns></returns>
public RB_Student_ViewModel GetStudentModule(int StuId)
{
return studentRepository.GetEntity<RB_Student_ViewModel>(StuId);
var extModel = studentRepository.GetEntity<RB_Student_ViewModel>(StuId);
if (extModel != null && extModel.StuId > 0)
{
var assistList = student_AssistRepository.GetStudentAssistListRepository(new RB_Student_Assist_Extend()
{
StuId = extModel.StuId
});
extModel.AssistList = assistList;
}
return extModel;
}
/// <summary>
......
......@@ -44,5 +44,39 @@ WHERE 1=1
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();
}
/// <summary>
/// 获取到访列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Visit_Extend> GetStudentVisitListRepository(RB_Student_Visit_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.StuName,'') AS StuName,IFNULL(B.StuTel,'') AS StuTel
FROM RB_Student_Visit AS A INNER JOIN rb_student AS B ON A.StuId=B.StuId
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);
}
if (!string.IsNullOrEmpty(query.QueryDate))
{
//今日到访
builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Student_Visit_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.QueryDate));
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Student_Visit_Extend.Id));
return Get<RB_Student_Visit_Extend>( builder.ToString()).ToList();
}
}
}
......@@ -98,8 +98,8 @@ WHERE 1=1
StringBuilder builder = new StringBuilder();
var parameters = new DynamicParameters();
builder.Append(@"
SELECT A.*,IFNULL(B.`Name`,'') AS VisitorName,C.ClassDate,C.ClassTime,C.EndTime,C.ClassContent,IFNULL(D.TeacherName,'') AS TeacherName,IFNULL(E.RoomName,'') AS RoomName
FROM RB_Visitor_Reserve AS A LEFT JOIN rb_visitor AS B ON A.Visitor_Id=B.Id
SELECT A.*,IFNULL(B.StuName,'') AS VisitorName,C.ClassDate,C.ClassTime,C.EndTime,C.ClassContent,IFNULL(D.TeacherName,'') AS TeacherName,IFNULL(E.RoomName,'') AS RoomName
FROM RB_Visitor_Reserve AS A LEFT JOIN rb_student AS B ON A.Visitor_Id=B.StuId
LEFT JOIN rb_reserve_class AS C ON A.ReserveClassId=C.ReserveClassId
LEFT JOIN rb_teacher AS D ON C.TeacherId=D.TId
LEFT JOIN rb_class_room AS E ON C.ClassRoomId=E.RoomId
......@@ -133,10 +133,10 @@ WHERE 1=1
Int32.TryParse(query.Q_ReserveStatus, out int result);
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.ReserveStatus), result);
}
if (!string.IsNullOrEmpty(query.VisitorName))
if (!string.IsNullOrEmpty(query.StuName))
{
builder.AppendFormat(" AND B.{0} LIKE @VisitorName ", nameof(RB_Visitor.Name));
parameters.Add("VisitorName", "%" + query.VisitorName.Trim() + "%");
builder.AppendFormat(" AND B.{0} LIKE @StuName ", nameof(RB_Visitor_Reserve_Extend.StuName));
parameters.Add("StuName", "%" + query.StuName.Trim() + "%");
}
}
return Get<RB_Visitor_Reserve_Extend>(builder.ToString(), parameters).ToList();
......
......@@ -360,92 +360,6 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
logContent = "创建了该客户";
logTitle = "创建客户";
}
var oldAssistList = student_AssistRepository.GetStudentAssistListRepository(new Model.ViewModel.Customer.RB_Student_Assist_Extend()
{
StuId = model.StuId
});
List<int> ids1 = new List<int>();
if (model.AssistList != null)
{
ids1 = Common.Plugin.StringHelper.StringToListInt(string.Join(",", model.AssistList.Select(qitem => qitem.AssistId)));
}
if (oldAssistList != null)
{
List<int> ids2 = Common.Plugin.StringHelper.StringToListInt(string.Join(",", oldAssistList.Select(qitem => qitem.AssistId)));
if (ids2 != null && ids2.Count > 0)
{
ids1.AddRange(ids2);
}
}
string aids = string.Join(",", ids1);
List<Employee_ViewModel> empList = new List<Employee_ViewModel>();
if (!string.IsNullOrEmpty(aids))
{
empList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{
QIds = aids
});
}
//以前没有协同人员【直接新增】
if (oldAssistList == null || (oldAssistList != null && oldAssistList.Count == 0))
{
foreach (var item in oldAssistList)
{
student_AssistRepository.Insert(new Model.Entity.Customer.RB_Student_Assist()
{
AssistId = item.AssistId,
AssistType = item.AssistType,
StuId = model.StuId
});
logContent+=string.Format("新增协同人员:"+ empList?.FirstOrDefault(qitem=>qitem.Id==item.AssistId)?.EmployeeName);
}
}
else
{
//现在没有协同人员了【直接删除以前的协同人员】
if (model.AssistList == null || (model.AssistList != null && model.AssistList.Count == 0))
{
student_AssistRepository.DeleteStudentAssistRepository(model.StuId);
foreach (var item in oldAssistList)
{
logContent += string.Format("删除协同人员:" + empList?.FirstOrDefault(qitem => qitem.Id == item.AssistId)?.EmployeeName);
}
}
//找出差异的数据
var deleteList = oldAssistList.Where(qitem => !model.AssistList.Any(oldItem => qitem.Id == oldItem.Id)).ToList();
foreach (var dItem in deleteList)
{
if (dItem.Id > 0)
{
logContent += string.Format("删除协同人员:" + empList?.FirstOrDefault(qitem => qitem.Id == dItem.AssistId)?.EmployeeName);
student_AssistRepository.Delete(dItem.Id);
}
}
foreach (var item in model.AssistList)
{
item.StuId = model.StuId;
if (item.Id == 0)
{
logContent += string.Format("新增协同人员:" + empList?.FirstOrDefault(qitem => qitem.Id == item.AssistId)?.EmployeeName);
student_AssistRepository.Insert(item);
}
else
{
var oldModel = oldAssistList?.FirstOrDefault(qitem => qitem.Id == item.Id);
if ((oldModel?.AssistId ?? 0) != item.AssistId)
{
logContent += string.Format("修改协同人员:【0】=>【{1}】",
empList?.FirstOrDefault(qitem => qitem.Id == (oldModel?.AssistId ?? 0))?.EmployeeName,
empList?.FirstOrDefault(qitem => qitem.Id == item.AssistId)?.EmployeeName
);
}
student_AssistRepository.Update(item);
}
}
}
student_LogRepository.AddStuLogRepository(model.StuId, Common.Enum.Log.StudentLogTypeEnum.BasicInfo, logTitle, logContent, createBy, CreateType: model.CreateType);
return flag;
}
......
using Edu.Cache.User;
using Edu.Common.API;
using Edu.Common.Enum.User;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Customer;
using Edu.Model.ViewModel.User;
......@@ -7,6 +8,7 @@ using Edu.Module.Customer;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -233,6 +235,8 @@ namespace Edu.WebApi.Controllers.Customer
item.Feedback,
CreateTime=Common.ConvertHelper.FormatTimeStr2(item.CreateTime),
CreateByName,
item.IsVisit,
item.IsVisitStr,
});
}
pageModel.Count = rowsCount;
......@@ -264,7 +268,7 @@ namespace Edu.WebApi.Controllers.Customer
extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = base.UserInfo.Group_Id;
bool flag = customerStudentModule.SetStudentVisitModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
return flag ? ApiResult.Success(data:extModel) : ApiResult.Failed();
}
/// <summary>
......@@ -275,8 +279,9 @@ namespace Edu.WebApi.Controllers.Customer
public ApiResult SetStudentVisitFeedback()
{
var Id = base.ParmJObj.GetInt("Id");
int IsVisit = base.ParmJObj.GetInt("IsVisit");
string Feedback = base.ParmJObj.GetStringValue("Feedback");
bool flag = customerStudentModule.SetStudentVisitFeedbackModule(Feedback, Id, base.UserInfo.Id);
bool flag = customerStudentModule.SetStudentVisitFeedbackModule(Feedback, Id, base.UserInfo.Id, IsVisit);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......@@ -411,5 +416,51 @@ namespace Edu.WebApi.Controllers.Customer
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 新增修改协助人员
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetStudentAssist()
{
var AssistList = new List<RB_Student_Assist_Extend>();
var StuId = base.ParmJObj.GetInt("StuId");
string assistListStr = base.ParmJObj.GetStringValue("AssistList");
if (!string.IsNullOrEmpty(assistListStr))
{
JArray jarray = JArray.Parse(assistListStr);
if (jarray != null && jarray.Count > 0)
{
foreach (var jItem in jarray)
{
JObject jobj = JObject.Parse(jItem.ToString());
var aModel = new RB_Student_Assist_Extend()
{
Id = jobj.GetInt("Id"),
AssistId = jobj.GetInt("AssistId"),
AssistType = (AssistTypeEnum)jobj.GetInt("AssistType"),
StuId = StuId,
};
AssistList.Add(aModel);
}
}
}
bool flag = customerStudentModule.SetStudentAssistModule(StuId, AssistList,base.UserInfo.Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 获取协助人员列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentAssistList()
{
var StuId = base.ParmJObj.GetInt("StuId");
var data = customerStudentModule.GeStudentAssistListModule(StuId);
return ApiResult.Success(data: data);
}
}
}
......@@ -3,6 +3,9 @@ using Edu.Common.API;
using Edu.Common.Enum.Duty;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Duty;
using Edu.Model.ViewModel.Grade;
using Edu.Module.Course;
using Edu.Module.Customer;
using Edu.Module.Duty;
using Edu.Module.User;
using Edu.WebApi.Filter;
......@@ -12,6 +15,7 @@ using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Edu.WebApi.Controllers.Duty
......@@ -35,6 +39,16 @@ namespace Edu.WebApi.Controllers.Duty
/// </summary>
private readonly StudentModule studentModule = AOP.AOPHelper.CreateAOPObject<StudentModule>();
/// <summary>
/// 客户学员处理类对象
/// </summary>
private readonly CustomerStudentModule customerStudentModule = new CustomerStudentModule();
/// <summary>
/// 班级处理类对象
/// </summary>
private readonly ClassModule classModule = new ClassModule();
/// <summary>
/// 获取值班计划分页列表【管理端】
/// </summary>
......@@ -550,8 +564,6 @@ namespace Edu.WebApi.Controllers.Duty
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 获取访客分页列表
/// </summary>
......@@ -689,5 +701,65 @@ namespace Edu.WebApi.Controllers.Duty
bool flag = dutyPlanModule.UpdateVisitorModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 获取今日到访列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetDutyTodayVisit()
{
var Id = base.ParmJObj.GetInt("Id");
var planModel = dutyPlanModule.GetDutyPlanModule(Id);
string planDate = Common.ConvertHelper.FormatDate(planModel.Date);
var data = customerStudentModule.GetStudentVisitListModule(new Model.ViewModel.Customer.RB_Student_Visit_Extend()
{
Group_Id = planModel.Group_Id,
School_Id = planModel.School_Id,
QueryDate = planDate
});
List<object> list = new List<object>();
if (data != null && data.Count > 0)
{
foreach (var item in data)
{
string StuTel = item.StuTel;
StuTel= Regex.Replace(StuTel, "(\\d{3})(\\d{5})(\\d{3})", "$1*****$3");
list.Add(new
{
item.Id,
item.StuId,
item.StuName,
Date = Common.ConvertHelper.FormatDate(item.Date),
item.VisitTime,
item.Remark,
item.Feedback,
item.School_Id,
item.SchoolName,
item.ReceptionPersion,
item.ReceptionPersionName,
CreateTimeStr =Common.ConvertHelper.FormatTime(item.CreateTime),
item.IsVisit,
item.IsVisitStr,
item.ReceptionPersionTel,
StuTel,
});
}
}
return ApiResult.Success(data: list);
}
/// <summary>
/// 值班获取今日试听安排
/// </summary>
/// <returns></returns>
public ApiResult GetDutyTrialLesson()
{
var Id = base.ParmJObj.GetInt("Id");
var planModel = dutyPlanModule.GetDutyPlanModule(Id);
string planDate = Common.ConvertHelper.FormatDate(planModel.Date);
var data = classModule.GetDateTrialLessonModule(planDate, planDate);
return ApiResult.Success(data: data);
}
}
}
......@@ -779,27 +779,7 @@ namespace Edu.WebApi.Controllers.User
{
return ApiResult.Failed("此学员手机号已绑定同行!请重新录入!");
}
extModel.AssistList = new List<RB_Student_Assist_Extend>();
string AssistList = base.ParmJObj.GetStringValue("AssistList");
if (!string.IsNullOrEmpty(AssistList))
{
JArray jarray = JArray.Parse(AssistList);
if (jarray != null && jarray.Count > 0)
{
foreach (var jItem in jarray)
{
JObject jobj = JObject.Parse(jItem.ToString());
var aModel = new RB_Student_Assist_Extend()
{
Id = jobj.GetInt("Id"),
AssistId = jobj.GetInt("AssistId"),
AssistType = (AssistTypeEnum)jobj.GetInt("AssistType"),
StuId = jobj.GetInt("StuId"),
};
extModel.AssistList.Add(aModel);
}
}
}
bool flag = studentModule.SetStudentModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......@@ -1004,6 +984,7 @@ namespace Edu.WebApi.Controllers.User
extModel.StuChannel,
StuChannelName = extModel.StuChannel.ToName(),
extModel.PlatformName,
AssistList = extModel?.AssistList ?? new List<RB_Student_Assist_Extend>(),
};
return ApiResult.Success(data: obj);
}
......
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