Commit 1720b8bb authored by liudong1993's avatar liudong1993
parents 6bef0e11 054c4e60
......@@ -191,23 +191,32 @@ namespace Mall.Module.Product
item.AttrList = AttrList;
}
}
////拼团价格列表
//List<RB_Groupbuy_Activity_Specificationprice_Extend> specificationpriceList = GetGroupbuyActivitySpecificationpriceListModule(new RB_Groupbuy_Activity_Specificationprice_Extend()
//{
// MallBaseId = query.MallBaseId,
// TenantId = query.TenantId,
// GoodsId = extModel.GoodId,
//});
////拼团阶梯价格列表
//List<RB_Groupbuy_Activity_Step_Extend> groupStepList = GetGroupBuyActivityListModule(new RB_Groupbuy_Activity_Step_Extend()
//{
// MallBaseId = query.MallBaseId,
// TenantId = query.TenantId,
// GoodId = extModel.GoodId,
//});
//拼团阶梯基础设置列表
List<RB_Groupbuy_Activity_Step_Extend> groupStepList = GetGroupBuyActivityListModule(new RB_Groupbuy_Activity_Step_Extend()
{
MallBaseId = query.MallBaseId,
TenantId = query.TenantId,
GoodId = extModel.GoodId,
});
//拼团阶梯价格设置列表
List<RB_Groupbuy_Activity_Step_Price_Extend> StepPriceList = GetGroupbuyActivitySpecificationpriceListModule(new RB_Groupbuy_Activity_Step_Price_Extend()
{
MallBaseId=query.MallBaseId,
TenantId=query.TenantId,
GoodId=extModel.GoodId,
});
if (groupStepList != null && groupStepList.Count > 0)
{
foreach (var item in groupStepList)
{
item.StepPriceList = StepPriceList?.Where(qitem => qitem.StepId == item.StepId)?.ToList() ?? new List<RB_Groupbuy_Activity_Step_Price_Extend>();
}
}
extModel.SpecificationList = specificationList;
extModel.SpecificationPriceList = specPriceList;
// extModel.GroupList = groupStepList;
extModel.GroupList = groupStepList;
}
return extModel;
}
......@@ -272,7 +281,7 @@ namespace Mall.Module.Product
{
flag = SetGoodsSpecificationModule(extModel);
//flag = SetGoodGroupStepModule(extModel);
flag = SetGoodGroupStepModule(extModel);
}
return flag;
}
......@@ -304,7 +313,6 @@ namespace Mall.Module.Product
specItem.Id = newSpecId;
flag = newSpecId > 0;
}
if (specItem.SpecificationValueList != null && specItem.SpecificationValueList.Count > 0)
{
foreach (var specValueItem in specItem.SpecificationValueList)
......@@ -378,9 +386,17 @@ namespace Mall.Module.Product
groupItem.TenantId = extModel.TenantId;
groupItem.MallBaseId = extModel.MallBaseId;
groupItem.GoodId = extModel.GoodId;
var newGroupId = stepRepository.Insert(groupItem);
flag = newGroupId > 0;
if (newGroupId > 0)
if (groupItem.StepId > 0)
{
flag = stepRepository.Update(groupItem);
}
else
{
var newStepId = stepRepository.Insert(groupItem);
groupItem.StepId = newStepId;
flag = newStepId > 0;
}
if (groupItem.StepId > 0)
{
if (groupItem.StepPriceList != null && groupItem.StepPriceList.Count > 0)
{
......@@ -390,7 +406,15 @@ namespace Mall.Module.Product
subItem.MallBaseId = extModel.MallBaseId;
subItem.TenantId = extModel.TenantId;
subItem.GoodId = extModel.GoodId;
var stepPriceId = groupbuy_Activity_Step_PriceRepository.Insert(subItem);
subItem.StepId = groupItem.StepId;
if (subItem.Id > 0)
{
flag = groupbuy_Activity_Step_PriceRepository.Update(subItem);
}
else
{
flag = groupbuy_Activity_Step_PriceRepository.Insert(subItem)>0;
}
}
}
}
......
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