Commit b1dc7708 authored by liudong1993's avatar liudong1993

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

parents ec22e819 5735505c
......@@ -21,38 +21,38 @@ namespace Edu.Repository.Course
/// <returns></returns>
public List<RB_Teaching_BonusDetail_ViewModel> GetList(RB_Teaching_BonusDetail_ViewModel demodel)
{
string where = $@" 1=1 and Status=0";
string where = $@" 1=1 and A.Status=0";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_Teaching_BonusDetail.Group_Id)} ={demodel.Group_Id}";
where += $@" and A.{nameof(RB_Teaching_BonusDetail.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.School_Id > 0)
{
where += $@" and {nameof(RB_Teaching_BonusDetail.School_Id)} ={demodel.School_Id}";
where += $@" and A.{nameof(RB_Teaching_BonusDetail.School_Id)} ={demodel.School_Id}";
}
if (demodel.BonusId > 0)
{
where += $@" and {nameof(RB_Teaching_BonusDetail.BonusId)} ={demodel.BonusId}";
where += $@" and A.{nameof(RB_Teaching_BonusDetail.BonusId)} ={demodel.BonusId}";
}
if (!string.IsNullOrEmpty(demodel.BonusIds))
{
where += $@" and {nameof(RB_Teaching_BonusDetail.BonusId)} in({demodel.BonusIds})";
where += $@" and A.{nameof(RB_Teaching_BonusDetail.BonusId)} in({demodel.BonusIds})";
}
if (demodel.TeacherId > 0)
{
where += $@" and {nameof(RB_Teaching_BonusDetail.TeacherId)} ={demodel.TeacherId}";
where += $@" and A.{nameof(RB_Teaching_BonusDetail.TeacherId)} ={demodel.TeacherId}";
}
if (demodel.ClassId > 0)
{
where += $@" and {nameof(RB_Teaching_BonusDetail.ClassId)} ={demodel.ClassId}";
where += $@" and A.{nameof(RB_Teaching_BonusDetail.ClassId)} ={demodel.ClassId}";
}
if (demodel.Type > 0)
{
where += $@" and {nameof(RB_Teaching_BonusDetail.Type)} ={demodel.Type}";
where += $@" and A.{nameof(RB_Teaching_BonusDetail.Type)} ={demodel.Type}";
}
string sql = $@" select * from RB_Teaching_BonusDetail where {where} order by Id desc";
string sql = $@" select * from RB_Teaching_BonusDetail as A LEFT JOIN rb_teaching_bonus as b on a.BonusId=b.Id and b.State=2 where {where} order by a.Id desc";
return Get<RB_Teaching_BonusDetail_ViewModel>(sql).ToList();
}
......
......@@ -71,12 +71,12 @@ namespace Edu.WebApi.Controllers.Finance
ProfitNow = (IncomeActual + OtherIncomeActual) - PayActual;
//提成
decimal SaleCommission = (orderList != null && orderList.Any()) ? orderList.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 });
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;//绩效提成
decimal MeritsProfit = (meritsProfitList != null && meritsProfitList.Any()) ? (meritsProfitList.Where(x=>x.PerfState==Common.Enum.Course.PerfStateEnum.Confirmed).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 recultFiniceList = financeList.Select(x => new
......@@ -157,11 +157,11 @@ namespace Edu.WebApi.Controllers.Finance
RB_Finance_Extend model = new RB_Finance_Extend() { TCID = classId, OrderSource = OrderResourceEnum.Education, RB_Group_Id = base.UserInfo.Group_Id, FinanceType = 2 };
var financeList = financeModule.GetFinanceInfoList(model).Where(t => (t.Status == FinanceAuditStatus.InReview || t.Status == FinanceAuditStatus.Pass || t.Status == FinanceAuditStatus.CTemporary)).ToList();
var classInfo = classModule.GetClassAndCourseListRepository(new Model.ViewModel.Course.RB_Class_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId, School_Id = schoolId }).FirstOrDefault();
//收入
decimal IncomeReceive = 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;
IncomeActual = (orderList != null && orderList.Any()) ? orderList.Sum(x => x.Income) : 0;
......@@ -183,13 +183,14 @@ namespace Edu.WebApi.Controllers.Finance
ProfitNow = (IncomeActual + OtherIncomeActual) - PayActual;
//提成
//提成
decimal SaleCommission = (orderList != null && orderList.Any()) ? orderList.Sum(x => x.CommissionMoney) : 0; ;//销售提成
var teacherProfitList = teachingRewardsModule.GetBonusDetailList(new RB_Teaching_BonusDetail_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = classId });
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 });
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});
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();
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();
//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