Commit c0ffdac0 authored by 黄奎's avatar 黄奎

页面修改

parent 42b6cd69
using EduSpider.Model.Entity;
using EduSpider.Model.Extend;
using EduSpider.Model.Query;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -14,6 +16,11 @@ namespace EduSpider.Repository
/// </summary>
public interface IExam_ScoreRepository : IDBRepository<RB_Exam_Score>, IDependency
{
/// <summary>
/// 学生考试查询
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Exam_Score_Extend> GetExamScoreListRepository(CourseQuery query);
}
}
......@@ -116,5 +116,15 @@ namespace EduSpider.Model.Extend
return str;
}
}
/// <summary>
/// 考试排名
/// </summary>
public int ExamRank { get; set; }
/// <summary>
/// 考试领先度
/// </summary>
public decimal ExamRankRate { get; set; }
}
}
......@@ -9,6 +9,14 @@ namespace EduSpider.Model.Extend
/// </summary>
public class RB_Exam_Score_Extend : RB_Exam_Score
{
/// <summary>
/// 考试名称
/// </summary>
public string ExamName { get; set; }
/// <summary>
/// 考试导入时间
/// </summary>
public DateTime ExamCreateTime { get; set; }
}
}
using EduSpider.Model.Entity;
using EduSpider.Model.Extend;
using EduSpider.Model.Query;
using EduSpider.Repository.Base;
using System;
using System.Collections.Generic;
......@@ -13,6 +15,32 @@ namespace EduSpider.Repository
/// </summary>
public class Exam_ScoreRepository : BaseRepository<RB_Exam_Score>, IExam_ScoreRepository
{
/// <summary>
/// 学生考试查询
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Exam_Score_Extend> GetExamScoreListRepository(CourseQuery query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,B.ExamName,B.CreateTime AS ExamCreateTime
FROM RB_Exam_Score AS A INNER JOIN rb_exam AS B ON A.ExamId=B.ExamId
WHERE 1=1
");
if (query != null)
{
if (query.CourseId > 0)
{
builder.AppendFormat(" AND B.{0}={1} ", nameof(RB_Exam.CourseId), query.CourseId);
}
if (!string.IsNullOrEmpty(query.StuIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Exam_Score_Extend.StuId), query.StuIds);
}
}
return Get<RB_Exam_Score_Extend>(builder.ToString()).ToList();
}
}
}
......@@ -49,6 +49,12 @@ namespace EduSpider.Services
[Autowired]
public IHomeWorkRepository HomeWorkRepository { get; set; }
/// <summary>
/// 学生考试仓储接口
/// </summary>
[Autowired]
public IExam_ScoreRepository Exam_ScoreRepository { get; set; }
/// <summary>
/// 获取学员课程列表
......@@ -86,8 +92,27 @@ namespace EduSpider.Services
{
dataList.AddRange(homeWorkList);
}
var examList = Exam_ScoreRepository.GetExamScoreListRepository(query);
if (examList != null && examList.Count > 0)
{
foreach (var item in examList)
{
dataList.Add(new ExamWorkResult()
{
ResultType=2,
Title=item.ExamName,
CreateTime=item.ExamCreateTime,
Score=item.TScore,
//Score_p=0,
ExamRank=item.Rank,
ExamRankRate=item.RankRate,
});
}
}
if (dataList != null && dataList.Count > 0)
{
dataList = dataList.OrderBy(qitem => qitem.CreateTime).ToList();
foreach (var item in dataList)
{
list.Add(new
......
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