Commit 8c5a0daf authored by liudong1993's avatar liudong1993

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

parents 0b61890a ad69fee4
......@@ -274,6 +274,15 @@ namespace Edu.Model.Entity.User
/// 考级升级得分
/// </summary>
public decimal GradeTestScore { get; set; }
/// <summary>
/// 跟踪学员条数
/// </summary>
public decimal FinishFollow { get; set; }
/// <summary>
/// 总跟进条数
/// </summary>
public decimal TotalFollow { get; set; }
}
}
\ No newline at end of file
......@@ -30,25 +30,4 @@ namespace Edu.Model.ViewModel.User
/// </summary>
public decimal AssessmentScore { get; set; }
}
/// <summary>
/// 老师跟踪信息
/// </summary>
public class TeacherFollow
{
/// <summary>
/// 教师编号
/// </summary>
public int TeacherId { get; set; }
/// <summary>
/// 跟踪学员条数
/// </summary>
public decimal FollowCount { get; set; }
/// <summary>
/// 完成次数
/// </summary>
public decimal FinishTimes { get; set; }
}
}
......@@ -530,7 +530,7 @@ namespace Edu.Module.Course
Requirement = subItem.Requirement,
CourseRate = subItem.CourseRate,
CurrentHours = subItem.CurrentHours,
ChapterGradeNo = subItem.ChapterGradeNo
ChapterGradeNo = maxLength
};
//父节点
list.Add(parentModel);
......@@ -881,8 +881,10 @@ namespace Edu.Module.Course
oldCourseRate = chapterRepository.GetEntity(model.ChapterId)?.CourseRate ?? Common.Enum.Course.CourseRateEnum.OTHER;
}
flag = chapterRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Chapter_ViewModel.ChapterId), model.ChapterId));
if (flag && model.ParentId == 0) {
if (oldCourseRate != model.CourseRate) {
if (flag && model.ParentId == 0)
{
if (oldCourseRate != model.CourseRate)
{
//修改了等级了 重新初始化
System.Threading.Tasks.Task.Run(() =>
{
......@@ -893,7 +895,8 @@ namespace Edu.Module.Course
}
else
{
if (model.ParentId == 0) {
if (model.ParentId == 0)
{
//查询当前等级对应的NO
int CourseGradeId = chapterRepository.GetMaxChapterGradeNo(model.CourseId, model.ChapterNo, model.CourseRate, model.Group_Id);
model.ChapterGradeNo = CourseGradeId + 1;
......@@ -1073,18 +1076,9 @@ namespace Edu.Module.Course
var courseList = chapterRepository.GetCourseChapterListExtRepository();
if (courseList != null && courseList.Count > 0)
{
foreach (var item in courseList)
var tempCourseList = courseList.Where(qitem => qitem.CourseId == 58 || qitem.CourseId == 10);
foreach (var item in tempCourseList)
{
//if (item.CourseId == 285 || item.CourseId == 215 )
//{
// continue;
//}
//else
//{
//}
List<RB_Course_Chapter_ViewModel> result = new List<RB_Course_Chapter_ViewModel>();
var chapterQuery = new RB_Course_Chapter_ViewModel() { CourseId = item.CourseId };
var sourceList = GetChapterListModule(chapterQuery,isQueryWords:true);
......@@ -1147,14 +1141,14 @@ namespace Edu.Module.Course
}
index++;
}
chapterRepository.DeleteByCourseIdRepository(item.CourseId);
course_WordsRepository.DeleteWordsByCourseIdRepository(item.CourseId);
chapterRepository.SetBatchInsertCourseChapterRepository(result);
if (wordsList != null && wordsList.Count > 0)
{
course_WordsRepository.BatchInsertCourseWordsRepository(wordsList);
}
//chapterRepository.DeleteByCourseIdRepository(item.CourseId);
//course_WordsRepository.DeleteWordsByCourseIdRepository(item.CourseId);
//chapterRepository.SetBatchInsertCourseChapterRepository(result);
//if (wordsList != null && wordsList.Count > 0)
//{
// course_WordsRepository.BatchInsertCourseWordsRepository(wordsList);
//}
}
string str = Common.Plugin.JsonHelper.Serialize(result);
}
......
......@@ -97,6 +97,16 @@ namespace Edu.Module.Customer
consultant_DataRepository.ClearConsultantRepository();
}
/// <summary>
/// 检测指定日期是否已经生成数据
/// </summary>
/// <param name="Date"></param>
/// <returns></returns>
public bool CheckMarketDataModule(string Date)
{
return market_DataRepository.CheckMarketDataExistsRepository(Date);
}
/// <summary>
/// 生成市场部统计数据
/// </summary>
......@@ -307,6 +317,19 @@ namespace Edu.Module.Customer
}
}
/// <summary>
/// 检测指定日期是否已经生成数据
/// </summary>
/// <param name="Date"></param>
/// <returns></returns>
public bool CheckConsultantDataModule(string Date)
{
return consultant_DataRepository.CheckConsultantDataExistsRepository(Date);
}
/// <summary>
/// 生成课程顾问部数据
/// </summary>
......
......@@ -313,10 +313,20 @@ namespace Edu.Module.Duty
item.JoinNum = tempList?.Count()??0;
item.VisitorList = tempList?.ToList() ?? new List<RB_Visitor_Reserve_Extend>();
int OrderCount = 0;
int failCount = 0;
foreach (var subItem in tempList)
{
OrderCount += stuOrderList.Where(qitem => qitem.Student_Id == subItem.Visitor_Id)?.Count() ?? 0;
if (!(stuOrderList.Where(qitem => qitem.Student_Id == subItem.Visitor_Id)?.Count() > 0))
{
failCount++;
}
if ((stuOrderList.Where(qitem => qitem.Student_Id == subItem.Visitor_Id)?.Count() > 0))
{
OrderCount++;
}
}
item.FailCount = failCount;
item.OrderCount = OrderCount;
if (item.OrderCount > 0)
{
......@@ -326,7 +336,6 @@ namespace Edu.Module.Duty
{
item.ConversionRates = 0;
}
item.FailCount = item.JoinNum - item.OrderCount;
}
}
return list;
......
......@@ -1124,81 +1124,81 @@ namespace Edu.Module.User
/// <param name="receiveId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public string SetUserLeaveStudentCareOf(int userId, int receiveId, UserInfo userInfo)
{
var eModel = accountModule.GetEmployeeInfo(userId);
var reModel = accountModule.GetEmployeeInfo(receiveId);
if (eModel == null || reModel == null) { return "转交人不存在"; }
if (reModel.IsLeave != 1) { return "转交人非在职状态,无法交接"; }
//获取学员负责人 / 服务人员
var list = studentRepository.GetUserStudentCareOf(userId, userInfo.Group_Id);
if (list.Any())
{
//查询所有的服务人员
var alist = student_AssistRepository.GetUserStudentAssistCareOf(userId, userInfo.Group_Id);
var trans = studentRepository.DbTransaction;
try
{
foreach (var item in list)
{
bool flag = true;
if (item.CreateBy == userId) {
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Student_ViewModel.CreateBy), receiveId}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName = nameof(RB_Student_ViewModel.StuId),
FiledValue = item.StuId,
OperatorEnum =OperatorEnum.Equal
}
};
flag = studentRepository.Update(keyValues, wheres, trans);
}
if (flag) {
var clist = alist.Where(x => x.StuId == item.StuId).ToList();
foreach (var qitem in clist) {
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Student_Assist_Extend.AssistId),receiveId},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName = nameof(RB_Student_Assist_Extend.Id),
FiledValue = qitem.Id,
OperatorEnum =OperatorEnum.Equal
}
};
flag = student_AssistRepository.Update(keyValues, wheres, trans);
}
}
if (flag) {
//插入日志
student_LogRepository.Insert(new Model.Entity.Customer.RB_Student_Log()
{
CreateBy = userInfo.Id,
CreateTime = DateTime.Now,
CreateType = 1,
Group_Id = userInfo.Group_Id,
LogContent = "离职转交客人负责人与服务人员,由【" + eModel.EmployeeName + "(" + userId + ")" + "】转交给【" + reModel.EmployeeName + "(" + receiveId + ")" + "】",
LogId = 0,
LogTitle = "离职转交学员",
LogType = Common.Enum.Log.StudentLogTypeEnum.BasicInfo,
StuId = item.StuId
}, trans);
}
}
studentRepository.DBSession.Commit();
}
catch (Exception ex)
{
LogHelper.Write(ex, "SetUserLeaveStudentCareOf");
studentRepository.DBSession.Rollback();
return "学员转交出错了,请联系管理员";
}
}
return "";
}
//public string SetUserLeaveStudentCareOf(int userId, int receiveId, UserInfo userInfo)
//{
// var eModel = accountModule.GetEmployeeInfo(userId);
// var reModel = accountModule.GetEmployeeInfo(receiveId);
// if (eModel == null || reModel == null) { return "转交人不存在"; }
// if (reModel.IsLeave != 1) { return "转交人非在职状态,无法交接"; }
// //获取学员负责人 / 服务人员
// var list = studentRepository.GetUserStudentCareOf(userId, userInfo.Group_Id);
// if (list.Any())
// {
// //查询所有的服务人员
// var alist = student_AssistRepository.GetUserStudentAssistCareOf(userId, userInfo.Group_Id);
// var trans = studentRepository.DbTransaction;
// try
// {
// foreach (var item in list)
// {
// bool flag = true;
// if (item.CreateBy == userId) {
// Dictionary<string, object> keyValues = new Dictionary<string, object>() {
// { nameof(RB_Student_ViewModel.CreateBy), receiveId}
// };
// List<WhereHelper> wheres = new List<WhereHelper>() {
// new WhereHelper(){
// FiledName = nameof(RB_Student_ViewModel.StuId),
// FiledValue = item.StuId,
// OperatorEnum =OperatorEnum.Equal
// }
// };
// flag = studentRepository.Update(keyValues, wheres, trans);
// }
// if (flag) {
// var clist = alist.Where(x => x.StuId == item.StuId).ToList();
// foreach (var qitem in clist) {
// Dictionary<string, object> keyValues = new Dictionary<string, object>() {
// { nameof(RB_Student_Assist_Extend.AssistId),receiveId},
// };
// List<WhereHelper> wheres = new List<WhereHelper>() {
// new WhereHelper(){
// FiledName = nameof(RB_Student_Assist_Extend.Id),
// FiledValue = qitem.Id,
// OperatorEnum =OperatorEnum.Equal
// }
// };
// flag = student_AssistRepository.Update(keyValues, wheres, trans);
// }
// }
// if (flag) {
// //插入日志
// student_LogRepository.Insert(new Model.Entity.Customer.RB_Student_Log()
// {
// CreateBy = userInfo.Id,
// CreateTime = DateTime.Now,
// CreateType = 1,
// Group_Id = userInfo.Group_Id,
// LogContent = "离职转交客人负责人与服务人员,由【" + eModel.EmployeeName + "(" + userId + ")" + "】转交给【" + reModel.EmployeeName + "(" + receiveId + ")" + "】",
// LogId = 0,
// LogTitle = "离职转交学员",
// LogType = Common.Enum.Log.StudentLogTypeEnum.BasicInfo,
// StuId = item.StuId
// }, trans);
// }
// }
// studentRepository.DBSession.Commit();
// }
// catch (Exception ex)
// {
// LogHelper.Write(ex, "SetUserLeaveStudentCareOf");
// studentRepository.DBSession.Rollback();
// return "学员转交出错了,请联系管理员";
// }
// }
// return "";
//}
#endregion
}
......
......@@ -259,18 +259,18 @@ namespace Edu.Module.User
AssistList = item.AssistList,
StuChannel = item.StuChannel,
StuChannelName = item.StuChannelName,
CreateType=item.CreateType,
CreateType = item.CreateType,
CreateTypeName = item.CreateType.ToName(),
StuSourceId= item.StuSourceId,
StuSourceIdName= item.StuSourceIdName,
EnterpriseName= item.EnterpriseName,
StuPurpose= item.StuPurpose,
StuPurposeName= item.StuPurposeName,
AdvisorWinRate= item.AdvisorWinRate,
StuSourceId = item.StuSourceId,
StuSourceIdName = item.StuSourceIdName,
EnterpriseName = item.EnterpriseName,
StuPurpose = item.StuPurpose,
StuPurposeName = item.StuPurposeName,
AdvisorWinRate = item.AdvisorWinRate,
AdvisorExpectDate = item.AdvisorExpectDate,
AdvisorStatus=item.AdvisorStatus,
AdvisorStatusName= item.AdvisorStatusName,
AdvisorList=item.AdvisorList,
AdvisorStatus = item.AdvisorStatus,
AdvisorStatusName = item.AdvisorStatusName,
AdvisorList = item.AdvisorList,
BeginClassDate = Common.ConvertHelper.FormatDate(item.BeginClassDate),
GraduationTime = Common.ConvertHelper.FormatDate(item.GraduationTime),
};
......@@ -3045,6 +3045,16 @@ namespace Edu.Module.User
return yearList;
}
/// <summary>
/// 检测指定日期是否已经生成统计数据
/// </summary>
/// <param name="Date"></param>
/// <returns></returns>
public bool CheckStudentStaticModule(string Date)
{
return student_StaticRepository.CheckStudentStaticExistsRepository(Date);
}
/// <summary>
/// 生成每天数据
/// </summary>
......@@ -3362,6 +3372,17 @@ namespace Edu.Module.User
#endregion
#region 市场部客户数据统计
/// <summary>
/// 检测指定日期是否已经生成数据
/// </summary>
/// <param name="Date"></param>
/// <returns></returns>
public bool CheckStudentMarketModule(string Date)
{
return student_MarketRepository.CheckStudentMarketExistsRepository(Date);
}
/// <summary>
/// 生成市场部每天数据
/// </summary>
......@@ -6286,7 +6307,7 @@ namespace Edu.Module.User
StudyOrderMoney = Math.Round(monthList?.Average(qitem => qitem.StudyOrderMoney) ?? 0, 2),
OrderNotMoney = Math.Round(monthList?.Average(qitem => qitem.OrderNotMoney) ?? 0, 2),
StudyOrderNotMoney = Math.Round(monthList?.Average(qitem => qitem.StudyOrderNotMoney) ?? 0, 2),
ClassStudentCount= Math.Round(monthList?.Average(qitem => qitem.ClassStudentCount) ?? 0, 2),
ClassStudentCount = Math.Round(monthList?.Average(qitem => qitem.ClassStudentCount) ?? 0, 2),
};
var sumModel = new RB_Student_Company_Extend()
......@@ -6325,7 +6346,7 @@ namespace Edu.Module.User
StudyOrderMoney = monthList?.Sum(qitem => qitem.StudyOrderMoney) ?? 0,
OrderNotMoney = monthList?.Sum(qitem => qitem.OrderNotMoney) ?? 0,
StudyOrderNotMoney = monthList?.Sum(qitem => qitem.StudyOrderNotMoney) ?? 0,
ClassStudentCount= monthList?.Sum(qitem => qitem.ClassStudentCount) ?? 0,
ClassStudentCount = monthList?.Sum(qitem => qitem.ClassStudentCount) ?? 0,
};
monthList.Add(avgModel);
monthList.Add(sumModel);
......@@ -8545,6 +8566,17 @@ namespace Edu.Module.User
return yearList;
}
/// <summary>
/// 检测指定日期是否已经生成数据
/// </summary>
/// <param name="Date"></param>
/// <returns></returns>
public bool CheckStudentCompanyModule (string Date)
{
return student_CompanyRepository.CheckStudentCompanyExistsRepository(Date);
}
/// <summary>
/// 生成全公司每天数据
/// </summary>
......@@ -8895,7 +8927,7 @@ namespace Edu.Module.User
{
if (item.Times == 1)
{
var lastMonthDay =new DateTime(item.YearStr,item.MonthStr,1).AddMonths(-1);
var lastMonthDay = new DateTime(item.YearStr, item.MonthStr, 1).AddMonths(-1);
var lastMonthLastTimeList = student_StaticRepository.GetStudentStaticListRepository(new RB_Student_Static_Extend()
{
YearStr = lastMonthDay.Year,
......@@ -8971,7 +9003,7 @@ namespace Edu.Module.User
}
}
}
var marketList = student_MarketRepository.GetStudentMarketListRepository(new RB_Student_Market_Extend() { IsQueryNotMoney = 1 });
if (marketList != null && marketList.Count > 0)
{
......
......@@ -311,13 +311,19 @@ namespace Edu.Module.User
TeacherAccountId = TeacherAccountId
});
}
var detailsList = teacher_Assessment_DetailsRepository.GetTeacherAssessmentDetailsListRepository(new RB_Teacher_Assessment_Details_Extend()
var detailsList = new List<RB_Teacher_Assessment_Details_Extend>();
if (extModel != null && extModel.Id > 0)
{
TeacherAssessmentId = (extModel?.Id ?? 0),
CreateBy = userInfo.Id,
CheckType = CheckType
});
detailsList = teacher_Assessment_DetailsRepository.GetTeacherAssessmentDetailsListRepository(new RB_Teacher_Assessment_Details_Extend()
{
TeacherAssessmentId = (extModel?.Id ?? 0),
CreateBy = userInfo.Id,
CheckType = CheckType
});
}
var typeList = GetAssessmentTypeListModule(new RB_Assessment_Type_Extend() { });
var maxOptionList = new List<SubtypeItem>();
int maxLength = 0;
......@@ -353,7 +359,10 @@ namespace Edu.Module.User
List<object> subList = new List<object>();
foreach (var subItem in item.SubtypeList)
{
var tempDetail = detailsList.Where(qitem => qitem.AssessmentTypeId == item.Id && qitem.AssessmentSubTypeId == subItem.Id && qitem.CheckType == CheckType)?.FirstOrDefault();
var tempDetail = detailsList.Where(qitem =>
qitem.AssessmentTypeId == item.Id
&& qitem.AssessmentSubTypeId == subItem.Id
&& qitem.CheckType == CheckType)?.FirstOrDefault();
List<object> optionList = new List<object>();
foreach (var tItem in subItem.OptionList)
{
......
This diff is collapsed.
......@@ -128,15 +128,24 @@ namespace Edu.Repository.Course
/// <returns></returns>
public bool SetBatchCurrentHoursRepository(List<RB_Course_Chapter_ViewModel> param)
{
StringBuilder builder = new StringBuilder();
builder.Append("INSERT INTO rb_course_chapter (ChapterId, CurrentHours) VALUES");
param.ForEach(x =>
bool flag = false;
try
{
builder.Append($"({x.ChapterId},'{x.CurrentHours}'),");
});
builder = builder.Remove(builder.Length - 1, 1);
builder.Append("ON DUPLICATE KEY UPDATE CurrentHours=VALUES(CurrentHours);");
return Execute(builder.ToString()) > 0;
StringBuilder builder = new StringBuilder();
builder.Append("INSERT INTO rb_course_chapter (ChapterId, CurrentHours) VALUES");
param.ForEach(x =>
{
builder.Append($"({x.ChapterId},'{x.CurrentHours}'),");
});
builder = builder.Remove(builder.Length - 1, 1);
builder.Append("ON DUPLICATE KEY UPDATE CurrentHours=VALUES(CurrentHours);");
flag= Execute(builder.ToString()) > 0;
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "SetBatchCurrentHoursRepository");
}
return flag;
}
/// <summary>
......
......@@ -121,6 +121,23 @@ WHERE 1=1
return newId > 0;
}
/// <summary>
/// 检测指定日期是否已经生成数据
/// </summary>
/// <param name="Date"></param>
/// <returns></returns>
public bool CheckConsultantDataExistsRepository(string Date)
{
int result = 0;
string sql = string.Format("SELECT COUNT(1) FROM RB_Consultant_Data WHERE DATE_FORMAT(Date,'%y/%m/%d')= DATE_FORMAT('{0}','%y/%m/%d') ", Date);
var obj = base.ExecuteScalar(sql);
if (obj != null)
{
Int32.TryParse(obj.ToString(), out result);
}
return result > 0;
}
/// <summary>
/// 清除课程顾问部历史数据
/// </summary>
......
......@@ -84,5 +84,7 @@ WHERE 1=1
}
return Get<RB_Consultant_Goal_Extend>(builder.ToString()).ToList();
}
}
}
......@@ -111,6 +111,23 @@ WHERE 1=1
return newId > 0;
}
/// <summary>
/// 检测指定日期是否已经生成数据
/// </summary>
/// <param name="Date"></param>
/// <returns></returns>
public bool CheckMarketDataExistsRepository(string Date)
{
int result = 0;
string sql = string.Format("SELECT COUNT(1) FROM RB_Market_Data WHERE DATE_FORMAT(Date,'%y/%m/%d')= DATE_FORMAT('{0}','%y/%m/%d') ", Date);
var obj = base.ExecuteScalar(sql);
if (obj != null)
{
Int32.TryParse(obj.ToString(), out result);
}
return result > 0;
}
/// <summary>
/// 清楚历史数据
/// </summary>
......
......@@ -145,6 +145,23 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
return list?.FirstOrDefault();
}
/// <summary>
/// 检测指定日期是否已经生成数据
/// </summary>
/// <param name="Date"></param>
/// <returns></returns>
public bool CheckStudentCompanyExistsRepository(string Date)
{
int result = 0;
string sql = string.Format("SELECT COUNT(1) FROM RB_Student_Company WHERE DATE_FORMAT(Date,'%y/%m/%d')= DATE_FORMAT('{0}','%y/%m/%d') ", Date);
var obj = base.ExecuteScalar(sql);
if (obj != null)
{
Int32.TryParse(obj.ToString(), out result);
}
return result > 0;
}
/// <summary>
/// 清楚全公司客户统计数据
/// </summary>
......
......@@ -141,6 +141,23 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
return list?.FirstOrDefault();
}
/// <summary>
/// 检测指定日期是否已经生成数据
/// </summary>
/// <param name="Date"></param>
/// <returns></returns>
public bool CheckStudentMarketExistsRepository(string Date)
{
int result = 0;
string sql = string.Format("SELECT COUNT(1) FROM RB_Student_Market WHERE DATE_FORMAT(Date,'%y/%m/%d')= DATE_FORMAT('{0}','%y/%m/%d') ", Date);
var obj = base.ExecuteScalar(sql);
if (obj != null)
{
Int32.TryParse(obj.ToString(), out result);
}
return result > 0;
}
/// <summary>
/// 清除市场部客户数据统计信息
/// </summary>
......
......@@ -146,6 +146,25 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
return list?.FirstOrDefault();
}
/// <summary>
/// 检测指定日期是否已经生成数据
/// </summary>
/// <param name="Date"></param>
/// <returns></returns>
public bool CheckStudentStaticExistsRepository(string Date)
{
int result = 0;
string sql = string.Format("SELECT COUNT(1) FROM RB_Student_Static WHERE DATE_FORMAT(Date,'%y/%m/%d')= DATE_FORMAT('{0}','%y/%m/%d') ", Date);
var obj = base.ExecuteScalar(sql);
if (obj != null)
{
Int32.TryParse(obj.ToString(), out result);
}
return result > 0;
}
/// <summary>
/// 清楚数据
/// </summary>
......
......@@ -29,7 +29,8 @@ SELECT DATE_FORMAT(A.Date, '%Y-%m-%d') AS Date,A.YearStr,SUM(StudentCount) AS St
,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
,SUM(SpeakClassScore) AS SpeakClassScore,SUM(SpeakVipScore) AS SpeakVipScore,SUM(GradeTestScore) AS GradeTestScore,SUM(SpeakFailScore) AS SpeakFailScore
,SUM(SpeakClassScore) AS SpeakClassScore,SUM(SpeakVipScore) AS SpeakVipScore,SUM(GradeTestScore) AS GradeTestScore,SUM(SpeakFailScore) AS SpeakFailScore,SUM(FinishFollow) AS FinishFollow
,SUM(TotalFollow) AS TotalFollow
FROM RB_Teacher_Static AS A
WHERE 1=1
");
......@@ -88,7 +89,8 @@ SELECT A.TeacherId,CONCAT(DATE_FORMAT(A.Date, '%Y-%m'),'-01') AS Date,A.YearStr,
,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
,SUM(SpeakClassScore) AS SpeakClassScore,SUM(SpeakVipScore) AS SpeakVipScore,SUM(GradeTestScore) AS GradeTestScore,SUM(SpeakFailScore) AS SpeakFailScore
,SUM(SpeakClassScore) AS SpeakClassScore,SUM(SpeakVipScore) AS SpeakVipScore,SUM(GradeTestScore) AS GradeTestScore,SUM(SpeakFailScore) AS SpeakFailScore,SUM(FinishFollow) AS FinishFollow
,MAX(TotalFollow) AS TotalFollow
FROM RB_Teacher_Static AS A
WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00' AND A.TeacherId>0
");
......@@ -133,7 +135,8 @@ SELECT CONCAT(DATE_FORMAT(A.Date, '%Y-%m'),'-01') AS Date,A.YearStr,SUM(StudentC
,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
,SUM(SpeakClassScore) AS SpeakClassScore,SUM(SpeakVipScore) AS SpeakVipScore,SUM(GradeTestScore) AS GradeTestScore,SUM(SpeakFailScore) AS SpeakFailScore
,SUM(SpeakClassScore) AS SpeakClassScore,SUM(SpeakVipScore) AS SpeakVipScore,SUM(GradeTestScore) AS GradeTestScore,SUM(SpeakFailScore) AS SpeakFailScore,SUM(FinishFollow) AS FinishFollow
,MAX(TotalFollow) AS TotalFollow
FROM RB_Teacher_Static AS A
WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
");
......@@ -185,7 +188,8 @@ SELECT CONCAT(A.YearStr,'-01','-01') AS Date,A.YearStr,SUM(StudentCount) AS Stud
,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
,SUM(SpeakClassScore) AS SpeakClassScore,SUM(SpeakVipScore) AS SpeakVipScore,SUM(GradeTestScore) AS GradeTestScore,SUM(SpeakFailScore) AS SpeakFailScore
,SUM(SpeakClassScore) AS SpeakClassScore,SUM(SpeakVipScore) AS SpeakVipScore,SUM(GradeTestScore) AS GradeTestScore,SUM(SpeakFailScore) AS SpeakFailScore,SUM(FinishFollow) AS FinishFollow
,MAX(TotalFollow) AS TotalFollow
FROM RB_Teacher_Static AS A
WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
");
......@@ -225,16 +229,23 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
return list;
}
/// <summary>
/// 根据存储过程统计教师跟踪信息
/// 检测指定日期是否已经生成数据
/// </summary>
/// <param name="DateStr"></param>
/// <param name="Date"></param>
/// <returns></returns>
public List<TeacherFollow> GetTeacherFollowByProcRepository(string DateStr)
public bool CheckTeacherStaticExistsRepository(string Date)
{
string sql = string.Format("call proc_teacher_follow('{0}') ", DateStr);
var list = Get<TeacherFollow>(sql).ToList();
return list;
int result = 0;
string sql = string.Format("SELECT COUNT(1) FROM RB_Teacher_Static WHERE DATE_FORMAT(Date,'%y/%m/%d')= DATE_FORMAT('{0}','%y/%m/%d') ", Date);
var obj = base.ExecuteScalar(sql);
if (obj != null)
{
Int32.TryParse(obj.ToString(), out result);
}
return result > 0;
}
/// <summary>
......
......@@ -671,7 +671,6 @@ namespace Edu.WebApi.Controllers.Course
Objectives = base.ParmJObj.GetStringValue("Objectives"),
Requirement = base.ParmJObj.GetStringValue("Requirement"),
CourseRate = (CourseRateEnum)base.ParmJObj.GetInt("CourseRate"),
//CurrentHours=base.ParmJObj.GetInt("CurrentHours"),
};
extModel.Status = DateStateEnum.Normal;
......
......@@ -43,22 +43,24 @@ namespace Edu.WebApi.Controllers.DataService
query.Group_Id = base.UserInfo.Group_Id;
var result = teacherAssessmentModule.GetAssessmentTypeListModule(query);
List<object> list = new List<object>();
List<object> header = new List<object>();
header.Add(new
List<object> header = new List<object>
{
name = "TypeName",
label = "类别",
field = "TypeName",
align = "left"
});
new
{
name = "TypeName",
label = "类别",
field = "TypeName",
align = "left"
},
header.Add(new
{
name = "SubtypeList",
label = "内容",
field = "SubtypeList",
align = "left"
});
new
{
name = "SubtypeList",
label = "内容",
field = "SubtypeList",
align = "left"
}
};
if (result != null && result.Count > 0)
{
var optionList = new List<SubtypeItem>();
......
......@@ -36,12 +36,7 @@ namespace Edu.WebApi.Controllers.User
/// 学员统计
/// </summary>
private readonly StudentStatModule studentStatModule = new StudentStatModule();
/// <summary>
/// OKR处理类
/// </summary>
private readonly OKRPeriodModule okrPeriodModule = new OKRPeriodModule();
/// <summary>
/// 员工处理类
/// </summary>
......
......@@ -74,9 +74,9 @@ namespace Edu.WebApi.Controllers.User
ExcelRows = new List<ExcelColumn>()
{
new ExcelColumn("日期"){ CellWidth=15},
new ExcelColumn("学生人次"){ CellWidth=15},
new ExcelColumn("班主任与学生互动"){ CellWidth=15},
new ExcelColumn("班主任与学生互动得分"){ CellWidth=15},
new ExcelColumn("上课时数"){ CellWidth=15},
//new ExcelColumn("线上与学生互动数"){ CellWidth=10},
new ExcelColumn("续约(含留学)"){ CellWidth=15},
new ExcelColumn("学生升级"){ CellWidth=15},
new ExcelColumn("考级升级"){ CellWidth=15},
......@@ -109,9 +109,9 @@ namespace Edu.WebApi.Controllers.User
{
new ExcelColumn(dObj.GetStringValue("DateStr"))
};
columns.Add(new ExcelColumn(dObj.GetStringValue("StudentCount")));
columns.Add(new ExcelColumn(dObj.GetStringValue("FinishFollow") +"/"+ dObj.GetStringValue("TotalFollow")));
columns.Add(new ExcelColumn(dObj.GetStringValue("OnLineInteractiveScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("AttendClassHourScore")));
//columns.Add(new ExcelColumn(dObj.GetStringValue("OnLineInteractiveScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("RenewScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("UpgradeScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("GradeTestScore")));
......@@ -195,10 +195,9 @@ namespace Edu.WebApi.Controllers.User
ExcelRows = new List<ExcelColumn>()
{
new ExcelColumn("老师"){ CellWidth=15},
new ExcelColumn("学生人次"){ CellWidth=15},
new ExcelColumn("班主任学生互动"){ CellWidth=15},
new ExcelColumn("班主任学生互动得分"){ CellWidth=15},
new ExcelColumn("上课时数"){ CellWidth=15},
//new ExcelColumn("线上与学生互动数"){ CellWidth=10},
new ExcelColumn("续约(含留学)"){ CellWidth=15},
new ExcelColumn("学生升级"){ CellWidth=15},
new ExcelColumn("考级升级"){ CellWidth=15},
......@@ -232,10 +231,10 @@ namespace Edu.WebApi.Controllers.User
{
new ExcelColumn(dObj.GetStringValue("DateStr"))
};
columns.Add(new ExcelColumn(dObj.GetStringValue("StudentCount")));
columns.Add(new ExcelColumn(dObj.GetStringValue("FinishTimes") + "/" + dObj.GetStringValue("FollowCount")));
columns.Add(new ExcelColumn(dObj.GetStringValue("FinishFollow") + "/" + dObj.GetStringValue("TotalFollow")));
columns.Add(new ExcelColumn(dObj.GetStringValue("OnLineInteractiveScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("AttendClassHourScore")));
//columns.Add(new ExcelColumn(dObj.GetStringValue("OnLineInteractiveScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("RenewScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("UpgradeScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("GradeTestScore")));
......@@ -318,7 +317,7 @@ namespace Edu.WebApi.Controllers.User
ExcelRows = new List<ExcelColumn>()
{
new ExcelColumn("日期"){ CellWidth=15},
new ExcelColumn("学生人次"){ CellWidth=15},
//new ExcelColumn("学生人次"){ CellWidth=15},
new ExcelColumn("上课时数"){ CellWidth=15},
//new ExcelColumn("线上与学生互动数"){ CellWidth=10},
new ExcelColumn("续约(含留学)"){ CellWidth=15},
......@@ -353,7 +352,7 @@ namespace Edu.WebApi.Controllers.User
{
new ExcelColumn(dObj.GetStringValue("DateStr"))
};
columns.Add(new ExcelColumn(dObj.GetStringValue("StudentCount")));
//columns.Add(new ExcelColumn(dObj.GetStringValue("StudentCount")));
columns.Add(new ExcelColumn(dObj.GetStringValue("AttendClassHourScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("OnLineInteractiveScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("RenewScore")));
......
......@@ -147,7 +147,7 @@ namespace Edu.WebApi.Timers
marketTimer = new System.Timers.Timer()
{
Interval = (1000 * 60) * (5) //5分钟执行一次
Interval = (1000 * 60) * (5) //20分钟执行一次
};
marketTimer.Elapsed += new System.Timers.ElapsedEventHandler(DealMarketConsultantData);
marketTimer.Enabled = true;
......@@ -196,7 +196,6 @@ namespace Edu.WebApi.Timers
private static int dealStudentNotMoney_Timer = 0;
private static readonly string createMarkDataKey = "createMarkDataKey";
private static readonly string dealStudentProgress = "dealStudentProgress";
/// <summary>
......@@ -235,27 +234,39 @@ namespace Edu.WebApi.Timers
if (Interlocked.Exchange(ref marketconsultant_Timer, 1) == 0)
{
var today = DateTime.Now;
if (today.Hour >= 8 && today.Hour <= 10)
var currentDate = Common.ConvertHelper.FormatDate(today);
var startDate = Common.ConvertHelper.FormatDate(today.AddDays(-1));
if (!marketConsultantModule.CheckConsultantDataModule(startDate))
{
var currentDate = Common.ConvertHelper.FormatDate(today);
string cacheData = redis.Get(createMarkDataKey);
if (string.IsNullOrEmpty(cacheData))
{
redis.Set(createMarkDataKey, currentDate);
cacheData = currentDate;
}
if (!string.IsNullOrEmpty(cacheData) && cacheData != currentDate)
{
marketConsultantModule.CreateConsultantDataModule(today);
marketConsultantModule.CreateMarketDataModule(today);
UserInfo user = UserReidsCache.GetUserLoginInfo("1");
var startDate = Common.ConvertHelper.FormatDate(today.AddDays(-1));
studentStatModule.CreateStudentStaticModule(user, startDate, currentDate, isInit: false);
studentStatModule.CreateStudentMarketModule(user, startDate, currentDate, isInit: false);
studentStatModule.CreateStudentCompanyModule(user, startDate, currentDate, isInit: false);
teacherStaticModule.CreateTeacherStaticModule(user, startDate, currentDate, isInit: false);
redis.Set(createMarkDataKey, currentDate);
}
marketConsultantModule.CreateConsultantDataModule(today);
Common.Plugin.LogHelper.Write("CreateConsultantDataModule:" + startDate);
}
if (!marketConsultantModule.CheckMarketDataModule(startDate))
{
marketConsultantModule.CreateMarketDataModule(today);
Common.Plugin.LogHelper.Write("CreateMarketDataModule:" + startDate);
}
//缓存信息
UserInfo user = UserReidsCache.GetUserLoginInfo("1");
if (!studentStatModule.CheckStudentStaticModule(startDate))
{
studentStatModule.CreateStudentStaticModule(user, startDate, currentDate, isInit: false);
Common.Plugin.LogHelper.Write("CreateStudentStaticModule:" + startDate);
}
if (!studentStatModule.CheckStudentMarketModule(startDate))
{
studentStatModule.CreateStudentMarketModule(user, startDate, currentDate, isInit: false);
Common.Plugin.LogHelper.Write("CreateStudentMarketModule:" + startDate);
}
if (!studentStatModule.CheckStudentCompanyModule(startDate))
{
studentStatModule.CreateStudentCompanyModule(user, startDate, currentDate, isInit: false);
Common.Plugin.LogHelper.Write("CreateStudentCompanyModule:" + startDate);
}
if (!teacherStaticModule.CheckTeacherStaticExistsModule(startDate))
{
teacherStaticModule.CreateTeacherStaticModule(user, startDate, currentDate, isInit: false);
Common.Plugin.LogHelper.Write("CreateTeacherStaticModule:" + startDate);
}
Interlocked.Exchange(ref marketconsultant_Timer, 0);
}
......
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