Commit 66d8b950 authored by 吴春's avatar 吴春

提交代码

parent a40a3979
...@@ -25,5 +25,10 @@ namespace Edu.Common.Enum.Course ...@@ -25,5 +25,10 @@ namespace Edu.Common.Enum.Course
/// </summary> /// </summary>
[EnumField("网课端")] [EnumField("网课端")]
OnlineClass = 3, OnlineClass = 3,
/// <summary>
/// 小程序
/// </summary>
[EnumField("小程序")]
MallApplet = 4,
} }
} }
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Plugin;
namespace Edu.Common.Enum.Mall
{
/// <summary>
/// 商品上架版面类型枚举
/// </summary>
public enum GoodsPageTypeEnum
{
/// <summary>
/// 全部
/// </summary>
[EnumField("全部")]
All = 0,
/// <summary>
/// 商城
/// </summary>
[EnumField("商城")]
Mall = 1,
/// <summary>
/// 校园
/// </summary>
[EnumField("校园")]
School = 2,
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Plugin;
namespace Edu.Common.Enum.Mall
{
/// <summary>
/// 司导商品类型枚举
/// </summary>
public enum GuideCarGoodsTypeEnum
{
/// <summary>
/// 接机
/// </summary>
[EnumField("接机")]
JJ = 1,
/// <summary>
/// 送机
/// </summary>
[EnumField("送机")]
SJ = 2,
/// <summary>
/// 市区
/// </summary>
[EnumField("市区")]
SQ = 3,
/// <summary>
/// 周边
/// </summary>
[EnumField("周边")]
ZB = 4,
/// <summary>
/// 线路用车
/// </summary>
[EnumField("线路用车")]
Line = 5
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Plugin;
namespace Edu.Common.Enum.Mall
{
/// <summary>
/// 订单类型枚举
/// </summary>
public enum OrderTypeEnum
{
/// <summary>
/// 商城
/// </summary>
[EnumField("商城")]
Mall = 1,
/// <summary>
/// 砍价
/// </summary>
[EnumField("砍价")]
CutPrice = 2,
/// <summary>
/// 预约
/// </summary>
[EnumField("预约")]
Reservation = 3,
/// <summary>
/// 拼团
/// </summary>
[EnumField("拼团")]
GroupBooking = 4,
/// <summary>
/// 刮刮卡
/// </summary>
[EnumField("刮刮卡")]
ScratchCard = 5,
/// <summary>
/// 幸运抽奖
/// </summary>
[EnumField("幸运抽奖")]
LuckyDraw = 6,
/// <summary>
/// 积分商城
/// </summary>
[EnumField("积分商城")]
Integral = 7,
/// <summary>
/// 当面付
/// </summary>
[EnumField("当面付")]
InPersonToPay = 8,
/// <summary>
/// 超级会员卡
/// </summary>
[EnumField("超级会员卡")]
SuperCard = 9,
/// <summary>
/// 商品预售
/// </summary>
[EnumField("商品预售")]
GoodsToBooking = 10,
/// <summary>
/// 司导商品
/// </summary>
[EnumField("司导商品")]
SDGoods = 11,
/// <summary>
/// 网教课程
/// </summary>
[EnumField("网教课程")]
KCGoods = 12,
/// <summary>
/// 线下服务
/// </summary>
[EnumField("线下服务")]
OfflineService = 13,
}
}
...@@ -131,6 +131,9 @@ namespace Edu.Model.Entity.Course ...@@ -131,6 +131,9 @@ namespace Edu.Model.Entity.Course
/// </summary> /// </summary>
public decimal ClassHours { get; set; } public decimal ClassHours { get; set; }
/// <summary>
/// 甲鹤小程序商品id
/// </summary>
public int MallGoodsId { get; set; }
} }
} }
\ No newline at end of file
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Mall
{
/// <summary>
/// 甲鹤商品关联分类表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "MallConnection")]
public class RB_Goods_Category
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 商品id
/// </summary>
public int? GoodsId
{
get;
set;
}
/// <summary>
/// 分类id
/// </summary>
public int? CategoryId
{
get;
set;
}
/// <summary>
/// 删除状态
/// </summary>
public int? Status
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Mall
{
/// <summary>
/// 甲鹤小程序优惠表实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "MallConnection")]
public class RB_Goods_Preferential
{
/// <summary>
/// 主键编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 商品编号
/// </summary>
public int GoodsId { get; set; }
/// <summary>
/// 优惠条件
/// </summary>
public string PreferentialTerms { get; set; }
/// <summary>
/// 销售返佣类型(0-百分比,1-固定金额)
/// </summary>
public int SaleCommissionType { get; set; }
/// <summary>
/// 销售返佣
/// </summary>
public decimal SaleCommissionMoney { get; set; }
/// <summary>
/// 同行返佣类型(0-百分比,1-固定金额)
/// </summary>
public int B2BCommissionType { get; set; }
/// <summary>
/// 同行返佣
/// </summary>
public decimal B2BCommissionMoney { get; set; }
/// <summary>
/// 课程价格优惠类型(见枚举)
/// </summary>
public Common.Enum.Course.CoursePriceDiscountEnum PriceDiscountType { get; set; }
/// <summary>
/// 购买人数
/// </summary>
public int BuyNum { get; set; }
/// <summary>
/// 赠送人数
/// </summary>
public int SendNum { get; set; }
/// <summary>
/// 优惠价格类型(0-百分比,1-固定金额)
/// </summary>
public int PriceType { get; set; }
/// <summary>
/// 优惠金额
/// </summary>
public decimal PriceMoney { get; set; }
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// 状态
/// </summary>
public Common.Enum.DateStateEnum Status { get; set; }
/// <summary>
/// 教育返佣类型(0-百分比,1-固定金额)
/// </summary>
public int EduCommissionType { get; set; }
/// <summary>
/// 教育同行佣金
/// </summary>
public decimal EduCommissionMoney { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Mall
{
/// <summary>
/// 商品关联规格表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "MallConnection")]
public class RB_Goods_Specification
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 商品id
/// </summary>
public int? GoodsId
{
get;
set;
}
/// <summary>
/// 规格名称
/// </summary>
public string Name
{
get;
set;
}
/// <summary>
/// 排序
/// </summary>
public int? Sort
{
get;
set;
}
/// <summary>
/// 是否启用规格图片 1是 2否
/// </summary>
public int? EnabledImage
{
get;
set;
}
/// <summary>
/// Status
/// </summary>
public int? Status
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Mall
{
/// <summary>
/// 商品关联规格价格表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "MallConnection")]
public class RB_Goods_SpecificationPrice
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 商品id
/// </summary>
public int? GoodsId
{
get;
set;
}
/// <summary>
/// 规格值 排序组
/// </summary>
public string SpecificationSort
{
get;
set;
}
/// <summary>
/// 价格
/// </summary>
public decimal? SellingPrice
{
get;
set;
}
/// <summary>
/// 返佣总金额
/// </summary>
public decimal Commission
{
get;
set;
}
/// <summary>
/// 成本价
/// </summary>
public decimal CostMoney
{
get;
set;
}
/// <summary>
/// 库存
/// </summary>
public int? InventoryNum
{
get;
set;
}
/// <summary>
/// 商品重量 克
/// </summary>
public int? GoodsWeight
{
get;
set;
}
/// <summary>
/// 商品货号
/// </summary>
public string GoodsNumbers
{
get;
set;
}
/// <summary>
/// Status
/// </summary>
public int? Status
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// UpdateDate
/// </summary>
public DateTime? UpdateDate
{
get;
set;
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Mall
{
/// <summary>
/// 商品关联规格值表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "MallConnection")]
public class RB_Goods_SpecificationValue
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// GoodsId
/// </summary>
public int? GoodsId
{
get;
set;
}
/// <summary>
/// 规格id
/// </summary>
public int? SpecificationId
{
get;
set;
}
/// <summary>
/// 规格值名称
/// </summary>
public string Name
{
get;
set;
}
/// <summary>
/// 规格图片
/// </summary>
public string Image
{
get;
set;
}
/// <summary>
/// 排序 不能重复 用于价格绑定Key
/// </summary>
public int? Sort
{
get;
set;
}
/// <summary>
/// Status
/// </summary>
public int? Status
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// 班级id
/// </summary>
public int ClassId { get; set; }
}
}
using Edu.Common; using Edu.Common;
using Edu.Model.ViewModel.Mall;
using Edu.Model.ViewModel.User; using Edu.Model.ViewModel.User;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -151,5 +152,11 @@ namespace Edu.Model.ViewModel.Course ...@@ -151,5 +152,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary> /// </summary>
public int ChapterCount { get; set; } public int ChapterCount { get; set; }
/// <summary>
/// 小程序商品分类
/// </summary>
public List<RB_Goods_Category_Extend> CategoryList { get; set; }
} }
} }
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.Mall;
using VT.FW.DB;
namespace Edu.Model.ViewModel.Mall
{
/// <summary>
/// 甲鹤商品关联分类表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "MallConnection")]
public class RB_Goods_Category_Extend: RB_Goods_Category
{
/// <summary>
/// 分类名称
/// </summary>
public string CategoryName { get; set; }
/// <summary>
/// 商品ids
/// </summary>
public string GoodsIds { get; set; }
/// <summary>
/// 是否可以分享
/// </summary>
public int? IsForeignShare { get; set; }
/// <summary>
/// 父级分类编号
/// </summary>
public int ParentId { get; set; }
/// <summary>
/// 商品层级
/// </summary>
public int Tier { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.Mall;
namespace Edu.Model.ViewModel.Mall
{
/// <summary>
/// 商品表扩展实体
/// </summary>
public class RB_Goods_Extend : RB_Goods
{
/// <summary>
/// 商品ids
/// </summary>
public string GoodsIds { get; set; }
/// <summary>
/// 轮播图列表
/// </summary>
public List<RB_ImageCommonModel> CarouselImageList { get; set; }
/// <summary>
/// 服务列表
/// </summary>
public List<RB_ImageCommonModel> ServiceList { get; set; }
/// <summary>
/// 商品分类
/// </summary>
public List<RB_Goods_Category_Extend> CategoryList { get; set; }
/// <summary>
/// 规格名列表
/// </summary>
public List<RB_Goods_Specification_Extend> SpecificationList { get; set; }
/// <summary>
/// 规格价格列表
/// </summary>
public List<RB_Goods_SpecificationPrice_Extend> SpecificationPriceList { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.Mall;
namespace Edu.Model.ViewModel.Mall
{
/// <summary>
/// 商品优惠表扩展实体类
/// </summary>
public class RB_Goods_Preferential_Extend : RB_Goods_Preferential
{
/// <summary>
/// 商品编号
/// </summary>
public string QGoodsIds { get; set; }
/// <summary>
/// 优惠类型字符串
/// </summary>
public string PriceDiscountTypeStr { get { return Common.Plugin.EnumHelper.ToName(this.PriceDiscountType); } }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.Mall;
using VT.FW.DB;
namespace Edu.Model.ViewModel.Mall
{
/// <summary>
/// 商品关联规格价格表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "MallConnection")]
public class RB_Goods_SpecificationPrice_Extend : RB_Goods_SpecificationPrice
{
/// <summary>
/// 商品ids
/// </summary>
public string GoodsIds { get; set; }
/// <summary>
/// 规格值列表
/// </summary>
public object AttrList { get; set; }
/// <summary>
/// 规格值
/// </summary>
public string AttrStr { get; set; }
/// <summary>
/// 查询排序
/// </summary>
public int? SortNum { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.Mall;
using VT.FW.DB;
namespace Edu.Model.ViewModel.Mall
{
/// <summary>
/// 商品关联规格值表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "MallConnection")]
public class RB_Goods_SpecificationValue_Extend : RB_Goods_SpecificationValue
{
/// <summary>
/// 商品ids
/// </summary>
public string GoodsIds { get; set; }
/// <summary>
/// 图片路径
/// </summary>
public string ImagePath { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.Mall;
using VT.FW.DB;
namespace Edu.Model.ViewModel.Mall
{
/// <summary>
/// 商品关联规格表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "MallConnection")]
public class RB_Goods_Specification_Extend : RB_Goods_Specification
{
/// <summary>
/// 商品ids
/// </summary>
public string GoodsIds { get; set; }
/// <summary>
/// 规格值列表
/// </summary>
public List<RB_Goods_SpecificationValue_Extend> SpecificationValueList { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Mall
{
/// <summary>
/// 图片通用类
/// </summary>
[Serializable]
public class RB_ImageCommonModel
{
/// <summary>
/// id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 路径
/// </summary>
public string Path { get; set; }
/// <summary>
/// 1-视频
/// </summary>
public int Type { get; set; }
}
}
...@@ -8,7 +8,7 @@ using Edu.Model.CacheModel; ...@@ -8,7 +8,7 @@ using Edu.Model.CacheModel;
using Edu.Model.Entity.Course; using Edu.Model.Entity.Course;
using Edu.Model.Entity.Mall; using Edu.Model.Entity.Mall;
using Edu.Model.ViewModel.Course; using Edu.Model.ViewModel.Course;
//using Edu.Model.ViewModel.Mall; using Edu.Model.ViewModel.Mall;
using Edu.Model.ViewModel.Reserve; using Edu.Model.ViewModel.Reserve;
using Edu.Model.ViewModel.User; using Edu.Model.ViewModel.User;
using Edu.Repository.Course; using Edu.Repository.Course;
...@@ -160,33 +160,33 @@ namespace Edu.Module.Course ...@@ -160,33 +160,33 @@ namespace Edu.Module.Course
///// <summary> /// <summary>
///// 小程序对应的商品仓储对象 /// 小程序对应的商品仓储对象
///// </summary> /// </summary>
//private readonly Repository.Mall.RB_GoodsRepository mallGoodsRepository = new Repository.Mall.RB_GoodsRepository(); private readonly Repository.Mall.RB_GoodsRepository mallGoodsRepository = new Repository.Mall.RB_GoodsRepository();
///// <summary> /// <summary>
///// 小程序对应的商品分类仓储对象 /// 小程序对应的商品分类仓储对象
///// </summary> /// </summary>
//private readonly Repository.Mall.RB_Goods_CategoryRepository MallGoodsCategoryRepository = new Repository.Mall.RB_Goods_CategoryRepository(); private readonly Repository.Mall.RB_Goods_CategoryRepository MallGoodsCategoryRepository = new Repository.Mall.RB_Goods_CategoryRepository();
///// <summary> /// <summary>
///// 小程序对应的商品优惠仓储对象 /// 小程序对应的商品优惠仓储对象
///// </summary> /// </summary>
//private readonly Repository.Mall.RB_Goods_PreferentialRepository MallGoodsPreferentialRepository = new Repository.Mall.RB_Goods_PreferentialRepository(); private readonly Repository.Mall.RB_Goods_PreferentialRepository MallGoodsPreferentialRepository = new Repository.Mall.RB_Goods_PreferentialRepository();
///// <summary> /// <summary>
///// 商品规格 /// 商品规格
///// </summary> /// </summary>
//private readonly Repository.Mall.RB_Goods_SpecificationRepository goods_SpecificationRepository = new Repository.Mall.RB_Goods_SpecificationRepository(); private readonly Repository.Mall.RB_Goods_SpecificationRepository goods_SpecificationRepository = new Repository.Mall.RB_Goods_SpecificationRepository();
///// <summary> /// <summary>
///// 商品规格值 /// 商品规格值
///// </summary> /// </summary>
//private readonly Repository.Mall.RB_Goods_SpecificationValueRepository goods_SpecificationValueRepository = new Repository.Mall.RB_Goods_SpecificationValueRepository(); private readonly Repository.Mall.RB_Goods_SpecificationValueRepository goods_SpecificationValueRepository = new Repository.Mall.RB_Goods_SpecificationValueRepository();
///// <summary> /// <summary>
///// 商品规格价格 /// 商品规格价格
///// </summary> /// </summary>
//private readonly Repository.Mall.RB_Goods_SpecificationPriceRepository goods_SpecificationPriceRepository = new Repository.Mall.RB_Goods_SpecificationPriceRepository(); private readonly Repository.Mall.RB_Goods_SpecificationPriceRepository goods_SpecificationPriceRepository = new Repository.Mall.RB_Goods_SpecificationPriceRepository();
/// <summary> /// <summary>
/// 获取班级列表 /// 获取班级列表
...@@ -583,7 +583,7 @@ namespace Edu.Module.Course ...@@ -583,7 +583,7 @@ namespace Edu.Module.Course
model.ClassPlanList = classPlanList; model.ClassPlanList = classPlanList;
#region 同步班级到甲鹤小程序 Add by:W 2021-08-02 09:49 #region 同步班级到甲鹤小程序 Add by:W 2021-08-02 09:49
// SetGoodsSpecificationValue(model); //SetGoodsSpecificationValue(model);
#endregion #endregion
...@@ -969,6 +969,12 @@ namespace Edu.Module.Course ...@@ -969,6 +969,12 @@ 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));
if (flag)
{
#region 同步班级到甲鹤小程序 Add by:W 2021-08-02 09:49
// System.Threading.Tasks.Task.Run(() => SetGoodsSpecificationValue(model));
#endregion
}
return flag; return flag;
} }
...@@ -3872,14 +3878,15 @@ namespace Edu.Module.Course ...@@ -3872,14 +3878,15 @@ namespace Edu.Module.Course
// var courseModel = courseRepository.GetEntity(model.CouseId).RefMapperTo<RB_Course_ViewModel>(); // var courseModel = courseRepository.GetEntity(model.CouseId).RefMapperTo<RB_Course_ViewModel>();
// if (courseModel != null && courseModel.MallGoodsId > 0) // if (courseModel != null && courseModel.MallGoodsId > 0)
// { // {
// if (courseModel.SalePlatList != null && courseModel.SalePlatList.Any(x => x == 4))//课程关联到了小程序 // if (courseModel.SalePlatList != null && courseModel.SalePlatList.Any(x => x == 4) && model.ClassStatus == ClassStatusEnum.NonOpenClass)//课程关联到了小程序
// { // {
// Model.ViewModel.Mall.RB_Goods_Extend demodel = new Model.ViewModel.Mall.RB_Goods_Extend(); // Model.ViewModel.Mall.RB_Goods_Extend demodel = new Model.ViewModel.Mall.RB_Goods_Extend();
// demodel.MallBaseId = Convert.ToInt32(Config.JHMallBaseId); // demodel.MallBaseId = Convert.ToInt32(Config.JHMallBaseId);
// demodel.TenantId = Convert.ToInt32(Config.JHTenantId); // demodel.TenantId = Convert.ToInt32(Config.JHTenantId);
// demodel.SpecificationList = new List<RB_Goods_Specification_Extend>(); // demodel.SpecificationList = new List<RB_Goods_Specification_Extend>();
// demodel.SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>(); // demodel.SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>();
// demodel.Id = courseModel.MallGoodsId;
// demodel.CreateDate = System.DateTime.Now;
// RB_Goods_Specification_Extend modelSpecification = new RB_Goods_Specification_Extend(); // RB_Goods_Specification_Extend modelSpecification = new RB_Goods_Specification_Extend();
// modelSpecification.Id = 0;//暂定 // modelSpecification.Id = 0;//暂定
// modelSpecification.EnabledImage = 2; // modelSpecification.EnabledImage = 2;
...@@ -3910,7 +3917,7 @@ namespace Edu.Module.Course ...@@ -3910,7 +3917,7 @@ namespace Edu.Module.Course
// GoodsWeight = 0, // GoodsWeight = 0,
// InventoryNum = item.ClassPersion - item.OrderStudentCount,//暂定 // InventoryNum = item.ClassPersion - item.OrderStudentCount,//暂定
// SellingPrice = item.SellPrice, // SellingPrice = item.SellPrice,
// SpecificationSort = "1",//暂定 // SpecificationSort = Sort.ToString(),//暂定
// AttrList = new object() // AttrList = new object()
// }; // };
// demodel.SpecificationPriceList.Add(pModel); // demodel.SpecificationPriceList.Add(pModel);
...@@ -3998,24 +4005,31 @@ namespace Edu.Module.Course ...@@ -3998,24 +4005,31 @@ namespace Edu.Module.Course
// } // }
// #endregion // #endregion
// } // }
// } // else
// return flag; // {
//}
/// <summary>
///
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
//public bool UpdateGoodsSpecificationValue(RB_Class_ViewModel model)
//{
// bool flag = false; // var svlist = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsId = courseModel.MallGoodsId, TenantId = Convert.ToInt32(Config.JHTenantId), MallBaseId = Convert.ToInt32(Config.JHMallBaseId) });
// var splist = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsId = courseModel.MallGoodsId, TenantId = Convert.ToInt32(Config.JHTenantId), MallBaseId = Convert.ToInt32(Config.JHMallBaseId) });
// if (svlist != null && svlist.Any(x => x.ClassId == model.ClassId))
// {
// var svModel = svlist.Where(x => x.ClassId == model.ClassId).FirstOrDefault();
// var spModel = splist.Where(x => x.SortNum == svModel.Sort).FirstOrDefault();
// if (svModel != null && svModel.Id > 0)
// {
// goods_SpecificationValueRepository.Delete(svModel);
// }
// if (spModel != null && spModel.Id > 0)
// {
// goods_SpecificationPriceRepository.Delete(spModel);
// }
// }
// }
// }
// return flag; // return flag;
//} //}
#endregion #endregion
} }
......
This diff is collapsed.
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.Mall;
using Edu.Model.ViewModel.Mall;
namespace Edu.Repository.Mall
{
public class RB_GoodsRepository : BaseRepository<RB_Goods>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Goods_Extend> GetGoodsPage(int pageIndex, int pageSize, out long rowCount, RB_Goods_Extend dmodel)
{
string where = $" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0 and g.GoodsClassify=2 and g.{nameof(RB_Goods_Extend.GoodsStatus)}=1 ";
if (dmodel.TenantId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)}={dmodel.Id}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and g.{nameof(RB_Goods_Extend.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.IsProcurement > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsProcurement)}={dmodel.IsProcurement}";
}
if (dmodel.IsProxy > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsProxy)}={dmodel.IsProxy}";
}
if (dmodel.SupplierId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.SupplierId)}={dmodel.SupplierId}";
}
string orderBy = " g.Sort desc";
string sql = $@" SELECT g.* from rb_goods as g where {where} order by {orderBy}";
return GetPage<RB_Goods_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 商品列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_Extend> GetGoodsList(RB_Goods_Extend dmodel)
{
string where = $" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0 ";
if (dmodel.TenantId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)}={dmodel.Id}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and g.{nameof(RB_Goods_Extend.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.IsProcurement > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsProcurement)}={dmodel.IsProcurement}";
}
if (dmodel.IsProxy > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsProxy)}={dmodel.IsProxy}";
}
if (dmodel.SupplierId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.SupplierId)}={dmodel.SupplierId}";
}
string orderBy = " g.Sort desc";
string sql = $@" SELECT g.* from rb_goods as g where {where} order by {orderBy}";
return Get<RB_Goods_Extend>(sql).ToList();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.Mall;
using Edu.Model.ViewModel.Mall;
namespace Edu.Repository.Mall
{
public class RB_Goods_CategoryRepository:BaseRepository<RB_Goods_Category>
{
/// <summary>
/// 列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Goods_Category_Extend> GetList(RB_Goods_Category_Extend dmodel)
{
string where = $" 1=1 and gc.{nameof(RB_Goods_Category.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and gc.{nameof(RB_Goods_Category.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and gc.{nameof(RB_Goods_Category.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and gc.{nameof(RB_Goods_Category.Id)}={dmodel.Id}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and gc.{nameof(RB_Goods_Category.GoodsId)}={dmodel.GoodsId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and gc.{nameof(RB_Goods_Category.GoodsId)} in({dmodel.GoodsIds})";
}
if (dmodel.CategoryId > 0)
{
where += $@" and gc.{nameof(RB_Goods_Category.CategoryId)}={dmodel.CategoryId}";
}
string sql = $@"
SELECT gc.*,pc.Name as CategoryName,pc.IsForeignShare,pc.ParentId,pc.Tier
FROM RB_Goods_Category gc inner join rb_product_category pc on gc.CategoryId=pc.Id
WHERE {where} ORDER BY gc.Id DESC ";
return Get<RB_Goods_Category_Extend>(sql).ToList();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Common.Enum;
using Edu.Model.Entity.Mall;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.Mall;
namespace Edu.Repository.Mall
{
/// <summary>
/// 商品优惠仓储类
/// </summary>
public class RB_Goods_PreferentialRepository : BaseRepository<RB_Goods_Preferential>
{
/// <summary>
/// 获取商品优惠列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Goods_Preferential_Extend> GetGoodsPreferentialListRepostory(RB_Goods_Preferential_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT *
FROM RB_Goods_Preferential
WHERE 1=1 ");
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Goods_Preferential_Extend.Status), (int)DateStateEnum.Normal);
if (query == null)
{
return new List<RB_Goods_Preferential_Extend>();
}
else
{
if (query.TenantId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Goods_Preferential_Extend.TenantId), query.TenantId);
}
if (query.GoodsId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Goods_Preferential_Extend.GoodsId), query.GoodsId);
}
if (!string.IsNullOrEmpty(query.QGoodsIds))
{
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Goods_Preferential_Extend.GoodsId), query.QGoodsIds);
}
if (query.Id > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Goods_Preferential_Extend.Id), query.Id);
}
}
return Get<RB_Goods_Preferential_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 根据商品编号删除优惠信息
/// </summary>
/// <param name="GoodsId">商品编号</param>
/// <returns></returns>
public bool DeleteGoodsPreferentialRepostory(int GoodsId)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(" DELETE FROM RB_Goods_Preferential WHERE GoodsId={0} ", GoodsId);
return base.Execute(builder.ToString()) > 0;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.Mall;
using Edu.Model.ViewModel.Mall;
namespace Edu.Repository.Mall
{
/// <summary>
/// 商品关联规格价格仓储层
/// </summary>
public class RB_Goods_SpecificationPriceRepository : BaseRepository<RB_Goods_SpecificationPrice>
{
/// <summary>
/// 列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Goods_SpecificationPrice_Extend> GetList(RB_Goods_SpecificationPrice_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Goods_SpecificationPrice.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationPrice.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationPrice.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationPrice.Id)}={dmodel.Id}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationPrice.GoodsId)}={dmodel.GoodsId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and {nameof(RB_Goods_SpecificationPrice.GoodsId)} in({dmodel.GoodsIds})";
}
string sql = $@"select * from RB_Goods_SpecificationPrice where {where} order by Id desc";
return Get<RB_Goods_SpecificationPrice_Extend>(sql).ToList();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.Mall;
using Edu.Model.ViewModel.Mall;
namespace Edu.Repository.Mall
{
/// <summary>
/// 商品关联规格仓储层
/// </summary>
public class RB_Goods_SpecificationRepository : BaseRepository<RB_Goods_Specification>
{
/// <summary>
/// 列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Goods_Specification_Extend> GetList(RB_Goods_Specification_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Goods_Specification.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Goods_Specification.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Goods_Specification.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Goods_Specification.Id)}={dmodel.Id}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and {nameof(RB_Goods_Specification.GoodsId)}={dmodel.GoodsId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and {nameof(RB_Goods_Specification.GoodsId)} in({dmodel.GoodsIds})";
}
string sql = $@"select * from RB_Goods_Specification where {where} order by Id asc";
return Get<RB_Goods_Specification_Extend>(sql).ToList();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.Mall;
using Edu.Model.ViewModel.Mall;
namespace Edu.Repository.Mall
{
/// <summary>
/// 商品关联规格值仓储层
/// </summary>
public class RB_Goods_SpecificationValueRepository : BaseRepository<RB_Goods_SpecificationValue>
{
/// <summary>
/// 列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Goods_SpecificationValue_Extend> GetList(RB_Goods_SpecificationValue_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Goods_SpecificationValue.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationValue.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationValue.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationValue.Id)}={dmodel.Id}";
}
if (dmodel.SpecificationId > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationValue.SpecificationId)}={dmodel.SpecificationId}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationValue.GoodsId)}={dmodel.GoodsId}";
}
if (dmodel.ClassId > 0)
{
where += $@" and {nameof(RB_Goods_SpecificationValue.ClassId)}={dmodel.ClassId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and {nameof(RB_Goods_SpecificationValue.GoodsId)} in({dmodel.GoodsIds})";
}
string sql = $@"select * from RB_Goods_SpecificationValue where {where} order by Id asc";
return Get<RB_Goods_SpecificationValue_Extend>(sql).ToList();
}
/// <summary>
/// 获取规格值图片
/// </summary>
/// <param name="goodsId"></param>
/// <param name="specificationSort"></param>
/// <returns></returns>
public string GetSpecificationImage(int goodsId, string specificationSort)
{
try
{
int Sort = Convert.ToInt32(specificationSort.Split(":")[0]);
string sql = $@"select * from RB_Goods_SpecificationValue where Status=0 and GoodsId={goodsId} and Sort={Sort} and Image<> '' order by Id asc limit 1";
var model = Get<RB_Goods_SpecificationValue_Extend>(sql).FirstOrDefault();
if (model != null)
{
return model.Image ?? "";
}
return "";
}
catch (Exception)
{
return "";
}
}
}
}
...@@ -368,7 +368,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -368,7 +368,7 @@ namespace Edu.WebApi.Controllers.Course
extModel.DefaultTimeJson = ""; extModel.DefaultTimeJson = "";
} }
bool flag = classModule.SetClassModule(extModel); bool flag = classModule.SetClassModule(extModel);
return flag ? ApiResult.Success(data:extModel) : ApiResult.Failed(); return flag ? ApiResult.Success(data: extModel) : ApiResult.Failed();
} }
/// <summary> /// <summary>
...@@ -382,7 +382,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -382,7 +382,7 @@ namespace Edu.WebApi.Controllers.Course
List<RB_Class_Plan_ViewModel> result = new List<RB_Class_Plan_ViewModel>(); List<RB_Class_Plan_ViewModel> result = new List<RB_Class_Plan_ViewModel>();
bool flag = false; bool flag = false;
bool IsRepeat = false; bool IsRepeat = false;
var t1 = new Task(() => { flag = classModule.AddClassPlanModule(ClassId, planList,base.UserInfo,out IsRepeat); }); var t1 = new Task(() => { flag = classModule.AddClassPlanModule(ClassId, planList, base.UserInfo, out IsRepeat); });
t1.Start(); t1.Start();
Task.WaitAll(t1); Task.WaitAll(t1);
return flag ? ApiResult.Success(data: IsRepeat) : ApiResult.Failed(); return flag ? ApiResult.Success(data: IsRepeat) : ApiResult.Failed();
...@@ -427,7 +427,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -427,7 +427,7 @@ namespace Edu.WebApi.Controllers.Course
{ {
return ApiResult.ParamIsNull(message: "请选择上课时间段!"); return ApiResult.ParamIsNull(message: "请选择上课时间段!");
} }
bool flag = classModule.BatchUpdateClassPlanModule(ClassId,ChangeType, ClassRoomId, TeacherId, ClassPlanIdList,TimeList,base.UserInfo,out bool result); bool flag = classModule.BatchUpdateClassPlanModule(ClassId, ChangeType, ClassRoomId, TeacherId, ClassPlanIdList, TimeList, base.UserInfo, out bool result);
return flag ? ApiResult.Success(data: result) : ApiResult.Failed(); return flag ? ApiResult.Success(data: result) : ApiResult.Failed();
} }
...@@ -520,7 +520,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -520,7 +520,7 @@ namespace Edu.WebApi.Controllers.Course
ClassId, ClassId,
classModel?.ClassName, classModel?.ClassName,
classModel?.ClassNo, classModel?.ClassNo,
RepeatList= obj, RepeatList = obj,
}; };
return ApiResult.Success(data: data); return ApiResult.Success(data: data);
} }
...@@ -546,7 +546,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -546,7 +546,7 @@ namespace Edu.WebApi.Controllers.Course
{ {
ClassId = base.ParmJObj.GetInt("ClassId"), ClassId = base.ParmJObj.GetInt("ClassId"),
ClassStatus = (ClassStatusEnum)base.ParmJObj.GetInt("ClassStatus"), ClassStatus = (ClassStatusEnum)base.ParmJObj.GetInt("ClassStatus"),
Teacher_Id=base.ParmJObj.GetInt("Teacher_Id") Teacher_Id = base.ParmJObj.GetInt("Teacher_Id")
}; };
if (extModel.ClassId <= 0) if (extModel.ClassId <= 0)
{ {
...@@ -557,11 +557,12 @@ namespace Edu.WebApi.Controllers.Course ...@@ -557,11 +557,12 @@ namespace Edu.WebApi.Controllers.Course
{ {
return ApiResult.ParamIsNull(message: "未找到此班级,请刷新页面重试!"); return ApiResult.ParamIsNull(message: "未找到此班级,请刷新页面重试!");
} }
if (model.ClassStatus == ClassStatusEnum.NonOpenClass && extModel.ClassStatus == ClassStatusEnum.StudyIng && model.Teacher_Id <= 0&&extModel.Teacher_Id<=0) if (model.ClassStatus == ClassStatusEnum.NonOpenClass && extModel.ClassStatus == ClassStatusEnum.StudyIng && model.Teacher_Id <= 0 && extModel.Teacher_Id <= 0)
{ {
return ApiResult.ParamIsNull(message: "未找到此班级,请刷新页面重试!"); return ApiResult.ParamIsNull(message: "未找到此班级,请刷新页面重试!");
} }
bool flag = classModule.SetClassStatusModule(extModel,out string message, out bool result); extModel.CouseId = model.CouseId;
bool flag = classModule.SetClassStatusModule(extModel, out string message, out bool result);
return flag ? ApiResult.Success(message: message, data: result) : ApiResult.Failed(message: message, data: result); return flag ? ApiResult.Success(message: message, data: result) : ApiResult.Failed(message: message, data: result);
} }
...@@ -1090,7 +1091,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1090,7 +1091,7 @@ namespace Edu.WebApi.Controllers.Course
bool result = classModule.AddClassStudentDropOutModule(model, base.UserInfo.AccountName); bool result = classModule.AddClassStudentDropOutModule(model, base.UserInfo.AccountName);
return result ? ApiResult.Success() : ApiResult.Failed(); return result ? ApiResult.Success() : ApiResult.Failed();
} }
/// <summary> /// <summary>
/// 获取教室页列表 /// 获取教室页列表
/// </summary> /// </summary>
...@@ -1201,7 +1202,8 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1201,7 +1202,8 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.Failed(GuestName + "(" + item.OrderGuestId + ") 其补课已处理,无法修改其缺勤状态"); return ApiResult.Failed(GuestName + "(" + item.OrderGuestId + ") 其补课已处理,无法修改其缺勤状态");
} }
} }
if (signModel.CheckStatus == 1 && item.CheckStatus == 1) { if (signModel.CheckStatus == 1 && item.CheckStatus == 1)
{
//都是缺勤 不更新补课数据 //都是缺勤 不更新补课数据
item.IsUpdateMakeUp = 1; item.IsUpdateMakeUp = 1;
} }
...@@ -2107,7 +2109,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -2107,7 +2109,7 @@ namespace Edu.WebApi.Controllers.Course
{ {
query.ClassDate = Convert.ToDateTime(classDate); query.ClassDate = Convert.ToDateTime(classDate);
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Cors; ...@@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System.Linq; using System.Linq;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Edu.Model.ViewModel.Mall;
namespace Edu.WebApi.Controllers.Course namespace Edu.WebApi.Controllers.Course
{ {
...@@ -164,7 +165,8 @@ namespace Edu.WebApi.Controllers.Course ...@@ -164,7 +165,8 @@ namespace Edu.WebApi.Controllers.Course
int groupId = base.UserInfo.Group_Id; int groupId = base.UserInfo.Group_Id;
int courseId = base.ParmJObj.GetInt("CourseId", 0); int courseId = base.ParmJObj.GetInt("CourseId", 0);
var list = courseModule.GetAllCourseChapterCountModule(groupId, courseId); var list = courseModule.GetAllCourseChapterCountModule(groupId, courseId);
return ApiResult.Success(data: list.Where(x=>x.UnitCount>0).Select(x => new { return ApiResult.Success(data: list.Where(x => x.UnitCount > 0).Select(x => new
{
x.CourseId, x.CourseId,
x.CourseName, x.CourseName,
x.UnitCount, x.UnitCount,
...@@ -187,6 +189,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -187,6 +189,7 @@ namespace Edu.WebApi.Controllers.Course
Status = (DateStateEnum)base.ParmJObj.GetInt("Status"), Status = (DateStateEnum)base.ParmJObj.GetInt("Status"),
IsQPrice = base.ParmJObj.GetInt("IsQPrice"), IsQPrice = base.ParmJObj.GetInt("IsQPrice"),
IsQTeacher = base.ParmJObj.GetInt("IsQTeacher"), IsQTeacher = base.ParmJObj.GetInt("IsQTeacher"),
Saleplat = base.ParmJObj.GetStringValue("Saleplat"),
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
//query.School_Id = base.UserInfo.School_Id; //query.School_Id = base.UserInfo.School_Id;
...@@ -279,12 +282,33 @@ namespace Edu.WebApi.Controllers.Course ...@@ -279,12 +282,33 @@ namespace Edu.WebApi.Controllers.Course
IsKCourse = base.ParmJObj.GetInt("IsKCourse"), IsKCourse = base.ParmJObj.GetInt("IsKCourse"),
ClassHours = base.ParmJObj.GetDecimal("ClassHours") ClassHours = base.ParmJObj.GetDecimal("ClassHours")
}; };
try
{
extModel.CategoryList = JsonHelper.DeserializeObject<List<RB_Goods_Category_Extend>>(base.ParmJObj.GetStringValue("CategoryList"));
if (extModel.SalePlatList != null && extModel.SalePlatList.Any(x => x == 4))//有小程序的上架平台
{
if (extModel.CategoryList == null || !extModel.CategoryList.Any())
{
return ApiResult.Failed("上架小程序必须选择小程序对应的分类");
}
}
}
catch (Exception ex)
{
}
extModel.CreateTime = DateTime.Now; extModel.CreateTime = DateTime.Now;
extModel.CreateBy = base.UserInfo.Id; extModel.CreateBy = base.UserInfo.Id;
extModel.UpdateBy = base.UserInfo.Id; extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now; extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = this.UserInfo.Group_Id; extModel.Group_Id = this.UserInfo.Group_Id;
extModel.School_Id = this.UserInfo.School_Id; extModel.School_Id = this.UserInfo.School_Id;
if (extModel.CourseId > 0)
{
var oldModel = courseModule.GetCourseModule(extModel.CourseId, IsGetDiscount: 1);
extModel.MallGoodsId = oldModel.MallGoodsId;
extModel.PreferentialList = oldModel.PreferentialList;
}
bool flag = courseModule.SetCourseModule(extModel); bool flag = courseModule.SetCourseModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
...@@ -322,7 +346,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -322,7 +346,7 @@ namespace Edu.WebApi.Controllers.Course
{ {
var CourseId = base.ParmJObj.GetInt("CourseId", 0); var CourseId = base.ParmJObj.GetInt("CourseId", 0);
int Status = base.ParmJObj.GetInt("Status", 1); int Status = base.ParmJObj.GetInt("Status", 1);
var flag = courseModule.RemoveCourseModule(CourseId, Status,out string message); var flag = courseModule.RemoveCourseModule(CourseId, Status, out string message);
return flag ? ApiResult.Success(message: message) : ApiResult.Failed(message: message); return flag ? ApiResult.Success(message: message) : ApiResult.Failed(message: message);
} }
...@@ -430,14 +454,14 @@ namespace Edu.WebApi.Controllers.Course ...@@ -430,14 +454,14 @@ namespace Edu.WebApi.Controllers.Course
#region 课程章节管理 #region 课程章节管理
[HttpPost] [HttpPost]
public ApiResult SetImportCourseChapter() public ApiResult SetImportCourseChapter()
{ {
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Course_Chapter_ViewModel>(RequestParm.Msg.ToString()); var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Course_Chapter_ViewModel>(RequestParm.Msg.ToString());
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id; query.School_Id = base.UserInfo.School_Id;
query.CreateBy = base.UserInfo.Id; query.CreateBy = base.UserInfo.Id;
var q=courseModule.SetImportChapterModule(query); var q = courseModule.SetImportChapterModule(query);
if (q!=null && q.Count > 0) if (q != null && q.Count > 0)
{ {
return ApiResult.Success(); return ApiResult.Success();
} }
...@@ -458,17 +482,17 @@ namespace Edu.WebApi.Controllers.Course ...@@ -458,17 +482,17 @@ namespace Edu.WebApi.Controllers.Course
ChapterNo = base.ParmJObj.GetStringValue("ChapterNo"), ChapterNo = base.ParmJObj.GetStringValue("ChapterNo"),
ChapterName = base.ParmJObj.GetStringValue("ChapterName"), ChapterName = base.ParmJObj.GetStringValue("ChapterName"),
ChapterContent = base.ParmJObj.GetStringValue("ChapterContent"), ChapterContent = base.ParmJObj.GetStringValue("ChapterContent"),
ParentId=base.ParmJObj.GetInt("ParentId"), ParentId = base.ParmJObj.GetInt("ParentId"),
OpenStatus=base.ParmJObj.GetInt("OpenStatus"), OpenStatus = base.ParmJObj.GetInt("OpenStatus"),
Progress=base.ParmJObj.GetInt("Progress"), Progress = base.ParmJObj.GetInt("Progress"),
StudyHours=base.ParmJObj.GetInt("StudyHours"), StudyHours = base.ParmJObj.GetInt("StudyHours"),
StudyMinutes=base.ParmJObj.GetInt("StudyMinutes"), StudyMinutes = base.ParmJObj.GetInt("StudyMinutes"),
Objectives=base.ParmJObj.GetStringValue("Objectives"), Objectives = base.ParmJObj.GetStringValue("Objectives"),
Requirement=base.ParmJObj.GetStringValue("Requirement"), Requirement = base.ParmJObj.GetStringValue("Requirement"),
CourseRate=(CourseRateEnum)base.ParmJObj.GetInt("CourseRate"), CourseRate = (CourseRateEnum)base.ParmJObj.GetInt("CourseRate"),
//CurrentHours=base.ParmJObj.GetInt("CurrentHours"), //CurrentHours=base.ParmJObj.GetInt("CurrentHours"),
}; };
extModel.Status = DateStateEnum.Normal; extModel.Status = DateStateEnum.Normal;
extModel.CreateTime = DateTime.Now; extModel.CreateTime = DateTime.Now;
extModel.CreateBy = base.UserInfo.Id; extModel.CreateBy = base.UserInfo.Id;
...@@ -477,7 +501,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -477,7 +501,7 @@ namespace Edu.WebApi.Controllers.Course
extModel.Group_Id = this.UserInfo.Group_Id; extModel.Group_Id = this.UserInfo.Group_Id;
extModel.School_Id = this.UserInfo.School_Id; extModel.School_Id = this.UserInfo.School_Id;
bool flag = courseModule.SetChapterModule(extModel); bool flag = courseModule.SetChapterModule(extModel);
return flag ? ApiResult.Success(data:extModel) : ApiResult.Failed(); return flag ? ApiResult.Success(data: extModel) : ApiResult.Failed();
} }
/// <summary> /// <summary>
...@@ -565,9 +589,9 @@ namespace Edu.WebApi.Controllers.Course ...@@ -565,9 +589,9 @@ namespace Edu.WebApi.Controllers.Course
{ {
var extModel = new RB_Course_Chapter_ViewModel() var extModel = new RB_Course_Chapter_ViewModel()
{ {
CourseId=base.ParmJObj.GetInt("CourseId"), CourseId = base.ParmJObj.GetInt("CourseId"),
ChapterNo=base.ParmJObj.GetStringValue("ChapterNo"), ChapterNo = base.ParmJObj.GetStringValue("ChapterNo"),
ChapterId=base.ParmJObj.GetInt("ChapterId"), ChapterId = base.ParmJObj.GetInt("ChapterId"),
}; };
bool flag = courseModule.BatchRemoveChapterModule(extModel); bool flag = courseModule.BatchRemoveChapterModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
...@@ -608,7 +632,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -608,7 +632,7 @@ namespace Edu.WebApi.Controllers.Course
bool flag = courseModule.SetChapterOpenStatusModule(extModel); bool flag = courseModule.SetChapterOpenStatusModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
/// <summary> /// <summary>
/// 设置章节名称 /// 设置章节名称
/// </summary> /// </summary>
...@@ -1083,7 +1107,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1083,7 +1107,7 @@ namespace Edu.WebApi.Controllers.Course
foreach (var item in jArray) foreach (var item in jArray)
{ {
JObject param = JObject.Parse(item.ToString()); JObject param = JObject.Parse(item.ToString());
int priceDiscountType=param.GetInt("PriceDiscountType"); int priceDiscountType = param.GetInt("PriceDiscountType");
if (priceDiscountType <= 0) if (priceDiscountType <= 0)
{ {
return ApiResult.ParamIsNull(message: "请选择【优惠类型】"); return ApiResult.ParamIsNull(message: "请选择【优惠类型】");
...@@ -1120,14 +1144,18 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1120,14 +1144,18 @@ namespace Edu.WebApi.Controllers.Course
var groupList = list.GroupBy(qitem => new { qitem.PriceDiscountType, qitem.PriceDiscountTypeStr }); var groupList = list.GroupBy(qitem => new { qitem.PriceDiscountType, qitem.PriceDiscountTypeStr });
foreach (var item in groupList) foreach (var item in groupList)
{ {
var tempCount = list?.Where(qitem => qitem.PriceDiscountType == item.Key.PriceDiscountType)?.Count()??0; var tempCount = list?.Where(qitem => qitem.PriceDiscountType == item.Key.PriceDiscountType)?.Count() ?? 0;
if (tempCount > 1) if (tempCount > 1)
{ {
return ApiResult.ParamIsNull(message: string.Format("已存在【{0}】的优惠类型,请重新选择!", item.Key.PriceDiscountTypeStr)); return ApiResult.ParamIsNull(message: string.Format("已存在【{0}】的优惠类型,请重新选择!", item.Key.PriceDiscountTypeStr));
} }
} }
} }
var flag = courseModule.SetCoursePreferentialListModule(courseModel, list); var extModel = courseModule.GetCourseModule(courseModel.CourseId, IsGetDiscount: 0);
extModel.OriginalPrice = courseModel.OriginalPrice;
extModel.SellPrice = courseModel.SellPrice;
var flag = courseModule.SetCoursePreferentialListModule(extModel, list);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
#endregion #endregion
...@@ -1150,7 +1178,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1150,7 +1178,7 @@ namespace Edu.WebApi.Controllers.Course
{ {
return ApiResult.Success(); return ApiResult.Success();
} }
else else
{ {
return ApiResult.Failed(); return ApiResult.Failed();
} }
...@@ -1162,15 +1190,16 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1162,15 +1190,16 @@ namespace Edu.WebApi.Controllers.Course
/// <returns></returns> /// <returns></returns>
public ApiResult GetUnKnowUserByClassId() public ApiResult GetUnKnowUserByClassId()
{ {
int classId = ParmJObj.GetInt("classId",0); int classId = ParmJObj.GetInt("classId", 0);
var list = courseModule.GetUnKnowUserByClassTimeModule(classId); var list = courseModule.GetUnKnowUserByClassTimeModule(classId);
var result = list.Select(x => new { var result = list.Select(x => new
{
x.Id, x.Id,
x.UserAvatar, x.UserAvatar,
x.CreateTimeStr, x.CreateTimeStr,
x.FaceId x.FaceId
}); });
return ApiResult.Success(data:result); return ApiResult.Success(data: result);
} }
#endregion #endregion
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
"DataStatisticsConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_datastatistics;CharSet=utf8mb4; Convert Zero Datetime=true; ", "DataStatisticsConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_datastatistics;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"DataStatisticsConnectionPName": "MySql.Data.MySqlClient", "DataStatisticsConnectionPName": "MySql.Data.MySqlClient",
"LogConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_sys;CharSet=utf8mb4; Convert Zero Datetime=true; ", "LogConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_sys;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"LogConnectionPName": "MySql.Data.MySqlClient" "LogConnectionPName": "MySql.Data.MySqlClient",
"MallConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=test_reborn_mall;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"MallConnectionPName": "MySql.Data.MySqlClient"
}, },
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
......
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