服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2 天以前 3ab68d4877acffcb9677ecf369e15210e5db6981
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Rhea.Common;
using Tiger.Model;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Tiger.IBusiness;
 
namespace Tiger.Api.Controllers.WMS
{
    public partial class WMSController : ControllerBase
    {
        /// <summary>
        /// 仓库建模(获取仓库机构树形列表)
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetHouseModel(string? houseName, string? status)
        {
            return Ok(await DI.Resolve<IBS>().GetHouseModel(houseName, status));
        }
        /// <summary>
        /// 分权限仓库列表(获取仓库机构树形列表)
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetHouseModelOrg(HouseListItem listItem)
        {
            return Ok(await DI.Resolve<IBS>().GetHouseModelOrg(listItem));
        }
        /// <summary>
        /// 判断储位有无东西删仓库结构
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> DelWareHouseModel(DelWareHouseModelEntity wareHouse)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(DI.Resolve<IBS>().DelWareHouseModel(wareHouse));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
        /// <summary>
        /// 检查储位是否有物品
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> CheckLocation(DelWareHouseModelEntity wareHouse)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(DI.Resolve<IBS>().CheckLocation(wareHouse));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
        /// <summary>
        /// 添加储位
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> AddLoctionModel(List<AddLocationModelEntity> locations)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(DI.Resolve<IBS>().AddLocationModel(locations));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
        /// <summary>
        /// 根据仓库据点修改下级所有据点
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetUpdateOrg(string? id)
        {
            return Ok(await DI.Resolve<IBS>().GetUpdateOrg(id));
        }
        /// <summary>
        /// 根据仓库id获取仓库code
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetWmsCode(string? id)
        {
            return Ok(await DI.Resolve<IBS>().GetWmsCode(id));
        }
    }
}