From 02038504f14d5a0e0f860044a102afe62907d454 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 10 一月 2025 09:52:36 +0800
Subject: [PATCH] 添加获取旧WMS辅料仓库存接口方法及辅料仓功能
---
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ERP/ErpController.cs | 75 +++++++++++++++++++++++++++----------
1 files changed, 55 insertions(+), 20 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 3271fbf..ac5eaf8 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"
@@ -16,28 +16,29 @@
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>
@@ -45,10 +46,25 @@
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
- [HttpPost, Route("ReceivePurchaseOrderSingle"), AllowAnonymous, MethodParamsValidate]
- public WebResponseContent ReceivePurchaseOrder([FromBody] PurchaseOrderModel model)
+ [HttpPost, Route("ReceivePurchaseOrder"), AllowAnonymous, MethodParamsValidate]
+ public ErpResponseContent ReceivePurchaseOrder([FromBody] Root<PurchaseOrderModel> model)
{
- return _purchaseOrderService.ReceivePurchaseOrder(model);
+ 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>
@@ -57,9 +73,11 @@
/// <param name="model"></param>
/// <returns></returns>
[HttpPost, Route("ReceiveSupplier"), AllowAnonymous, MethodParamsValidate]
- public WebResponseContent ReceiveSupplier([FromBody] SupplierDTO model)
+ public ErpResponseContent ReceiveSupplier([FromBody] Root<SupplierDTO> model)
{
- return _supplierInfoService.ReceiveSupplier(model);
+ WebResponseContent content = _basicService.SupplierInfoService.ReceiveSupplier(model.Content);
+ if (content.Status) return Instance.OK();
+ else return Instance.Error(content.Message);
}
/// <summary>
@@ -68,9 +86,24 @@
/// <param name="model"></param>
/// <returns></returns>
[HttpPost, Route("ReceiveMaterial"), AllowAnonymous, MethodParamsValidate]
- public WebResponseContent ReceiveMaterial([FromBody] MaterielInfoDTO model)
+ public ErpResponseContent ReceiveMaterial([FromBody] Root<MaterielInfoDTO> model)
{
- return _materielInfoService.ReceiveMaterial(model);
+ 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>
@@ -79,9 +112,11 @@
/// <param name="erpOutOrder"></param>
/// <returns></returns>
[HttpPost, Route("ReceiveOutOrder"), AllowAnonymous, MethodParamsValidate]
- public WebResponseContent ReceiveOutOrder([FromBody] ErpOutOrderDTO erpOutOrder)
+ public ErpResponseContent ReceiveOutOrder([FromBody] Root<ErpOutOrderDTO> erpOutOrder)
{
- return _outboundOrderService.ReceiveOutOrder(erpOutOrder);
+ WebResponseContent content = _outboundService.OutboundOrderService.ReceiveOutOrder(erpOutOrder.Content);
+ if (content.Status) return Instance.OK();
+ else return Instance.Error(content.Message);
}
}
}
--
Gitblit v1.9.3