创建子工单
This commit is contained in:
@@ -128,6 +128,38 @@ namespace Tnb.BasicData
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetCanCreateSubWorkOrderMaterial(MaterialSelectQueryInput queryInput)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
if (!string.IsNullOrEmpty(queryInput.ebom_id))
|
||||
{
|
||||
List<string> ids = await GetAllChildrenMaterialId(queryInput.ebom_id,0);
|
||||
var result = await db.Queryable<BasMaterial>()
|
||||
.LeftJoin<DictionaryTypeEntity>((a, b) => b.EnCode == DictConst.MeasurementUnit && b.DeleteMark == null)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b, c) => c.DictionaryTypeId == b.Id && a.unit_id == c.EnCode)
|
||||
.WhereIF(!string.IsNullOrEmpty(queryInput.material_info), (a, b, c) => a.code.Contains(queryInput.material_info) || a.name.Contains(queryInput.material_info))
|
||||
.WhereIF(!string.IsNullOrEmpty(queryInput.ebom_id), (a, b, c) => ids.Contains(a.id))
|
||||
.Where((a,b,c)=>a.is_create_sub_work_order=="1")
|
||||
.Select((a, b, c) => new MaterialSelectOutput()
|
||||
{
|
||||
id = a.id,
|
||||
code = a.code,
|
||||
name = a.name,
|
||||
descrip = a.descrip,
|
||||
unit_id = a.unit_id,
|
||||
unit_name = c.FullName,
|
||||
}).ToPagedListAsync(queryInput.currentPage, queryInput.pageSize);
|
||||
|
||||
return PageResult<MaterialSelectOutput>.SqlSugarPageResult(result);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return PageResult<MaterialSelectOutput>.SqlSugarPageResult(new SqlSugarPagedList<MaterialSelectOutput>());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取物料清单下所子集物料id
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user