Commit f6814fb3 authored by 黄奎's avatar 黄奎

页面修改

parent 40a5745b
......@@ -134,5 +134,10 @@ namespace Edu.Model.ViewModel.Question
/// 开始问题编号
/// </summary>
public int StartId { get; set; }
/// <summary>
/// 排序类型(1-问题编号)
/// </summary>
public int OrderByType { get; set; }
}
}
\ No newline at end of file
......@@ -678,7 +678,7 @@ namespace Edu.Module.Exam
/// 题型数量统计
/// </summary>
/// <param name="query"></param>
public object GetAppQuestionStaticModule(RB_Question_ViewModel query,int StudentId)
public object GetAppQuestionStaticModule(RB_Question_ViewModel query, int StudentId)
{
object obj = new object();
int readingTotalCount = 0;
......@@ -707,7 +707,7 @@ namespace Edu.Module.Exam
var tempListeningList = finishList?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.Listening)?.ToList();
listeningFinishCount = tempListeningList?.Count() ?? 0;
listeningStartId = tempListeningList != null && tempListeningList.Count>0?( tempListeningList?.Max(qitem=>qitem.QuestionId) ?? 0):0;
listeningStartId = tempListeningList != null && tempListeningList.Count > 0 ? (tempListeningList?.Max(qitem => qitem.QuestionId) ?? 0) : 0;
var tempGrammarList = finishList?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseGrammarUse)?.ToList();
grammarFinishCount = tempGrammarList?.Count() ?? 0;
......@@ -762,6 +762,7 @@ namespace Edu.Module.Exam
public List<object> GetAppQuestionCategoryListModule(int pageIndex, int pageSize, out long rowsCount, RB_Question_ViewModel query)
{
List<object> list = new List<object>();
query.OrderByType = 1;
var dataList = questionRepository.GetQuestionPageListRepository(pageIndex, pageSize, out rowsCount, query);
if (dataList != null && dataList.Count > 0)
{
......@@ -769,43 +770,6 @@ namespace Edu.Module.Exam
{
var QuestionContentObj = analysisQuestion.ParsingQuestion(item.QuestionTypeKey, item.QuestionContent);
List<object> quesAnswerList = new List<object>();
//填空题、分录题、资料题
if (item.QuestionTypeKey == "fill-in" || item.QuestionTypeKey == "entry-problem" || item.QuestionTypeKey == "data-question")
{
var tempList = item.Answer.Split('★');
if (tempList != null && tempList.Count() > 0)
{
foreach (var tItem in tempList)
{
quesAnswerList.Add(tItem);
}
}
}
//完型填空
else if (item.QuestionTypeKey == "cloze")
{
if (!string.IsNullOrEmpty(item.Answer.ToString()))
{
try
{
var qAnsList = Common.Plugin.JsonHelper.DeserializeObject<List<SubAnswerItem>>(item.Answer.ToString());
if (qAnsList != null && qAnsList.Count() > 0)
{
foreach (var tItem in qAnsList)
{
quesAnswerList.Add(tItem);
}
}
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetAppQuestionCategoryListModule_Cloze:" + Common.Plugin.JsonHelper.Serialize(item));
}
}
}
else
{
if (!string.IsNullOrEmpty(item.Answer.ToString()))
{
try
......@@ -821,8 +785,7 @@ namespace Edu.Module.Exam
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetAppQuestionCategoryListModule_:" + Common.Plugin.JsonHelper.Serialize(item));
}
Common.Plugin.LogHelper.Write(ex, "GetAppQuestionCategoryListModule_Answer:" + Common.Plugin.JsonHelper.Serialize(item));
}
}
......@@ -832,14 +795,15 @@ namespace Edu.Module.Exam
item.QuestionTypeId,
item.QuestionTypeKey,
item.Category,
LevelType=item.BankType,
LevelType = item.BankType,
item.Title,
item.DifficultyType,
item.DifficultyTypeStr,
item.AnswerParse,
item.Answer,
QuestionContentObj,
QuestionAnswerList = quesAnswerList,
StundetAnswer=new List<string>(),
StundetAnswer = new List<string>(),
};
list.Add(obj);
}
......@@ -865,7 +829,7 @@ namespace Edu.Module.Exam
List<RB_Student_Exam_Extend> stuExamList = new List<RB_Student_Exam_Extend>();
if (!string.IsNullOrEmpty(bankIds))
{
stuExamList= student_ExamRepository.GetStudentExamListRepository(new RB_Student_Exam_Extend()
stuExamList = student_ExamRepository.GetStudentExamListRepository(new RB_Student_Exam_Extend()
{
GroupId = query.Group_Id,
QBankIds = bankIds
......@@ -873,18 +837,18 @@ namespace Edu.Module.Exam
}
foreach (var item in bankList)
{
var tempList = stuExamList?.Where(qitem => qitem.BankId == item.BankId)?.OrderByDescending(qitem=>qitem.Score)?.ToList();
var tempList = stuExamList?.Where(qitem => qitem.BankId == item.BankId)?.OrderByDescending(qitem => qitem.Score)?.ToList();
string LeastTime = "";//最短时间
decimal HighestScore = 0;//最高分
string MyUseTime = "";//用时
decimal MyScore = 0;//得分
int MyRank = 0;//排名
if (tempList != null)
if (tempList != null && tempList.Count > 0)
{
var least = tempList?.OrderBy(qitem => qitem.ExamMinutes)?.FirstOrDefault();
LeastTime = Common.ConvertHelper.CalcMinutesAndSeconds(least.StartTime, least.EndTime);
HighestScore = tempList?.Max(qitem => qitem.Score)??0;
var myLast= tempList?.Where(qitem=>qitem.StudentId==query.StudentId).OrderByDescending(qitem =>qitem.Id)?.FirstOrDefault();
HighestScore = tempList?.Max(qitem => qitem.Score) ?? 0;
var myLast = tempList?.Where(qitem => qitem.StudentId == query.StudentId).OrderByDescending(qitem => qitem.Id)?.FirstOrDefault();
if (myLast != null)
{
MyUseTime = Common.ConvertHelper.CalcMinutesAndSeconds(myLast.StartTime, myLast.EndTime);
......@@ -925,47 +889,17 @@ namespace Edu.Module.Exam
{
foreach (var item in questionList)
{
var QuestionContentObj = analysisQuestion.ParsingQuestion(item.QuestionTypeKey, item.QuestionContent);
List<object> answerList = new List<object>();
var QuestionContentObj = analysisQuestion.ParsingQuestion(item.QuestionTypeKey, item.QuestionContent, isNoAnswer: true);
List<object> quesAnswerList = new List<object>();
//填空题、分录题、资料题
if (item.QuestionTypeKey == "fill-in" || item.QuestionTypeKey == "entry-problem" || item.QuestionTypeKey == "data-question")
{
var tempList = item.Answer.Split('★');
if (tempList != null && tempList.Count() > 0)
{
foreach (var tItem in tempList)
{
answerList.Add(tItem);
}
}
}
//完型填空
else if (item.QuestionTypeKey == "cloze")
{
if (!string.IsNullOrEmpty(item.Answer.ToString()))
{
var qAnsList = Common.Plugin.JsonHelper.DeserializeObject<List<SubAnswerItem>>(item.Answer.ToString());
if (qAnsList != null && qAnsList.Count() > 0)
{
foreach (var tItem in qAnsList)
{
quesAnswerList.Add(tItem);
}
}
}
}
else if (item.QuestionTypeKey == "reading-comprehensio" || item.QuestionTypeKey == "listening")
{
if (!string.IsNullOrEmpty(item.Answer.ToString()))
{
try
{
var tempList = Common.ConvertHelper.StringToFileList(item.Answer);
if (tempList != null && tempList.Count > 0)
var qAnsList = Common.ConvertHelper.StringToFileList(item.Answer.ToString());
if (qAnsList != null && qAnsList.Count() > 0)
{
foreach (var tItem in tempList)
foreach (var tItem in qAnsList)
{
quesAnswerList.Add(tItem);
}
......@@ -973,8 +907,7 @@ namespace Edu.Module.Exam
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetAppBankDetailsPageModule_Item:" + Common.Plugin.JsonHelper.Serialize(item));
}
Common.Plugin.LogHelper.Write(ex, "GetAppBankDetailsPageModule_Answer:" + Common.Plugin.JsonHelper.Serialize(item));
}
}
var obj = new
......@@ -982,13 +915,16 @@ namespace Edu.Module.Exam
item.QuestionId,
item.QuestionTypeId,
item.QuestionTypeKey,
item.Category,
LevelType = item.BankType,
item.Title,
item.DifficultyType,
item.DifficultyTypeStr,
item.AnswerParse,
QuestionContentObj,
QuestionAnswerList = quesAnswerList,
AnswerList = answerList,
StundetAnswer = new List<string>(),
item.Answer,
};
result.Add(obj);
}
......
......@@ -201,7 +201,15 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}>{1} ", nameof(RB_Question_ViewModel.QuestionId), query.StartId);
}
if (query.OrderByType == 1)
{
builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Question_ViewModel.QuestionId));
}
else
{
builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Question_ViewModel.SortNum));
}
return GetPage<RB_Question_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
......
......@@ -51,6 +51,10 @@ WHERE 1=1 ");
builder.AppendFormat(" AND (A.{0} LIKE @BankName OR A.{1} LIKE @BankName)", nameof(RB_Question_Bank_ViewModel.BankName), nameof(RB_Question_Bank_ViewModel.BankNo));
parameters.Add("BankName", "%" + query.BankName.Trim() + "%");
}
if (query.BankType > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Question_Bank_ViewModel.BankType), (int)query.BankType);
}
builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Question_Bank_ViewModel.BankNo));
return GetPage<RB_Question_Bank_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
......
......@@ -24,38 +24,42 @@ namespace Edu.Repository.Sell
/// <returns></returns>
public List<RB_ReturnMoney_Batch_ViewModel> GetPageList(int pageIndex, int pageSize, out long count, int type, string month, int groupId)
{
string sql = $@"select IFNULL(SUM(b.CommissionMoeny),0) as TotalEmployee,IFNULL(SUM(c.CommissionMoeny),0) as TotalCustomer,a.FinanceIds,
IFNULL(SUM(d.CommissionMoeny),0) as TotalInternal,IFNULL(SUM(e.CommissionMoeny),0) as TotalTrans, a.Id,a.BatchName,TotalMoney,a.CreateBy,a.CreateDate,DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%S') as CreateDateStr";
sql += $@" from RB_ReturnMoney_Batch a LEFT JOIN
(SELECT SUM(CommissionMoeny) as CommissionMoeny,BatchId FROM rb_order_returncomission where OrderSourceType=1 and `Status` in(1,2) GROUP BY OrderSourceType) as b
string sql = $@"";
sql += $@" ";
sql += " ";
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT IFNULL(SUM(b.CommissionMoeny),0) as TotalEmployee,IFNULL(SUM(c.CommissionMoeny),0) as TotalCustomer,a.FinanceIds
,IFNULL(SUM(d.CommissionMoeny),0) as TotalInternal,IFNULL(SUM(e.CommissionMoeny),0) as TotalTrans
,a.Id,a.BatchName,TotalMoney,a.CreateBy,a.CreateDate,DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%S') as CreateDateStr
FROM RB_ReturnMoney_Batch a LEFT JOIN
(SELECT SUM(CommissionMoeny) as CommissionMoeny,BatchId FROM rb_order_returncomission where OrderSourceType=1 and `Status` in(1,2) GROUP BY OrderSourceType,BatchId) as b
on a.Id=b.BatchId
LEFT JOIN
(SELECT SUM(CommissionMoeny) as CommissionMoeny,BatchId FROM rb_order_returncomission where OrderSourceType=2 and `Status` in(1,2) GROUP BY OrderSourceType) as c
LEFT JOIN
(SELECT SUM(CommissionMoeny) as CommissionMoeny,BatchId FROM rb_order_returncomission where OrderSourceType=2 and `Status` in(1,2) GROUP BY OrderSourceType,BatchId) as c
on a.Id=c.BatchId
LEFT JOIN
(SELECT SUM(CommissionMoeny) as CommissionMoeny,BatchId FROM rb_order_returncomission where OrderSourceType=3 and `Status` in(1,2) GROUP BY OrderSourceType ) as d
LEFT JOIN
(SELECT SUM(CommissionMoeny) as CommissionMoeny,BatchId FROM rb_order_returncomission where OrderSourceType=3 and `Status` in(1,2) GROUP BY OrderSourceType,BatchId) as d
on a.Id=d.BatchId
LEFT JOIN
(SELECT SUM(CommissionMoeny) as CommissionMoeny,BatchId FROM rb_order_returncomission where OrderSourceType=4 and `Status` in(1,2) GROUP BY OrderSourceType ) as e
on a.Id=e.BatchId ";
sql += " where a.GroupId=@gid";
DynamicParameters parameters = new DynamicParameters();
parameters.Add("gid", groupId);
LEFT JOIN
(SELECT SUM(CommissionMoeny) as CommissionMoeny,BatchId FROM rb_order_returncomission where OrderSourceType=4 and `Status` in(1,2) GROUP BY OrderSourceType,BatchId) as e
on a.Id=e.BatchId
WHERE 1=1
");
if (groupId > 0)
{
builder.AppendFormat(" AND a.GroupId={0} ", groupId);
}
if (!string.IsNullOrEmpty(month))
{
sql += " and DATE_FORMAT(a.CreateDate,'%Y-%m')=@month";
parameters.Add("month", month);
builder.AppendFormat(" AND DATE_FORMAT(a.CreateDate,'%Y-%m')=DATE_FORMAT('{0}-01','%Y-%m')", month);
}
if (type != 0)
{
sql += " and a.CommissionType=@type";
parameters.Add("type", type);
builder.AppendFormat(" and a.CommissionType={0} ", type);
}
sql += " order by a.CreateDate desc";
return GetPage<RB_ReturnMoney_Batch_ViewModel>(pageIndex, pageSize, out count, sql, parameters).ToList();
builder.Append(" order by a.CreateDate desc ");
return GetPage<RB_ReturnMoney_Batch_ViewModel>(pageIndex, pageSize, out count, builder.ToString()).ToList();
}
/// <summary>
......
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