|  |  | 
 |  |  | using WIDESEA_IBasicService; | 
 |  |  | using WIDESEA_IInboundRepository; | 
 |  |  | using WIDESEA_IInboundService; | 
 |  |  | using WIDESEA_InboundService; | 
 |  |  | using WIDESEA_IOutboundService; | 
 |  |  | using WIDESEA_Model.Models; | 
 |  |  | using static WIDESEA_DTO.ErpResponseContent; | 
 |  |  |  | 
 |  |  | namespace WIDESEA_WMSServer.Controllers.ERP | 
 |  |  | { | 
 |  |  |     /// <summary> | 
 |  |  |     /// ERPæ¥å£ | 
 |  |  |     /// </summary> | 
 |  |  |     [Route("api/Erp")] | 
 |  |  |     [ApiController] | 
 |  |  |     public class ErpController : ControllerBase | 
 |  |  |     { | 
 |  |  |         private readonly IPurchaseOrderRepository _purchaseOrderRepository; | 
 |  |  |         private readonly IPurchaseOrderService _purchaseOrderService; | 
 |  |  |         private readonly ISupplierInfoService _supplierInfoService; | 
 |  |  |         private readonly IMaterielInfoService _materielInfoService; | 
 |  |  |         private readonly IOutboundOrderService _outboundOrderService; | 
 |  |  |         private readonly IBasicService _basicService; | 
 |  |  |         private readonly IOutboundService _outboundService; | 
 |  |  |         private readonly IInboundService _inboundService; | 
 |  |  |  | 
 |  |  |         public ErpController(IPurchaseOrderRepository purchaseOrderRepository, IPurchaseOrderService purchaseOrderService, ISupplierInfoService supplierInfoService, IMaterielInfoService materielInfoService, IOutboundOrderService outboundOrderService) | 
 |  |  |         public ErpController(IBasicService basicService, IOutboundService outboundService, IInboundService inboundService) | 
 |  |  |         { | 
 |  |  |             _purchaseOrderRepository = purchaseOrderRepository; | 
 |  |  |             _purchaseOrderService = purchaseOrderService; | 
 |  |  |             _supplierInfoService = supplierInfoService; | 
 |  |  |             _materielInfoService = materielInfoService; | 
 |  |  |             _outboundOrderService = outboundOrderService; | 
 |  |  |             _basicService = basicService; | 
 |  |  |             _outboundService = outboundService; | 
 |  |  |             _inboundService = inboundService; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  | 
 |  |  |         /// </summary> | 
 |  |  |         /// <param name="model"></param> | 
 |  |  |         /// <returns></returns> | 
 |  |  |         [HttpPost, Route("ReceivePurchaseOrderSingle"), AllowAnonymous, MethodParamsValidate] | 
 |  |  |         public WebResponseContent ReceivePurchaseOrder([FromBody] Root model) | 
 |  |  |         [HttpPost, Route("ReceivePurchaseOrder"), AllowAnonymous, MethodParamsValidate] | 
 |  |  |         public ErpResponseContent ReceivePurchaseOrder([FromBody] Root<PurchaseOrderModel> model) | 
 |  |  |         { | 
 |  |  |             return _purchaseOrderService.ReceivePurchaseOrder(model.Content); | 
 |  |  |             WebResponseContent content = _inboundService.PurchaseOrderService.ReceivePurchaseOrder(model.Content); | 
 |  |  |             if (content.Status) return Instance.OK(); | 
 |  |  |             else return Instance.Error(content.Message); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// æ¥æ¶ERPä»åºåå·¥åè´¨æ£åå·¥æ°æ® | 
 |  |  |         /// </summary> | 
 |  |  |         /// <param name="model"></param> | 
 |  |  |         /// <returns></returns> | 
 |  |  |         [HttpPost, Route("ReceiveUser"), AllowAnonymous, MethodParamsValidate] | 
 |  |  |         public ErpResponseContent ReceiveUser([FromBody] Root<UserInfoDTO> model) | 
 |  |  |         { | 
 |  |  |             WebResponseContent content = _basicService.UserInfoService.ReceiveUser(model.Content); | 
 |  |  |             if (content.Status) return Instance.OK(); | 
 |  |  |             else return Instance.Error(content.Message); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  | 
 |  |  |         /// <param name="model"></param> | 
 |  |  |         /// <returns></returns> | 
 |  |  |         [HttpPost, Route("ReceiveSupplier"), AllowAnonymous, MethodParamsValidate] | 
 |  |  |         public WebResponseContent ReceiveSupplier([FromBody] Supplier model) | 
 |  |  |         public ErpResponseContent ReceiveSupplier([FromBody] Root<SupplierDTO> model) | 
 |  |  |         { | 
 |  |  |             return _supplierInfoService.ReceiveSupplier(model.Content); | 
 |  |  |             WebResponseContent content = _basicService.SupplierInfoService.ReceiveSupplier(model.Content); | 
 |  |  |             if (content.Status) return Instance.OK(); | 
 |  |  |             else return Instance.Error(content.Message); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  | 
 |  |  |         /// <param name="model"></param> | 
 |  |  |         /// <returns></returns> | 
 |  |  |         [HttpPost, Route("ReceiveMaterial"), AllowAnonymous, MethodParamsValidate] | 
 |  |  |         public WebResponseContent ReceiveMaterial([FromBody] MaterielInfo model) | 
 |  |  |         public ErpResponseContent ReceiveMaterial([FromBody] Root<MaterielInfoDTO> model) | 
 |  |  |         { | 
 |  |  |             return _materielInfoService.ReceiveMaterial(model.Content); | 
 |  |  |             WebResponseContent content = _basicService.MaterielInfoService.ReceiveMaterial(model.Content); | 
 |  |  |             if (content.Status) return Instance.OK(); | 
 |  |  |             else return Instance.Error(content.Message); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// æ¥æ¶ERP客æ·ä¿¡æ¯ | 
 |  |  |         /// </summary> | 
 |  |  |         /// <param name="model"></param> | 
 |  |  |         /// <returns></returns> | 
 |  |  |         [HttpPost, Route("ReceiveCustomer"), AllowAnonymous, MethodParamsValidate] | 
 |  |  |         public ErpResponseContent ReceiveCustomer([FromBody] Root<CustomerInfoDTO> model) | 
 |  |  |         { | 
 |  |  |             WebResponseContent content = _basicService.CustomerInfoService.ReceiveCustomer(model.Content); | 
 |  |  |             if (content.Status) return Instance.OK(); | 
 |  |  |             else return Instance.Error(content.Message); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  | 
 |  |  |         /// <param name="erpOutOrder"></param> | 
 |  |  |         /// <returns></returns> | 
 |  |  |         [HttpPost, Route("ReceiveOutOrder"), AllowAnonymous, MethodParamsValidate] | 
 |  |  |         public WebResponseContent ReceiveOutOrder([FromBody] ErpOutOrder erpOutOrder) | 
 |  |  |         public ErpResponseContent ReceiveOutOrder([FromBody] Root<ErpOutOrderDTO> erpOutOrder) | 
 |  |  |         { | 
 |  |  |             return _outboundOrderService.ReceiveOutOrder(erpOutOrder.Content); | 
 |  |  |             WebResponseContent content = _outboundService.OutboundOrderService.ReceiveOutOrder(erpOutOrder.Content); | 
 |  |  |             if (content.Status) return Instance.OK(); | 
 |  |  |             else return Instance.Error(content.Message); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  | } |