fixed 完善商品类目及平台与商户权限
This commit is contained in:
parent
18ddd54bb1
commit
fcd62fa197
@ -18,13 +18,11 @@ namespace ARW.Model.Dto.Business.GoodsManager.ShopGoodsCategorys
|
|||||||
|
|
||||||
public long ShopGoodsCategoryGuid { get; set; }
|
public long ShopGoodsCategoryGuid { get; set; }
|
||||||
|
|
||||||
[Required(ErrorMessage = "店铺guid不能为空")]
|
|
||||||
public long ShopGuid { get; set; }
|
public long ShopGuid { get; set; }
|
||||||
|
|
||||||
[Required(ErrorMessage = "父级guid不能为空")]
|
[Required(ErrorMessage = "上级类目不能为空")]
|
||||||
public long ShopGoodsCategoryParentGuid { get; set; }
|
public long ShopGoodsCategoryParentGuid { get; set; }
|
||||||
|
|
||||||
[Required(ErrorMessage = "祖级guid不能为空")]
|
|
||||||
public string ShopGoodsCategoryAncestralGuid { get; set; }
|
public string ShopGoodsCategoryAncestralGuid { get; set; }
|
||||||
|
|
||||||
[Required(ErrorMessage = "名称不能为空")]
|
[Required(ErrorMessage = "名称不能为空")]
|
||||||
@ -51,7 +49,8 @@ namespace ARW.Model.Dto.Business.GoodsManager.ShopGoodsCategorys
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ShopGoodsCategoryQueryDto : PagerInfo
|
public class ShopGoodsCategoryQueryDto : PagerInfo
|
||||||
{
|
{
|
||||||
|
public long ShopGuid { get; set;}
|
||||||
|
public string ShopName { get; set; }
|
||||||
public string ShopGoodsCategoryName { get; set; }
|
public string ShopGoodsCategoryName { get; set; }
|
||||||
|
|
||||||
public int? ShopGoodsCategoryDisplayStatus { get; set; }
|
public int? ShopGoodsCategoryDisplayStatus { get; set; }
|
||||||
|
@ -37,42 +37,60 @@ namespace ARW.Model.Vo.Business.GoodsManager.ShopGoodsCategorys
|
|||||||
/// 描述 :店铺guid
|
/// 描述 :店铺guid
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonConverter(typeof(ValueToStringConverter))]
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
[SugarColumn(IsTreeKey = true)]
|
[EpplusIgnore]
|
||||||
[EpplusTableColumn(Header = "店铺guid")]
|
|
||||||
public long ShopGuid { get; set; }
|
public long ShopGuid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :店铺名称
|
||||||
|
/// </summary>
|
||||||
|
[EpplusTableColumn(Header = "店铺名称")]
|
||||||
|
public string ShopName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述 :父级guid
|
/// 描述 :父级guid
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonConverter(typeof(ValueToStringConverter))]
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
[SugarColumn(IsTreeKey = true)]
|
[SugarColumn(IsTreeKey = true)]
|
||||||
[EpplusTableColumn(Header = "父级guid")]
|
[EpplusIgnore]
|
||||||
public long ShopGoodsCategoryParentGuid { get; set; }
|
public long ShopGoodsCategoryParentGuid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[EpplusTableColumn(Header = "上级类目")]
|
||||||
|
public string ParentName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述 :祖级guid
|
/// 描述 :祖级guid
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonConverter(typeof(ValueToStringConverter))]
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
[SugarColumn(IsTreeKey = true)]
|
[SugarColumn(IsTreeKey = true)]
|
||||||
[EpplusTableColumn(Header = "祖级guid")]
|
[EpplusIgnore]
|
||||||
public string ShopGoodsCategoryAncestralGuid { get; set; }
|
public string ShopGoodsCategoryAncestralGuid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述 :名称
|
/// 描述 :名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[EpplusTableColumn(Header = "名称")]
|
[EpplusTableColumn(Header = "商品类目名称")]
|
||||||
public string ShopGoodsCategoryName { get; set; }
|
public string ShopGoodsCategoryName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述 :显示状态
|
/// 描述 :显示状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[EpplusTableColumn(Header = "显示状态")]
|
[EpplusIgnore]
|
||||||
public int ShopGoodsCategoryDisplayStatus { get; set; }
|
public int ShopGoodsCategoryDisplayStatus { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :显示状态名称
|
||||||
|
/// </summary>
|
||||||
|
[EpplusTableColumn(Header = "显示状态")]
|
||||||
|
public string ShopGoodsCategoryDisplayStatusName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述 :排序
|
/// 描述 :排序
|
||||||
@ -80,8 +98,6 @@ namespace ARW.Model.Vo.Business.GoodsManager.ShopGoodsCategorys
|
|||||||
[EpplusTableColumn(Header = "排序")]
|
[EpplusTableColumn(Header = "排序")]
|
||||||
public int ShopGoodsCategorySort { get; set; }
|
public int ShopGoodsCategorySort { get; set; }
|
||||||
|
|
||||||
[EpplusIgnore]
|
|
||||||
public string ParentName { get; set; }
|
|
||||||
|
|
||||||
[EpplusIgnore]
|
[EpplusIgnore]
|
||||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
@ -14,6 +14,11 @@ using ARW.Service.Business.IBusinessService.GoodsManager.ShopGoodsCategorys;
|
|||||||
using ARW.Model.Dto.Business.GoodsManager.ShopGoodsCategorys;
|
using ARW.Model.Dto.Business.GoodsManager.ShopGoodsCategorys;
|
||||||
using ARW.Model.Models.Business.GoodsManager.ShopGoodsCategorys;
|
using ARW.Model.Models.Business.GoodsManager.ShopGoodsCategorys;
|
||||||
using ARW.Model.Vo.Business.GoodsManager.ShopGoodsCategorys;
|
using ARW.Model.Vo.Business.GoodsManager.ShopGoodsCategorys;
|
||||||
|
using ARW.Model.Models.Business.ShopManager.Shops;
|
||||||
|
using ARW.Repository.System;
|
||||||
|
using ARW.Repository.Business.ShopManager.Shops;
|
||||||
|
using Senparc.CO2NET.Extensions;
|
||||||
|
using ARW.Model.System;
|
||||||
|
|
||||||
namespace ARW.Service.Business.BusinessService.GoodsManager.ShopGoodsCategorys
|
namespace ARW.Service.Business.BusinessService.GoodsManager.ShopGoodsCategorys
|
||||||
{
|
{
|
||||||
@ -27,43 +32,51 @@ namespace ARW.Service.Business.BusinessService.GoodsManager.ShopGoodsCategorys
|
|||||||
public class ShopGoodsCategoryServiceImpl : BaseService<ShopGoodsCategory>, IShopGoodsCategoryService
|
public class ShopGoodsCategoryServiceImpl : BaseService<ShopGoodsCategory>, IShopGoodsCategoryService
|
||||||
{
|
{
|
||||||
private readonly ShopGoodsCategoryRepository _ShopGoodsCategoryRepository;
|
private readonly ShopGoodsCategoryRepository _ShopGoodsCategoryRepository;
|
||||||
|
private readonly ShopRepository _ShopRepository;
|
||||||
|
private readonly SysDictDataRepository _SysDictDataRepository;
|
||||||
|
|
||||||
public ShopGoodsCategoryServiceImpl(ShopGoodsCategoryRepository ShopGoodsCategoryRepository)
|
public ShopGoodsCategoryServiceImpl(ShopGoodsCategoryRepository ShopGoodsCategoryRepository, SysDictDataRepository sysDictDataRepository, ShopRepository shopRepository)
|
||||||
{
|
{
|
||||||
this._ShopGoodsCategoryRepository = ShopGoodsCategoryRepository;
|
this._ShopGoodsCategoryRepository = ShopGoodsCategoryRepository;
|
||||||
|
_SysDictDataRepository = sysDictDataRepository;
|
||||||
|
_ShopRepository = shopRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 业务逻辑代码
|
#region 业务逻辑代码
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询店铺商品类目树形列表
|
/// 查询店铺商品类目树形列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public async Task<List<ShopGoodsCategoryVo>> GetShopGoodsCategoryTreeList(ShopGoodsCategoryQueryDto parm)
|
public async Task<List<ShopGoodsCategoryVo>> GetShopGoodsCategoryTreeList(ShopGoodsCategoryQueryDto parm)
|
||||||
{
|
{
|
||||||
//开始拼装查询条件
|
//开始拼装查询条件
|
||||||
var predicate = Expressionable.Create<ShopGoodsCategory>();
|
var predicate = Expressionable.Create<ShopGoodsCategory>();
|
||||||
|
|
||||||
|
predicate = predicate.AndIF(parm.ShopGuid != 0, s => s.ShopGuid == parm.ShopGuid);
|
||||||
predicate = predicate.AndIF(parm.ShopGoodsCategoryDisplayStatus != null, s => s.ShopGoodsCategoryDisplayStatus == parm.ShopGoodsCategoryDisplayStatus);
|
predicate = predicate.AndIF(parm.ShopGoodsCategoryDisplayStatus != null, s => s.ShopGoodsCategoryDisplayStatus == parm.ShopGoodsCategoryDisplayStatus);
|
||||||
var query = _ShopGoodsCategoryRepository
|
var query = _ShopGoodsCategoryRepository
|
||||||
.Queryable()
|
.Queryable()
|
||||||
.LeftJoin<ShopGoodsCategory>((s, c) => s.ShopGoodsCategoryParentGuid == c.ShopGoodsCategoryGuid)
|
.LeftJoin<ShopGoodsCategory>((s, c) => s.ShopGoodsCategoryParentGuid == c.ShopGoodsCategoryGuid)
|
||||||
|
.LeftJoin<Shop>((s, c, d) => s.ShopGuid == d.ShopGuid)
|
||||||
.Where(predicate.ToExpression())
|
.Where(predicate.ToExpression())
|
||||||
.OrderBy(s => s.ShopGoodsCategorySort,OrderByType.Asc)
|
.WhereIF(!string.IsNullOrEmpty(parm.ShopName), (s, c, d) => d.ShopName.Contains(parm.ShopName))
|
||||||
.Select((s,c) => new ShopGoodsCategoryVo
|
.OrderBy(s => s.ShopGoodsCategorySort, OrderByType.Asc)
|
||||||
|
.Select((s, c, d) => new ShopGoodsCategoryVo
|
||||||
{
|
{
|
||||||
ShopGoodsCategoryId = s.ShopGoodsCategoryId,
|
ShopGoodsCategoryId = s.ShopGoodsCategoryId,
|
||||||
ShopGoodsCategoryGuid = s.ShopGoodsCategoryGuid,
|
ShopGoodsCategoryGuid = s.ShopGoodsCategoryGuid,
|
||||||
ShopGuid = s.ShopGuid,
|
ShopGuid = s.ShopGuid,
|
||||||
ShopGoodsCategoryParentGuid = s.ShopGoodsCategoryParentGuid,
|
ShopName = d.ShopName,
|
||||||
ShopGoodsCategoryAncestralGuid = s.ShopGoodsCategoryAncestralGuid,
|
ShopGoodsCategoryParentGuid = s.ShopGoodsCategoryParentGuid,
|
||||||
ShopGoodsCategoryName = s.ShopGoodsCategoryName,
|
ShopGoodsCategoryAncestralGuid = s.ShopGoodsCategoryAncestralGuid,
|
||||||
ShopGoodsCategoryDisplayStatus = s.ShopGoodsCategoryDisplayStatus,
|
ShopGoodsCategoryName = s.ShopGoodsCategoryName,
|
||||||
ShopGoodsCategorySort = s.ShopGoodsCategorySort,
|
ShopGoodsCategoryDisplayStatus = s.ShopGoodsCategoryDisplayStatus,
|
||||||
ParentName = c.ShopGoodsCategoryName,
|
ShopGoodsCategorySort = s.ShopGoodsCategorySort,
|
||||||
});
|
ParentName = c.ShopGoodsCategoryName,
|
||||||
|
});
|
||||||
|
|
||||||
return await query.ToTreeAsync(it => it.Children, it => it.ShopGoodsCategoryParentGuid, 0);
|
return await query.ToTreeAsync(it => it.Children, it => it.ShopGoodsCategoryParentGuid, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -75,29 +88,35 @@ namespace ARW.Service.Business.BusinessService.GoodsManager.ShopGoodsCategorys
|
|||||||
//开始拼装查询条件d
|
//开始拼装查询条件d
|
||||||
var predicate = Expressionable.Create<ShopGoodsCategory>();
|
var predicate = Expressionable.Create<ShopGoodsCategory>();
|
||||||
|
|
||||||
|
predicate = predicate.AndIF(parm.ShopGuid != 0, s => s.ShopGuid == parm.ShopGuid);
|
||||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.ShopGoodsCategoryName), s => s.ShopGoodsCategoryName.Contains(parm.ShopGoodsCategoryName));
|
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.ShopGoodsCategoryName), s => s.ShopGoodsCategoryName.Contains(parm.ShopGoodsCategoryName));
|
||||||
predicate = predicate.AndIF(parm.ShopGoodsCategoryDisplayStatus != null, s => s.ShopGoodsCategoryDisplayStatus == parm.ShopGoodsCategoryDisplayStatus);
|
predicate = predicate.AndIF(parm.ShopGoodsCategoryDisplayStatus != null, s => s.ShopGoodsCategoryDisplayStatus == parm.ShopGoodsCategoryDisplayStatus);
|
||||||
var query = _ShopGoodsCategoryRepository
|
var query = _ShopGoodsCategoryRepository
|
||||||
.Queryable()
|
.Queryable()
|
||||||
|
.LeftJoin<ShopGoodsCategory>((s, c) => s.ShopGoodsCategoryParentGuid == c.ShopGoodsCategoryGuid)
|
||||||
|
.LeftJoin<Shop>((s, c, d) => s.ShopGuid == d.ShopGuid)
|
||||||
.Where(predicate.ToExpression())
|
.Where(predicate.ToExpression())
|
||||||
.OrderBy(s => s.ShopGoodsCategorySort,OrderByType.Asc)
|
.WhereIF(!string.IsNullOrEmpty(parm.ShopName), (s, c, d) => d.ShopName.Contains(parm.ShopName))
|
||||||
.Select(s => new ShopGoodsCategoryVo
|
.OrderBy(s => s.ShopGoodsCategorySort, OrderByType.Asc)
|
||||||
|
.Select((s, c, d) => new ShopGoodsCategoryVo
|
||||||
{
|
{
|
||||||
ShopGoodsCategoryId = s.ShopGoodsCategoryId,
|
ShopGoodsCategoryId = s.ShopGoodsCategoryId,
|
||||||
ShopGoodsCategoryGuid = s.ShopGoodsCategoryGuid,
|
ShopGoodsCategoryGuid = s.ShopGoodsCategoryGuid,
|
||||||
ShopGuid = s.ShopGuid,
|
ShopGuid = s.ShopGuid,
|
||||||
ShopGoodsCategoryParentGuid = s.ShopGoodsCategoryParentGuid,
|
ShopName = d.ShopName,
|
||||||
ShopGoodsCategoryAncestralGuid = s.ShopGoodsCategoryAncestralGuid,
|
ShopGoodsCategoryParentGuid = s.ShopGoodsCategoryParentGuid,
|
||||||
ShopGoodsCategoryName = s.ShopGoodsCategoryName,
|
ShopGoodsCategoryAncestralGuid = s.ShopGoodsCategoryAncestralGuid,
|
||||||
ShopGoodsCategoryDisplayStatus = s.ShopGoodsCategoryDisplayStatus,
|
ShopGoodsCategoryName = s.ShopGoodsCategoryName,
|
||||||
ShopGoodsCategorySort = s.ShopGoodsCategorySort,
|
ShopGoodsCategoryDisplayStatus = s.ShopGoodsCategoryDisplayStatus,
|
||||||
});
|
ShopGoodsCategorySort = s.ShopGoodsCategorySort,
|
||||||
|
ParentName = c.ShopGoodsCategoryName,
|
||||||
|
});
|
||||||
|
|
||||||
return await query.ToListAsync();
|
|
||||||
|
return await query.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加或修改店铺商品类目
|
/// 添加或修改店铺商品类目
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public async Task<string> AddOrUpdateShopGoodsCategory(ShopGoodsCategory model)
|
public async Task<string> AddOrUpdateShopGoodsCategory(ShopGoodsCategory model)
|
||||||
@ -128,30 +147,72 @@ namespace ARW.Service.Business.BusinessService.GoodsManager.ShopGoodsCategorys
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region Excel处理
|
#region Excel处理
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据导入处理
|
/// 数据导入处理
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public async Task<ShopGoodsCategoryVo> HandleImportData(ShopGoodsCategoryVo ShopGoodsCategory)
|
public async Task<ShopGoodsCategoryVo> HandleImportData(ShopGoodsCategoryVo ShopGoodsCategory, long userId, int index)
|
||||||
{
|
{
|
||||||
return ShopGoodsCategory;
|
try
|
||||||
|
{
|
||||||
|
// 店铺名称转Guid
|
||||||
|
var shoper = await _ShopRepository.GetFirstAsync(s => s.ShopName == ShopGoodsCategory.ShopName);
|
||||||
|
if (shoper == null) throw new Exception($"找不到店铺【{ShopGoodsCategory.ShopName}】");
|
||||||
|
|
||||||
|
if (userId != 1)
|
||||||
|
{
|
||||||
|
var shop = await _ShopRepository.GetFirstAsync(s => s.ShopUserId == userId);
|
||||||
|
if (shop == null) throw new Exception("该用户没有店铺");
|
||||||
|
// 店铺是否为自己的
|
||||||
|
if (shop.ShopName != ShopGoodsCategory.ShopName) throw new Exception("只允许添加自己的店铺数据");
|
||||||
|
}
|
||||||
|
ShopGoodsCategory.ShopGuid = shoper.ShopGuid;
|
||||||
|
|
||||||
|
|
||||||
|
// 上级类目名称转guid (本店铺的类目)
|
||||||
|
if (!string.IsNullOrEmpty(ShopGoodsCategory.ParentName))
|
||||||
|
{
|
||||||
|
var category = await _ShopGoodsCategoryRepository.GetFirstAsync(s => s.ShopGoodsCategoryName == ShopGoodsCategory.ParentName && s.ShopGuid == ShopGoodsCategory.ShopGuid);
|
||||||
|
ShopGoodsCategory.ShopGoodsCategoryParentGuid = category.ShopGoodsCategoryGuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示状态
|
||||||
|
var lable = ShopGoodsCategory.ShopGoodsCategoryDisplayStatusName;
|
||||||
|
ShopGoodsCategory.ShopGoodsCategoryDisplayStatus = Convert.ToInt32(_SysDictDataRepository.GetDictValueByName("display_status", lable));
|
||||||
|
|
||||||
|
return ShopGoodsCategory;
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Excel导入
|
/// Excel导入
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public async Task<string> ImportExcel(ShopGoodsCategory ShopGoodsCategory,int index,bool isUpdateSupport,string user)
|
public async Task<string> ImportExcel(ShopGoodsCategoryVo ShopGoodsCategoryVo, int index, bool isUpdateSupport, LoginUser user)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 空值判断
|
var category = await HandleImportData(ShopGoodsCategoryVo, user.UserId,index);
|
||||||
// if (ShopGoodsCategory.ShopGoodsCategoryId == null) throw new CustomException("店铺商品类目不能为空");
|
var ShopGoodsCategory = new ShopGoodsCategory
|
||||||
|
{
|
||||||
|
ShopGoodsCategoryId= category.ShopGoodsCategoryId,
|
||||||
|
ShopGoodsCategoryGuid= category.ShopGoodsCategoryGuid,
|
||||||
|
ShopGuid = category.ShopGuid,
|
||||||
|
ShopGoodsCategoryParentGuid = category.ShopGoodsCategoryParentGuid,
|
||||||
|
ShopGoodsCategoryName = category.ShopGoodsCategoryName,
|
||||||
|
ShopGoodsCategoryDisplayStatus = category.ShopGoodsCategoryDisplayStatus,
|
||||||
|
ShopGoodsCategorySort = category.ShopGoodsCategorySort
|
||||||
|
};
|
||||||
|
|
||||||
if (isUpdateSupport)
|
if (isUpdateSupport)
|
||||||
{
|
{
|
||||||
// 判断唯一值
|
// 判断唯一值
|
||||||
var model = await GetFirstAsync(s => s.ShopGoodsCategoryId == ShopGoodsCategory.ShopGoodsCategoryId);
|
var model = await GetFirstAsync(s => s.ShopGoodsCategoryId == ShopGoodsCategory.ShopGoodsCategoryId);
|
||||||
|
|
||||||
// 如果为空就新增数据
|
// 如果为空就新增数据
|
||||||
if (model == null)
|
if (model == null)
|
||||||
{
|
{
|
||||||
@ -160,7 +221,7 @@ namespace ARW.Service.Business.BusinessService.GoodsManager.ShopGoodsCategorys
|
|||||||
{
|
{
|
||||||
var addRes = await AddOrUpdateShopGoodsCategory(ShopGoodsCategory);
|
var addRes = await AddOrUpdateShopGoodsCategory(ShopGoodsCategory);
|
||||||
});
|
});
|
||||||
var addStr = $"第 {index} 行 => 店铺商品类目:【{ShopGoodsCategory.ShopGoodsCategoryId}】<span style='color:#27af49'>新增成功!</span><br>";
|
var addStr = $"第 {index} 行 => 店铺商品类目:【{ShopGoodsCategory.ShopGoodsCategoryName}】<span style='color:#27af49'>新增成功!</span><br>";
|
||||||
return addStr;
|
return addStr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -171,48 +232,53 @@ namespace ARW.Service.Business.BusinessService.GoodsManager.ShopGoodsCategorys
|
|||||||
{
|
{
|
||||||
ShopGoodsCategory.ShopGoodsCategoryId = model.ShopGoodsCategoryId;
|
ShopGoodsCategory.ShopGoodsCategoryId = model.ShopGoodsCategoryId;
|
||||||
ShopGoodsCategory.ShopGoodsCategoryGuid = model.ShopGoodsCategoryGuid;
|
ShopGoodsCategory.ShopGoodsCategoryGuid = model.ShopGoodsCategoryGuid;
|
||||||
ShopGoodsCategory.Update_by = user;
|
ShopGoodsCategory.Update_by = user.UserName;
|
||||||
ShopGoodsCategory.Update_time = DateTime.Now;
|
ShopGoodsCategory.Update_time = DateTime.Now;
|
||||||
var editRes = await AddOrUpdateShopGoodsCategory(ShopGoodsCategory);
|
var editRes = await AddOrUpdateShopGoodsCategory(ShopGoodsCategory);
|
||||||
});
|
});
|
||||||
var editStr = $"第 {index} 行 => 店铺商品类目:【{ShopGoodsCategory.ShopGoodsCategoryId}】<span style='color:#e6a23c'>更新成功!</span><br>";
|
var editStr = $"第 {index} 行 => 店铺商品类目:【{ShopGoodsCategory.ShopGoodsCategoryName}】<span style='color:#e6a23c'>更新成功!</span><br>";
|
||||||
return editStr;
|
return editStr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else
|
||||||
// 开启事务
|
{
|
||||||
|
// 开启事务
|
||||||
var res = await UseTranAsync(async () =>
|
var res = await UseTranAsync(async () =>
|
||||||
{
|
{
|
||||||
var addRes = await AddOrUpdateShopGoodsCategory(ShopGoodsCategory);
|
var addRes = await AddOrUpdateShopGoodsCategory(ShopGoodsCategory);
|
||||||
});
|
});
|
||||||
//Console.WriteLine(res.IsSuccess);
|
//Console.WriteLine(res.IsSuccess);
|
||||||
var addStr = $"第 {index} 行 => 店铺商品类目:【{ShopGoodsCategory.ShopGoodsCategoryId}】<span style='color:#27af49'>新增成功!</span><br>";
|
var addStr = $"第 {index} 行 => 店铺商品类目:【{ShopGoodsCategory.ShopGoodsCategoryName}】<span style='color:#27af49'>新增成功!</span><br>";
|
||||||
return addStr;
|
return addStr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
var errorRes = $"第 {index} 行 => 店铺商品类目:【{ShopGoodsCategory.ShopGoodsCategoryId}】<span style='color:red'>导入失败!{ex.Message}</span><br>";
|
var errorRes = $"第 {index} 行 => 店铺商品类目:【{ShopGoodsCategoryVo.ShopGoodsCategoryName}】<span style='color:red'>导入失败!{ex.Message}</span><br>";
|
||||||
return errorRes;
|
return errorRes;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Excel数据导出处理
|
/// Excel数据导出处理
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public async Task<List<ShopGoodsCategoryVo>> HandleExportData(List<ShopGoodsCategoryVo> data)
|
public async Task<List<ShopGoodsCategoryVo>> HandleExportData(List<ShopGoodsCategoryVo> data)
|
||||||
{
|
{
|
||||||
|
foreach (var item in data)
|
||||||
|
{
|
||||||
|
item.ShopGoodsCategoryDisplayStatusName = _SysDictDataRepository.GetDictNameByName("display_status", item.ShopGoodsCategoryDisplayStatus.ToString());
|
||||||
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -314,6 +314,13 @@ namespace ARW.Service.Business.BusinessService.ShopManager.Shops
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<bool> CheckRepeatShopName(string shopName)
|
||||||
|
{
|
||||||
|
var query = await _ShopRepository.GetFirstAsync(s => s.ShopName == shopName);
|
||||||
|
return query != null ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
|||||||
using ARW.Model;
|
using ARW.Model;
|
||||||
using ARW.Model.Dto.Business.GoodsManager.ShopGoodsCategorys;
|
using ARW.Model.Dto.Business.GoodsManager.ShopGoodsCategorys;
|
||||||
using ARW.Model.Models.Business.GoodsManager.ShopGoodsCategorys;
|
using ARW.Model.Models.Business.GoodsManager.ShopGoodsCategorys;
|
||||||
|
using ARW.Model.System;
|
||||||
using ARW.Model.Vo.Business.GoodsManager.ShopGoodsCategorys;
|
using ARW.Model.Vo.Business.GoodsManager.ShopGoodsCategorys;
|
||||||
|
|
||||||
namespace ARW.Service.Business.IBusinessService.GoodsManager.ShopGoodsCategorys
|
namespace ARW.Service.Business.IBusinessService.GoodsManager.ShopGoodsCategorys
|
||||||
@ -46,7 +47,7 @@ namespace ARW.Service.Business.IBusinessService.GoodsManager.ShopGoodsCategorys
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="shopVo"></param>
|
/// <param name="shopVo"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ShopGoodsCategoryVo> HandleImportData(ShopGoodsCategoryVo ShopGoodsCategoryVo);
|
Task<ShopGoodsCategoryVo> HandleImportData(ShopGoodsCategoryVo ShopGoodsCategoryVo,long userId,int index);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -54,7 +55,7 @@ namespace ARW.Service.Business.IBusinessService.GoodsManager.ShopGoodsCategorys
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="shopVo"></param>
|
/// <param name="shopVo"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<string> ImportExcel(ShopGoodsCategory ShopGoodsCategory,int index,bool isUpdateSupport,string user);
|
Task<string> ImportExcel(ShopGoodsCategoryVo ShopGoodsCategory,int index,bool isUpdateSupport,LoginUser user);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Excel导出
|
/// Excel导出
|
||||||
|
@ -78,5 +78,13 @@ namespace ARW.Service.Business.IBusinessService.ShopManager.Shops
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<string> GetShopOperatorDetail(ShopOperatorQueryDto parm);
|
Task<string> GetShopOperatorDetail(ShopOperatorQueryDto parm);
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检查是否有重复商店名称
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="shopName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> CheckRepeatShopName(string shopName);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,14 +33,17 @@ namespace ARW.WebApi.Controllers.Api.ShopManager.Shops
|
|||||||
public class ShopApiController : BaseController
|
public class ShopApiController : BaseController
|
||||||
{
|
{
|
||||||
private readonly IShopServiceApi _ShopServiceApi;
|
private readonly IShopServiceApi _ShopServiceApi;
|
||||||
|
private readonly IShopService _ShopService;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 依赖注入
|
/// 依赖注入
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ShopServiceApi">店铺店铺Api服务</param>
|
/// <param name="ShopServiceApi">店铺店铺Api服务</param>
|
||||||
public ShopApiController(IShopServiceApi ShopServiceApi)
|
/// <param name="ShopService">店铺店铺服务</param>
|
||||||
|
public ShopApiController(IShopServiceApi ShopServiceApi, IShopService ShopService)
|
||||||
{
|
{
|
||||||
_ShopServiceApi = ShopServiceApi;
|
_ShopServiceApi = ShopServiceApi;
|
||||||
|
_ShopService = ShopService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -80,6 +83,9 @@ namespace ARW.WebApi.Controllers.Api.ShopManager.Shops
|
|||||||
{
|
{
|
||||||
if (parm == null) { throw new CustomException("请求参数错误"); }
|
if (parm == null) { throw new CustomException("请求参数错误"); }
|
||||||
|
|
||||||
|
var isRepeat = await _ShopService.CheckRepeatShopName(parm.ShopName);
|
||||||
|
if (isRepeat) throw new CustomException("商铺名称已存在");
|
||||||
|
|
||||||
var modal = new Shop();
|
var modal = new Shop();
|
||||||
if (parm.ShopId != 0) modal = parm.Adapt<Shop>().ToUpdate(HttpContext);
|
if (parm.ShopId != 0) modal = parm.Adapt<Shop>().ToUpdate(HttpContext);
|
||||||
else modal = parm.Adapt<Shop>().ToCreate(HttpContext);
|
else modal = parm.Adapt<Shop>().ToCreate(HttpContext);
|
||||||
|
@ -15,6 +15,7 @@ using ARW.Model.Models.Business.GoodsManager.ShopGoodsCategorys;
|
|||||||
using ARW.Model.Vo.Business.GoodsManager.ShopGoodsCategorys;
|
using ARW.Model.Vo.Business.GoodsManager.ShopGoodsCategorys;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using ARW.Admin.WebApi.Framework;
|
using ARW.Admin.WebApi.Framework;
|
||||||
|
using ARW.Service.Business.IBusinessService.ShopManager.Shops;
|
||||||
|
|
||||||
|
|
||||||
namespace ARW.WebApi.Controllers.Business.GoodsManager.ShopGoodsCategorys
|
namespace ARW.WebApi.Controllers.Business.GoodsManager.ShopGoodsCategorys
|
||||||
@ -30,14 +31,16 @@ namespace ARW.WebApi.Controllers.Business.GoodsManager.ShopGoodsCategorys
|
|||||||
public class ShopGoodsCategoryController : BaseController
|
public class ShopGoodsCategoryController : BaseController
|
||||||
{
|
{
|
||||||
private readonly IShopGoodsCategoryService _ShopGoodsCategoryService;
|
private readonly IShopGoodsCategoryService _ShopGoodsCategoryService;
|
||||||
|
private readonly IShopService _ShopService;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 依赖注入
|
/// 依赖注入
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ShopGoodsCategoryService">店铺商品类目服务</param>
|
/// <param name="ShopGoodsCategoryService">店铺商品类目服务</param>
|
||||||
public ShopGoodsCategoryController(IShopGoodsCategoryService ShopGoodsCategoryService)
|
public ShopGoodsCategoryController(IShopGoodsCategoryService ShopGoodsCategoryService, IShopService shopService)
|
||||||
{
|
{
|
||||||
_ShopGoodsCategoryService = ShopGoodsCategoryService;
|
_ShopGoodsCategoryService = ShopGoodsCategoryService;
|
||||||
|
_ShopService = shopService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -50,6 +53,14 @@ namespace ARW.WebApi.Controllers.Business.GoodsManager.ShopGoodsCategorys
|
|||||||
[ActionPermissionFilter(Permission = "business:shopgoodscategory:treelist")]
|
[ActionPermissionFilter(Permission = "business:shopgoodscategory:treelist")]
|
||||||
public async Task<IActionResult> GetShopGoodsCategoryList([FromQuery] ShopGoodsCategoryQueryDto parm)
|
public async Task<IActionResult> GetShopGoodsCategoryList([FromQuery] ShopGoodsCategoryQueryDto parm)
|
||||||
{
|
{
|
||||||
|
var user = JwtUtil.GetLoginUser(App.HttpContext);
|
||||||
|
if (user.UserId != 1)
|
||||||
|
{
|
||||||
|
var shop = await _ShopService.GetFirstAsync(s => s.ShopUserId == user.UserId);
|
||||||
|
if (shop == null) throw new Exception("当前用户没有店铺");
|
||||||
|
parm.ShopGuid = shop.ShopGuid;
|
||||||
|
}
|
||||||
|
|
||||||
var res = await _ShopGoodsCategoryService.GetShopGoodsCategoryTreeList(parm);
|
var res = await _ShopGoodsCategoryService.GetShopGoodsCategoryTreeList(parm);
|
||||||
res ??= new List<ShopGoodsCategoryVo>();
|
res ??= new List<ShopGoodsCategoryVo>();
|
||||||
|
|
||||||
@ -72,6 +83,14 @@ namespace ARW.WebApi.Controllers.Business.GoodsManager.ShopGoodsCategorys
|
|||||||
if (parm.ShopGoodsCategoryId != 0) modal = parm.Adapt<ShopGoodsCategory>().ToUpdate(HttpContext);
|
if (parm.ShopGoodsCategoryId != 0) modal = parm.Adapt<ShopGoodsCategory>().ToUpdate(HttpContext);
|
||||||
else modal = parm.Adapt<ShopGoodsCategory>().ToCreate(HttpContext);
|
else modal = parm.Adapt<ShopGoodsCategory>().ToCreate(HttpContext);
|
||||||
|
|
||||||
|
var user = JwtUtil.GetLoginUser(App.HttpContext);
|
||||||
|
if (user.UserId != 1)
|
||||||
|
{
|
||||||
|
var shop = await _ShopService.GetFirstAsync(s => s.ShopUserId == user.UserId);
|
||||||
|
if (shop == null) throw new Exception("当前用户没有店铺");
|
||||||
|
modal.ShopGuid = shop.ShopGuid;
|
||||||
|
}
|
||||||
|
|
||||||
var res = await _ShopGoodsCategoryService.AddOrUpdateShopGoodsCategory(modal);
|
var res = await _ShopGoodsCategoryService.AddOrUpdateShopGoodsCategory(modal);
|
||||||
return SUCCESS(res);
|
return SUCCESS(res);
|
||||||
}
|
}
|
||||||
@ -99,9 +118,10 @@ namespace ARW.WebApi.Controllers.Business.GoodsManager.ShopGoodsCategorys
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("importData")]
|
[HttpPost("importData")]
|
||||||
[Log(Title = "店铺商品类目导入", BusinessType = BusinessType.IMPORT, IsSaveRequestData = false, IsSaveResponseData = false)]
|
[Log(Title = "店铺商品类目导入", BusinessType = BusinessType.IMPORT, IsSaveRequestData = false, IsSaveResponseData = false)]
|
||||||
[ActionPermissionFilter(Permission = "business:business:shopgoodscategory:import")]
|
[ActionPermissionFilter(Permission = "business:shopgoodscategory:import")]
|
||||||
public async Task<IActionResult> ImportExcel([FromForm(Name = "file")] IFormFile formFile, bool updateSupport)
|
public async Task<IActionResult> ImportExcel([FromForm(Name = "file")] IFormFile formFile, bool updateSupport)
|
||||||
{
|
{
|
||||||
|
|
||||||
var isUpdateSupport = updateSupport;
|
var isUpdateSupport = updateSupport;
|
||||||
IEnumerable<ShopGoodsCategoryVo> parm = ExcelHelper<ShopGoodsCategoryVo>.ImportData(formFile.OpenReadStream());
|
IEnumerable<ShopGoodsCategoryVo> parm = ExcelHelper<ShopGoodsCategoryVo>.ImportData(formFile.OpenReadStream());
|
||||||
|
|
||||||
@ -110,10 +130,10 @@ namespace ARW.WebApi.Controllers.Business.GoodsManager.ShopGoodsCategorys
|
|||||||
foreach (ShopGoodsCategoryVo item in parm)
|
foreach (ShopGoodsCategoryVo item in parm)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
var ShopGoodsCategory = await _ShopGoodsCategoryService.HandleImportData(item);
|
var user = JwtUtil.GetLoginUser(App.HttpContext);
|
||||||
var modal = ShopGoodsCategory.Adapt<ShopGoodsCategory>().ToCreate(HttpContext);
|
//var ShopGoodsCategory = await _ShopGoodsCategoryService.HandleImportData(item,user.UserId,i);
|
||||||
var user = JwtUtil.GetLoginUser(App.HttpContext).UserName;
|
//var modal = ShopGoodsCategory.Adapt<ShopGoodsCategory>().ToCreate(HttpContext);
|
||||||
var msg = await _ShopGoodsCategoryService.ImportExcel(modal, i, isUpdateSupport, user);
|
var msg = await _ShopGoodsCategoryService.ImportExcel(item, i, isUpdateSupport, user);
|
||||||
msgList.Add(msg);
|
msgList.Add(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,10 +155,16 @@ namespace ARW.WebApi.Controllers.Business.GoodsManager.ShopGoodsCategorys
|
|||||||
|
|
||||||
// 示例数据
|
// 示例数据
|
||||||
var allValues = new List<List<string>>();
|
var allValues = new List<List<string>>();
|
||||||
var values = new List<string>() { "111", "222", "333" };
|
var values = new List<string>() { "我的店铺", "", "电脑", "显示", "1" };
|
||||||
var values2 = new List<string>() { "444", "555", "666" };
|
var values2 = new List<string>() { "我的店铺", "电脑", "商业笔记本", "显示", "1" };
|
||||||
|
var values3 = new List<string>() { "我的店铺", "电脑", "游戏本", "显示", "2" };
|
||||||
|
var values4 = new List<string>() { "我的店铺", "", "外设", "显示", "2" };
|
||||||
|
var values5 = new List<string>() { "我的店铺", "外设", "鼠标", "显示", "1" };
|
||||||
allValues.Add(values);
|
allValues.Add(values);
|
||||||
allValues.Add(values2);
|
allValues.Add(values2);
|
||||||
|
allValues.Add(values3);
|
||||||
|
allValues.Add(values4);
|
||||||
|
allValues.Add(values5);
|
||||||
string sFileName = DownloadImportTemplate(ShopGoodsCategory, stream, "店铺商品类目导入模板", allValues);
|
string sFileName = DownloadImportTemplate(ShopGoodsCategory, stream, "店铺商品类目导入模板", allValues);
|
||||||
|
|
||||||
return File(stream.ToArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $"{sFileName}");
|
return File(stream.ToArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $"{sFileName}");
|
||||||
@ -153,6 +179,13 @@ namespace ARW.WebApi.Controllers.Business.GoodsManager.ShopGoodsCategorys
|
|||||||
[ActionPermissionFilter(Permission = "business:shopgoodscategory:export")]
|
[ActionPermissionFilter(Permission = "business:shopgoodscategory:export")]
|
||||||
public async Task<IActionResult> ExportExcel([FromQuery] ShopGoodsCategoryQueryDto parm)
|
public async Task<IActionResult> ExportExcel([FromQuery] ShopGoodsCategoryQueryDto parm)
|
||||||
{
|
{
|
||||||
|
var user = JwtUtil.GetLoginUser(App.HttpContext);
|
||||||
|
if (user.UserId != 1)
|
||||||
|
{
|
||||||
|
var shop = await _ShopService.GetFirstAsync(s => s.ShopUserId == user.UserId);
|
||||||
|
if (shop == null) throw new Exception("当前用户没有店铺");
|
||||||
|
parm.ShopGuid = shop.ShopGuid;
|
||||||
|
}
|
||||||
var list = await _ShopGoodsCategoryService.GetShopGoodsCategoryList(parm);
|
var list = await _ShopGoodsCategoryService.GetShopGoodsCategoryList(parm);
|
||||||
var data = list;
|
var data = list;
|
||||||
|
|
||||||
|
@ -108,6 +108,10 @@ namespace ARW.WebApi.Controllers.Business.ShopManager.Shops
|
|||||||
{
|
{
|
||||||
if (parm == null) { throw new CustomException("请求参数错误"); }
|
if (parm == null) { throw new CustomException("请求参数错误"); }
|
||||||
|
|
||||||
|
// 检查是否有重复商店名称
|
||||||
|
var isRepeat = await _ShopService.CheckRepeatShopName(parm.ShopName);
|
||||||
|
if (isRepeat) throw new CustomException("商铺名称已存在");
|
||||||
|
|
||||||
var modal = new Shop();
|
var modal = new Shop();
|
||||||
if (parm.ShopId != 0) modal = parm.Adapt<Shop>().ToUpdate(HttpContext);
|
if (parm.ShopId != 0) modal = parm.Adapt<Shop>().ToUpdate(HttpContext);
|
||||||
else modal = parm.Adapt<Shop>().ToCreate(HttpContext);
|
else modal = parm.Adapt<Shop>().ToCreate(HttpContext);
|
||||||
|
@ -117,7 +117,7 @@ $if(replaceDto.ShowBtnImport)
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("importData")]
|
[HttpPost("importData")]
|
||||||
[Log(Title = "${genTable.FunctionName}导入", BusinessType = BusinessType.IMPORT, IsSaveRequestData = false, IsSaveResponseData = false)]
|
[Log(Title = "${genTable.FunctionName}导入", BusinessType = BusinessType.IMPORT, IsSaveRequestData = false, IsSaveResponseData = false)]
|
||||||
[ActionPermissionFilter(Permission = "business:${replaceDto.PermissionPrefix}:import")]
|
[ActionPermissionFilter(Permission = "${replaceDto.PermissionPrefix}:import")]
|
||||||
public async Task<IActionResult> ImportExcel([FromForm(Name = "file")] IFormFile formFile,bool updateSupport)
|
public async Task<IActionResult> ImportExcel([FromForm(Name = "file")] IFormFile formFile,bool updateSupport)
|
||||||
{
|
{
|
||||||
var isUpdateSupport = updateSupport;
|
var isUpdateSupport = updateSupport;
|
||||||
|
@ -98,7 +98,7 @@ $end
|
|||||||
$if(replaceDto.ShowBtnImport)
|
$if(replaceDto.ShowBtnImport)
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Upload" @click="UploadDialogVisible = true"
|
<el-button type="primary" plain icon="Upload" @click="UploadDialogVisible = true"
|
||||||
v-hasPermi="['business:student:import']">导入</el-button>
|
v-hasPermi="['${replaceDto.PermissionPrefix}:import']">导入</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
$end
|
$end
|
||||||
$if(replaceDto.ShowBtnExport)
|
$if(replaceDto.ShowBtnExport)
|
||||||
@ -175,7 +175,7 @@ $if(replaceDto.ShowBtnAudit)
|
|||||||
@click="handleAudit(scope.row)" v-hasPermi="['${replaceDto.PermissionPrefix}:audit']">审核</el-button>
|
@click="handleAudit(scope.row)" v-hasPermi="['${replaceDto.PermissionPrefix}:audit']">审核</el-button>
|
||||||
$if(replaceDto.ShowBtnEdit)
|
$if(replaceDto.ShowBtnEdit)
|
||||||
<el-button type="primary" v-if="scope.row.${tool.FirstLowerCase(genTable.BusinessName)}AuditStatus == 2" size="small" icon="edit" @click="handleUpdate(scope.row)"
|
<el-button type="primary" v-if="scope.row.${tool.FirstLowerCase(genTable.BusinessName)}AuditStatus == 2" size="small" icon="edit" @click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['${replaceDto.PermissionPrefix}:addOrUpdateKey']">编辑</el-button>
|
v-hasPermi="['${replaceDto.PermissionPrefix}:addOrUpdate']">编辑</el-button>
|
||||||
$end
|
$end
|
||||||
$if(replaceDto.ShowBtnDelete)
|
$if(replaceDto.ShowBtnDelete)
|
||||||
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||||
@ -187,7 +187,7 @@ $end
|
|||||||
$else
|
$else
|
||||||
$if(replaceDto.ShowBtnEdit)
|
$if(replaceDto.ShowBtnEdit)
|
||||||
<el-button type="primary" size="small" icon="edit" @click="handleUpdate(scope.row)"
|
<el-button type="primary" size="small" icon="edit" @click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['${replaceDto.PermissionPrefix}:addOrUpdateKey']">编辑</el-button>
|
v-hasPermi="['${replaceDto.PermissionPrefix}:addOrUpdate']">编辑</el-button>
|
||||||
$end
|
$end
|
||||||
$if(replaceDto.ShowBtnDelete)
|
$if(replaceDto.ShowBtnDelete)
|
||||||
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||||
|
Loading…
Reference in New Issue
Block a user