Commit e43cdc91 authored by 吴春's avatar 吴春

提交代码

parent ef46e2f1
......@@ -64,6 +64,12 @@ namespace Mall.Model.Entity.Point
/// </summary>
public decimal StudyDuration { get; set; }
/// <summary>
/// 时长单位
/// </summary>
public DurationUnitEnum DurationUnit { get; set; }
/// <summary>
/// 删除状态
/// </summary>
......
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Common.Enum.Point;
using VT.FW.DB;
namespace Mall.Model.Entity.Point
{
/// <summary>
/// 老师课程
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Point_TeacherCourseOrder
{
public int ID { get; set; }
/// <summary>
/// 课程分类id
/// </summary>
public int CourseClassId { get; set; }
/// <summary>
/// 课程Id
/// </summary>
public string CourseId { get; set; }
/// <summary>
/// 老师id
/// </summary>
public int TeacherId { get; set; }
public int UserId { get; set; }
/// <summary>
/// 学习时间
/// </summary>
public DateTime StudyDate { get; set; }
/// <summary>
/// 时长
/// </summary>
public decimal StudyDuration { get; set; }
/// <summary>
/// 时长
/// </summary>
public decimal TotalStudyDuration { get; set; }
/// <summary>
/// 时长单位
/// </summary>
public DurationUnitEnum DurationUnit { get; set; }
/// <summary>
/// 订单状态 0-代付款,1-已支付,2-已确认,3已完成
/// </summary>
public int OrderStaus { get; set; }
/// <summary>
/// 是否推送放假信息0-否,1-是
/// </summary>
public int IsSendRoom { get; set; }
/// <summary>
/// 房间信息
/// </summary>
public string RoomInfo { get; set; }
/// <summary>
/// 总点数
/// </summary>
public int TotalPointNum { get; set; }
/// <summary>
/// 实际总点数
/// </summary>
public int ActualPointNum { get; set; }
/// <summary>
/// 基础点数
/// </summary>
public int BasePointNum { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int? State
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// UpdateDate
/// </summary>
public DateTime? UpdateDate
{
get;
set;
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Point;
namespace Mall.Model.Extend.Point
{
public class RB_Point_TeacherCourseOrder_Extend: RB_Point_TeacherCourseOrder
{
}
}
......@@ -20,22 +20,35 @@ namespace Mall.Model.Extend.Point
/// </summary>
public StudentNumTypeEnum StudentNumType { get; set; }
/// <summary>
/// 是否为公开课0-否,1-是
/// 分类名称
/// </summary>
public int IsPublic { get; set; }
public string ClassName { get; set; }
/// <summary>
/// 是否免费0-否,1-是
/// 学生人数名称
/// </summary>
public int IsFree { get; set; }
public string StudentNumTypeName { get; set; }
/// <summary>
/// 时长单位
/// 时长名称
/// </summary>
public DurationUnitEnum DurationUnit { get; set; }
public string DurationUnitName { get; set; }
/// <summary>
/// 是否为公开课0-否,1-是
/// </summary>
public int IsPublic { get; set; }
/// <summary>
/// 是否免费0-否,1-是
/// </summary>
public int IsFree { get; set; }
......
......@@ -350,7 +350,7 @@ namespace Mall.Module.Education
{ nameof(RB_Point_CourseClass_Extend.Sort), model.Sort },
{ nameof(RB_Point_CourseClass_Extend.PointNum), model.PointNum },
{ nameof(RB_Point_CourseClass_Extend.Duration), model.Duration },
{ nameof(RB_Point_CourseClass_Extend.DurationUnit), (int)model.Duration }
{ nameof(RB_Point_CourseClass_Extend.DurationUnit), model.DurationUnit }
};
IList<WhereHelper> auditrecordWhereHelpers = new List<WhereHelper>
{
......@@ -441,6 +441,97 @@ namespace Mall.Module.Education
{
return pointTeacherCourseRepository.GetTeacherCoursePageList(pageIndex, pageSize, out rowsCount, where);
}
/// <summary>
/// 新增/修改老师排课
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetTeacherCourse(RB_Point_TeacherCourse_Extend model)
{
if (model.ID == 0)
{
return pointTeacherCourseRepository.Insert(model) > 0;
}
else
{
IDictionary<string, object> fileds = new Dictionary<string, object>
{
{ nameof(RB_Point_TeacherCourse_Extend.UpdateDate), model.UpdateDate },
{ nameof(RB_Point_TeacherCourse_Extend.CourseClassId), model.CourseClassId },
{ nameof(RB_Point_TeacherCourse_Extend.TeacherId), model.TeacherId },
{ nameof(RB_Point_TeacherCourse_Extend.StudyDate), model.StudyDate },
{ nameof(RB_Point_TeacherCourse_Extend.StudyStartDate), model.StudyStartDate },
{ nameof(RB_Point_TeacherCourse_Extend.StudyEndDate), model.StudyEndDate },
{ nameof(RB_Point_TeacherCourse_Extend.PointNum), model.PointNum },
{ nameof(RB_Point_TeacherCourse_Extend.CourseName), model.CourseName },
{ nameof(RB_Point_TeacherCourse_Extend.MinDuration), model.MinDuration },
{ nameof(RB_Point_TeacherCourse_Extend.StudyDuration), model.StudyDuration }
};
IList<WhereHelper> auditrecordWhereHelpers = new List<WhereHelper>
{
new WhereHelper()
{
FiledName = nameof(RB_Point_TeacherCourse_Extend.ID),
FiledValue = model.ID,
OperatorEnum = OperatorEnum.Equal
},
new WhereHelper()
{
FiledName = nameof(RB_Point_TeacherCourse_Extend.TenantId),
FiledValue = model.TenantId,
OperatorEnum = OperatorEnum.Equal
},
new WhereHelper()
{
FiledName = nameof(RB_Point_TeacherCourse_Extend.MallBaseId),
FiledValue = model.MallBaseId,
OperatorEnum = OperatorEnum.Equal
}
};
return pointTeacherCourseRepository.Update(fileds, auditrecordWhereHelpers);
}
}
/// <summary>
/// 删除老师排课
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool DeleteTeacherCourse(RB_Point_TeacherCourse_Extend model)
{
IDictionary<string, object> fileds = new Dictionary<string, object>
{
{ nameof(RB_Point_TeacherCourse_Extend.UpdateDate), model.UpdateDate },
{ nameof(RB_Point_TeacherCourse_Extend.State),1 }
};
IList<WhereHelper> auditrecordWhereHelpers = new List<WhereHelper>
{
new WhereHelper()
{
FiledName = nameof(RB_Point_TeacherCourse_Extend.ID),
FiledValue = model.ID,
OperatorEnum = OperatorEnum.Equal
},
new WhereHelper()
{
FiledName = nameof(RB_Point_TeacherCourse_Extend.TenantId),
FiledValue = model.TenantId,
OperatorEnum = OperatorEnum.Equal
},
new WhereHelper()
{
FiledName = nameof(RB_Point_TeacherCourse_Extend.MallBaseId),
FiledValue = model.MallBaseId,
OperatorEnum = OperatorEnum.Equal
}
};
return pointTeacherCourseRepository.Update(fileds, auditrecordWhereHelpers);
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mall.Model.Entity.Point;
using Mall.Model.Extend.Point;
namespace Mall.Repository.Point
{
public class RB_Point_TeacherCourseOrderRepository:BaseRepository<RB_Point_TeacherCourseOrder>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_Point_TeacherCourseOrder); } }
/// <summary>
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_Point_TeacherCourseOrder_Extend> GetPointOrderList(RB_Point_TeacherCourseOrder_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from RB_Point_TeacherCourseOrder where state=0");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and MallBaseId={0}", where.MallBaseId);
}
if (where.ID > 0)
{
sb.AppendFormat(" and ID={0}", where.ID);
}
}
return Get<RB_Point_TeacherCourseOrder_Extend>(sb.ToString()).ToList();
}
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_Point_TeacherCourseOrder_Extend> GetPointOrderPageList(int pageIndex, int pageSize, out long rowsCount, RB_Point_TeacherCourseOrder_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT a.*,b.`Name` as UserName from RB_Point_TeacherCourseOrder as a LEFT JOIN rb_member_user as b on a.UserId=b.Id where a.state=0 ");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and a.TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and a.MallBaseId={0}", where.MallBaseId);
}
if (where.ID > 0)
{
sb.AppendFormat(" and a.ID={0}", where.ID);
}
if (where.OrderStaus > 0)
{
sb.AppendFormat(" and a.OrderStaus={0}", where.OrderStaus);
}
}
return GetPage<RB_Point_TeacherCourseOrder_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList();
}
}
}
......@@ -23,7 +23,7 @@ namespace Mall.Repository.Point
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT tc.*,et.`Name` as TeacherName,et.TeacherLogo,cc.CourseClassType,
cc.StudentNumType,cc.IsPublic,cc.IsFree,cc.DurationUnit
cc.StudentNumType,cc.IsPublic,cc.IsFree
from RB_Point_TeacherCourse as tc
LEFT JOIN rb_point_courseclass as cc on tc.CourseClassId=cc.ID
LEFT JOIN rb_education_teacher as et on tc.TeacherId=et.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