|
|
@@ -37,7 +37,10 @@ namespace BPA.SAAS.KitChenManage.Application.Authorization.Services |
|
|
|
Id = a.Id, |
|
|
|
Key = a.Key, |
|
|
|
StoreId = a.StoreId, |
|
|
|
StoreName = b.Name |
|
|
|
StoreName = b.Name, |
|
|
|
UpdateAt = a.UpdateAt, |
|
|
|
PeriodValidity = a.PeriodValidity, |
|
|
|
|
|
|
|
}) |
|
|
|
.ToPageListAsync(input.Current, input.PageSize, total); |
|
|
|
PageUtil util = new PageUtil() |
|
|
@@ -98,6 +101,11 @@ namespace BPA.SAAS.KitChenManage.Application.Authorization.Services |
|
|
|
/// <returns></returns> |
|
|
|
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); |
|
|
|
if (data == null) |
|
|
|
{ |
|
|
@@ -110,6 +118,22 @@ namespace BPA.SAAS.KitChenManage.Application.Authorization.Services |
|
|
|
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> |
|
|
|
/// CodeFirst |
|
|
|