using CMS.Extensions.Abp.AspNetCore.Mvc.Filters;
|
using CMS.Framework.AspNetCore.Users;
|
using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan;
|
using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
|
using CmsQueryExtensions.Entitys;
|
using Microsoft.AspNetCore.Mvc;
|
using System.Reflection;
|
|
namespace CMS.Plugin.PipeLineLems.Controller
|
{
|
/// <summary>
|
/// 作业计划服务
|
/// </summary>
|
[ApiController]
|
[TypeFilter(typeof(CMSLanguageFilter))]
|
[TypeFilter(typeof(CMSUowActionFilter))]
|
[TypeFilter(typeof(CMSAuditActionFilter))]
|
[TypeFilter(typeof(CMSExceptionFilter))]
|
[Route("api/v{version:apiVersion}/PipeLineLems/[controller]")]
|
public class WorkPlanPublicController : ControllerBase
|
{
|
|
private readonly IMesAppService _mesAppService;
|
private readonly ICurrentUser _currentUser;
|
private readonly Application.Implements.SharedService sharedService;
|
private IServiceProvider _serviceProvider;
|
|
/// <summary>
|
/// Initializes a new instance of the <see cref="TestEntityNameController"/> class.
|
/// </summary>
|
/// <param name="testentitynameAppService">The testentityname application service.</param>
|
public WorkPlanPublicController(IMesAppService mesAppService, ICurrentUser currentUser, Application.Implements.SharedService _sharedService,
|
IServiceProvider serviceProvider)
|
{
|
_mesAppService = mesAppService;
|
_currentUser = currentUser;
|
sharedService = _sharedService;
|
_serviceProvider = serviceProvider;
|
}
|
|
/// <summary>
|
/// 获取生产计划.
|
/// </summary>
|
/// <param name="input">标识符.</param>
|
/// <returns></returns>
|
[HttpPost]
|
public virtual async Task<MesOrderResponse> GetWorkPlanAsync([FromBody] List<WorkPlanInput> input)
|
{
|
return await _mesAppService.CreateAsync(input,"","");
|
}
|
|
/// <summary>
|
/// 分拣
|
/// </summary>
|
/// <param name="input">标识符.</param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("Pick")]
|
public virtual async Task<MesOrderResponse> Pick([FromBody] PickInput input)
|
{
|
MyCurrentUser myCurrentUser = new MyCurrentUser()
|
{
|
UserAccount = _currentUser.UserAccount,
|
UserId = _currentUser.UserId
|
};
|
return await sharedService.CommonPick(_serviceProvider, input, myCurrentUser);
|
}
|
}
|
}
|