Commit d0082dbe authored by 黄奎's avatar 黄奎

页面修改

parent 4fc29488
...@@ -193,5 +193,10 @@ namespace Mall.Model.Entity.Product ...@@ -193,5 +193,10 @@ namespace Mall.Model.Entity.Product
/// 商户编号 /// 商户编号
/// </summary> /// </summary>
public int TenantId { get; set; } public int TenantId { get; set; }
/// <summary>
/// 是否自定义规格 1是 2否
/// </summary>
public int IsCustomSpecification { get; set; }
} }
} }
...@@ -139,9 +139,5 @@ namespace Mall.Model.Entity.Product ...@@ -139,9 +139,5 @@ namespace Mall.Model.Entity.Product
set; set;
} }
/// <summary>
/// 阶梯编号
/// </summary>
public int StepId { get; set; }
} }
} }
...@@ -127,6 +127,9 @@ namespace Mall.Model.Extend.Product ...@@ -127,6 +127,9 @@ namespace Mall.Model.Extend.Product
/// </summary> /// </summary>
public List<RB_Groupbuy_Activity_Specificationprice_Extend> SpecificationPriceList { get; set; } public List<RB_Groupbuy_Activity_Specificationprice_Extend> SpecificationPriceList { get; set; }
/// <summary>
/// 服务列表
/// </summary>
public List<RB_ImageCommonModel> ServiceList { get; set; }
} }
} }
using Mall.Model.Extend.Product; using Mall.Model.Extend.Product;
using Mall.Repository.Product; using Mall.Repository.Product;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
using VT.FW.DB; using VT.FW.DB;
using System.Linq; using System.Linq;
using Mall.Model.Entity.Product; using Mall.Model.Entity.Product;
using Mall.AOP.CustomerAttribute;
namespace Mall.Module.Product namespace Mall.Module.Product
{ {
...@@ -176,7 +175,8 @@ namespace Mall.Module.Product ...@@ -176,7 +175,8 @@ namespace Mall.Module.Product
/// </summary> /// </summary>
/// <param name="extModel"></param> /// <param name="extModel"></param>
/// <returns></returns> /// <returns></returns>
public bool SetGroupbuyActivityModule(RB_Groupbuy_Activity_Extend extModel) [TransactionCallHandler]
public virtual bool SetGroupbuyActivityModule(RB_Groupbuy_Activity_Extend extModel)
{ {
bool flag = false; bool flag = false;
if (extModel.ActivityId > 0) if (extModel.ActivityId > 0)
...@@ -216,6 +216,7 @@ namespace Mall.Module.Product ...@@ -216,6 +216,7 @@ namespace Mall.Module.Product
{ nameof(RB_Groupbuy_Activity_Extend.CardIds),extModel.CardIds}, { nameof(RB_Groupbuy_Activity_Extend.CardIds),extModel.CardIds},
{ nameof(RB_Groupbuy_Activity_Extend.App_share_title),extModel.App_share_title}, { nameof(RB_Groupbuy_Activity_Extend.App_share_title),extModel.App_share_title},
{ nameof(RB_Groupbuy_Activity_Extend.App_share_pic),extModel.App_share_pic}, { nameof(RB_Groupbuy_Activity_Extend.App_share_pic),extModel.App_share_pic},
{ nameof(RB_Groupbuy_Activity_Extend.IsCustomSpecification),extModel.IsCustomSpecification},
}; };
flag = groupbuy_ActivityRepository.Update(fileds, new WhereHelper(nameof(RB_Groupbuy_Activity_Extend.ActivityId), extModel.ActivityId)); flag = groupbuy_ActivityRepository.Update(fileds, new WhereHelper(nameof(RB_Groupbuy_Activity_Extend.ActivityId), extModel.ActivityId));
} }
...@@ -227,14 +228,57 @@ namespace Mall.Module.Product ...@@ -227,14 +228,57 @@ namespace Mall.Module.Product
} }
if (flag) if (flag)
{ {
if (extModel.SpecificationList != null && extModel.SpecificationList.Count>0) flag= SetGoodsSpecificationModule(extModel);
flag= SetGoodGroupStepModule(extModel);
}
flag = false;
return flag;
}
/// <summary>
/// 添加修改商品规格
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
private bool SetGoodsSpecificationModule(RB_Groupbuy_Activity_Extend extModel)
{ {
bool flag = false;
if (extModel.IsCustomSpecification == 1)
{
var oldSpecList= GetGroupbuyActivitySpecificationListModule(new RB_Groupbuy_Activity_Specification_Extend()
{
MallBaseId = extModel.MallBaseId,
TenantId = extModel.TenantId,
GoodsId = extModel.GoodId,
});
if (oldSpecList.Count() != extModel.SpecificationList.Count() || oldSpecList.Count() != extModel.SpecificationList.Where(x => x.Id > 0).Count())
{
//删除规格
IList<WhereHelper> specWheres = new List<WhereHelper>()
{
new WhereHelper(nameof(RB_Groupbuy_Activity_Specification_Extend.TenantId),extModel.TenantId),
new WhereHelper(nameof(RB_Groupbuy_Activity_Specification_Extend.MallBaseId),extModel.MallBaseId),
new WhereHelper(nameof(RB_Groupbuy_Activity_Specification_Extend.GoodsId),extModel.GoodId),
};
groupbuy_Activity_SpecificationRepository.Delete(specWheres);
//删除值
IList<WhereHelper> specValuesWheres = new List<WhereHelper>()
{
new WhereHelper(nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.TenantId),extModel.TenantId),
new WhereHelper(nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.MallBaseId),extModel.MallBaseId),
new WhereHelper(nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.GoodsId),extModel.GoodId),
};
groupbuy_Activity_SpecificationValueRepository.Delete(specValuesWheres);
foreach (var specItem in extModel.SpecificationList) foreach (var specItem in extModel.SpecificationList)
{ {
specItem.TenantId = extModel.TenantId; specItem.TenantId = extModel.TenantId;
specItem.MallBaseId = extModel.MallBaseId; specItem.MallBaseId = extModel.MallBaseId;
specItem.GoodsId = extModel.GoodId; specItem.GoodsId = extModel.GoodId;
var newSpecId = groupbuy_Activity_SpecificationRepository.Insert(specItem); var newSpecId = groupbuy_Activity_SpecificationRepository.Insert(specItem);
specItem.Id = newSpecId;
if (specItem.SpecificationValueList != null && specItem.SpecificationValueList.Count > 0) if (specItem.SpecificationValueList != null && specItem.SpecificationValueList.Count > 0)
{ {
foreach (var specValueItem in specItem.SpecificationValueList) foreach (var specValueItem in specItem.SpecificationValueList)
...@@ -243,12 +287,27 @@ namespace Mall.Module.Product ...@@ -243,12 +287,27 @@ namespace Mall.Module.Product
specValueItem.TenantId = extModel.TenantId; specValueItem.TenantId = extModel.TenantId;
specValueItem.SpecificationId = newSpecId; specValueItem.SpecificationId = newSpecId;
specValueItem.GoodsId = extModel.GoodId; specValueItem.GoodsId = extModel.GoodId;
var newSpecValueId = groupbuy_Activity_SpecificationValueRepository.Insert(specValueItem); flag = groupbuy_Activity_SpecificationValueRepository.Insert(specValueItem) > 0;
} }
} }
} }
} }
else
{
}
}
return flag;
}
/// <summary>
/// 新增修改阶梯团价
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
private bool SetGoodGroupStepModule(RB_Groupbuy_Activity_Extend extModel)
{
bool flag = false;
if (extModel.GroupList != null && extModel.GroupList.Count > 0) if (extModel.GroupList != null && extModel.GroupList.Count > 0)
{ {
foreach (var groupItem in extModel.GroupList) foreach (var groupItem in extModel.GroupList)
...@@ -257,6 +316,7 @@ namespace Mall.Module.Product ...@@ -257,6 +316,7 @@ namespace Mall.Module.Product
groupItem.MallBaseId = extModel.MallBaseId; groupItem.MallBaseId = extModel.MallBaseId;
groupItem.GoodId = extModel.GoodId; groupItem.GoodId = extModel.GoodId;
var newGroupId = stepRepository.Insert(groupItem); var newGroupId = stepRepository.Insert(groupItem);
flag = newGroupId > 0;
if (newGroupId > 0) if (newGroupId > 0)
{ {
foreach (var priceItem in extModel.SpecificationPriceList) foreach (var priceItem in extModel.SpecificationPriceList)
...@@ -264,13 +324,12 @@ namespace Mall.Module.Product ...@@ -264,13 +324,12 @@ namespace Mall.Module.Product
priceItem.MallBaseId = extModel.MallBaseId; priceItem.MallBaseId = extModel.MallBaseId;
priceItem.TenantId = extModel.TenantId; priceItem.TenantId = extModel.TenantId;
priceItem.GoodsId = extModel.GoodId; priceItem.GoodsId = extModel.GoodId;
priceItem.StepId = newGroupId; //priceItem.StepId = newGroupId;
groupbuy_Activity_SpecificationPriceRepository.Insert(priceItem); groupbuy_Activity_SpecificationPriceRepository.Insert(priceItem);
} }
} }
} }
} }
}
return flag; return flag;
} }
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Mall.AOP\Mall.AOP.csproj" />
<ProjectReference Include="..\Mall.CacheManager\Mall.CacheManager.csproj" /> <ProjectReference Include="..\Mall.CacheManager\Mall.CacheManager.csproj" />
<ProjectReference Include="..\Mall.Common\Mall.Common.csproj" /> <ProjectReference Include="..\Mall.Common\Mall.Common.csproj" />
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" /> <ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
......
...@@ -75,6 +75,10 @@ namespace Mall.WebApi.Controllers ...@@ -75,6 +75,10 @@ namespace Mall.WebApi.Controllers
//背景插件 //背景插件
case "background": case "background":
var backgroundData = subItem.data as backgroundItem; var backgroundData = subItem.data as backgroundItem;
if (backgroundData != null && !string.IsNullOrWhiteSpace(backgroundData.backgroundPicUrl))
{
backgroundData.backgroundPicUrl = Common.Config.GetFileUrl(backgroundData.backgroundPicUrl);
}
obj = new obj = new
{ {
id = subItem.Id, id = subItem.Id,
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Mall.AOP;
using Mall.Common.API; using Mall.Common.API;
using Mall.Model.Extend.Product; using Mall.Model.Extend.Product;
using Mall.Model.Extend.User; using Mall.Model.Extend.User;
...@@ -25,10 +26,12 @@ namespace Mall.WebApi.Controllers.Product ...@@ -25,10 +26,12 @@ namespace Mall.WebApi.Controllers.Product
/// </summary> /// </summary>
private readonly GroupBuyConfigModule groupBuyConfigModule = new GroupBuyConfigModule(); private readonly GroupBuyConfigModule groupBuyConfigModule = new GroupBuyConfigModule();
/// <summary> /// <summary>
/// 拼团活动 /// 拼团活动
/// </summary> /// </summary>
private readonly GroupBuyConfigActivityModule groupBuyConfigActivityModule = new GroupBuyConfigActivityModule(); private readonly GroupBuyConfigActivityModule groupBuyConfigActivityModule = AOPHelper.CreateAOPObject<GroupBuyConfigActivityModule>();
#region 拼团配置设置 #region 拼团配置设置
/// <summary> /// <summary>
...@@ -125,6 +128,10 @@ namespace Mall.WebApi.Controllers.Product ...@@ -125,6 +128,10 @@ namespace Mall.WebApi.Controllers.Product
var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_Groupbuy_Activity_Extend>(RequestParm.msg.ToString()); var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_Groupbuy_Activity_Extend>(RequestParm.msg.ToString());
extModel.MallBaseId = RequestParm.MallBaseId; extModel.MallBaseId = RequestParm.MallBaseId;
extModel.TenantId = RequestParm.TenantId; extModel.TenantId = RequestParm.TenantId;
if (extModel.ServiceList != null && extModel.ServiceList.Count > 0)
{
extModel.GoodsService = Common.Plugin.JsonHelper.Serialize(extModel.ServiceList);
}
bool flag = groupBuyConfigActivityModule.SetGroupbuyActivityModule(extModel); bool flag = groupBuyConfigActivityModule.SetGroupbuyActivityModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
......
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