Commit 286855d3 authored by liudong1993's avatar liudong1993

分销订单调整

parent 0c2c258a
......@@ -878,11 +878,12 @@ namespace Mall.Module.Product
if (gmodel.GoodsClassify != 2) {
return ApiResult.Failed("有非网课类商品");
}
var categoryList = clist.Where(x => x.GoodsId == item.GoodsId).ToList();
item.CommissionPrice = gmodel.Commission;// 粉象 返佣金额
item.CostMoney = (gmodel.CostPrice ?? 0);
item.Specification = "[]";
item.SpecificationSort = "0";
item.PresentFXGrade = gmodel.PresentFXGrade ?? 0;//赠送粉象分销等级
item.PresentFXMonth = gmodel.PresentFXMonth ?? 0;
......@@ -1310,6 +1311,7 @@ namespace Mall.Module.Product
}
}
}
item.EducationCouponId = 0;
if (demodel.Use_Education_Id > 0)
{
var couponModel = GoodsCouponList.Where(x => x.GoodsId == item.GoodsId).FirstOrDefault();
......
......@@ -4881,6 +4881,46 @@ namespace Mall.Module.Product
return list;
}
/// <summary>
/// 获取下拉列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_Goods_Extend> GetProductGoodsDialogList_V2(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel)
{
var list = goodsRepository.GetProductGoodsDialogList_V2(pageIndex, pageSize, out count, demodel);
if (list.Any())
{
foreach (var item in list)
{
//轮播图
item.CoverImage = "";
item.CarouselImageList = new List<RB_ImageCommonModel>();
if (!string.IsNullOrEmpty(item.CarouselImage) && item.CarouselImage != "[]")
{
List<string> CarouselIdList = JsonConvert.DeserializeObject<List<string>>(item.CarouselImage);
//封面图
item.CoverImage = CarouselIdList[0];
//轮播图
//轮播图
foreach (var qitem in CarouselIdList)
{
item.CarouselImageList.Add(new RB_ImageCommonModel()
{
Id = 0,
Name = "",
Path = qitem
});
}
}
}
}
return list;
}
/// <summary>
/// 获取后台商品分页列表
......
......@@ -144,7 +144,132 @@ where {where} group by g.Id order by {orderBy}";
return GetPage<RB_Goods_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowCount"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_Extend> GetProductGoodsDialogList_V2(int pageIndex, int pageSize, out long rowCount, RB_Goods_Extend dmodel)
{
string where = $" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0 ";
where += $@" and g.GoodsClassify <> 1";//排除司导的
if (dmodel.TenantId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.NotTenantId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.TenantId)}<>{dmodel.NotTenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)}={dmodel.Id}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and g.{nameof(RB_Goods_Extend.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.GoodsStatus > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.GoodsStatus)}={dmodel.GoodsStatus}";
}
if (dmodel.IsSelectSellOut == 1)
{
where += $@" and g.{nameof(RB_Goods_Extend.InventoryNum)}<=0";
}
if (!string.IsNullOrEmpty(dmodel.CategoryIds))
{
where += $@" and c.{nameof(RB_Goods_Category.CategoryId)} in({dmodel.CategoryIds})";
}
if (!string.IsNullOrEmpty(dmodel.StartTime))
{
where += $@" and g.{nameof(RB_Goods_Extend.CreateDate)} >='{dmodel.StartTime}'";
}
if (!string.IsNullOrEmpty(dmodel.EndTime))
{
where += $@" and g.{nameof(RB_Goods_Extend.CreateDate)} <='{dmodel.EndTime + " 23:59:59"}'";
}
if (dmodel.IsProcurement > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsProcurement)}={dmodel.IsProcurement}";
}
if (dmodel.IsProxy > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsProxy)}={dmodel.IsProxy}";
}
if (dmodel.SupplierId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.SupplierId)}={dmodel.SupplierId}";
}
if (dmodel.GoodsPageType.HasValue)
{
if (dmodel.GoodsPageType == Common.Enum.Goods.GoodsPageTypeEnum.Mall)
{
where += $@" and g.{nameof(RB_Goods_Extend.GoodsPageType)} in(0,1)";
}
else if (dmodel.GoodsPageType == Common.Enum.Goods.GoodsPageTypeEnum.School)
{
where += $@" and g.{nameof(RB_Goods_Extend.GoodsPageType)} in(0,2)";
}
}
string orderBy = " g.CreateDate desc";
if (dmodel.OrderBy == 1)
{
//id升序
orderBy = " g.Id asc";
}
else if (dmodel.OrderBy == 2)
{
//id降序
orderBy = " g.Id desc";
}
else if (dmodel.OrderBy == 3)
{
//排序升序
orderBy = " g.Sort asc";
}
else if (dmodel.OrderBy == 4)
{
//排序降序
orderBy = " g.Sort desc";
}
else if (dmodel.OrderBy == 5)
{
//售价升序
orderBy = " g.SellingPrice asc";
}
else if (dmodel.OrderBy == 6)
{
//售价降序
orderBy = " g.SellingPrice desc";
}
else if (dmodel.OrderBy == 7)
{
//库存升序
orderBy = " g.InventoryNum asc";
}
else if (dmodel.OrderBy == 8)
{
//库存降序
orderBy = " g.InventoryNum desc";
}
string sql = $@"select g.Id,g.Name,g.CarouselImage,g.SellingPrice from RB_Goods g
inner join rb_goods_category c on g.Id=c.GoodsId
where {where} group by g.Id order by {orderBy}";
return GetPage<RB_Goods_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 分页列表
......
......@@ -2301,7 +2301,7 @@ namespace Mall.WebApi.Controllers.MallBase
y.OrderType,
OrderTypeName = y.OrderType.GetEnumName(),
y.GoodsName,
SpecificationList = JsonConvert.DeserializeObject<List<string>>(y.Specification),
SpecificationList =!string.IsNullOrEmpty(y.Specification)? JsonConvert.DeserializeObject<List<string>>(y.Specification):new List<string>(),
y.ProductCode,
y.Final_Price,
y.Number
......
......@@ -1445,6 +1445,32 @@ namespace Mall.WebApi.Controllers.MallBase
}
/// <summary>
/// 获取商品列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetProductGoodsDialogList_V2()
{
var parms = RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
RB_Goods_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Extend>(parms.msg.ToString());
demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId;
var list = productModule.GetProductGoodsDialogList_V2(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.Id,
x.Name,
x.CoverImage,
x.CarouselImageList,
x.SellingPrice
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 获取商品列表
/// </summary>
......
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