Commit 8c4756d9 authored by liudong1993's avatar liudong1993

教师基础课时 增加启用配置

parent 1af19010
...@@ -192,5 +192,15 @@ namespace Edu.Model.Entity.User ...@@ -192,5 +192,15 @@ namespace Edu.Model.Entity.User
/// 老师特长 /// 老师特长
/// </summary> /// </summary>
public string Specialty { get; set; } public string Specialty { get; set; }
/// <summary>
/// 基础课时启用 1是
/// </summary>
public int BaseHoursEnabled { get; set; }
/// <summary>
/// 启用时间 (存到月)
/// </summary>
public string EnableTime { get; set; }
} }
} }
\ No newline at end of file
...@@ -122,6 +122,16 @@ namespace Edu.Model.ViewModel.Course ...@@ -122,6 +122,16 @@ namespace Edu.Model.ViewModel.Course
/// </summary> /// </summary>
public decimal BaseHourFee { get; set; } public decimal BaseHourFee { get; set; }
/// <summary>
/// 是否启用基础课时 1是
/// </summary>
public int BaseHoursEnabled { get; set; }
/// <summary>
/// 启用时间 (存到月)
/// </summary>
public string EnableTime { get; set; }
/// <summary> /// <summary>
/// 班级课时分钟数 /// 班级课时分钟数
/// </summary> /// </summary>
......
...@@ -82,6 +82,16 @@ namespace Edu.Model.ViewModel.Course ...@@ -82,6 +82,16 @@ namespace Edu.Model.ViewModel.Course
/// </summary> /// </summary>
public decimal HourMoney { get; set; } public decimal HourMoney { get; set; }
/// <summary>
/// 是否启用基础课时 1是
/// </summary>
public int BaseHoursEnabled { get; set; }
/// <summary>
/// 启用时间 (存到月)
/// </summary>
public string EnableTime { get; set; }
#endregion #endregion
} }
} }
\ No newline at end of file
...@@ -191,5 +191,15 @@ namespace Edu.Model.ViewModel.User ...@@ -191,5 +191,15 @@ namespace Edu.Model.ViewModel.User
/// 基础课时费 /// 基础课时费
/// </summary> /// </summary>
public decimal BaseHourFee { get; set; } public decimal BaseHourFee { get; set; }
/// <summary>
/// 是否启用基础课时 1是
/// </summary>
public int BaseHoursEnabled { get; set; }
/// <summary>
/// 启用时间 (存到月)
/// </summary>
public string EnableTime { get; set; }
} }
} }
...@@ -607,6 +607,13 @@ namespace Edu.Module.Course ...@@ -607,6 +607,13 @@ namespace Edu.Module.Course
List<int> TeacherIdList = blist.Select(x => x.TeacherId).Distinct().ToList(); List<int> TeacherIdList = blist.Select(x => x.TeacherId).Distinct().ToList();
foreach (var item in TeacherIdList) foreach (var item in TeacherIdList)
{ {
var teacherModel = teacherList.Where(x => x.TId == item).FirstOrDefault();
if (teacherModel == null) {
continue;
}
if (!(teacherModel.BaseHoursEnabled == 1 && Convert.ToDateTime(dmodel.Month) >= Convert.ToDateTime(teacherModel.EnableTime))){
continue;
}
var qblist = blist.Where(x => x.TeacherId == item).OrderBy(x => x.Date).ThenBy(x => x.UnitPrice).ToList(); var qblist = blist.Where(x => x.TeacherId == item).OrderBy(x => x.Date).ThenBy(x => x.UnitPrice).ToList();
int BasicHours = configModel.BasicHours; int BasicHours = configModel.BasicHours;
foreach (var qitem in qblist) foreach (var qitem in qblist)
......
...@@ -2462,7 +2462,7 @@ namespace Edu.Module.Finance ...@@ -2462,7 +2462,7 @@ namespace Edu.Module.Finance
#region 基础课时处理 #region 基础课时处理
decimal DeductionMoney = 0; decimal DeductionMoney = 0;
if (configModel.BasicHours > 0) if (configModel.BasicHours > 0 && item.BaseHoursEnabled == 1 && STime >= Convert.ToDateTime(item.EnableTime))
{ {
//遍历所有老师 //遍历所有老师
List<int> TeacherIdList = mlist.Select(x => x.TeacherId).Distinct().ToList(); List<int> TeacherIdList = mlist.Select(x => x.TeacherId).Distinct().ToList();
...@@ -2615,7 +2615,7 @@ namespace Edu.Module.Finance ...@@ -2615,7 +2615,7 @@ namespace Edu.Module.Finance
#region 基础课时处理 #region 基础课时处理
decimal DeductionMoney = 0; decimal DeductionMoney = 0;
if (configModel.BasicHours > 0) if (configModel.BasicHours > 0 && item.BaseHoursEnabled == 1 && STime >= Convert.ToDateTime(item.EnableTime))
{ {
//遍历所有老师 //遍历所有老师
List<int> TeacherIdList = mlist.Select(x => x.TeacherId).Distinct().ToList(); List<int> TeacherIdList = mlist.Select(x => x.TeacherId).Distinct().ToList();
...@@ -2767,7 +2767,9 @@ namespace Edu.Module.Finance ...@@ -2767,7 +2767,9 @@ namespace Edu.Module.Finance
Hours = Hours, Hours = Hours,
HourMoney = HourMoney, HourMoney = HourMoney,
UnitPrice = unitPrice, UnitPrice = unitPrice,
Money = KSMoney Money = KSMoney,
BaseHoursEnabled = item.BaseHoursEnabled,
EnableTime = item.EnableTime
}); });
} }
...@@ -2776,10 +2778,10 @@ namespace Edu.Module.Finance ...@@ -2776,10 +2778,10 @@ namespace Edu.Module.Finance
while (true) while (true)
{ {
DateTime ETime = STime.AddMonths(1).AddDays(-1); DateTime ETime = STime.AddMonths(1).AddDays(-1);
var mlist = RList.Where(x => x.Date >= STime && x.Date <= ETime).ToList(); var mlist = RList.Where(x => x.Date >= STime && x.Date <= ETime && x.BaseHoursEnabled == 1 && STime >= Convert.ToDateTime(x.EnableTime)).ToList();
#region 基础课时处理 #region 基础课时处理
decimal DeductionMoney = 0; decimal DeductionMoney = 0;
if (configModel.BasicHours > 0) if (configModel.BasicHours > 0 && mlist.Any())
{ {
//遍历所有老师 //遍历所有老师
List<int> TeacherIdList = mlist.Select(x => x.TeacherId).Distinct().ToList(); List<int> TeacherIdList = mlist.Select(x => x.TeacherId).Distinct().ToList();
...@@ -2881,7 +2883,9 @@ namespace Edu.Module.Finance ...@@ -2881,7 +2883,9 @@ namespace Edu.Module.Finance
Hours = Hours, Hours = Hours,
HourMoney = HourMoney, HourMoney = HourMoney,
UnitPrice = unitPrice, UnitPrice = unitPrice,
Money = KSMoney Money = KSMoney,
BaseHoursEnabled = item.BaseHoursEnabled,
EnableTime = item.EnableTime
}); });
} }
...@@ -2890,11 +2894,11 @@ namespace Edu.Module.Finance ...@@ -2890,11 +2894,11 @@ namespace Edu.Module.Finance
while (true) while (true)
{ {
DateTime ETime = STime.AddMonths(1).AddDays(-1); DateTime ETime = STime.AddMonths(1).AddDays(-1);
var mlist = RList.Where(x => x.Date >= STime && x.Date <= ETime).ToList(); var mlist = RList.Where(x => x.Date >= STime && x.Date <= ETime && x.BaseHoursEnabled == 1 && STime >= Convert.ToDateTime(x.EnableTime)).ToList();
#region 基础课时处理 #region 基础课时处理
decimal DeductionMoney = 0; decimal DeductionMoney = 0;
if (configModel.BasicHours > 0) if (configModel.BasicHours > 0 && mlist.Any())
{ {
//遍历所有老师 //遍历所有老师
List<int> TeacherIdList = mlist.Select(x => x.TeacherId).Distinct().ToList(); List<int> TeacherIdList = mlist.Select(x => x.TeacherId).Distinct().ToList();
......
...@@ -295,6 +295,8 @@ namespace Edu.Module.User ...@@ -295,6 +295,8 @@ namespace Edu.Module.User
fileds.Add(nameof(RB_Teacher_ViewModel.BaseStuNum), model.BaseStuNum); fileds.Add(nameof(RB_Teacher_ViewModel.BaseStuNum), model.BaseStuNum);
fileds.Add(nameof(RB_Teacher_ViewModel.BaseHourFee), model.BaseHourFee); fileds.Add(nameof(RB_Teacher_ViewModel.BaseHourFee), model.BaseHourFee);
fileds.Add(nameof(RB_Teacher_ViewModel.Specialty), model.Specialty); fileds.Add(nameof(RB_Teacher_ViewModel.Specialty), model.Specialty);
fileds.Add(nameof(RB_Teacher_ViewModel.BaseHoursEnabled), model.BaseHoursEnabled);
fileds.Add(nameof(RB_Teacher_ViewModel.EnableTime), model.EnableTime);
#region 修改日志 #region 修改日志
string logContent = ""; string logContent = "";
if (model.TeacherName != oldModel.TeacherName) if (model.TeacherName != oldModel.TeacherName)
......
...@@ -438,7 +438,7 @@ GROUP BY tt.TeacherId,tt.OrderGuestId ...@@ -438,7 +438,7 @@ GROUP BY tt.TeacherId,tt.OrderGuestId
} }
string sql = $@" string sql = $@"
SELECT p.TeacherId,t2.TeacherName,t2.BaseHourFee,c.ClassName,co.CourseName,p.ClassId,c.ClassType,c.ClassNo,c.ClassHourMinute,c.CouseId,p.ClassDate,p.ClassTimeId,t.StartTime as StartDate,t.EndTime as EndDate FROM rb_class_check p SELECT p.TeacherId,t2.TeacherName,t2.BaseHourFee,t2.BaseHoursEnabled,t2.EnableTime,c.ClassName,co.CourseName,p.ClassId,c.ClassType,c.ClassNo,c.ClassHourMinute,c.CouseId,p.ClassDate,p.ClassTimeId,t.StartTime as StartDate,t.EndTime as EndDate FROM rb_class_check p
INNER JOIN rb_class_time t on p.ClassTimeId = t.ClassTimeId INNER JOIN rb_class_time t on p.ClassTimeId = t.ClassTimeId
LEFT JOIN rb_teacher t2 on p.TeacherId = t2.TId LEFT JOIN rb_teacher t2 on p.TeacherId = t2.TId
LEFT JOIN rb_class c on p.ClassId = c.ClassId LEFT JOIN rb_class c on p.ClassId = c.ClassId
......
...@@ -449,7 +449,7 @@ FROM ...@@ -449,7 +449,7 @@ FROM
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT ar.AccountRemark,A.Id,A.Account,A.AccountId,A.Group_Id,A.School_Id,A.EmployeeName,A.UserIcon,A.IDCard,A.Sex,A.Education,A.EntryTime,A.Address,A.BirthDate SELECT ar.AccountRemark,A.Id,A.Account,A.AccountId,A.Group_Id,A.School_Id,A.EmployeeName,A.UserIcon,A.IDCard,A.Sex,A.Education,A.EntryTime,A.Address,A.BirthDate
,A.LeaveStatus,A.LeaveTime,A.EmployeeTel,A.AccountType,A.Email,A.BaseHourFee,IFNULL(A.DirectSupervisor,0) AS DirectSupervisor ,A.LeaveStatus,A.LeaveTime,A.EmployeeTel,A.AccountType,A.Email,A.BaseHourFee,A.BaseHoursEnabled,A.EnableTime,IFNULL(A.DirectSupervisor,0) AS DirectSupervisor
,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName ,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName
,IFNULL(d.DeptId,0) AS Dept_Id,IFNULL(d.DeptName,'') AS DeptName,IFNULL(p.PostId,0) AS Post_Id, IFNULL(p.PostName,'') AS PostName ,IFNULL(d.DeptId,0) AS Dept_Id,IFNULL(d.DeptName,'') AS DeptName,IFNULL(p.PostId,0) AS Post_Id, IFNULL(p.PostName,'') AS PostName
,(CASE WHEN CONCAT(DATE_FORMAT(now(),'%Y'),'-',DATE_FORMAT(BirthDate,'%m-%d')) >= DATE_FORMAT(now(),'%Y-%m-%d') ,(CASE WHEN CONCAT(DATE_FORMAT(now(),'%Y'),'-',DATE_FORMAT(BirthDate,'%m-%d')) >= DATE_FORMAT(now(),'%Y-%m-%d')
...@@ -463,7 +463,7 @@ FROM ...@@ -463,7 +463,7 @@ FROM
,b.School_Id,IFNULL(B.MName,'') AS EmployeeName,B.MHead AS UserIcon,B.Dept_Id,B.Post_Id,B.IDCard ,b.School_Id,IFNULL(B.MName,'') AS EmployeeName,B.MHead AS UserIcon,B.Dept_Id,B.Post_Id,B.IDCard
,B.Sex,B.Education,B.EntryTime,B.Address,B.BirthDate ,B.Sex,B.Education,B.EntryTime,B.Address,B.BirthDate
,B.LeaveStatus,B.LeaveTime,B.MTel AS EmployeeTel,IFNULL(B.Email,'') AS Email ,B.LeaveStatus,B.LeaveTime,B.MTel AS EmployeeTel,IFNULL(B.Email,'') AS Email
,0 as BaseHourFee ,0 as BaseHourFee,0 as BaseHoursEnabled,'' as EnableTime
FROM rb_manager AS B LEFT JOIN rb_account AS A ON A.AccountId=B.MId AND A.AccountType=1 FROM rb_manager AS B LEFT JOIN rb_account AS A ON A.AccountId=B.MId AND A.AccountType=1
WHERE 1=1 {0} {1} WHERE 1=1 {0} {1}
UNION ALL UNION ALL
...@@ -472,7 +472,7 @@ FROM ...@@ -472,7 +472,7 @@ FROM
,b.School_Id,IFNULL(B.TeacherName,'') AS EmployeeName,B.TeacherIcon AS UserIcon,B.Dept_Id,B.Post_Id,B.IDCard ,b.School_Id,IFNULL(B.TeacherName,'') AS EmployeeName,B.TeacherIcon AS UserIcon,B.Dept_Id,B.Post_Id,B.IDCard
,B.Sex,B.Education,B.EntryTime,B.Address,B.BirthDate ,B.Sex,B.Education,B.EntryTime,B.Address,B.BirthDate
,B.LeaveStatus,B.LeaveTime,B.TeacherTel AS EmployeeTel,IFNULL(B.Email,'') AS Email ,B.LeaveStatus,B.LeaveTime,B.TeacherTel AS EmployeeTel,IFNULL(B.Email,'') AS Email
,B.BaseHourFee ,B.BaseHourFee,B.BaseHoursEnabled,B.EnableTime
FROM rb_teacher AS B LEFT JOIN rb_account AS A ON A.AccountId=B.TId AND A.AccountType=2 FROM rb_teacher AS B LEFT JOIN rb_account AS A ON A.AccountId=B.TId AND A.AccountType=2
WHERE 1=1 {0} {2} WHERE 1=1 {0} {2}
UNION ALL UNION ALL
...@@ -481,7 +481,7 @@ FROM ...@@ -481,7 +481,7 @@ FROM
,b.School_Id,IFNULL(B.AssistName,'') AS EmployeeName,B.AssistIcon AS UserIcon,B.Dept_Id,B.Post_Id,B.IDCard ,b.School_Id,IFNULL(B.AssistName,'') AS EmployeeName,B.AssistIcon AS UserIcon,B.Dept_Id,B.Post_Id,B.IDCard
,B.Sex,B.Education,B.EntryTime,B.Address,B.BirthDate ,B.Sex,B.Education,B.EntryTime,B.Address,B.BirthDate
,B.LeaveStatus,B.LeaveTime,B.AssistTel AS EmployeeTel,IFNULL(B.Email,'') AS Email ,B.LeaveStatus,B.LeaveTime,B.AssistTel AS EmployeeTel,IFNULL(B.Email,'') AS Email
,0 as BaseHourFee ,0 as BaseHourFee,0 as BaseHoursEnabled,'' as EnableTime
FROM rb_assist AS B LEFT JOIN rb_account AS A ON A.AccountId=B.AId AND A.AccountType=3 FROM rb_assist AS B LEFT JOIN rb_account AS A ON A.AccountId=B.AId AND A.AccountType=3
WHERE 1=1 {0} {3} WHERE 1=1 {0} {3}
) AS A LEFT JOIN rb_group AS g ON A.Group_Id=g.GId ) AS A LEFT JOIN rb_group AS g ON A.Group_Id=g.GId
......
...@@ -404,7 +404,9 @@ namespace Edu.WebApi.Controllers.User ...@@ -404,7 +404,9 @@ namespace Edu.WebApi.Controllers.User
BaseStuNum = base.ParmJObj.GetInt("BaseStuNum"), BaseStuNum = base.ParmJObj.GetInt("BaseStuNum"),
BaseHourFee = base.ParmJObj.GetDecimal("BaseHourFee"), BaseHourFee = base.ParmJObj.GetDecimal("BaseHourFee"),
AuditStatus = AccountStatusEnum.Pass, AuditStatus = AccountStatusEnum.Pass,
Specialty=base.ParmJObj.GetStringValue("Specialty"), Specialty = base.ParmJObj.GetStringValue("Specialty"),
BaseHoursEnabled = base.ParmJObj.GetInt("BaseHoursEnabled", 0),
EnableTime = base.ParmJObj.GetStringValue("EnableTime")
}; };
extModel.TeachTag = base.ParmJObj.GetStringValue("TeachTag"); extModel.TeachTag = base.ParmJObj.GetStringValue("TeachTag");
extModel.CreateBy = base.UserInfo.Id; extModel.CreateBy = base.UserInfo.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