Commit 4fc29488 authored by 吴春's avatar 吴春
parents 7fe4c33e 6a38fd26
...@@ -44,7 +44,7 @@ namespace Mall.Module.Product ...@@ -44,7 +44,7 @@ namespace Mall.Module.Product
/// </summary> /// </summary>
/// <param name="query"></param> /// <param name="query"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Groupbuy_Activity_Step_Extend> GetGroupBuyActivityListRepository(RB_Groupbuy_Activity_Step_Extend query) public List<RB_Groupbuy_Activity_Step_Extend> GetGroupBuyActivityListModule(RB_Groupbuy_Activity_Step_Extend query)
{ {
return stepRepository.GetGroupBuyActivityListRepository(query); return stepRepository.GetGroupBuyActivityListRepository(query);
} }
...@@ -94,9 +94,19 @@ namespace Mall.Module.Product ...@@ -94,9 +94,19 @@ namespace Mall.Module.Product
if (list != null && list.Count > 0) if (list != null && list.Count > 0)
{ {
string Ids = string.Join(",", list.Select(qitem => qitem.ActivityId)); string Ids = string.Join(",", list.Select(qitem => qitem.ActivityId));
List<RB_Groupbuy_Activity_Step_Extend> groupList = new List<RB_Groupbuy_Activity_Step_Extend>();
if (!string.IsNullOrEmpty(Ids)) if (!string.IsNullOrEmpty(Ids))
{ {
groupList= GetGroupBuyActivityListModule(new RB_Groupbuy_Activity_Step_Extend()
{
MallBaseId = query.MallBaseId,
TenantId = query.TenantId,
GoodIds = Ids
});
}
foreach (var item in list)
{
item.GroupList = groupList?.Where(qitem => qitem.GoodId == item.GoodId)?.ToList() ?? new List<RB_Groupbuy_Activity_Step_Extend>();
} }
} }
return list; return list;
...@@ -148,7 +158,7 @@ namespace Mall.Module.Product ...@@ -148,7 +158,7 @@ namespace Mall.Module.Product
GoodsId = extModel.GoodId, GoodsId = extModel.GoodId,
}); });
//拼团阶梯价格列表 //拼团阶梯价格列表
List<RB_Groupbuy_Activity_Step_Extend> groupStepList = GetGroupBuyActivityListRepository(new RB_Groupbuy_Activity_Step_Extend() List<RB_Groupbuy_Activity_Step_Extend> groupStepList = GetGroupBuyActivityListModule(new RB_Groupbuy_Activity_Step_Extend()
{ {
MallBaseId = query.MallBaseId, MallBaseId = query.MallBaseId,
TenantId = query.TenantId, TenantId = query.TenantId,
...@@ -215,6 +225,52 @@ namespace Mall.Module.Product ...@@ -215,6 +225,52 @@ namespace Mall.Module.Product
extModel.ActivityId = newId; extModel.ActivityId = newId;
flag = newId > 0; flag = newId > 0;
} }
if (flag)
{
if (extModel.SpecificationList != null && extModel.SpecificationList.Count>0)
{
foreach (var specItem in extModel.SpecificationList)
{
specItem.TenantId = extModel.TenantId;
specItem.MallBaseId = extModel.MallBaseId;
specItem.GoodsId = extModel.GoodId;
var newSpecId = groupbuy_Activity_SpecificationRepository.Insert(specItem);
if (specItem.SpecificationValueList != null && specItem.SpecificationValueList.Count > 0)
{
foreach (var specValueItem in specItem.SpecificationValueList)
{
specValueItem.MallBaseId = extModel.MallBaseId;
specValueItem.TenantId = extModel.TenantId;
specValueItem.SpecificationId = newSpecId;
specValueItem.GoodsId = extModel.GoodId;
var newSpecValueId = groupbuy_Activity_SpecificationValueRepository.Insert(specValueItem);
}
}
}
}
if (extModel.GroupList != null && extModel.GroupList.Count > 0)
{
foreach (var groupItem in extModel.GroupList)
{
groupItem.TenantId = extModel.TenantId;
groupItem.MallBaseId = extModel.MallBaseId;
groupItem.GoodId = extModel.GoodId;
var newGroupId = stepRepository.Insert(groupItem);
if (newGroupId > 0)
{
foreach (var priceItem in extModel.SpecificationPriceList)
{
priceItem.MallBaseId = extModel.MallBaseId;
priceItem.TenantId = extModel.TenantId;
priceItem.GoodsId = extModel.GoodId;
priceItem.StepId = newGroupId;
groupbuy_Activity_SpecificationPriceRepository.Insert(priceItem);
}
}
}
}
}
return flag; return flag;
} }
} }
......
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