|
|
|
@ -1,9 +1,11 @@
|
|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Data;
|
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
|
using DS.WMS.Core.TaskInteraction.Entity;
|
|
|
|
|
using DS.WMS.Core.TaskInteraction.Interface;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.TaskInteraction.Method
|
|
|
|
|
{
|
|
|
|
@ -74,6 +76,29 @@ namespace DS.WMS.Core.TaskInteraction.Method
|
|
|
|
|
// return DataResult<Tuple<string, string>>.Success(new Tuple<string, string>(title, content));
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取数据提供程序
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query">查询条件</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<DataResult<List<BusinessDataProvider>>> GetProvidersAsync(string? query)
|
|
|
|
|
{
|
|
|
|
|
List<IConditionalModel> conditionals = [];
|
|
|
|
|
if (!string.IsNullOrEmpty(query))
|
|
|
|
|
conditionals = Db.Utilities.JsonToConditionalModels(query);
|
|
|
|
|
|
|
|
|
|
var list = await TenantDb.Queryable<BusinessDataProvider>()
|
|
|
|
|
.Where(conditionals).ToListAsync();
|
|
|
|
|
|
|
|
|
|
var result = DataResult<List<BusinessDataProvider>>.Success(list);
|
|
|
|
|
result.AdditionalData ??= [];
|
|
|
|
|
var types = Array.FindAll(Assembly.GetExecutingAssembly().GetTypes(),
|
|
|
|
|
x => x.IsClass && typeof(IDataProvider).IsAssignableFrom(x));
|
|
|
|
|
result.AdditionalData["AvailableTypes"] = types.Select(x => x.FullName);
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取分页列表
|
|
|
|
|
/// </summary>
|
|
|
|
|