Commit ffcc290d authored by 黄奎's avatar 黄奎

页面修改

parent a4517729
......@@ -14,5 +14,15 @@ namespace Edu.Model.ViewModel.User
/// 显示月份字符串
/// </summary>
public string ShowMonthStr { get; set; }
/// <summary>
/// 教师编号
/// </summary>
public string QTeacherIds { get; set; }
/// <summary>
/// 部门编号
/// </summary>
public int DeptId { get; set; }
}
}
......@@ -80,6 +80,11 @@ namespace Edu.Model.ViewModel.User
/// </summary>
public string QTIds { get; set; }
/// <summary>
/// 不查询老师
/// </summary>
public string NotQueryTIds { get; set; }
/// <summary>
/// 对应账号id
/// </summary>
......
......@@ -39,7 +39,19 @@ namespace Edu.Module.User
});
foreach (var item in list)
{
item.SubtypeList = subList?.Where(qitem => qitem.AssessmentTypeId == item.Id)?.ToList() ?? new List<RB_Assessment_Subtype_Extend>();
var tempList= subList?.Where(qitem => qitem.AssessmentTypeId == item.Id)?.ToList() ?? new List<RB_Assessment_Subtype_Extend>();
if (tempList != null && tempList.Count > 0)
{
foreach (var subItem in tempList)
{
subItem.OptionList = new List<SubtypeItem>();
if (!string.IsNullOrEmpty(subItem.Options))
{
subItem.OptionList = Common.Plugin.JsonHelper.DeserializeObject<List<SubtypeItem>>(subItem.Options);
}
}
}
item.SubtypeList = tempList;
}
}
return list;
......@@ -70,6 +82,38 @@ namespace Edu.Module.User
model.Id = newId;
flag = newId > 0;
}
if (model.SubtypeList != null)
{
foreach (var subItem in model.SubtypeList)
{
subItem.Group_Id = model.Group_Id;
subItem.AssessmentTypeId = model.Id;
subItem.CreateBy = model.CreateBy;
subItem.CreateTime = model.CreateTime;
subItem.UpdateBy = model.UpdateBy;
subItem.UpdateTime = model.UpdateTime;
subItem.Status = DateStateEnum.Normal;
if (subItem.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Assessment_Subtype_Extend.SubTypeName),subItem.SubTypeName },
{nameof(RB_Assessment_Subtype_Extend.Options),subItem.Options },
{nameof(RB_Assessment_Subtype_Extend.UpdateBy),subItem.UpdateBy },
{nameof(RB_Assessment_Subtype_Extend.UpdateTime),subItem.UpdateTime },
{nameof(RB_Assessment_Subtype_Extend.SortNum),subItem.SortNum },
};
flag = assessment_SubtypeRepository.Update(fileds, new WhereHelper(nameof(RB_Assessment_Subtype_Extend.Id), subItem.Id));
}
else
{
var newId = assessment_SubtypeRepository.Insert(subItem);
model.Id = newId;
flag = newId > 0;
}
}
}
return flag;
}
......@@ -83,7 +127,19 @@ namespace Edu.Module.User
var extModel = assessment_TypeRepository.GetEntity<RB_Assessment_Type_Extend>(Id);
if (extModel != null)
{
extModel.SubtypeList = GetAssessmentSubtypeListModule(new RB_Assessment_Subtype_Extend() { AssessmentTypeId = extModel.Id });
var subList= GetAssessmentSubtypeListModule(new RB_Assessment_Subtype_Extend() { AssessmentTypeId = extModel.Id });
if (subList != null && subList.Count > 0)
{
foreach (var subItem in subList)
{
subItem.OptionList = new List<SubtypeItem>();
if (!string.IsNullOrEmpty(subItem.Options))
{
subItem.OptionList = Common.Plugin.JsonHelper.DeserializeObject<List<SubtypeItem>>(subItem.Options);
}
}
}
extModel.SubtypeList = subList;
}
return extModel;
}
......@@ -114,34 +170,6 @@ namespace Edu.Module.User
return subList;
}
/// <summary>
/// 新增修改老师考评子类型配置
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetAssessmentSubtypeModule(RB_Assessment_Subtype_Extend model)
{
bool flag = false;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Assessment_Subtype_Extend.SubTypeName),model.SubTypeName },
{nameof(RB_Assessment_Subtype_Extend.Options),model.Options },
{nameof(RB_Assessment_Subtype_Extend.UpdateBy),model.UpdateBy },
{nameof(RB_Assessment_Subtype_Extend.UpdateTime),model.UpdateTime },
{nameof(RB_Assessment_Subtype_Extend.SortNum),model.SortNum },
};
flag = assessment_SubtypeRepository.Update(fileds, new WhereHelper(nameof(RB_Assessment_Subtype_Extend.Id), model.Id));
}
else
{
var newId = assessment_SubtypeRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 根据编号获取老师考评子类型配置
......
......@@ -30,6 +30,24 @@ namespace Edu.Module.User
/// <returns></returns>
public List<object> GetTeacherStaticListModule(RB_Teacher_Static_Extend query)
{
var teacherList = new List<RB_Account_ViewModel>();
var queryTeacher = new RB_Account_ViewModel() { AccountType = Common.Enum.User.AccountTypeEnum.Teacher };
if (query.DeptId > 0)
{
queryTeacher.Dept_Id = query.DeptId;
teacherList = accountRepository.GetAccountListExtRepository(queryTeacher);
query.QTeacherIds = string.Join(",", teacherList.Select(qitem => qitem.AccountId));
}
else
{
teacherList = accountRepository.GetAccountListExtRepository(queryTeacher);
query.QTeacherIds = "";
}
int teacherCount = 1;
if (teacherList != null && teacherList.Count > 0)
{
teacherCount = teacherList.Count;
}
List<object> dataList = new List<object>();
var list = teacher_StaticRepository.GetTeacherStaticListRepository(query);
if (list != null && list.Count > 0)
......@@ -262,6 +280,14 @@ namespace Edu.Module.User
MiniAppTimeScore = (item.MiniAppTimeScore - firstModel.MiniAppTimeScore) / firstModel.MiniAppTimeScore * 100;
}
decimal ActivityNum = 0;
if (firstModel.ActivityNum > 0)
{
ActivityNum = (item.ActivityNum - firstModel.ActivityNum) / firstModel.ActivityNum * 100;
}
decimal TotalScore = 0;
if (firstModel.TotalScore > 0)
{
......@@ -280,12 +306,450 @@ namespace Edu.Module.User
ScoreGap = (item.ScoreGap - firstModel.ScoreGap) / firstModel.ScoreGap * 100;
}
subObj = new
{
Id = 0,
DateStr = "环比成长",
StudentCount = Math.Round(StudentCount, 2) + "%",
AttendClassHour = Math.Round(AttendClassHour, 2) + "%",
AttendClassHourScore = Math.Round(AttendClassHourScore, 2) + "%",
OnLineInteractive = Math.Round(OnLineInteractive, 2) + "%",
OnLineInteractiveScore = Math.Round(OnLineInteractiveScore, 2) + "%",
Renew = Math.Round(Renew, 2) + "%",
RenewScore = Math.Round(RenewScore, 2) + "%",
Upgrade = Math.Round(Upgrade, 2) + "%",
UpgradeScore = Math.Round(UpgradeScore, 2) + "%",
Trans = Math.Round(Trans, 2) + "%",
TransScore = Math.Round(TransScore, 2) + "%",
TrialSpeak = Math.Round(TrialSpeak, 2) + "%",
TrialSpeakScore = Math.Round(TrialSpeakScore, 2) + "%",
Truancy = Math.Round(Truancy, 2) + "%",
TruancyScore = Math.Round(TruancyScore, 2) + "%",
Withdraws = Math.Round(Withdraws, 2) + "%",
WithdrawsScore = Math.Round(WithdrawsScore, 2) + "%",
Complaint = Math.Round(Complaint, 2) + "%",
ComplaintScore = Math.Round(ComplaintScore, 2) + "%",
TeacherBeLate = Math.Round(TeacherBeLate, 2) + "%",
TeacherBeLateScore = Math.Round(TeacherBeLateScore, 2) + "%",
N5ClassHours = Math.Round(N5ClassHours, 2) + "%",
N5ClassHoursScore = Math.Round(N5ClassHoursScore, 2) + "%",
N4ClassHours = Math.Round(N4ClassHours, 2) + "%",
N4ClassHoursScore = Math.Round(N4ClassHoursScore, 2) + "%",
N3ClassHours = Math.Round(N3ClassHours, 2) + "%",
N3ClassHoursScore = Math.Round(N3ClassHoursScore, 2) + "%",
N2ClassHours = Math.Round(N2ClassHours, 2) + "%",
N2ClassHoursScore = Math.Round(N2ClassHoursScore, 2) + "%",
N1ClassHours = Math.Round(N1ClassHours, 2) + "%",
N1ClassHoursScore = Math.Round(N1ClassHoursScore, 2) + "%",
MiniAppPractise = Math.Round(MiniAppPractise, 2) + "%",
MiniAppPractiseScore = Math.Round(MiniAppPractiseScore, 2) + "%",
MiniAppTime = Math.Round(MiniAppTime, 2) + "%",
MiniAppTimeScore = Math.Round(MiniAppTimeScore, 2) + "%",
TotalScore = Math.Round(TotalScore, 2) + "%",
AvgScore = Math.Round(AvgScore, 2) + "%",
ScoreGap = Math.Round(ScoreGap, 2) + "%",
ActivityNum = Math.Round(ActivityNum, 2) + "%",
};
}
firstModel = item;
firstModel.TotalScore = (firstModel.StudentCount + firstModel.AttendClassHourScore + firstModel.OnLineInteractiveScore + firstModel.RenewScore
+ firstModel.UpgradeScore + firstModel.TransScore + firstModel.TrialSpeakScore - firstModel.TruancyScore - firstModel.WithdrawsScore - firstModel.ComplaintScore
- firstModel.TeacherBeLateScore + firstModel.N2ClassHoursScore + firstModel.N1ClassHoursScore + firstModel.MiniAppPractiseScore + firstModel.MiniAppTimeScore
+ firstModel.ActivityNum
);
firstModel.AvgScore = Math.Round(firstModel.TotalScore / teacherCount, 2);
firstModel.ScoreGap = firstModel.TotalScore - firstModel.AvgScore;
index++;
}
item.TotalScore = (item.StudentCount + item.AttendClassHourScore + item.OnLineInteractiveScore + item.RenewScore
+ item.UpgradeScore + item.TransScore + item.TrialSpeakScore - item.TruancyScore - item.WithdrawsScore - item.ComplaintScore
- item.TeacherBeLateScore + item.N2ClassHoursScore + item.N1ClassHoursScore + item.MiniAppPractiseScore + item.MiniAppTimeScore
+ item.ActivityNum
);
item.AvgScore = Math.Round(item.TotalScore / teacherCount, 2);
item.ScoreGap = item.TotalScore - item.AvgScore;
dataList.Add(new
{
item.Id,
DateStr,
item.StudentCount,
item.AttendClassHour,
item.AttendClassHourScore,
item.OnLineInteractive,
item.OnLineInteractiveScore,
item.Renew,
item.RenewScore,
item.Upgrade,
item.UpgradeScore,
item.Trans,
item.TransScore,
item.TrialSpeak,
item.TrialSpeakScore,
item.Truancy,
item.TruancyScore,
item.Withdraws,
item.WithdrawsScore,
item.Complaint,
item.ComplaintScore,
item.TeacherBeLate,
item.TeacherBeLateScore,
item.N5ClassHours,
item.N5ClassHoursScore,
item.N4ClassHours,
item.N4ClassHoursScore,
item.N3ClassHours,
item.N3ClassHoursScore,
item.N2ClassHours,
item.N2ClassHoursScore,
item.N1ClassHours,
item.N1ClassHoursScore,
item.MiniAppPractise,
item.MiniAppPractiseScore,
item.MiniAppTime,
item.MiniAppTimeScore,
item.TotalScore,
item.AvgScore,
item.ScoreGap,
item.ActivityNum,
});
if (DateStr.Contains("总数") && index > 1)
{
dataList.Add(subObj);
}
}
var tempList = list?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
dataList.Add(new
{
Id = 0,
DateStr = "月总数",
StudentCount = tempList?.Sum(qitem => qitem.StudentCount),
AttendClassHour = tempList?.Sum(qitem => qitem.AttendClassHour),
AttendClassHourScore = tempList?.Sum(qitem => qitem.AttendClassHourScore),
OnLineInteractive = tempList?.Sum(qitem => qitem.OnLineInteractive),
OnLineInteractiveScore = tempList?.Sum(qitem => qitem.OnLineInteractiveScore),
Renew = tempList?.Sum(qitem => qitem.Renew),
RenewScore = tempList?.Sum(qitem => qitem.RenewScore),
Upgrade = tempList?.Sum(qitem => qitem.Upgrade),
UpgradeScore = tempList?.Sum(qitem => qitem.UpgradeScore),
Trans = tempList?.Sum(qitem => qitem.Trans),
TransScore = tempList?.Sum(qitem => qitem.TransScore),
TrialSpeak = tempList?.Sum(qitem => qitem.TrialSpeak),
TrialSpeakScore = tempList?.Sum(qitem => qitem.TrialSpeakScore),
Truancy = tempList?.Sum(qitem => qitem.Truancy),
TruancyScore = tempList?.Sum(qitem => qitem.TruancyScore),
Withdraws = tempList?.Sum(qitem => qitem.Withdraws),
WithdrawsScore = tempList?.Sum(qitem => qitem.WithdrawsScore),
Complaint = tempList?.Sum(qitem => qitem.Complaint),
ComplaintScore = tempList?.Sum(qitem => qitem.ComplaintScore),
TeacherBeLate = tempList?.Sum(qitem => qitem.TeacherBeLate),
TeacherBeLateScore = tempList?.Sum(qitem => qitem.TeacherBeLateScore),
N5ClassHours = tempList?.Sum(qitem => qitem.N5ClassHours),
N5ClassHoursScore = tempList?.Sum(qitem => qitem.N5ClassHoursScore),
N4ClassHours = tempList?.Sum(qitem => qitem.N4ClassHours),
N4ClassHoursScore = tempList?.Sum(qitem => qitem.N4ClassHoursScore),
N3ClassHours = tempList?.Sum(qitem => qitem.N3ClassHours),
N3ClassHoursScore = tempList?.Sum(qitem => qitem.N3ClassHoursScore),
N2ClassHours = tempList?.Sum(qitem => qitem.N2ClassHours),
N2ClassHoursScore = tempList?.Sum(qitem => qitem.N2ClassHoursScore),
N1ClassHours = tempList?.Sum(qitem => qitem.N1ClassHours),
N1ClassHoursScore = tempList?.Sum(qitem => qitem.N1ClassHoursScore),
MiniAppPractise = tempList?.Sum(qitem => qitem.MiniAppPractise),
MiniAppPractiseScore = tempList?.Sum(qitem => qitem.MiniAppPractiseScore),
MiniAppTime = tempList?.Sum(qitem => qitem.MiniAppTime),
MiniAppTimeScore = tempList?.Sum(qitem => qitem.MiniAppTimeScore),
TotalScore = tempList?.Sum(qitem => qitem.TotalScore),
AvgScore = tempList?.Sum(qitem => qitem.AvgScore),
ScoreGap = tempList?.Sum(qitem => qitem.ScoreGap),
ActivityNum = tempList?.Sum(qitem => qitem.ActivityNum),
});
}
return dataList;
}
/// <summary>
/// 教师行为月份统计
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<object> GetTeacherStaticMonthExtListModule(RB_Teacher_Static_Extend query)
{
var teacherList = new List<RB_Account_ViewModel>();
var queryTeacher = new RB_Account_ViewModel() { AccountType = Common.Enum.User.AccountTypeEnum.Teacher };
if (query.DeptId > 0)
{
queryTeacher.Dept_Id = query.DeptId;
teacherList = accountRepository.GetAccountListExtRepository(queryTeacher);
query.QTeacherIds = string.Join(",", teacherList.Select(qitem => qitem.AccountId));
}
else
{
teacherList = accountRepository.GetAccountListExtRepository(queryTeacher);
query.QTeacherIds = "";
}
int teacherCount = 1;
if (teacherList != null && teacherList.Count > 0)
{
teacherCount = teacherList.Count;
}
List<object> dataList = new List<object>();
var list = teacher_StaticRepository.GetTeacherStaticMonthExtListRepository(query);
if (list != null && list.Count > 0)
{
int index = 0;
var firstModel = new RB_Teacher_Static_Extend();
foreach (var item in list)
{
string DateStr = Common.ConvertHelper.FormatMonthDay(item.Date);
object subObj = new object();
if (string.IsNullOrEmpty(DateStr))
{
if (index == 0)
{
DateStr = "上期总数";
}
else
{
DateStr = "总数";
}
if (index > 0)
{
decimal StudentCount = 0;
if (firstModel.StudentCount > 0)
{
StudentCount = (item.StudentCount - firstModel.StudentCount) / firstModel.StudentCount * 100;
}
decimal AttendClassHour = 0;
if (firstModel.AttendClassHour > 0)
{
AttendClassHour = (item.AttendClassHour - firstModel.AttendClassHour) / firstModel.AttendClassHour * 100;
}
decimal AttendClassHourScore = 0;
if (firstModel.AttendClassHourScore > 0)
{
AttendClassHourScore = (item.AttendClassHourScore - firstModel.AttendClassHourScore) / firstModel.AttendClassHourScore * 100;
}
decimal OnLineInteractive = 0;
if (firstModel.OnLineInteractive > 0)
{
OnLineInteractive = (item.OnLineInteractive - firstModel.OnLineInteractive) / firstModel.OnLineInteractive * 100;
}
decimal OnLineInteractiveScore = 0;
if (firstModel.OnLineInteractiveScore > 0)
{
OnLineInteractiveScore = (item.OnLineInteractiveScore - firstModel.OnLineInteractiveScore) / firstModel.OnLineInteractiveScore * 100;
}
decimal Renew = 0;
if (firstModel.Renew > 0)
{
Renew = (item.Renew - firstModel.Renew) / firstModel.Renew * 100;
}
decimal RenewScore = 0;
if (firstModel.RenewScore > 0)
{
RenewScore = (item.RenewScore - firstModel.RenewScore) / firstModel.RenewScore * 100;
}
decimal Upgrade = 0;
if (firstModel.Upgrade > 0)
{
Upgrade = (item.Upgrade - firstModel.Upgrade) / firstModel.Upgrade * 100;
}
decimal UpgradeScore = 0;
if (firstModel.UpgradeScore > 0)
{
UpgradeScore = (item.UpgradeScore - firstModel.UpgradeScore) / firstModel.UpgradeScore * 100;
}
decimal Trans = 0;
if (firstModel.Trans > 0)
{
Trans = (item.Trans - firstModel.Trans) / firstModel.Trans * 100;
}
decimal TransScore = 0;
if (firstModel.TransScore > 0)
{
TransScore = (item.TransScore - firstModel.TransScore) / firstModel.TransScore * 100;
}
decimal TrialSpeak = 0;
if (firstModel.TrialSpeak > 0)
{
TrialSpeak = (item.TrialSpeak - firstModel.TrialSpeak) / firstModel.TrialSpeak * 100;
}
decimal TrialSpeakScore = 0;
if (firstModel.TrialSpeakScore > 0)
{
TrialSpeakScore = (item.TrialSpeakScore - firstModel.TrialSpeakScore) / firstModel.TrialSpeakScore * 100;
}
decimal Truancy = 0;
if (firstModel.Truancy > 0)
{
Truancy = (item.Truancy - firstModel.Truancy) / firstModel.Truancy * 100;
}
decimal TruancyScore = 0;
if (firstModel.TruancyScore > 0)
{
TruancyScore = (item.TruancyScore - firstModel.TruancyScore) / firstModel.TruancyScore * 100;
}
decimal Withdraws = 0;
if (firstModel.Withdraws > 0)
{
Withdraws = (item.Withdraws - firstModel.Withdraws) / firstModel.Withdraws * 100;
}
decimal WithdrawsScore = 0;
if (firstModel.WithdrawsScore > 0)
{
WithdrawsScore = (item.WithdrawsScore - firstModel.WithdrawsScore) / firstModel.WithdrawsScore * 100;
}
decimal Complaint = 0;
if (firstModel.Complaint > 0)
{
Complaint = (item.Complaint - firstModel.Complaint) / firstModel.Complaint * 100;
}
decimal ComplaintScore = 0;
if (firstModel.ComplaintScore > 0)
{
ComplaintScore = (item.ComplaintScore - firstModel.ComplaintScore) / firstModel.ComplaintScore * 100;
}
decimal TeacherBeLate = 0;
if (firstModel.TeacherBeLate > 0)
{
TeacherBeLate = (item.TeacherBeLate - firstModel.TeacherBeLate) / firstModel.TeacherBeLate * 100;
}
decimal TeacherBeLateScore = 0;
if (firstModel.TeacherBeLateScore > 0)
{
TeacherBeLateScore = (item.TeacherBeLateScore - firstModel.TeacherBeLateScore) / firstModel.TeacherBeLateScore * 100;
}
decimal N5ClassHours = 0;
if (firstModel.N5ClassHours > 0)
{
N5ClassHours = (item.N5ClassHours - firstModel.N5ClassHours) / firstModel.N5ClassHours * 100;
}
decimal N5ClassHoursScore = 0;
if (firstModel.N5ClassHoursScore > 0)
{
N5ClassHoursScore = (item.N5ClassHoursScore - firstModel.N5ClassHoursScore) / firstModel.N5ClassHoursScore * 100;
}
decimal N4ClassHours = 0;
if (firstModel.N4ClassHours > 0)
{
N4ClassHours = (item.N4ClassHours - firstModel.N4ClassHours) / firstModel.N4ClassHours * 100;
}
decimal N4ClassHoursScore = 0;
if (firstModel.N4ClassHoursScore > 0)
{
N4ClassHoursScore = (item.N4ClassHoursScore - firstModel.N4ClassHoursScore) / firstModel.N4ClassHoursScore * 100;
}
decimal N3ClassHours = 0;
if (firstModel.N3ClassHours > 0)
{
N3ClassHours = (item.N3ClassHours - firstModel.N3ClassHours) / firstModel.N3ClassHours * 100;
}
decimal N3ClassHoursScore = 0;
if (firstModel.N3ClassHoursScore > 0)
{
N3ClassHoursScore = (item.N3ClassHoursScore - firstModel.N3ClassHoursScore) / firstModel.N3ClassHoursScore * 100;
}
decimal N2ClassHours = 0;
if (firstModel.N2ClassHours > 0)
{
N2ClassHours = (item.N2ClassHours - firstModel.N2ClassHours) / firstModel.N2ClassHours * 100;
}
decimal N2ClassHoursScore = 0;
if (firstModel.N2ClassHoursScore > 0)
{
N2ClassHoursScore = (item.N2ClassHoursScore - firstModel.N2ClassHoursScore) / firstModel.N2ClassHoursScore * 100;
}
decimal N1ClassHours = 0;
if (firstModel.N1ClassHours > 0)
{
N1ClassHours = (item.N1ClassHours - firstModel.N1ClassHours) / firstModel.N1ClassHours * 100;
}
decimal N1ClassHoursScore = 0;
if (firstModel.N1ClassHoursScore > 0)
{
N1ClassHoursScore = (item.N1ClassHoursScore - firstModel.N1ClassHoursScore) / firstModel.N1ClassHoursScore * 100;
}
decimal MiniAppPractise = 0;
if (firstModel.MiniAppPractise > 0)
{
MiniAppPractise = (item.MiniAppPractise - firstModel.MiniAppPractise) / firstModel.MiniAppPractise * 100;
}
decimal MiniAppPractiseScore = 0;
if (firstModel.MiniAppPractiseScore > 0)
{
MiniAppPractiseScore = (item.MiniAppPractiseScore - firstModel.MiniAppPractiseScore) / firstModel.MiniAppPractiseScore * 100;
}
decimal MiniAppTime = 0;
if (firstModel.MiniAppTime > 0)
{
MiniAppTime = (item.MiniAppTime - firstModel.MiniAppTime) / firstModel.MiniAppTime * 100;
}
decimal MiniAppTimeScore = 0;
if (firstModel.MiniAppTimeScore > 0)
{
MiniAppTimeScore = (item.MiniAppTimeScore - firstModel.MiniAppTimeScore) / firstModel.MiniAppTimeScore * 100;
}
decimal ActivityNum = 0;
if (firstModel.ActivityNum > 0)
{
ActivityNum = (item.ActivityNum - firstModel.ActivityNum) / firstModel.ActivityNum * 100;
}
decimal TotalScore = 0;
if (firstModel.TotalScore > 0)
{
TotalScore = (item.TotalScore - firstModel.TotalScore) / firstModel.TotalScore * 100;
}
decimal AvgScore = 0;
if (firstModel.AvgScore > 0)
{
AvgScore = (item.AvgScore - firstModel.AvgScore) / firstModel.AvgScore * 100;
}
decimal ScoreGap = 0;
if (firstModel.ScoreGap > 0)
{
ScoreGap = (item.ScoreGap - firstModel.ScoreGap) / firstModel.ScoreGap * 100;
}
subObj = new
{
Id = 0,
......@@ -332,8 +796,23 @@ namespace Edu.Module.User
};
}
firstModel = item;
firstModel.TotalScore = (firstModel.StudentCount + firstModel.AttendClassHourScore + firstModel.OnLineInteractiveScore + firstModel.RenewScore
+ firstModel.UpgradeScore + firstModel.TransScore + firstModel.TrialSpeakScore - firstModel.TruancyScore - firstModel.WithdrawsScore - firstModel.ComplaintScore
- firstModel.TeacherBeLateScore + firstModel.N2ClassHoursScore + firstModel.N1ClassHoursScore + firstModel.MiniAppPractiseScore + firstModel.MiniAppTimeScore
+ firstModel.ActivityNum
);
firstModel.AvgScore = Math.Round(firstModel.TotalScore / teacherCount, 2);
firstModel.ScoreGap = firstModel.TotalScore - firstModel.AvgScore;
index++;
}
item.TotalScore = (item.StudentCount + item.AttendClassHourScore + item.OnLineInteractiveScore + item.RenewScore
+ item.UpgradeScore + item.TransScore + item.TrialSpeakScore - item.TruancyScore - item.WithdrawsScore - item.ComplaintScore
- item.TeacherBeLateScore + item.N2ClassHoursScore + item.N1ClassHoursScore + item.MiniAppPractiseScore + item.MiniAppTimeScore
+ item.ActivityNum
);
item.AvgScore = Math.Round(item.TotalScore / teacherCount, 2);
item.ScoreGap = item.TotalScore - item.AvgScore;
dataList.Add(new
{
item.Id,
......@@ -2545,12 +3024,13 @@ namespace Edu.Module.User
public bool CreateTeacherStaticModule(UserInfo user, string StartTime, string EndTime, bool isInit = true)
{
bool flag = true;
//5,10,15,20
var teacherList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{
AccountTypeStr = "2",
Group_Id = user.Group_Id,
IsLeave = 1
});
})?.Where(qitem => qitem.AccountId != 5 && qitem.AccountId != 10 && qitem.AccountId != 15 && qitem.AccountId != 20).ToList();
int teacherCount = teacherList?.Count() ?? 1;
List<WechatCheck_ViewModel> checkList = new List<WechatCheck_ViewModel>();
List<WechatCheck_ViewModel> messageList = new List<WechatCheck_ViewModel>();
......
......@@ -73,6 +73,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND t.{0} IN({1}) ", nameof(RB_Teacher_ViewModel.TId), query.QTIds);
}
if (!string.IsNullOrEmpty(query.NotQueryTIds))
{
builder.AppendFormat(" AND t.{0} NOT IN({1}) ", nameof(RB_Teacher_ViewModel.TId), query.NotQueryTIds);
}
//在职老师
if (query.IsQLeave == 0)
{
......@@ -86,6 +90,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Teacher_ViewModel.IsShow), query.IsShow);
}
if (query.Dept_Id > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Teacher_ViewModel.Dept_Id), query.Dept_Id);
}
}
return Get<RB_Teacher_ViewModel>(builder.ToString(), parameters).ToList();
}
......
......@@ -21,7 +21,14 @@ namespace Edu.Repository.User
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
SELECT DATE_FORMAT(A.Date, '%Y-%m-%d') AS Date,A.YearStr,SUM(StudentCount) AS StudentCount,SUM(AttendClassHour) AS AttendClassHour,SUM(AttendClassHourScore) AS AttendClassHourScore
,SUM(OnLineInteractive) AS OnLineInteractive,SUM(OnLineInteractiveScore) AS OnLineInteractiveScore,SUM(Renew) AS Renew,SUM(RenewScore) AS RenewScore,SUM(`Upgrade`) AS `Upgrade`
,SUM(UpgradeScore) AS UpgradeScore,SUM(Trans) AS Trans,SUM(TransScore) AS TransScore,SUM(TrialSpeak) AS TrialSpeak,SUM(TrialSpeakScore) AS TrialSpeakScore,SUM(Truancy) AS Truancy
,SUM(TruancyScore) AS TruancyScore,SUM(Withdraws) AS Withdraws,SUM(WithdrawsScore) AS WithdrawsScore,SUM(Complaint) AS Complaint,SUM(ComplaintScore) AS ComplaintScore
,SUM(TeacherBeLate) AS TeacherBeLate,SUM(TeacherBeLateScore) AS TeacherBeLateScore,SUM(N5ClassHours) AS N5ClassHours,SUM(N5ClassHoursScore) AS N5ClassHoursScore,SUM(N4ClassHours) AS N4ClassHours
,SUM(N4ClassHoursScore) AS N4ClassHoursScore,SUM(N3ClassHours) AS N3ClassHours,SUM(N3ClassHoursScore) AS N3ClassHoursScore,SUM(N2ClassHours) AS N2ClassHours,SUM(N2ClassHoursScore) AS N2ClassHoursScore
,SUM(N1ClassHours) AS N1ClassHours,SUM(N1ClassHoursScore) AS N1ClassHoursScore,SUM(MiniAppPractise) AS MiniAppPractise,SUM(MiniAppPractiseScore) AS MiniAppPractiseScore,SUM(MiniAppTime) AS MiniAppTime
,SUM(MiniAppTimeScore) AS MiniAppTimeScore,SUM(TotalScore) AS TotalScore,SUM(AvgScore) AS AvgScore,SUM(ScoreGap) AS ScoreGap,SUM(ActivityNum) AS ActivityNum
FROM RB_Teacher_Static AS A
WHERE 1=1
");
......@@ -47,15 +54,64 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.TeacherId), query.TeacherId);
}
else if (!string.IsNullOrEmpty(query.QTeacherIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Teacher_Static_Extend.TeacherId), query.QTeacherIds);
}
else
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.TeacherId), 0);
}
}
builder.AppendFormat(" GROUP BY DATE_FORMAT(A.Date, '%Y-%m-%d') ,A.YearStr,A.MonthStr,A.Times ");
builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Student_Static_Extend.Id));
//builder.AppendFormat(" ORDER BY DATE_FORMAT(A.Date, '%Y-%m-%d') ASC ");
return Get<RB_Teacher_Static_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 教师行为月份统计
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Teacher_Static_Extend> GetTeacherStaticMonthExtListRepository(RB_Teacher_Static_Extend query, bool isYear = false)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.TeacherId,CONCAT(DATE_FORMAT(A.Date, '%Y-%m'),'-01') AS Date,A.YearStr,SUM(StudentCount) AS StudentCount,SUM(AttendClassHour) AS AttendClassHour,SUM(AttendClassHourScore) AS AttendClassHourScore
,SUM(OnLineInteractive) AS OnLineInteractive,SUM(OnLineInteractiveScore) AS OnLineInteractiveScore,SUM(Renew) AS Renew,SUM(RenewScore) AS RenewScore,SUM(`Upgrade`) AS `Upgrade`
,SUM(UpgradeScore) AS UpgradeScore,SUM(Trans) AS Trans,SUM(TransScore) AS TransScore,SUM(TrialSpeak) AS TrialSpeak,SUM(TrialSpeakScore) AS TrialSpeakScore,SUM(Truancy) AS Truancy
,SUM(TruancyScore) AS TruancyScore,SUM(Withdraws) AS Withdraws,SUM(WithdrawsScore) AS WithdrawsScore,SUM(Complaint) AS Complaint,SUM(ComplaintScore) AS ComplaintScore
,SUM(TeacherBeLate) AS TeacherBeLate,SUM(TeacherBeLateScore) AS TeacherBeLateScore,SUM(N5ClassHours) AS N5ClassHours,SUM(N5ClassHoursScore) AS N5ClassHoursScore,SUM(N4ClassHours) AS N4ClassHours
,SUM(N4ClassHoursScore) AS N4ClassHoursScore,SUM(N3ClassHours) AS N3ClassHours,SUM(N3ClassHoursScore) AS N3ClassHoursScore,SUM(N2ClassHours) AS N2ClassHours,SUM(N2ClassHoursScore) AS N2ClassHoursScore
,SUM(N1ClassHours) AS N1ClassHours,SUM(N1ClassHoursScore) AS N1ClassHoursScore,SUM(MiniAppPractise) AS MiniAppPractise,SUM(MiniAppPractiseScore) AS MiniAppPractiseScore,SUM(MiniAppTime) AS MiniAppTime
,SUM(MiniAppTimeScore) AS MiniAppTimeScore,SUM(TotalScore) AS TotalScore,SUM(AvgScore) AS AvgScore,SUM(ScoreGap) AS ScoreGap,SUM(ActivityNum) AS ActivityNum
FROM RB_Teacher_Static AS A
WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.Group_Id), query.Group_Id);
}
if (query.YearStr > 0)
{
if (isYear)
{
builder.AppendFormat(" AND A.{0}<={1} ", nameof(RB_Teacher_Static_Extend.YearStr), query.YearStr);
}
else
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.YearStr), query.YearStr);
}
}
}
builder.AppendFormat(" GROUP BY DATE_FORMAT(A.Date, '%Y-%m'),A.TeacherId ");
builder.AppendFormat(" ORDER BY DATE_FORMAT(A.Date, '%Y-%m') ASC ");
return Get<RB_Teacher_Static_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 教师行为月份统计
......
......@@ -6,6 +6,7 @@ using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -53,6 +54,45 @@ namespace Edu.WebApi.Controllers.DataService
TypeName = ParmJObj.GetStringValue("TypeName"),
SortNum = base.ParmJObj.GetInt("SortNum"),
};
model.SubtypeList = new List<RB_Assessment_Subtype_Extend>();
string subtypeListStr = base.ParmJObj.GetStringValue("SubtypeList");
if (!string.IsNullOrEmpty(subtypeListStr))
{
JArray jArray = JArray.Parse(subtypeListStr);
if (jArray != null && jArray.Count > 0)
{
foreach (var jItem in jArray)
{
JObject jobj = JObject.Parse(jItem.ToString());
var subModel = new RB_Assessment_Subtype_Extend()
{
Id = jobj.GetInt("Id"),
SubTypeName = jobj.GetStringValue("SubTypeName"),
OptionList = new List<SubtypeItem>()
};
string optionListStr = jobj.GetStringValue("OptionList");
if (!string.IsNullOrEmpty(optionListStr))
{
JArray subArray = JArray.Parse(optionListStr);
if (subArray != null && subArray.Count > 0)
{
foreach (var subItem in subArray)
{
JObject sObj = JObject.Parse(subItem.ToString());
subModel.OptionList.Add(new SubtypeItem()
{
LevelTitle = sObj.GetStringValue("LevelTitle"),
LevelDesc = sObj.GetStringValue("LevelDesc"),
LevelScore = sObj.GetDecimal("LevelScore"),
});
}
}
}
subModel.Options = JsonHelper.Serialize(subModel.OptionList);
model.SubtypeList.Add(subModel);
}
}
}
model.Group_Id = base.UserInfo.Group_Id;
model.CreateBy = base.UserInfo.Id;
model.UpdateBy = base.UserInfo.Id;
......@@ -87,45 +127,6 @@ namespace Edu.WebApi.Controllers.DataService
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 新增修改老师考评子类型配置
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetAssessmentSubtype()
{
var model = new RB_Assessment_Subtype_Extend()
{
Id = base.ParmJObj.GetInt("Id"),
AssessmentTypeId = base.ParmJObj.GetInt("AssessmentTypeId"),
SubTypeName = base.ParmJObj.GetStringValue("SubTypeName"),
SortNum = base.ParmJObj.GetInt("SortNum"),
};
List<SubtypeItem> OptionList = new List<SubtypeItem>();
string options = base.ParmJObj.GetStringValue("OptionList");
if (!string.IsNullOrEmpty(options))
{
try
{
OptionList = Common.Plugin.JsonHelper.DeserializeObject<List<SubtypeItem>>(options);
}
catch
{
}
}
model.Options = Common.Plugin.JsonHelper.Serialize(OptionList);
model.Group_Id = base.UserInfo.Group_Id;
model.CreateBy = base.UserInfo.Id;
model.UpdateBy = base.UserInfo.Id;
model.CreateTime = DateTime.Now;
model.UpdateTime = DateTime.Now;
model.Status = Common.Enum.DateStateEnum.Normal;
var flag = teacherAssessmentModule.SetAssessmentSubtypeModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号获取老师考评子类型配置
/// </summary>
......
......@@ -40,12 +40,30 @@ namespace Edu.WebApi.Controllers.User
YearStr = base.ParmJObj.GetInt("YearStr"),
MonthStr = base.ParmJObj.GetInt("MonthStr"),
TeacherId=base.ParmJObj.GetInt("TeacherId"),
DeptId=base.ParmJObj.GetInt("DeptId"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = teacherStaticModule.GetTeacherStaticListModule(query);
return ApiResult.Success(data: list);
}
/// <summary>
/// 教师行为数据月度统计
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetTeacherMonthStatic()
{
var query = new RB_Teacher_Static_Extend()
{
YearStr = base.ParmJObj.GetInt("YearStr"),
MonthStr = base.ParmJObj.GetInt("MonthStr"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = teacherStaticModule.GetTeacherStaticMonthExtListModule(query);
return ApiResult.Success(data: list);
}
/// <summary>
/// 下载教师行为数据每日统计
/// </summary>
......@@ -59,6 +77,7 @@ namespace Edu.WebApi.Controllers.User
YearStr = base.ParmJObj.GetInt("YearStr"),
MonthStr = base.ParmJObj.GetInt("MonthStr"),
TeacherId = base.ParmJObj.GetInt("TeacherId"),
DeptId = base.ParmJObj.GetInt("DeptId"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = teacherStaticModule.GetTeacherStaticListModule(query);
......
......@@ -420,7 +420,9 @@ namespace Edu.WebApi.Controllers.User
var query = new RB_Teacher_ViewModel()
{
IsQLeave = base.ParmJObj.GetInt("IsQLeave"),
IsShow = base.ParmJObj.GetInt("IsShow", 0)
IsShow = base.ParmJObj.GetInt("IsShow", 0),
NotQueryTIds=base.ParmJObj.GetStringValue("NotQueryTIds"),
Dept_Id=base.ParmJObj.GetInt("Dept_Id"),
};
query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id;
......
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