Commit 82fbb887 authored by liudong1993's avatar liudong1993

教育课时费制单

parent aecd0673
...@@ -3888,9 +3888,13 @@ namespace Edu.Module.Finance ...@@ -3888,9 +3888,13 @@ namespace Edu.Module.Finance
string EndTime = DateTime.Now.ToString("yyyy-MM-dd"); string EndTime = DateTime.Now.ToString("yyyy-MM-dd");
#region 班级下老师的课时费 #region 班级下老师的课时费
List<RB_Teaching_BonusDetail_ViewModel> TeacherHoursList = new List<RB_Teaching_BonusDetail_ViewModel>(); List<RB_Teaching_BonusDetail_ViewModel> TeacherHoursList = new List<RB_Teaching_BonusDetail_ViewModel>();
var TeacherAlist = class_CheckRepository.GetTeacherConsumptionHoursDetialList("", -1, classId, StartTime, EndTime, userInfo.Group_Id);
if (TeacherAlist.Any())
{
//上这班的老师
string teacherIds = string.Join(",", TeacherAlist.Select(x => x.TeacherId).Distinct());
//根据学生签到表 查询 //根据学生签到表 查询
var list = class_CheckRepository.GetTeacherConsumptionHoursDetialList("", -1, classId, StartTime, EndTime, userInfo.Group_Id); var list = class_CheckRepository.GetTeacherConsumptionHoursDetialList(teacherIds, -1, 0, StartTime, EndTime, userInfo.Group_Id);
if (list.Any()) if (list.Any())
{ {
//班级类型查询 //班级类型查询
...@@ -3901,10 +3905,13 @@ namespace Edu.Module.Finance ...@@ -3901,10 +3905,13 @@ namespace Edu.Module.Finance
foreach (var item in list) foreach (var item in list)
{ {
int Minutes = (int)(Convert.ToDateTime("2021-06-29 " + item.EndDate) - Convert.ToDateTime("2021-06-29 " + item.StartDate)).TotalMinutes;
decimal Hours = Math.Round(Convert.ToDecimal(Minutes) / 60, 2, MidpointRounding.AwayFromZero);//小时
//上课课时 //上课课时
decimal KSNum = item.CurrentDeductionHours;//签到课时长度 decimal KSNum = item.CurrentDeductionHours;//签到课时长度
if (item.ClassId == 18) { KSNum = 0; }// 18班 特殊处理
decimal ClassHourMinute = configModel.BasicMinutes;//课时分钟数
//if (item.ClassHourMinute > 0) { ClassHourMinute = item.ClassHourMinute; }
decimal Hours = Math.Round(KSNum * ClassHourMinute / 60, 2, MidpointRounding.AwayFromZero);//小时
var typeModel = cTypeList.Where(x => x.CTypeId == item.ClassType).FirstOrDefault(); var typeModel = cTypeList.Where(x => x.CTypeId == item.ClassType).FirstOrDefault();
...@@ -3912,8 +3919,6 @@ namespace Edu.Module.Finance ...@@ -3912,8 +3919,6 @@ namespace Edu.Module.Finance
//课时费 需要每个班级 单独计算 因为 班级有附加费用 //课时费 需要每个班级 单独计算 因为 班级有附加费用
decimal KSMoney = KSNum * unitPrice; decimal KSMoney = KSNum * unitPrice;
decimal ClassHourMinute = configModel.BasicMinutes;//课时分钟数
if (item.ClassHourMinute > 0) { ClassHourMinute = item.ClassHourMinute; }
decimal HourMoney = Math.Round(unitPrice / ClassHourMinute * 60, 2, MidpointRounding.AwayFromZero);//每小时课时费 decimal HourMoney = Math.Round(unitPrice / ClassHourMinute * 60, 2, MidpointRounding.AwayFromZero);//每小时课时费
...@@ -3989,6 +3994,8 @@ namespace Edu.Module.Finance ...@@ -3989,6 +3994,8 @@ namespace Edu.Module.Finance
STime = STime.AddMonths(1); STime = STime.AddMonths(1);
} }
} }
TeacherHoursList = TeacherHoursList.Where(x => x.ClassId == classId).ToList();
}
#endregion #endregion
#region 班级下学生的课耗 #region 班级下学生的课耗
......
...@@ -195,7 +195,7 @@ ORDER BY {orderBy} ...@@ -195,7 +195,7 @@ ORDER BY {orderBy}
} }
if (!string.IsNullOrEmpty(demodel.ClassNo)) if (!string.IsNullOrEmpty(demodel.ClassNo))
{ {
where += $@" and c.{nameof(RB_Class.ClassNo)} ={demodel.ClassNo}"; where += $@" and c.{nameof(RB_Class.ClassNo)} ='{demodel.ClassNo}'";
} }
if (!string.IsNullOrEmpty(demodel.GuestName)) if (!string.IsNullOrEmpty(demodel.GuestName))
{ {
...@@ -310,6 +310,10 @@ where {where} order by {orderBy} ...@@ -310,6 +310,10 @@ where {where} order by {orderBy}
{ {
where += $@" and c.{nameof(RB_Class.ClassName)} like '%{demodel.ClassName}%'"; where += $@" and c.{nameof(RB_Class.ClassName)} like '%{demodel.ClassName}%'";
} }
if (!string.IsNullOrEmpty(demodel.ClassNo))
{
where += $@" and c.{nameof(RB_Class.ClassNo)} ='{demodel.ClassNo}'";
}
if (!string.IsNullOrEmpty(demodel.GuestName)) if (!string.IsNullOrEmpty(demodel.GuestName))
{ {
if (demodel.Group_Id > 0) if (demodel.Group_Id > 0)
......
...@@ -1310,7 +1310,8 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1310,7 +1310,8 @@ namespace Edu.WebApi.Controllers.Course
Q_OrderBy = base.ParmJObj.GetInt("Q_OrderBy"), Q_OrderBy = base.ParmJObj.GetInt("Q_OrderBy"),
PlatformTax = base.ParmJObj.GetDecimal("PlatformTax"), PlatformTax = base.ParmJObj.GetDecimal("PlatformTax"),
EnterID = base.ParmJObj.GetInt("EnterID"), EnterID = base.ParmJObj.GetInt("EnterID"),
HelpEnterId = base.ParmJObj.GetInt("HelpEnterId",0) HelpEnterId = base.ParmJObj.GetInt("HelpEnterId",0),
ClassNo = base.ParmJObj.GetStringValue("ClassNo"),
}; };
demodel.Group_Id = userInfo.Group_Id; demodel.Group_Id = userInfo.Group_Id;
......
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