using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using WIDESEA_Core.Attributes; using WIDESEA_Core; using WIDESEA_DTO; using WIDESEA_IBasicService; using WIDESEA_ITaskInfoService; using WIDESEA_TaskInfoService; using WIDESEA_DTO.ERP; using WIDESEA_Core.Helper; using Autofac.Core; using WIDESEA_DTO.Stock; using WIDESEA_BasicService; using WIDESEA_DTO.Basic; using WIDESEA_DTO.MES; using WIDESEA_IOutboundService; using WIDESEA_IInboundService; using WIDESEA_External.MESService; using WIDESEA_External.Model; namespace WIDESEA_WMSServer.Controllers.MES { /// /// MES接口 /// [Route("api/Mes")] [ApiController] public class MesController : ControllerBase { private readonly ITaskService _taskService; private readonly IOutMESOrderService _outMESOrderService; private readonly IMESProInOrderInfoService _proInOrderInfoService; private readonly IInvokeMESService _invokeMESService; public MesController(ITaskService taskService,IOutMESOrderService outMESOrderService,IMESProInOrderInfoService proInOrderInfoService, IInvokeMESService invokeMESService) { _taskService = taskService; _outMESOrderService = outMESOrderService; _proInOrderInfoService=proInOrderInfoService; _invokeMESService = invokeMESService; } /// /// 接收MES领料计划 /// /// [HttpPost, HttpGet, Route("ReceiveOutBound"), AllowAnonymous] public WebResponseContent ReceiveOutBound([FromBody] List outMESOrderDTOs) { return _taskService.ReceiveOutBound(outMESOrderDTOs); } /// /// MES自动叫料接口 /// /// [HttpPost, HttpGet, Route("ReceiveAutoIssue"), AllowAnonymous] public WebResponseContent ReceiveAutoIssue([FromBody] MESAutoIssueDTO autoIssueDTO) { return _taskService.ReceiveAutoIssue(autoIssueDTO); } /// /// MES手动叫料接口 /// /// [HttpPost, HttpGet, Route("ReceiveManualIssue"), AllowAnonymous] public WebResponseContent ReceiveManualIssue([FromBody] MESManualIssueDTO manualIssueDTO) { return _taskService.ReceiveManualIssue(manualIssueDTO); } /// /// MES空托/余料呼叫接口 /// /// [HttpPost, HttpGet, Route("ReceiveReturnIssue"), AllowAnonymous] public WebResponseContent ReceiveReturnIssue([FromBody] List returnIssueDTOs) { return _taskService.ReceiveReturnIssue(returnIssueDTOs); } /// /// 成品/半成品信息同步接口 /// /// [HttpPost, HttpGet, Route("ReceiveProCodeInfo"), AllowAnonymous] public WebResponseContent ReceiveProCodeInfo([FromBody] List proInDTOs) { return _taskService.ReceiveProCodeInfo(proInDTOs); } /// /// MES工单停止接口 /// /// [HttpPost, HttpGet, Route("ReceiveProOrderStop"), AllowAnonymous] public WebResponseContent ReceiveProOrderStop([FromBody] MESOrderStopDTO orderStopDTO) { return _proInOrderInfoService.ReceiveProOrderStop(orderStopDTO); } /// /// MES配送出发通知 /// /// [HttpPost, Route("MESDispatchUp"), AllowAnonymous] public string MESDispatchUp([FromBody] MESDispatchModel mESDispatchModel) { return _invokeMESService.MESDispatchUp(mESDispatchModel); } /// /// MES配送到达通知 /// /// [HttpPost, Route("MESDelivery"), AllowAnonymous] public string MESDelivery([FromBody] MESDeliveryModel mESDeliveryModel) { return _invokeMESService.MESDelivery(mESDeliveryModel); } /// /// MES退料空托接收通知 /// /// [HttpPost, Route("MESRecepNotice"), AllowAnonymous] public string MESRecepNotice([FromBody] MESRecepNoticeModel mESRecepNoticeModel) { return _invokeMESService.MESRecepNotice(mESRecepNoticeModel); } /// /// MES小车到达通知 /// /// /// [HttpPost, Route("MESAvgArriveNotice"), AllowAnonymous] public string MESAvgArriveNotice([FromBody] MESAvgArriveNoticeModel mESAvgArriveNoticeModel) { return _invokeMESService.MESAvgArriveNotice(mESAvgArriveNoticeModel); } /// /// MES产量回传 /// /// /// [HttpPost,HttpGet, Route("MESBoxCodeNotice"), AllowAnonymous] public string MESBoxCodeNotice(string boxCode) { return _invokeMESService.MESBoxCodeNotice(boxCode); } } }