Commit 683072c1 authored by liudong1993's avatar liudong1993

1

parent 01d28121
......@@ -3119,7 +3119,8 @@ namespace Mall.Module.Product
TenantId = demodel.TenantId,
UpdateDate = DateTime.Now,
UserId = OneUserId,
Type = 2
Type = 2,
IsRemit = 0
}, trans);
//向上找出所有可以分销的
......@@ -3173,7 +3174,8 @@ namespace Mall.Module.Product
TenantId = demodel.TenantId,
UpdateDate = DateTime.Now,
UserId = ParentId,
Type = 2
Type = 2,
IsRemit = 0
}, trans);
}
ParentId = member_UserRepository.GetEntity(ParentId)?.SuperiorId ?? 0;
......@@ -3345,7 +3347,8 @@ namespace Mall.Module.Product
TenantId = demodel.TenantId,
UpdateDate = DateTime.Now,
UserId = OneUserId,
Type = 1
Type = 1,
IsRemit = 0
};
gocList.Add(gocModel);
break;
......@@ -3412,7 +3415,8 @@ namespace Mall.Module.Product
TenantId = demodel.TenantId,
UpdateDate = DateTime.Now,
UserId = TwoUserId,
Type = 1
Type = 1,
IsRemit = 0
};
gocList.Add(gocModel);
}
......@@ -3493,7 +3497,8 @@ namespace Mall.Module.Product
TenantId = demodel.TenantId,
UpdateDate = DateTime.Now,
UserId = ThreeUserId,
Type = 1
Type = 1,
IsRemit = 0
};
gocList.Add(gocModel);
}
......
......@@ -144,6 +144,96 @@ namespace Mall.Module.Property
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> GetGoodsToProcurementPageList(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel)
{
var GoodsList = goodsRepository.GetPageList(pageIndex, pageSize, out count, demodel);
if (GoodsList.Any())
{
int tenantId = demodel.TenantId;
int mallBaseId = demodel.MallBaseId;
var SpecificationList = new List<RB_Goods_Specification_Extend>();
var SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>();
//查询出商品规格
if (GoodsList.Where(x => x.IsCustomSpecification == 1).Any())
{
string goodsIds = string.Join(",", GoodsList.Where(x => x.IsCustomSpecification == 1).Select(x => x.Id));
SpecificationList = goods_SpecificationRepository.GetList(new RB_Goods_Specification_Extend() { GoodsIds = goodsIds, TenantId = tenantId, MallBaseId = mallBaseId });
if (SpecificationList.Any())
{
var svlist = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsIds = goodsIds, TenantId = tenantId, MallBaseId = mallBaseId });
foreach (var item in svlist)
{
item.ImagePath = item.Image;
}
foreach (var item in SpecificationList)
{
item.SpecificationValueList = svlist.Where(x => x.SpecificationId == item.Id).ToList();
}
}
SpecificationPriceList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = goodsIds, TenantId = tenantId, MallBaseId = mallBaseId });
foreach (var item in SpecificationPriceList)
{
if (!string.IsNullOrEmpty(item.SpecificationSort))
{
var SpList = SpecificationList.Where(x => x.GoodsId == item.GoodsId).ToList();
var ssarr = item.SpecificationSort.Split(':');
int Sort = Convert.ToInt32(ssarr[0]);
List<string> AttrList = new List<string>();
for (int i = 0; i < ssarr.Length; i++)
{
var smodel = SpList[i];
var svmodel = smodel.SpecificationValueList.Where(x => x.Sort == Convert.ToInt32(ssarr[i])).FirstOrDefault();
AttrList.Add(smodel.Name + ":" + svmodel.Name);
}
item.AttrList = AttrList;
}
}
}
//查询分类
string ids = string.Join(",", GoodsList.Select(x => x.Id));
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
foreach (var item in GoodsList)
{
item.CategoryList = clist.Where(x => x.GoodsId == item.Id).ToList();
//轮播图
item.CoverImage = "";
if (!string.IsNullOrEmpty(item.CarouselImage) && item.CarouselImage != "[]")
{
List<string> CarouselIdList = JsonConvert.DeserializeObject<List<string>>(item.CarouselImage);
//封面图
item.CoverImage = CarouselIdList[0];
}
if (item.IsCustomSpecification == 1)
{
item.SpecificationPriceList = SpecificationPriceList.Where(x => x.GoodsId == item.Id).ToList();
}
else {
item.SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>();
item.SpecificationPriceList.Add(new RB_Goods_SpecificationPrice_Extend()
{
Id = item.GoodsId ?? 0,
GoodsId = item.GoodsId,
GoodsNumbers = item.GoodsNumbers,
GoodsWeight = item.GoodsWeight,
InventoryNum = item.InventoryNum,
SpecificationSort = "",
AttrList = new List<string>() { "规格:" + item.DefaultSpecificationName }
});
}
}
}
return GoodsList;
}
/// <summary>
/// 获取采购单详情
/// </summary>
......
......@@ -11,6 +11,7 @@ using Newtonsoft.Json.Linq;
using Mall.Common;
using Mall.Module.Property;
using Mall.Model.Extend.Property;
using Mall.Model.Extend.Product;
namespace Mall.WebApi.Controllers.MallBase
{
......@@ -126,10 +127,36 @@ namespace Mall.WebApi.Controllers.MallBase
/// 获取商品规格列表
/// </summary>
/// <returns></returns>
//[HttpPost]
//public ApiResult GetGoodsToProcurementPageList() {
//}
[HttpPost]
public ApiResult GetGoodsToProcurementPageList()
{
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 = propertyModule.GetGoodsToProcurementPageList(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.CostPrice,
x.IsCustomSpecification,
SpecificationList = x.SpecificationPriceList.Select(y=>new {
y.Id,
y.GoodsId,
y.GoodsNumbers,
y.GoodsWeight,
y.InventoryNum,
y.SpecificationSort,
y.AttrList
})
});
return ApiResult.Success("", pagelist);
}
/// <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