模具与物料、设备接口修改
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Aop.Api.Domain;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Filter;
|
||||
@@ -167,15 +168,21 @@ namespace Tnb.BasicData
|
||||
public async Task<dynamic> GetMaterialByType(Dictionary<string, string> dic)
|
||||
{
|
||||
string types = dic["types"];
|
||||
int currentPage = int.Parse(dic["currentPage"].ToString());
|
||||
int pagesize = int.Parse(dic["pageSize"].ToString());
|
||||
string queryJson = dic["queryJson"];
|
||||
string[] typeArr = types.Split(",");
|
||||
List<BasMaterial> list = await _repository.AsSugarClient().Queryable<BasMaterial>().Where(x => x.state == "1").ToListAsync();
|
||||
List<BasMaterial> result = new();
|
||||
List<string> ids = new();
|
||||
foreach (string type in typeArr)
|
||||
{
|
||||
result.AddRange(list.Where(x => x.category_id.Contains(type)));
|
||||
ids.AddRange(list.Where(x => x.category_id.Contains(type)).Select(p => p.id));
|
||||
}
|
||||
|
||||
return result;
|
||||
SqlSugarPagedList<BasMaterial> result = await _repository.AsSugarClient().Queryable<BasMaterial>()
|
||||
.WhereIF(ids.Count > 0, a => ids.Contains(a.id))
|
||||
.WhereIF(!string.IsNullOrEmpty(queryJson), a => a.name.Contains(queryJson) || a.code.Contains(queryJson))
|
||||
.Select(a => a).ToPagedListAsync(currentPage, pagesize);
|
||||
return PageResult<BasMaterial>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
|
||||
Reference in New Issue
Block a user