56 lines
1.8 KiB
C#
Executable File
56 lines
1.8 KiB
C#
Executable File
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Opsoft.NetCore.O3App.Domain.Models.ESOP;
|
|
using Opsoft.NetCore.O3App.Domain.UnitOfWork.ESOP.ESOP;
|
|
using Opsoft.NetCore.O3App.Domain.UnitOfWork.ESOP.IServices;
|
|
using Opsoft.NetCore.O3App.Shared;
|
|
using Opsoft.NetCore.O3App.WebApi.Models;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Opsoft.NetCore.O3App.WebApi.Controllers.ESOP
|
|
{
|
|
/// <summary>
|
|
/// ESOP
|
|
/// </summary>
|
|
[Authorize]
|
|
public class ESOPController : BaseApiController<ESOPController>
|
|
{
|
|
//服务层变量
|
|
private readonly IESOPService service;
|
|
public ESOPController(IMapper mapper, ILogger<ESOPController> logger, IESOPService service)
|
|
: base(mapper, logger)
|
|
{
|
|
this.service = service;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取文件信息
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<BaseResponse<object>> GetAnnounceAndFile([FromBody] ESOPRequest request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await service.GetAnnounceAndFile(input);
|
|
}, request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据工位编码获取资源以及工序识别码信息
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public async Task<BaseResponse<ESopStationResponse>> GetSourceAndCode(string stationCode)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
return await service.GetSourceAndCode(input);
|
|
}, stationCode);
|
|
}
|
|
}
|
|
}
|