Commit a3569bd6 authored by 黄奎's avatar 黄奎

新增文件

parent 0c150ed5
using Edu.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Common.Enum.Course
{
/// <summary>
/// 排课方式枚举
/// </summary>
public enum ClassStyleEnum
{
/// <summary>
/// 按周排课
/// </summary>
[EnumField("按周排课")]
Week = 1,
/// <summary>
/// 按月排课
/// </summary>
[EnumField("按月排课")]
Month = 2,
/// <summary>
/// 固定日期
/// </summary>
[EnumField("固定日期")]
FixedDate = 3,
/// <summary>
/// 约课
/// </summary>
[EnumField("约课")]
OnLine =4,
}
/// <summary>
/// 课程状态枚举
/// </summary>
public enum ClassStatusEnum
{
/// <summary>
/// 开课中
/// </summary>
[EnumField("开课中")]
OpenClass =1,
/// <summary>
/// 节课
/// </summary>
[EnumField("节课")]
CloseClass = 2,
}
}
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using System;
using VT.FW.DB;
......@@ -70,5 +71,70 @@ namespace Edu.Model.Entity.Course
/// 删除状态(0-正常,1-禁用)
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 招生人数
/// </summary>
public int ClassPersion { get; set; }
/// <summary>
/// 开班时间
/// </summary>
public DateTime OpenTime { get; set; }
/// <summary>
/// 截止报名时间
/// </summary>
public DateTime? EndOrderTime { get; set; }
/// <summary>
/// 原价
/// </summary>
public decimal OriginalPrice { get; set; }
/// <summary>
/// 售价
/// </summary>
public decimal SellPrice { get; set; }
/// <summary>
/// 是否阶梯价(1-是)
/// </summary>
public int IsStepPrice { get; set; }
/// <summary>
/// 教室编号
/// </summary>
public int ClassRoomId { get; set; }
/// <summary>
/// 是否开启提成设置(1-是)
/// </summary>
public int IsOpenCommission { get; set; }
/// <summary>
/// 提成类型(1-人头,2-百分比)
/// </summary>
public int CommissionType { get; set; }
/// <summary>
/// 提成值
/// </summary>
public decimal CommissionValue { get; set; }
/// <summary>
/// 课时
/// </summary>
public int ClassHours { get; set; }
/// <summary>
/// 排课方式(1-周,2-月,3-固定日期,4-约课)
/// </summary>
public ClassStyleEnum ClassStyle { get; set; }
/// <summary>
/// 班级状态
/// </summary>
public ClassStatusEnum ClassStatus { get; set; }
}
}
using Edu.Common.Enum;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Course
{
/// <summary>
/// 班级上课计划实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Class_Plan
{
/// <summary>
/// 上课计划编号
/// </summary>
public int ClassPlanId { get; set; }
/// <summary>
/// 班级编号
/// </summary>
public int ClassId { get; set; }
/// <summary>
/// 上课日期
/// </summary>
public DateTime ClassDate { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 教室编号
/// </summary>
public int ClassRoomId { get; set; }
}
}
\ No newline at end of file
using Edu.Common.Enum;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Course
{
/// <summary>
/// 教室管理实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Class_Room
{
/// <summary>
/// 主键编号
/// </summary>
public int RoomId { get; set; }
/// <summary>
/// 教师名称
/// </summary>
public string RoomName { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 所属校区
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 状态
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 更新人
/// </summary>
public int? UpdateBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Course
{
/// <summary>
/// 班级阶梯价实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Class_StepPrice
{
/// <summary>
/// 课程阶梯价主键编号
/// </summary>
public int ClassStepPriceId { get; set; }
/// <summary>
/// 人数
/// </summary>
public int? PersionNum { get; set; }
/// <summary>
/// 价格
/// </summary>
public decimal PersionPrice { get; set; }
/// <summary>
/// 课程编号
/// </summary>
public int ClassId { get; set; }
}
}
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Course
{
/// <summary>
/// 班级上课时间实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Class_Time
{
/// <summary>
/// 上课时间编号
/// </summary>
public int ClassTimeId { get; set; }
/// <summary>
/// 上课计划编号
/// </summary>
public int ClassPlanId { get; set; }
/// <summary>
/// 上课开始时间
/// </summary>
public string StartTime { get; set; }
/// <summary>
/// 上课结束时间
/// </summary>
public string EndTime { get; set; }
}
}
using Edu.Model.Entity.Course;
namespace Edu.Model.ViewModel.Course
{
/// <summary>
/// 班级上课计划视图实体类
/// </summary>
public class RB_Class_Plan_ViewModel: RB_Class_Plan
{
/// <summary>
/// 班级编号【查询使用,逗号分隔】
/// </summary>
public string QClassIds { get; set; }
}
}
using Edu.Model.Entity.Course;
namespace Edu.Model.ViewModel.Course
{
/// <summary>
/// 教室管理扩展实体类
/// </summary>
public class RB_Class_Room_ViewModel : RB_Class_Room
{
}
}
using Edu.Model.Entity.Course;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Course
{
/// <summary>
/// 课程阶梯价实体类
/// </summary>
public class RB_Class_StepPrice_ViewModel : RB_Class_StepPrice
{
/// <summary>
/// 课程编号【查询使用】
/// </summary>
public string QClassIds { get; set; }
}
}
\ No newline at end of file
using Edu.Model.Entity.Course;
namespace Edu.Model.ViewModel.Course
{
/// <summary>
/// 班级上课时间视图实体类
/// </summary>
public class RB_Class_Time_ViewModel : RB_Class_Time
{
/// <summary>
/// 计划编号【查询使用,逗号分隔】
/// </summary>
public string QClassPlanIds { get; set; }
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
namespace Edu.Model.ViewModel.Course
{
......@@ -62,5 +63,10 @@ namespace Edu.Model.ViewModel.Course
/// 作业数量
/// </summary>
public int JobCount { get; set; }
/// <summary>
/// 班级阶梯价列表
/// </summary>
public List<RB_Class_StepPrice_ViewModel> ClassStepPriceList { get; set; }
}
}
\ No newline at end of file
......@@ -62,8 +62,9 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetClassModule(RB_Class_ViewModel model)
public virtual bool SetClassModule(RB_Class_ViewModel model)
{
bool flag = false;
if (model.ClassId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -72,15 +73,32 @@ namespace Edu.Module.Course
{ nameof(RB_Class_ViewModel.CouseId),model.CouseId},
{ nameof(RB_Class_ViewModel.Teacher_Id),model.Teacher_Id},
{ nameof(RB_Class_ViewModel.Assist_Id),model.Assist_Id},
{ nameof(RB_Class_ViewModel.UpdateBy),model.UpdateBy},
{ nameof(RB_Class_ViewModel.UpdateTime),model.UpdateTime},
{ nameof(RB_Class_ViewModel.ClassPersion),model.ClassPersion},
{ nameof(RB_Class_ViewModel.OpenTime),model.OpenTime},
{ nameof(RB_Class_ViewModel.EndOrderTime),model.EndOrderTime},
{ nameof(RB_Class_ViewModel.OriginalPrice),model.OriginalPrice},
{ nameof(RB_Class_ViewModel.SellPrice),model.SellPrice},
{ nameof(RB_Class_ViewModel.IsStepPrice),model.IsStepPrice},
{ nameof(RB_Class_ViewModel.ClassRoomId),model.ClassRoomId},
{ nameof(RB_Class_ViewModel.IsOpenCommission),model.IsOpenCommission},
{ nameof(RB_Class_ViewModel.CommissionType),model.CommissionType},
{ nameof(RB_Class_ViewModel.CommissionValue),model.CommissionValue},
{ nameof(RB_Class_ViewModel.ClassHours),model.ClassHours},
{ nameof(RB_Class_ViewModel.ClassStyle),model.ClassStyle},
{ nameof(RB_Class_ViewModel.ClassStatus),model.ClassStatus},
};
return classRepository.Update(fileds, new WhereHelper(nameof(RB_Class_ViewModel.ClassId), model.ClassId));
flag= classRepository.Update(fileds, new WhereHelper(nameof(RB_Class_ViewModel.ClassId), model.ClassId));
}
else
{
var newId = classRepository.Insert(model);
model.ClassId = newId;
return newId > 0;
flag =newId > 0;
}
return flag;
}
/// <summary>
......
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Course
{
/// <summary>
/// 班级上课计划仓储层
/// </summary>
public class RB_Class_PlanRepository : BaseRepository<RB_Class_Plan>
{
/// <summary>
/// 获取班级上课计划列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_Plan_ViewModel> GetClassPlanListRepository(RB_Class_Plan_ViewModel query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT *
FROM RB_Class_Plan
WHERE 1=1
");
if (query != null)
{
if (query.ClassId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Class_Plan_ViewModel.ClassId), query.ClassId);
}
if (!string.IsNullOrEmpty(query.QClassIds))
{
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Class_Plan_ViewModel.ClassId), query.QClassIds);
}
}
return Get<RB_Class_Plan_ViewModel>(builder.ToString()).ToList();
}
}
}
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Course
{
/// <summary>
/// 教室管理仓储层
/// </summary>
public class RB_Class_RoomRepository : BaseRepository<RB_Class_Room>
{
/// <summary>
/// 获取教室分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_Room_ViewModel> GetClassRoomPageListRepository(int pageIndex, int pageSize, out long rowsCount, RB_Class_Room_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Class_Room AS A
WHERE 1=1
");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Room_ViewModel.Group_Id), query.Group_Id);
}
if (query.School_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Room_ViewModel.School_Id), query.School_Id);
}
if (!string.IsNullOrEmpty(query.RoomName))
{
builder.AppendFormat(" AND A.{0} LIKE @RoomName ", nameof(RB_Class_Room_ViewModel.RoomName));
parameters.Add("RoomName", "%" + query.RoomName.Trim() + "%");
}
}
return GetPage<RB_Class_Room_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取教室列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_Room_ViewModel> GetClassRoomListRepository(RB_Class_Room_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Class_Room AS A
WHERE 1=1
");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Room_ViewModel.Group_Id), query.Group_Id);
}
if (query.School_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Room_ViewModel.School_Id), query.School_Id);
}
if (!string.IsNullOrEmpty(query.RoomName))
{
builder.AppendFormat(" AND A.{0} LIKE @RoomName ", nameof(RB_Class_Room_ViewModel.RoomName));
parameters.Add("RoomName", "%" + query.RoomName.Trim() + "%");
}
}
return Get<RB_Class_Room_ViewModel>(builder.ToString(), parameters).ToList();
}
}
}
\ No newline at end of file
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Course
{
/// <summary>
/// 课程阶梯价格仓储层
/// </summary>
public class RB_Class_StepPriceRepository : BaseRepository<RB_Class_StepPrice>
{
/// <summary>
/// 获取课程阶梯价格列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_StepPrice_ViewModel> GetClassStepPriceListRepository(RB_Class_StepPrice_ViewModel query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT *
FROM RB_Class_StepPrice
WHERE 1=1
");
if (query != null)
{
if (query.ClassId>0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Class_StepPrice_ViewModel.ClassId), query.ClassId);
}
if (!string.IsNullOrEmpty(query.QClassIds))
{
builder.AppendFormat(" AND {0} IN ({1}) ", nameof(RB_Class_StepPrice_ViewModel.ClassId), query.QClassIds);
}
}
return Get<RB_Class_StepPrice_ViewModel>(builder.ToString()).ToList();
}
}
}
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Course
{
/// <summary>
/// 班级上课时间仓储层
/// </summary>
public class RB_Class_TimeRepository:BaseRepository<RB_Class_Time>
{
/// <summary>
/// 获取班级上课时间列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_Time_ViewModel> GetClassTimeListRepository(RB_Class_Time_ViewModel query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT *
FROM RB_Class_Time
WHERE 1=1
");
if (query != null)
{
if (query.ClassPlanId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Class_Time_ViewModel.ClassPlanId), query.ClassPlanId);
}
if (!string.IsNullOrEmpty(query.QClassPlanIds))
{
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Class_Time_ViewModel.ClassPlanId), query.QClassPlanIds);
}
}
return Get<RB_Class_Time_ViewModel>(builder.ToString()).ToList();
}
}
}
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