From f747c5151051c12a1c44eaf5ef49f0a3805702b0 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期日, 09 十一月 2025 10:22:53 +0800
Subject: [PATCH] 1
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs | 27 ++++++++++++++++++++++-----
1 files changed, 22 insertions(+), 5 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
index 93ae8e7..7a055e8 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
@@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
using SqlSugar;
using System.Net;
using System.Threading.Tasks;
@@ -33,19 +34,26 @@
private readonly IESSApiService _eSSApiService;
private readonly ILocationInfoService _locationInfoService;
private readonly IDailySequenceService _dailySequenceService;
- public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService) : base(service)
+ private readonly IMaterialUnitService _materialUnitService;
+ private readonly ILogger<InboundOrderController> _logger;
+ public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService) : base(service)
{
this.erpApiService = erpApiService;
_invokeMESService = invokeMESService;
_eSSApiService = eSSApiService;
_dailySequenceService = dailySequenceService;
_locationInfoService = locationInfoService;
+ _logger = logger;
+ _materialUnitService = materialUnitService;
}
[HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate]
public async Task<WebResponseContent> Test()
{
-
+ var purchaseToStockResult = await _materialUnitService.ConvertPurchaseToStockAsync("101001-00002", 10);
+
+ var pdddurchaseToStockResult = await _materialUnitService.ConvertPurchaseToStockAsync("100513-00210", 10);
+
var sddd = _locationInfoService.AssignLocation();
var code = sddd.LocationCode;
// await _dailySequenceService.GetNextSequenceAsync();
@@ -88,13 +96,14 @@
/// <param name="model"></param>
/// <returns></returns>
[HttpPost, Route("ReceiveInboundOrder"), AllowAnonymous, MethodParamsValidate]
- public WebResponseContent ReceiveInboundOrder([FromBody] InboundRequestModel model)
+ public async Task<WebResponseContent> ReceiveInboundOrder([FromBody] InboundRequestModel model)
{
if(model.inBounds == null || !model.inBounds.Any())
{
return WebResponseContent.Instance.Error("鍏ュ簱鍗曚笉鑳戒负绌�");
}
+ _logger.LogInformation("InboundOrderController ReceiveInboundOrder: " + JsonConvert.SerializeObject(model));
List<Dt_InboundOrder> inboundOrders = new List<Dt_InboundOrder>();
foreach (var item in model.inBounds)
@@ -136,7 +145,9 @@
BatchNo = detailitem.batchNo,
Unit = detailitem.unit,
WarehouseCode = detailitem.warehouseCode,
- OrderQuantity = detailitem.qty
+ OrderQuantity = detailitem.qty,
+ BarcodeUnit = detailitem.unit,
+ BarcodeQty = detailitem.qty,
};
dt_InboundOrder.Details.Add(inboundOrderDetail);
}
@@ -150,7 +161,7 @@
inboundOrders.Add(dt_InboundOrder);
}
- var content = Service.ReceiveInboundOrder(inboundOrders, model.operationType);
+ var content =await Service.ReceiveInboundOrder(inboundOrders, model.operationType);
if (content.Status) return WebResponseContent.Instance.OK(200);
else return WebResponseContent.Instance.Error(content.Message);
@@ -183,5 +194,11 @@
}
+ [HttpPost, Route("UnPalletQuantity"), AllowAnonymous, MethodParamsValidate]
+ public WebResponseContent UnPalletQuantity(string orderNo)
+ {
+ return Service.UnPalletQuantity(orderNo);
+ }
+
}
}
--
Gitblit v1.9.3