Commit ec1c1032 authored by 黄奎's avatar 黄奎

页面修改

parent 09eff672
...@@ -101,5 +101,9 @@ namespace Mall.Model.Extend.User ...@@ -101,5 +101,9 @@ namespace Mall.Model.Extend.User
/// </summary> /// </summary>
public int IsSelectOverTime { get; set; } public int IsSelectOverTime { get; set; }
/// <summary>
/// 小程序排序
/// </summary>
public int SortNum { get; set; }
} }
} }
...@@ -120,6 +120,10 @@ namespace Mall.Model.Extend.User ...@@ -120,6 +120,10 @@ namespace Mall.Model.Extend.User
#endregion #endregion
/// <summary>
/// 小程序排序
/// </summary>
public int SortNum { get; set; }
} }
......
...@@ -3,6 +3,7 @@ using System.Collections.Generic; ...@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Mall.AOP.CustomerAttribute;
using Mall.Common; using Mall.Common;
using Mall.Common.API; using Mall.Common.API;
using Mall.Common.Plugin; using Mall.Common.Plugin;
...@@ -341,8 +342,10 @@ namespace Mall.Module.Product ...@@ -341,8 +342,10 @@ namespace Mall.Module.Product
} }
} }
} }
else { else
if (demodel.SmallShopsId > 0) { {
if (demodel.SmallShopsId > 0)
{
if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any()) if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any())
{ {
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault(); var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault();
...@@ -741,7 +744,8 @@ namespace Mall.Module.Product ...@@ -741,7 +744,8 @@ namespace Mall.Module.Product
} }
} }
} }
else { else
{
if (demodel.SmallShopsId > 0) if (demodel.SmallShopsId > 0)
{ {
if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any()) if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any())
...@@ -1350,7 +1354,8 @@ namespace Mall.Module.Product ...@@ -1350,7 +1354,8 @@ namespace Mall.Module.Product
if (UserId > 0) if (UserId > 0)
{ {
userModel = GetMemberUserInfo(UserId); userModel = GetMemberUserInfo(UserId);
if (SmallShopsId == 0) { if (SmallShopsId == 0)
{
SmallShopsId = userModel.SmallShopId; SmallShopsId = userModel.SmallShopId;
} }
} }
...@@ -1515,7 +1520,8 @@ namespace Mall.Module.Product ...@@ -1515,7 +1520,8 @@ namespace Mall.Module.Product
} }
#region 微店处理会员价格 #region 微店处理会员价格
if (model.MemberPriceList.Any() && SmallShopsId > 0) { if (model.MemberPriceList.Any() && SmallShopsId > 0)
{
if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.UpPrice > 0).Any()) if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.UpPrice > 0).Any())
{ {
foreach (var item in model.MemberPriceList) foreach (var item in model.MemberPriceList)
...@@ -1789,10 +1795,12 @@ namespace Mall.Module.Product ...@@ -1789,10 +1795,12 @@ namespace Mall.Module.Product
} }
} }
} }
else { else
{
//是否展示分享vip佣金 //是否展示分享vip佣金
var fxcommissionList = distributor_FXCommissionRepository.GetFXCommissionList(new RB_Distributor_FXCommission_Extend() { TenantId = TenantId, MallBaseId = MallBaseId, FXGradeId = disModel.FXGradeId ?? 0 }); var fxcommissionList = distributor_FXCommissionRepository.GetFXCommissionList(new RB_Distributor_FXCommission_Extend() { TenantId = TenantId, MallBaseId = MallBaseId, FXGradeId = disModel.FXGradeId ?? 0 });
if (fxcommissionList.Any()) { if (fxcommissionList.Any())
{
model.MaxShare = fxcommissionList.Max(x => x.CommissionPrice ?? 0); model.MaxShare = fxcommissionList.Max(x => x.CommissionPrice ?? 0);
} }
} }
...@@ -2390,7 +2398,7 @@ namespace Mall.Module.Product ...@@ -2390,7 +2398,7 @@ namespace Mall.Module.Product
fullMoneyPinkage = model.FreeShippingModel.FullMoneyPinkage ?? 0, fullMoneyPinkage = model.FreeShippingModel.FullMoneyPinkage ?? 0,
fullNumPinkage = model.FreeShippingModel.FullNumPinkage ?? 0, fullNumPinkage = model.FreeShippingModel.FullNumPinkage ?? 0,
freeShippingUrl = model.FreeShippingModel.FreeShippingUrl, freeShippingUrl = model.FreeShippingModel.FreeShippingUrl,
marketingLogo= model.MarketingLogo, marketingLogo = model.MarketingLogo,
cats = model.CategoryList.Select(x => new cats = model.CategoryList.Select(x => new
{ {
x.CategoryId, x.CategoryId,
...@@ -3789,7 +3797,7 @@ namespace Mall.Module.Product ...@@ -3789,7 +3797,7 @@ namespace Mall.Module.Product
/// <param name="demodel"></param> /// <param name="demodel"></param>
/// <param name="IsGetSpec">是否获取规格</param> /// <param name="IsGetSpec">是否获取规格</param>
/// <returns></returns> /// <returns></returns>
public List<RB_Goods_Extend> GetProductGoodsPageList(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel,int IsGetSpec=0) public List<RB_Goods_Extend> GetProductGoodsPageList(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel, int IsGetSpec = 0)
{ {
var list = goodsRepository.GetPageList(pageIndex, pageSize, out count, demodel); var list = goodsRepository.GetPageList(pageIndex, pageSize, out count, demodel);
if (list.Any()) if (list.Any())
...@@ -3806,9 +3814,9 @@ namespace Mall.Module.Product ...@@ -3806,9 +3814,9 @@ namespace Mall.Module.Product
List<RB_Goods_SpecificationPrice_Extend> SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>(); List<RB_Goods_SpecificationPrice_Extend> SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>();
if (IsGetSpec == 1) if (IsGetSpec == 1)
{ {
SpecificationList= goods_SpecificationRepository.GetList(new RB_Goods_Specification_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); SpecificationList = goods_SpecificationRepository.GetList(new RB_Goods_Specification_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
svlist = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); svlist = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
SpecificationPriceList= goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); SpecificationPriceList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
} }
foreach (var item in list) foreach (var item in list)
...@@ -3836,9 +3844,9 @@ namespace Mall.Module.Product ...@@ -3836,9 +3844,9 @@ namespace Mall.Module.Product
} }
item.GoodsBuyNum = olist.Where(x => x.GoodsId == item.Id).FirstOrDefault()?.OrderNum ?? 0; item.GoodsBuyNum = olist.Where(x => x.GoodsId == item.Id).FirstOrDefault()?.OrderNum ?? 0;
if (IsGetSpec==1) if (IsGetSpec == 1)
{ {
item.SpecificationList = SpecificationList?.Where(qitem => qitem.GoodsId == item.Id)?.ToList()??new List<RB_Goods_Specification_Extend>(); item.SpecificationList = SpecificationList?.Where(qitem => qitem.GoodsId == item.Id)?.ToList() ?? new List<RB_Goods_Specification_Extend>();
if (item.SpecificationList != null && item.SpecificationList.Count > 0) if (item.SpecificationList != null && item.SpecificationList.Count > 0)
{ {
foreach (var subItem in item.SpecificationList) foreach (var subItem in item.SpecificationList)
...@@ -4196,9 +4204,9 @@ namespace Mall.Module.Product ...@@ -4196,9 +4204,9 @@ namespace Mall.Module.Product
/// </summary> /// </summary>
/// <param name="demodel"></param> /// <param name="demodel"></param>
/// <returns></returns> /// <returns></returns>
public bool SetProductGoodsInfo(RB_Goods_Extend demodel) [TransactionCallHandler]
public virtual bool SetProductGoodsInfo(RB_Goods_Extend demodel)
{ {
//bool IsSyncProxy = false;
var goodsModel = new RB_Goods(); var goodsModel = new RB_Goods();
if (demodel.Id > 0) if (demodel.Id > 0)
{ {
...@@ -4229,8 +4237,6 @@ namespace Mall.Module.Product ...@@ -4229,8 +4237,6 @@ namespace Mall.Module.Product
} }
} }
} }
var trans = goodsRepository.DbTransaction;
try try
{ {
if (demodel.Id > 0) if (demodel.Id > 0)
...@@ -4348,7 +4354,7 @@ namespace Mall.Module.Product ...@@ -4348,7 +4354,7 @@ namespace Mall.Module.Product
OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
} }
}; };
bool flag = goodsRepository.Update(keyValues, wheres, trans); bool flag = goodsRepository.Update(keyValues, wheres);
if (flag) if (flag)
{ {
#region 修改分类 #region 修改分类
...@@ -4367,11 +4373,11 @@ namespace Mall.Module.Product ...@@ -4367,11 +4373,11 @@ namespace Mall.Module.Product
MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
Status = 0, Status = 0,
TenantId = demodel.TenantId TenantId = demodel.TenantId
}, trans); });
} }
foreach (var item in deleteList) foreach (var item in deleteList)
{ {
goods_CategoryRepository.Delete(item.Id, trans); goods_CategoryRepository.Delete(item.Id);
} }
#endregion #endregion
#region 修改规格 #region 修改规格
...@@ -4385,9 +4391,9 @@ namespace Mall.Module.Product ...@@ -4385,9 +4391,9 @@ namespace Mall.Module.Product
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 });
//删除后新增 //删除后新增
goods_SpecificationRepository.DeleteBatch(slist, trans); goods_SpecificationRepository.DeleteBatch(slist);
goods_SpecificationValueRepository.DeleteBatch(svlist, trans); goods_SpecificationValueRepository.DeleteBatch(svlist);
goods_SpecificationPriceRepository.DeleteBatch(splist, trans); goods_SpecificationPriceRepository.DeleteBatch(splist);
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()
...@@ -4401,7 +4407,7 @@ namespace Mall.Module.Product ...@@ -4401,7 +4407,7 @@ namespace Mall.Module.Product
Sort = item.Sort, Sort = item.Sort,
Status = 0, Status = 0,
TenantId = demodel.TenantId TenantId = demodel.TenantId
}, trans); });
if (sid > 0) if (sid > 0)
{ {
foreach (var qitem in item.SpecificationValueList) foreach (var qitem in item.SpecificationValueList)
...@@ -4418,7 +4424,7 @@ namespace Mall.Module.Product ...@@ -4418,7 +4424,7 @@ namespace Mall.Module.Product
Status = 0, Status = 0,
TenantId = demodel.TenantId, TenantId = demodel.TenantId,
SpecificationId = sid SpecificationId = sid
}, trans); });
} }
} }
} }
...@@ -4440,7 +4446,7 @@ namespace Mall.Module.Product ...@@ -4440,7 +4446,7 @@ namespace Mall.Module.Product
UpdateDate = demodel.UpdateDate, UpdateDate = demodel.UpdateDate,
Commission = item.Commission, Commission = item.Commission,
CostMoney = item.CostMoney CostMoney = item.CostMoney
}, trans); });
} }
} }
else else
...@@ -4463,13 +4469,13 @@ namespace Mall.Module.Product ...@@ -4463,13 +4469,13 @@ namespace Mall.Module.Product
OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
} }
}; };
bool flag1 = goods_SpecificationRepository.Update(keyValues1, wheres1, trans); bool flag1 = goods_SpecificationRepository.Update(keyValues1, wheres1);
if (flag1) if (flag1)
{ {
var sv2list = svlist.Where(x => x.SpecificationId == item.Id).ToList(); var sv2list = svlist.Where(x => x.SpecificationId == item.Id).ToList();
if (sv2list.Count() != supmodel.SpecificationValueList.Count() || sv2list.Count() != supmodel.SpecificationValueList.Where(x => x.Id > 0).Count()) if (sv2list.Count() != supmodel.SpecificationValueList.Count() || sv2list.Count() != supmodel.SpecificationValueList.Where(x => x.Id > 0).Count())
{ {
goods_SpecificationValueRepository.DeleteBatch(sv2list, trans); goods_SpecificationValueRepository.DeleteBatch(sv2list);
foreach (var qitem in supmodel.SpecificationValueList) foreach (var qitem in supmodel.SpecificationValueList)
{ {
goods_SpecificationValueRepository.Insert(new RB_Goods_SpecificationValue() goods_SpecificationValueRepository.Insert(new RB_Goods_SpecificationValue()
...@@ -4484,7 +4490,7 @@ namespace Mall.Module.Product ...@@ -4484,7 +4490,7 @@ namespace Mall.Module.Product
Status = 0, Status = 0,
TenantId = demodel.TenantId, TenantId = demodel.TenantId,
SpecificationId = item.Id SpecificationId = item.Id
}, trans); });
} }
} }
else else
...@@ -4504,7 +4510,7 @@ namespace Mall.Module.Product ...@@ -4504,7 +4510,7 @@ namespace Mall.Module.Product
OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
} }
}; };
goods_SpecificationValueRepository.Update(keyValues2, wheres2, trans); goods_SpecificationValueRepository.Update(keyValues2, wheres2);
} }
} }
} }
...@@ -4512,7 +4518,7 @@ namespace Mall.Module.Product ...@@ -4512,7 +4518,7 @@ namespace Mall.Module.Product
//价格新增/更新 //价格新增/更新
if (splist.Count() != demodel.SpecificationPriceList.Count() || splist.Count() != demodel.SpecificationPriceList.Where(x => splist.Select(y => y.SpecificationSort).Contains(x.SpecificationSort)).Count()) if (splist.Count() != demodel.SpecificationPriceList.Count() || splist.Count() != demodel.SpecificationPriceList.Where(x => splist.Select(y => y.SpecificationSort).Contains(x.SpecificationSort)).Count())
{ {
goods_SpecificationPriceRepository.DeleteBatch(splist, trans); goods_SpecificationPriceRepository.DeleteBatch(splist);
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()
...@@ -4531,7 +4537,7 @@ namespace Mall.Module.Product ...@@ -4531,7 +4537,7 @@ namespace Mall.Module.Product
UpdateDate = demodel.UpdateDate, UpdateDate = demodel.UpdateDate,
Commission = item.Commission, Commission = item.Commission,
CostMoney = item.CostMoney CostMoney = item.CostMoney
}, trans); });
} }
} }
else else
...@@ -4556,7 +4562,7 @@ namespace Mall.Module.Product ...@@ -4556,7 +4562,7 @@ namespace Mall.Module.Product
OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
} }
}; };
goods_SpecificationPriceRepository.Update(keyValues1, wheres1, trans); goods_SpecificationPriceRepository.Update(keyValues1, wheres1);
} }
} }
} }
...@@ -4569,7 +4575,7 @@ namespace Mall.Module.Product ...@@ -4569,7 +4575,7 @@ namespace Mall.Module.Product
//价格新增/更新 //价格新增/更新
if (splist.Count() != demodel.SpecificationPriceList.Count() || splist.Count() != demodel.SpecificationPriceList.Where(x => splist.Select(y => y.SpecificationSort).Contains(x.SpecificationSort)).Count()) if (splist.Count() != demodel.SpecificationPriceList.Count() || splist.Count() != demodel.SpecificationPriceList.Where(x => splist.Select(y => y.SpecificationSort).Contains(x.SpecificationSort)).Count())
{ {
goods_SpecificationPriceRepository.DeleteBatch(splist, trans); goods_SpecificationPriceRepository.DeleteBatch(splist);
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()
...@@ -4588,7 +4594,7 @@ namespace Mall.Module.Product ...@@ -4588,7 +4594,7 @@ namespace Mall.Module.Product
UpdateDate = demodel.UpdateDate, UpdateDate = demodel.UpdateDate,
Commission = item.Commission, Commission = item.Commission,
CostMoney = item.CostMoney CostMoney = item.CostMoney
}, trans); });
} }
} }
else else
...@@ -4613,7 +4619,7 @@ namespace Mall.Module.Product ...@@ -4613,7 +4619,7 @@ namespace Mall.Module.Product
OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
} }
}; };
goods_SpecificationPriceRepository.Update(keyValues1, wheres1, trans); goods_SpecificationPriceRepository.Update(keyValues1, wheres1);
} }
} }
} }
...@@ -4636,11 +4642,11 @@ namespace Mall.Module.Product ...@@ -4636,11 +4642,11 @@ namespace Mall.Module.Product
MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
Status = 0, Status = 0,
TenantId = demodel.TenantId TenantId = demodel.TenantId
}, trans); });
} }
foreach (var item in deleteList1) foreach (var item in deleteList1)
{ {
goods_AreaRepository.Delete(item.Id, trans); goods_AreaRepository.Delete(item.Id);
} }
...@@ -4656,7 +4662,7 @@ namespace Mall.Module.Product ...@@ -4656,7 +4662,7 @@ namespace Mall.Module.Product
|| dclist.Select(x => x.DistributorGrade).Distinct().Count() != demodel.DistributionCommissionList.Select(x => x.DistributorGrade).Distinct().Count() || dclist.Select(x => x.DistributorGrade).Distinct().Count() != demodel.DistributionCommissionList.Select(x => x.DistributorGrade).Distinct().Count()
|| dclist.Select(x => x.DistributorGrade).Distinct().Count() != dclist.Select(x => x.DistributorGrade).Distinct().Where(x => demodel.DistributionCommissionList.Select(y => y.DistributorGrade).Distinct().Contains(x)).Count()) || dclist.Select(x => x.DistributorGrade).Distinct().Count() != dclist.Select(x => x.DistributorGrade).Distinct().Where(x => demodel.DistributionCommissionList.Select(y => y.DistributorGrade).Distinct().Contains(x)).Count())
{ {
goods_DistributionCommissionRepository.DeleteBatch(dclist, trans); goods_DistributionCommissionRepository.DeleteBatch(dclist);
foreach (var item in demodel.DistributionCommissionList) foreach (var item in demodel.DistributionCommissionList)
{ {
goods_DistributionCommissionRepository.Insert(new RB_Goods_DistributionCommission() goods_DistributionCommissionRepository.Insert(new RB_Goods_DistributionCommission()
...@@ -4673,7 +4679,7 @@ namespace Mall.Module.Product ...@@ -4673,7 +4679,7 @@ namespace Mall.Module.Product
Status = 0, Status = 0,
TenantId = demodel.TenantId, TenantId = demodel.TenantId,
UpdateDate = demodel.UpdateDate UpdateDate = demodel.UpdateDate
}, trans); });
} }
} }
else else
...@@ -4696,7 +4702,7 @@ namespace Mall.Module.Product ...@@ -4696,7 +4702,7 @@ namespace Mall.Module.Product
OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
} }
}; };
goods_DistributionCommissionRepository.Update(keyValues1, wheres1, trans); goods_DistributionCommissionRepository.Update(keyValues1, wheres1);
} }
} }
} }
...@@ -4711,7 +4717,7 @@ namespace Mall.Module.Product ...@@ -4711,7 +4717,7 @@ namespace Mall.Module.Product
|| mplist.Select(x => x.MemberGrade).Distinct().Count() != demodel.MemberPriceList.Select(x => x.MemberGrade).Distinct().Count() || mplist.Select(x => x.MemberGrade).Distinct().Count() != demodel.MemberPriceList.Select(x => x.MemberGrade).Distinct().Count()
|| mplist.Select(x => x.MemberGrade).Distinct().Count() != mplist.Select(x => x.MemberGrade).Distinct().Where(x => demodel.MemberPriceList.Select(y => y.MemberGrade).Distinct().Contains(x)).Count()) || mplist.Select(x => x.MemberGrade).Distinct().Count() != mplist.Select(x => x.MemberGrade).Distinct().Where(x => demodel.MemberPriceList.Select(y => y.MemberGrade).Distinct().Contains(x)).Count())
{ {
goods_MemberPriceRepository.DeleteBatch(mplist, trans); goods_MemberPriceRepository.DeleteBatch(mplist);
foreach (var item in demodel.MemberPriceList) foreach (var item in demodel.MemberPriceList)
{ {
goods_MemberPriceRepository.Insert(new RB_Goods_MemberPrice() goods_MemberPriceRepository.Insert(new RB_Goods_MemberPrice()
...@@ -4726,7 +4732,7 @@ namespace Mall.Module.Product ...@@ -4726,7 +4732,7 @@ namespace Mall.Module.Product
Status = 0, Status = 0,
TenantId = demodel.TenantId, TenantId = demodel.TenantId,
UpdateDate = demodel.UpdateDate UpdateDate = demodel.UpdateDate
}, trans); });
} }
} }
else else
...@@ -4747,7 +4753,7 @@ namespace Mall.Module.Product ...@@ -4747,7 +4753,7 @@ namespace Mall.Module.Product
OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
} }
}; };
goods_MemberPriceRepository.Update(keyValues1, wheres1, trans); goods_MemberPriceRepository.Update(keyValues1, wheres1);
} }
} }
} }
...@@ -4833,7 +4839,7 @@ namespace Mall.Module.Product ...@@ -4833,7 +4839,7 @@ namespace Mall.Module.Product
} }
else else
{ {
int Id = goodsRepository.Insert(demodel, trans); int Id = goodsRepository.Insert(demodel);
bool flag = Id > 0; bool flag = Id > 0;
if (flag) if (flag)
{ {
...@@ -4849,7 +4855,7 @@ namespace Mall.Module.Product ...@@ -4849,7 +4855,7 @@ namespace Mall.Module.Product
MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
Status = 0, Status = 0,
TenantId = demodel.TenantId TenantId = demodel.TenantId
}, trans); });
} }
//插入规格 //插入规格
if (demodel.IsCustomSpecification == 1) if (demodel.IsCustomSpecification == 1)
...@@ -4867,7 +4873,7 @@ namespace Mall.Module.Product ...@@ -4867,7 +4873,7 @@ namespace Mall.Module.Product
Sort = item.Sort, Sort = item.Sort,
Status = 0, Status = 0,
TenantId = demodel.TenantId TenantId = demodel.TenantId
}, trans); });
if (sid > 0) if (sid > 0)
{ {
foreach (var qitem in item.SpecificationValueList) foreach (var qitem in item.SpecificationValueList)
...@@ -4884,7 +4890,7 @@ namespace Mall.Module.Product ...@@ -4884,7 +4890,7 @@ namespace Mall.Module.Product
Status = 0, Status = 0,
TenantId = demodel.TenantId, TenantId = demodel.TenantId,
SpecificationId = sid SpecificationId = sid
}, trans); });
} }
} }
} }
...@@ -4906,7 +4912,7 @@ namespace Mall.Module.Product ...@@ -4906,7 +4912,7 @@ namespace Mall.Module.Product
UpdateDate = demodel.UpdateDate, UpdateDate = demodel.UpdateDate,
Commission = item.Commission, Commission = item.Commission,
CostMoney = item.CostMoney CostMoney = item.CostMoney
}, trans); });
} }
} }
//插入区域 //插入区域
...@@ -4922,7 +4928,7 @@ namespace Mall.Module.Product ...@@ -4922,7 +4928,7 @@ namespace Mall.Module.Product
MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
Status = 0, Status = 0,
TenantId = demodel.TenantId TenantId = demodel.TenantId
}, trans); });
} }
//插入卡卷 //插入卡卷
//插入分销佣金 //插入分销佣金
...@@ -4944,7 +4950,7 @@ namespace Mall.Module.Product ...@@ -4944,7 +4950,7 @@ namespace Mall.Module.Product
Status = 0, Status = 0,
TenantId = demodel.TenantId, TenantId = demodel.TenantId,
UpdateDate = demodel.UpdateDate UpdateDate = demodel.UpdateDate
}, trans); });
} }
} }
//插入会员价格 //插入会员价格
...@@ -4964,18 +4970,17 @@ namespace Mall.Module.Product ...@@ -4964,18 +4970,17 @@ namespace Mall.Module.Product
Status = 0, Status = 0,
TenantId = demodel.TenantId, TenantId = demodel.TenantId,
UpdateDate = demodel.UpdateDate UpdateDate = demodel.UpdateDate
}, trans); });
} }
} }
} }
} }
goodsRepository.DBSession.Commit();
return true; return true;
} }
catch (Exception ex) catch (Exception ex)
{ {
LogHelper.Write(ex, "SetProductGoodsInfo"); LogHelper.Write(ex, "SetProductGoodsInfo:"+Common.Plugin.JsonHelper.Serialize(demodel));
goodsRepository.DBSession.Rollback();
return false; return false;
} }
} }
...@@ -5615,7 +5620,7 @@ namespace Mall.Module.Product ...@@ -5615,7 +5620,7 @@ namespace Mall.Module.Product
/// <param name="tenantId"></param> /// <param name="tenantId"></param>
/// <param name="mallBaseId"></param> /// <param name="mallBaseId"></param>
/// <returns></returns> /// <returns></returns>
public string SetGoodsCategoryTransfer(int categoryId, int newCategoryId, int tenantId, int mallBaseId,int empId) public string SetGoodsCategoryTransfer(int categoryId, int newCategoryId, int tenantId, int mallBaseId, int empId)
{ {
var newModel = product_CategoryRepository.GetEntity(newCategoryId); var newModel = product_CategoryRepository.GetEntity(newCategoryId);
if (newModel == null) { return "新分类不存在"; } if (newModel == null) { return "新分类不存在"; }
...@@ -5624,7 +5629,8 @@ namespace Mall.Module.Product ...@@ -5624,7 +5629,8 @@ namespace Mall.Module.Product
var list = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { CategoryId = categoryId, TenantId = tenantId, MallBaseId = mallBaseId }); var list = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { CategoryId = categoryId, TenantId = tenantId, MallBaseId = mallBaseId });
if (list.Any()) if (list.Any())
{ {
foreach (var item in list) { foreach (var item in list)
{
//修改分类 //修改分类
Dictionary<string, object> keyValues = new Dictionary<string, object>() { Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Goods_Category.CategoryId),newCategoryId} { nameof(RB_Goods_Category.CategoryId),newCategoryId}
...@@ -5637,7 +5643,8 @@ namespace Mall.Module.Product ...@@ -5637,7 +5643,8 @@ namespace Mall.Module.Product
} }
}; };
bool flag = goods_CategoryRepository.Update(keyValues, wheres); bool flag = goods_CategoryRepository.Update(keyValues, wheres);
if (flag) { if (flag)
{
//记录该商品日志 //记录该商品日志
goods_LogRepository.Insert(new RB_Goods_Log() goods_LogRepository.Insert(new RB_Goods_Log()
{ {
...@@ -5653,7 +5660,8 @@ namespace Mall.Module.Product ...@@ -5653,7 +5660,8 @@ namespace Mall.Module.Product
} }
return "转移成功,总计:" + list.Count() + "商品"; return "转移成功,总计:" + list.Count() + "商品";
} }
else { else
{
return "该分类下未找到相关商品"; return "该分类下未找到相关商品";
} }
} }
......
...@@ -3968,7 +3968,16 @@ namespace Mall.Module.User ...@@ -3968,7 +3968,16 @@ namespace Mall.Module.User
{ {
string UserIds = member_UserRepository.GetMemberChildIdStr(demodel.UserId ?? 0); string UserIds = member_UserRepository.GetMemberChildIdStr(demodel.UserId ?? 0);
var list = member_UserRepository.GetPageListForFX(pageIndex, pageSize, out count, new RB_Member_User_Extend() { UserIds = UserIds, FXGradeId = demodel.FXGradeId, Name = demodel.Name, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); var list = member_UserRepository.GetPageListForFX(pageIndex, pageSize, out count,
new RB_Member_User_Extend()
{
UserIds = UserIds,
FXGradeId = demodel.FXGradeId,
Name = demodel.Name,
TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId,
SortNum = demodel.SortNum
});
List<object> RList = new List<object>(); List<object> RList = new List<object>();
if (list.Any()) if (list.Any())
{ {
......
...@@ -411,35 +411,42 @@ WHERE {where} group by g.Id order by g.CreateDate desc"; ...@@ -411,35 +411,42 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
{ {
where += $@" and g.{nameof(RB_Goods_Extend.CreateDate)} <='{dmodel.EndTime + " 23:59:59"}'"; where += $@" and g.{nameof(RB_Goods_Extend.CreateDate)} <='{dmodel.EndTime + " 23:59:59"}'";
} }
//默认综合【升序】
string orderBy = $" order by g.{nameof(RB_Goods_Extend.Sort)} asc"; string orderBy = $" order by g.{nameof(RB_Goods_Extend.Sort)} asc";
//上架时间【降序】
if (dmodel.OrderBy == 1) if (dmodel.OrderBy == 1)
{//最新 {
orderBy = $" order by g.{nameof(RB_Goods_Extend.CreateDate)} desc"; orderBy = $" order by g.{nameof(RB_Goods_Extend.CreateDate)} DESC";
}
//上架时间【升序】
else if (dmodel.OrderBy == 5)
{
orderBy = $" order by g.{nameof(RB_Goods_Extend.CreateDate)} ASC ";
} }
//价格低=>高【升序】
else if (dmodel.OrderBy == 2) else if (dmodel.OrderBy == 2)
{ {
//价格低-高 orderBy = $" order by g.{nameof(RB_Goods_Extend.SellingPrice)} ASC";
orderBy = $" order by g.{nameof(RB_Goods_Extend.SellingPrice)} asc";
} }
//价格高=>低【降序】
else if (dmodel.OrderBy == 3) else if (dmodel.OrderBy == 3)
{ {
//价格高-低 orderBy = $" order by g.{nameof(RB_Goods_Extend.SellingPrice)} DESC";
orderBy = $" order by g.{nameof(RB_Goods_Extend.SellingPrice)} desc";
} }
//销量高=>低【降序】
else if (dmodel.OrderBy == 4) else if (dmodel.OrderBy == 4)
{ {
//销量高-低 orderBy = $" order by g.{nameof(RB_Goods_Extend.SalesNum)} DESC ";
orderBy = $" order by g.{nameof(RB_Goods_Extend.SalesNum)} desc ";
} }
//上架时间升序 //销量低=>高【升序】
else if (dmodel.OrderBy == 5) else if (dmodel.OrderBy == 6)
{ {
orderBy = $" order by g.{nameof(RB_Goods_Extend.CreateDate)} ASC "; orderBy = $" order by g.{nameof(RB_Goods_Extend.SalesNum)} ASC ";
} }
//上架时间降序 //综合【降序】
else if (dmodel.OrderBy == 6) else if (dmodel.OrderBy == 7)
{ {
orderBy = $" order by g.{nameof(RB_Goods_Extend.CreateDate)} DESC "; orderBy = $" order by g.{nameof(RB_Goods_Extend.Sort)} DESC ";
} }
if (dmodel.IsSelectVideo == 1) if (dmodel.IsSelectVideo == 1)
......
...@@ -223,14 +223,17 @@ select * from RB_Member_User where {where} order by CreateDate desc ...@@ -223,14 +223,17 @@ select * from RB_Member_User where {where} order by CreateDate desc
/// <returns></returns> /// <returns></returns>
public List<RB_Member_User_Extend> GetPageListForFX(int pageIndex, int pageSize, out long rowCount, RB_Member_User_Extend dmodel) public List<RB_Member_User_Extend> GetPageListForFX(int pageIndex, int pageSize, out long rowCount, RB_Member_User_Extend dmodel)
{ {
string where = " 1=1 and d.Status=0 "; string where = " and d.Status=0 ";
string where2 = "";
if (dmodel.TenantId > 0) if (dmodel.TenantId > 0)
{ {
where += $@" and u.{nameof(RB_Member_User.TenantId)}={dmodel.TenantId}"; where += $@" and u.{nameof(RB_Member_User.TenantId)}={dmodel.TenantId}";
where2 += $@" and u.{nameof(RB_Member_User.TenantId)}={dmodel.TenantId}";
} }
if (dmodel.MallBaseId > 0) if (dmodel.MallBaseId > 0)
{ {
where += $@" and u.{nameof(RB_Member_User.MallBaseId)}={dmodel.MallBaseId}"; where += $@" and u.{nameof(RB_Member_User.MallBaseId)}={dmodel.MallBaseId}";
where2 += $@" and u.{nameof(RB_Member_User.MallBaseId)}={dmodel.MallBaseId}";
} }
if (!string.IsNullOrEmpty(dmodel.Name)) if (!string.IsNullOrEmpty(dmodel.Name))
{ {
...@@ -269,12 +272,34 @@ select * from RB_Member_User where {where} order by CreateDate desc ...@@ -269,12 +272,34 @@ select * from RB_Member_User where {where} order by CreateDate desc
where += $@" and d.{nameof(RB_Distributor_Info.FXGradeId)}={dmodel.FXGradeId}"; where += $@" and d.{nameof(RB_Distributor_Info.FXGradeId)}={dmodel.FXGradeId}";
} }
string sql = $@" StringBuilder builder = new StringBuilder();
select u.* from RB_Member_User u builder.AppendFormat(@"
inner join rb_distributor_info d on u.Id =d.UserId SELECT u.*
where {where} order by u.CreateDate desc FROM RB_Member_User u INNER JOIN rb_distributor_info d on u.Id =d.UserId
"; LEFT JOIN (
return GetPage<RB_Member_User_Extend>(pageIndex, pageSize, out rowCount, sql).ToList(); SELECT u.SuperiorId,COUNT(0) AS ReferralsNum
FROM rb_member_user u
WHERE 1=1 {1}
GROUP BY u.SuperiorId
) AS B ON U.Id=B.SuperiorId
WHERE 1=1 {0}
", where, where2);
string orderBy = " order by u.CreateDate desc ";
if (dmodel.SortNum == 1)
{
orderBy = " order by u.CreateDate ASC ";
}
else if (dmodel.SortNum == 2)
{
orderBy = " order by B.ReferralsNum DESC ";
}
else if (dmodel.SortNum == 3)
{
orderBy = " order by B.ReferralsNum ASC ";
}
builder.AppendFormat(orderBy);
return GetPage<RB_Member_User_Extend>(pageIndex, pageSize, out rowCount,builder.ToString()).ToList();
} }
/// <summary> /// <summary>
......
...@@ -15,6 +15,7 @@ using Mall.CacheManager.User; ...@@ -15,6 +15,7 @@ using Mall.CacheManager.User;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Mall.Common; using Mall.Common;
using Mall.Module.Product; using Mall.Module.Product;
using Mall.AOP;
namespace Mall.WebApi.Controllers.MallBase namespace Mall.WebApi.Controllers.MallBase
{ {
...@@ -25,7 +26,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -25,7 +26,8 @@ namespace Mall.WebApi.Controllers.MallBase
public class ProductController : BaseController public class ProductController : BaseController
{ {
private readonly ProductModule productModule = new ProductModule(); private readonly ProductModule productModule = AOPHelper.CreateAOPObject<ProductModule>();
#region 素材管理 #region 素材管理
/// <summary> /// <summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment