Commit 048fa3a4 authored by 黄奎's avatar 黄奎

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents 3aaacb98 2d758b85
...@@ -42,5 +42,10 @@ namespace Edu.Common.Enum.Course ...@@ -42,5 +42,10 @@ namespace Edu.Common.Enum.Course
/// </summary> /// </summary>
[EnumField("教育同行")] [EnumField("教育同行")]
EduClient = 7, EduClient = 7,
/// <summary>
/// 甲鹤小程序
/// </summary>
[EnumField("甲鹤小程序")]
MallApplet = 8,
} }
} }
...@@ -18,7 +18,7 @@ namespace Edu.Model.Entity.Finance ...@@ -18,7 +18,7 @@ namespace Edu.Model.Entity.Finance
/// </summary> /// </summary>
public int ID { get; set; } public int ID { get; set; }
/// <summary> /// <summary>
/// 类型 1收款 2退款 /// 类型 1收款 2退款,3-活动收入,4-活动退款
/// </summary> /// </summary>
public int? Type public int? Type
{ {
......
...@@ -21,5 +21,11 @@ namespace Edu.Model.ViewModel.Mall ...@@ -21,5 +21,11 @@ namespace Edu.Model.ViewModel.Mall
/// 图片路径 /// 图片路径
/// </summary> /// </summary>
public string ImagePath { get; set; } public string ImagePath { get; set; }
/// <summary>
/// 班级ids
/// </summary>
public string ClassIds { get; set; }
} }
} }
...@@ -24,6 +24,7 @@ using System.Collections.Generic; ...@@ -24,6 +24,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using VT.FW.DB; using VT.FW.DB;
using Edu.Model.Entity.Mall;
using Edu.Repository.BackClass; using Edu.Repository.BackClass;
using Edu.Repository.Grade; using Edu.Repository.Grade;
using Edu.Repository.Sell; using Edu.Repository.Sell;
...@@ -589,7 +590,7 @@ namespace Edu.Module.Course ...@@ -589,7 +590,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
...@@ -978,7 +979,7 @@ namespace Edu.Module.Course ...@@ -978,7 +979,7 @@ namespace Edu.Module.Course
if (flag) if (flag)
{ {
#region 同步班级到甲鹤小程序 Add by:W 2021-08-02 09:49 #region 同步班级到甲鹤小程序 Add by:W 2021-08-02 09:49
// System.Threading.Tasks.Task.Run(() => SetGoodsSpecificationValue(model)); System.Threading.Tasks.Task.Run(() => SetGoodsSpecificationValue(model));
#endregion #endregion
} }
return flag; return flag;
...@@ -3907,163 +3908,168 @@ namespace Edu.Module.Course ...@@ -3907,163 +3908,168 @@ namespace Edu.Module.Course
/// </summary> /// </summary>
/// <param name="model"></param> /// <param name="model"></param>
/// <returns></returns> /// <returns></returns>
//public bool SetGoodsSpecificationValue(RB_Class_ViewModel model) public bool SetGoodsSpecificationValue(RB_Class_ViewModel model)
//{ {
// bool flag = false; bool flag = false;
// 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) && model.ClassStatus == ClassStatusEnum.NonOpenClass)//课程关联到了小程序 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.Id = courseModel.MallGoodsId;
// demodel.CreateDate = System.DateTime.Now; 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;
// modelSpecification.Name = "开班日期"; modelSpecification.Name = "开班日期";
// modelSpecification.Sort = 1; modelSpecification.Sort = 1;
// modelSpecification.SpecificationValueList = new List<RB_Goods_SpecificationValue_Extend>(); 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(); 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()) if (classList != null && classList.Any())
// { {
// int Sort = 1; int Sort = 1;
// foreach (var item in classList) foreach (var item in classList)
// { {
// RB_Goods_SpecificationValue_Extend modelSpecificationValue = new RB_Goods_SpecificationValue_Extend(); RB_Goods_SpecificationValue_Extend modelSpecificationValue = new RB_Goods_SpecificationValue_Extend();
// modelSpecificationValue.Id = 0; modelSpecificationValue.Id = 0;
// modelSpecificationValue.Image = ""; modelSpecificationValue.Image = "";
// modelSpecificationValue.ImagePath = ""; modelSpecificationValue.ImagePath = "";
// modelSpecificationValue.Name = item.OpenTime.ToString("MM月dd日"); modelSpecificationValue.Name = item.OpenTime.ToString("MM月dd日");
// modelSpecificationValue.Sort = Sort;///暂定1 modelSpecificationValue.Sort = Sort;///暂定1
// modelSpecificationValue.ClassId = item.ClassId; modelSpecificationValue.ClassId = item.ClassId;
// modelSpecification.SpecificationValueList.Add(modelSpecificationValue); modelSpecification.SpecificationValueList.Add(modelSpecificationValue);
// RB_Goods_SpecificationPrice_Extend pModel = new RB_Goods_SpecificationPrice_Extend() RB_Goods_SpecificationPrice_Extend pModel = new RB_Goods_SpecificationPrice_Extend()
// { {
// Commission = 0, Commission = 0,
// CostMoney = 0, CostMoney = 0,
// GoodsNumbers = item.ClassNo, GoodsNumbers = item.ClassNo,
// GoodsWeight = 0, GoodsWeight = 0,
// InventoryNum = item.ClassPersion - item.OrderStudentCount,//暂定 InventoryNum = item.ClassPersion - item.OrderStudentCount,//暂定
// SellingPrice = item.SellPrice, SellingPrice = item.SellPrice,
// SpecificationSort = Sort.ToString(),//暂定 SpecificationSort = Sort.ToString(),//暂定
// AttrList = new object() AttrList = new object()
// }; };
// demodel.SpecificationPriceList.Add(pModel); demodel.SpecificationPriceList.Add(pModel);
// Sort += 1; Sort += 1;
// } }
// } }
// demodel.SpecificationList.Add(modelSpecification); demodel.SpecificationList.Add(modelSpecification);
// #region 删除规格 #region 删除规格
// var slist = goods_SpecificationRepository.GetList(new RB_Goods_Specification_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); 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 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 }); var splist = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
// if (slist != null && slist.Any()) if (slist != null && slist.Any())
// { {
// //删除后新增 //删除后新增
// goods_SpecificationRepository.DeleteBatch(slist); goods_SpecificationRepository.DeleteBatch(slist);
// } }
// if (svlist != null && svlist.Any()) if (svlist != null && svlist.Any())
// { {
// goods_SpecificationValueRepository.DeleteBatch(svlist); goods_SpecificationValueRepository.DeleteBatch(svlist);
// } }
// if (splist != null && splist.Any()) if (splist != null && splist.Any())
// { {
// goods_SpecificationPriceRepository.DeleteBatch(splist); goods_SpecificationPriceRepository.DeleteBatch(splist);
// } }
// #endregion #endregion
// #region 新增规格 #region 新增规格
// foreach (var item in demodel.SpecificationList) foreach (var item in demodel.SpecificationList)
// { {
// int sid = goods_SpecificationRepository.Insert(new RB_Goods_Specification() int sid = goods_SpecificationRepository.Insert(new RB_Goods_Specification()
// { {
// CreateDate = demodel.CreateDate, CreateDate = demodel.CreateDate,
// EnabledImage = item.EnabledImage, EnabledImage = item.EnabledImage,
// GoodsId = courseModel.MallGoodsId, GoodsId = courseModel.MallGoodsId,
// Id = 0, Id = 0,
// MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
// Name = item.Name, Name = item.Name,
// Sort = item.Sort, Sort = item.Sort,
// Status = 0, Status = 0,
// TenantId = demodel.TenantId TenantId = demodel.TenantId
// }); });
// if (sid > 0) if (sid > 0)
// { {
// foreach (var qitem in item.SpecificationValueList) foreach (var qitem in item.SpecificationValueList)
// { {
// goods_SpecificationValueRepository.Insert(new RB_Goods_SpecificationValue() goods_SpecificationValueRepository.Insert(new RB_Goods_SpecificationValue()
// { {
// CreateDate = demodel.CreateDate, CreateDate = demodel.CreateDate,
// GoodsId = courseModel.MallGoodsId, GoodsId = courseModel.MallGoodsId,
// Id = 0, Id = 0,
// Image = qitem.Image, Image = qitem.Image,
// MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
// Name = qitem.Name, Name = qitem.Name,
// Sort = qitem.Sort, Sort = qitem.Sort,
// Status = 0, Status = 0,
// TenantId = demodel.TenantId, TenantId = demodel.TenantId,
// SpecificationId = sid, SpecificationId = sid,
// ClassId = qitem.ClassId ClassId = qitem.ClassId
// }); });
// } }
// } }
// } }
// foreach (var item in demodel.SpecificationPriceList) foreach (var item in demodel.SpecificationPriceList)
// { {
// goods_SpecificationPriceRepository.Insert(new RB_Goods_SpecificationPrice() goods_SpecificationPriceRepository.Insert(new RB_Goods_SpecificationPrice()
// { {
// CreateDate = demodel.CreateDate, CreateDate = demodel.CreateDate,
// GoodsId = courseModel.MallGoodsId, GoodsId = courseModel.MallGoodsId,
// Id = 0, Id = 0,
// GoodsNumbers = item.GoodsNumbers, GoodsNumbers = item.GoodsNumbers,
// GoodsWeight = item.GoodsWeight, GoodsWeight = item.GoodsWeight,
// InventoryNum = item.InventoryNum, InventoryNum = item.InventoryNum,
// MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
// SellingPrice = item.SellingPrice, SellingPrice = item.SellingPrice,
// SpecificationSort = item.SpecificationSort, SpecificationSort = item.SpecificationSort,
// Status = 0, Status = 0,
// TenantId = demodel.TenantId, TenantId = demodel.TenantId,
// UpdateDate = demodel.UpdateDate, UpdateDate = demodel.UpdateDate,
// Commission = item.Commission, Commission = item.Commission,
// CostMoney = item.CostMoney CostMoney = item.CostMoney
// }); });
// } }
// #endregion #endregion
// } }
// else else
// { {
// var svlist = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsId = courseModel.MallGoodsId, TenantId = Convert.ToInt32(Config.JHTenantId), MallBaseId = Convert.ToInt32(Config.JHMallBaseId) }); 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) }); 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)) if (svlist != null && svlist.Any(x => x.ClassId == model.ClassId))
// { {
// var svModel = svlist.Where(x => x.ClassId == model.ClassId).FirstOrDefault(); var svModel = svlist.Where(x => x.ClassId == model.ClassId).FirstOrDefault();
// var spModel = splist.Where(x => x.SortNum == svModel.Sort).FirstOrDefault(); var spModel = splist.Where(x => x.SortNum == svModel.Sort).FirstOrDefault();
// if (svModel != null && svModel.Id > 0) if (svModel != null && svModel.Id > 0)
// { {
// goods_SpecificationValueRepository.Delete(svModel); goods_SpecificationValueRepository.Delete(svModel);
// } }
// if (spModel != null && spModel.Id > 0) if (spModel != null && spModel.Id > 0)
// { {
// goods_SpecificationPriceRepository.Delete(spModel); goods_SpecificationPriceRepository.Delete(spModel);
// } }
// } }
// } }
// } }
// return flag; return flag;
//} }
#endregion #endregion
......
...@@ -304,12 +304,12 @@ namespace Edu.Module.Course ...@@ -304,12 +304,12 @@ namespace Edu.Module.Course
} }
if (model.SalePlatList != null && model.SalePlatList.Any(x => x == 4))//上架小程序端,则要同步到小程序 if (model.SalePlatList != null && model.SalePlatList.Any(x => x == 4))//上架小程序端,则要同步到小程序
{ {
//int GoodsId = SetMallGoods(model);//新增字段保存返回电商商品ID int GoodsId = SetMallGoods(model);//新增字段保存返回电商商品ID
//Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
//{ {
// {nameof(RB_Course_ViewModel.MallGoodsId),GoodsId }, {nameof(RB_Course_ViewModel.MallGoodsId),GoodsId },
//}; };
//flag = courseRepository.Update(fileds, new WhereHelper(nameof(RB_Course_ViewModel.CourseId), model.CourseId)); flag = courseRepository.Update(fileds, new WhereHelper(nameof(RB_Course_ViewModel.CourseId), model.CourseId));
} }
if (model.MallGoodsId > 0 && !model.SalePlatList.Any(x => x == 4))//之前上架了小程序端,现在取消了则下架商品 if (model.MallGoodsId > 0 && !model.SalePlatList.Any(x => x == 4))//之前上架了小程序端,现在取消了则下架商品
{ {
...@@ -1558,7 +1558,7 @@ namespace Edu.Module.Course ...@@ -1558,7 +1558,7 @@ namespace Edu.Module.Course
if (flag && courseModel.SalePlatList != null && courseModel.SalePlatList.Any(x => x == 4))//上架小程序端,则要同步到小程序 if (flag && courseModel.SalePlatList != null && courseModel.SalePlatList.Any(x => x == 4))//上架小程序端,则要同步到小程序
{ {
// System.Threading.Tasks.Task.Run(() => UpdateMallGoodsPrice(courseModel, list)); System.Threading.Tasks.Task.Run(() => UpdateMallGoodsPrice(courseModel, list));
} }
return flag; return flag;
} }
...@@ -1608,540 +1608,540 @@ namespace Edu.Module.Course ...@@ -1608,540 +1608,540 @@ namespace Edu.Module.Course
#region 小程序商品 #region 小程序商品
//public int SetMallGoods(RB_Course_ViewModel model) public int SetMallGoods(RB_Course_ViewModel model)
//{ {
// int goodsId = 0; int goodsId = 0;
// 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();
// if (model.MallGoodsId > 0) if (model.MallGoodsId > 0)
// { {
// demodel = mallGoodsRepository.GetGoodsList(new Model.ViewModel.Mall.RB_Goods_Extend { Id = model.MallGoodsId }).FirstOrDefault(); demodel = mallGoodsRepository.GetGoodsList(new Model.ViewModel.Mall.RB_Goods_Extend { Id = model.MallGoodsId }).FirstOrDefault();
// if (demodel == null || demodel.Id == 0)//不存在 if (demodel == null || demodel.Id == 0)//不存在
// { {
// demodel = new Model.ViewModel.Mall.RB_Goods_Extend(); demodel = new Model.ViewModel.Mall.RB_Goods_Extend();
// } }
// } }
// demodel.CarouselImageList = new List<Model.ViewModel.Mall.RB_ImageCommonModel>(); demodel.CarouselImageList = new List<Model.ViewModel.Mall.RB_ImageCommonModel>();
// if (!string.IsNullOrWhiteSpace(model.CoverImg)) if (!string.IsNullOrWhiteSpace(model.CoverImg))
// { {
// demodel.CarouselImageList.Add(new Model.ViewModel.Mall.RB_ImageCommonModel demodel.CarouselImageList.Add(new Model.ViewModel.Mall.RB_ImageCommonModel
// { {
// Id = 0, Id = 0,
// Name = "", Name = "",
// Path = model.CoverImg, Path = model.CoverImg,
// Type = 0 Type = 0
// }); });
// demodel.CarouselImage = JsonHelper.Serialize(demodel.CarouselImageList.Select(x => x.Path)); demodel.CarouselImage = JsonHelper.Serialize(demodel.CarouselImageList.Select(x => x.Path));
// } }
// demodel.Name = model.CourseName; demodel.Name = model.CourseName;
// demodel.Remark ??= model.CourseFeature; demodel.Remark ??= model.CourseFeature;
// demodel.VideoAddress = ""; demodel.VideoAddress = "";
// demodel.CustomShareTitles = ""; demodel.CustomShareTitles = "";
// demodel.CustomShareImage = ""; demodel.CustomShareImage = "";
// demodel.GoodsStatus = 1; demodel.GoodsStatus = 1;
// demodel.InventoryNum = 100;// demodel.InventoryNum = 100;//
// demodel.DefaultSpecificationName = ""; demodel.DefaultSpecificationName = "";
// demodel.SellingPrice = model.SellPrice; demodel.SellingPrice = model.SellPrice;
// demodel.OriginalPrice = model.OriginalPrice; demodel.OriginalPrice = model.OriginalPrice;
// demodel.Unit = "课";// demodel.Unit = "课";//
// demodel.CostPrice = 0;// demodel.CostPrice = 0;//
// demodel.IsGoodsNegotiable = 0; demodel.IsGoodsNegotiable = 0;
// demodel.SalesNum = 0; demodel.SalesNum = 0;
// demodel.GoodsNumbers = ""; demodel.GoodsNumbers = "";
// demodel.IsCustomSpecification = 1;// demodel.IsCustomSpecification = 1;//
// demodel.GoodsWeight = 0; demodel.GoodsWeight = 0;
// demodel.IsDefaultService = 1; demodel.IsDefaultService = 1;
// demodel.FreightId = -1; demodel.FreightId = -1;
// demodel.FormsId = 1; demodel.FormsId = 1;
// demodel.LimitBuyGoodsNum = -1; demodel.LimitBuyGoodsNum = -1;
// demodel.LimitBuyOrderNum = -1; demodel.LimitBuyOrderNum = -1;
// demodel.IsAreaBuy = 0; demodel.IsAreaBuy = 0;
// demodel.IntegralPresent = 0; demodel.IntegralPresent = 0;
// demodel.IntegralPresentType = 2; demodel.IntegralPresentType = 2;
// demodel.PointsDeduction = 0; demodel.PointsDeduction = 0;
// demodel.PointsDeductionType = 2; demodel.PointsDeductionType = 2;
// demodel.IsMultipleDeduction = 2; demodel.IsMultipleDeduction = 2;
// demodel.GoodsDetails = model.CourseIntro; demodel.GoodsDetails = model.CourseIntro;
// demodel.SeparateDistribution = 0;// demodel.SeparateDistribution = 0;//
// demodel.SeparateDistributionType = 1; demodel.SeparateDistributionType = 1;
// demodel.SeparateDistributionMoneyType = 2; demodel.SeparateDistributionMoneyType = 2;
// demodel.EnjoyMember = 1; demodel.EnjoyMember = 1;
// demodel.SeparateSetMember = 0; demodel.SeparateSetMember = 0;
// demodel.IsQuickBuy = 1; demodel.IsQuickBuy = 1;
// demodel.FullNumPinkage = 0; demodel.FullNumPinkage = 0;
// demodel.FullMoneyPinkage = 0; demodel.FullMoneyPinkage = 0;
// demodel.SupplierId = 0; demodel.SupplierId = 0;
// demodel.Sort = 1; demodel.Sort = 1;
// demodel.Commission = 0; demodel.Commission = 0;
// demodel.SendArea = ""; demodel.SendArea = "";
// demodel.VideoType = 1; demodel.VideoType = 1;
// demodel.GoodsPageType = 0; demodel.GoodsPageType = 0;
// demodel.IsNoTax = 0; demodel.IsNoTax = 0;
// demodel.GoodsCountry = ""; demodel.GoodsCountry = "";
// demodel.FatCode = ""; demodel.FatCode = "";
// demodel.GoodsUrl = ""; demodel.GoodsUrl = "";
// demodel.goodsLogo = ""; demodel.goodsLogo = "";
// demodel.SeparateDistributionMoneyType ??= 1; demodel.SeparateDistributionMoneyType ??= 1;
// demodel.EnjoyMember ??= 2; demodel.EnjoyMember ??= 2;
// demodel.SeparateSetMember ??= 2; demodel.SeparateSetMember ??= 2;
// demodel.IsQuickBuy ??= 2; demodel.IsQuickBuy ??= 2;
// demodel.IsSellWell ??= 2; demodel.IsSellWell ??= 2;
// demodel.GoodsType ??= OrderTypeEnum.Mall; demodel.GoodsType ??= OrderTypeEnum.Mall;
// demodel.GoodsStatus ??= 2; demodel.GoodsStatus ??= 2;
// demodel.IsProxy ??= 2; demodel.IsProxy ??= 2;
// demodel.ProxyType ??= 1; demodel.ProxyType ??= 1;
// demodel.ProxyRises ??= 0; demodel.ProxyRises ??= 0;
// demodel.ProxyMoney ??= 0; demodel.ProxyMoney ??= 0;
// demodel.IsProcurement = 2;//新增时 demodel.IsProcurement = 2;//新增时
// demodel.PresentFXGrade ??= 0;//赠送粉象等级 demodel.PresentFXGrade ??= 0;//赠送粉象等级
// demodel.PresentFXMonth ??= 0; demodel.PresentFXMonth ??= 0;
// demodel.Advertising ??= "";//广告词 demodel.Advertising ??= "";//广告词
// demodel.SubName ??= "";//副标题 demodel.SubName ??= "";//副标题
// demodel.IsLiveGoods ??= 2;//是否直播商品 1是 2否 demodel.IsLiveGoods ??= 2;//是否直播商品 1是 2否
// demodel.SendArea ??= "";//发货地 demodel.SendArea ??= "";//发货地
// demodel.GoodsClassify = 0; demodel.GoodsClassify = 0;
// demodel.IntegralComment ??= 0;//评论反积分 demodel.IntegralComment ??= 0;//评论反积分
// demodel.IntegralCommentType ??= 1; demodel.IntegralCommentType ??= 1;
// demodel.GoodsPageType ??= GoodsPageTypeEnum.All; demodel.GoodsPageType ??= GoodsPageTypeEnum.All;
// demodel.TenantId = Convert.ToInt32(Config.JHTenantId); demodel.TenantId = Convert.ToInt32(Config.JHTenantId);
// demodel.MallBaseId = Convert.ToInt32(Config.JHMallBaseId); demodel.MallBaseId = Convert.ToInt32(Config.JHMallBaseId);
// #region 商品规格信息 #region 商品规格信息
// 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>();
// 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;
// modelSpecification.Name = "开班日期"; modelSpecification.Name = "开班日期";
// modelSpecification.Sort = 1; modelSpecification.Sort = 1;
// modelSpecification.SpecificationValueList = new List<RB_Goods_SpecificationValue_Extend>(); modelSpecification.SpecificationValueList = new List<RB_Goods_SpecificationValue_Extend>();
// //查询课程对应班级开课时间大于今天的班级 //查询课程对应班级开课时间大于今天的班级
// var classList = classRepository.GetClassAndCourseListRepository(new RB_Class_ViewModel { CouseId = model.CourseId, StartTime = System.DateTime.Now.ToString("yyyy-MM-dd") }).Where(x => x.ClassStatus == Common.Enum.Course.ClassStatusEnum.NonOpenClass && x.OpenTime > System.DateTime.Now).ToList(); var classList = classRepository.GetClassAndCourseListRepository(new RB_Class_ViewModel { CouseId = model.CourseId, 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()) if (classList != null && classList.Any())
// { {
// int Sort = 1; int Sort = 1;
// foreach (var item in classList) foreach (var item in classList)
// { {
// RB_Goods_SpecificationValue_Extend modelSpecificationValue = new RB_Goods_SpecificationValue_Extend(); RB_Goods_SpecificationValue_Extend modelSpecificationValue = new RB_Goods_SpecificationValue_Extend();
// modelSpecificationValue.Id = 0; modelSpecificationValue.Id = 0;
// modelSpecificationValue.Image = ""; modelSpecificationValue.Image = "";
// modelSpecificationValue.ImagePath = ""; modelSpecificationValue.ImagePath = "";
// modelSpecificationValue.Name = item.OpenTime.ToString("MM月dd日"); modelSpecificationValue.Name = item.OpenTime.ToString("MM月dd日");
// modelSpecificationValue.Sort = Sort;///暂定1 modelSpecificationValue.Sort = Sort;///暂定1
// modelSpecificationValue.ClassId = item.ClassId; modelSpecificationValue.ClassId = item.ClassId;
// modelSpecification.SpecificationValueList.Add(modelSpecificationValue); modelSpecification.SpecificationValueList.Add(modelSpecificationValue);
// RB_Goods_SpecificationPrice_Extend pModel = new RB_Goods_SpecificationPrice_Extend() RB_Goods_SpecificationPrice_Extend pModel = new RB_Goods_SpecificationPrice_Extend()
// { {
// Commission = 0, Commission = 0,
// CostMoney = 0, CostMoney = 0,
// GoodsNumbers = item.ClassNo, GoodsNumbers = item.ClassNo,
// 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);
// Sort += 1; Sort += 1;
// } }
// } }
// demodel.SpecificationList.Add(modelSpecification); demodel.SpecificationList.Add(modelSpecification);
// #endregion #endregion
// if (demodel.Id == 0)//已存在,更新 if (demodel.Id == 0)//已存在,更新
// { {
// demodel.Status = 0; demodel.Status = 0;
// demodel.CreateDate = System.DateTime.Now; demodel.CreateDate = System.DateTime.Now;
// demodel.UpdateDate = System.DateTime.Now; demodel.UpdateDate = System.DateTime.Now;
// goodsId = mallGoodsRepository.Insert(demodel); goodsId = mallGoodsRepository.Insert(demodel);
// if (goodsId > 0) if (goodsId > 0)
// { {
// //插入分类 //插入分类
// foreach (var item in model.CategoryList) foreach (var item in model.CategoryList)
// { {
// MallGoodsCategoryRepository.Insert(new RB_Goods_Category() MallGoodsCategoryRepository.Insert(new RB_Goods_Category()
// { {
// CategoryId = item.CategoryId, CategoryId = item.CategoryId,
// CreateDate = demodel.CreateDate, CreateDate = demodel.CreateDate,
// GoodsId = goodsId, GoodsId = goodsId,
// Id = 0, Id = 0,
// MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
// Status = 0, Status = 0,
// TenantId = demodel.TenantId TenantId = demodel.TenantId
// }); });
// } }
// } }
// } }
// else else
// { //修改 { //修改
// Dictionary<string, object> keyValues = new Dictionary<string, object>() { Dictionary<string, object> keyValues = new Dictionary<string, object>() {
// { nameof(RB_Goods.Name),demodel.Name}, { nameof(RB_Goods.Name),demodel.Name},
// { nameof(RB_Goods.CarouselImage),demodel.CarouselImage}, { nameof(RB_Goods.CarouselImage),demodel.CarouselImage},
// { nameof(RB_Goods.VideoAddress),demodel.VideoAddress}, { nameof(RB_Goods.VideoAddress),demodel.VideoAddress},
// { nameof(RB_Goods.CustomShareTitles),demodel.CustomShareTitles}, { nameof(RB_Goods.CustomShareTitles),demodel.CustomShareTitles},
// { nameof(RB_Goods.CustomShareImage),demodel.CustomShareImage}, { nameof(RB_Goods.CustomShareImage),demodel.CustomShareImage},
// { nameof(RB_Goods.GoodsStatus),demodel.GoodsStatus}, { nameof(RB_Goods.GoodsStatus),demodel.GoodsStatus},
// { nameof(RB_Goods.InventoryNum),demodel.InventoryNum}, { nameof(RB_Goods.InventoryNum),demodel.InventoryNum},
// { nameof(RB_Goods.DefaultSpecificationName),demodel.DefaultSpecificationName}, { nameof(RB_Goods.DefaultSpecificationName),demodel.DefaultSpecificationName},
// { nameof(RB_Goods.IsCustomSpecification),demodel.IsCustomSpecification}, { nameof(RB_Goods.IsCustomSpecification),demodel.IsCustomSpecification},
// { nameof(RB_Goods.Sort),demodel.Sort}, { nameof(RB_Goods.Sort),demodel.Sort},
// { nameof(RB_Goods.SellingPrice),demodel.SellingPrice}, { nameof(RB_Goods.SellingPrice),demodel.SellingPrice},
// { nameof(RB_Goods.OriginalPrice),demodel.OriginalPrice}, { nameof(RB_Goods.OriginalPrice),demodel.OriginalPrice},
// { nameof(RB_Goods.Unit),demodel.Unit}, { nameof(RB_Goods.Unit),demodel.Unit},
// { nameof(RB_Goods.CostPrice),demodel.CostPrice}, { nameof(RB_Goods.CostPrice),demodel.CostPrice},
// { nameof(RB_Goods.IsGoodsNegotiable),demodel.IsGoodsNegotiable}, { nameof(RB_Goods.IsGoodsNegotiable),demodel.IsGoodsNegotiable},
// { nameof(RB_Goods.SalesNum),demodel.SalesNum}, { nameof(RB_Goods.SalesNum),demodel.SalesNum},
// { nameof(RB_Goods.GoodsNumbers),demodel.GoodsNumbers}, { nameof(RB_Goods.GoodsNumbers),demodel.GoodsNumbers},
// { nameof(RB_Goods.GoodsWeight),demodel.GoodsWeight}, { nameof(RB_Goods.GoodsWeight),demodel.GoodsWeight},
// { nameof(RB_Goods.IsDefaultService),demodel.IsDefaultService}, { nameof(RB_Goods.IsDefaultService),demodel.IsDefaultService},
// { nameof(RB_Goods.GoodsService),demodel.GoodsService}, { nameof(RB_Goods.GoodsService),demodel.GoodsService},
// { nameof(RB_Goods.FreightId),demodel.FreightId}, { nameof(RB_Goods.FreightId),demodel.FreightId},
// { nameof(RB_Goods.FormsId),demodel.FormsId}, { nameof(RB_Goods.FormsId),demodel.FormsId},
// { nameof(RB_Goods.LimitBuyGoodsNum),demodel.LimitBuyGoodsNum}, { nameof(RB_Goods.LimitBuyGoodsNum),demodel.LimitBuyGoodsNum},
// { nameof(RB_Goods.LimitBuyOrderNum),demodel.LimitBuyOrderNum}, { nameof(RB_Goods.LimitBuyOrderNum),demodel.LimitBuyOrderNum},
// { nameof(RB_Goods.FullNumPinkage),demodel.FullNumPinkage}, { nameof(RB_Goods.FullNumPinkage),demodel.FullNumPinkage},
// { nameof(RB_Goods.FullMoneyPinkage),demodel.FullMoneyPinkage}, { nameof(RB_Goods.FullMoneyPinkage),demodel.FullMoneyPinkage},
// { nameof(RB_Goods.IsAreaBuy),demodel.IsAreaBuy}, { nameof(RB_Goods.IsAreaBuy),demodel.IsAreaBuy},
// { nameof(RB_Goods.IntegralPresent),demodel.IntegralPresent}, { nameof(RB_Goods.IntegralPresent),demodel.IntegralPresent},
// { nameof(RB_Goods.IntegralPresentType),demodel.IntegralPresentType}, { nameof(RB_Goods.IntegralPresentType),demodel.IntegralPresentType},
// { nameof(RB_Goods.PointsDeduction),demodel.PointsDeduction}, { nameof(RB_Goods.PointsDeduction),demodel.PointsDeduction},
// { nameof(RB_Goods.PointsDeductionType),demodel.PointsDeductionType}, { nameof(RB_Goods.PointsDeductionType),demodel.PointsDeductionType},
// { nameof(RB_Goods.IsMultipleDeduction),demodel.IsMultipleDeduction}, { nameof(RB_Goods.IsMultipleDeduction),demodel.IsMultipleDeduction},
// { nameof(RB_Goods.GoodsDetails),demodel.GoodsDetails}, { nameof(RB_Goods.GoodsDetails),demodel.GoodsDetails},
// { nameof(RB_Goods.UpdateDate),demodel.UpdateDate}, { nameof(RB_Goods.UpdateDate),demodel.UpdateDate},
// { nameof(RB_Goods.SeparateDistribution),demodel.SeparateDistribution}, { nameof(RB_Goods.SeparateDistribution),demodel.SeparateDistribution},
// { nameof(RB_Goods.SeparateDistributionType),demodel.SeparateDistributionType}, { nameof(RB_Goods.SeparateDistributionType),demodel.SeparateDistributionType},
// { nameof(RB_Goods.SeparateDistributionMoneyType),demodel.SeparateDistributionMoneyType}, { nameof(RB_Goods.SeparateDistributionMoneyType),demodel.SeparateDistributionMoneyType},
// { nameof(RB_Goods.EnjoyMember),demodel.EnjoyMember}, { nameof(RB_Goods.EnjoyMember),demodel.EnjoyMember},
// { nameof(RB_Goods.SeparateSetMember),demodel.SeparateSetMember}, { nameof(RB_Goods.SeparateSetMember),demodel.SeparateSetMember},
// { nameof(RB_Goods.IsQuickBuy),demodel.IsQuickBuy}, { nameof(RB_Goods.IsQuickBuy),demodel.IsQuickBuy},
// { nameof(RB_Goods.SupplierId),demodel.SupplierId}, { nameof(RB_Goods.SupplierId),demodel.SupplierId},
// { nameof(RB_Goods.IsProxy),demodel.IsProxy}, { nameof(RB_Goods.IsProxy),demodel.IsProxy},
// { nameof(RB_Goods.ProxyType),demodel.ProxyType}, { nameof(RB_Goods.ProxyType),demodel.ProxyType},
// { nameof(RB_Goods.ProxyRises),demodel.ProxyRises}, { nameof(RB_Goods.ProxyRises),demodel.ProxyRises},
// { nameof(RB_Goods.ProxyMoney),demodel.ProxyMoney}, { nameof(RB_Goods.ProxyMoney),demodel.ProxyMoney},
// { nameof(RB_Goods.Commission),demodel.Commission}, { nameof(RB_Goods.Commission),demodel.Commission},
// { nameof(RB_Goods.PresentFXGrade),demodel.PresentFXGrade}, { nameof(RB_Goods.PresentFXGrade),demodel.PresentFXGrade},
// { nameof(RB_Goods.PresentFXMonth),demodel.PresentFXMonth}, { nameof(RB_Goods.PresentFXMonth),demodel.PresentFXMonth},
// { nameof(RB_Goods.Advertising),demodel.Advertising}, { nameof(RB_Goods.Advertising),demodel.Advertising},
// { nameof(RB_Goods.SubName),demodel.SubName}, { nameof(RB_Goods.SubName),demodel.SubName},
// { nameof(RB_Goods.MarketingLogo),demodel.MarketingLogo}, { nameof(RB_Goods.MarketingLogo),demodel.MarketingLogo},
// { nameof(RB_Goods.IsLiveGoods),demodel.IsLiveGoods}, { nameof(RB_Goods.IsLiveGoods),demodel.IsLiveGoods},
// { nameof(RB_Goods.ShelvesDate),demodel.ShelvesDate }, { nameof(RB_Goods.ShelvesDate),demodel.ShelvesDate },
// { nameof(RB_Goods.DownDate),demodel.DownDate }, { nameof(RB_Goods.DownDate),demodel.DownDate },
// { nameof(RB_Goods.SendArea),demodel.SendArea }, { nameof(RB_Goods.SendArea),demodel.SendArea },
// { nameof(RB_Goods.VideoType),demodel.VideoType }, { nameof(RB_Goods.VideoType),demodel.VideoType },
// { nameof(RB_Goods.IntegralComment),demodel.IntegralComment }, { nameof(RB_Goods.IntegralComment),demodel.IntegralComment },
// { nameof(RB_Goods.IntegralCommentType),demodel.IntegralCommentType }, { nameof(RB_Goods.IntegralCommentType),demodel.IntegralCommentType },
// { nameof(RB_Goods.Remark),demodel.Remark }, { nameof(RB_Goods.Remark),demodel.Remark },
// { nameof(RB_Goods.GoodsPageType),demodel.GoodsPageType }, { nameof(RB_Goods.GoodsPageType),demodel.GoodsPageType },
// { nameof(RB_Goods.IsNoTax),demodel.IsNoTax }, { nameof(RB_Goods.IsNoTax),demodel.IsNoTax },
// { nameof(RB_Goods.MinProfitRate),demodel.MinProfitRate }, { nameof(RB_Goods.MinProfitRate),demodel.MinProfitRate },
// { nameof(RB_Goods.GoodsCountry),demodel.GoodsCountry }, { nameof(RB_Goods.GoodsCountry),demodel.GoodsCountry },
// { nameof(RB_Goods.FatCode),demodel.FatCode }, { nameof(RB_Goods.FatCode),demodel.FatCode },
// { nameof(RB_Goods.GoodsUrl),demodel.GoodsUrl }, { nameof(RB_Goods.GoodsUrl),demodel.GoodsUrl },
// { nameof(RB_Goods.goodsLogo),demodel.goodsLogo }, { nameof(RB_Goods.goodsLogo),demodel.goodsLogo },
// }; };
// List<WhereHelper> wheres = new List<WhereHelper>() { List<WhereHelper> wheres = new List<WhereHelper>() {
// new WhereHelper(){ new WhereHelper(){
// FiledName=nameof(RB_Goods.Id), FiledName=nameof(RB_Goods.Id),
// FiledValue=demodel.Id, FiledValue=demodel.Id,
// OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
// }, },
// new WhereHelper(){ new WhereHelper(){
// FiledName=nameof(RB_Goods.TenantId), FiledName=nameof(RB_Goods.TenantId),
// FiledValue=demodel.TenantId, FiledValue=demodel.TenantId,
// OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
// }, },
// new WhereHelper(){ new WhereHelper(){
// FiledName=nameof(RB_Goods.MallBaseId), FiledName=nameof(RB_Goods.MallBaseId),
// FiledValue=demodel.MallBaseId, FiledValue=demodel.MallBaseId,
// OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
// } }
// }; };
// bool flag = mallGoodsRepository.Update(keyValues, wheres); bool flag = mallGoodsRepository.Update(keyValues, wheres);
// if (flag) if (flag)
// { {
// #region 删除规格 #region 删除规格
// var slist = goods_SpecificationRepository.GetList(new RB_Goods_Specification_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); 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 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 }); var splist = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
// if (slist != null && slist.Any()) if (slist != null && slist.Any())
// { {
// //删除后新增 //删除后新增
// goods_SpecificationRepository.DeleteBatch(slist); goods_SpecificationRepository.DeleteBatch(slist);
// } }
// if (svlist != null && svlist.Any()) if (svlist != null && svlist.Any())
// { {
// goods_SpecificationValueRepository.DeleteBatch(svlist); goods_SpecificationValueRepository.DeleteBatch(svlist);
// } }
// if (splist != null && splist.Any()) if (splist != null && splist.Any())
// { {
// goods_SpecificationPriceRepository.DeleteBatch(splist); goods_SpecificationPriceRepository.DeleteBatch(splist);
// } }
// #endregion #endregion
// #region 修改分类 #region 修改分类
// var clist = MallGoodsCategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); var clist = MallGoodsCategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsId = demodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
// var insertList = model.CategoryList.Where(x => !clist.Select(y => y.CategoryId).Contains(x.CategoryId)).ToList(); var insertList = model.CategoryList.Where(x => !clist.Select(y => y.CategoryId).Contains(x.CategoryId)).ToList();
// var deleteList = clist.Where(x => !model.CategoryList.Select(y => y.CategoryId).Contains(x.CategoryId)).ToList(); var deleteList = clist.Where(x => !model.CategoryList.Select(y => y.CategoryId).Contains(x.CategoryId)).ToList();
// foreach (var item in insertList) foreach (var item in insertList)
// { {
// MallGoodsCategoryRepository.Insert(new RB_Goods_Category() MallGoodsCategoryRepository.Insert(new RB_Goods_Category()
// { {
// CategoryId = item.CategoryId, CategoryId = item.CategoryId,
// CreateDate = demodel.CreateDate, CreateDate = demodel.CreateDate,
// GoodsId = demodel.Id, GoodsId = demodel.Id,
// Id = 0, Id = 0,
// MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
// Status = 0, Status = 0,
// TenantId = demodel.TenantId TenantId = demodel.TenantId
// }); });
// } }
// foreach (var item in deleteList) foreach (var item in deleteList)
// { {
// MallGoodsCategoryRepository.Delete(item.Id); MallGoodsCategoryRepository.Delete(item.Id);
// } }
// #endregion #endregion
// } }
// goodsId = demodel.Id; goodsId = demodel.Id;
// } }
// //插入规格 //插入规格
// if (demodel.IsCustomSpecification == 1) if (demodel.IsCustomSpecification == 1)
// { {
// foreach (var item in demodel.SpecificationList) foreach (var item in demodel.SpecificationList)
// { {
// int sid = goods_SpecificationRepository.Insert(new RB_Goods_Specification() int sid = goods_SpecificationRepository.Insert(new RB_Goods_Specification()
// { {
// CreateDate = demodel.CreateDate, CreateDate = demodel.CreateDate,
// EnabledImage = item.EnabledImage, EnabledImage = item.EnabledImage,
// GoodsId = goodsId, GoodsId = goodsId,
// Id = 0, Id = 0,
// MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
// Name = item.Name, Name = item.Name,
// Sort = item.Sort, Sort = item.Sort,
// Status = 0, Status = 0,
// TenantId = demodel.TenantId TenantId = demodel.TenantId
// }); });
// if (sid > 0) if (sid > 0)
// { {
// foreach (var qitem in item.SpecificationValueList) foreach (var qitem in item.SpecificationValueList)
// { {
// goods_SpecificationValueRepository.Insert(new RB_Goods_SpecificationValue() goods_SpecificationValueRepository.Insert(new RB_Goods_SpecificationValue()
// { {
// CreateDate = demodel.CreateDate, CreateDate = demodel.CreateDate,
// GoodsId = goodsId, GoodsId = goodsId,
// Id = 0, Id = 0,
// Image = qitem.Image, Image = qitem.Image,
// MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
// Name = qitem.Name, Name = qitem.Name,
// Sort = qitem.Sort, Sort = qitem.Sort,
// Status = 0, Status = 0,
// TenantId = demodel.TenantId, TenantId = demodel.TenantId,
// SpecificationId = sid, SpecificationId = sid,
// ClassId = qitem.ClassId ClassId = qitem.ClassId
// }); });
// } }
// } }
// } }
// foreach (var item in demodel.SpecificationPriceList) foreach (var item in demodel.SpecificationPriceList)
// { {
// goods_SpecificationPriceRepository.Insert(new RB_Goods_SpecificationPrice() goods_SpecificationPriceRepository.Insert(new RB_Goods_SpecificationPrice()
// { {
// CreateDate = demodel.CreateDate, CreateDate = demodel.CreateDate,
// GoodsId = goodsId, GoodsId = goodsId,
// Id = 0, Id = 0,
// GoodsNumbers = item.GoodsNumbers, GoodsNumbers = item.GoodsNumbers,
// GoodsWeight = item.GoodsWeight, GoodsWeight = item.GoodsWeight,
// InventoryNum = item.InventoryNum, InventoryNum = item.InventoryNum,
// MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
// SellingPrice = item.SellingPrice, SellingPrice = item.SellingPrice,
// SpecificationSort = item.SpecificationSort, SpecificationSort = item.SpecificationSort,
// Status = 0, Status = 0,
// TenantId = demodel.TenantId, TenantId = demodel.TenantId,
// UpdateDate = demodel.UpdateDate, UpdateDate = demodel.UpdateDate,
// Commission = item.Commission, Commission = item.Commission,
// CostMoney = item.CostMoney CostMoney = item.CostMoney
// }); });
// } }
// } }
// #region 商品优惠价格 #region 商品优惠价格
// var oldList = MallGoodsPreferentialRepository.GetGoodsPreferentialListRepostory(new RB_Goods_Preferential_Extend() { GoodsId = goodsId }); var oldList = MallGoodsPreferentialRepository.GetGoodsPreferentialListRepostory(new RB_Goods_Preferential_Extend() { GoodsId = goodsId });
// List<RB_Goods_Preferential_Extend> goodsPreferentialLsit = new List<RB_Goods_Preferential_Extend>(); List<RB_Goods_Preferential_Extend> goodsPreferentialLsit = new List<RB_Goods_Preferential_Extend>();
// if (model.PreferentialList!=null&& model.PreferentialList.Any()) if (model.PreferentialList != null && model.PreferentialList.Any())
// { {
// foreach (var item in model.PreferentialList) foreach (var item in model.PreferentialList)
// { {
// RB_Goods_Preferential_Extend goodsPreferential = new RB_Goods_Preferential_Extend() RB_Goods_Preferential_Extend goodsPreferential = new RB_Goods_Preferential_Extend()
// { {
// Id = 0, Id = 0,
// GoodsId = goodsId, GoodsId = goodsId,
// PreferentialTerms = item.PreferentialTerms, PreferentialTerms = item.PreferentialTerms,
// SaleCommissionType = item.SaleCommissionType, SaleCommissionType = item.SaleCommissionType,
// SaleCommissionMoney = item.SaleCommissionMoney, SaleCommissionMoney = item.SaleCommissionMoney,
// B2BCommissionType = item.B2BCommissionType, B2BCommissionType = item.B2BCommissionType,
// B2BCommissionMoney = item.B2BCommissionMoney, B2BCommissionMoney = item.B2BCommissionMoney,
// PriceDiscountType = item.PriceDiscountType, PriceDiscountType = item.PriceDiscountType,
// BuyNum = item.BuyNum, BuyNum = item.BuyNum,
// SendNum = item.SendNum, SendNum = item.SendNum,
// PriceType = item.PriceType, PriceType = item.PriceType,
// PriceMoney = item.PriceMoney, PriceMoney = item.PriceMoney,
// TenantId = Convert.ToInt32(Config.JHTenantId), TenantId = Convert.ToInt32(Config.JHTenantId),
// MallBaseId = Convert.ToInt32(Config.JHMallBaseId), MallBaseId = Convert.ToInt32(Config.JHMallBaseId),
// Status = 0, Status = 0,
// EduCommissionType = item.EduCommissionType, EduCommissionType = item.EduCommissionType,
// EduCommissionMoney = item.EduCommissionMoney EduCommissionMoney = item.EduCommissionMoney
// }; };
// goodsPreferentialLsit.Add(goodsPreferential); goodsPreferentialLsit.Add(goodsPreferential);
// } }
// } }
// if (oldList == null || !oldList.Any()) if (oldList == null || !oldList.Any())
// { {
// foreach (var item in goodsPreferentialLsit) foreach (var item in goodsPreferentialLsit)
// { {
// MallGoodsPreferentialRepository.Insert(item); MallGoodsPreferentialRepository.Insert(item);
// } }
// } }
// //原来有优惠数据 //原来有优惠数据
// else else
// { {
// if (model.PreferentialList == null || (model.PreferentialList != null && model.PreferentialList.Count == 0)) if (model.PreferentialList == null || (model.PreferentialList != null && model.PreferentialList.Count == 0))
// { {
// MallGoodsPreferentialRepository.DeleteGoodsPreferentialRepostory(goodsId); MallGoodsPreferentialRepository.DeleteGoodsPreferentialRepostory(goodsId);
// } }
// else else
// { {
// //找出差异的数据 //找出差异的数据
// var deleteList = oldList.Where(qitem => !goodsPreferentialLsit.Any(oldItem => qitem.PriceDiscountType == oldItem.PriceDiscountType)).ToList(); var deleteList = oldList.Where(qitem => !goodsPreferentialLsit.Any(oldItem => qitem.PriceDiscountType == oldItem.PriceDiscountType)).ToList();
// foreach (var dItem in deleteList) foreach (var dItem in deleteList)
// { {
// if (dItem.Id > 0) if (dItem.Id > 0)
// { {
// MallGoodsPreferentialRepository.Delete(dItem.Id); MallGoodsPreferentialRepository.Delete(dItem.Id);
// } }
// } }
// foreach (var priceItem in goodsPreferentialLsit) foreach (var priceItem in goodsPreferentialLsit)
// { {
// var nowItem = oldList.Where(x => x.PriceDiscountType == priceItem.PriceDiscountType).FirstOrDefault(); var nowItem = oldList.Where(x => x.PriceDiscountType == priceItem.PriceDiscountType).FirstOrDefault();
// if (nowItem != null && nowItem.Id > 0) if (nowItem != null && nowItem.Id > 0)
// { {
// priceItem.Id = nowItem.Id; priceItem.Id = nowItem.Id;
// } }
// if (priceItem.Id == 0) if (priceItem.Id == 0)
// { {
// MallGoodsPreferentialRepository.Insert(priceItem); MallGoodsPreferentialRepository.Insert(priceItem);
// } }
// else else
// { {
// MallGoodsPreferentialRepository.Update(priceItem); MallGoodsPreferentialRepository.Update(priceItem);
// } }
// } }
// } }
// } }
// #endregion #endregion
// return goodsId; return goodsId;
//} }
///// <summary> /// <summary>
///// 更新商品的售价-卖价;原价-基础收费以及优惠政策 /// 更新商品的售价-卖价;原价-基础收费以及优惠政策
///// </summary> /// </summary>
///// <param name="courseModel"></param> /// <param name="courseModel"></param>
///// <param name="list"></param> /// <param name="list"></param>
///// <returns></returns> /// <returns></returns>
//public bool UpdateMallGoodsPrice(RB_Course_ViewModel courseModel, List<RB_Course_Preferential_Extend> list) public bool UpdateMallGoodsPrice(RB_Course_ViewModel courseModel, List<RB_Course_Preferential_Extend> list)
//{ {
// bool flag = false; bool flag = false;
// Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
// { {
// {nameof(RB_Goods.SellingPrice),courseModel.SellPrice }, {nameof(RB_Goods.SellingPrice),courseModel.SellPrice },
// {nameof(RB_Goods.OriginalPrice),courseModel.OriginalPrice }, {nameof(RB_Goods.OriginalPrice),courseModel.OriginalPrice },
// }; };
// flag = mallGoodsRepository.Update(fileds, new WhereHelper(nameof(RB_Goods.Id), courseModel.MallGoodsId)); flag = mallGoodsRepository.Update(fileds, new WhereHelper(nameof(RB_Goods.Id), courseModel.MallGoodsId));
// var oldList = MallGoodsPreferentialRepository.GetGoodsPreferentialListRepostory(new RB_Goods_Preferential_Extend() { GoodsId = courseModel.MallGoodsId }); var oldList = MallGoodsPreferentialRepository.GetGoodsPreferentialListRepostory(new RB_Goods_Preferential_Extend() { GoodsId = courseModel.MallGoodsId });
// List<RB_Goods_Preferential_Extend> goodsPreferentialLsit = new List<RB_Goods_Preferential_Extend>(); List<RB_Goods_Preferential_Extend> goodsPreferentialLsit = new List<RB_Goods_Preferential_Extend>();
// foreach (var item in list) foreach (var item in list)
// { {
// RB_Goods_Preferential_Extend goodsPreferential = new RB_Goods_Preferential_Extend() RB_Goods_Preferential_Extend goodsPreferential = new RB_Goods_Preferential_Extend()
// { {
// Id = 0, Id = 0,
// GoodsId = courseModel.MallGoodsId, GoodsId = courseModel.MallGoodsId,
// PreferentialTerms = item.PreferentialTerms, PreferentialTerms = item.PreferentialTerms,
// SaleCommissionType = item.SaleCommissionType, SaleCommissionType = item.SaleCommissionType,
// SaleCommissionMoney = item.SaleCommissionMoney, SaleCommissionMoney = item.SaleCommissionMoney,
// B2BCommissionType = item.B2BCommissionType, B2BCommissionType = item.B2BCommissionType,
// B2BCommissionMoney = item.B2BCommissionMoney, B2BCommissionMoney = item.B2BCommissionMoney,
// PriceDiscountType = item.PriceDiscountType, PriceDiscountType = item.PriceDiscountType,
// BuyNum = item.BuyNum, BuyNum = item.BuyNum,
// SendNum = item.SendNum, SendNum = item.SendNum,
// PriceType = item.PriceType, PriceType = item.PriceType,
// PriceMoney = item.PriceMoney, PriceMoney = item.PriceMoney,
// TenantId = Convert.ToInt32(Config.JHTenantId), TenantId = Convert.ToInt32(Config.JHTenantId),
// MallBaseId = Convert.ToInt32(Config.JHMallBaseId), MallBaseId = Convert.ToInt32(Config.JHMallBaseId),
// Status = 0, Status = 0,
// EduCommissionType = item.EduCommissionType, EduCommissionType = item.EduCommissionType,
// EduCommissionMoney = item.EduCommissionMoney EduCommissionMoney = item.EduCommissionMoney
// }; };
// goodsPreferentialLsit.Add(goodsPreferential); goodsPreferentialLsit.Add(goodsPreferential);
// } }
// if (oldList == null || !oldList.Any()) if (oldList == null || !oldList.Any())
// { {
// foreach (var item in goodsPreferentialLsit) foreach (var item in goodsPreferentialLsit)
// { {
// flag = MallGoodsPreferentialRepository.Insert(item) > 0; flag = MallGoodsPreferentialRepository.Insert(item) > 0;
// } }
// } }
// //原来有优惠数据 //原来有优惠数据
// else else
// { {
// if (list == null || (list != null && list.Count == 0)) if (list == null || (list != null && list.Count == 0))
// { {
// flag = MallGoodsPreferentialRepository.DeleteGoodsPreferentialRepostory(courseModel.MallGoodsId); flag = MallGoodsPreferentialRepository.DeleteGoodsPreferentialRepostory(courseModel.MallGoodsId);
// } }
// else else
// { {
// //找出差异的数据 //找出差异的数据
// var deleteList = oldList.Where(qitem => !goodsPreferentialLsit.Any(oldItem => qitem.PriceDiscountType == oldItem.PriceDiscountType)).ToList(); var deleteList = oldList.Where(qitem => !goodsPreferentialLsit.Any(oldItem => qitem.PriceDiscountType == oldItem.PriceDiscountType)).ToList();
// foreach (var dItem in deleteList) foreach (var dItem in deleteList)
// { {
// if (dItem.Id > 0) if (dItem.Id > 0)
// { {
// flag = MallGoodsPreferentialRepository.Delete(dItem.Id) > 0; flag = MallGoodsPreferentialRepository.Delete(dItem.Id) > 0;
// } }
// } }
// foreach (var priceItem in goodsPreferentialLsit) foreach (var priceItem in goodsPreferentialLsit)
// { {
// var nowItem = oldList.Where(x => x.PriceDiscountType == priceItem.PriceDiscountType).FirstOrDefault(); var nowItem = oldList.Where(x => x.PriceDiscountType == priceItem.PriceDiscountType).FirstOrDefault();
// if (nowItem != null && nowItem.Id > 0) if (nowItem != null && nowItem.Id > 0)
// { {
// priceItem.Id = nowItem.Id; priceItem.Id = nowItem.Id;
// } }
// if (priceItem.Id == 0) if (priceItem.Id == 0)
// { {
// flag = MallGoodsPreferentialRepository.Insert(priceItem) > 0; flag = MallGoodsPreferentialRepository.Insert(priceItem) > 0;
// } }
// else else
// { {
// flag = MallGoodsPreferentialRepository.Update(priceItem); flag = MallGoodsPreferentialRepository.Update(priceItem);
// } }
// } }
// } }
// } }
// return flag; return flag;
//} }
#endregion #endregion
} }
......
...@@ -14,6 +14,7 @@ using Edu.Model.ViewModel.Contract; ...@@ -14,6 +14,7 @@ using Edu.Model.ViewModel.Contract;
using Edu.Model.ViewModel.Course; using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.Grade; using Edu.Model.ViewModel.Grade;
using Edu.Model.ViewModel.Log; using Edu.Model.ViewModel.Log;
using Edu.Model.ViewModel.Mall;
using Edu.Model.ViewModel.Reserve; using Edu.Model.ViewModel.Reserve;
using Edu.Model.ViewModel.Sell; using Edu.Model.ViewModel.Sell;
using Edu.Model.ViewModel.StudyAbroad; using Edu.Model.ViewModel.StudyAbroad;
...@@ -27,6 +28,7 @@ using Edu.Repository.Reserve; ...@@ -27,6 +28,7 @@ using Edu.Repository.Reserve;
using Edu.Repository.Sell; using Edu.Repository.Sell;
using Edu.Repository.StudyAbroad; using Edu.Repository.StudyAbroad;
using Edu.Repository.User; using Edu.Repository.User;
using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -205,7 +207,10 @@ namespace Edu.Module.Course ...@@ -205,7 +207,10 @@ namespace Edu.Module.Course
/// 商品规格价格 /// 商品规格价格
/// </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>
private readonly RB_Finance_ConfigRepository finance_ConfigRepository = new RB_Finance_ConfigRepository();
#region 日语培训 #region 日语培训
...@@ -837,7 +842,7 @@ namespace Edu.Module.Course ...@@ -837,7 +842,7 @@ namespace Edu.Module.Course
#region 更新甲鹤小程序规格对应的库存 #region 更新甲鹤小程序规格对应的库存
if (flag && demodel.JoinType != OrderJoinTypeEnum.RenewOrder)//续费订单不去更新规格库存 if (flag && demodel.JoinType != OrderJoinTypeEnum.RenewOrder)//续费订单不去更新规格库存
{ {
// System.Threading.Tasks.Task.Run(() => UpdateClassInventoryNum(demodel)); System.Threading.Tasks.Task.Run(() => UpdateClassInventoryNum(demodel));
} }
#endregion #endregion
} }
...@@ -1260,7 +1265,7 @@ namespace Edu.Module.Course ...@@ -1260,7 +1265,7 @@ namespace Edu.Module.Course
#region 更新甲鹤小程序规格对应的库存 #region 更新甲鹤小程序规格对应的库存
if (flag && orderModel.JoinType != OrderJoinTypeEnum.RenewOrder)//续费订单不去更新规格库存 if (flag && orderModel.JoinType != OrderJoinTypeEnum.RenewOrder)//续费订单不去更新规格库存
{ {
// System.Threading.Tasks.Task.Run(() => UpdateCancelClassOrder(orderModel)); System.Threading.Tasks.Task.Run(() => UpdateCancelClassOrder(orderModel));
} }
#endregion #endregion
} }
...@@ -2845,79 +2850,457 @@ namespace Edu.Module.Course ...@@ -2845,79 +2850,457 @@ namespace Edu.Module.Course
#region 更新甲鹤小程序对应的班级招生人数 #region 更新甲鹤小程序对应的班级招生人数
///// <summary> /// <summary>
///// 下单更新甲鹤小程序规格对应的班级人数 /// 下单更新甲鹤小程序规格对应的班级人数
///// </summary> /// </summary>
///// <param name="demodel"></param> /// <param name="demodel"></param>
///// <returns></returns> /// <returns></returns>
//public bool UpdateClassInventoryNum(RB_Order_ViewModel demodel) public bool UpdateClassInventoryNum(RB_Order_ViewModel demodel)
//{ {
// bool flag = false; bool flag = false;
// var courseModel = courseRepository.GetEntity(demodel.CourseId).RefMapperTo<RB_Course_ViewModel>(); var courseModel = courseRepository.GetEntity(demodel.CourseId).RefMapperTo<RB_Course_ViewModel>();
// if (courseModel != null && courseModel.MallGoodsId > 0) if (courseModel != null && courseModel.MallGoodsId > 0)
// { {
// var svlist = goods_SpecificationValueRepository.GetList(new Edu.Model.ViewModel.Mall.RB_Goods_SpecificationValue_Extend() { GoodsId = courseModel.MallGoodsId, TenantId = Convert.ToInt32(Config.JHTenantId), MallBaseId = Convert.ToInt32(Config.JHMallBaseId) }); var svlist = goods_SpecificationValueRepository.GetList(new Edu.Model.ViewModel.Mall.RB_Goods_SpecificationValue_Extend() { GoodsId = courseModel.MallGoodsId, TenantId = Convert.ToInt32(Config.JHTenantId), MallBaseId = Convert.ToInt32(Config.JHMallBaseId) });
// var splist = goods_SpecificationPriceRepository.GetList(new Edu.Model.ViewModel.Mall.RB_Goods_SpecificationPrice_Extend() { GoodsId = courseModel.MallGoodsId, TenantId = Convert.ToInt32(Config.JHTenantId), MallBaseId = Convert.ToInt32(Config.JHMallBaseId) }); var splist = goods_SpecificationPriceRepository.GetList(new Edu.Model.ViewModel.Mall.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 == demodel.ClassId)) if (svlist != null && svlist.Any(x => x.ClassId == demodel.ClassId))
// { {
// var svModel = svlist.Where(x => x.ClassId == demodel.ClassId).FirstOrDefault(); var svModel = svlist.Where(x => x.ClassId == demodel.ClassId).FirstOrDefault();
// if (svModel != null && svModel.Id > 0) if (svModel != null && svModel.Id > 0)
// { {
// var spModel = splist.Where(x => x.SpecificationSort == svModel.Sort.ToString()).FirstOrDefault(); var spModel = splist.Where(x => x.SpecificationSort == svModel.Sort.ToString()).FirstOrDefault();
// Dictionary<string, object> keyValues = new Dictionary<string, object>() { Dictionary<string, object> keyValues = new Dictionary<string, object>() {
// { nameof(Edu.Model.ViewModel.Mall.RB_Goods_SpecificationPrice_Extend.InventoryNum),spModel.InventoryNum - demodel.GuestNum} { nameof(Edu.Model.ViewModel.Mall.RB_Goods_SpecificationPrice_Extend.InventoryNum),spModel.InventoryNum - demodel.GuestNum}
// }; };
// List<WhereHelper> wheres = new List<WhereHelper>() List<WhereHelper> wheres = new List<WhereHelper>()
// { {
// new WhereHelper(){ new WhereHelper(){
// FiledName=nameof(Edu.Model.ViewModel.Mall.RB_Goods_SpecificationPrice_Extend.Id), FiledName=nameof(Edu.Model.ViewModel.Mall.RB_Goods_SpecificationPrice_Extend.Id),
// FiledValue=spModel.Id, FiledValue=spModel.Id,
// OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
// } }
// }; };
// flag = goods_SpecificationPriceRepository.Update(keyValues, wheres); flag = goods_SpecificationPriceRepository.Update(keyValues, wheres);
// } }
// } }
// } }
// return flag; return flag;
//} }
///// <summary> /// <summary>
///// 取消更新甲鹤小程序规格对应的班级人数 /// 取消更新甲鹤小程序规格对应的班级人数
///// </summary> /// </summary>
///// <param name="demodel"></param> /// <param name="demodel"></param>
///// <returns></returns> /// <returns></returns>
//public bool UpdateCancelClassOrder(RB_Order demodel) public bool UpdateCancelClassOrder(RB_Order demodel)
//{ {
// bool flag = false; bool flag = false;
// var courseModel = courseRepository.GetEntity(demodel.CourseId).RefMapperTo<RB_Course_ViewModel>(); var courseModel = courseRepository.GetEntity(demodel.CourseId).RefMapperTo<RB_Course_ViewModel>();
// if (courseModel != null && courseModel.MallGoodsId > 0) if (courseModel != null && courseModel.MallGoodsId > 0)
// { {
// var svlist = goods_SpecificationValueRepository.GetList(new Edu.Model.ViewModel.Mall.RB_Goods_SpecificationValue_Extend() { GoodsId = courseModel.MallGoodsId, TenantId = Convert.ToInt32(Config.JHTenantId), MallBaseId = Convert.ToInt32(Config.JHMallBaseId) }); var svlist = goods_SpecificationValueRepository.GetList(new Edu.Model.ViewModel.Mall.RB_Goods_SpecificationValue_Extend() { GoodsId = courseModel.MallGoodsId, TenantId = Convert.ToInt32(Config.JHTenantId), MallBaseId = Convert.ToInt32(Config.JHMallBaseId) });
// var splist = goods_SpecificationPriceRepository.GetList(new Edu.Model.ViewModel.Mall.RB_Goods_SpecificationPrice_Extend() { GoodsId = courseModel.MallGoodsId, TenantId = Convert.ToInt32(Config.JHTenantId), MallBaseId = Convert.ToInt32(Config.JHMallBaseId) }); var splist = goods_SpecificationPriceRepository.GetList(new Edu.Model.ViewModel.Mall.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 == demodel.ClassId)) if (svlist != null && svlist.Any(x => x.ClassId == demodel.ClassId))
// { {
// var svModel = svlist.Where(x => x.ClassId == demodel.ClassId).FirstOrDefault(); var svModel = svlist.Where(x => x.ClassId == demodel.ClassId).FirstOrDefault();
// if (svModel != null && svModel.Id > 0) if (svModel != null && svModel.Id > 0)
// { {
// var spModel = splist.Where(x => x.SpecificationSort == svModel.Sort.ToString()).FirstOrDefault(); var spModel = splist.Where(x => x.SpecificationSort == svModel.Sort.ToString()).FirstOrDefault();
// Dictionary<string, object> keyValues = new Dictionary<string, object>() { Dictionary<string, object> keyValues = new Dictionary<string, object>() {
// { nameof(Edu.Model.ViewModel.Mall.RB_Goods_SpecificationPrice_Extend.InventoryNum),spModel.InventoryNum + demodel.GuestNum} { nameof(Edu.Model.ViewModel.Mall.RB_Goods_SpecificationPrice_Extend.InventoryNum),spModel.InventoryNum + demodel.GuestNum}
// }; };
// List<WhereHelper> wheres = new List<WhereHelper>() List<WhereHelper> wheres = new List<WhereHelper>()
// { {
// new WhereHelper(){ new WhereHelper(){
// FiledName=nameof(Edu.Model.ViewModel.Mall.RB_Goods_SpecificationPrice_Extend.Id), FiledName=nameof(Edu.Model.ViewModel.Mall.RB_Goods_SpecificationPrice_Extend.Id),
// FiledValue=spModel.Id, FiledValue=spModel.Id,
// OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
// } }
// }; };
// flag = goods_SpecificationPriceRepository.Update(keyValues, wheres); flag = goods_SpecificationPriceRepository.Update(keyValues, wheres);
// } }
// } }
// } }
// return flag; return flag;
//} }
/// <summary>
/// 日语培训下单
/// </summary>
/// <param name="demodel"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public virtual bool SetBatchClassOrder(List<RB_Order_ViewModel> list, UserInfo userInfo, bool isEditOrder)
{
bool flag = false;
foreach (var demodel in list)
{
//查询班级信息
var classModel = classRepository.GetEntity(demodel.ClassId);
if (classModel == null)
{
flag = false;
return flag;
}
if (demodel.JoinType == OrderJoinTypeEnum.Normal || demodel.JoinType == OrderJoinTypeEnum.RenewOrder)
{
demodel.CourseId = classModel.CouseId;
}
//课程信息
var courseModel = courseRepository.GetEntity(demodel.CourseId);
#region 计算订单优惠信息
//获取课程优惠
var coursePreferentialList = course_PreferentialRepository.GetCoursePreferentialListRepostory(new RB_Course_Preferential_Extend()
{
CourseId = demodel.CourseId
});
//课程优惠信息
decimal disMoney = 0;//课程最大优惠金额
decimal coursePrice = courseModel.SellPrice;//课程最低单价
var coursePreferentialModel = new RB_Course_Preferential_Extend();
if (coursePreferentialList != null && coursePreferentialList.Count > 0)
{
if (demodel.GuestNum == 1)
{
coursePreferentialModel = coursePreferentialList?.Where(qitem => qitem.PriceDiscountType == CoursePriceDiscountEnum.SingleJoin)?.FirstOrDefault();
}
if (demodel.GuestNum >= 2)
{
coursePreferentialModel = coursePreferentialList?.Where(qitem => qitem.PriceDiscountType == CoursePriceDiscountEnum.DoubleJoin)?.FirstOrDefault();
}
var saleCommissionType = coursePreferentialModel?.SaleCommissionType ?? 0;
if (saleCommissionType == 0)
{
var tempMoney = (courseModel?.SellPrice ?? 0) * (coursePreferentialModel?.SaleCommissionMoney ?? 0);
disMoney = tempMoney / Convert.ToDecimal(100);
}
else
{
disMoney = coursePreferentialModel?.SaleCommissionMoney ?? 0;
}
var b2bCommissionType = coursePreferentialModel?.B2BCommissionType ?? 0;
if (b2bCommissionType == 0)
{
var tempMoney = (courseModel?.SellPrice ?? 0) * (coursePreferentialModel?.B2BCommissionMoney ?? 0);
disMoney += tempMoney / Convert.ToDecimal(100);
}
else
{
disMoney = coursePreferentialModel?.B2BCommissionMoney ?? 0;
}
var priceCommissionType = coursePreferentialModel?.PriceType ?? 0;
if (priceCommissionType == 0)
{
coursePrice = coursePrice * (100 - (coursePreferentialModel?.PriceMoney ?? 0)) / 100;
}
else
{
coursePrice -= (coursePreferentialModel?.PriceMoney ?? 0);
}
#region 记录提成信息
if (coursePreferentialModel == null)
{
coursePreferentialModel = coursePreferentialList.FirstOrDefault();
}
demodel.CommissionType = coursePreferentialModel?.SaleCommissionType ?? 0;
demodel.CommissionRate = coursePreferentialModel?.SaleCommissionMoney ?? 0;
demodel.CommissionTypeTH = coursePreferentialModel?.B2BCommissionType ?? 0;
demodel.CommissionRateTH = coursePreferentialModel?.B2BCommissionMoney ?? 0;
if (coursePreferentialModel != null)
{
demodel.CommissionRemark = "使用优惠Id:" + coursePreferentialModel.Id + " 返佣类型:" + demodel.CommissionType + " 返佣比例/金额:" + demodel.CommissionRate + " 同行返佣类型:" + demodel.CommissionTypeTH + " 同行返佣比例/金额:" + demodel.CommissionRateTH;
}
#endregion
}
if (demodel.IsLessPrice == 1 && demodel.LessPrice > 0)
{
if (coursePreferentialList != null && coursePreferentialList.Count > 0)
{
if (demodel.LessPrice > disMoney)
{
return flag;
}
}
//else
//{
// message = "此课程未配置【销售提成】信息,请通知OP在课程里面添加优惠信息!";
// return flag;
//}
}
#endregion
if (demodel.OrderSource == OrderSourceEnum.EduClient || demodel.OrderSource == OrderSourceEnum.Client)
{
if (demodel.OrderSource == OrderSourceEnum.EduClient)
{
demodel.GeneralOccupation = "";
}
else if (demodel.OrderSource == OrderSourceEnum.Client)
{
demodel.EduOccupation = "";
}
}
else
{
demodel.EduOccupation = "";
demodel.GeneralOccupation = "";
}
if (demodel.IsLessPrice == 0)
{
demodel.LessPrice = 0;
}
var orderModel = new RB_Order();
if (demodel.OrderId > 0)
{
orderModel = orderRepository.GetEntity(demodel.OrderId);
}
if (demodel.OrderId > 0)
{
int BNum = orderRepository.GetClassOrderPeopleNumRepository(demodel.ClassId.ToString()).FirstOrDefault()?.GuestNum ?? 0;
if (BNum + demodel.GuestNum - orderModel.GuestNum > classModel.ClassPersion)
{
flag = false;
// message = "人数报超" + (classModel.ClassPersion - (BNum + demodel.GuestNum - orderModel.GuestNum));
return flag;
}
}
else
{
int BNum = orderRepository.GetClassOrderPeopleNumRepository(demodel.ClassId.ToString()).FirstOrDefault()?.GuestNum ?? 0;
if (BNum + demodel.GuestNum > classModel.ClassPersion)
{
flag = false;
// message = "人数报超" + (classModel.ClassPersion - (BNum + demodel.GuestNum));
return flag;
}
}
//没有总经理修改订单权限
if (!isEditOrder)
{
if (demodel.Unit_Price < coursePrice)
{
flag = false;
// message = "成交单价不能小于最低价格";
return flag;
}
if (demodel.JoinType == OrderJoinTypeEnum.InsertClass)
{
var newPreferPrice = Math.Round(coursePrice / courseModel.ClassHours * (courseModel.ClassHours - demodel.StartClassHours) * demodel.GuestNum, 2);
if (demodel.PreferPrice != (newPreferPrice - demodel.LessPrice))
{
flag = false;
// message = "应收总额不正确";
return flag;
}
}
else if (demodel.JoinType == OrderJoinTypeEnum.TransOrder || demodel.JoinType == OrderJoinTypeEnum.SplitOrder)
{
//不验证应收
}
else
{
if (demodel.PreferPrice != (demodel.Unit_Price * demodel.GuestNum - demodel.LessPrice))
{
flag = false;
// message = "应收总额不正确";
return flag;
}
}
}
//日志信息
string LogContent = "";
//销售备注
string SaleRemark = "";
if (demodel.JoinType == OrderJoinTypeEnum.InsertClass)
{
if (Convert.ToDateTime(Common.ConvertHelper.FormatTime(demodel.EffectTime)) < Convert.ToDateTime(Common.ConvertHelper.FormatTime(DateTime.Now)))
{
demodel.EffectStatus = 1;
}
else
{
demodel.EffectStatus = 0;
}
}
else
{
demodel.EffectStatus = 1;
demodel.EffectTime = DateTime.Now;
}
if (classModel.ClassStatus == Common.Enum.Course.ClassStatusEnum.EndClass)
{
flag = false;
// message = "班级状态不正确";
return flag;
}
demodel.Class_Price = courseModel.SellPrice;
int OrderId = orderRepository.Insert(demodel);
demodel.OrderId = OrderId;
flag = OrderId > 0;
LogContent = "新增日语培训订单";
//记录订单备注
if (!string.IsNullOrEmpty(demodel.SaleRemark))
{
SaleRemark = demodel.SaleRemark;
}
#region 更新甲鹤小程序规格对应的库存
if (flag && demodel.JoinType != OrderJoinTypeEnum.RenewOrder)//续费订单不去更新规格库存
{
System.Threading.Tasks.Task.Run(() => UpdateClassInventoryNum(demodel));
}
#endregion
#region 写日志
if (flag)
{
var financeConfig = finance_ConfigRepository.GetList(new Edu.Model.ViewModel.Finance.RB_Finance_Config_ViewModel { Group_Id = demodel.Group_Id, Type = Common.Enum.Course.FinanceConfigTypeEnum.Tuition }).FirstOrDefault();
if (financeConfig == null)
{
financeConfig = new Edu.Model.ViewModel.Finance.RB_Finance_Config_ViewModel();
}
// var OriginalFee = Math.Round((Convert.ToDecimal(Config.SettlementRate) / 100) * (Convert.ToDecimal(payModel.amount.payer_total) / 100), 2, MidpointRounding.AwayFromZero);//手续费
#region 财务单据数据组装
var detailList = new List<object>
{
new
{
CostTypeId = financeConfig?.CostTypeId ?? 533,
Number = demodel.GuestNum,
OriginalMoney = Convert.ToDecimal(demodel.Income) ,
UnitPrice = Convert.ToDecimal(demodel.Income/demodel.GuestNum) ,
Remark = "甲鹤小程序用户下单自动生成财务单据"
}
};
var financeObj = new
{
IsPublic = 1,
BType = 1,//item.AccountType,
AccountId = financeConfig?.ClientID ?? 54,
WBMoney = Convert.ToDecimal(demodel.Income) ,
TradeDate = System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"),
AccountNumber = System.DateTime.Now.AddDays(-1).ToString("yyyyMMdd"),
TemplateId = financeConfig?.TempleteId ?? 139,
OrderSource = 17,
Remark = System.DateTime.Now.ToString("yyyy年MM月dd日") + "自动生成财务单据",
detailList,
OriginalFee = demodel.PlatformTax,
CreateBy = userInfo.Id,
RemitterName = demodel.GuestName,
RB_Branch_Id = userInfo.School_Id,
RB_Group_Id = userInfo.Group_Id,
RB_Depart_Id = userInfo.DeptId,
RB_CreateByName = userInfo.AccountName,
RB_DepartName = userInfo.DeptName,
RB_BranchName = userInfo.SchoolName,
RB_GroupName = userInfo.GroupName,
FinanceType = 2,
GuestId = 0,
OrderId,
TCIDList = demodel.ClassId > 0 ? new List<int>() { demodel.ClassId } : new List<int>(),
};
#endregion
string sign = EncryptionHelper.AesEncrypt(JsonHelper.Serialize(financeObj), Config.FinanceKey);
var resultInfo = new
{
msg = sign,
};
string apiResult = Common.Plugin.HttpHelper.HttpPost(Config.ReadConfigKey("IncomeFinanceApi"), JsonHelper.Serialize(resultInfo), "");
JObject parmsJob = JObject.Parse(apiResult);
string resultCode = parmsJob.GetStringValue("resultCode");
int frid = parmsJob.GetInt("data", 0);
if (resultCode == "1" && frid > 0)//新增记录
{
}
//销售备注
if (!string.IsNullOrEmpty(SaleRemark))
{
order_RemarkRepository.Insert(new RB_Order_Remark()
{
Id = 0,
Content = SaleRemark,
CreateBy = demodel.CreateBy,
CreateTime = DateTime.Now,
OrderId = demodel.OrderId,
Type = 1
});
}
//订单日志
if (!string.IsNullOrEmpty(LogContent))
{
changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog()
{
Id = 0,
Type = 2,
CreateBy = userInfo.Id,
CreateTime = DateTime.Now,
Group_Id = userInfo.Group_Id,
LogContent = LogContent,
School_Id = userInfo.School_Id,
SourceId = demodel.OrderId
});
}
}
#endregion
}
return flag;
}
/// <summary>
/// 更新班级对应的商品库存
/// </summary>
/// <param name="classId"></param>
/// <returns></returns>
public bool UpdateGoodsSpecification(List<int> classId)
{
bool flag = false;
string classIds = string.Join(",", classId.Select(x => x));
var classList = classRepository.GetClassAndCourseListRepository(new RB_Class_ViewModel { Q_ClassIds = classIds });
var goodsSpecificationValueList = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend { ClassIds = classIds });
var goodsSpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>();
if (goodsSpecificationValueList != null && goodsSpecificationValueList.Any())
{
goodsSpecificationPriceList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend { GoodsId = goodsSpecificationValueList.FirstOrDefault()?.GoodsId });
}
if (classList != null && classList.Any() && goodsSpecificationValueList != null && goodsSpecificationValueList.Any() && goodsSpecificationValueList != null && goodsSpecificationValueList.Any())
{
foreach (var item in classList)//查找班级对应的规格
{
var valueModle = goodsSpecificationValueList.Where(x => x.ClassId == item.ClassId).FirstOrDefault();
if (valueModle != null && valueModle.Id > 0)
{
var priceModel = goodsSpecificationPriceList.Where(x => x.GoodsId == valueModle.GoodsId && x.SpecificationSort == (valueModle.Sort ?? 0).ToString()).FirstOrDefault();
if (priceModel != null && priceModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Goods_SpecificationPrice_Extend.InventoryNum),item.ClassPersion-item.OrderStudentCount},
};
flag = classRepository.Update(fileds, new WhereHelper(nameof(RB_Goods_SpecificationPrice_Extend.Id), priceModel.Id));
}
}
}
}
return flag;
}
#endregion #endregion
} }
} }
\ No newline at end of file
...@@ -118,6 +118,10 @@ WHERE 1=1 ...@@ -118,6 +118,10 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.ClassId), query.ClassId); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.ClassId), query.ClassId);
} }
if (!string.IsNullOrEmpty(query.Q_ClassIds))
{
builder.AppendFormat(" AND A.{0} in ({1}) ", nameof(RB_Class_ViewModel.ClassId), query.Q_ClassIds);
}
if (query.Status >= 0) if (query.Status >= 0)
{ {
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.Status), (int)query.Status); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.Status), (int)query.Status);
......
...@@ -50,7 +50,10 @@ namespace Edu.Repository.Mall ...@@ -50,7 +50,10 @@ namespace Edu.Repository.Mall
{ {
where += $@" and {nameof(RB_Goods_SpecificationValue.GoodsId)} in({dmodel.GoodsIds})"; where += $@" and {nameof(RB_Goods_SpecificationValue.GoodsId)} in({dmodel.GoodsIds})";
} }
if (!string.IsNullOrEmpty(dmodel.ClassIds))
{
where += $@" and {nameof(RB_Goods_SpecificationValue.ClassId)} in({dmodel.ClassIds})";
}
string sql = $@"select * from RB_Goods_SpecificationValue where {where} order by Id asc"; string sql = $@"select * from RB_Goods_SpecificationValue where {where} order by Id asc";
return Get<RB_Goods_SpecificationValue_Extend>(sql).ToList(); return Get<RB_Goods_SpecificationValue_Extend>(sql).ToList();
} }
......
...@@ -283,21 +283,21 @@ namespace Edu.WebApi.Controllers.Course ...@@ -283,21 +283,21 @@ 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 try
//{ {
// extModel.CategoryList = JsonHelper.DeserializeObject<List<RB_Goods_Category_Extend>>(base.ParmJObj.GetStringValue("CategoryList")); 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.SalePlatList != null && extModel.SalePlatList.Any(x => x == 4))//有小程序的上架平台
// { {
// if (extModel.CategoryList == null || !extModel.CategoryList.Any()) if (extModel.CategoryList == null || !extModel.CategoryList.Any())
// { {
// return ApiResult.Failed("上架小程序必须选择小程序对应的分类"); return ApiResult.Failed("上架小程序必须选择小程序对应的分类");
// } }
// } }
//} }
//catch (Exception ex) 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;
......
...@@ -110,7 +110,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -110,7 +110,7 @@ namespace Edu.WebApi.Controllers.Course
x.SchoolName, x.SchoolName,
UpdateTime = Common.ConvertHelper.FormatTime(x.UpdateTime), UpdateTime = Common.ConvertHelper.FormatTime(x.UpdateTime),
x.OtherCourseList, x.OtherCourseList,
IsChaBan= IsInsertClass, IsChaBan = IsInsertClass,
}; };
result.Add(obj); result.Add(obj);
} }
...@@ -410,7 +410,8 @@ namespace Edu.WebApi.Controllers.Course ...@@ -410,7 +410,8 @@ namespace Edu.WebApi.Controllers.Course
{ {
return x.CommissionRate + x.CommissionRateTH - x.LessPrice; return x.CommissionRate + x.CommissionRateTH - x.LessPrice;
} }
else { else
{
return Math.Round((x.PreferPrice - x.DiscountMoney + x.LessPrice) * (x.CommissionRate + x.CommissionRateTH) / 100, 2, MidpointRounding.AwayFromZero) - x.LessPrice; return Math.Round((x.PreferPrice - x.DiscountMoney + x.LessPrice) * (x.CommissionRate + x.CommissionRateTH) / 100, 2, MidpointRounding.AwayFromZero) - x.LessPrice;
} }
} }
...@@ -485,14 +486,14 @@ namespace Edu.WebApi.Controllers.Course ...@@ -485,14 +486,14 @@ namespace Edu.WebApi.Controllers.Course
OldPreferPrice = base.ParmJObj.GetDecimal("OldPreferPrice"), OldPreferPrice = base.ParmJObj.GetDecimal("OldPreferPrice"),
CourseId = base.ParmJObj.GetInt("CourseId"), CourseId = base.ParmJObj.GetInt("CourseId"),
StartClassHours = base.ParmJObj.GetInt("StartClassHours"), StartClassHours = base.ParmJObj.GetInt("StartClassHours"),
EffectTime=base.ParmJObj.GetDateTime("EffectTime"), EffectTime = base.ParmJObj.GetDateTime("EffectTime"),
UpOrderId=base.ParmJObj.GetInt("UpOrderId"), UpOrderId = base.ParmJObj.GetInt("UpOrderId"),
VisitorReserveId=base.ParmJObj.GetInt("VisitorReserveId"), VisitorReserveId = base.ParmJObj.GetInt("VisitorReserveId"),
JoinType= OrderJoinTypeEnum.Normal, JoinType = OrderJoinTypeEnum.Normal,
TargetJoinType= OrderJoinTypeEnum.Normal, TargetJoinType = OrderJoinTypeEnum.Normal,
}; };
var IsInsertClass= base.ParmJObj.GetInt("IsChaBan"); var IsInsertClass = base.ParmJObj.GetInt("IsChaBan");
if (IsInsertClass == 1) if (IsInsertClass == 1)
{ {
demodel.JoinType = OrderJoinTypeEnum.InsertClass; demodel.JoinType = OrderJoinTypeEnum.InsertClass;
...@@ -531,11 +532,11 @@ namespace Edu.WebApi.Controllers.Course ...@@ -531,11 +532,11 @@ namespace Edu.WebApi.Controllers.Course
if (demodel.OrderType == OrderTypeEnum.CourseOrder) if (demodel.OrderType == OrderTypeEnum.CourseOrder)
{ {
if (demodel.JoinType == OrderJoinTypeEnum.Normal) if (demodel.JoinType == OrderJoinTypeEnum.Normal)
{ {
demodel.StartClassHours = 0; demodel.StartClassHours = 0;
} }
else if (demodel.JoinType == OrderJoinTypeEnum.InsertClass) else if (demodel.JoinType == OrderJoinTypeEnum.InsertClass)
{ {
if (demodel.CourseId <= 0) if (demodel.CourseId <= 0)
{ {
...@@ -626,7 +627,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -626,7 +627,7 @@ namespace Edu.WebApi.Controllers.Course
model.OrderNature, model.OrderNature,
OrderNatureName = model.OrderNature.ToName(), OrderNatureName = model.OrderNature.ToName(),
model.OldPreferPrice, model.OldPreferPrice,
IsChaBan=model.JoinType== OrderJoinTypeEnum.InsertClass?1:0, IsChaBan = model.JoinType == OrderJoinTypeEnum.InsertClass ? 1 : 0,
model.CourseId, model.CourseId,
model.StartClassHours, model.StartClassHours,
EffectTime = Common.ConvertHelper.FormatDate(model.EffectTime), EffectTime = Common.ConvertHelper.FormatDate(model.EffectTime),
...@@ -692,7 +693,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -692,7 +693,7 @@ namespace Edu.WebApi.Controllers.Course
model.OrderType, model.OrderType,
model.SourceId, model.SourceId,
OrderTypeName = Common.Plugin.EnumHelper.ToName(model.OrderType), OrderTypeName = Common.Plugin.EnumHelper.ToName(model.OrderType),
OpenTime=Common.ConvertHelper.FormatDate(model.OpenTime), OpenTime = Common.ConvertHelper.FormatDate(model.OpenTime),
}); });
} }
...@@ -1076,16 +1077,16 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1076,16 +1077,16 @@ namespace Edu.WebApi.Controllers.Course
x.CourseName, x.CourseName,
x.StartClassHours, x.StartClassHours,
x.JoinType, x.JoinType,
JoinTypeName= x.JoinType.ToName(), JoinTypeName = x.JoinType.ToName(),
x.TargetJoinType, x.TargetJoinType,
TargetJoinTypeName=x.TargetJoinType.ToName(), TargetJoinTypeName = x.TargetJoinType.ToName(),
x.SourceOrderId, x.SourceOrderId,
x.SourceClassName, x.SourceClassName,
x.TargetOrderId, x.TargetOrderId,
x.TargetClassName, x.TargetClassName,
x.EffectStatus, x.EffectStatus,
x.EffectStatusStr, x.EffectStatusStr,
EffectTime=Common.ConvertHelper.FormatDate(x.EffectTime), EffectTime = Common.ConvertHelper.FormatDate(x.EffectTime),
x.UpOrderId, x.UpOrderId,
x.GuestContractNo, x.GuestContractNo,
x.ContractType, x.ContractType,
...@@ -1130,8 +1131,8 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1130,8 +1131,8 @@ namespace Edu.WebApi.Controllers.Course
BirthDate = base.ParmJObj.GetDateTime("BirthDate"), BirthDate = base.ParmJObj.GetDateTime("BirthDate"),
TotalHours = base.ParmJObj.GetDecimal("TotalHours"), TotalHours = base.ParmJObj.GetDecimal("TotalHours"),
StuIcon = base.ParmJObj.GetStringValue("StuIcon"), StuIcon = base.ParmJObj.GetStringValue("StuIcon"),
GuestContractNo=base.ParmJObj.GetStringValue("GuestContractNo"), GuestContractNo = base.ParmJObj.GetStringValue("GuestContractNo"),
ContractType=base.ParmJObj.GetInt("ContractType"), ContractType = base.ParmJObj.GetInt("ContractType"),
}; };
if (dmodel.OrderId <= 0) if (dmodel.OrderId <= 0)
{ {
...@@ -1244,9 +1245,9 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1244,9 +1245,9 @@ namespace Edu.WebApi.Controllers.Course
x.CourseId, x.CourseId,
x.CourseName, x.CourseName,
x.JoinType, x.JoinType,
JoinTypeName=x.JoinType.ToName(), JoinTypeName = x.JoinType.ToName(),
x.TargetJoinType, x.TargetJoinType,
TargetJoinTypeName=x.JoinType.ToName(), TargetJoinTypeName = x.JoinType.ToName(),
x.SourceOrderId, x.SourceOrderId,
x.SourceClassName, x.SourceClassName,
x.TargetOrderId, x.TargetOrderId,
...@@ -1296,7 +1297,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1296,7 +1297,7 @@ namespace Edu.WebApi.Controllers.Course
x.OldPreferPrice, x.OldPreferPrice,
x.EffectStatus, x.EffectStatus,
x.EffectStatusStr, x.EffectStatusStr,
EffectTime=Common.ConvertHelper.FormatDate(x.EffectTime), EffectTime = Common.ConvertHelper.FormatDate(x.EffectTime),
x.UpOrderId, x.UpOrderId,
OpenTime = Common.ConvertHelper.FormatDate(x.OpenTime), OpenTime = Common.ConvertHelper.FormatDate(x.OpenTime),
x.VisitorReserveId, x.VisitorReserveId,
...@@ -1398,7 +1399,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1398,7 +1399,7 @@ namespace Edu.WebApi.Controllers.Course
Q_OrderBy = base.ParmJObj.GetInt("Q_OrderBy"), Q_OrderBy = base.ParmJObj.GetInt("Q_OrderBy"),
PlatformTax = base.ParmJObj.GetDecimal("PlatformTax"), PlatformTax = base.ParmJObj.GetDecimal("PlatformTax"),
EnterID = base.ParmJObj.GetInt("EnterID"), EnterID = base.ParmJObj.GetInt("EnterID"),
HelpEnterId = base.ParmJObj.GetInt("HelpEnterId",0), HelpEnterId = base.ParmJObj.GetInt("HelpEnterId", 0),
ClassNo = base.ParmJObj.GetStringValue("ClassNo") ClassNo = base.ParmJObj.GetStringValue("ClassNo")
}; };
demodel.Group_Id = userInfo.Group_Id; demodel.Group_Id = userInfo.Group_Id;
...@@ -1415,7 +1416,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1415,7 +1416,7 @@ namespace Edu.WebApi.Controllers.Course
DueInMoney = orderS?.DueInMoney ?? 0, DueInMoney = orderS?.DueInMoney ?? 0,
GuestNum = orderS?.GuestNum ?? 0, GuestNum = orderS?.GuestNum ?? 0,
CancelNum = orderS?.CancelNum ?? 0, CancelNum = orderS?.CancelNum ?? 0,
CommissionMoney = (orderS?.CommissionMoney ?? 0)>0?(orderS?.CommissionMoney ?? 0):0, CommissionMoney = (orderS?.CommissionMoney ?? 0) > 0 ? (orderS?.CommissionMoney ?? 0) : 0,
ExtraRewardMoney = orderS?.ExtraRewardMoney ?? 0 ExtraRewardMoney = orderS?.ExtraRewardMoney ?? 0
}, },
List = orderList?.Select(x => new List = orderList?.Select(x => new
...@@ -1427,11 +1428,11 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1427,11 +1428,11 @@ namespace Edu.WebApi.Controllers.Course
x.SourceId, x.SourceId,
x.ClassSchoolId, x.ClassSchoolId,
x.ClassName, x.ClassName,
OpenTime=Common.ConvertHelper.FormatDate(x.OpenTime), OpenTime = Common.ConvertHelper.FormatDate(x.OpenTime),
x.JoinType, x.JoinType,
JoinTypeName=x.JoinType.ToName(), JoinTypeName = x.JoinType.ToName(),
x.TargetJoinType, x.TargetJoinType,
TargetJoinTypeName=x.TargetJoinType.ToName(), TargetJoinTypeName = x.TargetJoinType.ToName(),
x.SourceOrderId, x.SourceOrderId,
x.SourceClassName, x.SourceClassName,
x.TargetOrderId, x.TargetOrderId,
...@@ -1489,7 +1490,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1489,7 +1490,7 @@ namespace Edu.WebApi.Controllers.Course
qitem.S_ClassId, qitem.S_ClassId,
qitem.S_ClassName, qitem.S_ClassName,
qitem.S_JoinType, qitem.S_JoinType,
S_JoinTypeName= qitem.S_JoinType.ToName(), S_JoinTypeName = qitem.S_JoinType.ToName(),
qitem.S_OrderId, qitem.S_OrderId,
qitem.T_ClassId, qitem.T_ClassId,
qitem.T_ClassName, qitem.T_ClassName,
...@@ -1700,12 +1701,14 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1700,12 +1701,14 @@ namespace Edu.WebApi.Controllers.Course
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult SetOrderHelpEnterId() { public ApiResult SetOrderHelpEnterId()
{
var userInfo = base.UserInfo; var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString()); JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int OrderId = parms.GetInt("OrderId", 0); int OrderId = parms.GetInt("OrderId", 0);
int HelpEnterId = parms.GetInt("HelpEnterId", 0); int HelpEnterId = parms.GetInt("HelpEnterId", 0);
if (OrderId <= 0) { if (OrderId <= 0)
{
return ApiResult.ParamIsNull("请传递订单id"); return ApiResult.ParamIsNull("请传递订单id");
} }
...@@ -1714,7 +1717,8 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1714,7 +1717,8 @@ namespace Edu.WebApi.Controllers.Course
{ {
return ApiResult.Success(); return ApiResult.Success();
} }
else { else
{
return ApiResult.Failed(msg); return ApiResult.Failed(msg);
} }
} }
...@@ -2168,6 +2172,74 @@ namespace Edu.WebApi.Controllers.Course ...@@ -2168,6 +2172,74 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.Success(data: otherClassList); return ApiResult.Success(data: otherClassList);
} }
#endregion
#region 甲鹤小程序付款的课程同步过来
/// <summary>
/// 新增修改订单
/// </summary>
/// <returns></returns>
[HttpPost]
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
public ApiResult SetBatchClassOrder()
{
Model.CacheModel.UserInfo userinfo = new Model.CacheModel.UserInfo();
int EnterID = base.ParmJObj.GetInt("EnterID");
List<RB_Order_ViewModel> list = JsonHelper.DeserializeObject<List<RB_Order_ViewModel>>(base.ParmJObj.GetStringValue("Order"));
list.ForEach(x => x.TargetJoinType = OrderJoinTypeEnum.Normal);
list.ForEach(x => x.JoinType = OrderJoinTypeEnum.Normal);
list.ForEach(x => x.JoinType = OrderJoinTypeEnum.Normal);
list.ForEach(x => x.OrderSource = OrderSourceEnum.MallApplet);
list.ForEach(x => x.OrderType = OrderTypeEnum.CourseOrder);
if (EnterID > 0)
{
userinfo = UserReidsCache.GetUserLoginInfo(EnterID);
list.ForEach(x => x.School_Id = userinfo.School_Id);
list.ForEach(x => x.Group_Id = userinfo.Group_Id);
list.ForEach(x => x.Dept_Id = userinfo.DeptId);
list.ForEach(x => x.CreateBy = EnterID);
list.ForEach(x => x.UpdateBy = EnterID);
}
else
{
userinfo.Group_Id = list.FirstOrDefault()?.Group_Id ?? 0;
}
list.ForEach(x => x.OrderForm = OrderFormEnum.Applet);
list.ForEach(x => x.TradeWay = TradeWayEnum.OnLine);
list.ForEach(x => x.CreateTime = DateTime.Now);
list.ForEach(x => x.UpdateTime = DateTime.Now);
list.ForEach(x => x.OrderState = OrderStateEnum.Normal);
list.ForEach(x => x.StartClassHours = 0);
var flag = false;
flag = orderModule.SetBatchClassOrder(list, userinfo, false);
return flag ? ApiResult.Success("") : ApiResult.Failed("");
}
/// <summary>
/// 系统自动取消时同步规格库存
/// </summary>
/// <returns></returns>
[HttpPost]
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
public ApiResult UpdateGoodsSpecification()
{
Model.CacheModel.UserInfo userinfo = new Model.CacheModel.UserInfo();
List<int> list = JsonHelper.DeserializeObject<List<int>>(base.ParmJObj.GetStringValue("Order"));
var flag = false;
flag = orderModule.UpdateGoodsSpecification(list);
return flag ? ApiResult.Success("") : ApiResult.Failed("");
}
#endregion #endregion
} }
} }
{ {
"ConnectionStrings": { "ConnectionStrings": {
"DefaultConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_edu;CharSet=utf8mb4; Convert Zero Datetime=true; ", "DefaultConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_edu;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"DefaultConnectionPName": "MySql.Data.MySqlClient", "DefaultConnectionPName": "MySql.Data.MySqlClient",
"FinanceConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8mb4; Convert Zero Datetime=true; ", "FinanceConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"FinanceConnectionPName": "MySql.Data.MySqlClient", "FinanceConnectionPName": "MySql.Data.MySqlClient",
"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; ", "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" "MallConnectionPName": "MySql.Data.MySqlClient"
}, },
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",
"Microsoft": "Warning", "Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information" "Microsoft.Hosting.Lifetime": "Information"
} }
}, },
"SettlementRate": "0.60", "SettlementRate": "0.60",
"SellCommissionFFBL": "0.15", "SellCommissionFFBL": "0.15",
"JwtSecretKey": "@VIITTOREBORN*2018", "JwtSecretKey": "@VIITTOREBORN*2018",
"MallJwtSecretKey": "@VIITTOREBORN*2018123", "MallJwtSecretKey": "@VIITTOREBORN*2018123",
"JwtExpirTime": 86400, "JwtExpirTime": 86400,
"IsSendMsg": 2, "IsSendMsg": 2,
"AllowedHosts": "*", "AllowedHosts": "*",
"OpenValidation": "False", "OpenValidation": "False",
"UploadSiteUrl": "http://192.168.1.36:8120", "UploadSiteUrl": "http://192.168.1.36:8120",
"ViewFileSiteUrl": "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com", "ViewFileSiteUrl": "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com",
"ErpViewFileSiteUrl": "http://imgfile.oytour.com", "ErpViewFileSiteUrl": "http://imgfile.oytour.com",
"Mongo": "mongodb://47.96.25.130:27017", "Mongo": "mongodb://47.96.25.130:27017",
"MongoDBName": "Edu", "MongoDBName": "Edu",
"WkHtmlToPdfPath": "D:/wkhtmltopdf/bin/", "WkHtmlToPdfPath": "D:/wkhtmltopdf/bin/",
"FinanceKey": "FinanceMallInsertToERPViitto2020", "FinanceKey": "FinanceMallInsertToERPViitto2020",
"PaymentFinanceApi": "http://192.168.20.7:8083/api/Mall/InsertFinanceBatchForMallOut", "PaymentFinanceApi": "http://192.168.20.7:8083/api/Mall/InsertFinanceBatchForMallOut",
"IncomeFinanceApi": "http://192.168.20.7:8083/api/Mall/InsertFinanceBatchForMallIn", "IncomeFinanceApi": "http://192.168.20.7:8083/api/Mall/InsertFinanceBatchForMallIn",
"sTenpayNotifyUrl": "http://eduapi.oytour.com/api/WeChatPay/WxPayCallback", //下单回调地址 "sTenpayNotifyUrl": "http://eduapi.oytour.com/api/WeChatPay/WxPayCallback", //下单回调地址
"sTenpayNotifyRefundUrl": "http://eduapi.oytour.com/api/WeChatPay/Refunds", //退款回调地址 "sTenpayNotifyRefundUrl": "http://eduapi.oytour.com/api/WeChatPay/Refunds", //退款回调地址
"FinanceDateBase": "reborn_finance", "FinanceDateBase": "reborn_finance",
"EduDateBase": "uat_reborn_edu", "EduDateBase": "uat_reborn_edu",
"JHTenantId": "15", "JHTenantId": "15",
"JHMallBaseId": "5", "JHMallBaseId": "5",
"Notice_BaseKey": "Notice_BaseKey", "Notice_BaseKey": "Notice_BaseKey",
"EducationContractSchool": "EducationContractSchool", "EducationContractSchool": "EducationContractSchool",
"EducationContractAdmin": "EducationContractAdmin", "EducationContractAdmin": "EducationContractAdmin",
"RabbitMqConfig": { "RabbitMqConfig": {
"HostName": "47.96.25.130", "HostName": "47.96.25.130",
"VirtualHost": "/", "VirtualHost": "/",
"Port": 5672, "Port": 5672,
"UserName": "guest", "UserName": "guest",
"Password": "viitto2019", "Password": "viitto2019",
"QueenName": "vt_sys_message_test" "QueenName": "vt_sys_message_test"
}, },
"RedisSetting": { "RedisSetting": {
"RedisServer": "47.96.23.199", "RedisServer": "47.96.23.199",
"RedisPort": "6379", "RedisPort": "6379",
"RedisPwd": "Viitto2018" "RedisPwd": "Viitto2018"
}, },
"VirtualDirectory": "WebFile", "VirtualDirectory": "WebFile",
//未填写 未打分 下降比例 //未填写 未打分 下降比例
"OKRMatterValue": "30,100,100", "OKRMatterValue": "30,100,100",
//是否是线上环境 //是否是线上环境
"IsOnline": false, "IsOnline": false,
//退课流程编号 //退课流程编号
"BackClassFlowId": 1, "BackClassFlowId": 1,
//分区校长岗位编号 //分区校长岗位编号
"SchoolPostId": 3, "SchoolPostId": 3,
//教务长 //教务长
"JiaoWuZhang": 8, "JiaoWuZhang": 8,
//留学就业部门主管审核编号[王涛] //留学就业部门主管审核编号[王涛]
"StudyAbroadDirectorId": 64, "StudyAbroadDirectorId": 64,
//留学就业部门负责人审核编号[姚顺先] //留学就业部门负责人审核编号[姚顺先]
"StudyAbroadManagerId": 52, "StudyAbroadManagerId": 52,
//合同默认抬头 //合同默认抬头
"ContractDefaultTitle": "JH-DZ-CD-", "ContractDefaultTitle": "JH-DZ-CD-",
//消息推送AppId //消息推送AppId
"PushAppId": "JiaHeJiaoYu", "PushAppId": "JiaHeJiaoYu",
//是否推送消息 //是否推送消息
"IsPushMessage": "1", "IsPushMessage": "1",
//超过下班时间60分钟不能打卡 //超过下班时间60分钟不能打卡
"MoreThanMinutes": 60, "MoreThanMinutes": 60,
//连续缺课课时 //连续缺课课时
"AbsentHours": 12, "AbsentHours": 12,
//值班时间验证日期 //值班时间验证日期
"DutyDate": "2021-06-30", "DutyDate": "2021-06-30",
//调课流程编号 //调课流程编号
"ChangeClassFlowId": 2, "ChangeClassFlowId": 2,
//停课流程编号 //停课流程编号
"StopClassFlowId": 3, "StopClassFlowId": 3,
//临时上课邀请流程编号 //临时上课邀请流程编号
"TempInvitationClassFlowId": 4, "TempInvitationClassFlowId": 4,
//订单转班流程编号 //订单转班流程编号
"OrderTransClassFlowId": 5, "OrderTransClassFlowId": 5,
//订单分拆流程编号 //订单分拆流程编号
"OrderSplitClassFlowId": 6, "OrderSplitClassFlowId": 6,
"ErpUrl": "http://localhost:8181/#", "ErpUrl": "http://localhost:8181/#",
//是否开启调课数据验证 //是否开启调课数据验证
"IsOpenChangeClassVerify": 1, "IsOpenChangeClassVerify": 1,
......
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