Commit 379a692f authored by 吴春's avatar 吴春

分类调整

parent 47b7dbe5
......@@ -65,5 +65,10 @@ namespace Mall.Model.Entity.TradePavilion
/// 父级分类Id
/// </summary>
public int ParentId { get; set; }
/// <summary>
/// 排序
/// </summary>
public int SortNum { get; set; }
}
}
......@@ -1213,6 +1213,8 @@ namespace Mall.Module.TradePavilion
{nameof(RB_BrandClass_Extend.BrandCategory),model.BrandCategory},
{nameof(RB_BrandClass_Extend.Status),model.Status },
{nameof(RB_BrandClass_Extend.UpdateDate),model.UpdateDate },
{nameof(RB_BrandClass_Extend.ParentId),model.ParentId },
{nameof(RB_BrandClass_Extend.SortNum),model.SortNum },
};
flag = brandClassRepository.Update(fileds, new WhereHelper(nameof(RB_BrandClass_Extend.ID), model.ID));
}
......@@ -1226,19 +1228,26 @@ namespace Mall.Module.TradePavilion
}
/// <summary>
///删除品牌状态
///删除品牌分类
/// </summary>
/// <param name="CompanyId"></param>
/// <param name="Status"></param>
/// <param name="ID"></param>
/// <returns></returns>
public bool RemoveBrandClassModule(int CarrierId)
public bool RemoveBrandClassModule(int ID)
{
var oldModel = GetBrandClassModule(ID);
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_BrandClass_Extend.Status),1 },
};
bool flag = brandClassRepository.Update(fileds, new WhereHelper(nameof(RB_BrandClass_Extend.ID), CarrierId));
bool flag = brandClassRepository.Update(fileds, new WhereHelper(nameof(RB_BrandClass_Extend.ID), ID));
var childList = GetBrandClassListModule(new RB_BrandClass_Extend() { ParentId = ID, BrandCategory = oldModel.BrandCategory });
if (childList != null && childList.Count > 0)
{
foreach (var item in childList)
{
flag = brandClassRepository.Update(fileds, new WhereHelper(nameof(RB_BrandClass_Extend.ID), item.ID));
}
}
return flag;
}
......
......@@ -77,14 +77,6 @@ WHERE 1=1
}
else
{
//if (query.TenantId > 0)
//{
// builder.AppendFormat(" AND {0}={1} ", nameof(RB_BrandClass_Extend.TenantId), query.TenantId);
//}
//if (query.MallBaseId > 0)
//{
// builder.AppendFormat(" AND {0}={1} ", nameof(RB_BrandClass_Extend.MallBaseId), query.MallBaseId);
//}
if (!string.IsNullOrEmpty(query.ClassName))
{
builder.AppendFormat(" AND {0} LIKE @Name ", nameof(RB_BrandClass_Extend.ClassName));
......@@ -98,8 +90,12 @@ WHERE 1=1
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_BrandClass_Extend.ID), query.ID);
}
if (query.ParentId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_BrandClass_Extend.ParentId), query.ParentId);
}
}
builder.AppendFormat(" ORDER BY {0} ASC ", nameof(RB_BrandClass_Extend.SortNum));
return Get<RB_BrandClass_Extend>(builder.ToString(), parameters).ToList();
}
}
......
......@@ -1834,6 +1834,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
MallBaseId = RequestParm.MallBaseId,
TenantId = RequestParm.TenantId,
BrandCategory = (BrandCategoryEnum)parms.GetInt("BrandCategory"),
ParentId = parms.GetInt("ParentId")
};
List<object> list = new List<object>();
var dataList = carrierModule.GetBrandClassListModule(query);
......@@ -1846,6 +1847,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
item.Logo,
item.BrandCategory,
BrandCategoryName = item.BrandCategory.GetEnumName(),
item.ParentId,
item.SortNum,
});
}
return ApiResult.Success(data: list);
......@@ -1883,6 +1886,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
Logo = parms.GetStringValue("Logo"),
ClassName = parms.GetStringValue("ClassName"),
BrandCategory = (BrandCategoryEnum)parms.GetInt("BrandCategory"),
ParentId = parms.GetInt("ParentId"),
SortNum = parms.GetInt("SortNum"),
};
if (string.IsNullOrWhiteSpace(query.ClassName))
{
......@@ -1901,14 +1906,14 @@ namespace Mall.WebApi.Controllers.TradePavilion
}
/// <summary>
/// 删除品牌信息
/// 删除品牌分类
/// </summary>
/// <returns></returns>
public ApiResult RemoveBrandClass()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var CarrierId = parms.GetInt("Id", 0);
var flag = carrierModule.RemoveBrandClassModule(CarrierId);
var Id = parms.GetInt("Id", 0);
var flag = carrierModule.RemoveBrandClassModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......
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