Commit 4b7cf449 authored by liudong1993's avatar liudong1993
parents cc63eca2 5661bfca
......@@ -71,5 +71,10 @@ namespace EduSpider.Model.Query
/// 默认评价编号
/// </summary>
public int DefaultCommentId { get; set; }
/// <summary>
/// 学员作业编号
/// </summary>
public long Stu_HomeWork_Id { get; set; }
}
}
......@@ -32,6 +32,7 @@ namespace EduSpider.Repository
StuUid = item.StuUid,
HomeWorkId = item.HomeWorkId,
}).FirstOrDefault();
string createTimeStr = "";
if (defaultModel != null)
{
......@@ -42,7 +43,7 @@ namespace EduSpider.Repository
var homeWorkModel = new StuHomeWorkRepository().GetStuHomeWorkDetailsListRepository(new CourseQuery()
{
CourseId = item.CourseId,
HomeWorkId = item.HomeWorkId,
Stu_HomeWork_Id = item.HomeWorkId,
StuIds = item.StuUid.ToString()
}).FirstOrDefault();
if (homeWorkModel != null)
......@@ -58,7 +59,6 @@ namespace EduSpider.Repository
{
item.CreateTime = DateTime.Now;
}
// flag = base.Insert(item) > 0;
}
bool flag = BatchInsert(list);
return flag;
......
......@@ -61,6 +61,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Stu_HomeWork_Extend.homework_id), query.HomeWorkId);
}
if (query.Stu_HomeWork_Id > 0)
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Stu_HomeWork_Extend.stu_homework_id), query.Stu_HomeWork_Id);
}
if (!string.IsNullOrEmpty(query.QHomeWorkIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Stu_HomeWork_Extend.homework_id), query.QHomeWorkIds);
......@@ -139,17 +143,7 @@ WHERE 1=1
var First_Stu_HomeWork_Id = firstList.LastOrDefault().Stu_HomeWork_Id;
var tempModel = GetSystemCreateComment(commentList, cItem.course_id, First_Stu_HomeWork_Id);
var firstNum = CreateRandomNum();
var firstStartTime = firstList.LastOrDefault().CreateTime;
var secondModel = homeWorkList.Where(qitem => qitem.RowNum == 6).FirstOrDefault();
if (secondModel != null)
{
var newSeconds = CreateRandomSecondNum(firstStartTime, secondModel.CreateTime);
firstStartTime = firstStartTime.AddSeconds(newSeconds);
}
else
{
firstStartTime = firstStartTime.AddMinutes(firstNum);
}
var firstStartTime = firstList.LastOrDefault().CreateTime.AddSeconds(1);
if (tempModel == null || (tempModel != null && tempModel.Id <= 0))
{
var f_model = new RB_Stu_Comment_Extend()
......@@ -199,17 +193,7 @@ WHERE 1=1
var Second_Stu_HomeWork_Id = secondList.LastOrDefault().Stu_HomeWork_Id;
var secondModel = GetSystemCreateComment(commentList, cItem.course_id, Second_Stu_HomeWork_Id);
var secondNum = CreateRandomNum();
var secondTime = secondList.LastOrDefault().CreateTime;
var thirdModel = homeWorkList.Where(qitem => qitem.RowNum == 10).FirstOrDefault();
if (thirdModel != null)
{
var newSeconds = CreateRandomSecondNum(secondTime, thirdModel.CreateTime);
secondTime = secondTime.AddSeconds(newSeconds);
}
else
{
secondTime = secondTime.AddMinutes(secondNum);
}
var secondTime = secondList.LastOrDefault().CreateTime.AddSeconds(1);
if (secondModel == null || (secondModel != null && secondModel.Id <= 0))
{
......@@ -259,17 +243,8 @@ WHERE 1=1
var Third_Stu_HomeWork_Id = thirdList.LastOrDefault().Stu_HomeWork_Id;
var thirdModel = GetSystemCreateComment(commentList, cItem.course_id, Third_Stu_HomeWork_Id);
var thirdNum = CreateRandomNum();
var thirdTime = thirdList.LastOrDefault().CreateTime;
var fourthModel = homeWorkList.Where(qitem => qitem.RowNum == 14).FirstOrDefault();
if (fourthModel != null)
{
var newSeconds = CreateRandomSecondNum(thirdTime, fourthModel.CreateTime);
thirdTime = thirdTime.AddSeconds(newSeconds);
}
else
{
thirdTime = thirdTime.AddMinutes(thirdNum);
}
var thirdTime = thirdList.LastOrDefault().CreateTime.AddSeconds(1);
if (thirdModel == null || (thirdModel != null && thirdModel.Id <= 0))
{
var t_model = new RB_Stu_Comment_Extend()
......@@ -279,7 +254,7 @@ WHERE 1=1
CourseId = cItem.course_id,
CreateType = 1,
CreateByName = thirdList.LastOrDefault().ThName,
CreateTime = thirdList.LastOrDefault().CreateTime.AddMinutes(thirdNum),
CreateTime = thirdTime,
ShowType = 3,
Details = new List<RB_Stu_CommentDetails>()
};
......@@ -295,7 +270,7 @@ WHERE 1=1
Info = info,
CreateType = 1,
CreateByName = thirdList.LastOrDefault().ThName,
CreateTime = thirdList.LastOrDefault().CreateTime.AddMinutes(thirdNum),
CreateTime = thirdTime,
ShowType = 3,
});
new StuCommentRepository().SetStuCommentRepository(t_model);
......
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