bug
This commit is contained in:
40
BasicData/Tnb.BasicData.Entities/Dto/MbomMaterialOutput.cs
Normal file
40
BasicData/Tnb.BasicData.Entities/Dto/MbomMaterialOutput.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
namespace Tnb.BasicData.Entities.Dto
|
||||
{
|
||||
public class MbomMaterialOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string code { get; set; }
|
||||
public string name { get; set; }
|
||||
/// <summary>
|
||||
/// 物料规格
|
||||
/// </summary>
|
||||
public string? material_specification { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料型号(箱号)
|
||||
/// </summary>
|
||||
public string? material_standard { get; set; }
|
||||
public string unit_id { get; set; } = string.Empty;
|
||||
public string category_id { get; set; } = string.Empty;
|
||||
public List<MbomMaterialDetailOutput> tablefield183 { get; set; } = new List<MbomMaterialDetailOutput>();
|
||||
|
||||
}
|
||||
|
||||
public class MbomMaterialDetailOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 主单位数量
|
||||
/// </summary>
|
||||
public string? number_of_primary_unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 辅助单位数量
|
||||
/// </summary>
|
||||
public string? number_of_auxiliary_unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 辅助单位
|
||||
/// </summary>
|
||||
public string auxiliary_unit_id { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||
@@ -589,7 +590,6 @@ namespace Tnb.BasicData
|
||||
/// <param name="mbomSaveDataInput"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<string> SaveDataNew(MbomSaveDataInput mbomSaveDataInput)
|
||||
{
|
||||
ErrorCode errorCode = ErrorCode.COM1008;
|
||||
@@ -776,7 +776,7 @@ namespace Tnb.BasicData
|
||||
.SetColumns(x => x.station == process!.station)
|
||||
.SetColumns(x => x.byproduct_status == process!.byproduct_status)
|
||||
.SetColumns(x => x.production_method == process!.production_method)
|
||||
.SetColumns(x => x.process_id == process!.id)
|
||||
.SetColumns(x => x.process_id == process!.process_id)
|
||||
.Where(x => x.id == process!.id).ExecuteCommandAsync();
|
||||
|
||||
if (process!.inputs != null)
|
||||
@@ -876,6 +876,36 @@ namespace Tnb.BasicData
|
||||
}
|
||||
return result.IsSuccess ? "保存成功" : result.ErrorMessage;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<dynamic> GetMaterialInfo(string id)
|
||||
{
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
MbomMaterialOutput basMaterial = await db.Queryable<BasMaterial>()
|
||||
.Select((a) => new MbomMaterialOutput
|
||||
{
|
||||
id = a.id,
|
||||
code = a.code,
|
||||
name = a.name,
|
||||
material_specification = a.material_specification,
|
||||
material_standard = a.material_standard,
|
||||
tablefield183 = SqlFunc.Subqueryable<BasMaterialUnit>()
|
||||
.LeftJoin<DictionaryTypeEntity>((x,y)=>y.EnCode==DictConst.MeasurementUnit)
|
||||
.LeftJoin<DictionaryDataEntity>((x,y,z)=>y.Id==z.DictionaryTypeId)
|
||||
.Where(x=>x.material_id==a.id)
|
||||
.ToList((x,y,z)=>new MbomMaterialDetailOutput
|
||||
{
|
||||
number_of_primary_unit = x.number_of_primary_unit,
|
||||
number_of_auxiliary_unit = x.number_of_primary_unit,
|
||||
auxiliary_unit_id = z.FullName
|
||||
}),
|
||||
|
||||
}).FirstAsync();
|
||||
Dictionary<string, object> result = new Dictionary<string, object>();
|
||||
result.Add("id",id);
|
||||
result.Add("data",basMaterial);
|
||||
return basMaterial;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user