Commit 438f6dbc authored by 黄奎's avatar 黄奎

新增字段

parent bbd50152
...@@ -249,5 +249,10 @@ namespace Edu.Model.Entity.User ...@@ -249,5 +249,10 @@ namespace Edu.Model.Entity.User
/// 活动次数 /// 活动次数
/// </summary> /// </summary>
public decimal ActivityNum { get; set; } public decimal ActivityNum { get; set; }
/// <summary>
/// 教师编号
/// </summary>
public int TeacherId { get; set; }
} }
} }
\ No newline at end of file
...@@ -38,5 +38,10 @@ namespace Edu.Model.ViewModel.WeChat ...@@ -38,5 +38,10 @@ namespace Edu.Model.ViewModel.WeChat
/// 班次Id /// 班次Id
/// </summary> /// </summary>
public int Scheduleid { get; set; } public int Scheduleid { get; set; }
/// <summary>
/// 聊天数据
/// </summary>
public int MessageCount { get; set; }
} }
} }
...@@ -283,7 +283,7 @@ namespace Edu.Module.EduTask ...@@ -283,7 +283,7 @@ namespace Edu.Module.EduTask
Requirement = "", Requirement = "",
CourseRate = CourseRateEnum.Advanced, CourseRate = CourseRateEnum.Advanced,
CurrentHours = 0, CurrentHours = 0,
ChapterGradeNo = 1, ChapterGradeNo = Num,
}); });
} }
if (courseChapterList != null && courseChapterList.Count > 0) if (courseChapterList != null && courseChapterList.Count > 0)
......
...@@ -328,7 +328,7 @@ namespace Edu.Module.User ...@@ -328,7 +328,7 @@ namespace Edu.Module.User
TotalScore = Math.Round(TotalScore, 2) + "%", TotalScore = Math.Round(TotalScore, 2) + "%",
AvgScore = Math.Round(AvgScore, 2) + "%", AvgScore = Math.Round(AvgScore, 2) + "%",
ScoreGap = Math.Round(ScoreGap, 2) + "%", ScoreGap = Math.Round(ScoreGap, 2) + "%",
ActivityNum= Math.Round(ActivityNum, 2) + "%", ActivityNum = Math.Round(ActivityNum, 2) + "%",
}; };
} }
firstModel = item; firstModel = item;
...@@ -486,7 +486,7 @@ namespace Edu.Module.User ...@@ -486,7 +486,7 @@ namespace Edu.Module.User
TotalScore = tempData?.TotalScore ?? 0, TotalScore = tempData?.TotalScore ?? 0,
AvgScore = tempData?.AvgScore ?? 0, AvgScore = tempData?.AvgScore ?? 0,
ScoreGap = tempData?.ScoreGap ?? 0, ScoreGap = tempData?.ScoreGap ?? 0,
ActivityNum= tempData?.ActivityNum ?? 0, ActivityNum = tempData?.ActivityNum ?? 0,
}; };
monthList.Add(newData); monthList.Add(newData);
} }
...@@ -919,7 +919,7 @@ namespace Edu.Module.User ...@@ -919,7 +919,7 @@ namespace Edu.Module.User
TotalScore = TotalScore, TotalScore = TotalScore,
AvgScore = AvgScore, AvgScore = AvgScore,
ScoreGap = ScoreGap, ScoreGap = ScoreGap,
ActivityNum=ActivityNum, ActivityNum = ActivityNum,
}; };
result.Add(newModel); result.Add(newModel);
} }
...@@ -1613,7 +1613,7 @@ namespace Edu.Module.User ...@@ -1613,7 +1613,7 @@ namespace Edu.Module.User
TotalScore = TotalScore, TotalScore = TotalScore,
AvgScore = AvgScore, AvgScore = AvgScore,
ScoreGap = ScoreGap, ScoreGap = ScoreGap,
ActivityNum=ActivityNum, ActivityNum = ActivityNum,
}); });
} }
...@@ -2128,7 +2128,7 @@ namespace Edu.Module.User ...@@ -2128,7 +2128,7 @@ namespace Edu.Module.User
TotalScore = TotalScore, TotalScore = TotalScore,
AvgScore = AvgScore, AvgScore = AvgScore,
ScoreGap = ScoreGap, ScoreGap = ScoreGap,
ActivityNum= ActivityNum, ActivityNum = ActivityNum,
}; };
result.Add(newModel); result.Add(newModel);
} }
...@@ -2548,11 +2548,12 @@ namespace Edu.Module.User ...@@ -2548,11 +2548,12 @@ namespace Edu.Module.User
var teacherList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel() var teacherList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{ {
AccountTypeStr = "2", AccountTypeStr = "2",
Group_Id=user.Group_Id, Group_Id = user.Group_Id,
IsLeave = 1 IsLeave = 1
}); });
int teacherCount = teacherList?.Count() ?? 1; int teacherCount = teacherList?.Count() ?? 1;
List<WechatCheck_ViewModel> checkList = new List<WechatCheck_ViewModel>(); List<WechatCheck_ViewModel> checkList = new List<WechatCheck_ViewModel>();
List<WechatCheck_ViewModel> messageList = new List<WechatCheck_ViewModel>();
if (isInit) if (isInit)
{ {
teacher_StaticRepository.DeleteTeacherStaticByProcRepository(); teacher_StaticRepository.DeleteTeacherStaticByProcRepository();
...@@ -2568,64 +2569,403 @@ namespace Edu.Module.User ...@@ -2568,64 +2569,403 @@ namespace Edu.Module.User
//获取老师迟到早退信息 //获取老师迟到早退信息
checkList = Edu.ThirdCore.QYWinXin.QYWeiXinHelper.GetWeChatCheckList(workUserIds, newDate); checkList = Edu.ThirdCore.QYWinXin.QYWeiXinHelper.GetWeChatCheckList(workUserIds, newDate);
//获取老师与学员沟通次数 //获取老师与学员沟通次数
int message_cnt = Edu.ThirdCore.QYWinXin.QYWeiXinHelper.GetWechatStudentStatic(workUserIds, newDate); messageList = Edu.ThirdCore.QYWinXin.QYWeiXinHelper.GetWechatStudentStatic(workUserIds, newDate);
var procModel = teacher_StaticRepository.GetTeacherStaticByProcRepository(Common.ConvertHelper.FormatDate(newDate));
var newModel = new RB_Teacher_Static_Extend() int times = 1;
int newDay = newDate.Day;
//本月最后一天
var curMonthLastDay = new DateTime(newDate.Year, newDate.Month, 1).AddMonths(1).AddDays(-1);
//单个老师
var procModelList = teacher_StaticRepository.GetTeacherStaticByProcRepository(Common.ConvertHelper.FormatDate(newDate));
foreach (var item in teacherList)
{
var procModel = procModelList.Where(qitem => qitem.TeacherId == item.AccountId).FirstOrDefault();
var newModel = new RB_Teacher_Static_Extend()
{
Id = 0,
Date = newDate,
StudentCount = procModel?.StudentCount ?? 0,
AttendClassHour = procModel?.AttendClassHour ?? 0,
AttendClassHourScore = procModel?.AttendClassHourScore ?? 0,
Renew = procModel?.Renew ?? 0,
RenewScore = procModel?.RenewScore ?? 0,
Upgrade = procModel?.Upgrade ?? 0,
UpgradeScore = procModel?.UpgradeScore ?? 0,
Trans = procModel?.Trans ?? 0,
TransScore = procModel?.TransScore ?? 0,
TrialSpeak = procModel?.TrialSpeak ?? 0,
TrialSpeakScore = procModel?.TrialSpeakScore ?? 0,
Truancy = procModel?.Truancy ?? 0,
TruancyScore = procModel?.TruancyScore ?? 0,
Withdraws = procModel?.Withdraws ?? 0,
WithdrawsScore = procModel?.WithdrawsScore ?? 0,
Complaint = procModel?.Complaint ?? 0,
ComplaintScore = procModel?.ComplaintScore ?? 0,
N5ClassHours = procModel?.N5ClassHours ?? 0,
N5ClassHoursScore = procModel?.N5ClassHoursScore ?? 0,
N4ClassHours = procModel?.N4ClassHours ?? 0,
N4ClassHoursScore = procModel?.N4ClassHoursScore ?? 0,
N3ClassHours = procModel?.N3ClassHours ?? 0,
N3ClassHoursScore = procModel?.N3ClassHoursScore ?? 0,
N2ClassHours = procModel?.N2ClassHours ?? 0,
N2ClassHoursScore = procModel?.N2ClassHoursScore ?? 0,
N1ClassHours = procModel?.N1ClassHours ?? 0,
N1ClassHoursScore = procModel?.N1ClassHoursScore ?? 0,
MiniAppPractise = procModel?.MiniAppPractise ?? 0,
MiniAppPractiseScore = procModel?.MiniAppPractiseScore ?? 0,
MiniAppTime = procModel?.MiniAppTime ?? 0,
MiniAppTimeScore = procModel?.MiniAppTimeScore ?? 0,
ActivityNum = procModel?.ActivityNum ?? 0,
YearStr = newDate.Year,
MonthStr = newDate.Month,
TeacherId = item.AccountId,
};
newModel.OnLineInteractive = messageList.Where(qitem => qitem.Acctid == item.WorkUserId)?.FirstOrDefault()?.MessageCount ?? 0;
newModel.OnLineInteractiveScore = newModel.OnLineInteractive;
newModel.TeacherBeLate = checkList.Where(qitem=>qitem.Acctid==item.WorkUserId)?.Where(qitem => qitem.ExceptionCount > 0)?.Count() ?? 0;
newModel.TeacherBeLateScore = newModel.TeacherBeLate;
newModel.TotalScore = (newModel.StudentCount + newModel.AttendClassHourScore + newModel.OnLineInteractiveScore + newModel.RenewScore
+ newModel.UpgradeScore + newModel.TransScore + newModel.TrialSpeakScore - newModel.TruancyScore - newModel.WithdrawsScore - newModel.ComplaintScore
- newModel.TeacherBeLateScore + newModel.N2ClassHoursScore + newModel.N1ClassHoursScore + newModel.MiniAppPractiseScore + newModel.MiniAppTimeScore
+ newModel.ActivityNum
);
newModel.AvgScore = Math.Round(newModel.TotalScore / teacherCount, 2);
newModel.ScoreGap = newModel.TotalScore - newModel.AvgScore;
if (newDay >= 1 && newDay <= 10)
{
times = 1;
//记录上月最后一个时段总数
if (newDay == 1)
{
var lastMonthDay = newDate.AddMonths(-1);
var lastMonthLastTimeList = teacher_StaticRepository.GetTeacherStaticListRepository(new RB_Teacher_Static_Extend()
{
YearStr = lastMonthDay.Year,
MonthStr = lastMonthDay.Month,
Times = 3,
TeacherId = item.AccountId
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
var staticModel = new RB_Teacher_Static_Extend()
{
Id = 0,
StudentCount = lastMonthLastTimeList?.Sum(qitem => qitem.StudentCount) ?? 0,
AttendClassHour = lastMonthLastTimeList?.Sum(qitem => qitem.AttendClassHour) ?? 0,
AttendClassHourScore = lastMonthLastTimeList?.Sum(qitem => qitem.AttendClassHourScore) ?? 0,
OnLineInteractive = lastMonthLastTimeList?.Sum(qitem => qitem.OnLineInteractive) ?? 0,
OnLineInteractiveScore = lastMonthLastTimeList?.Sum(qitem => qitem.OnLineInteractiveScore) ?? 0,
Renew = lastMonthLastTimeList?.Sum(qitem => qitem.Renew) ?? 0,
RenewScore = lastMonthLastTimeList?.Sum(qitem => qitem.RenewScore) ?? 0,
Upgrade = lastMonthLastTimeList?.Sum(qitem => qitem.Upgrade) ?? 0,
UpgradeScore = lastMonthLastTimeList?.Sum(qitem => qitem.UpgradeScore) ?? 0,
Trans = lastMonthLastTimeList?.Sum(qitem => qitem.Trans) ?? 0,
TransScore = lastMonthLastTimeList?.Sum(qitem => qitem.TransScore) ?? 0,
TrialSpeak = lastMonthLastTimeList?.Sum(qitem => qitem.TrialSpeak) ?? 0,
TrialSpeakScore = lastMonthLastTimeList?.Sum(qitem => qitem.TrialSpeakScore) ?? 0,
Truancy = lastMonthLastTimeList?.Sum(qitem => qitem.Truancy) ?? 0,
TruancyScore = lastMonthLastTimeList?.Sum(qitem => qitem.TruancyScore) ?? 0,
Withdraws = lastMonthLastTimeList?.Sum(qitem => qitem.Withdraws) ?? 0,
WithdrawsScore = lastMonthLastTimeList?.Sum(qitem => qitem.WithdrawsScore) ?? 0,
Complaint = lastMonthLastTimeList?.Sum(qitem => qitem.Complaint) ?? 0,
ComplaintScore = lastMonthLastTimeList?.Sum(qitem => qitem.ComplaintScore) ?? 0,
TeacherBeLate = lastMonthLastTimeList?.Sum(qitem => qitem.TeacherBeLate) ?? 0,
TeacherBeLateScore = lastMonthLastTimeList?.Sum(qitem => qitem.TeacherBeLateScore) ?? 0,
N5ClassHours = lastMonthLastTimeList?.Sum(qitem => qitem.N5ClassHours) ?? 0,
N5ClassHoursScore = lastMonthLastTimeList?.Sum(qitem => qitem.N5ClassHoursScore) ?? 0,
N4ClassHours = lastMonthLastTimeList?.Sum(qitem => qitem.N4ClassHours) ?? 0,
N4ClassHoursScore = lastMonthLastTimeList?.Sum(qitem => qitem.N4ClassHoursScore) ?? 0,
N3ClassHours = lastMonthLastTimeList?.Sum(qitem => qitem.N3ClassHours) ?? 0,
N3ClassHoursScore = lastMonthLastTimeList?.Sum(qitem => qitem.N3ClassHoursScore) ?? 0,
N2ClassHours = lastMonthLastTimeList?.Sum(qitem => qitem.N2ClassHours) ?? 0,
N2ClassHoursScore = lastMonthLastTimeList?.Sum(qitem => qitem.N2ClassHoursScore) ?? 0,
N1ClassHours = lastMonthLastTimeList?.Sum(qitem => qitem.N1ClassHours) ?? 0,
N1ClassHoursScore = lastMonthLastTimeList?.Sum(qitem => qitem.N1ClassHoursScore) ?? 0,
MiniAppPractise = lastMonthLastTimeList?.Sum(qitem => qitem.MiniAppPractise) ?? 0,
MiniAppPractiseScore = lastMonthLastTimeList?.Sum(qitem => qitem.MiniAppPractiseScore) ?? 0,
MiniAppTime = lastMonthLastTimeList?.Sum(qitem => qitem.MiniAppTime) ?? 0,
MiniAppTimeScore = lastMonthLastTimeList?.Sum(qitem => qitem.MiniAppTimeScore) ?? 0,
TotalScore = lastMonthLastTimeList?.Sum(qitem => qitem.TotalScore) ?? 0,
AvgScore = lastMonthLastTimeList?.Sum(qitem => qitem.AvgScore) ?? 0,
ScoreGap = lastMonthLastTimeList?.Sum(qitem => qitem.ScoreGap) ?? 0,
ActivityNum = lastMonthLastTimeList?.Sum(qitem => qitem.ActivityNum) ?? 0,
YearStr = newDate.Year,
MonthStr = newDate.Month,
TeacherId = item.AccountId,
};
staticModel.Times = 1;
staticModel.Group_Id = user.Group_Id;
staticModel.School_Id = user.School_Id;
staticModel.CreateBy = user.Id;
staticModel.CreateTime = DateTime.Now;
teacher_StaticRepository.Insert(staticModel);
}
}
else if (newDay >= 11 && newDay <= 20)
{
times = 2;
//记录本月第一阶段总数
if (newDay == 11)
{
var curMonthFirstTimeList = teacher_StaticRepository.GetTeacherStaticListRepository(new RB_Teacher_Static_Extend()
{
YearStr = newDate.Year,
MonthStr = newDate.Month,
Times = 1,
TeacherId = item.AccountId,
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
var firstTimeStaticModel = new RB_Teacher_Static_Extend()
{
Id = 0,
StudentCount = curMonthFirstTimeList?.Sum(qitem => qitem.StudentCount) ?? 0,
AttendClassHour = curMonthFirstTimeList?.Sum(qitem => qitem.AttendClassHour) ?? 0,
AttendClassHourScore = curMonthFirstTimeList?.Sum(qitem => qitem.AttendClassHourScore) ?? 0,
OnLineInteractive = curMonthFirstTimeList?.Sum(qitem => qitem.OnLineInteractive) ?? 0,
OnLineInteractiveScore = curMonthFirstTimeList?.Sum(qitem => qitem.OnLineInteractiveScore) ?? 0,
Renew = curMonthFirstTimeList?.Sum(qitem => qitem.Renew) ?? 0,
RenewScore = curMonthFirstTimeList?.Sum(qitem => qitem.RenewScore) ?? 0,
Upgrade = curMonthFirstTimeList?.Sum(qitem => qitem.Upgrade) ?? 0,
UpgradeScore = curMonthFirstTimeList?.Sum(qitem => qitem.UpgradeScore) ?? 0,
Trans = curMonthFirstTimeList?.Sum(qitem => qitem.Trans) ?? 0,
TransScore = curMonthFirstTimeList?.Sum(qitem => qitem.TransScore) ?? 0,
TrialSpeak = curMonthFirstTimeList?.Sum(qitem => qitem.TrialSpeak) ?? 0,
TrialSpeakScore = curMonthFirstTimeList?.Sum(qitem => qitem.TrialSpeakScore) ?? 0,
Truancy = curMonthFirstTimeList?.Sum(qitem => qitem.Truancy) ?? 0,
TruancyScore = curMonthFirstTimeList?.Sum(qitem => qitem.TruancyScore) ?? 0,
Withdraws = curMonthFirstTimeList?.Sum(qitem => qitem.Withdraws) ?? 0,
WithdrawsScore = curMonthFirstTimeList?.Sum(qitem => qitem.WithdrawsScore) ?? 0,
Complaint = curMonthFirstTimeList?.Sum(qitem => qitem.Complaint) ?? 0,
ComplaintScore = curMonthFirstTimeList?.Sum(qitem => qitem.ComplaintScore) ?? 0,
TeacherBeLate = curMonthFirstTimeList?.Sum(qitem => qitem.TeacherBeLate) ?? 0,
TeacherBeLateScore = curMonthFirstTimeList?.Sum(qitem => qitem.TeacherBeLateScore) ?? 0,
N5ClassHours = curMonthFirstTimeList?.Sum(qitem => qitem.N5ClassHours) ?? 0,
N5ClassHoursScore = curMonthFirstTimeList?.Sum(qitem => qitem.N5ClassHoursScore) ?? 0,
N4ClassHours = curMonthFirstTimeList?.Sum(qitem => qitem.N4ClassHours) ?? 0,
N4ClassHoursScore = curMonthFirstTimeList?.Sum(qitem => qitem.N4ClassHoursScore) ?? 0,
N3ClassHours = curMonthFirstTimeList?.Sum(qitem => qitem.N3ClassHours) ?? 0,
N3ClassHoursScore = curMonthFirstTimeList?.Sum(qitem => qitem.N3ClassHoursScore) ?? 0,
N2ClassHours = curMonthFirstTimeList?.Sum(qitem => qitem.N2ClassHours) ?? 0,
N2ClassHoursScore = curMonthFirstTimeList?.Sum(qitem => qitem.N2ClassHoursScore) ?? 0,
N1ClassHours = curMonthFirstTimeList?.Sum(qitem => qitem.N1ClassHours) ?? 0,
N1ClassHoursScore = curMonthFirstTimeList?.Sum(qitem => qitem.N1ClassHoursScore) ?? 0,
MiniAppPractise = curMonthFirstTimeList?.Sum(qitem => qitem.MiniAppPractise) ?? 0,
MiniAppPractiseScore = curMonthFirstTimeList?.Sum(qitem => qitem.MiniAppPractiseScore) ?? 0,
MiniAppTime = curMonthFirstTimeList?.Sum(qitem => qitem.MiniAppTime) ?? 0,
MiniAppTimeScore = curMonthFirstTimeList?.Sum(qitem => qitem.MiniAppTimeScore) ?? 0,
TotalScore = curMonthFirstTimeList?.Sum(qitem => qitem.TotalScore) ?? 0,
AvgScore = curMonthFirstTimeList?.Sum(qitem => qitem.AvgScore) ?? 0,
ScoreGap = curMonthFirstTimeList?.Sum(qitem => qitem.ScoreGap) ?? 0,
ActivityNum = curMonthFirstTimeList?.Sum(qitem => qitem.ActivityNum) ?? 0,
YearStr = newDate.Year,
MonthStr = newDate.Month,
TeacherId = item.AccountId,
};
firstTimeStaticModel.Times = 2;
firstTimeStaticModel.Group_Id = user.Group_Id;
firstTimeStaticModel.School_Id = user.School_Id;
firstTimeStaticModel.CreateBy = user.Id;
firstTimeStaticModel.CreateTime = DateTime.Now;
teacher_StaticRepository.Insert(firstTimeStaticModel);
}
}
else
{
times = 3;
//记录本月第二阶段总数
if (newDay == 21)
{
var curMonthSecondTimeList = teacher_StaticRepository.GetTeacherStaticListRepository(new RB_Teacher_Static_Extend()
{
YearStr = newDate.Year,
MonthStr = newDate.Month,
Times = 2,
TeacherId = item.AccountId,
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
var secondTimeStaticModel = new RB_Teacher_Static_Extend()
{
Id = 0,
StudentCount = curMonthSecondTimeList?.Sum(qitem => qitem.StudentCount) ?? 0,
AttendClassHour = curMonthSecondTimeList?.Sum(qitem => qitem.AttendClassHour) ?? 0,
AttendClassHourScore = curMonthSecondTimeList?.Sum(qitem => qitem.AttendClassHourScore) ?? 0,
OnLineInteractive = curMonthSecondTimeList?.Sum(qitem => qitem.OnLineInteractive) ?? 0,
OnLineInteractiveScore = curMonthSecondTimeList?.Sum(qitem => qitem.OnLineInteractiveScore) ?? 0,
Renew = curMonthSecondTimeList?.Sum(qitem => qitem.Renew) ?? 0,
RenewScore = curMonthSecondTimeList?.Sum(qitem => qitem.RenewScore) ?? 0,
Upgrade = curMonthSecondTimeList?.Sum(qitem => qitem.Upgrade) ?? 0,
UpgradeScore = curMonthSecondTimeList?.Sum(qitem => qitem.UpgradeScore) ?? 0,
Trans = curMonthSecondTimeList?.Sum(qitem => qitem.Trans) ?? 0,
TransScore = curMonthSecondTimeList?.Sum(qitem => qitem.TransScore) ?? 0,
TrialSpeak = curMonthSecondTimeList?.Sum(qitem => qitem.TrialSpeak) ?? 0,
TrialSpeakScore = curMonthSecondTimeList?.Sum(qitem => qitem.TrialSpeakScore) ?? 0,
Truancy = curMonthSecondTimeList?.Sum(qitem => qitem.Truancy) ?? 0,
TruancyScore = curMonthSecondTimeList?.Sum(qitem => qitem.TruancyScore) ?? 0,
Withdraws = curMonthSecondTimeList?.Sum(qitem => qitem.Withdraws) ?? 0,
WithdrawsScore = curMonthSecondTimeList?.Sum(qitem => qitem.WithdrawsScore) ?? 0,
Complaint = curMonthSecondTimeList?.Sum(qitem => qitem.Complaint) ?? 0,
ComplaintScore = curMonthSecondTimeList?.Sum(qitem => qitem.ComplaintScore) ?? 0,
TeacherBeLate = curMonthSecondTimeList?.Sum(qitem => qitem.TeacherBeLate) ?? 0,
TeacherBeLateScore = curMonthSecondTimeList?.Sum(qitem => qitem.TeacherBeLateScore) ?? 0,
N5ClassHours = curMonthSecondTimeList?.Sum(qitem => qitem.N5ClassHours) ?? 0,
N5ClassHoursScore = curMonthSecondTimeList?.Sum(qitem => qitem.N5ClassHoursScore) ?? 0,
N4ClassHours = curMonthSecondTimeList?.Sum(qitem => qitem.N4ClassHours) ?? 0,
N4ClassHoursScore = curMonthSecondTimeList?.Sum(qitem => qitem.N4ClassHoursScore) ?? 0,
N3ClassHours = curMonthSecondTimeList?.Sum(qitem => qitem.N3ClassHours) ?? 0,
N3ClassHoursScore = curMonthSecondTimeList?.Sum(qitem => qitem.N3ClassHoursScore) ?? 0,
N2ClassHours = curMonthSecondTimeList?.Sum(qitem => qitem.N2ClassHours) ?? 0,
N2ClassHoursScore = curMonthSecondTimeList?.Sum(qitem => qitem.N2ClassHoursScore) ?? 0,
N1ClassHours = curMonthSecondTimeList?.Sum(qitem => qitem.N1ClassHours) ?? 0,
N1ClassHoursScore = curMonthSecondTimeList?.Sum(qitem => qitem.N1ClassHoursScore) ?? 0,
MiniAppPractise = curMonthSecondTimeList?.Sum(qitem => qitem.MiniAppPractise) ?? 0,
MiniAppPractiseScore = curMonthSecondTimeList?.Sum(qitem => qitem.MiniAppPractiseScore) ?? 0,
MiniAppTime = curMonthSecondTimeList?.Sum(qitem => qitem.MiniAppTime) ?? 0,
MiniAppTimeScore = curMonthSecondTimeList?.Sum(qitem => qitem.MiniAppTimeScore) ?? 0,
TotalScore = curMonthSecondTimeList?.Sum(qitem => qitem.TotalScore) ?? 0,
AvgScore = curMonthSecondTimeList?.Sum(qitem => qitem.AvgScore) ?? 0,
ScoreGap = curMonthSecondTimeList?.Sum(qitem => qitem.ScoreGap) ?? 0,
ActivityNum = curMonthSecondTimeList?.Sum(qitem => qitem.ActivityNum) ?? 0,
YearStr = newDate.Year,
MonthStr = newDate.Month,
TeacherId = item.AccountId,
};
secondTimeStaticModel.Times = 3;
secondTimeStaticModel.Group_Id = user.Group_Id;
secondTimeStaticModel.School_Id = user.School_Id;
secondTimeStaticModel.CreateBy = user.Id;
secondTimeStaticModel.CreateTime = DateTime.Now;
teacher_StaticRepository.Insert(secondTimeStaticModel);
}
}
newModel.Times = times;
newModel.Group_Id = user.Group_Id;
newModel.School_Id = user.School_Id;
newModel.CreateBy = user.Id;
newModel.CreateTime = DateTime.Now;
if (flag)
{
var newId = teacher_StaticRepository.Insert(newModel);
newModel.Id = newId;
flag = newId > 0;
}
//本月最后一天
if (newDay == curMonthLastDay.Day)
{
var curMonthThirdTimeList = teacher_StaticRepository.GetTeacherStaticListRepository(new RB_Teacher_Static_Extend()
{
YearStr = newDate.Year,
MonthStr = newDate.Month,
Times = 3,
TeacherId = item.AccountId,
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
var thirdTimeStaticModel = new RB_Teacher_Static_Extend()
{
Id = 0,
StudentCount = curMonthThirdTimeList?.Sum(qitem => qitem.StudentCount) ?? 0,
AttendClassHour = curMonthThirdTimeList?.Sum(qitem => qitem.AttendClassHour) ?? 0,
AttendClassHourScore = curMonthThirdTimeList?.Sum(qitem => qitem.AttendClassHourScore) ?? 0,
OnLineInteractive = curMonthThirdTimeList?.Sum(qitem => qitem.OnLineInteractive) ?? 0,
OnLineInteractiveScore = curMonthThirdTimeList?.Sum(qitem => qitem.OnLineInteractiveScore) ?? 0,
Renew = curMonthThirdTimeList?.Sum(qitem => qitem.Renew) ?? 0,
RenewScore = curMonthThirdTimeList?.Sum(qitem => qitem.RenewScore) ?? 0,
Upgrade = curMonthThirdTimeList?.Sum(qitem => qitem.Upgrade) ?? 0,
UpgradeScore = curMonthThirdTimeList?.Sum(qitem => qitem.UpgradeScore) ?? 0,
Trans = curMonthThirdTimeList?.Sum(qitem => qitem.Trans) ?? 0,
TransScore = curMonthThirdTimeList?.Sum(qitem => qitem.TransScore) ?? 0,
TrialSpeak = curMonthThirdTimeList?.Sum(qitem => qitem.TrialSpeak) ?? 0,
TrialSpeakScore = curMonthThirdTimeList?.Sum(qitem => qitem.TrialSpeakScore) ?? 0,
Truancy = curMonthThirdTimeList?.Sum(qitem => qitem.Truancy) ?? 0,
TruancyScore = curMonthThirdTimeList?.Sum(qitem => qitem.TruancyScore) ?? 0,
Withdraws = curMonthThirdTimeList?.Sum(qitem => qitem.Withdraws) ?? 0,
WithdrawsScore = curMonthThirdTimeList?.Sum(qitem => qitem.WithdrawsScore) ?? 0,
Complaint = curMonthThirdTimeList?.Sum(qitem => qitem.Complaint) ?? 0,
ComplaintScore = curMonthThirdTimeList?.Sum(qitem => qitem.ComplaintScore) ?? 0,
TeacherBeLate = curMonthThirdTimeList?.Sum(qitem => qitem.TeacherBeLate) ?? 0,
TeacherBeLateScore = curMonthThirdTimeList?.Sum(qitem => qitem.TeacherBeLateScore) ?? 0,
N5ClassHours = curMonthThirdTimeList?.Sum(qitem => qitem.N5ClassHours) ?? 0,
N5ClassHoursScore = curMonthThirdTimeList?.Sum(qitem => qitem.N5ClassHoursScore) ?? 0,
N4ClassHours = curMonthThirdTimeList?.Sum(qitem => qitem.N4ClassHours) ?? 0,
N4ClassHoursScore = curMonthThirdTimeList?.Sum(qitem => qitem.N4ClassHoursScore) ?? 0,
N3ClassHours = curMonthThirdTimeList?.Sum(qitem => qitem.N3ClassHours) ?? 0,
N3ClassHoursScore = curMonthThirdTimeList?.Sum(qitem => qitem.N3ClassHoursScore) ?? 0,
N2ClassHours = curMonthThirdTimeList?.Sum(qitem => qitem.N2ClassHours) ?? 0,
N2ClassHoursScore = curMonthThirdTimeList?.Sum(qitem => qitem.N2ClassHoursScore) ?? 0,
N1ClassHours = curMonthThirdTimeList?.Sum(qitem => qitem.N1ClassHours) ?? 0,
N1ClassHoursScore = curMonthThirdTimeList?.Sum(qitem => qitem.N1ClassHoursScore) ?? 0,
MiniAppPractise = curMonthThirdTimeList?.Sum(qitem => qitem.MiniAppPractise) ?? 0,
MiniAppPractiseScore = curMonthThirdTimeList?.Sum(qitem => qitem.MiniAppPractiseScore) ?? 0,
MiniAppTime = curMonthThirdTimeList?.Sum(qitem => qitem.MiniAppTime) ?? 0,
MiniAppTimeScore = curMonthThirdTimeList?.Sum(qitem => qitem.MiniAppTimeScore) ?? 0,
TotalScore = curMonthThirdTimeList?.Sum(qitem => qitem.TotalScore) ?? 0,
AvgScore = curMonthThirdTimeList?.Sum(qitem => qitem.AvgScore) ?? 0,
ScoreGap = curMonthThirdTimeList?.Sum(qitem => qitem.ScoreGap) ?? 0,
ActivityNum = curMonthThirdTimeList?.Sum(qitem => qitem.ActivityNum) ?? 0,
YearStr = newDate.Year,
MonthStr = newDate.Month,
TeacherId = item.AccountId,
};
thirdTimeStaticModel.Times = 4;
thirdTimeStaticModel.Group_Id = user.Group_Id;
thirdTimeStaticModel.School_Id = user.School_Id;
thirdTimeStaticModel.CreateBy = user.Id;
thirdTimeStaticModel.CreateTime = DateTime.Now;
teacher_StaticRepository.Insert(thirdTimeStaticModel);
}
}
//合计
var newModel2 = new RB_Teacher_Static_Extend()
{ {
Id = 0, Id = 0,
Date = newDate, Date = newDate,
StudentCount = procModel?.StudentCount ?? 0, StudentCount = procModelList?.Sum(qitem => qitem.StudentCount) ?? 0,
AttendClassHour = procModel?.AttendClassHour ?? 0, AttendClassHour = procModelList?.Sum(qitem => qitem.AttendClassHour) ?? 0,
AttendClassHourScore = procModel?.AttendClassHourScore ?? 0, AttendClassHourScore = procModelList?.Sum(qitem => qitem.AttendClassHourScore) ?? 0,
Renew = procModel?.Renew ?? 0, Renew = procModelList?.Sum(qitem => qitem.Renew) ?? 0,
RenewScore = procModel?.RenewScore ?? 0, RenewScore = procModelList?.Sum(qitem => qitem.RenewScore) ?? 0,
Upgrade = procModel?.Upgrade ?? 0, Upgrade = procModelList?.Sum(qitem => qitem.Upgrade) ?? 0,
UpgradeScore = procModel?.UpgradeScore ?? 0, UpgradeScore = procModelList?.Sum(qitem => qitem.UpgradeScore) ?? 0,
Trans = procModel?.Trans ?? 0, Trans = procModelList?.Sum(qitem => qitem.Trans) ?? 0,
TransScore = procModel?.TransScore ?? 0, TransScore = procModelList?.Sum(qitem => qitem.TransScore) ?? 0,
TrialSpeak = procModel?.TrialSpeak ?? 0, TrialSpeak = procModelList?.Sum(qitem => qitem.TrialSpeak) ?? 0,
TrialSpeakScore = procModel?.TrialSpeakScore ?? 0, TrialSpeakScore = procModelList?.Sum(qitem => qitem.TrialSpeakScore) ?? 0,
Truancy = procModel?.Truancy ?? 0, Truancy = procModelList?.Sum(qitem => qitem.Truancy) ?? 0,
TruancyScore = procModel?.TruancyScore ?? 0, TruancyScore = procModelList?.Sum(qitem => qitem.TruancyScore) ?? 0,
Withdraws = procModel?.Withdraws ?? 0, Withdraws = procModelList?.Sum(qitem => qitem.Withdraws) ?? 0,
WithdrawsScore = procModel?.WithdrawsScore ?? 0, WithdrawsScore = procModelList?.Sum(qitem => qitem.WithdrawsScore) ?? 0,
Complaint = procModel?.Complaint ?? 0, Complaint = procModelList?.Sum(qitem => qitem.Complaint) ?? 0,
ComplaintScore = procModel?.ComplaintScore ?? 0, ComplaintScore = procModelList?.Sum(qitem => qitem.ComplaintScore) ?? 0,
N5ClassHours = procModel?.N5ClassHours ?? 0, N5ClassHours = procModelList?.Sum(qitem => qitem.N5ClassHours) ?? 0,
N5ClassHoursScore = procModel?.N5ClassHoursScore ?? 0, N5ClassHoursScore = procModelList?.Sum(qitem => qitem.N5ClassHoursScore) ?? 0,
N4ClassHours = procModel?.N4ClassHours ?? 0, N4ClassHours = procModelList?.Sum(qitem => qitem.N4ClassHours) ?? 0,
N4ClassHoursScore = procModel?.N4ClassHoursScore ?? 0, N4ClassHoursScore = procModelList?.Sum(qitem => qitem.N4ClassHoursScore) ?? 0,
N3ClassHours = procModel?.N3ClassHours ?? 0, N3ClassHours = procModelList?.Sum(qitem => qitem.N3ClassHours) ?? 0,
N3ClassHoursScore = procModel?.N3ClassHoursScore ?? 0, N3ClassHoursScore = procModelList?.Sum(qitem => qitem.N3ClassHoursScore) ?? 0,
N2ClassHours = procModel?.N2ClassHours ?? 0, N2ClassHours = procModelList?.Sum(qitem => qitem.N2ClassHours) ?? 0,
N2ClassHoursScore = procModel?.N2ClassHoursScore ?? 0, N2ClassHoursScore = procModelList?.Sum(qitem => qitem.N2ClassHoursScore) ?? 0,
N1ClassHours = procModel?.N1ClassHours ?? 0, N1ClassHours = procModelList?.Sum(qitem => qitem.N1ClassHours) ?? 0,
N1ClassHoursScore = procModel?.N1ClassHoursScore ?? 0, N1ClassHoursScore = procModelList?.Sum(qitem => qitem.N1ClassHoursScore) ?? 0,
MiniAppPractise = procModel?.MiniAppPractise ?? 0, MiniAppPractise = procModelList?.Sum(qitem => qitem.MiniAppPractise) ?? 0,
MiniAppPractiseScore = procModel?.MiniAppPractiseScore ?? 0, MiniAppPractiseScore = procModelList?.Sum(qitem => qitem.MiniAppPractiseScore) ?? 0,
MiniAppTime = procModel?.MiniAppTime ?? 0, MiniAppTime = procModelList?.Sum(qitem => qitem.MiniAppTime) ?? 0,
MiniAppTimeScore = procModel?.MiniAppTimeScore ?? 0, MiniAppTimeScore = procModelList?.Sum(qitem => qitem.MiniAppTimeScore) ?? 0,
ActivityNum= procModel?.ActivityNum ?? 0, ActivityNum = procModelList?.Sum(qitem => qitem.ActivityNum) ?? 0,
YearStr = newDate.Year, YearStr = newDate.Year,
MonthStr = newDate.Month, MonthStr = newDate.Month,
TeacherId = 0,
}; };
newModel.OnLineInteractive = message_cnt; newModel2.OnLineInteractive = messageList?.Sum(qitem => qitem.MessageCount) ?? 0;
newModel.OnLineInteractiveScore = newModel.OnLineInteractive; newModel2.OnLineInteractiveScore = newModel2.OnLineInteractive;
newModel.TeacherBeLate = checkList?.Where(qitem => qitem.ExceptionCount > 0)?.Count() ?? 0; newModel2.TeacherBeLate = checkList?.Where(qitem => qitem.ExceptionCount > 0)?.Count() ?? 0;
newModel.TeacherBeLateScore = newModel.TeacherBeLate; newModel2.TeacherBeLateScore = newModel2.TeacherBeLate;
newModel.TotalScore = (newModel.StudentCount + newModel.AttendClassHourScore + newModel.OnLineInteractiveScore + newModel.RenewScore newModel2.TotalScore = (newModel2.StudentCount + newModel2.AttendClassHourScore + newModel2.OnLineInteractiveScore + newModel2.RenewScore
+ newModel.UpgradeScore + newModel.TransScore + newModel.TrialSpeakScore - newModel.TruancyScore - newModel.WithdrawsScore - newModel.ComplaintScore + newModel2.UpgradeScore + newModel2.TransScore + newModel2.TrialSpeakScore - newModel2.TruancyScore - newModel2.WithdrawsScore - newModel2.ComplaintScore
- newModel.TeacherBeLateScore + newModel.N2ClassHoursScore + newModel.N1ClassHoursScore + newModel.MiniAppPractiseScore + newModel.MiniAppTimeScore - newModel2.TeacherBeLateScore + newModel2.N2ClassHoursScore + newModel2.N1ClassHoursScore + newModel2.MiniAppPractiseScore + newModel2.MiniAppTimeScore
+ newModel.ActivityNum + newModel2.ActivityNum
); );
newModel.AvgScore = Math.Round(newModel.TotalScore / teacherCount, 2); newModel2.AvgScore = Math.Round(newModel2.TotalScore / teacherCount, 2);
newModel.ScoreGap = newModel.TotalScore - newModel.AvgScore; newModel2.ScoreGap = newModel2.TotalScore - newModel2.AvgScore;
int times = 1;
int newDay = newDate.Day;
//本月最后一天
var curMonthLastDay = new DateTime(newDate.Year, newDate.Month, 1).AddMonths(1).AddDays(-1);
if (newDay >= 1 && newDay <= 10) if (newDay >= 1 && newDay <= 10)
{ {
times = 1; times = 1;
...@@ -2637,7 +2977,7 @@ namespace Edu.Module.User ...@@ -2637,7 +2977,7 @@ namespace Edu.Module.User
{ {
YearStr = lastMonthDay.Year, YearStr = lastMonthDay.Year,
MonthStr = lastMonthDay.Month, MonthStr = lastMonthDay.Month,
Times = 3 Times = 3,
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList(); })?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
var staticModel = new RB_Teacher_Static_Extend() var staticModel = new RB_Teacher_Static_Extend()
{ {
...@@ -2683,6 +3023,7 @@ namespace Edu.Module.User ...@@ -2683,6 +3023,7 @@ namespace Edu.Module.User
ActivityNum = lastMonthLastTimeList?.Sum(qitem => qitem.ActivityNum) ?? 0, ActivityNum = lastMonthLastTimeList?.Sum(qitem => qitem.ActivityNum) ?? 0,
YearStr = newDate.Year, YearStr = newDate.Year,
MonthStr = newDate.Month, MonthStr = newDate.Month,
TeacherId = 0,
}; };
staticModel.Times = 1; staticModel.Times = 1;
staticModel.Group_Id = user.Group_Id; staticModel.Group_Id = user.Group_Id;
...@@ -2702,7 +3043,7 @@ namespace Edu.Module.User ...@@ -2702,7 +3043,7 @@ namespace Edu.Module.User
{ {
YearStr = newDate.Year, YearStr = newDate.Year,
MonthStr = newDate.Month, MonthStr = newDate.Month,
Times = 1 Times = 1,
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList(); })?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
var firstTimeStaticModel = new RB_Teacher_Static_Extend() var firstTimeStaticModel = new RB_Teacher_Static_Extend()
{ {
...@@ -2767,7 +3108,7 @@ namespace Edu.Module.User ...@@ -2767,7 +3108,7 @@ namespace Edu.Module.User
{ {
YearStr = newDate.Year, YearStr = newDate.Year,
MonthStr = newDate.Month, MonthStr = newDate.Month,
Times = 2 Times = 2,
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList(); })?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
var secondTimeStaticModel = new RB_Teacher_Static_Extend() var secondTimeStaticModel = new RB_Teacher_Static_Extend()
{ {
...@@ -2822,15 +3163,15 @@ namespace Edu.Module.User ...@@ -2822,15 +3163,15 @@ namespace Edu.Module.User
teacher_StaticRepository.Insert(secondTimeStaticModel); teacher_StaticRepository.Insert(secondTimeStaticModel);
} }
} }
newModel.Times = times; newModel2.Times = times;
newModel.Group_Id = user.Group_Id; newModel2.Group_Id = user.Group_Id;
newModel.School_Id = user.School_Id; newModel2.School_Id = user.School_Id;
newModel.CreateBy = user.Id; newModel2.CreateBy = user.Id;
newModel.CreateTime = DateTime.Now; newModel2.CreateTime = DateTime.Now;
if (flag) if (flag)
{ {
var newId = teacher_StaticRepository.Insert(newModel); var newId = teacher_StaticRepository.Insert(newModel2);
newModel.Id = newId; newModel2.Id = newId;
flag = newId > 0; flag = newId > 0;
} }
//本月最后一天 //本月最后一天
...@@ -2840,7 +3181,7 @@ namespace Edu.Module.User ...@@ -2840,7 +3181,7 @@ namespace Edu.Module.User
{ {
YearStr = newDate.Year, YearStr = newDate.Year,
MonthStr = newDate.Month, MonthStr = newDate.Month,
Times = 3 Times = 3,
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList(); })?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
var thirdTimeStaticModel = new RB_Teacher_Static_Extend() var thirdTimeStaticModel = new RB_Teacher_Static_Extend()
{ {
...@@ -2886,6 +3227,7 @@ namespace Edu.Module.User ...@@ -2886,6 +3227,7 @@ namespace Edu.Module.User
ActivityNum = curMonthThirdTimeList?.Sum(qitem => qitem.ActivityNum) ?? 0, ActivityNum = curMonthThirdTimeList?.Sum(qitem => qitem.ActivityNum) ?? 0,
YearStr = newDate.Year, YearStr = newDate.Year,
MonthStr = newDate.Month, MonthStr = newDate.Month,
TeacherId = 0,
}; };
thirdTimeStaticModel.Times = 4; thirdTimeStaticModel.Times = 4;
thirdTimeStaticModel.Group_Id = user.Group_Id; thirdTimeStaticModel.Group_Id = user.Group_Id;
......
...@@ -43,6 +43,14 @@ WHERE 1=1 ...@@ -43,6 +43,14 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.Times), query.Times); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.Times), query.Times);
} }
if (query.TeacherId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.TeacherId), query.TeacherId);
}
else
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.TeacherId), 0);
}
} }
builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Student_Static_Extend.Id)); builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Student_Static_Extend.Id));
return Get<RB_Teacher_Static_Extend>(builder.ToString()).ToList(); return Get<RB_Teacher_Static_Extend>(builder.ToString()).ToList();
...@@ -86,6 +94,14 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00' ...@@ -86,6 +94,14 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.YearStr), query.YearStr); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.YearStr), query.YearStr);
} }
} }
if (query.TeacherId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.TeacherId), query.TeacherId);
}
else
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.TeacherId), 0);
}
} }
builder.AppendFormat(" GROUP BY DATE_FORMAT(A.Date, '%Y-%m') "); builder.AppendFormat(" GROUP BY DATE_FORMAT(A.Date, '%Y-%m') ");
builder.AppendFormat(" ORDER BY DATE_FORMAT(A.Date, '%Y-%m') ASC "); builder.AppendFormat(" ORDER BY DATE_FORMAT(A.Date, '%Y-%m') ASC ");
...@@ -122,6 +138,14 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00' ...@@ -122,6 +138,14 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
{ {
builder.AppendFormat(" AND A.{0}<={1} ", nameof(RB_Teacher_Static_Extend.YearStr), query.YearStr); builder.AppendFormat(" AND A.{0}<={1} ", nameof(RB_Teacher_Static_Extend.YearStr), query.YearStr);
} }
if (query.TeacherId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.TeacherId), query.TeacherId);
}
else
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Teacher_Static_Extend.TeacherId), 0);
}
} }
builder.AppendFormat(" GROUP BY A.YearStr "); builder.AppendFormat(" GROUP BY A.YearStr ");
builder.AppendFormat(" ORDER BY A.YearStr ASC "); builder.AppendFormat(" ORDER BY A.YearStr ASC ");
...@@ -133,11 +157,11 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00' ...@@ -133,11 +157,11 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
/// </summary> /// </summary>
/// <param name="DateStr"></param> /// <param name="DateStr"></param>
/// <returns></returns> /// <returns></returns>
public RB_Teacher_Static_Extend GetTeacherStaticByProcRepository(string DateStr) public List<RB_Teacher_Static_Extend> GetTeacherStaticByProcRepository(string DateStr)
{ {
string sql = string.Format("call proc_teacher_static('{0}') ", DateStr); string sql = string.Format("call proc_teacher_static('{0}') ", DateStr);
var list = Get<RB_Teacher_Static_Extend>(sql); var list = Get<RB_Teacher_Static_Extend>(sql).ToList();
return list?.FirstOrDefault(); return list;
} }
/// <summary> /// <summary>
......
...@@ -746,9 +746,9 @@ namespace Edu.ThirdCore.QYWinXin ...@@ -746,9 +746,9 @@ namespace Edu.ThirdCore.QYWinXin
/// </summary> /// </summary>
/// <param name="userIds"></param> /// <param name="userIds"></param>
/// <param name="day"></param> /// <param name="day"></param>
public static int GetWechatStudentStatic(List<string> userIds, DateTime day) public static List<WechatCheck_ViewModel> GetWechatStudentStatic(List<string> userIds, DateTime day)
{ {
int message_cnt = 0; List<WechatCheck_ViewModel> list = new List<WechatCheck_ViewModel>();
string WX_CorpId = "ww8418f1889fdded76"; string WX_CorpId = "ww8418f1889fdded76";
//客户联系秘钥 //客户联系秘钥
string Employee_Secret = "Jpn1_rq00KHuCef4fGAjcsg1dH02ncTPvH5rxshyD9c"; string Employee_Secret = "Jpn1_rq00KHuCef4fGAjcsg1dH02ncTPvH5rxshyD9c";
...@@ -756,32 +756,40 @@ namespace Edu.ThirdCore.QYWinXin ...@@ -756,32 +756,40 @@ namespace Edu.ThirdCore.QYWinXin
DateTime start = new DateTime(day.Year, day.Month, day.Day, 0, 0, 0); DateTime start = new DateTime(day.Year, day.Month, day.Day, 0, 0, 0);
long startt = Common.ConvertHelper.ConvertDateTimeInt(start); long startt = Common.ConvertHelper.ConvertDateTimeInt(start);
long endt = Common.ConvertHelper.ConvertDateTimeInt(start); long endt = Common.ConvertHelper.ConvertDateTimeInt(start);
var request = new
{
start_time = startt,
end_time = endt,
userid = userIds,
partyid=new List<int>()
};
string url = string.Format("https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_user_behavior_data?access_token={0}", token); string url = string.Format("https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_user_behavior_data?access_token={0}", token);
var Rmsg = HttpHelper.HttpPost(url, JsonHelper.Serialize(request), ""); foreach (var item in userIds)
if (!string.IsNullOrEmpty(Rmsg))
{ {
JObject root = JObject.Parse(Rmsg); WechatCheck_ViewModel model = new WechatCheck_ViewModel()
if (root.GetInt("errcode") == 0)
{ {
JArray behavior_data = JArray.Parse(root.GetStringValue("behavior_data")); Acctid = item
if (behavior_data != null && behavior_data.Count > 0) };
var request = new
{
start_time = startt,
end_time = endt,
userid = new List<string>() { item},
partyid = new List<int>()
};
var Rmsg = HttpHelper.HttpPost(url, JsonHelper.Serialize(request), "");
if (!string.IsNullOrEmpty(Rmsg))
{
JObject root = JObject.Parse(Rmsg);
if (root.GetInt("errcode") == 0)
{ {
foreach (var jItem in behavior_data) JArray behavior_data = JArray.Parse(root.GetStringValue("behavior_data"));
if (behavior_data != null && behavior_data.Count > 0)
{ {
JObject sObj = JObject.Parse(jItem.ToString()); foreach (var jItem in behavior_data)
message_cnt += sObj.GetInt("message_cnt"); {
JObject sObj = JObject.Parse(jItem.ToString());
model.MessageCount= sObj.GetInt("message_cnt");
}
} }
} }
} }
list.Add(model);
} }
return message_cnt; return list;
} }
#endregion #endregion
} }
......
...@@ -38,7 +38,8 @@ namespace Edu.WebApi.Controllers.User ...@@ -38,7 +38,8 @@ namespace Edu.WebApi.Controllers.User
var query = new RB_Teacher_Static_Extend() var query = new RB_Teacher_Static_Extend()
{ {
YearStr = base.ParmJObj.GetInt("YearStr"), YearStr = base.ParmJObj.GetInt("YearStr"),
MonthStr = base.ParmJObj.GetInt("MonthStr") MonthStr = base.ParmJObj.GetInt("MonthStr"),
TeacherId=base.ParmJObj.GetInt("TeacherId"),
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
var list = teacherStaticModule.GetTeacherStaticListModule(query); var list = teacherStaticModule.GetTeacherStaticListModule(query);
...@@ -56,7 +57,8 @@ namespace Edu.WebApi.Controllers.User ...@@ -56,7 +57,8 @@ namespace Edu.WebApi.Controllers.User
var query = new RB_Teacher_Static_Extend() var query = new RB_Teacher_Static_Extend()
{ {
YearStr = base.ParmJObj.GetInt("YearStr"), YearStr = base.ParmJObj.GetInt("YearStr"),
MonthStr = base.ParmJObj.GetInt("MonthStr") MonthStr = base.ParmJObj.GetInt("MonthStr"),
TeacherId = base.ParmJObj.GetInt("TeacherId"),
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
var list = teacherStaticModule.GetTeacherStaticListModule(query); var list = teacherStaticModule.GetTeacherStaticListModule(query);
...@@ -150,6 +152,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -150,6 +152,7 @@ namespace Edu.WebApi.Controllers.User
var query = new RB_Teacher_Static_Extend() var query = new RB_Teacher_Static_Extend()
{ {
YearStr = base.ParmJObj.GetInt("YearStr"), YearStr = base.ParmJObj.GetInt("YearStr"),
TeacherId = base.ParmJObj.GetInt("TeacherId"),
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
var list = teacherStaticModule.GetTeacherStaticMonthModule(query); var list = teacherStaticModule.GetTeacherStaticMonthModule(query);
...@@ -167,6 +170,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -167,6 +170,7 @@ namespace Edu.WebApi.Controllers.User
var query = new RB_Teacher_Static_Extend() var query = new RB_Teacher_Static_Extend()
{ {
YearStr = base.ParmJObj.GetInt("YearStr"), YearStr = base.ParmJObj.GetInt("YearStr"),
TeacherId = base.ParmJObj.GetInt("TeacherId"),
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
var list = teacherStaticModule.GetTeacherStaticMonthModule(query); var list = teacherStaticModule.GetTeacherStaticMonthModule(query);
...@@ -260,6 +264,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -260,6 +264,7 @@ namespace Edu.WebApi.Controllers.User
var query = new RB_Teacher_Static_Extend() var query = new RB_Teacher_Static_Extend()
{ {
YearStr = base.ParmJObj.GetInt("YearStr"), YearStr = base.ParmJObj.GetInt("YearStr"),
TeacherId = base.ParmJObj.GetInt("TeacherId"),
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
var list = teacherStaticModule.GetTeacherStaticMonthRateModule(query); var list = teacherStaticModule.GetTeacherStaticMonthRateModule(query);
...@@ -277,6 +282,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -277,6 +282,7 @@ namespace Edu.WebApi.Controllers.User
var query = new RB_Teacher_Static_Extend() var query = new RB_Teacher_Static_Extend()
{ {
YearStr = base.ParmJObj.GetInt("YearStr"), YearStr = base.ParmJObj.GetInt("YearStr"),
TeacherId = base.ParmJObj.GetInt("TeacherId"),
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
var list = teacherStaticModule.GetTeacherStaticMonthRateModule(query); var list = teacherStaticModule.GetTeacherStaticMonthRateModule(query);
...@@ -351,6 +357,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -351,6 +357,7 @@ namespace Edu.WebApi.Controllers.User
var query = new RB_Teacher_Static_Extend() var query = new RB_Teacher_Static_Extend()
{ {
YearStr = base.ParmJObj.GetInt("YearStr"), YearStr = base.ParmJObj.GetInt("YearStr"),
TeacherId = base.ParmJObj.GetInt("TeacherId"),
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
var list = teacherStaticModule.GetTeacherStaticListYearModule(query); var list = teacherStaticModule.GetTeacherStaticListYearModule(query);
...@@ -368,6 +375,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -368,6 +375,7 @@ namespace Edu.WebApi.Controllers.User
var query = new RB_Teacher_Static_Extend() var query = new RB_Teacher_Static_Extend()
{ {
YearStr = base.ParmJObj.GetInt("YearStr"), YearStr = base.ParmJObj.GetInt("YearStr"),
TeacherId = base.ParmJObj.GetInt("TeacherId"),
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
var list = teacherStaticModule.GetTeacherStaticListYearModule(query); var list = teacherStaticModule.GetTeacherStaticListYearModule(query);
...@@ -422,6 +430,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -422,6 +430,7 @@ namespace Edu.WebApi.Controllers.User
var query = new RB_Teacher_Static_Extend() var query = new RB_Teacher_Static_Extend()
{ {
YearStr = base.ParmJObj.GetInt("YearStr"), YearStr = base.ParmJObj.GetInt("YearStr"),
TeacherId = base.ParmJObj.GetInt("TeacherId"),
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
var list = teacherStaticModule.GetTeacherStaticYearRateModule(query); var list = teacherStaticModule.GetTeacherStaticYearRateModule(query);
...@@ -439,6 +448,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -439,6 +448,7 @@ namespace Edu.WebApi.Controllers.User
var query = new RB_Teacher_Static_Extend() var query = new RB_Teacher_Static_Extend()
{ {
YearStr = base.ParmJObj.GetInt("YearStr"), YearStr = base.ParmJObj.GetInt("YearStr"),
TeacherId = base.ParmJObj.GetInt("TeacherId"),
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
var list = teacherStaticModule.GetTeacherStaticYearRateModule(query); var list = teacherStaticModule.GetTeacherStaticYearRateModule(query);
......
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