@@ -64,6 +64,17 @@ namespace BPA.SAAS.KitChenManage.Application.Authorization | |||||
return await _authorizationService.UpdateStoreAuthTime(input); | return await _authorizationService.UpdateStoreAuthTime(input); | ||||
} | } | ||||
/// <summary> | |||||
/// 删除店铺权限 | |||||
/// </summary> | |||||
/// <param name="id"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/authorization/delstoreauthorization")] | |||||
public async Task<bool> DelStoreAuthorization(string id) | |||||
{ | |||||
return await _authorizationService.DelStoreAuthorization(id); | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// CodeFirst | /// CodeFirst | ||||
/// </summary> | /// </summary> | ||||
@@ -37,7 +37,10 @@ namespace BPA.SAAS.KitChenManage.Application.Authorization.Services | |||||
Id = a.Id, | Id = a.Id, | ||||
Key = a.Key, | Key = a.Key, | ||||
StoreId = a.StoreId, | StoreId = a.StoreId, | ||||
StoreName = b.Name | |||||
StoreName = b.Name, | |||||
UpdateAt = a.UpdateAt, | |||||
PeriodValidity = a.PeriodValidity, | |||||
}) | }) | ||||
.ToPageListAsync(input.Current, input.PageSize, total); | .ToPageListAsync(input.Current, input.PageSize, total); | ||||
PageUtil util = new PageUtil() | PageUtil util = new PageUtil() | ||||
@@ -98,6 +101,11 @@ namespace BPA.SAAS.KitChenManage.Application.Authorization.Services | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<bool> UpdateStoreAuthTime(CreateOrUpDateStoreAuthorizationDto input) | public async Task<bool> UpdateStoreAuthTime(CreateOrUpDateStoreAuthorizationDto input) | ||||
{ | { | ||||
var data1 = await _db.Queryable<BPA_StoreAuthorization>().FirstAsync(x => x.StoreId == input.StoreId); | |||||
if (data1!=null&&data1.Id!=input.Id) | |||||
{ | |||||
throw Oops.Oh("店铺授权信息已存在"); | |||||
} | |||||
var data = await _db.Queryable<BPA_StoreAuthorization>().FirstAsync(x => x.Id == input.Id); | var data = await _db.Queryable<BPA_StoreAuthorization>().FirstAsync(x => x.Id == input.Id); | ||||
if (data == null) | if (data == null) | ||||
{ | { | ||||
@@ -110,6 +118,22 @@ namespace BPA.SAAS.KitChenManage.Application.Authorization.Services | |||||
return await _db.Updateable(data).ExecuteCommandHasChangeAsync(); | return await _db.Updateable(data).ExecuteCommandHasChangeAsync(); | ||||
} | } | ||||
/// <summary> | |||||
/// 删除店铺权限 | |||||
/// </summary> | |||||
/// <param name="id"></param> | |||||
/// <returns></returns> | |||||
public async Task<bool> DelStoreAuthorization(string id) | |||||
{ | |||||
var data = await _db.Queryable<BPA_StoreAuthorization>().FirstAsync(x => x.Id == id); | |||||
if (data == null) | |||||
{ | |||||
throw Oops.Oh("授权信息不存在"); | |||||
} | |||||
return await _db.Deleteable(data).ExecuteCommandHasChangeAsync(); | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// CodeFirst | /// CodeFirst | ||||
@@ -36,7 +36,12 @@ namespace BPA.SAAS.KitChenManage.Application.Authorization.Services | |||||
Task<bool> UpdateStoreAuthTime(CreateOrUpDateStoreAuthorizationDto input); | Task<bool> UpdateStoreAuthTime(CreateOrUpDateStoreAuthorizationDto input); | ||||
/// <summary> | |||||
/// 删除店铺权限 | |||||
/// </summary> | |||||
/// <param name="id"></param> | |||||
/// <returns></returns> | |||||
Task<bool> DelStoreAuthorization(string id); | |||||
@@ -31,6 +31,13 @@ | |||||
<param name="input"></param> | <param name="input"></param> | ||||
<returns></returns> | <returns></returns> | ||||
</member> | </member> | ||||
<member name="M:BPA.SAAS.KitChenManage.Application.Authorization.AuthorizationServices.DelStoreAuthorization(System.String)"> | |||||
<summary> | |||||
删除店铺权限 | |||||
</summary> | |||||
<param name="id"></param> | |||||
<returns></returns> | |||||
</member> | |||||
<member name="M:BPA.SAAS.KitChenManage.Application.Authorization.AuthorizationServices.CodeFirst"> | <member name="M:BPA.SAAS.KitChenManage.Application.Authorization.AuthorizationServices.CodeFirst"> | ||||
<summary> | <summary> | ||||
CodeFirst | CodeFirst | ||||
@@ -69,6 +76,13 @@ | |||||
<param name="id"></param> | <param name="id"></param> | ||||
<returns></returns> | <returns></returns> | ||||
</member> | </member> | ||||
<member name="M:BPA.SAAS.KitChenManage.Application.Authorization.Services.AuthorizationService.DelStoreAuthorization(System.String)"> | |||||
<summary> | |||||
删除店铺权限 | |||||
</summary> | |||||
<param name="id"></param> | |||||
<returns></returns> | |||||
</member> | |||||
<member name="M:BPA.SAAS.KitChenManage.Application.Authorization.Services.AuthorizationService.CodeFirst"> | <member name="M:BPA.SAAS.KitChenManage.Application.Authorization.Services.AuthorizationService.CodeFirst"> | ||||
<summary> | <summary> | ||||
CodeFirst | CodeFirst | ||||
@@ -95,6 +109,13 @@ | |||||
<param name="id"></param> | <param name="id"></param> | ||||
<returns></returns> | <returns></returns> | ||||
</member> | </member> | ||||
<member name="M:BPA.SAAS.KitChenManage.Application.Authorization.Services.IAuthorizationService.DelStoreAuthorization(System.String)"> | |||||
<summary> | |||||
删除店铺权限 | |||||
</summary> | |||||
<param name="id"></param> | |||||
<returns></returns> | |||||
</member> | |||||
<member name="M:BPA.SAAS.KitChenManage.Application.Authorization.Services.IAuthorizationService.CodeFirst"> | <member name="M:BPA.SAAS.KitChenManage.Application.Authorization.Services.IAuthorizationService.CodeFirst"> | ||||
<summary> | <summary> | ||||
CodeFirst | CodeFirst | ||||