From c95029139c278f0d2980e6d67cab42f5331e8d06 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期五, 05 十二月 2025 08:35:04 +0800
Subject: [PATCH] 提交
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundBatchPickingService.cs | 34 +++++++++++++++++++++++++---------
1 files changed, 25 insertions(+), 9 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/OutboundBatchPickingService.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/OutboundBatchPickingService.cs"
index de06d72..e988272 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/OutboundBatchPickingService.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/OutboundBatchPickingService.cs"
@@ -21,6 +21,7 @@
using WIDESEA_IBasicService;
using WIDESEA_IOutboundService;
using WIDESEA_IStockService;
+using WIDESEA_ITaskInfoService;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Basic;
using WIDESEA_Model.Models.Outbound;
@@ -49,6 +50,7 @@
private readonly IDailySequenceService _dailySequenceService;
private readonly IAllocateService _allocateService;
private readonly IRepository<Dt_OutboundBatch> _outboundBatchRepository;
+ private readonly ITask_HtyService _task_HtyService;
private readonly ILogger<OutboundPickingService> _logger;
private Dictionary<string, string> stations = new Dictionary<string, string>
@@ -68,7 +70,7 @@
public OutboundBatchPickingService(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_OutboundBatch> outboundBatchRepository) : base(BaseDal)
+ IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, ITask_HtyService task_HtyService) : base(BaseDal)
{
_unitOfWorkManage = unitOfWorkManage;
_stockInfoService = stockInfoService;
@@ -86,6 +88,7 @@
_dailySequenceService = dailySequenceService;
_allocateService = allocateService;
_outboundBatchRepository = outboundBatchRepository;
+ _task_HtyService = task_HtyService;
}
// <summary>
@@ -1798,7 +1801,7 @@
// 鏇存柊閿佸畾璁板綍鐘舵�佷负宸插洖搴�
lockInfo.Status = (int)OutLockStockStatusEnum.宸插洖搴�;
- lockInfo.Operator = App.User.UserName;
+ lockInfo.Operator = App.User.UserName;
await _outStockLockInfoService.Db.Updateable(lockInfo).ExecuteCommandAsync();
@@ -1854,7 +1857,7 @@
// 鏇存柊閿佸畾璁板綍鐘舵�佷负宸插洖搴�
lockInfo.Status = (int)OutLockStockStatusEnum.宸插洖搴�;
- lockInfo.Operator = App.User.UserName;
+ lockInfo.Operator = App.User.UserName;
await _outStockLockInfoService.Db.Updateable(lockInfo).ExecuteCommandAsync();
@@ -1945,9 +1948,17 @@
PalletType = stockInfo.PalletType,
WarehouseId = currentTask.WarehouseId
};
+ try
+ {
+ await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync();
- await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync();
-
+ }
+ catch (Exception ex)
+ {
+ _logger.LogInformation($"鍒涘缓鍥炲簱浠诲姟澶辫触 - 璁㈠崟: {orderNo}, 鎵樼洏: {palletCode}");
+ throw new Exception($"鍒涘缓鍥炲簱浠诲姟澶辫触 - 璁㈠崟: {orderNo}, 鎵樼洏: {palletCode}");
+
+ }
// 鍙戦�丒SS鍛戒护
await SendESSCommands(palletCode, currentTask.TargetAddress, returnTask);
@@ -2223,7 +2234,7 @@
// 鍒嗛厤鏁伴噺鍦ㄨ鍗曟槑缁嗗眰闈㈢粺涓�澶勭悊
var originalStatus = lockInfo.Status;
lockInfo.Status = (int)OutLockStockStatusEnum.宸插洖搴�;
- lockInfo.Operator = App.User.UserName;
+ lockInfo.Operator = App.User.UserName;
await _outStockLockInfoService.Db.Updateable(lockInfo).ExecuteCommandAsync();
@@ -2550,7 +2561,7 @@
/// <summary>
/// 澶勭悊鏈垎鎷g殑閿佸畾璁板綍鍥炲簱
/// </summary>
-
+
/// <summary>
/// 澶勭悊鎵樼洏涓婄殑搴撳瓨璐х墿鍥炲簱
@@ -3478,11 +3489,16 @@
};
// 淇濆瓨鍥炲簱浠诲姟
- await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync();
+ var insertcount = await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync();
+ if (insertcount <= 0)
+ {
+ throw new Exception("鍒涘缓浠诲姟澶辫触锛�");
+ }
var targetAddress = originalTask.TargetAddress;
// 鍒犻櫎鍘熷鍑哄簱浠诲姟
- _taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.鑷姩瀹屾垚);
+ //_taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.鑷姩瀹屾垚);
+ _task_HtyService.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.浜哄伐鍒犻櫎);
await _taskRepository.Db.Deleteable(originalTask).ExecuteCommandAsync();
--
Gitblit v1.9.3