From 18d1f45193e34e00fc1b6f65b8596ddb29c5267d Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期二, 24 十二月 2024 15:32:43 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ERP/ErpController.cs |   57 ++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 48 insertions(+), 9 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ERP/ErpController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ERP/ErpController.cs"
index 19dafe1..bf6754d 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ERP/ErpController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ERP/ErpController.cs"
@@ -18,6 +18,7 @@
 using WIDESEA_IInboundService;
 using WIDESEA_IOutboundService;
 using WIDESEA_Model.Models;
+using static WIDESEA_DTO.ErpResponseContent;
 
 namespace WIDESEA_WMSServer.Controllers.ERP
 {
@@ -30,14 +31,18 @@
         private readonly ISupplierInfoService _supplierInfoService;
         private readonly IMaterielInfoService _materielInfoService;
         private readonly IOutboundOrderService _outboundOrderService;
+        private readonly ICustomerInfoService _customerInfoService;
+        private readonly IUserInfoService _userInfoService;
 
-        public ErpController(IPurchaseOrderRepository purchaseOrderRepository, IPurchaseOrderService purchaseOrderService, ISupplierInfoService supplierInfoService, IMaterielInfoService materielInfoService, IOutboundOrderService outboundOrderService)
+        public ErpController(IPurchaseOrderRepository purchaseOrderRepository, IPurchaseOrderService purchaseOrderService, ISupplierInfoService supplierInfoService, IMaterielInfoService materielInfoService, IOutboundOrderService outboundOrderService,ICustomerInfoService customerInfoService, IUserInfoService userInfoService)
         {
             _purchaseOrderRepository = purchaseOrderRepository;
             _purchaseOrderService = purchaseOrderService;
             _supplierInfoService = supplierInfoService;
             _materielInfoService = materielInfoService;
             _outboundOrderService = outboundOrderService;
+            _customerInfoService = customerInfoService;
+            _userInfoService = userInfoService;
         }
 
         /// <summary>
@@ -46,9 +51,24 @@
         /// <param name="model"></param>
         /// <returns></returns>
         [HttpPost, Route("ReceivePurchaseOrderSingle"), AllowAnonymous, MethodParamsValidate]
-        public WebResponseContent ReceivePurchaseOrder([FromBody] Root model)
+        public ErpResponseContent ReceivePurchaseOrder([FromBody] Root<PurchaseOrderModel> model)
         {
-            return _purchaseOrderService.ReceivePurchaseOrder(model.Content);
+            WebResponseContent content = _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 = _userInfoService.ReceiveUser(model.Content);
+            if (content.Status) return Instance.OK();
+            else return Instance.Error(content.Message);
         }
 
         /// <summary>
@@ -57,9 +77,11 @@
         /// <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 = _supplierInfoService.ReceiveSupplier(model.Content);
+            if (content.Status) return Instance.OK();
+            else return Instance.Error(content.Message);
         }
 
         /// <summary>
@@ -68,9 +90,24 @@
         /// <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 = _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 = _customerInfoService.ReceiveCustomer(model.Content);
+            if (content.Status) return Instance.OK();
+            else return Instance.Error(content.Message);
         }
 
         /// <summary>
@@ -79,9 +116,11 @@
         /// <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 = _outboundOrderService.ReceiveOutOrder(erpOutOrder.Content);
+            if (content.Status) return Instance.OK();
+            else return Instance.Error(content.Message);
         }
     }
 }

--
Gitblit v1.9.3