Commit 889a422a authored by liudong1993's avatar liudong1993

班级月度课耗统计

parent 31423f8b
...@@ -3351,7 +3351,7 @@ namespace Edu.Module.Finance ...@@ -3351,7 +3351,7 @@ namespace Edu.Module.Finance
string MaxTime = TeacherHoursList.Max(x => x.Date).ToString("yyyy-MM"); string MaxTime = TeacherHoursList.Max(x => x.Date).ToString("yyyy-MM");
//初始化 基础课时 //初始化 基础课时
DateTime STime = Convert.ToDateTime(StartTime); DateTime STime = Convert.ToDateTime(Convert.ToDateTime(StartTime).ToString("yyyy-MM") + "-01");
while (true) while (true)
{ {
DateTime ETime = STime.AddMonths(1).AddDays(-1); DateTime ETime = STime.AddMonths(1).AddDays(-1);
......
...@@ -106,6 +106,10 @@ namespace Edu.Repository.Finance ...@@ -106,6 +106,10 @@ namespace Edu.Repository.Finance
{ {
where += string.Format(" AND A." + nameof(RB_Edu_RevenueReport_Extend.ClassId) + "=" + model.ClassId); where += string.Format(" AND A." + nameof(RB_Edu_RevenueReport_Extend.ClassId) + "=" + model.ClassId);
} }
if (!string.IsNullOrEmpty(model.ClassNo))
{
where += string.Format(" AND A." + nameof(RB_Edu_RevenueReport_Extend.ClassNo) + " ='{0}'", model.ClassNo);
}
if (!string.IsNullOrEmpty(model.ClassName)) if (!string.IsNullOrEmpty(model.ClassName))
{ {
where += string.Format(" AND A." + nameof(RB_Edu_RevenueReport_Extend.ClassName) + " like '%{0}%'", model.ClassName); where += string.Format(" AND A." + nameof(RB_Edu_RevenueReport_Extend.ClassName) + " like '%{0}%'", model.ClassName);
...@@ -167,6 +171,10 @@ namespace Edu.Repository.Finance ...@@ -167,6 +171,10 @@ namespace Edu.Repository.Finance
{ {
where += string.Format(" AND A." + nameof(RB_Edu_RevenueReport_Extend.ClassId) + "=" + model.ClassId); where += string.Format(" AND A." + nameof(RB_Edu_RevenueReport_Extend.ClassId) + "=" + model.ClassId);
} }
if (!string.IsNullOrEmpty(model.ClassNo))
{
where += string.Format(" AND A." + nameof(RB_Edu_RevenueReport_Extend.ClassNo) + " ='{0}'", model.ClassNo);
}
if (!string.IsNullOrEmpty(model.ClassName)) if (!string.IsNullOrEmpty(model.ClassName))
{ {
where += string.Format(" AND A." + nameof(RB_Edu_RevenueReport_Extend.ClassName) + " like '%{0}%'", model.ClassName); where += string.Format(" AND A." + nameof(RB_Edu_RevenueReport_Extend.ClassName) + " like '%{0}%'", model.ClassName);
......
...@@ -90,12 +90,6 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -90,12 +90,6 @@ namespace Edu.WebApi.Controllers.Finance
PayReceive = (financeList != null && financeList.Any()) ? financeList.Where(x => x.Type == WFTempLateClassEnum.OUT).Sum(x => x.Money ?? 0) : 0; PayReceive = (financeList != null && financeList.Any()) ? financeList.Where(x => x.Type == WFTempLateClassEnum.OUT).Sum(x => x.Money ?? 0) : 0;
PayActual = (financeList != null && financeList.Any()) ? financeList.Where(x => x.Type == WFTempLateClassEnum.OUT).Sum(x => x.PayMoney ?? 0) : 0; PayActual = (financeList != null && financeList.Any()) ? financeList.Where(x => x.Type == WFTempLateClassEnum.OUT).Sum(x => x.PayMoney ?? 0) : 0;
//利润
decimal ProfitActual = 0;//实际利润
decimal ProfitNow = 0;//当前利润
ProfitActual = (IncomeActual + OtherIncomeActual) - PayReceive;
ProfitNow = (IncomeActual + OtherIncomeActual) - PayActual;
//提成 //提成
decimal SaleCommission = (orderList != null && orderList.Any()) ? orderList.Where(x => x.IsCommissionGive == 1).Sum(x => x.CommissionMoney + x.ExtraCommissionMoney) : 0;//销售提成 decimal SaleCommission = (orderList != null && orderList.Any()) ? orderList.Where(x => x.IsCommissionGive == 1).Sum(x => x.CommissionMoney + x.ExtraCommissionMoney) : 0;//销售提成
var teacherProfitList = teachingRewardsModule.GetBonusDetailList(new RB_Teaching_BonusDetail_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId, School_Id = schoolId }); var teacherProfitList = teachingRewardsModule.GetBonusDetailList(new RB_Teaching_BonusDetail_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId, School_Id = schoolId });
...@@ -104,6 +98,15 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -104,6 +98,15 @@ namespace Edu.WebApi.Controllers.Finance
var meritsProfitList = teachingRewardsModule.GetTeachingPerfList(new RB_Teaching_Perf_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId, School_Id = schoolId }); var meritsProfitList = teachingRewardsModule.GetTeachingPerfList(new RB_Teaching_Perf_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId, School_Id = schoolId });
decimal MeritsProfit = (meritsProfitList != null && meritsProfitList.Any()) ? (meritsProfitList.Where(x => x.PerfState == Common.Enum.Course.PerfStateEnum.Confirmed).OrderByDescending(x => x.CreateTime).FirstOrDefault()?.Money ?? 0) : 0;//绩效提成 decimal MeritsProfit = (meritsProfitList != null && meritsProfitList.Any()) ? (meritsProfitList.Where(x => x.PerfState == Common.Enum.Course.PerfStateEnum.Confirmed).OrderByDescending(x => x.CreateTime).FirstOrDefault()?.Money ?? 0) : 0;//绩效提成
PayReceive += (SaleCommission + TeacherProfitNow + MeritsProfit);//支出加上提成的
PayActual += (SaleCommission + TeacherProfitNow + MeritsProfit);
//利润
decimal ProfitActual = 0;//实际利润
decimal ProfitNow = 0;//当前利润
ProfitActual = (IncomeActual + OtherIncomeActual) - PayReceive;
ProfitNow = (IncomeActual + OtherIncomeActual) - PayActual;
//项目信息 //项目信息
var projectInfo = new object(); var projectInfo = new object();
if (classId > 0) if (classId > 0)
...@@ -212,12 +215,6 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -212,12 +215,6 @@ namespace Edu.WebApi.Controllers.Finance
PayReceive = (financeList != null && financeList.Any()) ? financeList.Where(x => x.Type == WFTempLateClassEnum.OUT).Sum(x => x.Money ?? 0) : 0; PayReceive = (financeList != null && financeList.Any()) ? financeList.Where(x => x.Type == WFTempLateClassEnum.OUT).Sum(x => x.Money ?? 0) : 0;
PayActual = (financeList != null && financeList.Any()) ? financeList.Where(x => x.Type == WFTempLateClassEnum.OUT).Sum(x => x.PayMoney ?? 0) : 0; PayActual = (financeList != null && financeList.Any()) ? financeList.Where(x => x.Type == WFTempLateClassEnum.OUT).Sum(x => x.PayMoney ?? 0) : 0;
//利润
decimal ProfitActual = 0;//实际利润
decimal ProfitNow = 0;//当前利润
ProfitActual = (IncomeReceive + OtherIncomeReceive) - PayReceive;
ProfitNow = (IncomeActual + OtherIncomeActual) - PayActual;
//提成 //提成
decimal SaleCommission = (orderList != null && orderList.Any()) ? orderList.Where(x => x.IsCommissionGive == 1).Sum(x => x.CommissionMoney) : 0; ;//销售提成 decimal SaleCommission = (orderList != null && orderList.Any()) ? orderList.Where(x => x.IsCommissionGive == 1).Sum(x => x.CommissionMoney) : 0; ;//销售提成
var teacherProfitList = teachingRewardsModule.GetBonusDetailList(new RB_Teaching_BonusDetail_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId, School_Id = schoolId }); var teacherProfitList = teachingRewardsModule.GetBonusDetailList(new RB_Teaching_BonusDetail_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId, School_Id = schoolId });
...@@ -226,6 +223,15 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -226,6 +223,15 @@ namespace Edu.WebApi.Controllers.Finance
var meritsProfitList = teachingRewardsModule.GetTeachingPerfList(new RB_Teaching_Perf_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId, School_Id = schoolId }); var meritsProfitList = teachingRewardsModule.GetTeachingPerfList(new RB_Teaching_Perf_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId, School_Id = schoolId });
decimal MeritsProfit = (meritsProfitList != null && meritsProfitList.Any()) ? (meritsProfitList.OrderByDescending(x => x.CreateTime).FirstOrDefault()?.Money ?? 0) : 0;//绩效提成 decimal MeritsProfit = (meritsProfitList != null && meritsProfitList.Any()) ? (meritsProfitList.OrderByDescending(x => x.CreateTime).FirstOrDefault()?.Money ?? 0) : 0;//绩效提成
PayReceive += (SaleCommission + TeacherProfitNow + MeritsProfit);//支出加上
PayActual += (SaleCommission + TeacherProfitNow + MeritsProfit);
//利润
decimal ProfitActual = 0;//实际利润
decimal ProfitNow = 0;//当前利润
ProfitActual = (IncomeReceive + OtherIncomeReceive) - PayReceive;
ProfitNow = (IncomeActual + OtherIncomeActual) - PayActual;
string title = "班级情况"; string title = "班级情况";
string subtitle = "班级名称"; string subtitle = "班级名称";
string thirdTitle = "课程名称:"; string thirdTitle = "课程名称:";
......
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