Commit b2889820 authored by liudong1993's avatar liudong1993

点数订单

parent 65cc279b
......@@ -14,21 +14,21 @@ namespace Mall.Common.Enum.Point
/// 待付款
/// </summary>
[EnumField("待付款")]
NoPaid = 0,
NoPaid = 1,
/// <summary>
/// 待确认
/// </summary>
[EnumField("待确认")]
Paid = 1,
Paid = 2,
/// <summary>
/// 待上课
/// </summary>
[EnumField("待上课")]
NoClass = 2,
NoClass = 3,
/// <summary>
/// 完成
/// </summary>
[EnumField("完成")]
Complete = 3
Complete = 4
}
}
......@@ -31,5 +31,14 @@ namespace Mall.Model.Extend.Point
/// 用户名称
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 开始时间
/// </summary>
public string StartTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public string EndTime { get; set; }
}
}
......@@ -591,9 +591,9 @@ namespace Mall.Module.Education
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public RB_Point_TeacherCourseOrder_Extend GetPointOrderInfo(int orderId, int MallBaseId)
public RB_Point_TeacherCourseOrder_Extend GetPointOrderInfo(int orderId, int TenantId)
{
var model = pointTeacherCourseOrderRepository.GetPointOrderInfo(new RB_Point_TeacherCourseOrder_Extend() { ID = orderId, MallBaseId = MallBaseId });
var model = pointTeacherCourseOrderRepository.GetPointOrderInfo(new RB_Point_TeacherCourseOrder_Extend() { ID = orderId, TenantId = TenantId });
return model;
}
......
......@@ -76,7 +76,7 @@ where a.state=0 ");
{
sb.AppendFormat(" and a.ID={0}", where.ID);
}
if (where.OrderStaus >= 0)
if (where.OrderStaus > 0)
{
sb.AppendFormat(" and a.OrderStaus={0}", where.OrderStaus);
}
......@@ -92,6 +92,14 @@ where a.state=0 ");
{
sb.AppendFormat(" and a.UserId={0}", where.UserId);
}
if (!string.IsNullOrEmpty(where.StartTime))
{
sb.AppendFormat(" and a.CreateDate >='{0}'", where.StartTime);
}
if (!string.IsNullOrEmpty(where.EndTime))
{
sb.AppendFormat(" and a.CreateDate <='{0}'", where.EndTime + " 23:59:59");
}
}
sb.AppendFormat(" order by a.ID desc");
return GetPage<RB_Point_TeacherCourseOrder_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList();
......@@ -126,7 +134,7 @@ where a.state=0 ");
{
sb.AppendFormat(" and a.ID={0}", where.ID);
}
if (where.OrderStaus >= 0)
if (where.OrderStaus > 0)
{
sb.AppendFormat(" and a.OrderStaus={0}", where.OrderStaus);
}
......
......@@ -62,5 +62,98 @@ namespace Mall.WebApi.Controllers.Education
return ApiResult.Success("", pagelist);
}
#endregion
#region 订单列表
/// <summary>
/// 获取订单列表分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetPointOrderPageList()
{
var parms = RequestParm;
var userInfo = AppletUserInfo;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
RB_Point_TeacherCourseOrder_Extend demodel = JsonConvert.DeserializeObject<RB_Point_TeacherCourseOrder_Extend>(RequestParm.msg.ToString());
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.UserId = userInfo.UserId;//只能查询自己的订单列表
var list = pointModule.GetPointOrderPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.ID,
x.CourseClassId,
CourseClassTypeName = x.CourseClassType.GetEnumName(),
x.CourseId,
x.CourseName,
x.TeacherId,
x.TeacherName,
x.TeacherLogo,
StudyDate = x.StudyDate.ToString("MM-dd HH:mm"),
x.StudyDuration,
x.TotalStudyDuration,
DurationUnit = x.DurationUnit.GetEnumName(),
x.OrderStaus,
OrderStatusName = x.OrderStaus.GetEnumName(),
x.IsSendRoom,
x.RoomInfo,
x.TotalPointNum,
x.ActualPointNum,
x.BasePointNum,
x.UserId,
x.UserName,
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 获取订单详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetPointOrderInfo()
{
var userInfo = AppletUserInfo;
var parms = JObject.Parse(RequestParm.msg.ToString());
int OrderId = parms.GetInt("OrderId", 0);
if (OrderId <= 0)
{
return ApiResult.ParamIsNull("请传递订单id");
}
var model = pointModule.GetPointOrderInfo(OrderId, userInfo.TenantId);
if (model == null) { return ApiResult.Failed("订单不存在"); }
if (model.UserId != userInfo.UserId) { return ApiResult.Failed("不是你的订单,无法查看"); }
return ApiResult.Success("", new
{
model.ID,
model.CourseClassId,
CourseClassTypeName = model.CourseClassType.GetEnumName(),
model.CourseId,
model.CourseName,
model.TeacherId,
model.TeacherName,
model.TeacherLogo,
StudyDate = model.StudyDate.ToString("MM-dd HH:mm"),
model.StudyDuration,
model.TotalStudyDuration,
DurationUnit = model.DurationUnit.GetEnumName(),
model.OrderStaus,
OrderStatusName = model.OrderStaus.GetEnumName(),
model.IsSendRoom,
model.RoomInfo,
model.TotalPointNum,
model.ActualPointNum,
model.BasePointNum,
model.UserId,
model.UserName,
CreateDate = model.CreateDate.HasValue ? model.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
});
}
#endregion
}
}
......@@ -249,7 +249,7 @@ namespace Mall.WebApi.Controllers.Education
return ApiResult.ParamIsNull("请传递订单id");
}
var model = pointModule.GetPointOrderInfo(OrderId, userInfo.MallBaseId);
var model = pointModule.GetPointOrderInfo(OrderId, userInfo.TenantId);
if (model == null) { return ApiResult.Failed("订单不存在");}
return ApiResult.Success("", new
{
......
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