From 911a17b31eb1caa56d02a7be547176be6c259127 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期一, 16 十二月 2024 21:30:23 +0800 Subject: [PATCH] 接口优化 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ERP/ErpController.cs | 25 +++++++++++++++++-------- 1 files changed, 17 insertions(+), 8 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..48ed393 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 { @@ -46,9 +47,11 @@ /// <param name="model"></param> /// <returns></returns> [HttpPost, Route("ReceivePurchaseOrderSingle"), AllowAnonymous, MethodParamsValidate] - public WebResponseContent ReceivePurchaseOrder([FromBody] Root model) + public ErpResponseContent ReceivePurchaseOrder([FromBody] Root 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> @@ -57,9 +60,11 @@ /// <param name="model"></param> /// <returns></returns> [HttpPost, Route("ReceiveSupplier"), AllowAnonymous, MethodParamsValidate] - public WebResponseContent ReceiveSupplier([FromBody] Supplier model) + public ErpResponseContent ReceiveSupplier([FromBody] Supplier 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 +73,11 @@ /// <param name="model"></param> /// <returns></returns> [HttpPost, Route("ReceiveMaterial"), AllowAnonymous, MethodParamsValidate] - public WebResponseContent ReceiveMaterial([FromBody] MaterielInfo model) + public ErpResponseContent ReceiveMaterial([FromBody] MaterielInfo 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> @@ -79,9 +86,11 @@ /// <param name="erpOutOrder"></param> /// <returns></returns> [HttpPost, Route("ReceiveOutOrder"), AllowAnonymous, MethodParamsValidate] - public WebResponseContent ReceiveOutOrder([FromBody] ErpOutOrder erpOutOrder) + public ErpResponseContent ReceiveOutOrder([FromBody] ErpOutOrder 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