增加MES-WMS接口
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Aop.Api.Domain;
|
||||
using Aspose.Cells.Drawing;
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Extension;
|
||||
@@ -12,9 +13,12 @@ using JNPF.FriendlyException;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Outputs;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
@@ -78,5 +82,32 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES齐套搭配方案查询接口
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> MESCollocationSchemeQuery(MESCollocationSchemeQueryInput input)
|
||||
{
|
||||
var results = new List<CollocationSchemeOutput>();
|
||||
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
|
||||
{
|
||||
list = SqlFunc.Subqueryable<WmsCollocationSchemeD>().Where(b => b.bill_id == a.id).ToList(),
|
||||
}, true)
|
||||
.Mapper(it=> it.CollocationSchemeDs = it.list.Adapt<List<CollocationSchemeDOutput>>())
|
||||
.ToListAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return await ToApiResult(JNPF.Common.Enums.HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
return await ToApiResult(results);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user