fcx
7 天以前 35f29f98993a2cede58e105ff810c83d7b8858f4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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);
        }
    }
}