MES齐套搭配方案查询接口,忽略中间变量
This commit is contained in:
@@ -3,6 +3,8 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto.Outputs
|
||||
{
|
||||
@@ -63,11 +65,11 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs
|
||||
/// 齐套明细输出
|
||||
/// </summary>
|
||||
public List<CollocationSchemeDOutput>? CollocationSchemeDs { get; set; }
|
||||
|
||||
public List<WmsCollocationSchemeD> list{ get; set; }
|
||||
[JsonIgnore]
|
||||
public List<WmsCollocationSchemeD>? list { get; set; }
|
||||
}
|
||||
|
||||
public class CollocationSchemeDOutput
|
||||
|
||||
public class CollocationSchemeDOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键ID
|
||||
|
||||
@@ -94,13 +94,12 @@ namespace Tnb.WarehouseMgr
|
||||
try
|
||||
{
|
||||
results = await _db.Queryable<WmsCollocationSchemeH>()
|
||||
.LeftJoin<WmsCollocationSchemeD>((a, b) => b.bill_id == a.id)
|
||||
.Where(a => a.material_id == input.material_id)
|
||||
.Select((a, b) => new CollocationSchemeOutput
|
||||
.Select(a => new CollocationSchemeOutput
|
||||
{
|
||||
list = SqlFunc.Subqueryable<WmsCollocationSchemeD>().Where(b => b.bill_id == a.id).ToList(),
|
||||
}, true)
|
||||
.Mapper(it=> it.CollocationSchemeDs = it.list.Adapt<List<CollocationSchemeDOutput>>())
|
||||
.Mapper(it => it.CollocationSchemeDs = it.list?.Adapt<List<CollocationSchemeDOutput>>())
|
||||
.ToListAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user