Commit 2da3c2c5 authored by 吴春's avatar 吴春

提交代码

parent 8f54aacd
using Edu.AOP.CustomerAttribute;
using Edu.Cache.User;
using Edu.Common;
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.CacheModel;
using Edu.Model.Entity.Course;
using Edu.Model.Entity.Mall;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.Mall;
using Edu.Model.ViewModel.Reserve;
using Edu.Model.ViewModel.User;
using Edu.Repository.Course;
......@@ -157,6 +160,34 @@ namespace Edu.Module.Course
///// <summary>
///// 小程序对应的商品仓储对象
///// </summary>
//private readonly Repository.Mall.RB_GoodsRepository mallGoodsRepository = new Repository.Mall.RB_GoodsRepository();
///// <summary>
///// 小程序对应的商品分类仓储对象
///// </summary>
//private readonly Repository.Mall.RB_Goods_CategoryRepository MallGoodsCategoryRepository = new Repository.Mall.RB_Goods_CategoryRepository();
///// <summary>
///// 小程序对应的商品优惠仓储对象
///// </summary>
//private readonly Repository.Mall.RB_Goods_PreferentialRepository MallGoodsPreferentialRepository = new Repository.Mall.RB_Goods_PreferentialRepository();
///// <summary>
///// 商品规格
///// </summary>
//private readonly Repository.Mall.RB_Goods_SpecificationRepository goods_SpecificationRepository = new Repository.Mall.RB_Goods_SpecificationRepository();
///// <summary>
///// 商品规格值
///// </summary>
//private readonly Repository.Mall.RB_Goods_SpecificationValueRepository goods_SpecificationValueRepository = new Repository.Mall.RB_Goods_SpecificationValueRepository();
///// <summary>
///// 商品规格价格
///// </summary>
//private readonly Repository.Mall.RB_Goods_SpecificationPriceRepository goods_SpecificationPriceRepository = new Repository.Mall.RB_Goods_SpecificationPriceRepository();
/// <summary>
/// 获取班级列表
/// </summary>
......@@ -558,7 +589,7 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool AddClassPlanModule(int ClassId, List<RB_Class_Plan_ViewModel> planList,UserInfo user,out bool result)
public bool AddClassPlanModule(int ClassId, List<RB_Class_Plan_ViewModel> planList, UserInfo user, out bool result)
{
bool flag = true;
result = false;
......@@ -607,7 +638,7 @@ namespace Edu.Module.Course
var classLogModel = new Model.Entity.Log.RB_Class_Log()
{
LogType = Common.Enum.Course.ClassLogTypeEnum.CreateClass,
LogContent = string.Format("班级管理员{0}创建上课计划成功!但是存在冲突的上课安排,等待管理员处理!",user.AccountName),
LogContent = string.Format("班级管理员{0}创建上课计划成功!但是存在冲突的上课安排,等待管理员处理!", user.AccountName),
ClassId = ClassId,
Group_Id = model.Group_Id,
School_Id = model.School_Id,
......@@ -621,7 +652,7 @@ namespace Edu.Module.Course
var classLogModel = new Model.Entity.Log.RB_Class_Log()
{
LogType = Common.Enum.Course.ClassLogTypeEnum.CreateClass,
LogContent = string.Format("班级管理员{0},完成班级排课计划冲突",user.AccountName),
LogContent = string.Format("班级管理员{0},完成班级排课计划冲突", user.AccountName),
ClassId = ClassId,
Group_Id = model.Group_Id,
School_Id = model.School_Id,
......@@ -866,12 +897,13 @@ namespace Edu.Module.Course
item.ClassPlanId,
item.ClassId,
item.ClassName,
ClassDate=Common.ConvertHelper.FormatDate(item.ClassDate),
ClassDate = Common.ConvertHelper.FormatDate(item.ClassDate),
item.TeacherId,
item.TeacherName,
item.ClassRoomId,
item.RoomName,
PlanTimeList= timeList.Where(qitem => qitem.ClassPlanId == item.ClassPlanId).Select(qitem => new {
PlanTimeList = timeList.Where(qitem => qitem.ClassPlanId == item.ClassPlanId).Select(qitem => new
{
qitem.ClassTimeId,
qitem.ClassId,
qitem.ClassPlanId,
......@@ -894,7 +926,7 @@ namespace Edu.Module.Course
/// <param name="message"></param>
/// <returns></returns>
[TransactionCallHandler]
public virtual bool SetClassStatusModule(RB_Class_ViewModel model, out string message,out bool result)
public virtual bool SetClassStatusModule(RB_Class_ViewModel model, out string message, out bool result)
{
result = false;
bool flag = false;
......@@ -930,7 +962,7 @@ namespace Edu.Module.Course
}
}
flag= classRepository.Update(fileds, new WhereHelper(nameof(RB_Class_ViewModel.ClassId), model.ClassId));
flag = classRepository.Update(fileds, new WhereHelper(nameof(RB_Class_ViewModel.ClassId), model.ClassId));
return flag;
}
......@@ -3820,5 +3852,145 @@ namespace Edu.Module.Course
#endregion
#region 甲鹤小程序商品信息
//public bool SetGoodsSpecificationValue(RB_Class_ViewModel model)
//{
// bool flag = false;
// var courseModel = courseRepository.GetEntity(model.CouseId).RefMapperTo<RB_Course_ViewModel>();
// if (courseModel != null && courseModel.MallGoodsId > 0)
// {
// if (courseModel.SalePlatList != null && courseModel.SalePlatList.Any(x => x == 4))//课程关联到了小程序
// {
// Model.ViewModel.Mall.RB_Goods_Extend demodel = new Model.ViewModel.Mall.RB_Goods_Extend();
// demodel.MallBaseId = Convert.ToInt32(Config.JHMallBaseId);
// demodel.TenantId = Convert.ToInt32(Config.JHTenantId);
// demodel.SpecificationList = new List<RB_Goods_Specification_Extend>();
// demodel.SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>();
// RB_Goods_Specification_Extend modelSpecification = new RB_Goods_Specification_Extend();
// modelSpecification.Id = 0;//暂定
// modelSpecification.EnabledImage = 2;
// modelSpecification.Name = "开班日期";
// modelSpecification.Sort = 1;
// modelSpecification.SpecificationValueList = new List<RB_Goods_SpecificationValue_Extend>();
// //查询课程对应班级开课时间大于今天的班级
// var classList = classRepository.GetClassAndCourseListRepository(new RB_Class_ViewModel { CouseId = model.CouseId, StartTime = System.DateTime.Now.ToString("yyyy-MM-dd") }).Where(x => x.ClassStatus == Common.Enum.Course.ClassStatusEnum.NonOpenClass && x.OpenTime > System.DateTime.Now).ToList();
// if (classList != null && classList.Any())
// {
// int Sort = 1;
// foreach (var item in classList)
// {
// RB_Goods_SpecificationValue_Extend modelSpecificationValue = new RB_Goods_SpecificationValue_Extend();
// modelSpecificationValue.Id = 0;
// modelSpecificationValue.Image = "";
// modelSpecificationValue.ImagePath = "";
// modelSpecificationValue.Name = item.OpenTime.ToString("MM月dd日");
// modelSpecificationValue.Sort = Sort;///暂定1
// modelSpecificationValue.ClassId = item.ClassId;
// modelSpecification.SpecificationValueList.Add(modelSpecificationValue);
// RB_Goods_SpecificationPrice_Extend pModel = new RB_Goods_SpecificationPrice_Extend()
// {
// Commission = 0,
// CostMoney = 0,
// GoodsNumbers = item.ClassNo,
// GoodsWeight = 0,
// InventoryNum = item.ClassPersion - item.OrderStudentCount,//暂定
// SellingPrice = item.SellPrice,
// SpecificationSort = "1",//暂定
// AttrList = new object()
// };
// demodel.SpecificationPriceList.Add(pModel);
// Sort += 1;
// }
// }
// demodel.SpecificationList.Add(modelSpecification);
// #region 删除规格
// var slist = goods_SpecificationRepository.GetList(new RB_Goods_Specification_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
// var svlist = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
// var splist = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
// if (slist != null && slist.Any())
// {
// //删除后新增
// goods_SpecificationRepository.DeleteBatch(slist);
// }
// if (svlist != null && svlist.Any())
// {
// goods_SpecificationValueRepository.DeleteBatch(svlist);
// }
// if (splist != null && splist.Any())
// {
// goods_SpecificationPriceRepository.DeleteBatch(splist);
// }
// #endregion
// #region 新增规格
// foreach (var item in demodel.SpecificationList)
// {
// int sid = goods_SpecificationRepository.Insert(new RB_Goods_Specification()
// {
// CreateDate = demodel.CreateDate,
// EnabledImage = item.EnabledImage,
// GoodsId = courseModel.MallGoodsId,
// Id = 0,
// MallBaseId = demodel.MallBaseId,
// Name = item.Name,
// Sort = item.Sort,
// Status = 0,
// TenantId = demodel.TenantId
// });
// if (sid > 0)
// {
// foreach (var qitem in item.SpecificationValueList)
// {
// goods_SpecificationValueRepository.Insert(new RB_Goods_SpecificationValue()
// {
// CreateDate = demodel.CreateDate,
// GoodsId = courseModel.MallGoodsId,
// Id = 0,
// Image = qitem.Image,
// MallBaseId = demodel.MallBaseId,
// Name = qitem.Name,
// Sort = qitem.Sort,
// Status = 0,
// TenantId = demodel.TenantId,
// SpecificationId = sid,
// ClassId = qitem.ClassId
// });
// }
// }
// }
// foreach (var item in demodel.SpecificationPriceList)
// {
// goods_SpecificationPriceRepository.Insert(new RB_Goods_SpecificationPrice()
// {
// CreateDate = demodel.CreateDate,
// GoodsId = courseModel.MallGoodsId,
// Id = 0,
// GoodsNumbers = item.GoodsNumbers,
// GoodsWeight = item.GoodsWeight,
// InventoryNum = item.InventoryNum,
// MallBaseId = demodel.MallBaseId,
// SellingPrice = item.SellingPrice,
// SpecificationSort = item.SpecificationSort,
// Status = 0,
// TenantId = demodel.TenantId,
// UpdateDate = demodel.UpdateDate,
// Commission = item.Commission,
// CostMoney = item.CostMoney
// });
// }
// #endregion
// }
// }
// return flag;
//}
#endregion
}
}
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