| | |
| | | using WIDESEA_TaskInfoService; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_Core.Helper; |
| | | using Autofac.Core; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEA_External.ERPService; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.MES |
| | | { |
| | | /// <summary> |
| | | /// MESæ¥å£ |
| | | /// </summary> |
| | | [Route("api/Mes")] |
| | | [ApiController] |
| | | public class MesController : ControllerBase |
| | | { |
| | | private readonly IPurchaseOrderRepository _purchaseOrderRepository; |
| | | private readonly IPurchaseOrderService _purchaseOrderService; |
| | | private readonly ISupplierInfoService _supplierInfoService; |
| | | private readonly IMaterielInfoService _materielInfoService; |
| | | private readonly IOutboundOrderService _outboundOrderService; |
| | | private readonly IOutboundService _outboundService; |
| | | private readonly ITaskService _taskService; |
| | | |
| | | public MesController(IPurchaseOrderRepository purchaseOrderRepository, IPurchaseOrderService purchaseOrderService, ISupplierInfoService supplierInfoService, IMaterielInfoService materielInfoService, IOutboundOrderService outboundOrderService, ITaskService taskService) |
| | | private readonly IInvokeERPService _invokeERPService; |
| | | public MesController(IOutboundService outboundService, ITaskService taskService,IInvokeERPService invokeERPService) |
| | | { |
| | | _purchaseOrderRepository = purchaseOrderRepository; |
| | | _purchaseOrderService = purchaseOrderService; |
| | | _supplierInfoService = supplierInfoService; |
| | | _materielInfoService = materielInfoService; |
| | | _outboundOrderService = outboundOrderService; |
| | | _outboundService = outboundService; |
| | | _taskService = taskService; |
| | | _invokeERPService = invokeERPService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶MESæµè¯æ¶åºåº |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | //[HttpPost, Route("TestToolOut"), AllowAnonymous, MethodParamsValidate] |
| | | //public MesResponseContent TestToolOut([FromBody] Root<TestToolOutModel> model) |
| | | [HttpPost, Route("TestToolOut"), AllowAnonymous, MethodParamsValidate] |
| | | public MesResponseContent TestToolOut([FromBody] Root<TestToolOutModel> model) |
| | | { |
| | | return _taskService.TestToolOut(model.Content); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶MESæµè¯æ¶éåº |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("TestToolBack"), AllowAnonymous, MethodParamsValidate] |
| | | public MesResponseContent TestToolBack([FromBody] Root<TestToolBackModel> model) |
| | | { |
| | | return _taskService.TestToolBack(model.Content); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æµè¯æ¶æ¥åº |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("TestToolScrap"), AllowAnonymous, MethodParamsValidate] |
| | | public MesResponseContent TestScrap([FromBody] Root<TestToolScrap> model) |
| | | { |
| | | return _taskService.TestScrap(model.Content); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="toolSynInfo"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("TestSynStock"), AllowAnonymous] |
| | | public WebResponseContent TestSynStock([FromBody] TestToolSynInfo toolSynInfo) |
| | | { |
| | | return _taskService.TestSynStock(toolSynInfo); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åºæ¿åºåº |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("SubstrateOut"), AllowAnonymous] |
| | | public MesResponseContent SubstrateOut([FromBody] Root<SubstrateOutModel> model) |
| | | { |
| | | return _taskService.SubstrateOut(model.Content); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åºæ¿ä½æéåº |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("SubstrateBack"), AllowAnonymous] |
| | | public MesResponseContent SubstrateBack([FromBody] Root<SubstrateBackModel> model) |
| | | { |
| | | return _taskService.SubstrateBack(model.Content); |
| | | } |
| | | /// <summary> |
| | | /// PP大å·åºåº-è¿è¡åå· |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("PPSubsectionOut"), AllowAnonymous] |
| | | public MesResponseContent PPSubsectionOut([FromBody] Root<PPSubsectionOutModel> model) |
| | | { |
| | | return _taskService.PPSubsectionOut(model.Content); |
| | | } |
| | | /// <summary> |
| | | /// PPå°å·åºåº |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("PPCutOut"), AllowAnonymous] |
| | | public MesResponseContent PPCutOut([FromBody] Root<PPCutOutModle> model) |
| | | { |
| | | return _taskService.PPCutOut(model.Content); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// PPå
¥åº(大å·ãå°å·ãå¼ æ) |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("PPBack"), AllowAnonymous] |
| | | public MesResponseContent PPBack([FromBody] Root<PPBackModel> model) |
| | | { |
| | | return _taskService.PPBack(model.Content); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// PPåºåæ¥è¯¢ |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("QueryPpByWidth"), AllowAnonymous] |
| | | public MesResponseContent QueryPpByWidth([FromBody] Root<QueryPpByWidthModel> model) |
| | | { |
| | | return _taskService.QueryPpByWidth(model.Content); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç©æåºåºï¼WMS忥åºåºç©ææ¹æ¬¡è³MES |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("UploadMesMaterialLotaAcept"), AllowAnonymous] |
| | | public WebResponseContent UploadMesMaterialLotaAcept([FromBody] MesMaterialLotaAceptModel model) |
| | | { |
| | | return _taskService.UploadMesMaterialLotaAcept(model); |
| | | } |
| | | /// <summary> |
| | | /// MESæåå
å
ä¿¡æ¯æ¥æ¶ |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("BagInfoSync"), AllowAnonymous] |
| | | public MesResponseContent BagInfoSync([FromBody] Root<MesBagInfoModel> model) |
| | | { |
| | | return _taskService.BagInfoSync(model.Content); |
| | | } |
| | | /// <summary> |
| | | /// MESæåå¤å
ä¿¡æ¯æ¥æ¶ |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("BoxStockin"), AllowAnonymous] |
| | | public MesResponseContent BoxStockin([FromBody] Root<MesBoxInfoModel> model) |
| | | { |
| | | return _taskService.BoxStockin(model.Content); |
| | | } |
| | | /// <summary> |
| | | /// MESæååºåºæ¥å£è°ç¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ShipmentOrderSync"), AllowAnonymous] |
| | | public WebResponseContent ShipmentOrderSync([FromBody] MesShipmentOrderSync model) |
| | | { |
| | | return _taskService.ShipmentOrderSync(model); |
| | | } |
| | | /// <summary> |
| | | /// æåè¿å·¥æåº |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost,Route("RworkTask"),AllowAnonymous] |
| | | public MesResponseContent RworkTask([FromBody] Root<RworkTaskModel> model) |
| | | { |
| | | return _taskService.RworkTask(model.Content); |
| | | } |
| | | /// <summary> |
| | | /// åºåæ¿åºåºåæ¥æ¥å£ |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ProductOutBoundSync"), AllowAnonymous] |
| | | public WebResponseContent ProductOutBoundSync([FromBody] MesProductOutBound model) |
| | | { |
| | | return _outboundService.RworkOutboundOrderService.ProductOutBoundSync(model); |
| | | } |
| | | /// <summary> |
| | | /// çæMESPPä»å¤§å·åºåºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="keys"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("MESPPGenerateOutboundTasks"), AllowAnonymous] |
| | | public WebResponseContent MESPPGenerateOutboundTasks([FromBody] int[] keys) |
| | | { |
| | | return _taskService.MESPPGenerateOutboundTasks(keys); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæMESPPä»å°å·åºåºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="keys"></param> |
| | | /// <returns></returns> |
| | | //[HttpPost, HttpGet, Route("PPCutOutGenerateOutboundTasks"), AllowAnonymous] |
| | | //public WebResponseContent PPCutOutGenerateOutboundTasks([FromBody] int[] keys) |
| | | //{ |
| | | // return _taskService.TestToolOut(model.Content); |
| | | // return _taskService.PPCutOutGenerateOutboundTasks(keys); |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// çæåºåºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="orderDetailId"></param> |
| | | /// <param name="stockSelectViews"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("PPCutOutGenerateOutboundTasks"), AllowAnonymous] |
| | | public WebResponseContent PPCutOutGenerateOutboundTasks(int orderDetailId, [FromBody] List<PPStockSelectViewDTO> stockSelectViews) |
| | | { |
| | | return _taskService.PPCutOutGenerateOutboundTasks(orderDetailId, stockSelectViews); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// PPå¹³åºç´æ¥åºåº |
| | | /// </summary> |
| | | /// <param name="orderDetailId"></param> |
| | | /// <param name="stockSelectViews"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("PPGeneratePKOutboundTask"), AllowAnonymous] |
| | | public WebResponseContent PPGeneratePKOutboundTask(int orderDetailId, [FromBody] List<PPStockSelectViewDTO> stockSelectViews) |
| | | { |
| | | return _taskService.PPGeneratePKOutboundTask(orderDetailId, stockSelectViews); |
| | | } |
| | | /// <summary> |
| | | /// æ£éªååä¼ æ´æ° |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("CheckResultReturn"), AllowAnonymous, MethodParamsValidate] |
| | | public MesResponseContent CheckResultReturn([FromBody] ERPCheckModel model) |
| | | { |
| | | string content = _invokeERPService.InvokeCheckOrderApi(model); |
| | | ErpRequestContent requestContent = content.DeserializeObject<ErpRequestContent>(); |
| | | if (requestContent.res != 1) |
| | | { |
| | | return MesResponseContent.Instance.Error(requestContent.Data); |
| | | } |
| | | return MesResponseContent.Instance.OK("æå"); |
| | | } |
| | | } |
| | | } |