Commit 0c5cfc40 authored by 黄奎's avatar 黄奎

页面修改

parent 5c6c067b
using System; using Edu.Common.Enum.User;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using VT.FW.DB; using VT.FW.DB;
...@@ -40,7 +41,7 @@ namespace Edu.Model.Entity.DataStatistics ...@@ -40,7 +41,7 @@ namespace Edu.Model.Entity.DataStatistics
/// <summary> /// <summary>
/// 考核类型(1-教学主管,2-教务主管) /// 考核类型(1-教学主管,2-教务主管)
/// </summary> /// </summary>
public int CheckType { get; set; } public CheckTypeEnum CheckType { get; set; }
/// <summary> /// <summary>
/// 得分 /// 得分
...@@ -52,5 +53,10 @@ namespace Edu.Model.Entity.DataStatistics ...@@ -52,5 +53,10 @@ namespace Edu.Model.Entity.DataStatistics
/// </summary> /// </summary>
public DateTime CreateTime { get; set; } public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
} }
} }
using Edu.AOP.CustomerAttribute; using Edu.AOP.CustomerAttribute;
using Edu.Common.Enum; using Edu.Common.Enum;
using Edu.Common.Enum.User;
using Edu.Model.CacheModel; using Edu.Model.CacheModel;
using Edu.Model.ViewModel.DataStatistics; using Edu.Model.ViewModel.DataStatistics;
using Edu.Model.ViewModel.User; using Edu.Model.ViewModel.User;
...@@ -265,20 +266,20 @@ namespace Edu.Module.User ...@@ -265,20 +266,20 @@ namespace Edu.Module.User
public object GetTeacherAssessmentModule(int TeacherAccountId, int YearStr , int MonthStr, UserInfo userInfo) public object GetTeacherAssessmentModule(int TeacherAccountId, int YearStr , int MonthStr, UserInfo userInfo)
{ {
object result = new object(); object result = new object();
int CheckType = 0; CheckTypeEnum CheckType = 0;
//获取字典配置的教学主管和教务主管 //获取字典配置的教学主管和教务主管
var dicModel = GetDictValueListModule(userInfo.Group_Id, "TEACHER_ASSESSMENT").FirstOrDefault(); var dicModel = GetDictValueListModule(userInfo.Group_Id, "TEACHER_ASSESSMENT").FirstOrDefault();
if (dicModel != null) if (dicModel != null)
{ {
//教学主管 //教学主管
if (dicModel.Code.Equals(userInfo.Id)) if (dicModel.Code.Equals(userInfo.Id.ToString()))
{ {
CheckType = 1; CheckType = CheckTypeEnum.JiaoXueManager;
} }
//教务主管 //教务主管
if (dicModel.Content.Equals(userInfo.Id)) if (dicModel.Content.Equals(userInfo.Id.ToString()))
{ {
CheckType = 2; CheckType = CheckTypeEnum.JiaoWuManager;
} }
} }
var extModel = teacher_AssessmentRepository.GetTeacherAssessmentEntityRepository(new RB_Teacher_Assessment_Extend() var extModel = teacher_AssessmentRepository.GetTeacherAssessmentEntityRepository(new RB_Teacher_Assessment_Extend()
...@@ -289,7 +290,9 @@ namespace Edu.Module.User ...@@ -289,7 +290,9 @@ namespace Edu.Module.User
}); });
var detailsList = teacher_Assessment_DetailsRepository.GetTeacherAssessmentDetailsListRepository(new RB_Teacher_Assessment_Details_Extend() var detailsList = teacher_Assessment_DetailsRepository.GetTeacherAssessmentDetailsListRepository(new RB_Teacher_Assessment_Details_Extend()
{ {
TeacherAssessmentId = (extModel?.Id ?? 0) TeacherAssessmentId = (extModel?.Id ?? 0),
CreateBy = userInfo.Id,
CheckType = CheckType
}); });
var typeList = GetAssessmentTypeListModule(new RB_Assessment_Type_Extend() { }); var typeList = GetAssessmentTypeListModule(new RB_Assessment_Type_Extend() { });
List<object> list = new List<object>(); List<object> list = new List<object>();
...@@ -298,22 +301,29 @@ namespace Edu.Module.User ...@@ -298,22 +301,29 @@ namespace Edu.Module.User
List<object> subList = new List<object>(); List<object> subList = new List<object>();
foreach (var subItem in item.SubtypeList) foreach (var subItem in item.SubtypeList)
{ {
var tempDetail = detailsList.Where(qitem => qitem.AssessmentTypeId == item.Id && qitem.AssessmentSubTypeId == subItem.Id && qitem.CheckType == CheckType)?.FirstOrDefault();
List<object> optionList = new List<object>(); List<object> optionList = new List<object>();
foreach (var tItem in subItem.OptionList) foreach (var tItem in subItem.OptionList)
{ {
bool IsCheck = false;
if ((tempDetail?.CheckId ?? 0) == tItem.LevelId)
{
IsCheck = true;
}
optionList.Add(new optionList.Add(new
{ {
tItem.LevelId, tItem.LevelId,
tItem.LevelTitle, tItem.LevelTitle,
tItem.LevelDesc, tItem.LevelDesc,
tItem.IsCheck, IsCheck,
tItem.LevelScore, tItem.LevelScore,
}); });
} }
var sObj = new var sObj = new
{ {
CheckId = 0, Id=tempDetail?.Id??0,
CheckScore = 0, CheckId = tempDetail?.CheckId??0,
CheckScore = tempDetail?.CheckScore??0,
AssessmentSubtypeId = subItem.Id, AssessmentSubtypeId = subItem.Id,
subItem.SubTypeName, subItem.SubTypeName,
OptionList = optionList, OptionList = optionList,
......
...@@ -35,6 +35,14 @@ WHERE 1=1 ...@@ -35,6 +35,14 @@ WHERE 1=1
{ {
builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Teacher_Assessment_Details_Extend.TeacherAssessmentId), query.QTeacherAssessmentIds); builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Teacher_Assessment_Details_Extend.TeacherAssessmentId), query.QTeacherAssessmentIds);
} }
if (query.CreateBy > 0)
{
builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Teacher_Assessment_Details_Extend.CreateBy), query.CreateBy);
}
if (query.CheckType > 0)
{
builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Teacher_Assessment_Details_Extend.CheckType), (int)query.CheckType);
}
} }
return Get<RB_Teacher_Assessment_Details_Extend>(builder.ToString()).ToList(); return Get<RB_Teacher_Assessment_Details_Extend>(builder.ToString()).ToList();
} }
......
using Edu.Cache.User; using Edu.Cache.User;
using Edu.Common.API; using Edu.Common.API;
using Edu.Common.Enum.User;
using Edu.Common.Plugin; using Edu.Common.Plugin;
using Edu.Model.ViewModel.DataStatistics; using Edu.Model.ViewModel.DataStatistics;
using Edu.Module.User; using Edu.Module.User;
...@@ -85,7 +86,7 @@ namespace Edu.WebApi.Controllers.DataService ...@@ -85,7 +86,7 @@ namespace Edu.WebApi.Controllers.DataService
JObject sObj = JObject.Parse(subItem.ToString()); JObject sObj = JObject.Parse(subItem.ToString());
subModel.OptionList.Add(new SubtypeItem() subModel.OptionList.Add(new SubtypeItem()
{ {
LevelId= LevelId, LevelId = LevelId,
LevelTitle = sObj.GetStringValue("LevelTitle"), LevelTitle = sObj.GetStringValue("LevelTitle"),
LevelDesc = sObj.GetStringValue("LevelDesc"), LevelDesc = sObj.GetStringValue("LevelDesc"),
LevelScore = sObj.GetDecimal("LevelScore"), LevelScore = sObj.GetDecimal("LevelScore"),
...@@ -215,10 +216,22 @@ namespace Edu.WebApi.Controllers.DataService ...@@ -215,10 +216,22 @@ namespace Edu.WebApi.Controllers.DataService
var model = new RB_Teacher_Assessment_Extend() var model = new RB_Teacher_Assessment_Extend()
{ {
Id = base.ParmJObj.GetInt("Id"), Id = base.ParmJObj.GetInt("Id"),
YearStr=base.ParmJObj.GetInt("YearStr"), YearStr = base.ParmJObj.GetInt("YearStr"),
MonthStr=base.ParmJObj.GetInt("MonthStr"), MonthStr = base.ParmJObj.GetInt("MonthStr"),
TeacherAccountId=base.ParmJObj.GetInt("TeacherAccountId"), TeacherAccountId = base.ParmJObj.GetInt("TeacherAccountId"),
TeacherScore = base.ParmJObj.GetDecimal("TeacherScore"),
JiaoWuScore = base.ParmJObj.GetDecimal("JiaoWuScore"),
}; };
if (model.YearStr <= 0 || model.MonthStr <= 0)
{
return ApiResult.Failed(message: "请选择时间!");
}
if (model.TeacherAccountId <= 0)
{
return ApiResult.Failed(message: "请选择老师!");
}
CheckTypeEnum CheckType = (CheckTypeEnum)base.ParmJObj.GetInt("CheckType");
model.DetailsList = new List<RB_Teacher_Assessment_Details_Extend>(); model.DetailsList = new List<RB_Teacher_Assessment_Details_Extend>();
var detailsLists = base.ParmJObj.GetStringValue("DetailsList"); var detailsLists = base.ParmJObj.GetStringValue("DetailsList");
if (!string.IsNullOrEmpty(detailsLists)) if (!string.IsNullOrEmpty(detailsLists))
...@@ -245,8 +258,9 @@ namespace Edu.WebApi.Controllers.DataService ...@@ -245,8 +258,9 @@ namespace Edu.WebApi.Controllers.DataService
AssessmentSubTypeId = tObj.GetInt("AssessmentSubtypeId"), AssessmentSubTypeId = tObj.GetInt("AssessmentSubtypeId"),
CheckId = tObj.GetInt("CheckId"), CheckId = tObj.GetInt("CheckId"),
CheckScore = tObj.GetDecimal("CheckScore"), CheckScore = tObj.GetDecimal("CheckScore"),
CheckType = base.ParmJObj.GetInt("CheckType"), CheckType = CheckType,
CreateTime = DateTime.Now CreateTime = DateTime.Now,
CreateBy = base.UserInfo.Id,
}; };
model.DetailsList.Add(dModel); model.DetailsList.Add(dModel);
} }
...@@ -255,6 +269,17 @@ namespace Edu.WebApi.Controllers.DataService ...@@ -255,6 +269,17 @@ namespace Edu.WebApi.Controllers.DataService
} }
} }
} }
if (CheckType == CheckTypeEnum.JiaoXueManager)
{
model.TeacherScore = model.DetailsList.Where(qitem => qitem.CheckType == CheckTypeEnum.JiaoXueManager).Sum(qitem => qitem.CheckScore);
}
else if (CheckType == CheckTypeEnum.JiaoWuManager)
{
model.JiaoWuScore = model.DetailsList.Where(qitem => qitem.CheckType == CheckTypeEnum.JiaoWuManager).Sum(qitem => qitem.CheckScore);
}
//总分=(教學主管考核*30%+教务主管考核*70%)
model.TotalScore = model.TeacherScore * Convert.ToDecimal(0.3) + model.JiaoWuScore * Convert.ToDecimal(0.7);
model.Group_Id = base.UserInfo.Group_Id; model.Group_Id = base.UserInfo.Group_Id;
model.School_Id = base.UserInfo.School_Id; model.School_Id = base.UserInfo.School_Id;
model.CreateBy = base.UserInfo.Id; model.CreateBy = base.UserInfo.Id;
...@@ -262,8 +287,6 @@ namespace Edu.WebApi.Controllers.DataService ...@@ -262,8 +287,6 @@ namespace Edu.WebApi.Controllers.DataService
var flag = teacherAssessmentModule.SaveTeacherAssessmentModule(model); var flag = teacherAssessmentModule.SaveTeacherAssessmentModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
#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