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
CheckType = CheckType
});
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>();
foreach (var item in typeList)
......@@ -402,6 +429,32 @@ namespace Edu.Module.User
TeacherAssessmentId = (extModel?.Id ?? 0),
});
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>();
DateTime? S_JiaoWu_Time = null;
DateTime? S_JiaoXue_Time = null;
......
......@@ -42,7 +42,77 @@ namespace Edu.WebApi.Controllers.DataService
};
query.Group_Id = base.UserInfo.Group_Id;
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>
......@@ -195,7 +265,7 @@ namespace Edu.WebApi.Controllers.DataService
item.Other,
TeacherSignDate = Common.ConvertHelper.FormatTime(item.TeacherSignDate),
item.AuditStatus,
AuditStatusName=item.AuditStatus.ToName(),
AuditStatusName = item.AuditStatus.ToName(),
item.IsTeacherFinish,
item.IsJiaoWuFinish,
});
......@@ -216,7 +286,7 @@ namespace Edu.WebApi.Controllers.DataService
int YearStr = base.ParmJObj.GetInt("YearStr");
int MonthStr = base.ParmJObj.GetInt("MonthStr");
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);
}
......@@ -227,7 +297,6 @@ namespace Edu.WebApi.Controllers.DataService
[HttpPost]
public ApiResult GetTeacherAssessmentDetail()
{
int Id = base.ParmJObj.GetInt("Id");
var model = teacherAssessmentModule.GetTeacherAssessmentDetailModule(Id);
return ApiResult.Success(data: model);
......@@ -377,7 +446,7 @@ namespace Edu.WebApi.Controllers.DataService
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);
}
#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