Commit e3aa76a3 authored by 黄奎's avatar 黄奎

页面修改

parent 502dfe7e
using Edu.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Common.Enum.Course
{
/// <summary>
/// 销售端口
/// </summary>
public enum SaleplatEnum
{
/// <summary>
/// 内部销售
/// </summary>
[EnumField("内部销售")]
InternalSales = 1,
/// <summary>
/// 学员App
/// </summary>
[EnumField("学员App")]
StudentApp= 2,
/// <summary>
/// 网课端
/// </summary>
[EnumField("网课端")]
OnlineClass = 3,
}
}
...@@ -3,31 +3,41 @@ using VT.FW.DB; ...@@ -3,31 +3,41 @@ using VT.FW.DB;
namespace Edu.Model.Entity.Course namespace Edu.Model.Entity.Course
{ {
/// <summary> /// <summary>
/// 课程阶梯价格实体 /// 课程阶梯价格实体
/// </summary> /// </summary>
[Serializable] [Serializable]
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class RB_Course_StepPrice public class RB_Course_StepPrice
{ {
/// <summary> /// <summary>
/// 主键 /// 主键
/// </summary> /// </summary>
public int CoursePriceId { get; set; } public int CoursePriceId { get; set; }
/// <summary> /// <summary>
/// 课程编号 /// 课程编号
/// </summary> /// </summary>
public int CourseId { get; set; } public int CourseId { get; set; }
/// <summary> /// <summary>
/// 人数 /// 人数
/// </summary> /// </summary>
public int PersionNum { get; set; } public int PersionNum { get; set; }
/// <summary> /// <summary>
/// 售价 /// 售价
/// </summary> /// </summary>
public decimal SellPrice { get; set; } public decimal PersionPrice { get; set; }
}
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
}
} }
...@@ -23,7 +23,7 @@ namespace Edu.Model.ViewModel.Course ...@@ -23,7 +23,7 @@ namespace Edu.Model.ViewModel.Course
/// <summary> /// <summary>
/// 创建时间字符串 /// 创建时间字符串
/// </summary> /// </summary>
public string CreateTimeStr { get { return this.CreateTime.FormatTime();} } public string CreateTimeStr { get { return this.CreateTime.FormatTime(); } }
/// <summary> /// <summary>
/// 更新时间 /// 更新时间
...@@ -44,5 +44,35 @@ namespace Edu.Model.ViewModel.Course ...@@ -44,5 +44,35 @@ namespace Edu.Model.ViewModel.Course
/// 课程阶梯价格列表 /// 课程阶梯价格列表
/// </summary> /// </summary>
public List<RB_Course_StepPrice_ViewModel> StepPriceList { get; set; } public List<RB_Course_StepPrice_ViewModel> StepPriceList { get; set; }
/// <summary>
/// 教师团队
/// </summary>
public List<int> TeacherIdList
{
get
{
if (!string.IsNullOrEmpty(this.Teacher_Ids))
{
return Common.ConvertHelper.StringToList(this.Teacher_Ids);
}
return new List<int>();
}
}
/// <summary>
/// 销售平台
/// </summary>
public List<int> SalePlatList
{
get
{
if (!string.IsNullOrEmpty(this.Saleplat))
{
return Common.ConvertHelper.StringToList(this.Saleplat);
}
return new List<int>();
}
}
} }
} }
\ No newline at end of file
...@@ -43,6 +43,7 @@ namespace Edu.Model.ViewModel.Question ...@@ -43,6 +43,7 @@ namespace Edu.Model.ViewModel.Question
/// </summary> /// </summary>
public string QQuestionTypeStr { get; set; } public string QQuestionTypeStr { get; set; }
/// <summary> /// <summary>
/// 知识点【查询使用,多选】 /// 知识点【查询使用,多选】
/// </summary> /// </summary>
......
...@@ -161,19 +161,64 @@ namespace Edu.Module.Course ...@@ -161,19 +161,64 @@ namespace Edu.Module.Course
model.CourseId = newId; model.CourseId = newId;
flag = newId > 0; flag = newId > 0;
} }
//没有设置阶梯价格,删除原来的价格
course_StepPriceRepository.DeleteStepPriceRepository(model.CourseId); #region 阶梯报价
if (model.IsOpenStepPrice == 1) //未开启阶梯价格
if (model.IsOpenStepPrice == 0)
{
course_StepPriceRepository.DeleteStepPriceRepository(model.CourseId);
}
else//开启阶梯价格
{ {
if (model.StepPriceList != null && model.StepPriceList.Count > 0) var oldStepPriceList = course_StepPriceRepository.GetCourseStepPriceListRepository( new RB_Course_StepPrice_ViewModel() { CourseId=model.CourseId});
//以前没有阶梯报价信息【直接新增】
if (oldStepPriceList == null || (oldStepPriceList != null && oldStepPriceList.Count == 0))
{ {
foreach (var item in model.StepPriceList) if (model.StepPriceList != null && model.StepPriceList.Count > 0)
{
foreach (var item in model.StepPriceList)
{
item.CoursePriceId = 0;
item.CourseId = model.CourseId;
item.Group_Id = model.Group_Id;
item.School_Id = model.School_Id;
course_StepPriceRepository.Insert(item);
}
}
}
else//以前有阶梯报价
{
//现在没有阶梯报价了【直接删除以前的阶梯报价】
if (model.StepPriceList == null || (model.StepPriceList != null && model.StepPriceList.Count == 0))
{
course_StepPriceRepository.DeleteStepPriceRepository(model.CourseId);
}
//找出差异的数据
var deleteList = oldStepPriceList.Where(qitem => !model.StepPriceList.Any(oldItem => qitem.CoursePriceId == oldItem.CoursePriceId)).ToList();
foreach (var dItem in deleteList)
{
if (dItem.CoursePriceId > 0)
{
course_StepPriceRepository.Delete(dItem.CoursePriceId);
}
}
foreach (var priceItem in model.StepPriceList)
{ {
item.CourseId = model.CourseId; priceItem.CourseId = model.CourseId;
course_StepPriceRepository.Insert(item); priceItem.Group_Id = model.Group_Id;
priceItem.School_Id = model.School_Id;
if (priceItem.CoursePriceId == 0)
{
course_StepPriceRepository.Insert(priceItem);
}
else
{
course_StepPriceRepository.Update(priceItem);
}
} }
} }
} }
#endregion
return flag; return flag;
} }
......
using System; using System;
using Edu.Cache.User; using Edu.Cache.User;
using Edu.Common.API; using Edu.Common.API;
using Edu.Common.Enum.Course;
using Edu.Common.Plugin; using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course; using Edu.Model.ViewModel.Course;
using Edu.Module.Course; using Edu.Module.Course;
...@@ -216,6 +217,17 @@ namespace Edu.WebApi.Controllers.Course ...@@ -216,6 +217,17 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.Success(data: extModel); return ApiResult.Success(data: extModel);
} }
/// <summary>
/// 获取销售端口
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetSaleplatList()
{
var list = Common.Plugin.EnumHelper.EnumToList(typeof(SaleplatEnum));
return ApiResult.Success(data: list);
}
/// <summary> /// <summary>
/// 删除课程 /// 删除课程
/// </summary> /// </summary>
......
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