Commit 7f837acc authored by 黄奎's avatar 黄奎

页面修改

parent 0c6c3402
......@@ -26,5 +26,10 @@ namespace Edu.Model.ViewModel.User
return Common.ConvertHelper.FormatDate2(this.Date);
}
}
/// <summary>
/// 查询待收金额不为0的数据
/// </summary>
public int IsQueryNotMoney { get; set; }
}
}
......@@ -25,5 +25,10 @@ namespace Edu.Model.ViewModel.User
return Common.ConvertHelper.FormatDate2(this.Date);
}
}
/// <summary>
/// 查询待收金额不为0的数据
/// </summary>
public int IsQueryNotMoney { get; set; }
}
}
......@@ -26,6 +26,11 @@ namespace Edu.Model.ViewModel.User
return Common.ConvertHelper.FormatDate2(this.Date);
}
}
/// <summary>
/// 查询待收金额不为0的数据
/// </summary>
public int IsQueryNotMoney { get; set; }
}
/// <summary>
......
......@@ -10,6 +10,7 @@ using Edu.Repository.User;
using System;
using System.Collections.Generic;
using System.Linq;
using VT.FW.DB;
namespace Edu.Module.User
{
......@@ -3354,7 +3355,7 @@ namespace Edu.Module.User
YearStr = newDate.Year,
MonthStr = newDate.Month,
};
thirdTimeStaticModel.Times = 3;
thirdTimeStaticModel.Times = 4;
thirdTimeStaticModel.Group_Id = user.Group_Id;
thirdTimeStaticModel.School_Id = user.School_Id;
thirdTimeStaticModel.CreateBy = user.Id;
......@@ -3640,7 +3641,7 @@ namespace Edu.Module.User
YearStr = newDate.Year,
MonthStr = newDate.Month,
};
thirdTimeStaticModel.Times = 3;
thirdTimeStaticModel.Times = 4;
thirdTimeStaticModel.Group_Id = user.Group_Id;
thirdTimeStaticModel.School_Id = user.School_Id;
thirdTimeStaticModel.CreateBy = user.Id;
......@@ -8844,7 +8845,7 @@ namespace Edu.Module.User
YearStr = newDate.Year,
MonthStr = newDate.Month,
};
thirdTimeStaticModel.Times = 3;
thirdTimeStaticModel.Times = 4;
thirdTimeStaticModel.Group_Id = user.Group_Id;
thirdTimeStaticModel.School_Id = user.School_Id;
thirdTimeStaticModel.CreateBy = user.Id;
......@@ -8856,5 +8857,323 @@ namespace Edu.Module.User
}
#endregion
#region 重新计算市场、课程顾问、全公司数据统计的待收金额
/// <summary>
/// 重新计算统计数据语培待收和留学待收
/// </summary>
/// <returns></returns>
public bool CalcStudentNotMoneyModule()
{
bool flag = false;
//课程顾问部数据
var consultantList = student_StaticRepository.GetStudentStaticListRepository(new RB_Student_Static_Extend() { IsQueryNotMoney = 1 });
if (consultantList != null && consultantList.Count > 0)
{
foreach (var item in consultantList)
{
if (!string.IsNullOrEmpty(item.DateStr))
{
var newModel = student_StaticRepository.GetStudentStaticByProcRepository(Common.ConvertHelper.FormatDate(item.Date), "");
if (item.OrderNotMoney != newModel.OrderNotMoney || item.StudyOrderNotMoney != newModel.StudyOrderNotMoney)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Static_Extend.OrderMoney),newModel.OrderMoney },
{nameof(RB_Student_Static_Extend.OrderNotMoney),newModel.OrderNotMoney },
{nameof(RB_Student_Static_Extend.StudyOrderMoney),newModel.StudyOrderMoney },
{nameof(RB_Student_Static_Extend.StudyOrderNotMoney),newModel.StudyOrderNotMoney },
};
flag = student_StaticRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Static_Extend.Id), item.Id));
}
}
else
{
if (item.Times == 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,
MonthStr = lastMonthDay.Month,
Times = 3
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Static_Extend.OrderMoney),lastMonthLastTimeList?.Sum(qitem=>qitem.OrderMoney)??0 },
{nameof(RB_Student_Static_Extend.OrderNotMoney),lastMonthLastTimeList?.Sum(qitem=>qitem.OrderNotMoney)??0 },
{nameof(RB_Student_Static_Extend.StudyOrderMoney),lastMonthLastTimeList?.Sum(qitem=>qitem.StudyOrderMoney)??0 },
{nameof(RB_Student_Static_Extend.StudyOrderNotMoney),lastMonthLastTimeList?.Sum(qitem=>qitem.StudyOrderNotMoney)??0 },
};
flag = student_StaticRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Static_Extend.Id), item.Id));
}
if (item.Times == 2)
{
var curMonthFirstTimeList = student_StaticRepository.GetStudentStaticListRepository(new RB_Student_Static_Extend()
{
YearStr = item.YearStr,
MonthStr = item.MonthStr,
Times = 1
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Static_Extend.OrderMoney),curMonthFirstTimeList?.Sum(qitem=>qitem.OrderMoney)??0 },
{nameof(RB_Student_Static_Extend.OrderNotMoney),curMonthFirstTimeList?.Sum(qitem=>qitem.OrderNotMoney)??0 },
{nameof(RB_Student_Static_Extend.StudyOrderMoney),curMonthFirstTimeList?.Sum(qitem=>qitem.StudyOrderMoney)??0 },
{nameof(RB_Student_Static_Extend.StudyOrderNotMoney),curMonthFirstTimeList?.Sum(qitem=>qitem.StudyOrderNotMoney)??0 },
};
flag = student_StaticRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Static_Extend.Id), item.Id));
}
if (item.Times == 3)
{
var curMonthSecondTimeList = student_StaticRepository.GetStudentStaticListRepository(new RB_Student_Static_Extend()
{
YearStr = item.YearStr,
MonthStr = item.MonthStr,
Times = 2
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Static_Extend.OrderMoney),curMonthSecondTimeList?.Sum(qitem=>qitem.OrderMoney)??0 },
{nameof(RB_Student_Static_Extend.OrderNotMoney),curMonthSecondTimeList?.Sum(qitem=>qitem.OrderNotMoney)??0 },
{nameof(RB_Student_Static_Extend.StudyOrderMoney),curMonthSecondTimeList?.Sum(qitem=>qitem.StudyOrderMoney)??0 },
{nameof(RB_Student_Static_Extend.StudyOrderNotMoney),curMonthSecondTimeList?.Sum(qitem=>qitem.StudyOrderNotMoney)??0 },
};
flag = student_StaticRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Static_Extend.Id), item.Id));
}
if (item.Times == 4)
{
var curMonthThirdTimeList = student_StaticRepository.GetStudentStaticListRepository(new RB_Student_Static_Extend()
{
YearStr = item.YearStr,
MonthStr = item.MonthStr,
Times = 3
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Static_Extend.OrderMoney),curMonthThirdTimeList?.Sum(qitem=>qitem.OrderMoney)??0 },
{nameof(RB_Student_Static_Extend.OrderNotMoney),curMonthThirdTimeList?.Sum(qitem=>qitem.OrderNotMoney)??0 },
{nameof(RB_Student_Static_Extend.StudyOrderMoney),curMonthThirdTimeList?.Sum(qitem=>qitem.StudyOrderMoney)??0 },
{nameof(RB_Student_Static_Extend.StudyOrderNotMoney),curMonthThirdTimeList?.Sum(qitem=>qitem.StudyOrderNotMoney)??0 },
};
flag = student_StaticRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Static_Extend.Id), item.Id));
}
}
}
}
var marketList = student_MarketRepository.GetStudentMarketListRepository(new RB_Student_Market_Extend() { IsQueryNotMoney = 1 });
if (marketList != null && marketList.Count > 0)
{
foreach (var item in marketList)
{
if (!string.IsNullOrEmpty(item.DateStr))
{
var newModel = student_MarketRepository.GetStudentMarketByProcRepository(Common.ConvertHelper.FormatDate(item.Date));
if (item.OrderNotMoney != newModel.OrderNotMoney || item.StudyOrderNotMoney != newModel.StudyOrderNotMoney)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Market_Extend.OrderMoney),newModel.OrderMoney },
{nameof(RB_Student_Market_Extend.OrderNotMoney),newModel.OrderNotMoney },
{nameof(RB_Student_Market_Extend.StudyOrderMoney),newModel.StudyOrderMoney },
{nameof(RB_Student_Market_Extend.StudyOrderNotMoney),newModel.StudyOrderNotMoney },
};
flag = student_MarketRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Market_Extend.Id), item.Id));
}
}
else
{
if (item.Times == 1)
{
var lastMonthDay = new DateTime(item.YearStr, item.MonthStr, 1).AddMonths(-1);
var lastMonthLastTimeList = student_MarketRepository.GetStudentMarketListRepository(new RB_Student_Market_Extend()
{
YearStr = lastMonthDay.Year,
MonthStr = lastMonthDay.Month,
Times = 3
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Market_Extend.OrderMoney),lastMonthLastTimeList?.Sum(qitem=>qitem.OrderMoney)??0 },
{nameof(RB_Student_Market_Extend.OrderNotMoney),lastMonthLastTimeList?.Sum(qitem=>qitem.OrderNotMoney)??0 },
{nameof(RB_Student_Market_Extend.StudyOrderMoney),lastMonthLastTimeList?.Sum(qitem=>qitem.StudyOrderMoney)??0 },
{nameof(RB_Student_Market_Extend.StudyOrderNotMoney),lastMonthLastTimeList?.Sum(qitem=>qitem.StudyOrderNotMoney)??0 },
};
flag = student_MarketRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Market_Extend.Id), item.Id));
}
if (item.Times == 2)
{
var curMonthFirstTimeList = student_MarketRepository.GetStudentMarketListRepository(new RB_Student_Market_Extend()
{
YearStr = item.YearStr,
MonthStr = item.MonthStr,
Times = 1
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Market_Extend.OrderMoney),curMonthFirstTimeList?.Sum(qitem=>qitem.OrderMoney)??0 },
{nameof(RB_Student_Market_Extend.OrderNotMoney),curMonthFirstTimeList?.Sum(qitem=>qitem.OrderNotMoney)??0 },
{nameof(RB_Student_Market_Extend.StudyOrderMoney),curMonthFirstTimeList?.Sum(qitem=>qitem.StudyOrderMoney)??0 },
{nameof(RB_Student_Market_Extend.StudyOrderNotMoney),curMonthFirstTimeList?.Sum(qitem=>qitem.StudyOrderNotMoney)??0 },
};
flag = student_MarketRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Static_Extend.Id), item.Id));
}
if (item.Times == 3)
{
var curMonthSecondTimeList = student_MarketRepository.GetStudentMarketListRepository(new RB_Student_Market_Extend()
{
YearStr = item.YearStr,
MonthStr = item.MonthStr,
Times = 2
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Market_Extend.OrderMoney),curMonthSecondTimeList?.Sum(qitem=>qitem.OrderMoney)??0 },
{nameof(RB_Student_Market_Extend.OrderNotMoney),curMonthSecondTimeList?.Sum(qitem=>qitem.OrderNotMoney)??0 },
{nameof(RB_Student_Market_Extend.StudyOrderMoney),curMonthSecondTimeList?.Sum(qitem=>qitem.StudyOrderMoney)??0 },
{nameof(RB_Student_Market_Extend.StudyOrderNotMoney),curMonthSecondTimeList?.Sum(qitem=>qitem.StudyOrderNotMoney)??0 },
};
flag = student_MarketRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Market_Extend.Id), item.Id));
}
if (item.Times == 4)
{
var curMonthThirdTimeList = student_MarketRepository.GetStudentMarketListRepository(new RB_Student_Market_Extend()
{
YearStr = item.YearStr,
MonthStr = item.MonthStr,
Times = 3
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Market_Extend.OrderMoney),curMonthThirdTimeList?.Sum(qitem=>qitem.OrderMoney)??0 },
{nameof(RB_Student_Market_Extend.OrderNotMoney),curMonthThirdTimeList?.Sum(qitem=>qitem.OrderNotMoney)??0 },
{nameof(RB_Student_Market_Extend.StudyOrderMoney),curMonthThirdTimeList?.Sum(qitem=>qitem.StudyOrderMoney)??0 },
{nameof(RB_Student_Market_Extend.StudyOrderNotMoney),curMonthThirdTimeList?.Sum(qitem=>qitem.StudyOrderNotMoney)??0 },
};
flag = student_MarketRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Market_Extend.Id), item.Id));
}
}
}
}
var companyList = student_CompanyRepository.GetStudentCompanyListRepository(new RB_Student_Company_Extend() { IsQueryNotMoney = 1 });
if (companyList != null && companyList.Count > 0)
{
foreach (var item in companyList)
{
if (!string.IsNullOrEmpty(item.DateStr))
{
var newModel = student_CompanyRepository.GetStudentCompanyByProcRepository(Common.ConvertHelper.FormatDate(item.Date), "");
if (item.OrderNotMoney != newModel.OrderNotMoney || item.StudyOrderNotMoney != newModel.StudyOrderNotMoney)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Company_Extend.OrderMoney),newModel.OrderMoney },
{nameof(RB_Student_Company_Extend.OrderNotMoney),newModel.OrderNotMoney },
{nameof(RB_Student_Company_Extend.StudyOrderMoney),newModel.StudyOrderMoney },
{nameof(RB_Student_Company_Extend.StudyOrderNotMoney),newModel.StudyOrderNotMoney },
};
flag = student_CompanyRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Company_Extend.Id), item.Id));
}
}
else
{
if (item.Times == 1)
{
var lastMonthDay = new DateTime(item.YearStr, item.MonthStr, 1).AddMonths(-1);
var lastMonthLastTimeList = student_CompanyRepository.GetStudentCompanyListRepository(new RB_Student_Company_Extend()
{
YearStr = lastMonthDay.Year,
MonthStr = lastMonthDay.Month,
Times = 3
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Company_Extend.OrderMoney),lastMonthLastTimeList?.Sum(qitem=>qitem.OrderMoney)??0 },
{nameof(RB_Student_Company_Extend.OrderNotMoney),lastMonthLastTimeList?.Sum(qitem=>qitem.OrderNotMoney)??0 },
{nameof(RB_Student_Company_Extend.StudyOrderMoney),lastMonthLastTimeList?.Sum(qitem=>qitem.StudyOrderMoney)??0 },
{nameof(RB_Student_Company_Extend.StudyOrderNotMoney),lastMonthLastTimeList?.Sum(qitem=>qitem.StudyOrderNotMoney)??0 },
};
flag = student_CompanyRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Company_Extend.Id), item.Id));
}
if (item.Times == 2)
{
var curMonthFirstTimeList = student_CompanyRepository.GetStudentCompanyListRepository(new RB_Student_Company_Extend()
{
YearStr = item.YearStr,
MonthStr = item.MonthStr,
Times = 1
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Company_Extend.OrderMoney),curMonthFirstTimeList?.Sum(qitem=>qitem.OrderMoney)??0 },
{nameof(RB_Student_Company_Extend.OrderNotMoney),curMonthFirstTimeList?.Sum(qitem=>qitem.OrderNotMoney)??0 },
{nameof(RB_Student_Company_Extend.StudyOrderMoney),curMonthFirstTimeList?.Sum(qitem=>qitem.StudyOrderMoney)??0 },
{nameof(RB_Student_Company_Extend.StudyOrderNotMoney),curMonthFirstTimeList?.Sum(qitem=>qitem.StudyOrderNotMoney)??0 },
};
flag = student_CompanyRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Company_Extend.Id), item.Id));
}
if (item.Times == 3)
{
var curMonthSecondTimeList = student_CompanyRepository.GetStudentCompanyListRepository(new RB_Student_Company_Extend()
{
YearStr = item.YearStr,
MonthStr = item.MonthStr,
Times = 2
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Company_Extend.OrderMoney),curMonthSecondTimeList?.Sum(qitem=>qitem.OrderMoney)??0 },
{nameof(RB_Student_Company_Extend.OrderNotMoney),curMonthSecondTimeList?.Sum(qitem=>qitem.OrderNotMoney)??0 },
{nameof(RB_Student_Company_Extend.StudyOrderMoney),curMonthSecondTimeList?.Sum(qitem=>qitem.StudyOrderMoney)??0 },
{nameof(RB_Student_Company_Extend.StudyOrderNotMoney),curMonthSecondTimeList?.Sum(qitem=>qitem.StudyOrderNotMoney)??0 },
};
flag = student_CompanyRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Company_Extend.Id), item.Id));
}
if (item.Times == 4)
{
var curMonthThirdTimeList = student_CompanyRepository.GetStudentCompanyListRepository(new RB_Student_Company_Extend()
{
YearStr = item.YearStr,
MonthStr = item.MonthStr,
Times = 3
})?.Where(qitem => !string.IsNullOrEmpty(Common.ConvertHelper.FormatDate(qitem.Date)))?.ToList();
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Company_Extend.OrderMoney),curMonthThirdTimeList?.Sum(qitem=>qitem.OrderMoney)??0 },
{nameof(RB_Student_Company_Extend.OrderNotMoney),curMonthThirdTimeList?.Sum(qitem=>qitem.OrderNotMoney)??0 },
{nameof(RB_Student_Company_Extend.StudyOrderMoney),curMonthThirdTimeList?.Sum(qitem=>qitem.StudyOrderMoney)??0 },
{nameof(RB_Student_Company_Extend.StudyOrderNotMoney),curMonthThirdTimeList?.Sum(qitem=>qitem.StudyOrderNotMoney)??0 },
};
flag = student_CompanyRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Company_Extend.Id), item.Id));
}
}
}
}
return flag;
}
#endregion
}
}
......@@ -45,6 +45,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Company_Extend.Times), query.Times);
}
if (query.IsQueryNotMoney == 1)
{
builder.AppendFormat(" AND (A.{0}<>0 OR A.{1}<>0) ", nameof(RB_Student_Company_Extend.OrderNotMoney), nameof(RB_Student_Company_Extend.StudyOrderNotMoney));
}
}
builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Student_Company_Extend.Id));
return Get<RB_Student_Company_Extend>(builder.ToString()).ToList();
......
......@@ -43,6 +43,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Market_Extend.Times), query.Times);
}
if (query.IsQueryNotMoney == 1)
{
builder.AppendFormat(" AND (A.{0}<>0 OR A.{1}<>0) ", nameof(RB_Student_Market_Extend.OrderNotMoney), nameof(RB_Student_Market_Extend.StudyOrderNotMoney));
}
}
builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Student_Static_Extend.Id));
return Get<RB_Student_Market_Extend>(builder.ToString()).ToList();
......
......@@ -46,6 +46,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Static_Extend.Times), query.Times);
}
if (query.IsQueryNotMoney == 1)
{
builder.AppendFormat(" AND (A.{0}<>0 OR A.{1}<>0) ", nameof(RB_Student_Static_Extend.OrderNotMoney), nameof(RB_Student_Static_Extend.StudyOrderNotMoney));
}
}
builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Student_Static_Extend.Id));
return Get<RB_Student_Static_Extend>(builder.ToString()).ToList();
......
......@@ -999,48 +999,10 @@ namespace Edu.WebApi.Controllers.User
return File(byteData1, "application/octet-stream", excelName);
}
}
/// <summary>
/// 初始化课程顾问部学员统计数据
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult InitStudentStatic()
{
var userInfo = base.UserInfo;
string StartTime = base.ParmJObj.GetStringValue("StartTime");
if (string.IsNullOrEmpty(StartTime))
{
StartTime = Common.ConvertHelper.FormatDate(DateTime.Now);
}
StartTime = "2021-12-21";
string EndTime = Common.ConvertHelper.FormatDate(DateTime.Now);
bool flag = studentStatModule.CreateStudentStaticModule(userInfo, StartTime, EndTime);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
#region 市场部客户数据统计
/// <summary>
/// 初始化市场部学员统计数据
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult InitStudentMarket()
{
var userInfo = base.UserInfo;
string StartTime = base.ParmJObj.GetStringValue("StartTime");
if (string.IsNullOrEmpty(StartTime))
{
StartTime = Common.ConvertHelper.FormatDate(DateTime.Now);
}
StartTime = "2021-12-21";
string EndTime = Common.ConvertHelper.FormatDate(DateTime.Now);
bool flag = studentStatModule.CreateStudentMarketModule(userInfo, StartTime, EndTime);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 市场部客户数据每日统计
/// </summary>
......@@ -2018,12 +1980,17 @@ namespace Edu.WebApi.Controllers.User
}
}
#endregion
#region 刷新待收金额和初始化数据
/// <summary>
/// 初始化全公司学员统计数据
/// 初始化学员统计数据
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult InitStudentCompany()
public ApiResult InitStudentData()
{
var userInfo = base.UserInfo;
string StartTime = base.ParmJObj.GetStringValue("StartTime");
......@@ -2034,9 +2001,21 @@ namespace Edu.WebApi.Controllers.User
StartTime = "2021-12-21";
string EndTime = Common.ConvertHelper.FormatDate(DateTime.Now);
bool flag = studentStatModule.CreateStudentCompanyModule(userInfo, StartTime, EndTime);
flag = studentStatModule.CreateStudentMarketModule(userInfo, StartTime, EndTime);
flag = studentStatModule.CreateStudentStaticModule(userInfo, StartTime, EndTime);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
/// <summary>
/// 初始化全公司学员统计数据
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RefreshStudentNotMoney()
{
bool flag = studentStatModule.CalcStudentNotMoneyModule();
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
}
}
......@@ -85,6 +85,9 @@ namespace Edu.WebApi.Timers
static System.Timers.Timer dealStudentProgressTimer;//处理学员上课进度
static System.Timers.Timer dealStudentNotMoneyTimer;//处理学员待收金额
public static void RunTimer()
{
timer1 = new System.Timers.Timer
......@@ -150,6 +153,13 @@ namespace Edu.WebApi.Timers
};
dealStudentProgressTimer.Elapsed += new System.Timers.ElapsedEventHandler(DealStudentProgressModule);
dealStudentProgressTimer.Enabled = true;
dealStudentNotMoneyTimer = new System.Timers.Timer()
{
Interval = (1000 * 60) * (60*4) //1小时检查一次
};
dealStudentNotMoneyTimer.Elapsed += new System.Timers.ElapsedEventHandler(DealStudentNotMoneyData);
dealStudentNotMoneyTimer.Enabled = true;
}
public static void RunStop()
......@@ -163,6 +173,7 @@ namespace Edu.WebApi.Timers
finishGuest.Enabled = false;
marketTimer.Enabled = false;
dealStudentProgressTimer.Enabled = false;
dealStudentNotMoneyTimer.Enabled = false;
}
/// <summary>
......@@ -177,6 +188,7 @@ namespace Edu.WebApi.Timers
private static int guestfinish_Timer = 0;
private static int marketconsultant_Timer = 0;
private static int dealstudentprogress_Timer = 0;
private static int dealStudentNotMoney_Timer = 0;
private static readonly string createMarkDataKey = "createMarkDataKey";
......@@ -239,6 +251,20 @@ namespace Edu.WebApi.Timers
}
}
/// <summary>
/// 定时更新学员统计待收金额
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public static void DealStudentNotMoneyData(object sender, System.Timers.ElapsedEventArgs e)
{
if (Interlocked.Exchange(ref dealStudentNotMoney_Timer, 1) == 0)
{
studentStatModule.CalcStudentNotMoneyModule();
Interlocked.Exchange(ref dealStudentNotMoney_Timer, 0);
}
}
/// <summary>
/// 处理学员毕业状态
/// </summary>
......
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