From f0be132fea1e4c1e00277fb2dafbc7585796156b Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期四, 11 十二月 2025 14:59:06 +0800
Subject: [PATCH] 提交
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs | 5 +-
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 68 +++++++++++++++++++++++++++++----
2 files changed, 61 insertions(+), 12 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_TaskInfoService/TaskService.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_TaskInfoService/TaskService.cs"
index 03574dc..b65d4c3 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_TaskInfoService/TaskService.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_TaskInfoService/TaskService.cs"
@@ -303,11 +303,11 @@
_recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, WIDESEA_Common.StockEnum.StockChangeType.MaterielGroup);
}
- catch(Exception ex)
+ catch (Exception ex)
{
- _logger.LogInformation($"InboundTaskCompleted AddLocationStatusChangeRecord : {ex.Message} " );
+ _logger.LogInformation($"InboundTaskCompleted AddLocationStatusChangeRecord : {ex.Message} ");
}
- try
+ try
{
foreach (var inboundOrder in inboundOrders)
{
@@ -579,7 +579,7 @@
{
_locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforelocationStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum);
}
- catch(Exception ex)
+ catch (Exception ex)
{
_logger.LogInformation($"InEmptyTaskCompleted AddLocationStatusChangeRecord : {ex.Message} ");
}
@@ -696,7 +696,7 @@
{
await Db.Deleteable(task).ExecuteCommandAsync();
}
-
+
await RecalculateOrderStatus(task.OrderNo);
try
{
@@ -757,8 +757,8 @@
{
try
{
-
-
+
+
// 鑾峰彇鍙楀奖鍝嶇殑璁㈠崟鏄庣粏ID锛堝幓閲嶏級
//var affectedDetailIds = returnLocks
// .Select(x => x.OrderDetailId)
@@ -999,7 +999,7 @@
_logger.LogInformation($"鏇存柊璁㈠崟鐘舵�� - OrderNo: {orderNo}, 鏃х姸鎬�: {outboundOrder.OrderStatus}, 鏂扮姸鎬�: {newStatus}");
}
-
+
}
catch (Exception ex)
{
@@ -1136,8 +1136,33 @@
allocatefeedmodel.Details.Add(detailModel);
}
+ var groupedResult = allocatefeedmodel.Details.GroupBy(item => new
+ {
+ item.WarehouseCode,
+ item.MaterialCode,
+ item.Unit,
+ item.LineNo
+ }).Select(group => new AllocateDtoDetail
+ {
+ WarehouseCode = group.Key.WarehouseCode,
+ MaterialCode = group.Key.MaterialCode,
+ LineNo = group.Key.LineNo,
+ Qty = group.Sum(x => x.Qty),
+ Unit = group.Key.Unit,
+ Barcodes = group.SelectMany(x => x.Barcodes)
+ .GroupBy(b => b.Barcode)
+ .Select(b => new BarcodeInfo
+ {
+ Barcode = b.Key,
+ BatchNo = b.First().BatchNo,
+ SupplyCode = b.First().SupplyCode,
+ Qty = b.Max(x => x.Qty),
+ Unit = b.First().Unit
+ }) .ToList()
+ }) .ToList();
+ allocatefeedmodel.Details = groupedResult;
- var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel);
+ var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel);
if (result != null && result.code == 200)
{
await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>()
@@ -1222,6 +1247,31 @@
}
feedmodel.details.Add(detailModel);
}
+ var groupedResult = feedmodel.details.GroupBy(item => new
+ {
+ item.warehouseCode,
+ item.materialCode,
+ item.unit,
+ item.lineNo
+ }).Select(group => new FeedbackOutboundDetailsModel
+ {
+ warehouseCode = group.Key.warehouseCode,
+ materialCode = group.Key.materialCode,
+ lineNo = group.Key.lineNo,
+ qty = group.Sum(x => x.qty),
+ unit = group.Key.unit,
+ barcodes = group.SelectMany(x => x.barcodes)
+ .GroupBy(b => b.barcode)
+ .Select(b => new WIDESEA_DTO.Outbound.BarcodesModel
+ {
+ barcode = b.Key,
+ batchNo = b.First().batchNo,
+ supplyCode = b.First().supplyCode,
+ qty = b.Max(x => x.qty),
+ unit = b.First().unit
+ }).ToList()
+ }).ToList();
+ feedmodel.details = groupedResult;
var result = await _invokeMESService.FeedbackOutbound(feedmodel);
if (result != null && result.code == 200)
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 c91eb7f..34a6a2f 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"
@@ -66,8 +66,7 @@
[HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate]
public async Task<WebResponseContent> Test()
- {
-
+ {
//var originalTask = _taskRepository.Db.Queryable<Dt_Task>().First();
//var result = _task_HtyService.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.浜哄伐鍒犻櫎);
@@ -91,7 +90,7 @@
//var ddddssss = "WSLOT" + DateTime.Now.ToString("yyyyMMddHHmmss") + ssss.ToString().PadLeft(5, '0');
//erpApiService.GetSuppliersAsync();
- erpApiService.GetMaterialUnitAsync();
+ // erpApiService.GetMaterialUnitAsync();
//var sss = await _invokeMESService.NewMaterielToMes(new WIDESEA_DTO.Basic.MaterielToMesDTO
//{
--
Gitblit v1.9.3