diff --git a/ARW.Model/Vo/Api/ShopManager/Shops/GoodsCategoryVoApi.cs b/ARW.Model/Vo/Api/ShopManager/Shops/GoodsCategoryVoApi.cs
index b49ef6b..23550ab 100644
--- a/ARW.Model/Vo/Api/ShopManager/Shops/GoodsCategoryVoApi.cs
+++ b/ARW.Model/Vo/Api/ShopManager/Shops/GoodsCategoryVoApi.cs
@@ -1,7 +1,9 @@
+using ARW.Model.Vo.Business.GoodsManager.GoodsCategorys;
using Newtonsoft.Json;
using OfficeOpenXml.Attributes;
using SqlSugar;
using System;
+using System.Collections.Generic;
namespace ARW.Model.Vo.Api.ShopManager.Shops
{
@@ -23,10 +25,22 @@ namespace ARW.Model.Vo.Api.ShopManager.Shops
///
/// 描述 :值
///
+ [SugarColumn(IsTreeKey = true)]
[JsonConverter(typeof(ValueToStringConverter))]
public long Value { get; set; }
+ ///
+ /// 描述 :父级guid
+ ///
+ [JsonConverter(typeof(ValueToStringConverter))]
+ public long ParentGuid { get; set; }
+
+
+ [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
+ [SugarColumn(IsIgnore = true)]
+ public List Children { get; set; }
+
}
}
diff --git a/ARW.Service/Api/BusinessService/ShopManager/Shops/ShopServiceApi.cs b/ARW.Service/Api/BusinessService/ShopManager/Shops/ShopServiceApi.cs
index b389cd1..f40049b 100644
--- a/ARW.Service/Api/BusinessService/ShopManager/Shops/ShopServiceApi.cs
+++ b/ARW.Service/Api/BusinessService/ShopManager/Shops/ShopServiceApi.cs
@@ -53,15 +53,15 @@ namespace ARW.Service.Api.BusinessService.ShopManager.Shops
{
var query = _GoodsCategoryRepository
.Queryable()
- .Where(s => s.GoodsCategoryParentGuid == 0)
.OrderBy(s => s.Update_time, OrderByType.Desc)
.Select((s) => new GoodsCategoryVoApi
{
+ ParentGuid = s.GoodsCategoryParentGuid,
Label = s.GoodsCategoryName,
Value = s.GoodsCategoryGuid,
});
- return await query.ToListAsync();
+ return await query.ToTreeAsync(it => it.Children, it => it.ParentGuid, 0);
}
diff --git a/ARW.Service/Business/BusinessService/GoodsManager/GoodsCategorys/GoodsCategoryService.cs b/ARW.Service/Business/BusinessService/GoodsManager/GoodsCategorys/GoodsCategoryService.cs
index 9471a07..12ee34c 100644
--- a/ARW.Service/Business/BusinessService/GoodsManager/GoodsCategorys/GoodsCategoryService.cs
+++ b/ARW.Service/Business/BusinessService/GoodsManager/GoodsCategorys/GoodsCategoryService.cs
@@ -122,6 +122,7 @@ namespace ARW.Service.Business.BusinessService.GoodsManager.GoodsCategorys
}
else
{
+ if (model.GoodsCategoryParentGuid != 0) throw new CustomException("不允许添加三级类目!");
var info = _GoodsCategoryRepository.GetFirst(it => it.GoodsCategoryGuid == model.GoodsCategoryParentGuid);
model.GoodsCategoryAncestralGuid = "0";
if (info != null) model.GoodsCategoryAncestralGuid = info.GoodsCategoryAncestralGuid + "," + model.GoodsCategoryParentGuid;
diff --git a/ARW.WebApi/Controllers/Business/ShopManager/Shops/ShopController.cs b/ARW.WebApi/Controllers/Business/ShopManager/Shops/ShopController.cs
index 9f41b1f..ca8e434 100644
--- a/ARW.WebApi/Controllers/Business/ShopManager/Shops/ShopController.cs
+++ b/ARW.WebApi/Controllers/Business/ShopManager/Shops/ShopController.cs
@@ -112,7 +112,6 @@ namespace ARW.WebApi.Controllers.Business.ShopManager.Shops
if (parm.ShopId != 0) modal = parm.Adapt().ToUpdate(HttpContext);
else modal = parm.Adapt().ToCreate(HttpContext);
- modal.ShopAuditStatus = 1;
var res = await _ShopService.AddOrUpdateShop(modal);
return SUCCESS(res);