Commit c1d93321 authored by liudong1993's avatar liudong1993

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

parents eeea2e26 6d994ccf
......@@ -112,7 +112,7 @@ namespace Edu.Common
}
/// <summary>
/// 格式化时间【yyyy-MM-dd
/// 格式化时间【yyyy年MM月dd日
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
......
......@@ -345,5 +345,30 @@ namespace Edu.Model.Entity.Sell
/// 是否已回归原班(1-是)
/// </summary>
public int IsBackClass { get; set; }
/// <summary>
/// 同业ID
/// </summary>
public int CustomerId { get; set; }
/// <summary>
/// 付款状态 1已付款 2未付款
/// </summary>
public int PayState { get; set; }
/// <summary>
/// 付款时间
/// </summary>
public DateTime? PayDate { get; set; }
/// <summary>
/// 兑换奖品人数
/// </summary>
public int ExchangeNum { get; set; }
/// <summary>
/// 兑换奖品金额
/// </summary>
public decimal ExchangeMoney { get; set; }
}
}
......@@ -186,6 +186,11 @@ namespace Edu.Model.ViewModel.Sell
/// </summary>
public string CourseName { get; set; }
/// <summary>
/// 课程封面图
/// </summary>
public string CourseImg { get; set; }
/// <summary>
/// 开班时间
/// </summary>
......@@ -254,5 +259,15 @@ namespace Edu.Model.ViewModel.Sell
/// 科目名称
/// </summary>
public string CourseSubjectName { get; set; }
/// <summary>
/// 班级开班状态
/// </summary>
public ClassStatusEnum ClassStatus { get; set; }
/// <summary>
/// 学生表_学员编号
/// </summary>
public int Q_StudentId { get; set; }
}
}
\ No newline at end of file
......@@ -36,5 +36,25 @@ namespace Edu.Model.ViewModel.User
/// 学员状态
/// </summary>
public GuestStateEnum StuGuestState { get; set; }
/// <summary>
/// 订单状态
/// </summary>
public OrderStateEnum OrderState { get; set; }
/// <summary>
/// 总课时
/// </summary>
public decimal TotalHours { get; set; }
/// <summary>
/// 完成课时
/// </summary>
public decimal CompleteHours { get; set; }
/// <summary>
/// 班级状态
/// </summary>
public ClassStatusEnum ClassStatus { get; set; }
}
}
......@@ -141,5 +141,10 @@ namespace Edu.Model.ViewModel.User
/// 学员状态
/// </summary>
public GuestStateEnum StuGuestState { get; set; }
/// <summary>
/// 账号表主键编号
/// </summary>
public int Account_Id { get; set; }
}
}
\ No newline at end of file
......@@ -163,6 +163,11 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_Student_MakeupRepository student_MakeupRepository = new RB_Student_MakeupRepository();
/// <summary>
/// 学员订单仓储层对象
/// </summary>
private readonly RB_Student_OrderGuestRepository student_OrderGuestRepository = new RB_Student_OrderGuestRepository();
/// <summary>
/// 日志仓储对象
/// </summary>
......@@ -1967,7 +1972,6 @@ namespace Edu.Module.Course
{
//基础课时分钟数
var BasicMinutes = 0;
//BasicMinutes = class_ConfigRepository.GetBasicMinutesRepository(list[0].Group_Id);
BasicMinutes = class_ConfigRepository.GetClassMinutesRepository(list[0].ClassId);
var timeModel = class_TimeRepository.GetClassTimeListRepository(new RB_Class_Time_ViewModel()
{
......@@ -2638,7 +2642,6 @@ namespace Edu.Module.Course
var makeUpHours = (guestModel?.MakeUpHours ?? 0) + (checkModel?.CurrentDeductionHours ?? 0);
Dictionary<string, object> guestFileds = new Dictionary<string, object>()
{
//{ nameof(RB_Order_Guest_ViewModel.GuestState), 1 },
{ nameof(RB_Order_Guest_ViewModel.MakeUpHours),makeUpHours }
};
flag = order_GuestRepository.Update(guestFileds, new WhereHelper(nameof(RB_Order_Guest_ViewModel.Id), GuestId));
......@@ -3397,18 +3400,10 @@ namespace Edu.Module.Course
timeList = class_TimeRepository.GetClassTimeListRepository(new RB_Class_Time_ViewModel() { QClassPlanIds = Ids });
}
string ClassIds = string.Join(",", planList.GroupBy(x => x.ClassId).Select(x => x.Key));
//var orderStudentList = order_GuestRepository.GetList(new RB_Order_Guest_ViewModel()
//{
// ClassIds = ClassIds,
// Group_Id = model.Group_Id,
// School_Id = model.School_Id
//}).Where(x => x.GuestState == 1).ToList();
foreach (var item in planList)
{
item.PlanTimeList = new List<RB_Class_Time_ViewModel>();
item.PlanTimeList = timeList.Where(x => x.ClassPlanId == item.ClassPlanId).ToList();
//item.GuestList = new List<RB_Order_Guest_ViewModel>();
//item.GuestList = orderStudentList.Where(x => x.ClassId == item.ClassId).ToList();
}
}
return planList;
......@@ -3559,37 +3554,6 @@ namespace Edu.Module.Course
}
#endregion
/// <summary>
/// 修改班级默认上课时间
/// </summary>
/// <param name="ClassId"></param>
/// <param name="DefaultTimeJson"></param>
/// <returns></returns>
public bool UpdateClassTimeModule(int ClassId, string DefaultTimeJson)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Class_ViewModel.DefaultTimeJson), DefaultTimeJson},
};
var flag = classRepository.Update(fileds, new WhereHelper(nameof(RB_Class_ViewModel.ClassId), ClassId));
return flag;
}
/// <summary>
/// 更新上课计划中的课时数
/// </summary>
/// <param name="ClassTimeId"></param>
/// <param name="TimeHour"></param>
/// <returns></returns>
public bool UpdateClassPlanTimeModule(int ClassTimeId, decimal TimeHour)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Class_Time.TimeHour), TimeHour},
};
var flag = class_TimeRepository.Update(fileds, new WhereHelper(nameof(RB_Class_Time.ClassTimeId), ClassTimeId));
return flag;
}
#region 班级课程关联管理
......@@ -4407,7 +4371,6 @@ namespace Edu.Module.Course
if (list != null && list.Count > 0)
{
var classTimeList = new List<RB_Class_Time_ViewModel>();
// var classOrderList = new List<RB_Order_ViewModel>();
var stepPriceList = new List<RB_Class_StepPrice_ViewModel>();
var otherCourseList = new List<RB_Class_Course_Extend>();
var maxPlanDateList = new List<RB_Class_Plan_ViewModel>();
......@@ -4415,7 +4378,6 @@ namespace Edu.Module.Course
if (!string.IsNullOrEmpty(ids))
{
classTimeList = class_TimeRepository.GetClassTimeListRepository(ids);
// classOrderList = orderRepository.GetClassOrderPeopleNumRepository(ids);
otherCourseList = GetClassCourseListModule(new RB_Class_Course_Extend() { QClassIds = ids });
maxPlanDateList = class_PlanRepository.GetClassPlanMaxDataRepository(new RB_Class_Plan_ViewModel()
{
......@@ -4778,8 +4740,6 @@ namespace Edu.Module.Course
#endregion
#region 上课反馈记录
/// <summary>
/// 反馈意见
......@@ -4835,5 +4795,70 @@ namespace Edu.Module.Course
return class_FeedBackRepository.GetClassFeedBackPageListRepository(pageIndex, pageSize, out rowsCount, query);
}
#endregion
/// <summary>
/// 同业小程序获取学习学习情况
/// </summary>
/// <param name="student_stuId"></param>
/// <returns></returns>
public object AppCustomerGetClassPlan(int student_stuId)
{
decimal SurplusClassHours = 0;
ClassStatusEnum classStatus = 0;
GuestStateEnum StuGuestState = 0;
List<object> list = new List<object>();
var stuOrderList= student_OrderGuestRepository.GetStrOrderGuestListRepository(new RB_Student_OrderGuest_ViewModel()
{
Student_Id = student_stuId
});
if (stuOrderList != null && stuOrderList.Count > 0)
{
var firstModel= stuOrderList.Where(qitem =>
qitem.OrderState == OrderStateEnum.Normal
&& qitem.ClassStatus != ClassStatusEnum.EndClass
&& (qitem.TotalHours - qitem.CompleteHours) > 0)
?.OrderBy(qitem => qitem.OrderId)
?.FirstOrDefault();
int classId = firstModel?.ClassId??0;
classStatus = firstModel?.ClassStatus ?? 0;
StuGuestState = firstModel?.StuGuestState ?? 0;
SurplusClassHours = (firstModel?.TotalHours ?? 0) - (firstModel?.CompleteHours ?? 0);
if (SurplusClassHours < 0)
{
SurplusClassHours = 0;
}
if (classId > 0)
{
var planList = class_PlanRepository.GetClassPlanListExtRepository(new RB_Class_Plan_ViewModel()
{
ClassId = classId,
StartTime = Common.ConvertHelper.FormatDate(DateTime.Now)
});
var disList = planList.GroupBy(qitem => new { qitem.ClassId, qitem.ClassDate }).Select(qitem => new { qitem.Key.ClassId, qitem.Key.ClassDate }).Take(10);
foreach (var item in disList)
{
var tempModel = planList.Where(qitem => qitem.ClassId == item.ClassId && qitem.ClassDate == item.ClassDate)?.OrderBy(qitem => qitem.StartTime)?.FirstOrDefault();
list.Add(new
{
tempModel?.CourseName,
tempModel?.RoomName,
tempModel?.TeacherName,
TeacherIcon=tempModel?.UserIcon,
ClassTime= Common.ConvertHelper.FormatDate2(tempModel?.ClassDate) +" "+tempModel?.StartTime
});
}
}
}
var result = new
{
classStatus,
classStatusName = classStatus.ToName(),
StuGuestState,
StuGuestStateName = StuGuestState.ToName(),
SurplusClassHours,
PlanList = list
};
return result;
}
}
}
This diff is collapsed.
......@@ -31,7 +31,7 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_Student_BackClassRepository student_BackClassRepository = new RB_Student_BackClassRepository();
/// <summary>
/// 学员签到仓储层对象
/// </summary>
......@@ -52,7 +52,7 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_BackClass_ProtocolRepository backClass_ProtocolRepository = new RB_BackClass_ProtocolRepository();
/// <summary>
/// 创建退课流程
......@@ -67,7 +67,7 @@ namespace Edu.Module.Course
/// <param name="StateMent">退课协议申明</param>
/// <param name="message"></param>
/// <returns></returns>
public virtual bool CreateBackClassApplyModule(int GuestId, int OrderId, string reason, UserInfo userinfo,string receiptFile,string BackAccountName,string BackAccount,string StateMent,out string message)
public virtual bool CreateBackClassApplyModule(int GuestId, int OrderId, string reason, UserInfo userinfo, string receiptFile, string BackAccountName, string BackAccount, string StateMent, out string message)
{
bool flag;
message = "";
......@@ -90,7 +90,7 @@ namespace Edu.Module.Course
message = "未找到对应的班级信息!";
return false;
}
//获取教师实体信息
var teacherModel = accountRepository.GetAccountListExtRepository(new Model.ViewModel.User.RB_Account_ViewModel()
{
......@@ -98,7 +98,8 @@ namespace Edu.Module.Course
AccountType = Common.Enum.User.AccountTypeEnum.Teacher
})?.FirstOrDefault();
var teacherId = teacherModel?.Id ?? 0;
var saleMan = accountRepository.GetAccountListExtRepository(new Model.ViewModel.User.RB_Account_ViewModel() {
var saleMan = accountRepository.GetAccountListExtRepository(new Model.ViewModel.User.RB_Account_ViewModel()
{
Id = orderModel.EnterID
})?.FirstOrDefault();
var totalBackCount = student_BackClassRepository.GetStudentBackClassNumRepository();
......@@ -123,12 +124,12 @@ namespace Edu.Module.Course
{
courseModel = courseRepository.GetEntity(classModel.CouseId);
}
//预计退款金额
decimal backMoney =0;
backMoney = orderRepository.CalcBackMoneyRepository(orderModel, courseModel, FinishHours,out _);
decimal backMoney = 0;
backMoney = orderRepository.CalcBackMoneyRepository(orderModel, courseModel, FinishHours, out _);
var backClassModel = new RB_Student_BackClass_ViewModel()
{
BackId = 0,
......@@ -147,8 +148,8 @@ namespace Edu.Module.Course
OrderId = OrderId,
ApplyReason = reason,
FlowId = Common.Config.BackClassFlowId,
BackAccountName=BackAccountName,
BackAccount=BackAccount,
BackAccountName = BackAccountName,
BackAccount = BackAccount,
};
var newBackId = student_BackClassRepository.Insert(backClassModel);
backClassModel.BackId = newBackId;
......@@ -157,21 +158,21 @@ namespace Edu.Module.Course
{
flag = education_ReceiptRepository.SetEducationReceiptRepository(new RB_Education_Receipt()
{
Id=0,
Title="退课单据",
ClassId=orderModel.ClassId,
OrderId=orderModel.OrderId,
ReceiptType= Common.Enum.Finance.ReceiptTypeEnum.BackClass,
RelationId= backClassModel.BackId,
Group_Id=orderModel.Group_Id,
School_Id=orderModel.School_Id,
CreateBy=userinfo.Id,
CreateTime=DateTime.Now,
UpdateBy=userinfo.Id,
UpdateTime=DateTime.Now,
RecipientIds="",
VerifyStatus= Common.Enum.EduTask.EduTaskRrocessStatus.NotAudit,
ReceiptFile= receiptFile
Id = 0,
Title = "退课单据",
ClassId = orderModel.ClassId,
OrderId = orderModel.OrderId,
ReceiptType = Common.Enum.Finance.ReceiptTypeEnum.BackClass,
RelationId = backClassModel.BackId,
Group_Id = orderModel.Group_Id,
School_Id = orderModel.School_Id,
CreateBy = userinfo.Id,
CreateTime = DateTime.Now,
UpdateBy = userinfo.Id,
UpdateTime = DateTime.Now,
RecipientIds = "",
VerifyStatus = Common.Enum.EduTask.EduTaskRrocessStatus.NotAudit,
ReceiptFile = receiptFile
}, out message);
if (flag)
{
......@@ -200,33 +201,33 @@ namespace Edu.Module.Course
string ProtocolNum = (contractModel?.ContractNo ?? "") + "-T";
RB_BackClass_Protocol model = new RB_BackClass_Protocol()
{
Id=0,
BackId= newBackId,
ProtocolNum= ProtocolNum,
PartyAName=guestModel.GuestName,
PartyAGuardian="",
PartyBName= "成都市锦江区甲鹤外语培训学校有限公司",
PartyBLegal="",
SignDate=null,
OldSaleMan= saleMan?.AccountName??"",
OldCourseName=courseModel?.CourseName??"",
OldSellPrice=courseModel?.SellPrice??0,
OldDiscountMoney=orderModel?.PerDiscountMoney??0,
OldIncome=((orderModel?.Income ?? 0) + (orderModel?.PlatformTax ?? 0) - (orderModel?.Refund ?? 0))/orderModel.GuestNum,
OldFinaceNum= FinaceNum,
OldReceiveMan=saleMan?.AccountName??"",
TotalClassHours=guestModel.TotalHours,
CompleteHours=guestModel.CompleteHours,
SurplusHours= guestModel.TotalHours- guestModel.CompleteHours,
BackMoney= backClassModel.BackMoney,
AuditStatus=(int)Common.Enum.EduTask.EduTaskRrocessStatus.NotAudit,
CreateBy=orderModel.EnterID,
CreateTime=DateTime.Now,
Group_Id= classModel.Group_Id,
School_Id=classModel.School_Id,
StateMent=StateMent
Id = 0,
BackId = newBackId,
ProtocolNum = ProtocolNum,
PartyAName = guestModel.GuestName,
PartyAGuardian = "",
PartyBName = "成都市锦江区甲鹤外语培训学校有限公司",
PartyBLegal = "",
SignDate = null,
OldSaleMan = saleMan?.AccountName ?? "",
OldCourseName = courseModel?.CourseName ?? "",
OldSellPrice = courseModel?.SellPrice ?? 0,
OldDiscountMoney = orderModel?.PerDiscountMoney ?? 0,
OldIncome = ((orderModel?.Income ?? 0) + (orderModel?.PlatformTax ?? 0) - (orderModel?.Refund ?? 0)) / orderModel.GuestNum,
OldFinaceNum = FinaceNum,
OldReceiveMan = saleMan?.AccountName ?? "",
TotalClassHours = guestModel.TotalHours,
CompleteHours = guestModel.CompleteHours,
SurplusHours = guestModel.TotalHours - guestModel.CompleteHours,
BackMoney = backClassModel.BackMoney,
AuditStatus = (int)Common.Enum.EduTask.EduTaskRrocessStatus.NotAudit,
CreateBy = orderModel.EnterID,
CreateTime = DateTime.Now,
Group_Id = classModel.Group_Id,
School_Id = classModel.School_Id,
StateMent = StateMent
};
flag = backClass_ProtocolRepository.Insert(model) > 0;
flag = backClass_ProtocolRepository.Insert(model) > 0;
}
return flag;
}
......@@ -298,4 +299,4 @@ namespace Edu.Module.Course
return flag;
}
}
}
}
\ No newline at end of file
......@@ -146,39 +146,7 @@ namespace Edu.Module.User
/// <returns></returns>
public bool SetStudentModule(RB_Student_ViewModel model)
{
bool flag;
if (model.StuId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_ViewModel.StuName),model.StuName.Trim() },
{nameof(RB_Student_ViewModel.StuTel),model.StuTel.Trim() },
{nameof(RB_Student_ViewModel.StuIcon),model.StuIcon.Trim() },
{nameof(RB_Student_ViewModel.StuSex),model.StuSex },
{nameof(RB_Student_ViewModel.StuBirth),model.StuBirth },
{nameof(RB_Student_ViewModel.ProviceId),model.ProviceId },
{nameof(RB_Student_ViewModel.CityId),model.CityId },
{nameof(RB_Student_ViewModel.AreaId),model.AreaId },
{nameof(RB_Student_ViewModel.Interest),model.Interest },
{nameof(RB_Student_ViewModel.JapanBaseInfo),model.JapanBaseInfo },
{nameof(RB_Student_ViewModel.StuProfession),model.StuProfession },
{nameof(RB_Student_ViewModel.StuEducation),model.StuEducation },
{nameof(RB_Student_ViewModel.StuPurpose),model.StuPurpose },
{nameof(RB_Student_ViewModel.StuSource),model.StuSource },
{nameof(RB_Student_ViewModel.StuAddress),model.StuAddress },
{nameof(RB_Student_ViewModel.StuContract),model.StuContract },
{nameof(RB_Student_ViewModel.StuContractMobile),model.StuContractMobile },
{nameof(RB_Student_ViewModel.StuIDCard),model.StuIDCard },
{nameof(RB_Student_ViewModel.StuIDCardAddress),model.StuIDCardAddress },
};
flag = studentRepository.Update(fileds, new WhereHelper(nameof(RB_Student_ViewModel.StuId), model.StuId));
}
else
{
var newId = studentRepository.Insert(model);
model.StuId = newId;
flag = newId > 0;
}
bool flag = studentRepository.SetStudentRepository(model);
return flag;
}
......
......@@ -91,11 +91,12 @@ WHERE 1=1
SELECT A.*,IFNULL(B.RoomName,'') AS RoomName,IFNULL(T.TeacherName,'') AS TeacherName,IFNULL(T.TeacherHead,'') AS UserIcon
,Time.StartTime,time.EndTime,time.ClassTimeId
,TIMESTAMPDIFF(MINUTE, CONCAT('2020-12-16',' ',time.StartTime), CONCAT('2020-12-16',' ',time.EndTime)) AS ClassMinutes
,time.TimeHour,c.ClassName
,time.TimeHour,c.ClassName,IFNULL(course.CourseName,'') AS CourseName
FROM RB_Class_Plan AS A LEFT JOIN rb_class_room AS B ON A.ClassRoomId=B.RoomId
LEFT JOIN rb_teacher AS T ON A.TeacherId=T.TId
LEFT JOIN rb_class_time AS time ON A.ClassPlanId=Time.ClassPlanId
Left JOIN rb_class as c ON c.ClassId=A.ClassId
LEFT JOIN rb_class as c ON c.ClassId=A.ClassId
LEFT JOIN rb_course AS course ON c.CouseId=course.CourseId
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.Status), (int)DateStateEnum.Normal);
......@@ -483,7 +484,8 @@ WHERE 1=1 and class.ClassStatus in(1,2) and t.`Status`=0 and a.`Status`=0 and
public List<RB_Class_Plan_ViewModel> GetStudentPlanListRepository(RB_Class_Plan_ViewModel query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat($@"SELECT a.*,c.ClassName,lp.LessonPlanNum,c.ClassHours,b.RoomName,IFNULL(T.TeacherHead,'') AS UserIcon,IFNULL(T.TeacherName,'') AS TeacherName FROM rb_class_plan as a LEFT JOIN rb_class as c on a.ClassId=c.ClassId
builder.AppendFormat($@"
SELECT a.*,c.ClassName,lp.LessonPlanNum,c.ClassHours,b.RoomName,IFNULL(T.TeacherHead,'') AS UserIcon,IFNULL(T.TeacherName,'') AS TeacherName FROM rb_class_plan as a LEFT JOIN rb_class as c on a.ClassId=c.ClassId
LEFT JOIN rb_class_room as b on a.ClassRoomId=b.RoomId
LEFT JOIN rb_teacher AS T ON c.Teacher_Id=T.TId
LEFT JOIN rb_student_orderguest as sog on sog.ClassId=c.ClassId
......
......@@ -26,10 +26,6 @@ namespace Edu.Repository.Sell
{
where += $@" and o.{nameof(RB_Order_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
//if (demodel.School_Id > 0)
//{
// where += $@" and o.{nameof(RB_Order_ViewModel.School_Id)} ={demodel.School_Id}";
//}
if (demodel.OrderId > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}";
......@@ -223,6 +219,11 @@ ORDER BY {orderBy}
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%{demodel.GuestName}%')";
}
}
//学生表中学员编号
if (demodel.Q_StudentId > 0)
{
where += string.Format(" AND o.OrderId IN (SELECT OrderId FROM rb_student_orderguest WHERE Student_Id={0}) ", demodel.Q_StudentId);
}
if (demodel.CourseId > 0)
{
where += $@" and c.{nameof(RB_Class.CouseId)} ={demodel.CourseId}";
......@@ -256,6 +257,10 @@ ORDER BY {orderBy}
{
where += $@" and course.{nameof(RB_Order_ViewModel.CourseSubject)} = {demodel.CourseSubject}";
}
if (demodel.CustomerId > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.CustomerId)} = {demodel.CustomerId}";
}
string orderBy = " o.OrderId asc";
if (demodel.Q_OrderBy == 1)
{
......@@ -268,12 +273,13 @@ ORDER BY {orderBy}
string sql = $@"
SELECT o.*,c.ClassName,c.ClassNo,c.School_Id as ClassSchoolId,t.TeacherName,t.TeacherIcon,IFNULL(course.CourseName,'') AS CourseName
,C.OpenTime,course.CourseSubject,IFNULL(csubject.SubjectName,'') AS CourseSubjectName
FROM RB_Order o
LEFT JOIN rb_class c on o.ClassId = c.ClassId
,C.OpenTime,course.CourseSubject,IFNULL(csubject.SubjectName,'') AS CourseSubjectName,IFNULL(school.SName,'') AS SchoolName
,IFNULL(c.ClassStatus,0) AS ClassStatus,IFNULL(course.CoverImg,'') AS CourseImg
FROM RB_Order o LEFT JOIN rb_class c on o.ClassId = c.ClassId
LEFT JOIN rb_teacher t on c.Teacher_Id = t.TId
LEFT JOIN rb_course AS course ON (o.CourseId=course.CourseId AND o.CourseId>0 AND o.OrderType=1)
LEFT JOIN rb_course_subject AS csubject ON course.CourseSubject=csubject.Id
LEFT JOIN rb_school AS school ON c.School_Id=school.SId
WHERE {where} ORDER BY {orderBy}
";
return GetPage<RB_Order_ViewModel>(pageIndex, pageSize, out rowsCount, sql).ToList();
......@@ -842,7 +848,6 @@ GROUP BY o.EnterID
#endregion
#region 未完成的订单
/// <summary>
/// 获取我的未完成的订单
......
......@@ -251,10 +251,6 @@ WHERE 1=1 AND A.Status=0
{
where += $@" and A.{nameof(RB_Order_Guest_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
//if (demodel.School_Id > 0)
//{
// where += $@" and A.{nameof(RB_Order_Guest_ViewModel.School_Id)} ={demodel.School_Id}";
//}
if (demodel.Id > 0)
{
where += $@" and A.{nameof(RB_Order_Guest_ViewModel.Id)} ={demodel.Id}";
......@@ -568,7 +564,6 @@ WHERE {where}";
return Get<RB_Order_Guest_ViewModel>(sql).ToList();
}
#region 临时上课邀请学生查询
/// <summary>
/// 获取列表
......@@ -638,8 +633,6 @@ WHERE {where}";
#endregion
#region 学员名单
/// <summary>
/// 获取学员名单分页列表
......
using Edu.Common.Enum;
using Edu.Model.ViewModel.User;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB;
using VT.FW.DB.Dapper;
namespace Edu.Repository.User
......@@ -12,6 +14,11 @@ namespace Edu.Repository.User
/// </summary>
public class RB_StudentRepository : BaseRepository<Model.Entity.User.RB_Student>
{
/// <summary>
/// 账号
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 获取学生列表
/// </summary>
......@@ -161,7 +168,6 @@ where b.`Status`=0 and b.ClassStatus in(1,2) and a.status=0 and a.Account_Id={
}
/// <summary>
/// 根据学生id获取学生的班级课程学校信息
/// </summary>
......@@ -183,5 +189,62 @@ FROM rb_student as s LEFT JOIN rb_student_orderguest as sog on s.StuId=sog.Stude
WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 and cou.`Status`=0 and c.`Status`=0 and s.`Status`=0 and s.StuId={Student_Id} and s.Group_Id={Group_Id}");
return Get<RB_Student_ViewModel>(builder.ToString(), parameters).ToList();
}
public bool SetStudentRepository(RB_Student_ViewModel model)
{
bool flag;
if (model.StuId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_ViewModel.StuName),model.StuName.Trim() },
{nameof(RB_Student_ViewModel.StuTel),model.StuTel.Trim() },
{nameof(RB_Student_ViewModel.StuIcon),model.StuIcon.Trim() },
{nameof(RB_Student_ViewModel.StuSex),model.StuSex },
{nameof(RB_Student_ViewModel.StuBirth),model.StuBirth },
{nameof(RB_Student_ViewModel.ProviceId),model.ProviceId },
{nameof(RB_Student_ViewModel.CityId),model.CityId },
{nameof(RB_Student_ViewModel.AreaId),model.AreaId },
{nameof(RB_Student_ViewModel.Interest),model.Interest },
{nameof(RB_Student_ViewModel.JapanBaseInfo),model.JapanBaseInfo },
{nameof(RB_Student_ViewModel.StuProfession),model.StuProfession },
{nameof(RB_Student_ViewModel.StuEducation),model.StuEducation },
{nameof(RB_Student_ViewModel.StuPurpose),model.StuPurpose },
{nameof(RB_Student_ViewModel.StuSource),model.StuSource },
{nameof(RB_Student_ViewModel.StuAddress),model.StuAddress },
{nameof(RB_Student_ViewModel.StuContract),model.StuContract },
{nameof(RB_Student_ViewModel.StuContractMobile),model.StuContractMobile },
{nameof(RB_Student_ViewModel.StuIDCard),model.StuIDCard },
{nameof(RB_Student_ViewModel.StuIDCardAddress),model.StuIDCardAddress },
};
flag = base.Update(fileds, new WhereHelper(nameof(RB_Student_ViewModel.StuId), model.StuId));
}
else
{
var newId = base.Insert(model);
model.StuId = newId;
flag = newId > 0;
//创建学生账号
model.Account_Id = accountRepository.Insert(new Model.Entity.User.RB_Account()
{
Id = 0,
Account = model.StuTel,
AccountId = model.StuId,
AccountType = Common.Enum.User.AccountTypeEnum.Student,
AnnualLeaveDay = 0,
CreateBy = model.CreateBy,
CreateTime = DateTime.Now,
Group_Id = model.Group_Id,
School_Id = model.School_Id,
Status = DateStateEnum.Normal,
UpdateBy = model.UpdateBy,
UpdateTime = DateTime.Now,
Password = Common.DES.Encrypt(Common.Config.DefaultPwd)
});
}
return flag;
}
}
}
\ No newline at end of file
......@@ -23,9 +23,10 @@ namespace Edu.Repository.User
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.ClassName,'') AS ClassName,IFNULL(B.ClassNo,'') AS ClassNo,IFNULL(C.JoinType,0) AS StuJoinType,IFNULL(D.GuestState,0) AS StuGuestState
,C.OrderState,IFNULL(D.TotalHours,0) AS TotalHours,IFNULL(D.CompleteHours,0) AS CompleteHours,IFNULL(B.ClassStatus,0) AS ClassStatus
FROM RB_Student_OrderGuest AS A LEFT JOIN rb_class AS B ON A.ClassId=B.ClassId
LEFT JOIN rb_order AS C ON A.OrderId=C.OrderId
LEFT JOIN rb_order_guest AS D ON A.GuestId=D.Id
LEFT JOIN rb_order_guest AS D ON A.GuestId=D.Id
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_OrderGuest_ViewModel.Status), (int)DateStateEnum.Normal);
......
......@@ -141,11 +141,9 @@ namespace Edu.WebApi.Controllers.APP
/// <returns></returns>
public ApiResult GetStudentPlan()
{
var query = new RB_Class_Plan_ViewModel()
{
Group_Id = base.AppUserInfo.Group_Id,
StuId = base.AppUserInfo.Id,
StartTime = base.ParmJObj.GetStringValue("StartTime"),
EndTime = base.ParmJObj.GetStringValue("EndTime"),
......
using Edu.Common.API;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Grade;
using Edu.Model.ViewModel.Sell;
using Edu.Module.Course;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Edu.WebApi.Controllers.B2BApp
{
/// <summary>
/// 甲鹤同业小程序相关接口
/// </summary>
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class B2BAppController : BaseController
{
/// <summary>
/// 订单处理类对象
/// </summary>
private readonly OrderModule orderModule = new OrderModule();
/// <summary>
/// 班级处理类对象
/// </summary>
private readonly ClassModule classModule = new ClassModule();
/// <summary>
/// 同行获取学员订单分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult CustomerGetStudentOrderPage()
{
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var customer = base.AppletCustomerInfo;
var query = new RB_Order_ViewModel()
{
Group_Id=customer.GroupId,
CustomerId=customer.CustomerId,
GuestName=base.ParmJObj.GetStringValue("GuestName"),
Q_StudentId=base.ParmJObj.GetInt("Q_StudentId"),
};
var list = orderModule.GetMyOrderPageList(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<RB_Class_Time_ViewModel> timeList = new List<RB_Class_Time_ViewModel>();
if (list != null && list.Count > 0)
{
string classIds = string.Join(",", list.Select(qitem => qitem.ClassId));
timeList= orderModule.GetClassOpenTimeListModule(classIds);
}
List<object> result = new List<object>();
foreach (var item in list)
{
var timeModel = timeList.Where(qitem => qitem.ClassId == item.ClassId)?.FirstOrDefault();
result.Add(new
{
item.CourseId,
item.CourseName,
item.CourseImg,
item.ClassId,
item.ClassName,
item.ClassNo,
OpenTime= timeModel?.NewPlanDateTime??"",
item.ClassSchoolId,
item.SchoolName,
item.OrderState,
OrderStateName = item.OrderState.ToName(),
CreateTimeStr = Common.ConvertHelper.FormatTime(item.CreateTime),
item.GuestNum,
GuestList = item.GuestList.Select(qitem => new { qitem.GuestName }),
item.Income,
item.ClassStatus,
ClassStatusName = item.ClassStatus.ToName(),
RebateMoney = 0,
DepositbookMoney = 0,
});
}
pageModel.PageData = result;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 同行获取学员上课计划
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult CustomerGetStudentPlan()
{
var customer = base.AppletCustomerInfo;
int StuId = base.ParmJObj.GetInt("StuId");
var obj = classModule.AppCustomerGetClassPlan(StuId);
return ApiResult.Success(data: obj);
}
}
}
......@@ -647,7 +647,6 @@ namespace Edu.WebApi.Controllers.User
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Student_ViewModel>(RequestParm.Msg.ToString());
query.Group_Id = base.UserInfo.Group_Id;
//query.School_Id = base.UserInfo.School_Id;
var list = studentModule.GetStudentPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
......
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