Commit 8859e844 authored by 黄奎's avatar 黄奎

页面修改

parent 8c5a0daf
......@@ -29,5 +29,10 @@ namespace Edu.Model.ViewModel.Customer
/// 结束时间
/// </summary>
public string EndDate { get; set; }
/// <summary>
/// 学员姓名
/// </summary>
public string StuName { get; set; }
}
}
......@@ -1201,5 +1201,46 @@ namespace Edu.Module.User
//}
#endregion
/// <summary>
/// 今日需联系线索(之前预约或者24小时内收到的新线索)
/// </summary>
/// <param name="userId"></param>
/// <param name="receiveId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public List<object> GetTodayVisitModule(int CreateBy)
{
List<object> result = new List<object>();
var list = student_AppointmentRepository.GetStudentVisitListRepository(new RB_Student_Appointment_Extend()
{
QueryDate = Common.ConvertHelper.FormatDate(DateTime.Now),
CreateBy = CreateBy
});
if (list != null && list.Count > 0)
{
string createByIds = string.Join(",", list.Select(qitem => qitem.CreateBy));
List<RB_Account_ViewModel> empList = new List<RB_Account_ViewModel>();
if (!string.IsNullOrEmpty(createByIds))
{
empList = accountModule.GetAccountListExtModule(new RB_Account_ViewModel() { QIds = createByIds });
}
foreach (var item in list)
{
var tempEmp = empList?.FirstOrDefault(qitem => qitem.Id == item.CreateBy);
result.Add(new
{
item.Id,
item.StuId,
item.StuName,
item.CreateBy,
EmployeeName= tempEmp?.AccountName,
CreateTime=Common.ConvertHelper.FormatTime(item.CreateTime),
item.Feedback,
});
}
}
return result;
}
}
}
......@@ -83,19 +83,65 @@ WHERE 1=1
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(" AND DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Student_Appointment_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.QueryDate));
}
if (!string.IsNullOrEmpty(query.StartDate))
{
builder.AppendFormat(" AND A.{0}>='{1}' ", nameof(RB_Student_Visit_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.StartDate));
builder.AppendFormat(" AND A.{0}>='{1}' ", nameof(RB_Student_Appointment_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.StartDate));
}
if (!string.IsNullOrEmpty(query.EndDate))
{
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Student_Visit_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.EndDate));
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Student_Appointment_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.EndDate));
}
}
builder.AppendFormat(" GROUP BY A.CreateBy,DATE_FORMAT(A.CreateTime,'%Y/%m/%d') ");
return Get<RB_Student_Appointment_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 获取约访统计列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Appointment_Extend> GetStudentVisitListRepository(RB_Student_Appointment_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,B.StuName
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('{2}','%y/%m/%d') OR DATE_FORMAT(A.{1},'%y/%m/%d')= DATE_FORMAT('{2}','%y/%m/%d')) ", nameof(RB_Student_Appointment_Extend.CreateTime), nameof(RB_Student_Appointment_Extend.AppointmentTime), Common.ConvertHelper.FormatDate(query.QueryDate));
}
if (!string.IsNullOrEmpty(query.StartDate))
{
builder.AppendFormat(" AND A.{0}>='{1}' ", nameof(RB_Student_Appointment_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.StartDate));
}
if (!string.IsNullOrEmpty(query.EndDate))
{
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Student_Appointment_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.EndDate));
}
}
return Get<RB_Student_Appointment_Extend>(builder.ToString()).ToList();
}
}
}
......@@ -2712,8 +2712,10 @@ namespace Edu.WebApi.Controllers.User
{
foreach (var item in list)
{
var excelRows = new List<ExcelColumn>();
excelRows.Add(new ExcelColumn(UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName));
var excelRows = new List<ExcelColumn>
{
new ExcelColumn(UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName)
};
string curWeekStu = (item?.CurWeekStuList?.Count ?? 0).ToString();
string curMonthStu = (item?.CurMonthStuList?.Count ?? 0).ToString();
excelRows.Add(new ExcelColumn(curWeekStu));
......@@ -3305,5 +3307,19 @@ namespace Edu.WebApi.Controllers.User
}
}
#endregion
#region 首页待办工作视图统计
/// <summary>
/// 今日需联系线索
/// </summary>
/// <returns></returns>
public ApiResult GetTodayClue()
{
var list = studentModule.GetTodayVisitModule(base.UserInfo.Id);
return ApiResult.Success(data: list);
}
#endregion
}
}
\ No newline at end of file
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