子表信息可以传ids查询
This commit is contained in:
@@ -33,6 +33,7 @@ using Mapster;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -245,6 +246,33 @@ namespace JNPF.VisualDev
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据ids获取详情.
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="modelId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("DataChanges")]
|
||||
public async Task<dynamic> GetDetails(Dictionary<string,string> dic)
|
||||
{
|
||||
List<string> ids = dic.ContainsKey("ids") ? JsonConvert.DeserializeObject<List<string>>(dic["ids"]) : new List<string>();
|
||||
string modelId = dic.ContainsKey("modelId") ? dic["modelId"] : "";
|
||||
List<dynamic> result = new List<dynamic>();
|
||||
if (ids != null && ids.Count > 0)
|
||||
{
|
||||
foreach (var id in ids)
|
||||
{
|
||||
var data = await GetDetails(id, modelId);
|
||||
if (data != null)
|
||||
{
|
||||
result.Add(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user