This commit is contained in:
2023-05-09 17:25:33 +08:00
parent bf67c0f557
commit 208e6258d3
6 changed files with 63 additions and 25 deletions

View File

@@ -1,8 +1,10 @@
using JNPF.Common.Core.Manager;
using JNPF.Common.Enums;
using JNPF.Common.Filter;
using JNPF.Common.Security;
using JNPF.DependencyInjection;
using JNPF.DynamicApiController;
using JNPF.FriendlyException;
using JNPF.Systems.Entitys.System;
using JNPF.Systems.Interfaces.System;
using Microsoft.AspNetCore.Mvc;
@@ -69,11 +71,12 @@ namespace Tnb.BasicData
await _repository.AsSugarClient().Insertable<BasMaterialIntoFactorySpecifications>(materialIntoFactorySpecifications).ExecuteCommandAsync();
});
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
return result.IsSuccess ? "复制成功" : result.ErrorMessage;
}
/// <summary>
/// 获取物料清单所有子集物料信息
/// 获取物料清单及其所有子集物料信息
/// </summary>
/// <param name="queryInput"></param>
/// <returns></returns>
@@ -82,6 +85,8 @@ namespace Tnb.BasicData
{
var db = _repository.AsSugarClient();
List<string> ids = await GetAllChildrenMaterialId(queryInput.ebom_id);
BasEbomH ebom = await db.Queryable<BasEbomH>().Where(x => x.id == queryInput.ebom_id).SingleAsync();
ids.Add(ebom.material_id);
var result = await db.Queryable<BasMaterial>()
.LeftJoin<DictionaryDataEntity>((a, b) => a.unit_id == b.EnCode)
.LeftJoin<DictionaryTypeEntity>((a, b, c) => b.DictionaryTypeId == c.Id && c.EnCode == DictConst.MeasurementUnit && c.DeleteMark == null)