Commit aeab811d authored by liudong1993's avatar liudong1993

商品副标题

parent d83a78e1
...@@ -38,6 +38,11 @@ namespace Mall.Common.Enum.Goods ...@@ -38,6 +38,11 @@ namespace Mall.Common.Enum.Goods
[EnumField("商品名")] [EnumField("商品名")]
SPM = 5, SPM = 5,
/// <summary> /// <summary>
/// 副标题
/// </summary>
[EnumField("副标题")]
FBT = 28,
/// <summary>
/// 规格 /// 规格
/// </summary> /// </summary>
[EnumField("规格")] [EnumField("规格")]
......
...@@ -34,6 +34,10 @@ namespace Mall.Model.Extend.Product ...@@ -34,6 +34,10 @@ namespace Mall.Model.Extend.Product
/// </summary> /// </summary>
public string OrderIds { get; set; } public string OrderIds { get; set; }
/// <summary> /// <summary>
/// 商品副标题
/// </summary>
public string GoodsSubName { get; set; }
/// <summary>
/// 图片地址 /// 图片地址
/// </summary> /// </summary>
public string CoverImagePath { get; set; } public string CoverImagePath { get; set; }
......
...@@ -4866,13 +4866,18 @@ namespace Mall.Module.Product ...@@ -4866,13 +4866,18 @@ namespace Mall.Module.Product
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, OrderIds = string.Join(",", list.Select(x => x.OrderId)) }); var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, OrderIds = string.Join(",", list.Select(x => x.OrderId)) });
var erList = goods_ExpressRelevanceRepository.GetList(new RB_Goods_ExpressRelevance_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, OrderIds = string.Join(",", list.Select(x => x.OrderId)) }); var erList = goods_ExpressRelevanceRepository.GetList(new RB_Goods_ExpressRelevance_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, OrderIds = string.Join(",", list.Select(x => x.OrderId)) });
//查询图片 //查询图片
List<RB_Material_Info_Extend> Mlist = new List<RB_Material_Info_Extend>(); List<RB_Material_Info_Extend> Mlist = new List<RB_Material_Info_Extend>();
if (dlist.Any()) if (dlist.Any())
{ {
//剑鱼兄需求 2020=07-30 再查询一次商品表
string GoodsIds = string.Join(",", dlist.Select(x => x.GoodsId).Distinct());
var GList = goodsRepository.GetSingleListForGoodsSubName(new RB_Goods_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, GoodsIds = GoodsIds });
foreach (var item in dlist) foreach (var item in dlist)
{ {
item.CoverImagePath = item.CoverImage; item.CoverImagePath = item.CoverImage;
item.IsBindExpress = erList.Where(x => x.OrderDetailId == item.Id).Any() ? 1 : 2; item.IsBindExpress = erList.Where(x => x.OrderDetailId == item.Id).Any() ? 1 : 2;
item.GoodsSubName = GList.Where(x => x.Id == item.GoodsId).FirstOrDefault()?.SubName ?? "";
} }
} }
string areaIds1 = string.Join(",", list.Select(x => x.Province ?? 0).Distinct()); string areaIds1 = string.Join(",", list.Select(x => x.Province ?? 0).Distinct());
......
...@@ -847,11 +847,16 @@ namespace Mall.Module.Property ...@@ -847,11 +847,16 @@ namespace Mall.Module.Property
var sidList = supplies_StockInDetailRepository.GetList(new RB_Supplies_StockInDetail_Extend() { RB_Group_Id = eRPGroupId, StockInIdStr = siIds }); var sidList = supplies_StockInDetailRepository.GetList(new RB_Supplies_StockInDetail_Extend() { RB_Group_Id = eRPGroupId, StockInIdStr = siIds });
List<RB_Supplies_Material_Extend> materialList = new List<RB_Supplies_Material_Extend>(); List<RB_Supplies_Material_Extend> materialList = new List<RB_Supplies_Material_Extend>();
List<Model.Extend.Property.RB_Employee_Extend> empList = new List<Model.Extend.Property.RB_Employee_Extend>(); List<Model.Extend.Property.RB_Employee_Extend> empList = new List<Model.Extend.Property.RB_Employee_Extend>();
List<RB_Goods_Extend> GList = new List<RB_Goods_Extend>();
if (sidList.Any()) if (sidList.Any())
{ {
string matIds = string.Join(",", sidList.Select(x => x.SuppliesId).Distinct()); string matIds = string.Join(",", sidList.Select(x => x.SuppliesId).Distinct());
materialList = supplies_MaterialRepository.GetList(new RB_Supplies_Material_Extend() { RB_Group_Id = eRPGroupId, SuppliesIdStr = matIds }); materialList = supplies_MaterialRepository.GetList(new RB_Supplies_Material_Extend() { RB_Group_Id = eRPGroupId, SuppliesIdStr = matIds });
if (materialList.Where(x => x.GoodsId > 0).Any())
{
string goodsIds = string.Join(",", materialList.Where(x => x.GoodsId > 0).Select(x => x.GoodsId).Distinct());
GList = goodsRepository.GetSingleListForGoodsSubName(new RB_Goods_Extend() { GoodsIds = goodsIds });
}
string erpEmpIds = string.Join(",", sidList.Select(x => x.CreateBy ?? 0).Distinct()); string erpEmpIds = string.Join(",", sidList.Select(x => x.CreateBy ?? 0).Distinct());
empList = erpemployeeRepository.GetList(new Model.Extend.Property.RB_Employee_Extend() { RB_Group_id = eRPGroupId, EmployeeIds = erpEmpIds }); empList = erpemployeeRepository.GetList(new Model.Extend.Property.RB_Employee_Extend() { RB_Group_id = eRPGroupId, EmployeeIds = erpEmpIds });
} }
...@@ -894,12 +899,15 @@ namespace Mall.Module.Property ...@@ -894,12 +899,15 @@ namespace Mall.Module.Property
QRCodeHelper.CreateTQRCode(TQRCode, TQRPath, ImageFormat.Jpeg, width, 50); QRCodeHelper.CreateTQRCode(TQRCode, TQRPath, ImageFormat.Jpeg, width, 50);
} }
#endregion #endregion
var gmodel = GList.Where(x => x.Id == (materialModel.GoodsId ?? 0)).FirstOrDefault();
string SubName = gmodel?.SubName ?? "";
for (int i = 0; i < (item.Number ?? 0); i++) for (int i = 0; i < (item.Number ?? 0); i++)
{ {
RObj.Add(new RObj.Add(new
{ {
materialModel.GoodsId, materialModel.GoodsId,
GoodsName = materialModel.Name, GoodsName = SubName == "" ? materialModel.Name : SubName,
SpecificationList = spList, SpecificationList = spList,
CreateDate = item.CreateDate.HasValue ? item.CreateDate.Value.ToString("yyyy-MM-dd") : "", CreateDate = item.CreateDate.HasValue ? item.CreateDate.Value.ToString("yyyy-MM-dd") : "",
EmName = empModel?.EmName ?? "", EmName = empModel?.EmName ?? "",
......
...@@ -276,6 +276,59 @@ where {where} group by g.Id order by g.CreateDate desc"; ...@@ -276,6 +276,59 @@ where {where} group by g.Id order by g.CreateDate desc";
return Get<RB_Goods_Extend>(sql).ToList(); return Get<RB_Goods_Extend>(sql).ToList();
} }
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_Extend> GetSingleListForGoodsSubName(RB_Goods_Extend dmodel)
{
string where = $" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.TenantId)}={dmodel.TenantId}";
}
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 (!string.IsNullOrEmpty(dmodel.GoodsNameStr))
{
where += $@" and g.{nameof(RB_Goods_Extend.Name)} in ({dmodel.GoodsNameStr})";
}
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.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"}'";
}
string sql = $@"select g.Id,g.Name,g.SubName from RB_Goods g where {where}";
return Get<RB_Goods_Extend>(sql).ToList();
}
/// <summary> /// <summary>
/// 小程序获取商品列表 /// 小程序获取商品列表
/// </summary> /// </summary>
......
...@@ -66,11 +66,11 @@ namespace Mall.Repository.Property ...@@ -66,11 +66,11 @@ namespace Mall.Repository.Property
if (dmodel.StartDate.HasValue) if (dmodel.StartDate.HasValue)
{ {
where += $" and nameof(RB_Supplies_Check_Extend.StartDate) >={dmodel.StartDate} "; where += $" and {nameof(RB_Supplies_Check_Extend.StartDate)} >='{dmodel.StartDate}' ";
} }
if (dmodel.EndDate.HasValue) if (dmodel.EndDate.HasValue)
{ {
where += $" and nameof(RB_Supplies_Check_Extend.StartDate) <={dmodel.EndDate} "; where += $" and {nameof(RB_Supplies_Check_Extend.StartDate)} <='{dmodel.EndDate}' ";
} }
if (!string.IsNullOrWhiteSpace(dmodel.Periods)) if (!string.IsNullOrWhiteSpace(dmodel.Periods))
......
...@@ -202,6 +202,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -202,6 +202,8 @@ namespace Mall.WebApi.Controllers.MallBase
datarow.ExcelRows.Add(new ExcelColumn(value: item.UserName) { }); break; datarow.ExcelRows.Add(new ExcelColumn(value: item.UserName) { }); break;
case 5: case 5:
datarow.ExcelRows.Add(new ExcelColumn(value: item2.GoodsName) { }); break; datarow.ExcelRows.Add(new ExcelColumn(value: item2.GoodsName) { }); break;
case 28:
datarow.ExcelRows.Add(new ExcelColumn(value: item2.GoodsSubName) { }); break;
case 6: case 6:
datarow.ExcelRows.Add(new ExcelColumn(value: item2.Specification) { }); break; datarow.ExcelRows.Add(new ExcelColumn(value: item2.Specification) { }); break;
case 7: case 7:
......
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