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));
|
}
|
}
|
}
|