Commit 804f6fae authored by 吴春's avatar 吴春

提交代码

parent ee0b7bb6
......@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Product;
using Mall.Model.Entity.BaseSetUp;
using Mall.Model.Extend.BaseSetUp;
namespace Mall.Model.Extend.Product
{
......@@ -189,7 +190,7 @@ namespace Mall.Model.Extend.Product
/// <summary>
/// 商品分类包邮规则
/// </summary>
public List<RB_FreeShipping> FreeShippingList { get; set; }
public RB_FreeShipping_Extend FreeShippingModel { get; set; }
}
}
......@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Product;
using Mall.Model.Extend.BaseSetUp;
namespace Mall.Model.Extend.Product
{
......@@ -66,5 +67,15 @@ namespace Mall.Model.Extend.Product
/// 库存数量
/// </summary>
public int? InventoryNum { get; set; }
/// <summary>
/// 供应商ids 2020-08-04 Add By:W
/// </summary>
public string SupplierIds { get; set; }
/// <summary>
/// 商品分类包邮规则
/// </summary>
public RB_FreeShipping_Extend FreeShippingModel { get; set; }
}
}
......@@ -1002,6 +1002,20 @@ namespace Mall.Module.BaseSetUp
return model;
}
/// <summary>
/// 物流规则列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_FreeShipping_Extend> GetFreeShippingListByCategoryIds(RB_FreeShipping_Extend query)
{
return freeShippingRepository.GetFreeShippingListByCategoryIds(query);
}
/// <summary>
/// 新增/修改分类包邮基础信息
/// </summary>
......
This diff is collapsed.
......@@ -8,6 +8,7 @@ using Mall.Common.API;
using Mall.Common.Plugin;
using Mall.Model.Entity.Product;
using Mall.Model.Entity.User;
using Mall.Model.Extend.BaseSetUp;
using Mall.Model.Extend.Product;
using Mall.Model.Extend.User;
using Mall.Model.Query;
......@@ -16,6 +17,7 @@ using Mall.Repository.BaseSetUp;
using Mall.Repository.Product;
using Mall.Repository.User;
using Newtonsoft.Json;
using NPOI.SS.Formula.Functions;
using VT.FW.DB;
namespace Mall.Module.Product
......@@ -158,7 +160,7 @@ namespace Mall.Module.Product
/// </summary>
private readonly RB_Distributor_FXGradeRepository distributor_FXGradeRepository = new RB_Distributor_FXGradeRepository();
private RB_FreeShippingRepository freeShippingRepository = new RB_FreeShippingRepository();
......@@ -1049,6 +1051,24 @@ namespace Mall.Module.Product
#region 基本信息
//查询分类
model.CategoryList = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId });
//2020-08-05 根据分类查找商品对应的分类包邮规则 add by :W
if (model.CategoryList != null && model.CategoryList.Any())
{
string categoryIds = string.Join(",", model.CategoryList.Select(x => x.CategoryId));
var freeShippingList = freeShippingRepository.GetFreeShippingListByCategoryIds(new RB_FreeShipping_Extend { MallBaseId = model.MallBaseId, TenantId = model.TenantId, CategoryIds = categoryIds });
if (freeShippingList != null && freeShippingList.Any())
{
var fullNumPinkageModel = freeShippingList.Where(x => x.IsFreeShipping == 1 && x.IsEnable == 1 && x.FullNumPinkage > 0).OrderBy(x => x.FullNumPinkage).FirstOrDefault();
if (fullNumPinkageModel == null || fullNumPinkageModel.ID <= 0)
{
fullNumPinkageModel = freeShippingList.Where(x => x.IsFreeShipping == 1 && x.IsEnable == 1 && x.FullMoneyPinkage > 0).OrderBy(x => x.FullMoneyPinkage).FirstOrDefault();
}
model.FreeShippingModel = (fullNumPinkageModel == null || fullNumPinkageModel.ID <= 0) ? new RB_FreeShipping_Extend() : fullNumPinkageModel;
}
}
//最大售价
decimal MaxSellMoney = model.SellingPrice ?? 0;
model.SpecificationList = new List<RB_Goods_Specification_Extend>();
......@@ -1915,6 +1935,9 @@ namespace Mall.Module.Product
is_quick_shop = model.IsQuickBuy,
is_sell_well = model.IsSellWell,
is_negotiable = model.IsGoodsNegotiable,
freeShippingName = model.FreeShippingModel.Name,
fullMoneyPinkage = model.FreeShippingModel.FullMoneyPinkage,
fullNumPinkage = model.FreeShippingModel.FullNumPinkage,
cats = model.CategoryList.Select(x => new
{
x.CategoryId,
......@@ -6083,6 +6106,19 @@ namespace Mall.Module.Product
#endregion
#region 分类包邮规则信息
/// <summary>
/// 物流规则列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_FreeShipping_Extend> GetFreeShippingListByCategoryIds(RB_FreeShipping_Extend query)
{
return freeShippingRepository.GetFreeShippingListByCategoryIds(query);
}
#endregion
}
}
......@@ -90,21 +90,18 @@ namespace Mall.Repository.BaseSetUp
INNER JOIN rb_mallbase as c on a.MallBaseId = c.ID and a.TenantId = c.TenantId WHERE a.{nameof(RB_FreeShipping_Extend.Status)}=0 ");
if (query != null)
{
if (query.ID > 0)
{
builder.Append($" AND {nameof(RB_FreeShipping_Extend.ID)}={query.ID}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_FreeShipping_Extend.TenantId)}={query.TenantId}");
builder.Append($" AND a.{nameof(RB_FreeShipping_Extend.TenantId)}={query.TenantId}");
}
if (query.MallBaseId > 0)
{
builder.Append($" AND {nameof(RB_FreeShipping_Extend.MallBaseId)}={query.MallBaseId}");
builder.Append($" AND a.{nameof(RB_FreeShipping_Extend.MallBaseId)}={query.MallBaseId}");
}
if (!string.IsNullOrWhiteSpace(query.CategoryIds))
{
builder.Append($" AND {nameof(RB_FreeShippingCategory_Extend.CategoryId)} in({query.CategoryIds})");
builder.Append($" AND b.{nameof(RB_FreeShippingCategory_Extend.CategoryId)} in({query.CategoryIds})");
}
}
return Get<RB_FreeShipping_Extend>(builder.ToString()).ToList();
......
......@@ -63,7 +63,10 @@ namespace Mall.WebApi.Controllers.MallBase
x.GoodsStatus,
x.TenantId,
x.MallBaseId,
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
FreeShippingName = x.FreeShippingModel.Name,
FreeShippingFullMoneyPinkage = x.FreeShippingModel.FullMoneyPinkage,
FreeShippingFullNumPinkage = x.FreeShippingModel.FullNumPinkage,
});
List<object> robj = new List<object>() {
new {
......
......@@ -15,6 +15,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Mall.AOP\Mall.AOP.csproj" />
<ProjectReference Include="..\Mall.CacheManager\Mall.CacheManager.csproj" />
<ProjectReference Include="..\Mall.Common\Mall.Common.csproj" />
<ProjectReference Include="..\Mall.DataHelper\Mall.DataHelper.csproj" />
......
......@@ -22,6 +22,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB;
namespace Mall.WindowsService.Module
{
......
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