Commit 7c8605d3 authored by 黄奎's avatar 黄奎

学员学习字段调整

parent 6345e542
......@@ -55,17 +55,17 @@ namespace Edu.Model.Entity.User
/// <summary>
/// 单词得分
/// </summary>
public decimal Words { get; set; }
public string Words { get; set; }
/// <summary>
/// 练习题得分
/// </summary>
public decimal Practice { get; set; }
public string Practice { get; set; }
/// <summary>
/// 朗读背诵得分
/// </summary>
public decimal ReadingAloud { get; set; }
public string ReadingAloud { get; set; }
/// <summary>
/// 其他得分(JSON格式)
......
......@@ -3799,10 +3799,10 @@ namespace Edu.Module.Course
Rlist.Add(new
{
StudyID = studentStudyModel?.ID ?? 0,
Words = ((studentStudyModel?.Words ?? 0) > 0) ? studentStudyModel?.Words.ToString("F2") : "",
Practice = ((studentStudyModel?.Practice ?? 0) > 0) ? studentStudyModel?.Practice.ToString("F2") : "",
ReadingAloud = ((studentStudyModel?.ReadingAloud ?? 0) > 0) ? studentStudyModel?.ReadingAloud.ToString("F2") : "",
Other = !string.IsNullOrWhiteSpace(studentStudyModel?.Other ?? "") ? JsonHelper.DeserializeObject<List<StudyOther>>(studentStudyModel?.Other) : new List<StudyOther>(),
Words = studentStudyModel?.Words ?? "",
Practice = studentStudyModel?.Practice ?? "",
ReadingAloud = studentStudyModel?.ReadingAloud ?? "",
Other = studentStudyModel?.Other ?? "",
x.ChapterNo,
x.ChapterName,
x.CourseRate,
......@@ -3820,7 +3820,6 @@ namespace Edu.Module.Course
else
{
//跟班
cList.ForEach(x => { x.SortNum = Convert.ToDouble(x.ChapterNo); });
cList.OrderBy(x => x.SortNum).ToList().ForEach(x =>
{
......@@ -3828,10 +3827,10 @@ namespace Edu.Module.Course
Rlist.Add(new
{
StudyID = studentStudyModel?.ID ?? 0,
Words = ((studentStudyModel?.Words ?? 0) > 0) ? studentStudyModel?.Words.ToString("F2") : "",
Practice = ((studentStudyModel?.Practice ?? 0) > 0) ? studentStudyModel?.Practice.ToString("F2") : "",
ReadingAloud = ((studentStudyModel?.ReadingAloud ?? 0) > 0) ? studentStudyModel?.ReadingAloud.ToString("F2") : "",
Other = !string.IsNullOrWhiteSpace(studentStudyModel?.Other) ? JsonHelper.DeserializeObject<List<StudyOther>>(studentStudyModel?.Other) : new List<StudyOther>(),
Words = studentStudyModel?.Words ?? "",
Practice = studentStudyModel?.Practice ?? "",
ReadingAloud = studentStudyModel?.ReadingAloud ?? "",
Other = studentStudyModel?.Other ?? "",
x.ChapterNo,
x.ChapterName,
x.CourseRate,
......@@ -3847,21 +3846,18 @@ namespace Edu.Module.Course
});
}
}
if (studyList != null && studyList.Any(x => x.StudyType == 2))
{
var kaoshiList = studyList.Where(x => x.StudyType == 2).ToList();
Rlist.AddRange(kaoshiList.OrderBy(x => x.CreateTime).Select(x => new
{
CourseRateName = (courseModel?.CourseId ?? 0) > 0 ? courseModel?.CourseRate.ToName() : "",
StudyID = x?.ID ?? 0,
StudyType = x.StudyType,
Words = ((x?.Words ?? 0) > 0) ? x?.Words.ToString("F2") : "",
Practice = ((x?.Practice ?? 0) > 0) ? x?.Practice.ToString("F2") : "",
ReadingAloud = ((x?.ReadingAloud ?? 0) > 0) ? x?.ReadingAloud.ToString("F2") : "",
Other = !string.IsNullOrWhiteSpace(x?.Other) ? JsonHelper.DeserializeObject<List<StudyOther>>(x?.Other) : new List<StudyOther>(),
Words = x?.Words ?? "",
Practice = x?.Practice ?? "",
ReadingAloud = x?.ReadingAloud ?? "",
Other = x?.Other ?? "",
ChapterNo = "",
ChapterName = "",
CourseRate = "",
......@@ -3875,8 +3871,6 @@ namespace Edu.Module.Course
return Rlist;
}
/// <summary>
/// 获取学员学习情况
/// </summary>
......@@ -3891,11 +3885,11 @@ namespace Edu.Module.Course
Rlist.AddRange(studyList.OrderBy(x => x.CreateTime).Select(x => new
{
StudyID = x?.ID ?? 0,
StudyType = x.StudyType,
Words = 0,
Practice = 0,
ReadingAloud = 0,
Other = !string.IsNullOrWhiteSpace(x?.Other) ? JsonHelper.DeserializeObject<List<StudyOther>>(x?.Other) : new List<StudyOther>(),
x.StudyType,
Words = "",
Practice = "",
ReadingAloud = "",
Other = x?.Other ?? "",
ChapterNo = "",
ChapterName = "",
CourseRate = "",
......@@ -3936,10 +3930,7 @@ namespace Edu.Module.Course
AppointList = scroll_AppointmentRepository.GetAppointList(new RB_Scroll_Appointment_ViewModel() { Group_Id = demodel.Group_Id, CourseId = demodel.CourseId, StuId = demodel.StuId });
//查询所有的 补课记录
SkipList = scroll_SkipCourseRepository.GetList(new RB_Scroll_SkipCourse_ViewModel() { Group_Id = demodel.Group_Id, CourseId = demodel.CourseId, StuId = demodel.StuId });
}
return ogList;
}
......@@ -4108,9 +4099,8 @@ namespace Edu.Module.Course
});
}
}
return Rlist;
}
#endregion
}
}
}
\ No newline at end of file
......@@ -1271,52 +1271,53 @@ namespace Edu.WebApi.Controllers.Course
OrderId = base.ParmJObj.GetInt("OrderId", 0),
GuestId = base.ParmJObj.GetInt("GuestId", 0),
StuId = base.ParmJObj.GetInt("StuId", 0),
Words = base.ParmJObj.GetDecimal("Words"),
Practice = base.ParmJObj.GetDecimal("Practice"),
ReadingAloud = base.ParmJObj.GetDecimal("ReadingAloud"),
Words = base.ParmJObj.GetStringValue("Words"),
Practice = base.ParmJObj.GetStringValue("Practice"),
ReadingAloud = base.ParmJObj.GetStringValue("ReadingAloud"),
Other=base.ParmJObj.GetStringValue("Other"),
StudyValue = base.ParmJObj.GetStringValue("StudyValue"),
Remarks = base.ParmJObj.GetStringValue("Remarks"),
};
string other = base.ParmJObj.GetStringValue("Other");
List<StudyOther> otherList = new List<StudyOther>();
if (!string.IsNullOrWhiteSpace(other))
{
JArray otherListArray = JArray.Parse(other);
if (otherListArray != null && otherListArray.Count > 0)
{
foreach (var jItem in otherListArray)
{
JObject jobj = JObject.Parse(JsonHelper.Serialize(jItem));
string score = jobj.GetStringValue("Score");
string name = jobj.GetStringValue("Name");
if (!string.IsNullOrWhiteSpace(name) || !string.IsNullOrWhiteSpace(score))
{
decimal rScore = 0;
try
{
rScore = !string.IsNullOrWhiteSpace(score) ? Convert.ToDecimal(score) : 0;
}
catch (Exception ex)
{
rScore = 0;
}
otherList.Add(new StudyOther
{
Name = name,
Score = rScore,
});
}
}
}
}
if (otherList != null && otherList.Any())
{
demodel.Other = JsonHelper.Serialize(otherList);
}
else
{
demodel.Other = "";
}
//string other = base.ParmJObj.GetStringValue("Other");
//List<StudyOther> otherList = new List<StudyOther>();
//if (!string.IsNullOrWhiteSpace(other))
//{
// JArray otherListArray = JArray.Parse(other);
// if (otherListArray != null && otherListArray.Count > 0)
// {
// foreach (var jItem in otherListArray)
// {
// JObject jobj = JObject.Parse(JsonHelper.Serialize(jItem));
// string score = jobj.GetStringValue("Score");
// string name = jobj.GetStringValue("Name");
// if (!string.IsNullOrWhiteSpace(name) || !string.IsNullOrWhiteSpace(score))
// {
// decimal rScore = 0;
// try
// {
// rScore = !string.IsNullOrWhiteSpace(score) ? Convert.ToDecimal(score) : 0;
// }
// catch (Exception ex)
// {
// rScore = 0;
// }
// otherList.Add(new StudyOther
// {
// Name = name,
// Score = rScore,
// });
// }
// }
// }
//}
//if (otherList != null && otherList.Any())
//{
// demodel.Other = JsonHelper.Serialize(otherList);
//}
//else
//{
// demodel.Other = "";
//}
if (demodel.ID == 0)
{
demodel.CreateTime = DateTime.Now;
......
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