From 7cbc27cf7ec7005f9e5f6f87612eb7cfaffc2ac6 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期一, 08 十二月 2025 21:20:11 +0800
Subject: [PATCH] 提交
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs | 35 +++++++++++++++++++++++++++--------
1 files changed, 27 insertions(+), 8 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_OutboundService/OutboundPickingService.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_OutboundService/OutboundPickingService.cs"
index 4d20ff1..12d0d4c 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_OutboundService/OutboundPickingService.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_OutboundService/OutboundPickingService.cs"
@@ -87,7 +87,7 @@
public OutboundPickingService(IRepository<Dt_PickingRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IStockService stockService,
IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService, ILocationInfoService locationInfoService,
IOutboundOrderDetailService outboundOrderDetailService, ISplitPackageService splitPackageService, IOutboundOrderService outboundOrderService,
- IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_InboundOrder> inboundOrderRepository, IInboundOrderDetailService inboundOrderDetailService, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IReCheckOrderService reCheckOrderService, ITask_HtyService task_HtyService,IRepository<Dt_InterfaceLog> interfaceLog) : base(BaseDal)
+ IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_InboundOrder> inboundOrderRepository, IInboundOrderDetailService inboundOrderDetailService, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IReCheckOrderService reCheckOrderService, ITask_HtyService task_HtyService, IRepository<Dt_InterfaceLog> interfaceLog) : base(BaseDal)
{
_unitOfWorkManage = unitOfWorkManage;
_stockInfoService = stockInfoService;
@@ -304,7 +304,27 @@
var statusAnalysis = await AnalyzePalletStatus(orderNo, palletCode, stockInfo.Id);
if (!statusAnalysis.HasItemsToReturn)
- return await HandleNoReturnItems(orderNo, palletCode, task, stockInfo.Id);
+ {
+ try
+ {
+ var result = await HandleNoReturnItems(orderNo, palletCode, task, stockInfo.Id);
+ _unitOfWorkManage.CommitTran();
+ if (result.Status)
+ {
+ task.PalletType = PalletTypeEnum.Empty.ObjToInt();
+ await CreateReturnTaskAndHandleESS(orderNo, palletCode, task, TaskTypeEnum.InEmpty, PalletTypeEnum.Empty.ObjToInt());
+ }
+ return result;
+ }
+ catch (Exception ex)
+ {
+ _unitOfWorkManage.RollbackTran();
+ _logger.LogError($"ReturnRemaining 鍥炲簱绌虹澶辫触 - OrderNo: {orderNo}, PalletCode: {palletCode}, Error: {ex.Message}");
+ return WebResponseContent.Instance.Error($"鍥炲簱绌虹鎿嶄綔澶辫触: {ex.Message}");
+ }
+
+
+ }
// 4. 妫�鏌ユ槸鍚︽湁杩涜涓殑浠诲姟
if (statusAnalysis.HasActiveTasks)
@@ -1314,8 +1334,6 @@
//绌烘墭鐩樺浣曞鐞� 杩樻湁涓�涓嚭搴撲换鍔¤澶勭悊銆�
originalTask.PalletType = PalletTypeEnum.Empty.ObjToInt();
- await CreateReturnTaskAndHandleESS(orderNo, palletCode, originalTask, TaskTypeEnum.InEmpty, PalletTypeEnum.Empty.ObjToInt());
-
}
catch (Exception ex)
{
@@ -1700,7 +1718,7 @@
throw new Exception("鍒涘缓浠诲姟澶辫触锛�");
}
}
- catch (Exception ex)
+ catch (Exception ex)
{
_logger.LogInformation($"CreateReturnTaskAndHandleESS 鍒涘缓浠诲姟澶辫触: {orderNo} 锛� {palletCode}");
throw new Exception("鍒涘缓浠诲姟澶辫触锛�");
@@ -2119,8 +2137,7 @@
.Where(x => x.StockId == stockId && x.StockQuantity == 0)
.ExecuteCommandAsync();
- await _stockInfoService.Db.Deleteable<Dt_StockInfo>()
- .Where(x => x.Id == stockId).ExecuteCommandAsync();
+ _stockInfoService.DeleteData(stockId);
_logger.LogInformation($"娓呯悊闆跺簱瀛樻槑缁嗚褰� - StockId: {stockId}, 鍒犻櫎璁板綍鏁�: {deleteDetailCount}");
@@ -2937,7 +2954,7 @@
await _interfaceLog.Db.Updateable<Dt_InterfaceLog>()
.SetColumns(x => x.ReturnToMESStatus == 1)
- .Where(x=>x.DocumentNo == documentNo)
+ .Where(x => x.DocumentNo == documentNo)
.ExecuteCommandAsync();
}
return WebResponseContent.Instance.OK();
@@ -3261,6 +3278,8 @@
public List<Dt_StockInfoDetail> PalletStockGoods { get; set; } = new List<Dt_StockInfoDetail>();
public List<Dt_SplitPackageRecord> SplitRecords { get; set; } = new List<Dt_SplitPackageRecord>();
+ // 銆愭柊澧炪�戝凡澶勭悊鐨勬潯鐮侀泦鍚堬紙鐢ㄤ簬閬垮厤閲嶅锛�
+ public HashSet<string> ProcessedBarcodes { get; set; } = new HashSet<string>();
public List<string> AllBarcodes { get; set; } = new List<string>();
// 绌烘墭鐩樼浉鍏冲睘鎬�
public bool IsEmptyPallet { get; set; }
--
Gitblit v1.9.3