59 lines
1.6 KiB
C#
59 lines
1.6 KiB
C#
using System.Collections.Generic;
|
|
using AutoMapper;
|
|
using HHWMS.Web.Models;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using WalkingTec.Mvvm.Core;
|
|
|
|
namespace HHWMS.Web
|
|
{
|
|
/// <summary>
|
|
/// WCS接口
|
|
/// 调用方向 WCS --> WMS
|
|
/// </summary>
|
|
[Public]
|
|
[ActionDescription("HHWMS.WCSApi")]
|
|
[ApiController]
|
|
[Route("api/[controller]/[action]"), ApiExplorerSettings(GroupName = "User")]
|
|
public class IWCSController : ApiController
|
|
{
|
|
private readonly IUnitWork _unitwork;
|
|
private readonly IMapper _mapper;
|
|
|
|
public IWCSController(IUnitWork unitwork, IMapper mapper)
|
|
{
|
|
_unitwork = unitwork;
|
|
_mapper = mapper;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 请求入库
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public IActionResult RequestIn(WcsRequest request)
|
|
{
|
|
var inv = new List<Inventory>();
|
|
for (int i = 0; i < 10; i++)
|
|
inv.Add(new Inventory
|
|
{
|
|
ContainerCode = "test" + i
|
|
});
|
|
//_unitwork.BatchAdd<Inventory>(inv);
|
|
_unitwork.DeleteById<Inventory>(1441);
|
|
//_unitwork.BatchUpdate<Inventory>(x => x.ID > 1030, x=>new Inventory { Batch = "test"});
|
|
return ApiResult();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 状态返回
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public IActionResult TaskStatusResult(WcsRequest request)
|
|
{
|
|
return ApiResult();
|
|
}
|
|
|
|
}
|
|
}
|