Commit 91cc79ad authored by 黄奎's avatar 黄奎

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

parents 939ee838 01a3d36d
......@@ -9,6 +9,9 @@ namespace Edu.Model.ViewModel.Course
[Serializable]
public class RB_Order_Remark_ViewModel : Model.Entity.Course.RB_Order_Remark
{
/// <summary>
/// 姓名
/// </summary>
public string CreateByName { get; set; }
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -25,18 +25,20 @@ namespace Edu.Repository.Course
if (demodel.OrderId > 0)
{
where += $@" and {nameof(RB_Order_Remark.OrderId)} ={demodel.OrderId}";
where += $@" and r.{nameof(RB_Order_Remark.OrderId)} ={demodel.OrderId}";
}
if (!string.IsNullOrEmpty(orderIds))
{
where += $@" and {nameof(RB_Order_Remark.OrderId)} in({orderIds})";
where += $@" and r.{nameof(RB_Order_Remark.OrderId)} in({orderIds})";
}
if (demodel.Type > 0)
{
where += $@" and {nameof(RB_Order_Remark.Type)} ={demodel.Type}";
where += $@" and r.{nameof(RB_Order_Remark.Type)} ={demodel.Type}";
}
string sql = $@" select * from RB_Order_Remark where {where} order by Id desc";
string sql = $@" select r.*,e.EmName as CreateByName from RB_Order_Remark r
left join rb_employee e on r.CreateBy = e.EmployeeId
where {where} order by r.Id desc";
return Get<RB_Order_Remark_ViewModel>(sql).ToList();
}
......
......@@ -161,28 +161,28 @@ namespace Edu.WebApi.Controllers.Course
{
z.Id,
z.Content,
CreateBy = UserReidsCache.GetUserLoginInfo(z.CreateBy)?.AccountName ?? "",
CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}),
TeacherRemarkList = x.TeacherRemarkList.Select(z => new
{
z.Id,
z.Content,
CreateBy = UserReidsCache.GetUserLoginInfo(z.CreateBy)?.AccountName ?? "",
CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}),
RectorRemarkList = x.RectorRemarkList.Select(z => new
{
z.Id,
z.Content,
CreateBy = UserReidsCache.GetUserLoginInfo(z.CreateBy)?.AccountName ?? "",
CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}),
DirectorRemarkList = x.DirectorRemarkList.Select(z => new
{
z.Id,
z.Content,
CreateBy = UserReidsCache.GetUserLoginInfo(z.CreateBy)?.AccountName ?? "",
CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}),
GuestList = x.GuestList.Select(z => new
......@@ -863,28 +863,28 @@ namespace Edu.WebApi.Controllers.Course
{
z.Id,
z.Content,
CreateBy = UserReidsCache.GetUserLoginInfo(z.CreateBy)?.AccountName ?? "",
CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}),
TeacherRemarkList = x.TeacherRemarkList.Select(z => new
{
z.Id,
z.Content,
CreateBy = UserReidsCache.GetUserLoginInfo(z.CreateBy)?.AccountName ?? "",
CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}),
RectorRemarkList = x.RectorRemarkList.Select(z => new
{
z.Id,
z.Content,
CreateBy = UserReidsCache.GetUserLoginInfo(z.CreateBy)?.AccountName ?? "",
CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}),
DirectorRemarkList = x.DirectorRemarkList.Select(z => new
{
z.Id,
z.Content,
CreateBy = UserReidsCache.GetUserLoginInfo(z.CreateBy)?.AccountName ?? "",
CreateBy = z.CreateByName,
CreateTime = z.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
}),
GuestList = x.GuestList.Select(z => new
......
......@@ -27,6 +27,7 @@ namespace Edu.WebApi.Controllers.Finance
private readonly FinanceModule financeModule = AOP.AOPHelper.CreateAOPObject<FinanceModule>();
private readonly OrderModule orderModule = AOP.AOPHelper.CreateAOPObject<OrderModule>();
private readonly ClassModule classModule = AOP.AOPHelper.CreateAOPObject<ClassModule>();
private readonly TeachingRewardsModule teachingRewardsModule = AOP.AOPHelper.CreateAOPObject<TeachingRewardsModule>();
/// <summary>
/// 获取班级收支明细
......@@ -48,7 +49,7 @@ namespace Edu.WebApi.Controllers.Finance
//收入
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;
......@@ -60,19 +61,22 @@ namespace Edu.WebApi.Controllers.Finance
//支出
decimal PayReceive = 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;
PayActual = (financeList != null && financeList.Any()) ? financeList.Where(x => x.Type == WFTempLateClassEnum.OUT && x.OrderID <= 0).Sum(x => x.PayMoney ?? 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;
//利润
decimal ProfitActual = 0;//实际利润
decimal ProfitNow = 0;//当前利润
ProfitActual = (IncomeActual + OtherIncomeActual) - PayReceive;
ProfitActual = (IncomeReceive + OtherIncomeReceive) - PayReceive;
ProfitNow = (IncomeActual + OtherIncomeActual) - PayActual;
//提成
decimal SaleCommission = 0;//销售提成
decimal TeacherProfitNow = 0;//老师提成
decimal MeritsProfit = 0;//绩效提成
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, 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;//绩效提成
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
......@@ -169,19 +173,23 @@ namespace Edu.WebApi.Controllers.Finance
//支出
decimal PayReceive = 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;
PayActual = (financeList != null && financeList.Any()) ? financeList.Where(x => x.Type == WFTempLateClassEnum.OUT && x.OrderID <= 0).Sum(x => x.PayMoney ?? 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;
//利润
decimal ProfitActual = 0;//实际利润
decimal ProfitNow = 0;//当前利润
ProfitActual = (IncomeActual + OtherIncomeActual) - PayReceive;
ProfitActual = (IncomeReceive + OtherIncomeReceive) - PayReceive;
ProfitNow = (IncomeActual + OtherIncomeActual) - PayActual;
//提成
decimal SaleCommission = 0;//销售提成
decimal TeacherProfitNow = 0;//老师提成
decimal MeritsProfit = 0;//绩效提成
//提成
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 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> 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