using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Threading.Tasks;
|
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.Extensions.Logging;
|
using Newtonsoft.Json;
|
using Tiger.Model;
|
using Rhea.Common;
|
using Tiger.Model.SeaStone.Shelf;
|
using System.Threading;
|
using SqlSugar;
|
using Tiger.Model.Minsun;
|
using Tiger.IBusiness;
|
using Autofac;
|
|
namespace Tiger.Api.Controllers.Test
|
{
|
/// <summary>
|
/// 测试控制器
|
/// </summary>
|
public partial class TestController : ControllerBase
|
{
|
/// <summary>
|
///
|
/// </summary>
|
private readonly IInventroyInfo _IInventroyInfo = DI.Resolve<IInventroyInfo>();
|
private readonly IDbBackup _DbBackup = DI.Resolve<IDbBackup>();
|
[HttpPost]
|
public async Task<IActionResult> SendMail([FromBody] ApiAction<SendMailEntity> action)
|
{
|
_IMailServiceApi.SendMail(action.Data?.BodyEntity, action.Data?.SendServerConfigEntity);
|
//EmailHelper email = new EmailHelper(action.Data?.SendServerConfigEntity.SenderAccount, action.Data?.SendServerConfigEntity.SenderPassword);
|
//email.SendEmail(action.Data?.BodyEntity);
|
return Ok(action.GetResponse());
|
}
|
|
/// <summary>
|
/// 物料入库信息 物料名称、物料代码、物料供应商、数量、库位、储位、批次、入库时间
|
/// </summary>
|
/// <param name="param"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public async Task<IActionResult> GetInStoreInfoAsync(iParams param)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_IInventroyInfo.GetInStoreInfo(param));
|
}
|
catch (System.Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 物料出库信息 领料单号、领料料号、数量、库位、储位、出库时间
|
/// </summary>
|
/// <param name="param"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public async Task<IActionResult> GetOutStoreInfoAsync(iParams param)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_IInventroyInfo.GetOutStoreInfo(param));
|
}
|
catch (System.Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 物料库存信息
|
/// </summary>
|
/// <param name="param"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public async Task<IActionResult> GetStorageInfo(iParamsBase param)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_IInventroyInfo.GetStorageInfo(param));
|
}
|
catch (System.Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
[HttpPost]
|
public async Task<IActionResult> ExcuteDbBackup([FromBody] ApiAction action)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_DbBackup.ExcuteBackupBat(action?.Data.ToString()));
|
}
|
catch (System.Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
[HttpPost]
|
public async Task<IActionResult> GetU9CItem([FromBody] ApiAction<GetBasItemInput> action)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(await DI.Resolve<IU9C_MES>().GetBasItem(action.Data));
|
}
|
catch (System.Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
}
|
}
|