using System.Dynamic;
|
using MES.Service.service.BasicData;
|
using MES.Service.util;
|
using Microsoft.AspNetCore.Mvc;
|
|
namespace MESApplication.Controllers.BasicData;
|
|
/// <summary>
|
/// Simple控制器 - 菜单树形结构
|
/// </summary>
|
[ApiController]
|
[Route("api/[controller]")]
|
public class MesSimpleController : ControllerBase
|
{
|
private readonly MesSimpleManager _manager = new();
|
|
/// <summary>
|
/// 获取树形结构数据
|
/// </summary>
|
/// <returns>树形结构数据</returns>
|
[HttpPost("GetTree")]
|
public ResponseResult GetTree()
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBillList = _manager.GetTree();
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
/// <summary>
|
/// 获取树形结构数据(新表 MES_SIMPLE_NEW)
|
/// </summary>
|
/// <returns>树形结构数据</returns>
|
[HttpPost("GetTreeNew")]
|
public ResponseResult GetTreeNew()
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBillList = _manager.GetTreeNew();
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
}
|