Commit 464ea544 authored by 黄奎's avatar 黄奎

页面修改

parent 8ae86737
...@@ -31,6 +31,8 @@ using Edu.Repository.Sell; ...@@ -31,6 +31,8 @@ using Edu.Repository.Sell;
using Edu.Module.User; using Edu.Module.User;
using System.Web; using System.Web;
using Edu.Common.Enum.System; using Edu.Common.Enum.System;
using Edu.Repository.Exam;
using Edu.Model.ViewModel.Exam;
namespace Edu.Module.Course namespace Edu.Module.Course
{ {
...@@ -205,6 +207,11 @@ namespace Edu.Module.Course ...@@ -205,6 +207,11 @@ namespace Edu.Module.Course
/// </summary> /// </summary>
private readonly RB_Class_FeedBackRepository class_FeedBackRepository = new RB_Class_FeedBackRepository(); private readonly RB_Class_FeedBackRepository class_FeedBackRepository = new RB_Class_FeedBackRepository();
/// <summary>
/// 学员单词预习仓储层对象
/// </summary>
private readonly RB_StuWords_PrepRepository stuWords_PrepRepository = new RB_StuWords_PrepRepository();
/// <summary> /// <summary>
/// 获取班级列表 /// 获取班级列表
/// </summary> /// </summary>
...@@ -4850,7 +4857,7 @@ namespace Edu.Module.Course ...@@ -4850,7 +4857,7 @@ namespace Edu.Module.Course
/// </summary> /// </summary>
/// <param name="classId"></param> /// <param name="classId"></param>
/// <returns></returns> /// <returns></returns>
public object GetIndexWords(int classId, int courseId, int groupId) public object GetIndexWords(int classId, int courseId, int groupId,int Stu_Account_Id=0)
{ {
int NextCourseNo = 0, ReviewCourseNo = 0; int NextCourseNo = 0, ReviewCourseNo = 0;
var planModel = class_PlanRepository.GetToDayClassPlan(classId, groupId); var planModel = class_PlanRepository.GetToDayClassPlan(classId, groupId);
...@@ -4900,13 +4907,23 @@ namespace Edu.Module.Course ...@@ -4900,13 +4907,23 @@ namespace Edu.Module.Course
{ {
ReviewNum = course_WordsRepository.GetCourseWordsNum(courseId, ReviewCourseNo, groupId); ReviewNum = course_WordsRepository.GetCourseWordsNum(courseId, ReviewCourseNo, groupId);
} }
decimal TotalScore = 0;
if (Stu_Account_Id > 0)
{
TotalScore= stuWords_PrepRepository.GetStuWordsPrepScoreRepository(new RB_StuWords_Prep_Extend()
{
CourseId = courseId,
Stu_Account_Id = Stu_Account_Id
});
}
return new return new
{ {
NextWord = NextNum, NextWord = NextNum,
NextCourseNo, NextCourseNo,
ReviewWord = ReviewNum, ReviewWord = ReviewNum,
ReviewCourseNo, ReviewCourseNo,
CourseId= courseId CourseId = courseId,
TotalScore
}; };
} }
......
...@@ -49,10 +49,10 @@ namespace Edu.Repository.Exam ...@@ -49,10 +49,10 @@ namespace Edu.Repository.Exam
/// </summary> /// </summary>
/// <param name="query"></param> /// <param name="query"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_StuWords_Prep_Extend> GetStuWordsPrepPageRepository(int pageIndex,int pageSize,out long rowsCount, RB_StuWords_Prep_Extend query) public decimal GetStuWordsPrepScoreRepository(RB_StuWords_Prep_Extend query)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" SELECT A.* FROM RB_StuWords_Prep AS A WHERE 1=1 "); builder.AppendFormat(@" SELECT SUM(A.Score) AS Score FROM RB_StuWords_Prep AS A WHERE 1=1 ");
if (query != null) if (query != null)
{ {
if (query.Group_Id > 0) if (query.Group_Id > 0)
...@@ -72,7 +72,13 @@ namespace Edu.Repository.Exam ...@@ -72,7 +72,13 @@ namespace Edu.Repository.Exam
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_StuWords_Prep_Extend.Stu_Account_Id), query.Stu_Account_Id); builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_StuWords_Prep_Extend.Stu_Account_Id), query.Stu_Account_Id);
} }
} }
return GetPage<RB_StuWords_Prep_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList(); decimal totalScore = 0;
object obj = base.ExecuteScalar(builder.ToString());
if (obj != null)
{
decimal.TryParse(obj.ToString(), out totalScore);
}
return totalScore;
} }
} }
} }
...@@ -415,13 +415,15 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -415,13 +415,15 @@ namespace Edu.WebApi.Controllers.Applet
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult GetMyStudyCourseInfo() { public ApiResult GetMyStudyCourseInfo()
{
var appletUserInfo = base.AppletUserInfo; var appletUserInfo = base.AppletUserInfo;
JObject parms = JObject.Parse(base.RequestParm.Msg.ToString()); JObject parms = JObject.Parse(base.RequestParm.Msg.ToString());
int ClassId = parms.GetInt("ClassId", 0);//班级ID int ClassId = parms.GetInt("ClassId", 0);//班级ID
int CourseId = parms.GetInt("CourseId", 0);//课程ID int CourseId = parms.GetInt("CourseId", 0);//课程ID
int GuestId = parms.GetInt("GuestId", 0);//订单GuestId int GuestId = parms.GetInt("GuestId", 0);//订单GuestId
if (ClassId <= 0) { if (ClassId <= 0)
{
return ApiResult.ParamIsNull("请传递班级ID"); return ApiResult.ParamIsNull("请传递班级ID");
} }
//获取课程回顾 //获取课程回顾
...@@ -469,14 +471,17 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -469,14 +471,17 @@ namespace Edu.WebApi.Controllers.Applet
var Words = new object(); var Words = new object();
if (ClassId > 0 && CourseId > 0) if (ClassId > 0 && CourseId > 0)
{ {
Words = classModule.GetIndexWords(ClassId, CourseId, appletUserInfo.Group_Id); Words = classModule.GetIndexWords(ClassId, CourseId, appletUserInfo.Group_Id,appletUserInfo.Id);
} }
else else
{ {
Words = new Words = new
{ {
NextWord = 0, NextWord = 0,
ReviewWord = 0 NextCourseNo=0,
ReviewWord = 0,
ReviewCourseNo=0,
CourseId = CourseId
}; };
} }
......
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