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