Commit 0a3380d6 authored by 吴春's avatar 吴春

提交代码

parent 62988872
This diff is collapsed.
...@@ -27,6 +27,7 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -27,6 +27,7 @@ namespace Edu.WebApi.Controllers.Finance
private readonly FinanceModule financeModule = AOP.AOPHelper.CreateAOPObject<FinanceModule>(); private readonly FinanceModule financeModule = AOP.AOPHelper.CreateAOPObject<FinanceModule>();
private readonly OrderModule orderModule = AOP.AOPHelper.CreateAOPObject<OrderModule>(); private readonly OrderModule orderModule = AOP.AOPHelper.CreateAOPObject<OrderModule>();
private readonly ClassModule classModule = AOP.AOPHelper.CreateAOPObject<ClassModule>(); private readonly ClassModule classModule = AOP.AOPHelper.CreateAOPObject<ClassModule>();
private readonly TeachingRewardsModule teachingRewardsModule = AOP.AOPHelper.CreateAOPObject<TeachingRewardsModule>();
/// <summary> /// <summary>
/// 获取班级收支明细 /// 获取班级收支明细
...@@ -48,7 +49,7 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -48,7 +49,7 @@ namespace Edu.WebApi.Controllers.Finance
//收入 //收入
decimal IncomeReceive = 0;//应收 decimal IncomeReceive = 0;//应收
decimal IncomeActual = 0;//实收 decimal IncomeActual = 0;//实收
var orderList = orderModule.GetClassOrderList_V2(classId, base.UserInfo.Group_Id); var orderList = orderModule.GetClassOrderList_V2(classId, base.UserInfo.Group_Id).Where(x => (int)x.OrderState < 3);
IncomeReceive = (orderList != null && orderList.Any()) ? orderList.Sum(x => x.PreferPrice) : 0; IncomeReceive = (orderList != null && orderList.Any()) ? orderList.Sum(x => x.PreferPrice) : 0;
IncomeActual = (orderList != null && orderList.Any()) ? orderList.Sum(x => x.Income) : 0; IncomeActual = (orderList != null && orderList.Any()) ? orderList.Sum(x => x.Income) : 0;
...@@ -60,19 +61,22 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -60,19 +61,22 @@ namespace Edu.WebApi.Controllers.Finance
//支出 //支出
decimal PayReceive = 0;//应付 decimal PayReceive = 0;//应付
decimal PayActual = 0;//实付 decimal PayActual = 0;//实付
PayReceive = (financeList != null && financeList.Any()) ? financeList.Where(x => x.Type == WFTempLateClassEnum.OUT && x.OrderID <= 0).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 && x.OrderID <= 0).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 ProfitActual = 0;//实际利润
decimal ProfitNow = 0;//当前利润 decimal ProfitNow = 0;//当前利润
ProfitActual = (IncomeActual + OtherIncomeActual) - PayReceive; ProfitActual = (IncomeReceive + OtherIncomeReceive) - PayReceive;
ProfitNow = (IncomeActual + OtherIncomeActual) - PayActual; ProfitNow = (IncomeActual + OtherIncomeActual) - PayActual;
//提成 //提成
decimal SaleCommission = 0;//销售提成 decimal SaleCommission = (orderList != null && orderList.Any()) ? orderList.Sum(x => x.CommissionMoney) : 0; ;//销售提成
decimal TeacherProfitNow = 0;//老师提成 var teacherProfitList = teachingRewardsModule.GetBonusDetailList(new RB_Teaching_BonusDetail_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId, School_Id = schoolId });
decimal MeritsProfit = 0;//绩效提成 decimal TeacherProfitNow = (teacherProfitList != null && teacherProfitList.Any()) ? teacherProfitList.Sum(x => x.Money) : 0;//老师提成
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;//绩效提成
var classInfo = classModule.GetClassAndCourseListRepository(new Model.ViewModel.Course.RB_Class_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId, School_Id = schoolId }).FirstOrDefault(); var classInfo = classModule.GetClassAndCourseListRepository(new Model.ViewModel.Course.RB_Class_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId, School_Id = schoolId }).FirstOrDefault();
var recultFiniceList = financeList.Select(x => new var recultFiniceList = financeList.Select(x => new
...@@ -169,19 +173,23 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -169,19 +173,23 @@ namespace Edu.WebApi.Controllers.Finance
//支出 //支出
decimal PayReceive = 0;//应付 decimal PayReceive = 0;//应付
decimal PayActual = 0;//实付 decimal PayActual = 0;//实付
PayReceive = (financeList != null && financeList.Any()) ? financeList.Where(x => x.Type == WFTempLateClassEnum.OUT && x.OrderID <= 0).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 && x.OrderID <= 0).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 ProfitActual = 0;//实际利润
decimal ProfitNow = 0;//当前利润 decimal ProfitNow = 0;//当前利润
ProfitActual = (IncomeActual + OtherIncomeActual) - PayReceive; ProfitActual = (IncomeReceive + OtherIncomeReceive) - PayReceive;
ProfitNow = (IncomeActual + OtherIncomeActual) - PayActual; ProfitNow = (IncomeActual + OtherIncomeActual) - PayActual;
//提成 //提成
decimal SaleCommission = 0;//销售提成 //提成
decimal TeacherProfitNow = 0;//老师提成 decimal SaleCommission = (orderList != null && orderList.Any()) ? orderList.Sum(x => x.CommissionMoney) : 0; ;//销售提成
decimal MeritsProfit = 0;//绩效提成 var teacherProfitList = teachingRewardsModule.GetBonusDetailList(new RB_Teaching_BonusDetail_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId });
decimal TeacherProfitNow = (teacherProfitList != null && teacherProfitList.Any()) ? teacherProfitList.Sum(x => x.Money) : 0;//老师提成
var meritsProfitList = teachingRewardsModule.GetTeachingPerfList(new RB_Teaching_Perf_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId});
decimal MeritsProfit = (meritsProfitList != null && meritsProfitList.Any()) ? (meritsProfitList.OrderByDescending(x => x.CreateTime).FirstOrDefault()?.Money ?? 0) : 0;//绩效提成
List<RB_Finance_Extend> financeReciveList = financeList.Where(t => t.Type == WFTempLateClassEnum.IN).ToList(); List<RB_Finance_Extend> financeReciveList = financeList.Where(t => t.Type == WFTempLateClassEnum.IN).ToList();
List<RB_Finance_Extend> financePayList = financeList.Where(t => t.Type == WFTempLateClassEnum.OUT).ToList(); List<RB_Finance_Extend> financePayList = financeList.Where(t => t.Type == WFTempLateClassEnum.OUT).ToList();
//var recultFiniceList = financeList.Select(x => new //var recultFiniceList = financeList.Select(x => new
......
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