Commit 080d7001 authored by 吴春's avatar 吴春

1

parent 8f6b30ab
......@@ -1429,17 +1429,17 @@ namespace Edu.Module.Course
{
RList.Add(new
{
AccountId=0,
TeacherId=0,
TeacherHead="",
TeacherName="",
TeacherIntro="",
RoomId=0,
RoomName="",
SchoolName="",
CourseTimeList= ctModel.TimeList,
StartTime="",
EndTime=""
AccountId = 0,
TeacherId = 0,
TeacherHead = "",
TeacherName = "",
TeacherIntro = "",
RoomId = 0,
RoomName = "",
SchoolName = "",
CourseTimeList = ctModel.TimeList,
StartTime = "",
EndTime = ""
});
}
......@@ -2809,7 +2809,7 @@ namespace Edu.Module.Course
{
List<RB_Scroll_Appointment_ViewModel> list = new List<RB_Scroll_Appointment_ViewModel>();
list.Add(demodel);
class_CheckRepository.AppointStuCheckRepository(list,2);
class_CheckRepository.AppointStuCheckRepository(list, 2);
}
return flag ? "" : "出错了,请联系管理员";
#endregion
......@@ -3202,11 +3202,11 @@ namespace Edu.Module.Course
/// <param name="date"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public bool CancelSureAppointmentNewModule(CancelAppointmentModel model, UserInfo userInfo,out string message)
public bool CancelSureAppointmentNewModule(CancelAppointmentModel model, UserInfo userInfo, out string message)
{
message = "";
bool flag = false;
List<int> appointList = model.StuList.Select(qitem=>qitem.AppointId).ToList();
List<int> appointList = model.StuList.Select(qitem => qitem.AppointId).ToList();
//查询当日 所有的预约记录
var alllist = scroll_AppointmentRepository.GetAppointList(new RB_Scroll_Appointment_ViewModel() { Group_Id = userInfo.Group_Id, StartTime = model.Date, EntTime = model.Date, AccountId = model.AccountId, ShiftSort = model.ShiftSort });
var list = alllist.Where(x => appointList.Contains(x.Id)).ToList();
......@@ -3240,7 +3240,7 @@ namespace Edu.Module.Course
var tempList = list.Where(qitem => qitem.State != Common.Enum.Course.CourseAppointStateEnum.Cancel && qitem.State != Common.Enum.Course.CourseAppointStateEnum.Absent)?.ToList();
foreach (var item in tempList)
{
var currentStu= model.StuList.FirstOrDefault(qitem => qitem.AppointId == item.Id);
var currentStu = model.StuList.FirstOrDefault(qitem => qitem.AppointId == item.Id);
item.IsCalcStuCheck = currentStu.IsCalcStuCheck;
Dictionary<string, object> keyValues = new Dictionary<string, object>()
{
......@@ -3320,7 +3320,7 @@ namespace Edu.Module.Course
{
class_CheckRepository.Delete(qitem);
//更新学员完成课时
var oldCheckList =class_CheckRepository.GetClassCheckList(new RB_Class_Check_ViewModel() { QOrderGuestIds = item.GuestId.ToString() });
var oldCheckList = class_CheckRepository.GetClassCheckList(new RB_Class_Check_ViewModel() { QOrderGuestIds = item.GuestId.ToString() });
decimal finishHours = 0;
if (oldCheckList != null && oldCheckList.Count > 0)
{
......@@ -3333,6 +3333,14 @@ namespace Edu.Module.Course
};
order_GuestRepository.Update(guestFileds, new WhereHelper(nameof(RB_Order_Guest_Extend.Id), item.GuestId));
}
else if (item.IsCalcStuCheck == 1)
{
Dictionary<string, object> guestFileds = new Dictionary<string, object>()
{
{nameof(RB_Class_Check.IsCalcTeacFee), 0},
};
class_CheckRepository.Update(guestFileds, new WhereHelper(nameof(RB_Class_Check.ClassCheckId), qitem.ClassCheckId));
}
}
}
}
......@@ -3718,12 +3726,12 @@ namespace Edu.Module.Course
//根据课程Id 查询 上课课程
List<int> courseIdList = new List<int>();
courseIdList.Add(item.CourseId);
var tempCourseList = orderCourseList?.Where(qitem => qitem.OrderId == item.OrderId)?.Select(qitem=>qitem.CourseId)?.ToList()?.Distinct();
var tempCourseList = orderCourseList?.Where(qitem => qitem.OrderId == item.OrderId)?.Select(qitem => qitem.CourseId)?.ToList()?.Distinct();
if (tempCourseList != null && tempCourseList.Count() > 0)
{
courseIdList.AddRange(tempCourseList);
}
var cList = course_ChapterRepository.GetChapterListRepository(new RB_Course_Chapter_ViewModel() { Group_Id = demodel.Group_Id, CourseIds = string.Join(",", courseIdList.Distinct()),QOrderBy=1 })?.ToList();
var cList = course_ChapterRepository.GetChapterListRepository(new RB_Course_Chapter_ViewModel() { Group_Id = demodel.Group_Id, CourseIds = string.Join(",", courseIdList.Distinct()), QOrderBy = 1 })?.ToList();
if (item.ClassScrollType == 2)
{
......@@ -3731,7 +3739,7 @@ namespace Edu.Module.Course
foreach (var sItem in cList)
{
var AppointModel = achildList.Where(y => y.CourseGradeId == sItem.CourseRate && y.CourseGradeNo==sItem.ChapterGradeNo).FirstOrDefault();
var AppointModel = achildList.Where(y => y.CourseGradeId == sItem.CourseRate && y.CourseGradeNo == sItem.ChapterGradeNo).FirstOrDefault();
//var SkipModel = SkipList.Where(y => y.ChapterNo == x.SortNum && y.CourseId == item.CourseId).FirstOrDefault();
int AgainNum = achildList.Where(y => y.CourseGradeId == sItem.CourseRate && y.CourseGradeNo == sItem.ChapterGradeNo && y.AppointType == 3).Count();
int State = 0;
......
This diff is collapsed.
......@@ -531,7 +531,7 @@ SELECT tt.TeacherId,tt.OrderGuestId,tt.CurrentDeductionHours
,IFNULL(g.ClassUnitPrice,0) as ClassUnitPrice
FROM(
SELECT p.TeacherId,p.OrderGuestId,SUM(p.CurrentDeductionHours) as CurrentDeductionHours FROM rb_class_check p
WHERE p.`Status`=0 and p.Group_Id ={groupId} and p.TeacherId in ({userIds}) and p.ClassDate >= '{startMonth}' and p.ClassDate <='{endMonth} 23:59:59'
WHERE p.`Status`=0 and p.IsCalcTeacFee=1 and p.Group_Id ={groupId} and p.TeacherId in ({userIds}) and p.ClassDate >= '{startMonth}' and p.ClassDate <='{endMonth} 23:59:59'
GROUP BY p.TeacherId,p.OrderGuestId
)tt
left join rb_order_guest g on g.Id = tt.OrderGuestId
......@@ -570,10 +570,9 @@ GROUP BY tt.TeacherId,tt.OrderGuestId
{
where += $@" and p.ClassId ={classId}";
}
string sql = $@"
SELECT p.TeacherId,t2.TeacherName,t2.BaseHourFee,t2.BaseHoursEnabled,t2.EnableTime,t2.BaseHoursAdd,if(cp.PlanType=2,'预约课',c.ClassName) as ClassName,if(cp.PlanType=2,co2.CourseName,co.CourseName) as CourseName,p.ClassId,if(cp.PlanType=2,co2.AddHoursMoney,co.AddHoursMoney) as CourseAddHoursMoney,
c.ClassType,c.ClassNo,if(cp.PlanType=2,s2.SName,s.SName) as SName,c.ClassHourMinute,if(cp.PlanType=2,cp.CourseId,c.CouseId) as CouseId,p.ClassDate,p.ClassTimeId,t.StartTime as StartDate,t.EndTime as EndDate,Max(p.IsCalcTeacFee =1 then p.CurrentDeductionHours else 0 end) as CurrentDeductionHours
c.ClassType,c.ClassNo,if(cp.PlanType=2,s2.SName,s.SName) as SName,c.ClassHourMinute,if(cp.PlanType=2,cp.CourseId,c.CouseId) as CouseId,p.ClassDate,p.ClassTimeId,t.StartTime as StartDate,t.EndTime as EndDate,Max(CASE p.IsCalcTeacFee WHEN 1 THEN p.CurrentDeductionHours ELSE 0 END) as CurrentDeductionHours
FROM rb_class_check p
INNER JOIN rb_class_time t on p.ClassTimeId = t.ClassTimeId
inner join rb_class_plan cp on t.ClassPlanId = cp.ClassPlanId
......@@ -583,7 +582,7 @@ LEFT JOIN rb_course co on c.CouseId = co.CourseId
left join rb_course co2 on cp.CourseId = co2.CourseId
left join rb_school s on s.SId = c.School_Id
left join rb_school s2 on s2.SId = cp.School_Id
WHERE p.`Status`=0 and p.Group_Id ={group_Id} {where} and p.ClassDate >= '{startMonth}' and p.ClassDate <='{endMonth} 23:59:59'
WHERE p.`Status`=0 and p.IsCalcTeacFee=1 and p.Group_Id ={group_Id} {where} and p.ClassDate >= '{startMonth}' and p.ClassDate <='{endMonth} 23:59:59'
GROUP BY p.TeacherId,p.ClassId,p.ClassTimeId
ORDER BY p.ClassDate ASC
";
......@@ -602,7 +601,7 @@ ORDER BY p.ClassDate ASC
/// <returns></returns>
public List<RB_Class_Check_ViewModel> GetTeacherConsumptionHoursDetialList(string teacherIds, int schoolId, int classId, string startMonth, string endMonth, int group_Id)
{
string where = $@" ";
string where = $@" and p.IsCalcTeacFee=1 ";
if (!string.IsNullOrEmpty(teacherIds) && teacherIds != "-1" && teacherIds != "0")
{
where += $@" and p.TeacherId in({teacherIds})";
......@@ -617,7 +616,7 @@ ORDER BY p.ClassDate ASC
}
string sql = $@"
SELECT p.TeacherId,t2.TeacherName,t2.BaseHourFee,t2.BaseHoursEnabled,t2.EnableTime,if(cp.PlanType=2,'预约课',c.ClassName) as ClassName,if(cp.PlanType=2,co2.CourseName,co.CourseName) as CourseName,if(cp.PlanType=2,co2.AddHoursMoney,co.AddHoursMoney) as CourseAddHoursMoney,
SELECT p.TeacherId,t2.TeacherName,t2.BaseHourFee,p.IsCalcTeacFee,t2.BaseHoursEnabled,t2.EnableTime,if(cp.PlanType=2,'预约课',c.ClassName) as ClassName,if(cp.PlanType=2,co2.CourseName,co.CourseName) as CourseName,if(cp.PlanType=2,co2.AddHoursMoney,co.AddHoursMoney) as CourseAddHoursMoney,
p.ClassId,if(cp.PlanType=2,s2.SName,s.SName) as SName,c.ClassType,c.ClassNo,c.ClassHourMinute,if(cp.PlanType=2,cp.CourseId,c.CouseId) as CouseId,p.ClassDate,p.ClassTimeId,t.StartTime as StartDate,t.EndTime as EndDate,Max(case when p.IsCalcTeacFee =1 then p.CurrentDeductionHours else 0 end) as CurrentDeductionHours FROM rb_class_check p
INNER JOIN rb_class_time t on p.ClassTimeId = t.ClassTimeId
inner join rb_class_plan cp on t.ClassPlanId = cp.ClassPlanId
......@@ -627,7 +626,7 @@ LEFT JOIN rb_course co on c.CouseId = co.CourseId
left join rb_course co2 on cp.CourseId = co2.CourseId
left join rb_school s on s.SId = c.School_Id
left join rb_school s2 on s2.SId = cp.School_Id
WHERE p.`Status`=0 and p.Group_Id ={group_Id} {where} and p.ClassDate >= '{startMonth}' and p.ClassDate <='{endMonth} 23:59:59'
WHERE p.`Status`=0 and p.IsCalcTeacFee=1 and p.Group_Id ={group_Id} {where} and p.ClassDate >= '{startMonth}' and p.ClassDate <='{endMonth} 23:59:59'
GROUP BY p.TeacherId,p.ClassId,p.ClassTimeId
ORDER BY p.ClassDate ASC
";
......@@ -652,7 +651,7 @@ ORDER BY p.ClassDate ASC
/// <returns></returns>
public List<RB_Class_Check_ViewModel> GetStudentConsumptionHoursDetialPageList(int pageIndex, int pageSize, out long count, int teacherId, int schoolId, int classId, string startMonth, string endMonth, string studentName, int orderId, string contractNo, int groupId, int StudentId)
{
string where = $@" ";
string where = $@" and p.IsCalcTeacFee=1 ";
if (teacherId > 0)
{
where += $@" and p.TeacherId ={teacherId}";
......@@ -689,7 +688,7 @@ case when tt.ClassHours>0 and tt.TotalSub >0 then
(tt.CourseFee - tt.DiscountMoney) /tt.ClassHours
else 0 END END AS UnitPrice
FROM (
SELECT p.OrderGuestId,p.CurrentDeductionHours,t2.GuestName,p.TeacherId,t3.TeacherName,t2.OrderId,ec.ContractNo,if(cp.PlanType=2,'预约课',c.ClassName) as ClassName,c.ClassNo,if(cp.PlanType=2,co2.CourseName,co.CourseName) as CourseName,p.ClassId,if(cp.PlanType=2,cp.CourseId,c.CouseId) as CouseId
SELECT p.OrderGuestId,p.CurrentDeductionHours,p.IsCalcTeacFee,t2.GuestName,p.TeacherId,t3.TeacherName,t2.OrderId,ec.ContractNo,if(cp.PlanType=2,'预约课',c.ClassName) as ClassName,c.ClassNo,if(cp.PlanType=2,co2.CourseName,co.CourseName) as CourseName,p.ClassId,if(cp.PlanType=2,cp.CourseId,c.CouseId) as CouseId
,p.ClassDate,p.ClassTimeId,t.StartTime as StartDate,t.EndTime as EndDate,o.EnterID,o.HelpEnterId
,IFNULL(o.PreferPrice,0) -IFNULL(o.TextbookFee,0) -IFNULL(o.CoursewareFee,0) as CourseFee
,IFNULL(o.DiscountMoney,0) as DiscountMoney
......@@ -729,7 +728,7 @@ ORDER BY tt.ClassDate ASC
/// <returns></returns>
public List<RB_Class_Check_ViewModel> GetStudentConsumptionHoursDetialList(int teacherId, int schoolId, int classId, string startMonth, string endMonth, string studentName, int orderId, string contractNo, int groupId, string classIds = "", int StudentId = 0)
{
string where = $@" ";
string where = $@" and p.IsCalcTeacFee=1 ";
if (teacherId > 0)
{
where += $@" and p.TeacherId ={teacherId}";
......@@ -770,7 +769,7 @@ case when tt.ClassHours>0 and tt.TotalSub >0 then
(tt.CourseFee - tt.DiscountMoney) /tt.ClassHours
else 0 END END AS UnitPrice
FROM (
SELECT p.OrderGuestId,p.CurrentDeductionHours,t2.GuestName,p.TeacherId,t3.TeacherName,t2.OrderId,ec.ContractNo,if(cp.PlanType=2,'预约课',c.ClassName) as ClassName,c.ClassNo,if(cp.PlanType=2,co2.CourseName,co.CourseName) as CourseName,p.ClassId,if(cp.PlanType=2,cp.CourseId,c.CouseId) as CouseId
SELECT p.OrderGuestId,p.CurrentDeductionHours,p.IsCalcTeacFee,t2.GuestName,p.TeacherId,t3.TeacherName,t2.OrderId,ec.ContractNo,if(cp.PlanType=2,'预约课',c.ClassName) as ClassName,c.ClassNo,if(cp.PlanType=2,co2.CourseName,co.CourseName) as CourseName,p.ClassId,if(cp.PlanType=2,cp.CourseId,c.CouseId) as CouseId
,p.ClassDate,p.ClassTimeId,t.StartTime as StartDate,t.EndTime as EndDate,o.EnterID,o.HelpEnterId
,IFNULL(o.PreferPrice,0) -IFNULL(o.TextbookFee,0) -IFNULL(o.CoursewareFee,0) as CourseFee
,IFNULL(o.DiscountMoney,0) as DiscountMoney
......
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