chengsc
2025-05-08 8a83e6f21af0a764950e45b2565a370fff74daa5
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using WMS.IBLL.IIndexEcharServer;
using WMS.IBLL.ILogServer;
using WMS.IBLL.ISysServer;
 
namespace Wms.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [Authorize]
    public class IndexEcharController : ControllerBase
    {
        /// <summary>
        /// 依赖注入
        /// </summary>
        private readonly IDailyInventoryServer daily;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="_daily"></param>
        public IndexEcharController(IDailyInventoryServer _daily)
        {
            daily = _daily;
        }
 
        /// <summary>
        /// 当前任务量
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DailyInventory()
        {
            //捕获异常
            try
            {
                var list = daily.DailyInventory();
                return Ok(new
                {
                    code = 0,
                    msg = "任务列表",
                    data = list
                });
            }
            catch (Exception ex)
            {
                //抛出异常
                throw new Exception("获取当前任务量异常", ex);
            }
        }
 
        /// <summary>
        /// 当前单据量
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DailyReceipts()
        {
            //捕获异常
            try
            {
                var list = daily.DailyReceipts();
                return Ok(new
                {
                    code = 0,
                    msg = "单据列表",
                    data = list
                });
            }
            catch (Exception ex)
            {
                //抛出异常
                throw new Exception("获取当前单据量异常", ex);
            }
        }
 
        /// <summary>
        /// 获取储位占用量
        /// </summary>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        [HttpPost]
        public IActionResult LocatInventory()
        {
            //捕获异常
            try
            {
                var list = daily.LocatInventory();
                return Ok(new
                {
                    code = 0,
                    msg = "储位占用量",
                    data = list
                });
            }
            catch (Exception ex)
            {
                //抛出异常
                throw new Exception("获取当前储位占用量异常", ex);
            }
        }
 
        [HttpPost]
        public IActionResult LocatInventoryA()
        {
            //捕获异常
            try
            {
                var list = daily.LocatInventoryA();
                return Ok(new
                {
                    code = 0,
                    msg = "储位占用量",
                    data = list
                });
            }
            catch (Exception ex)
            {
                //抛出异常
                throw new Exception("获取当前储位占用量异常", ex);
            }
        }
    }
}