Commit 1651da2e authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents 82d79b2b 7f84fccd
...@@ -319,6 +319,33 @@ namespace Edu.Module.User ...@@ -319,6 +319,33 @@ namespace Edu.Module.User
CheckType = CheckType CheckType = CheckType
}); });
var typeList = GetAssessmentTypeListModule(new RB_Assessment_Type_Extend() { }); var typeList = GetAssessmentTypeListModule(new RB_Assessment_Type_Extend() { });
var maxOptionList = new List<SubtypeItem>();
int maxLength = 0;
foreach (var item in typeList)
{
item.SubtypeList.ForEach(subItem =>
{
if (subItem.OptionList.Count > maxLength)
{
maxOptionList = subItem.OptionList;
maxLength = subItem.OptionList.Count;
}
});
}
foreach (var item in typeList)
{
item.SubtypeList.ForEach(subItem =>
{
if (subItem.OptionList.Count < maxOptionList.Count)
{
for (var j = subItem.OptionList.Count; j < maxOptionList.Count; j++)
{
subItem.OptionList.Add(new SubtypeItem());
}
}
});
}
List<object> list = new List<object>(); List<object> list = new List<object>();
foreach (var item in typeList) foreach (var item in typeList)
...@@ -402,6 +429,32 @@ namespace Edu.Module.User ...@@ -402,6 +429,32 @@ namespace Edu.Module.User
TeacherAssessmentId = (extModel?.Id ?? 0), TeacherAssessmentId = (extModel?.Id ?? 0),
}); });
var typeList = GetAssessmentTypeListModule(new RB_Assessment_Type_Extend() { }); var typeList = GetAssessmentTypeListModule(new RB_Assessment_Type_Extend() { });
var maxOptionList = new List<SubtypeItem>();
int maxLength = 0;
foreach (var item in typeList)
{
item.SubtypeList.ForEach(subItem =>
{
if (subItem.OptionList.Count > maxLength)
{
maxOptionList = subItem.OptionList;
maxLength = subItem.OptionList.Count;
}
});
}
foreach (var item in typeList)
{
item.SubtypeList.ForEach(subItem =>
{
if (subItem.OptionList.Count < maxOptionList.Count)
{
for (var j = subItem.OptionList.Count; j < maxOptionList.Count; j++)
{
subItem.OptionList.Add(new SubtypeItem());
}
}
});
}
List<object> list = new List<object>(); List<object> list = new List<object>();
DateTime? S_JiaoWu_Time = null; DateTime? S_JiaoWu_Time = null;
DateTime? S_JiaoXue_Time = null; DateTime? S_JiaoXue_Time = null;
......
...@@ -42,7 +42,77 @@ namespace Edu.WebApi.Controllers.DataService ...@@ -42,7 +42,77 @@ namespace Edu.WebApi.Controllers.DataService
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
var result = teacherAssessmentModule.GetAssessmentTypeListModule(query); var result = teacherAssessmentModule.GetAssessmentTypeListModule(query);
return ApiResult.Success(data: result); List<object> list = new List<object>();
List<object> header = new List<object>();
header.Add(new
{
name = "TypeName",
label = "类别",
field = "TypeName",
align = "left"
});
header.Add(new
{
name = "SubtypeList",
label = "内容",
field = "SubtypeList",
align = "left"
});
if (result != null && result.Count > 0)
{
var optionList = new List<SubtypeItem>();
int maxLength = 0;
foreach (var item in result)
{
item.SubtypeList.ForEach(subItem =>
{
if (subItem.OptionList.Count > maxLength)
{
optionList = subItem.OptionList;
maxLength = subItem.OptionList.Count;
}
});
}
//添加表头
foreach (var hItem in optionList)
{
header.Add(new
{
name = hItem.LevelTitle,
label = hItem.LevelTitle,
field = hItem.LevelTitle,
align = "left"
});
}
foreach (var item in result)
{
item.SubtypeList.ForEach(subItem =>
{
if (subItem.OptionList.Count < optionList.Count)
{
for (var j = subItem.OptionList.Count; j < optionList.Count; j++)
{
subItem.OptionList.Add(new SubtypeItem());
}
}
});
}
header.Add(new
{
name = "Id",
label = "操作",
field = "Id"
});
}
return ApiResult.Success(data: new
{
header,
result
});
} }
/// <summary> /// <summary>
...@@ -195,7 +265,7 @@ namespace Edu.WebApi.Controllers.DataService ...@@ -195,7 +265,7 @@ namespace Edu.WebApi.Controllers.DataService
item.Other, item.Other,
TeacherSignDate = Common.ConvertHelper.FormatTime(item.TeacherSignDate), TeacherSignDate = Common.ConvertHelper.FormatTime(item.TeacherSignDate),
item.AuditStatus, item.AuditStatus,
AuditStatusName=item.AuditStatus.ToName(), AuditStatusName = item.AuditStatus.ToName(),
item.IsTeacherFinish, item.IsTeacherFinish,
item.IsJiaoWuFinish, item.IsJiaoWuFinish,
}); });
...@@ -216,7 +286,7 @@ namespace Edu.WebApi.Controllers.DataService ...@@ -216,7 +286,7 @@ namespace Edu.WebApi.Controllers.DataService
int YearStr = base.ParmJObj.GetInt("YearStr"); int YearStr = base.ParmJObj.GetInt("YearStr");
int MonthStr = base.ParmJObj.GetInt("MonthStr"); int MonthStr = base.ParmJObj.GetInt("MonthStr");
int Id = base.ParmJObj.GetInt("Id"); int Id = base.ParmJObj.GetInt("Id");
var obj = teacherAssessmentModule.GetTeacherAssessmentModule(Id,TeacherAccountId, YearStr, MonthStr, base.UserInfo); var obj = teacherAssessmentModule.GetTeacherAssessmentModule(Id, TeacherAccountId, YearStr, MonthStr, base.UserInfo);
return ApiResult.Success(data: obj); return ApiResult.Success(data: obj);
} }
...@@ -227,7 +297,6 @@ namespace Edu.WebApi.Controllers.DataService ...@@ -227,7 +297,6 @@ namespace Edu.WebApi.Controllers.DataService
[HttpPost] [HttpPost]
public ApiResult GetTeacherAssessmentDetail() public ApiResult GetTeacherAssessmentDetail()
{ {
int Id = base.ParmJObj.GetInt("Id"); int Id = base.ParmJObj.GetInt("Id");
var model = teacherAssessmentModule.GetTeacherAssessmentDetailModule(Id); var model = teacherAssessmentModule.GetTeacherAssessmentDetailModule(Id);
return ApiResult.Success(data: model); return ApiResult.Success(data: model);
...@@ -377,7 +446,7 @@ namespace Edu.WebApi.Controllers.DataService ...@@ -377,7 +446,7 @@ namespace Edu.WebApi.Controllers.DataService
Id = base.ParmJObj.GetInt("Id"), Id = base.ParmJObj.GetInt("Id"),
}; };
bool flag = teacherAssessmentModule.SubmitTeacherAssessmentApprovalModule(base.UserInfo, model.Id,out string message); bool flag = teacherAssessmentModule.SubmitTeacherAssessmentApprovalModule(base.UserInfo, model.Id, out string message);
return flag ? ApiResult.Success() : ApiResult.Failed(message: message); return flag ? ApiResult.Success() : ApiResult.Failed(message: message);
} }
#endregion #endregion
......
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