| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using SqlSugar; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.MaterielEnum; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_External.ERPService; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IInboundRepository; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.ERP |
| | | { |
| | |
| | | [ApiController] |
| | | public class ErpController : ControllerBase |
| | | { |
| | | private readonly IERPInvokeService _service; |
| | | public ErpController(IERPInvokeService service) |
| | | private readonly IPurchaseOrderRepository _purchaseOrderRepository; |
| | | private readonly IPurchaseOrderService _purchaseOrderService; |
| | | private readonly ISupplierInfoService _supplierInfoService; |
| | | private readonly IMaterielInfoService _materielInfoService; |
| | | private readonly IOutboundOrderService _outboundOrderService; |
| | | |
| | | public ErpController(IPurchaseOrderRepository purchaseOrderRepository, IPurchaseOrderService purchaseOrderService, ISupplierInfoService supplierInfoService, IMaterielInfoService materielInfoService, IOutboundOrderService outboundOrderService) |
| | | { |
| | | _service = service; |
| | | _purchaseOrderRepository = purchaseOrderRepository; |
| | | _purchaseOrderService = purchaseOrderService; |
| | | _supplierInfoService = supplierInfoService; |
| | | _materielInfoService = materielInfoService; |
| | | _outboundOrderService = outboundOrderService; |
| | | } |
| | | |
| | | [HttpPost, Route("ReceivePurchaseOrder"), AllowAnonymous] |
| | | /// <summary> |
| | | /// æ¥æ¶ERPéè´åä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ReceivePurchaseOrderSingle"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent ReceivePurchaseOrder([FromBody] PurchaseOrderModel model) |
| | | { |
| | | try |
| | | { |
| | | return _service.ReceivePurchaseOrder(model); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | return _purchaseOrderService.ReceivePurchaseOrder(model); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶ERPä¾åºåä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ReceiveSupplier"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent ReceiveSupplier([FromBody] SupplierDTO model) |
| | | { |
| | | return _supplierInfoService.ReceiveSupplier(model); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶ERPç©æä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ReceiveMaterial"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent ReceiveMaterial([FromBody] MaterielInfoDTO model) |
| | | { |
| | | return _materielInfoService.ReceiveMaterial(model); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶ERPåºåºåä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="erpOutOrder"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ReceiveOutOrder"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent ReceiveOutOrder([FromBody] ErpOutOrderDTO erpOutOrder) |
| | | { |
| | | return _outboundOrderService.ReceiveOutOrder(erpOutOrder); |
| | | } |
| | | } |
| | | } |