Commit a04a38fb authored by 吴春's avatar 吴春

解决冲突

parents 8a298d62 253f1731
......@@ -139,5 +139,14 @@ namespace Mall.Model.Entity.Product
set;
}
/// <summary>
/// 规格Id
/// </summary>
public int SpecificationId { get; set; }
/// <summary>
/// 规格值Id
/// </summary>
public int SpecificationValueId { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Mall.Model.Entity.Product
{
/// <summary>
/// 拼团价格实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Groupbuy_Activity_Step_Price
{
/// <summary>
/// 主键编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 阶梯编号
/// </summary>
public int StepId { get; set; }
/// <summary>
/// 商品编号
/// </summary>
public int GoodId { get; set; }
/// <summary>
/// 商户编号
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序编号
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 拼团价格
/// </summary>
public decimal PinTuanPrice { get; set; }
/// <summary>
/// 拼团库存
/// </summary>
public int PinTuanStock { get; set; }
}
}
using System;
using Mall.Model.Extend.Product;
using System;
using System.Collections.Generic;
using VT.FW.DB;
namespace Mall.Model.Entity.Product
{
/// <summary>
......@@ -8,11 +11,16 @@ namespace Mall.Model.Entity.Product
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Groupbuy_Activity_Step_Extend: RB_Groupbuy_Activity_Step
public class RB_Groupbuy_Activity_Step_Extend : RB_Groupbuy_Activity_Step
{
/// <summary>
/// 商品编号
/// </summary>
public string GoodIds { get; set; }
public string GoodIds { get; set; }
/// <summary>
/// 阶梯价格列表
/// </summary>
public List<RB_Groupbuy_Activity_Step_Price_Extend> StepPriceList { get; set; }
}
}
using Mall.Model.Entity.Product;
using System;
using VT.FW.DB;
namespace Mall.Model.Extend.Product
{
/// <summary>
/// 拼团价格扩展实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Groupbuy_Activity_Step_Price_Extend : RB_Groupbuy_Activity_Step_Price
{
/// <summary>
/// 商品编号
/// </summary>
public string GoodsIds { get; set; }
}
}
......@@ -248,9 +248,9 @@ namespace Mall.Module.User
{
//查询出所有商品id
string goodsIds = string.Join(",", goodsList.Select(x => x.GoodsId ?? 0).Distinct());
var glist = goodsRepository.GetSingleListForGoodsId(new RB_Goods_Extend() { GoodsIds = goodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
foreach (var item in glist)
{
var glist = goodsRepository.GetSingleList(new RB_Goods_Extend() { GoodsIds = goodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
foreach (var item in glist) {
item.CoverImage = "";
if (!string.IsNullOrEmpty(item.CarouselImage) && item.CarouselImage != "[]")
{
......
......@@ -30,6 +30,14 @@ WHERE 1=1
");
if (query != null)
{
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Groupbuy_Activity_Extend.MallBaseId), query.MallBaseId);
}
if (query.TenantId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Groupbuy_Activity_Extend.TenantId), query.TenantId);
}
//时间范围
if (!string.IsNullOrWhiteSpace(query.QStartDate) && !string.IsNullOrWhiteSpace(query.QEndDate))
{
......@@ -67,131 +75,22 @@ SELECT *
FROM RB_Groupbuy_Activity
WHERE 1=1
");
return Get<RB_Groupbuy_Activity_Extend>(builder.ToString()).FirstOrDefault();
}
}
/// <summary>
/// 拼团商品关联规格价格仓储层
/// </summary>
public class RB_Groupbuy_Activity_SpecificationPriceRepository : BaseRepository<RB_Groupbuy_Activity_Specificationprice>
{
/// <summary>
/// 获取拼团活动商品规格价格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Specificationprice_Extend> GetGroupbuyActivitySpecificationpriceListRepository(RB_Groupbuy_Activity_Specificationprice_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.Id)}={dmodel.Id}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.GoodsId)}={dmodel.GoodsId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.GoodsId)} in({dmodel.GoodsIds})";
}
string sql = $@"select * from rb_groupbuy_activity_specificationprice where {where} order by Id desc";
return Get<RB_Groupbuy_Activity_Specificationprice_Extend>(sql).ToList();
}
}
/// <summary>
/// 拼团活动商品关联规格值仓储层
/// </summary>
public class RB_Groupbuy_Activity_SpecificationValueRepository : BaseRepository<RB_Groupbuy_Activity_Specificationvalue>
{
/// <summary>
/// 获取拼团活动商品关联规格值列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Specificationvalue_Extend> GetGroupbuyActivitySpecificationValueListRepository(RB_Groupbuy_Activity_Specificationvalue_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.Id)}={dmodel.Id}";
}
if (dmodel.SpecificationId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.SpecificationId)}={dmodel.SpecificationId}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.GoodsId)}={dmodel.GoodsId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.GoodsId)} in({dmodel.GoodsIds})";
}
string sql = $@"select * from rb_groupbuy_activity_specificationvalue where {where} order by Id asc";
return Get<RB_Groupbuy_Activity_Specificationvalue_Extend>(sql).ToList();
}
}
/// <summary>
/// 拼团商品关联规格仓储层
/// </summary>
public class RB_Groupbuy_Activity_SpecificationRepository : BaseRepository<RB_Groupbuy_Activity_Specification>
{
/// <summary>
/// 获取拼团商品关联规格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Specification_Extend> GetGroupbuyActivitySpecificationListRepository(RB_Groupbuy_Activity_Specification_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Groupbuy_Activity_Specification_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.Id)}={dmodel.Id}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.GoodsId)}={dmodel.GoodsId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
if (query != null)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.GoodsId)} in({dmodel.GoodsIds})";
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Groupbuy_Activity_Extend.MallBaseId), query.MallBaseId);
}
if (query.TenantId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Groupbuy_Activity_Extend.TenantId), query.TenantId);
}
if (query.ActivityId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Groupbuy_Activity_Extend.ActivityId), query.ActivityId);
}
}
string sql = $@"select * from rb_groupbuy_activity_specification where {where} order by Id asc";
return Get<RB_Groupbuy_Activity_Specification_Extend>(sql).ToList();
return Get<RB_Groupbuy_Activity_Extend>(builder.ToString()).FirstOrDefault();
}
}
}
}
\ No newline at end of file
using Mall.Model.Entity.Product;
using Mall.Model.Extend.Product;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
namespace Mall.Repository.Product
{
/// <summary>
/// 拼团商品关联规格价格仓储层
/// </summary>
public class RB_Groupbuy_Activity_SpecificationPriceRepository : BaseRepository<RB_Groupbuy_Activity_Specificationprice>
{
/// <summary>
/// 获取拼团活动商品规格价格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Specificationprice_Extend> GetGroupbuyActivitySpecificationpriceListRepository(RB_Groupbuy_Activity_Specificationprice_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.Id)}={dmodel.Id}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.GoodsId)}={dmodel.GoodsId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationprice_Extend.GoodsId)} in({dmodel.GoodsIds})";
}
string sql = $@"select * from rb_groupbuy_activity_specificationprice where {where} order by Id desc";
return Get<RB_Groupbuy_Activity_Specificationprice_Extend>(sql).ToList();
}
}
/// <summary>
/// 拼团活动商品关联规格值仓储层
/// </summary>
public class RB_Groupbuy_Activity_SpecificationValueRepository : BaseRepository<RB_Groupbuy_Activity_Specificationvalue>
{
/// <summary>
/// 获取拼团活动商品关联规格值列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Specificationvalue_Extend> GetGroupbuyActivitySpecificationValueListRepository(RB_Groupbuy_Activity_Specificationvalue_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.Id)}={dmodel.Id}";
}
if (dmodel.SpecificationId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.SpecificationId)}={dmodel.SpecificationId}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.GoodsId)}={dmodel.GoodsId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specificationvalue_Extend.GoodsId)} in({dmodel.GoodsIds})";
}
string sql = $@"select * from rb_groupbuy_activity_specificationvalue where {where} order by Id asc";
return Get<RB_Groupbuy_Activity_Specificationvalue_Extend>(sql).ToList();
}
}
/// <summary>
/// 拼团商品关联规格仓储层
/// </summary>
public class RB_Groupbuy_Activity_SpecificationRepository : BaseRepository<RB_Groupbuy_Activity_Specification>
{
/// <summary>
/// 获取拼团商品关联规格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Specification_Extend> GetGroupbuyActivitySpecificationListRepository(RB_Groupbuy_Activity_Specification_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Groupbuy_Activity_Specification_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.Id)}={dmodel.Id}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.GoodsId)}={dmodel.GoodsId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and {nameof(RB_Groupbuy_Activity_Specification_Extend.GoodsId)} in({dmodel.GoodsIds})";
}
string sql = $@"select * from rb_groupbuy_activity_specification where {where} order by Id asc";
return Get<RB_Groupbuy_Activity_Specification_Extend>(sql).ToList();
}
}
}
using Mall.Model.Entity.Product;
using Mall.Model.Extend.Product;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mall.Repository.Product
{
/// <summary>
/// 拼团活动商品阶梯价格仓储层
/// </summary>
public class RB_Groupbuy_Activity_Step_PriceRepository : BaseRepository<RB_Groupbuy_Activity_Step_Price>
{
/// <summary>
/// 获取拼团活动商品规格价格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Groupbuy_Activity_Step_Price_Extend> GetGroupbuyActivitySpecificationpriceListRepository(RB_Groupbuy_Activity_Step_Price_Extend dmodel)
{
string where = $" 1=1 ";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Step_Price_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Step_Price_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Step_Price_Extend.Id)}={dmodel.Id}";
}
if (dmodel.GoodId > 0)
{
where += $@" and {nameof(RB_Groupbuy_Activity_Step_Price_Extend.GoodId)}={dmodel.GoodId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and {nameof(RB_Groupbuy_Activity_Step_Price_Extend.GoodId)} in({dmodel.GoodsIds})";
}
string sql = $@"select * from RB_Groupbuy_Activity_Step_Price where {where} order by Id desc";
return Get<RB_Groupbuy_Activity_Step_Price_Extend>(sql).ToList();
}
}
}
......@@ -41,7 +41,7 @@ namespace Mall.Repository.User
}
string sql = $@"select di.* from RB_SmallShops_Price_Extend di
string sql = $@"select di.* from RB_SmallShops_Price di
where {where} order by di.Id desc";
return Get<RB_SmallShops_Price_Extend>(sql).ToList();
}
......@@ -77,7 +77,7 @@ where {where} order by di.Id desc";
string sql = $@"
SELECT sp.GoodsId FROM rb_smallshops_price sp
INNER JOIN rb_goods g on sp.GoodsId=g.Id
{where}
where {where}
GROUP BY sp.GoodsId ORDER BY sp.CreateDate DESC
";
return GetPage<RB_SmallShops_Price_Extend>(pageIndex, pageSize, out count, sql).ToList();
......
......@@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks;
using Mall.AOP;
using Mall.Common.API;
using Mall.Common.Plugin;
using Mall.Model.Extend.Product;
using Mall.Model.Extend.User;
using Mall.Module.Product;
......@@ -12,6 +13,7 @@ using Mall.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
namespace Mall.WebApi.Controllers.Product
{
......@@ -24,14 +26,14 @@ namespace Mall.WebApi.Controllers.Product
/// <summary>
/// 拼团配置处理类对象
/// </summary>
private readonly GroupBuyConfigModule groupBuyConfigModule = new GroupBuyConfigModule();
private readonly Module.User.GroupBuyConfigModule groupBuyConfigModule = new Module.User.GroupBuyConfigModule();
/// <summary>
/// 拼团活动
/// </summary>
private readonly GroupBuyConfigActivityModule groupBuyConfigActivityModule = AOPHelper.CreateAOPObject<GroupBuyConfigActivityModule>();
private readonly Module.Product.GroupBuyActivityModule groupBuyConfigActivityModule = AOPHelper.CreateAOPObject<Module.Product.GroupBuyActivityModule>();
#region 拼团配置设置
/// <summary>
......@@ -115,7 +117,7 @@ namespace Mall.WebApi.Controllers.Product
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Groupbuy_Activity_Extend>(RequestParm.msg.ToString());
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
var extModel = groupBuyConfigActivityModule.GetGroupbuyActivityEntityModule(query);
var extModel = groupBuyConfigActivityModule.GetGroupbuyActivityEntityModule(query,isGetSpec:true);
return ApiResult.Success(data: extModel);
}
......@@ -135,5 +137,29 @@ namespace Mall.WebApi.Controllers.Product
bool flag = groupBuyConfigActivityModule.SetGroupbuyActivityModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 删除规格
/// </summary>
/// <returns></returns>
public ApiResult DeleteSpec()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var Id = parms.GetInt("Id");
bool flag = groupBuyConfigActivityModule.RemoveGroupBuySpecificationModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 删除规格值
/// </summary>
/// <returns></returns>
public ApiResult DeleteSpecValue()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var Id = parms.GetInt("Id");
bool flag = groupBuyConfigActivityModule.RemoveGroupBuySpecificationValueModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
}
}
\ No newline at end of file
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