Commit e7198f51 authored by 吴春's avatar 吴春

提交代码

parent a9dfc942
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Plugin;
namespace Edu.Common.Enum.Course
{
public enum CourseClassTypeEnum
{
/// <summary>
/// 一对一外教
/// </summary>
[EnumField("一对一外教")]
OneForeignTeacher = 1,
/// <summary>
/// 一对一外教
/// </summary>
[EnumField("一对一外教")]
OneChinaTeacher = 2,
/// <summary>
/// 名师课堂
/// </summary>
[EnumField("名师课堂")]
Famous = 3,
/// <summary>
/// 公开课
/// </summary>
[EnumField("公开课")]
Public = 4,
/// <summary>
/// 语法小班课
/// </summary>
[EnumField("语法小班课")]
Grammar = 5,
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Plugin;
namespace Edu.Common.Enum.Course
{
public enum OrderPayTypeEnum
{
/// <summary>
/// 微信
/// </summary>
[EnumField("微信")]
WeChatPay = 1,
/// <summary>
/// 支付宝
/// </summary>
[EnumField("支付宝")]
Alipay = 2
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Plugin;
namespace Edu.Common.Enum.Course
{
/// <summary>
/// 订单支付类型枚举
/// </summary>
public enum OrderPaymentTypeEnum
{
/// <summary>
/// 在线支付
/// </summary>
[EnumField("在线支付")]
OnlinePayment = 1,
/// <summary>
/// 货到付款
/// </summary>
[EnumField("货到付款")]
OfflinePayment = 2,
/// <summary>
/// 余额支付
/// </summary>
[EnumField("余额支付")]
YEPayment = 3,
/// <summary>
/// 线下支付
/// </summary>
[EnumField("线下支付")]
OfflinePay = 4,
/// <summary>
/// 支付定金
/// </summary>
[EnumField("支付定金")]
PayDeposit = 5,
/// <summary>
/// 储值卡支付
/// </summary>
[EnumField("储值卡支付")]
PayCards = 6
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Plugin;
namespace Edu.Common.Enum.Course
{
public enum StudentNumTypeEnum
{
/// <summary>
/// 一对一
/// </summary>
[EnumField("一对一")]
OneOnOne = 1,
/// <summary>
/// 多人
/// </summary>
[EnumField("多人")]
OneToMany = 2
}
}
......@@ -171,5 +171,32 @@ namespace Edu.Model.Entity.Course
/// 结课日期
/// </summary>
public DateTime EndClassDate { get; set; }
/// <summary>
/// App是否可预约
/// </summary>
public int IsSubscribe { get; set; }
/// <summary>
/// 是否可抵扣
/// </summary>
public int IsDeduction { get; set; }
/// <summary>
/// 点数
/// </summary>
public int Point { get; set; }
/// <summary>
/// 分类类型
/// </summary>
public CourseClassTypeEnum? CourseClassType { get; set; }
/// <summary>
/// 上课人数
/// </summary>
public StudentNumTypeEnum? StudentNumType { get; set; }
}
}
......@@ -11,124 +11,126 @@ namespace Edu.Model.Entity.Course
[DB(ConnectionName = "DefaultConnection")]
public class RB_Course
{
/// <summary>
/// 主键(课程编号)
/// </summary>
public int CourseId { get; set; }
/// <summary>
/// 课程封面图
/// </summary>
public string CoverImg { get; set; }
/// <summary>
/// 课程名称
/// </summary>
public string CourseName { get; set; }
/// <summary>
/// 课程介绍
/// </summary>
public string CourseIntro { get; set; }
/// <summary>
/// 课程分类编号
/// </summary>
public int CateId { 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; }
/// <summary>
/// 学校Id
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 教师编号[逗号分隔]
/// </summary>
public string Teacher_Ids { get; set; }
/// <summary>
/// 是否显示章节编号
/// </summary>
public int IsShowChapterNo { get; set; }
/// <summary>
/// 课程特色
/// </summary>
public string CourseFeature { get; set; }
/// <summary>
/// 原价
/// </summary>
public decimal OriginalPrice { get; set; }
/// <summary>
/// 售价
/// </summary>
public decimal SellPrice { get; set; }
/// <summary>
/// 是否开启阶梯定价(1-开启)
/// </summary>
public int IsOpenStepPrice { get; set; }
/// <summary>
/// 是否可续费课程(1-是)
/// </summary>
public int IsRenew { get; set; }
/// <summary>
/// 续费原价
/// </summary>
public decimal RenewOgPrice { get; set; }
/// <summary>
/// 续费售价
/// </summary>
public decimal RenewSlPrice { get; set; }
/// <summary>
/// 上架端口(1-内部销售,2-学员App,3-网课端)
/// </summary>
public string Saleplat { get; set; }
/// <summary>
/// 是否是K12课程(1-是)
/// </summary>
public int IsKCourse { get; set; }
/// <summary>
/// 课时
/// </summary>
public decimal ClassHours { get; set; }
}
/// <summary>
/// 主键(课程编号)
/// </summary>
public int CourseId { get; set; }
/// <summary>
/// 课程封面图
/// </summary>
public string CoverImg { get; set; }
/// <summary>
/// 课程名称
/// </summary>
public string CourseName { get; set; }
/// <summary>
/// 课程介绍
/// </summary>
public string CourseIntro { get; set; }
/// <summary>
/// 课程分类编号
/// </summary>
public int CateId { 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; }
/// <summary>
/// 学校Id
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 教师编号[逗号分隔]
/// </summary>
public string Teacher_Ids { get; set; }
/// <summary>
/// 是否显示章节编号
/// </summary>
public int IsShowChapterNo { get; set; }
/// <summary>
/// 课程特色
/// </summary>
public string CourseFeature { get; set; }
/// <summary>
/// 原价
/// </summary>
public decimal OriginalPrice { get; set; }
/// <summary>
/// 售价
/// </summary>
public decimal SellPrice { get; set; }
/// <summary>
/// 是否开启阶梯定价(1-开启)
/// </summary>
public int IsOpenStepPrice { get; set; }
/// <summary>
/// 是否可续费课程(1-是)
/// </summary>
public int IsRenew { get; set; }
/// <summary>
/// 续费原价
/// </summary>
public decimal RenewOgPrice { get; set; }
/// <summary>
/// 续费售价
/// </summary>
public decimal RenewSlPrice { get; set; }
/// <summary>
/// 上架端口(1-内部销售,2-学员App,3-网课端)
/// </summary>
public string Saleplat { get; set; }
/// <summary>
/// 是否是K12课程(1-是)
/// </summary>
public int IsKCourse { get; set; }
/// <summary>
/// 课时
/// </summary>
public decimal ClassHours { get; set; }
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Enum;
using VT.FW.DB;
namespace Edu.Model.Entity.Course
{
/// <summary>
/// 点数商品
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Point_Goods
{
public int ID { get; set; }
/// <summary>
/// 排序
/// </summary>
public int? Sort
{
get;
set;
}
/// <summary>
/// 售价
/// </summary>
public decimal? SellingPrice
{
get;
set;
}
/// <summary>
/// 原价
/// </summary>
public decimal? OriginalPrice
{
get;
set;
}
/// <summary>
/// 成本价格
/// </summary>
public decimal? CostPrice
{
get;
set;
}
/// <summary>
/// 点数
/// </summary>
public int PonitNum { get; set; }
/// <summary>
/// 赠送点数 0-不赠送,>0赠送
/// </summary>
public int GivePoint { get; set; }
/// <summary>
/// 名称
/// </summary>
public string GoodsName { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { 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; }
/// <summary>
/// 删除状态(0-正常,1-禁用)
/// </summary>
public DateStateEnum Status { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Enum.Course;
namespace Edu.Model.Entity.Course
{
public class RB_Point_Order
{
public int ID { get; set; }
/// <summary>
/// 订单号
/// </summary>
public string OrderNo
{
get;
set;
}
/// <summary>
/// 商户单号
/// </summary>
public string MerchantsNo
{
get;
set;
}
/// <summary>
/// 充值前点数
/// </summary>
public int OldPonitNum { get; set; }
/// <summary>
/// 充值点数
/// </summary>
public int PonitNum { get; set; }
/// <summary>
/// 赠送点数
/// </summary>
public int GivePoint { get; set; }
/// <summary>
/// 实收金额
/// </summary>
public decimal? Income
{
get;
set;
}
/// <summary>
/// 支付类型 枚举 1微信 2支付宝 3银行卡
/// </summary>
public OrderPayTypeEnum? PayWay
{
get;
set;
}
/// <summary>
/// 支付方式 枚举
/// </summary>
public OrderPaymentTypeEnum? PaymentWay
{
get;
set;
}
/// <summary>
/// 用户id
/// </summary>
public int? StudentId
{
get;
set;
}
/// <summary>
/// 订单状态 1-代付款,2-已付款
/// </summary>
public int OrderStatus
{
get;
set;
}
/// <summary>
/// 支付时间
/// </summary>
public DateTime? PaymentTime { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int? State
{
get;
set;
}
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.Course;
namespace Edu.Model.ViewModel.Course
{
[Serializable]
public class RB_Point_Goods_Extend : RB_Point_Goods
{
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.Course;
namespace Edu.Model.ViewModel.Course
{
public class RB_Point_Order_Extend : RB_Point_Order
{
/// <summary>
/// 用户名称
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 用户头像
/// </summary>
public string UserPhoto { get; set; }
/// <summary>
/// 点数商品id
/// </summary>
public int PointGoodsId { get; set; }
}
}
......@@ -259,6 +259,11 @@ namespace Edu.Module.Course
{ nameof(RB_Class_ViewModel.DefaultTimeJson),model.DefaultTimeJson},
{ nameof(RB_Class_ViewModel.DateJson),model.DateJson},
{ nameof(RB_Class_ViewModel.School_Id),model.School_Id},
{ nameof(RB_Class_ViewModel.IsSubscribe),model.IsSubscribe},
{ nameof(RB_Class_ViewModel.IsDeduction),model.IsDeduction},
{ nameof(RB_Class_ViewModel.Point),model.Point},
{ nameof(RB_Class_ViewModel.CourseClassType),model.CourseClassType},
{ nameof(RB_Class_ViewModel.StudentNumType),model.StudentNumType},
};
flag = classRepository.Update(fileds, new WhereHelper(nameof(RB_Class_ViewModel.ClassId), model.ClassId));
}
......@@ -1128,12 +1133,12 @@ namespace Edu.Module.Course
}
/// <summary>
/// 获取班级上课计划列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_Plan_ViewModel> GetClassPlanListRepository(RB_Class_Plan_ViewModel query)
/// <summary>
/// 获取班级上课计划列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_Plan_ViewModel> GetClassPlanListRepository(RB_Class_Plan_ViewModel query)
{
return class_PlanRepository.GetClassPlanListRepository(query);
}
......@@ -1478,7 +1483,7 @@ namespace Edu.Module.Course
/// <summary>
/// 获取老师计划列表
/// 获取学生上课计划列表
/// </summary>
/// <param name="classId">班级编号</param>
/// <param name="monthStr">月份</param>
......@@ -1511,6 +1516,19 @@ namespace Edu.Module.Course
}
return planList;
}
/// <summary>
/// 获取app约课
/// </summary>
/// <param name="Group_Id"></param>
/// <returns></returns>
public List<RB_Class_ViewModel> GetStuAppointment(int Group_Id)
{
return classRepository.GetStuAppointment(Group_Id);
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.ViewModel.Course;
using Edu.Repository.Course;
using VT.FW.DB;
namespace Edu.Module.Course
{
public class PointModule
{
/// <summary>
/// 点数产品仓储
/// </summary>
private readonly RB_Point_GoodsRepository pointGoodsRepository = new RB_Point_GoodsRepository();
#region 点数商品
/// <summary>
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_Point_Goods_Extend> GetPointGoodsList(RB_Point_Goods_Extend where)
{
return pointGoodsRepository.GetPointGoodsList(where);
}
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_Point_Goods_Extend> GetPointGoodsPageList(int pageIndex, int pageSize, out long rowsCount, RB_Point_Goods_Extend where)
{
return pointGoodsRepository.GetPointGoodsPageList(pageIndex, pageSize, out rowsCount, where);
}
/// <summary>
/// 新增/修改点数商品
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetPointGoods(RB_Point_Goods_Extend model)
{
if (model.ID == 0)
{
return pointGoodsRepository.Insert(model) > 0;
}
else
{
IDictionary<string, object> fileds = new Dictionary<string, object>
{
{ nameof(RB_Point_Goods_Extend.UpdateTime), model.UpdateTime },
{ nameof(RB_Point_Goods_Extend.UpdateBy), model.UpdateBy },
{ nameof(RB_Point_Goods_Extend.GoodsName), model.GoodsName },
{ nameof(RB_Point_Goods_Extend.GivePoint), model.GivePoint },
{ nameof(RB_Point_Goods_Extend.OriginalPrice), model.OriginalPrice },
{ nameof(RB_Point_Goods_Extend.SellingPrice), model.SellingPrice },
{ nameof(RB_Point_Goods_Extend.Sort), model.Sort },
{ nameof(RB_Point_Goods_Extend.CostPrice), model.CostPrice },
{ nameof(RB_Point_Goods_Extend.PonitNum), model.PonitNum }
};
IList<WhereHelper> auditrecordWhereHelpers = new List<WhereHelper>
{
new WhereHelper()
{
FiledName = nameof(RB_Point_Goods_Extend.ID),
FiledValue = model.ID,
OperatorEnum = OperatorEnum.Equal
},
new WhereHelper()
{
FiledName = nameof(RB_Point_Goods_Extend.Group_Id),
FiledValue = model.Group_Id,
OperatorEnum = OperatorEnum.Equal
}
};
return pointGoodsRepository.Update(fileds, auditrecordWhereHelpers);
}
}
/// <summary>
/// 删除点数商品
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool DeletePointGoods(RB_Point_Goods_Extend model)
{
IDictionary<string, object> fileds = new Dictionary<string, object>
{
{ nameof(RB_Point_Goods_Extend.UpdateTime), model.UpdateTime },
{ nameof(RB_Point_Goods_Extend.Status),1 }
};
IList<WhereHelper> auditrecordWhereHelpers = new List<WhereHelper>
{
new WhereHelper()
{
FiledName = nameof(RB_Point_Goods_Extend.ID),
FiledValue = model.ID,
OperatorEnum = OperatorEnum.Equal
},
new WhereHelper()
{
FiledName = nameof(RB_Point_Goods_Extend.Group_Id),
FiledValue = model.Group_Id,
OperatorEnum = OperatorEnum.Equal
}
};
return pointGoodsRepository.Update(fileds, auditrecordWhereHelpers);
}
#endregion
}
}
......@@ -39,7 +39,7 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.Group_Id), query.Group_Id);
}
if (query.ClassId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.ClassId), query.ClassId);
......@@ -313,7 +313,7 @@ WHERE 1=1
//销售平台
if (!string.IsNullOrEmpty(query.Saleplat))
{
var salePlatList= Common.ConvertHelper.StringToList(query.Saleplat);
var salePlatList = Common.ConvertHelper.StringToList(query.Saleplat);
string str = "";
if (salePlatList != null && salePlatList.Count > 0)
{
......@@ -321,7 +321,7 @@ WHERE 1=1
{
if (i == 0)
{
str += string.Format(" FIND_IN_SET('{0}', B.Saleplat)>0 ",salePlatList[i]);
str += string.Format(" FIND_IN_SET('{0}', B.Saleplat)>0 ", salePlatList[i]);
}
else
{
......@@ -368,7 +368,8 @@ FROM (
/// </summary>
/// <param name="GroupId"></param>
/// <returns></returns>
public List<RB_Class_ViewModel> GetTeachingPerfClassList(int GroupId) {
public List<RB_Class_ViewModel> GetTeachingPerfClassList(int GroupId)
{
string sql = $@"
SELECT c.*
FROM rb_class c LEFT JOIN rb_teaching_perf t on (c.ClassId = t.ClassId AND t.`Status`=0)
......@@ -389,7 +390,7 @@ SELECT Teacher_Id,COUNT(1) AS ClassCount
FROM rb_class
WHERE status=0 AND ClassStatus<>4 AND Teacher_Id IN({0})
GROUP BY Teacher_Id
",teacherIds);
", teacherIds);
return Get<TeacherClassStatic_ViewModel>(builder.ToString()).ToList();
}
......@@ -414,5 +415,26 @@ WHERE c.`Status`=0 and sog.`Status`=0 ");
builder.AppendFormat(" AND c.{0}={1} ", nameof(RB_Class_ViewModel.Group_Id), Group_Id);
return Get<RB_Class_ViewModel>(builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取app约课
/// </summary>
/// <param name="Group_Id"></param>
/// <returns></returns>
public List<RB_Class_ViewModel> GetStuAppointment(int Group_Id)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"SELECT a.CourseClassType,a.StudentNumType,SUM(b.OrderNum) as OrderStudentCount from rb_class as a LEFT JOIN
(SELECT ClassId,COUNT(OrderId) as OrderNum from rb_order where OrderState=1 GROUP BY ClassId ) as b on a.ClassId=b.ClassId
where a.`Status`=0 and a.IsSubscribe=1 and ClassStatus in(1,2)");
builder.AppendFormat(" AND a.Group_Id={0} ", Group_Id);
builder.AppendFormat(" GROUP BY a.CourseClassType,a.StudentNumType ");
return Get<RB_Class_ViewModel>(builder.ToString(), parameters).ToList();
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
namespace Edu.Repository.Course
{
/// <summary>
/// 点数商品
/// </summary>
public class RB_Point_GoodsRepository:BaseRepository<RB_Point_Goods>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_Point_Goods); } }
/// <summary>
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_Point_Goods_Extend> GetPointGoodsList(RB_Point_Goods_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from RB_Point_Goods where state=0");
if (where != null)
{
if (where.Group_Id > 0)
{
sb.AppendFormat(" and Group_Id={0}", where.Group_Id);
}
if (where.School_Id > 0)
{
sb.AppendFormat(" and School_Id={0}", where.School_Id);
}
if (where.ID > 0)
{
sb.AppendFormat(" and ID={0}", where.ID);
}
if (!string.IsNullOrWhiteSpace(where.GoodsName))
{
sb.AppendFormat(" and GoodsName like'%{0}%'", where.GoodsName);
}
}
return Get<RB_Point_Goods_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_Goods_Extend> GetPointGoodsPageList(int pageIndex, int pageSize, out long rowsCount, RB_Point_Goods_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from RB_Point_Goods where state=0");
if (where != null)
{
if (where.Group_Id > 0)
{
sb.AppendFormat(" and Group_Id={0}", where.Group_Id);
}
if (where.School_Id > 0)
{
sb.AppendFormat(" and School_Id={0}", where.School_Id);
}
if (where.ID > 0)
{
sb.AppendFormat(" and ID={0}", where.ID);
}
if (!string.IsNullOrWhiteSpace(where.GoodsName))
{
sb.AppendFormat(" and GoodsName like'%{0}%'", where.GoodsName);
}
}
return GetPage<RB_Point_Goods_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
namespace Edu.Repository.Course
{
public class RB_Point_OrderRepository:BaseRepository<RB_Point_Order>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_Point_Order); } }
/// <summary>
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_Point_Order_Extend> GetPointOrderList(RB_Point_Order_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from RB_Point_Order where state=0");
if (where != null)
{
if (where.Group_Id > 0)
{
sb.AppendFormat(" and Group_Id={0}", where.Group_Id);
}
if (where.ID > 0)
{
sb.AppendFormat(" and ID={0}", where.ID);
}
}
return Get<RB_Point_Order_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_Order_Extend> GetPointOrderPageList(int pageIndex, int pageSize, out long rowsCount, RB_Point_Order_Extend where)
{
StringBuilder sb = new StringBuilder();
// sb.Append($@"SELECT a.*,b.`Name` as UserName,b.Photo as UserPhoto from RB_Point_order as a LEFT JOIN rb_member_user as b on a.UserId=b.Id where a.state=0 ");
if (where != null)
{
if (where.Group_Id > 0)
{
sb.AppendFormat(" and a.Group_Id={0}", where.Group_Id);
}
if (where.ID > 0)
{
sb.AppendFormat(" and a.ID={0}", where.ID);
}
if (where.OrderStatus > 0)
{
sb.AppendFormat(" and a.OrderStatus={0}", where.OrderStatus);
}
if (where.StudentId > 0)
{
sb.AppendFormat(" and a.StudentId={0}", where.StudentId);
}
if (!string.IsNullOrEmpty(where.OrderNo))
{
sb.AppendFormat(" and a.OrderNo like '%{0}%'", where.OrderNo);
}
}
sb.Append(" order by a.ID desc");
return GetPage<RB_Point_Order_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList();
}
}
}
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Edu.Common.API;
using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.Entity.App;
using Edu.Model.ViewModel.User;
......@@ -143,12 +144,12 @@ namespace Edu.WebApi.Controllers.APP
var query = new Model.ViewModel.Course.RB_Class_Plan_ViewModel()
{
Group_Id = base.AppUserInfo.Group_Id,
StuId = base.AppUserInfo.Id,
StartTime = base.ParmJObj.GetStringValue("StartTime"),
EndTime = base.ParmJObj.GetStringValue("EndTime"),
};
var data = classModule.GetStudentPlanModule(query);
List<object> result = new List<object>();
......@@ -179,14 +180,14 @@ namespace Edu.WebApi.Controllers.APP
itemTime.EndTime,
item.TeacherName,
item.UserIcon,
// GuestStr = (item.GuestList != null && item.GuestList.Any()) ? string.Join(",", item.GuestList.Select(x => x.GuestName)) : ""
// GuestStr = (item.GuestList != null && item.GuestList.Any()) ? string.Join(",", item.GuestList.Select(x => x.GuestName)) : ""
});
}
if (plan.Where(x => x.LessonPlanNum > 0).Count() < plan.Count() && plan.Where(x => x.LessonPlanNum > 0).Count() > 0)
{
IsLessonStatus = 1;
}
else
{
IsLessonStatus = 0;
......@@ -212,6 +213,74 @@ namespace Edu.WebApi.Controllers.APP
}
return ApiResult.Success(data: result);
}
#endregion
#region 约课
/// <summary>
/// app约课
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAppointment()
{
var list = classModule.GetStuAppointment(base.AppUserInfo.Group_Id);
var listStudentNumType = Common.Plugin.EnumHelper.EnumToList(typeof(StudentNumTypeEnum));
var listCourseClassType = Common.Plugin.EnumHelper.EnumToList(typeof(CourseClassTypeEnum));
List<object> result = new List<object>();
foreach (var item in listStudentNumType)
{
List<object> courseClassTypeResult = new List<object>();
foreach (var courseClassTypeItem in listCourseClassType)
{
courseClassTypeResult.Add(new
{
Name = courseClassTypeItem.Name,
courseClassTypeItem.Id,
OrderStudentCount = list.Where(x => (int)x.StudentNumType == item.Id && (int)x.CourseClassType == courseClassTypeItem.Id).FirstOrDefault()?.OrderStudentCount ?? 0
});
}
result.Add(new
{
Name = item.Name,
item.Id,
ChildrenList = courseClassTypeResult
});
}
return ApiResult.Success("", data: result);
}
/// <summary>
/// 获取课程班级课程类型
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCourseClassTypeEnumList()
{
var list = Common.Plugin.EnumHelper.EnumToList(typeof(CourseClassTypeEnum));
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取学生人数枚举类型
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentNumTypeEnumList()
{
var list = Common.Plugin.EnumHelper.EnumToList(typeof(StudentNumTypeEnum));
return ApiResult.Success(data: list);
}
#endregion
}
}
......@@ -90,7 +90,7 @@ namespace Edu.WebApi.Controllers.Course
int IsAddDefault = base.ParmJObj.GetInt("IsAddDefault");
var query = new RB_Class_ViewModel()
{
CouseId=base.ParmJObj.GetInt("CourseId"),
CouseId = base.ParmJObj.GetInt("CourseId"),
};
query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id;
......@@ -99,7 +99,7 @@ namespace Edu.WebApi.Controllers.Course
{
list = new List<RB_Class_ViewModel>();
}
if(IsAddDefault==1)
if (IsAddDefault == 1)
{
list.Insert(0, new RB_Class_ViewModel()
{
......@@ -113,7 +113,7 @@ namespace Edu.WebApi.Controllers.Course
qitem.ClassName,
qitem.ClassHours,
OpenTime = Common.ConvertHelper.FormatDate(qitem.OpenTime)
})); ;
}));
}
/// <summary>
......@@ -153,6 +153,11 @@ namespace Edu.WebApi.Controllers.Course
CompleteProgress = 0,
School_Id = base.ParmJObj.GetInt("School_Id"),
ClassType = base.ParmJObj.GetInt("ClassType"),
IsSubscribe = base.ParmJObj.GetInt("IsSubscribe"),
IsDeduction = base.ParmJObj.GetInt("IsDeduction"),
Point = base.ParmJObj.GetInt("Point"),
CourseClassType = (CourseClassTypeEnum)base.ParmJObj.GetInt("CourseClassType"),
StudentNumType = (StudentNumTypeEnum)base.ParmJObj.GetInt("StudentNumType"),
};
try
{
......@@ -346,6 +351,30 @@ namespace Edu.WebApi.Controllers.Course
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 获取课程班级课程类型
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCourseClassTypeEnumList()
{
var list = Common.Plugin.EnumHelper.EnumToList(typeof(CourseClassTypeEnum));
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取学生人数枚举类型
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentNumTypeEnumList()
{
var list = Common.Plugin.EnumHelper.EnumToList(typeof(StudentNumTypeEnum));
return ApiResult.Success(data: list);
}
#endregion
#region 上课计划
......@@ -635,10 +664,10 @@ namespace Edu.WebApi.Controllers.Course
//判断当天是否有已签到数据
var checkLogList = classModule.GetClassCheckList(new RB_Class_Check_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = list.FirstOrDefault().ClassId, StartDate = list.FirstOrDefault().ClassDate.ToString("yyyy-MM-dd HH:mm:ss"), EndDate = list.FirstOrDefault().ClassDate.ToString("yyyy-MM-dd HH:mm:ss") });
foreach (var item in list)
{
var signModel= checkLogList?.Where(qitem => qitem.ClassDate == item.ClassDate && qitem.ClassId == item.ClassId && qitem.OrderGuestId == item.OrderGuestId)?.FirstOrDefault();
var signModel = checkLogList?.Where(qitem => qitem.ClassDate == item.ClassDate && qitem.ClassId == item.ClassId && qitem.OrderGuestId == item.OrderGuestId)?.FirstOrDefault();
if (signModel != null && signModel.ClassCheckId > 0)
{
item.ClassCheckId = signModel.ClassCheckId;
......
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