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;
namespace Edu.Model.Entity.Course
{
/// <summary>
/// 课程阶梯价格实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Course_StepPrice
/// <summary>
/// 课程阶梯价格实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Course_StepPrice
{
/// <summary>
/// 主键
/// </summary>
public int CoursePriceId { get; set; }
/// <summary>
/// 主键
/// </summary>
public int CoursePriceId { get; set; }
/// <summary>
/// 课程编号
/// </summary>
public int CourseId { get; set; }
/// <summary>
/// 课程编号
/// </summary>
public int CourseId { get; set; }
/// <summary>
/// 人数
/// </summary>
public int PersionNum { get; set; }
/// <summary>
/// 人数
/// </summary>
public int PersionNum { get; set; }
/// <summary>
/// 售价
/// </summary>
public decimal SellPrice { get; set; }
}
/// <summary>
/// 售价
/// </summary>
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
/// <summary>
/// 创建时间字符串
/// </summary>
public string CreateTimeStr { get { return this.CreateTime.FormatTime();} }
public string CreateTimeStr { get { return this.CreateTime.FormatTime(); } }
/// <summary>
/// 更新时间
......@@ -44,5 +44,35 @@ namespace Edu.Model.ViewModel.Course
/// 课程阶梯价格列表
/// </summary>
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
/// </summary>
public string QQuestionTypeStr { get; set; }
/// <summary>
/// 知识点【查询使用,多选】
/// </summary>
......
......@@ -161,19 +161,64 @@ namespace Edu.Module.Course
model.CourseId = newId;
flag = newId > 0;
}
//没有设置阶梯价格,删除原来的价格
course_StepPriceRepository.DeleteStepPriceRepository(model.CourseId);
if (model.IsOpenStepPrice == 1)
#region 阶梯报价
//未开启阶梯价格
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;
course_StepPriceRepository.Insert(item);
priceItem.CourseId = model.CourseId;
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;
}
......
using System;
using Edu.Cache.User;
using Edu.Common.API;
using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course;
using Edu.Module.Course;
......@@ -216,6 +217,17 @@ namespace Edu.WebApi.Controllers.Course
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>
......
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