@@ -1,4 +1,7 @@ | |||||
| | ||||
using BPA.SAAS.Manage.Core.Org; | |||||
using Microsoft.AspNetCore.Authorization; | |||||
namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Authorization | namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Authorization | ||||
{ | { | ||||
@@ -6,6 +9,24 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Authorization | |||||
[ApiDescriptionSettings("开放平台", Tag = "授权管理"), AllowAnonymous, NonUnify] | [ApiDescriptionSettings("开放平台", Tag = "授权管理"), AllowAnonymous, NonUnify] | ||||
public class AuthServices : IDynamicApiController | public class AuthServices : IDynamicApiController | ||||
{ | { | ||||
private readonly ISqlSugarClient _db; | |||||
public AuthServices(ISqlSugarClient db) | |||||
{ | |||||
_db = db; | |||||
} | |||||
/// <summary> | |||||
/// 获取加盟商信息 | |||||
/// </summary> | |||||
/// <param name="id"></param> | |||||
/// <returns></returns> | |||||
[HttpGet("/api/authorization/GetCompanyById")] | |||||
[AllowAnonymous] | |||||
public async Task<BPA_Company> GetCompanyById(string id) | |||||
{ | |||||
var data = await _db.Queryable<BPA_Company>().FirstAsync(x => x.Id == id); | |||||
return data; | |||||
} | |||||
} | } | ||||
} | } |
@@ -30,4 +30,10 @@ | |||||
<ProjectReference Include="..\BPA.SAAS.Manage.Core\BPA.SAAS.Manage.Core.csproj" /> | <ProjectReference Include="..\BPA.SAAS.Manage.Core\BPA.SAAS.Manage.Core.csproj" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | |||||
<Folder Include="AExternalPlatform\Service\Authorization\Dtos\" /> | |||||
<Folder Include="AExternalPlatform\Service\Authorization\Services\" /> | |||||
<Folder Include="AExternalPlatform\Service\CheckService\Dtos\" /> | |||||
</ItemGroup> | |||||
</Project> | </Project> |
@@ -202,8 +202,10 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
if (goods == null) throw Oops.Oh("商品不存在"); | if (goods == null) throw Oops.Oh("商品不存在"); | ||||
var goodsbom = _db.Queryable<BPA_GoodsBom>().Where(x => x.Goods_Id == id).ToList(); | var goodsbom = _db.Queryable<BPA_GoodsBom>().Where(x => x.Goods_Id == id).ToList(); | ||||
var goodsTechnology = _db.Queryable<BPA_GoodsTechnologyAction>().Where(x => x.GoodsId == id).ToList(); | var goodsTechnology = _db.Queryable<BPA_GoodsTechnologyAction>().Where(x => x.GoodsId == id).ToList(); | ||||
//var FoodMenuGoods = _db.Queryable<BPA_FoodMenuGoods>().Where(x => x.GoodsId == id).ToList(); | |||||
await _db.Deleteable(goodsbom).ExecuteCommandAsync(); | await _db.Deleteable(goodsbom).ExecuteCommandAsync(); | ||||
await _db.Deleteable(goodsTechnology).ExecuteCommandAsync(); | await _db.Deleteable(goodsTechnology).ExecuteCommandAsync(); | ||||
//await _db.Deleteable(FoodMenuGoods).ExecuteCommandAsync(); | |||||
var res = await _db.Deleteable(goods).ExecuteCommandAsync(); | var res = await _db.Deleteable(goods).ExecuteCommandAsync(); | ||||
_db.Ado.CommitTran(); | _db.Ado.CommitTran(); | ||||
return res > 0; | return res > 0; | ||||
@@ -57,7 +57,7 @@ namespace BPA.SAAS.Manage.Application.System.Services | |||||
Status = t.Status, | Status = t.Status, | ||||
IsAdmin=t.IsAdmin, | IsAdmin=t.IsAdmin, | ||||
Type= t.Type, | Type= t.Type, | ||||
//TypeName= GetTypeName(t.Type), | |||||
// TypeName= GetTypeName(t.Type), | |||||
Children = AllMenus.Where(x => x.Pid == t.Id).Select(x => new MenuTreeDtoOutput | Children = AllMenus.Where(x => x.Pid == t.Id).Select(x => new MenuTreeDtoOutput | ||||
{ | { | ||||
Id = x.Id, | Id = x.Id, | ||||
@@ -87,42 +87,13 @@ namespace BPA.SAAS.Manage.Application.System.Services | |||||
Status = y.Status, | Status = y.Status, | ||||
IsAdmin=y.IsAdmin, | IsAdmin=y.IsAdmin, | ||||
Type = y.Type, | Type = y.Type, | ||||
// TypeName = GetTypeName(y.Type), | |||||
//TypeName = GetTypeName(y.Type), | |||||
}).ToList() | }).ToList() | ||||
}).ToList() | }).ToList() | ||||
}).ToList(); | }).ToList(); | ||||
return data; | return data; | ||||
} | } | ||||
public string GetTypeName(string type) | |||||
{ | |||||
var ary = type.Split(','); | |||||
var name = ""; | |||||
for (int i = 0; i < ary.Length; i++) | |||||
{ | |||||
if (ary[i] == "0") | |||||
{ | |||||
name += "团餐"; | |||||
} | |||||
if (ary[i] == "1") | |||||
{ | |||||
name += "门店"; | |||||
} | |||||
if (ary[i] == "2") | |||||
{ | |||||
name += "后厨"; | |||||
} | |||||
if (ary[i] == "3") | |||||
{ | |||||
name += "公共"; | |||||
} | |||||
if(i< ary.Length - 1) | |||||
{ | |||||
name += ","; | |||||
} | |||||
} | |||||
return name; | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 新增菜单 | /// 新增菜单 | ||||
/// </summary> | /// </summary> | ||||
@@ -0,0 +1,24 @@ | |||||
using BPA.SAAS.Manage.Core.Base; | |||||
using SqlSugar; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Core.DataBase | |||||
{ | |||||
[SugarTable("bpa_foodmenugoods")] | |||||
public class BPA_FoodMenuGoods : IBaseEntity, IGroupId | |||||
{ | |||||
/// <summary> | |||||
/// 菜谱id | |||||
/// </summary> | |||||
public string FoodMenuId { get; set; } | |||||
/// <summary> | |||||
/// 商品id | |||||
/// </summary> | |||||
public string GoodsId { get; set; } | |||||
public string GroupId { get; set; } | |||||
} | |||||
} |