Commit 982191a2 authored by 黄奎's avatar 黄奎

页面修改

parent 6f4518dd
......@@ -10,5 +10,14 @@ namespace Edu.Model.ViewModel.Customer
/// </summary>
public class RB_Student_Appointment_Extend: RB_Student_Appointment
{
/// <summary>
/// 查询日期
/// </summary>
public string QueryDate { get; set; }
/// <summary>
/// 约访次数
/// </summary>
public int AppointmentCount { get; set; }
}
}
......@@ -43,8 +43,6 @@ namespace Edu.Module.User
/// </summary>
private readonly AccountModule accountModule = new AccountModule();
/// <summary>
/// 小程序用户仓储层对象 add by:W 2021-09-15
/// </summary>
......@@ -101,6 +99,11 @@ namespace Edu.Module.User
/// </summary>
private readonly RB_NeedsRepository needsRepository = new RB_NeedsRepository();
/// <summary>
/// 学员约访仓储层对象
/// </summary>
private readonly RB_Student_AppointmentRepository student_AppointmentRepository = new RB_Student_AppointmentRepository();
/// <summary>
/// 获取学生列表
/// </summary>
......@@ -648,5 +651,31 @@ namespace Edu.Module.User
return member_UserRepository.GetMemberUserEntityRepository(query);
}
#endregion
/// <summary>
/// 今日新名单
/// </summary>
/// <returns></returns>
public object GetStudentTodayStaticModule(int createBy)
{
var today = Common.ConvertHelper.FormatDate(DateTime.Now);
//今日新增名单
int todayAdd= studentRepository.GetStudentStaticRepository(createBy.ToString(), today, today)?.FirstOrDefault()?.ClueCount ?? 0;
//今日到访
int todayVisit = student_VisitRepository.GetStudentVisitStaticRepository(new RB_Student_Visit_Extend() { CreateBy = createBy, QueryDate = today })?.Count() ?? 0;
//今日预约
int AppointmentCount = student_AppointmentRepository.GetStudentVisitStaticRepository(new RB_Student_Appointment_Extend()
{
CreateBy = createBy,
QueryDate = today
})?.FirstOrDefault()?.AppointmentCount ?? 0;
object obj = new
{
todayAdd,
todayVisit,
AppointmentCount
};
return obj;
}
}
}
......@@ -45,5 +45,45 @@ WHERE 1=1
return GetPage<RB_Student_Appointment_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
/// <summary>
/// 获取约访统计列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Appointment_Extend> GetStudentVisitStaticRepository(RB_Student_Appointment_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.StuId,Count(1) AS AppointmentCount
FROM RB_Student_Appointment 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_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);
}
if (query.CreateBy > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.CreateBy), query.CreateBy);
}
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(" GROUP BY A.StuId ");
return Get<RB_Student_Appointment_Extend>(builder.ToString()).ToList();
}
}
}
......@@ -108,6 +108,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Student_Visit_Extend.StuId), query.QStuIds);
}
if (query.CreateBy > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Visit_Extend.CreateBy), query.CreateBy);
}
if (!string.IsNullOrEmpty(query.QueryDate))
{
//今日到访
......
......@@ -723,12 +723,12 @@ WHERE 1=1
public List<RB_Student_ViewModel> GetStudentStaticRepository(string createByIds,string startDate,string endDate)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT CreateBy,Count(1) AS ClueCount
FROM RB_Student
WHERE Status=0 AND CreateBy IN({0}) and CreateTime>='{1}' and CreateTime<='{2} 23:59:59'
", createByIds, startDate, endDate);
builder.AppendFormat(" GROUP BY CreateBy ");
var list = Get<RB_Student_ViewModel>(builder.ToString()).ToList();
return list;
}
......
......@@ -57,6 +57,11 @@ namespace Edu.WebApi.Controllers.User
/// </summary>
private readonly AccountModule accountModule = new AccountModule();
/// <summary>
/// 学员处理类对象
/// </summary>
private readonly StudentModule studentModule = new StudentModule();
#region 字典管理
/// <summary>
......@@ -2484,7 +2489,8 @@ namespace Edu.WebApi.Controllers.User
[HttpPost]
public ApiResult PersonnelStatic()
{
return ApiResult.Failed();
var obj = studentModule.GetStudentTodayStaticModule(base.UserInfo.Id);
return ApiResult.Success(data: obj);
}
/// <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