From 30470e6a44e05993bd1c63610af4fec3f0fda960 Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期一, 27 四月 2026 14:35:46 +0800
Subject: [PATCH] 1
---
WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/OrderEnum.cs | 1 -
WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs | 20 ++++++++++++++++++++
WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 5 ++++-
WMS/WIDESEA_WMSServer/WIDESEA_Model/WMSNoticeHub.cs | 13 +++++++++++++
4 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/OrderEnum.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/OrderEnum.cs
index 9979d2b..c2cc61f 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/OrderEnum.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/OrderEnum.cs
@@ -225,7 +225,6 @@
/// </summary>
[Description("鐢熶骇鍏ュ簱鍗�")]
works = 2,
-
/// <summary>
/// 璋冩嫧鍑哄簱鍗�
/// </summary>
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Model/WMSNoticeHub.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Model/WMSNoticeHub.cs
new file mode 100644
index 0000000..5f79c76
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Model/WMSNoticeHub.cs
@@ -0,0 +1,13 @@
+锘縰sing Microsoft.AspNetCore.SignalR;
+
+namespace WIDESEA_Model
+{
+ public class WMSNoticeHub : Hub
+ {
+ // 鍓嶇鐩戝惉杩欎釜鏂规硶灏辫兘鏀跺埌娑堟伅
+ public async Task SendMessage(string message)
+ {
+ await Clients.All.SendAsync("ReceiveMessage", message);
+ }
+ }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
index 85139cd..aa230b4 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
@@ -1,4 +1,5 @@
锘縰sing MailKit.Search;
+using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
@@ -235,12 +236,15 @@
Dt_Task task = Repository.QueryFirst(x => x.PalletCode == palletCode);
if (task != null)
{
+ _hubContext.Clients.All.SendAsync("ReceiveMessage", $"璇ユ墭鐩榹palletCode}宸茬敓鎴愪换鍔�");
return WebResponseContent.Instance.Error($"璇ユ墭鐩榹palletCode}宸茬敓鎴愪换鍔�");
}
Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First();
if (stockInfo == null)
{
+ _hubContext.Clients.All.SendAsync("ReceiveMessage", $"鏈壘鍒扮粍鐩樹俊鎭�");
+
return WebResponseContent.Instance.Error($"鏈壘鍒扮粍鐩樹俊鎭�");
}
@@ -250,6 +254,8 @@
Dt_LocationInfo locationInfo1 = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
if (locationInfo1 == null)
{
+ _hubContext.Clients.All.SendAsync("ReceiveMessage", $"鍥炲簱鍗曚腑璇ュ簱浣峽stockInfo.LocationCode}鏈壘鍒�");
+
return WebResponseContent.Instance.Error($"鍥炲簱鍗曚腑璇ュ簱浣峽stockInfo.LocationCode}鏈壘鍒�");
}
returnRoadwayInfo = _basicRepository.RoadwayInfoRepository.QueryFirst(x => x.RoadwayNo == locationInfo1.RoadwayNo && x.InStationCode == (returnRoadwayInfo.InStationCode != null ? returnRoadwayInfo.InStationCode : stationCode));
@@ -262,6 +268,8 @@
Dt_LocationInfo locationInfo1 = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == returnOrder.LocationCode);
if (locationInfo1 == null)
{
+ _hubContext.Clients.All.SendAsync("ReceiveMessage", $"鍥炲簱鍗曚腑璇ュ簱浣峽returnOrder.LocationCode}鏈壘鍒�");
+
return WebResponseContent.Instance.Error($"鍥炲簱鍗曚腑璇ュ簱浣峽returnOrder.LocationCode}鏈壘鍒�");
}
returnRoadwayInfo = _basicRepository.RoadwayInfoRepository.QueryFirst(x => x.RoadwayNo == locationInfo1.RoadwayNo && x.InStationCode == (returnRoadwayInfo.InStationCode != null ? returnRoadwayInfo.InStationCode : stationCode));
@@ -269,23 +277,31 @@
if (Repository.QueryFirst(x => x.SourceAddress == (returnRoadwayInfo.InStationCode != null ? returnRoadwayInfo.InStationCode : stationCode) && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null)
{
+ _hubContext.Clients.All.SendAsync("ReceiveMessage", $"璇ョ珯鐐瑰凡鏈夋湭鎵ц鐨勪换鍔�");
+
return WebResponseContent.Instance.Error($"璇ョ珯鐐瑰凡鏈夋湭鎵ц鐨勪换鍔�");
}
var details = stockInfo.Details.FirstOrDefault();
if (!string.IsNullOrEmpty(stockInfo.LocationCode))
{
+ _hubContext.Clients.All.SendAsync("ReceiveMessage", $"璇ユ墭鐩樺凡缁戝畾璐т綅");
+
return WebResponseContent.Instance.Error($"璇ユ墭鐩樺凡缁戝畾璐т綅");
}
Dt_RoadwayInfo roadwayInfo = _basicRepository.RoadwayInfoRepository.QueryFirst(x => x.InStationCode == (returnRoadwayInfo.InStationCode != null ? returnRoadwayInfo.InStationCode : stationCode));
if (roadwayInfo == null)
{
+ _hubContext.Clients.All.SendAsync("ReceiveMessage", $"鏈壘鍒拌鍏ュ簱绔欏彴鍦板潃");
+
return WebResponseContent.Instance.Error($"鏈壘鍒拌鍏ュ簱绔欏彴鍦板潃");
}
Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == roadwayInfo.RoadwayNo);
if (warehouse == null)
{
+ _hubContext.Clients.All.SendAsync("ReceiveMessage", $"鏈壘鍒拌浠撳簱");
+
return WebResponseContent.Instance.Error("鏈壘鍒拌浠撳簱");
}
@@ -295,6 +311,8 @@
locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == returnOrder.LocationCode);
if (locationInfo.LocationStatus != LocationStatusEnum.Lock.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.Disable.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt())
{
+ _hubContext.Clients.All.SendAsync("ReceiveMessage", $"璇ュ洖搴撳崟璐т綅{locationInfo.LocationCode}闈為攣瀹氱姸鎬佹垨璐т綅鍚敤鐘舵�佷笉姝g‘锛岃妫�鏌�");
+
return WebResponseContent.Instance.Error($"璇ュ洖搴撳崟璐т綅{locationInfo.LocationCode}闈為攣瀹氱姸鎬佹垨璐т綅鍚敤鐘舵�佷笉姝g‘锛岃妫�鏌�");
}
}
@@ -303,6 +321,8 @@
locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayInfo.RoadwayNo, stockInfo.PalletType, warehouse.WarehouseId, "", heightType);//, stockInfo.WarehouseId
if (locationInfo == null)
{
+ _hubContext.Clients.All.SendAsync("ReceiveMessage", $"璐т綅鍒嗛厤澶辫触,鏈壘鍒板彲鍒嗛厤璐т綅");
+
return WebResponseContent.Instance.Error($"璐т綅鍒嗛厤澶辫触,鏈壘鍒板彲鍒嗛厤璐т綅");
}
}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
index b1d8887..a5d8808 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -132,9 +132,11 @@
private readonly IInboundRepository _inboundRepository;
private readonly ITakeStockOrderCPRepository _takeStockOrderCPRepository;
private readonly ITakeStockOrderDetailCPRepository _takeStockOrderDetailCPRepository;
+ private readonly IHubContext<WMSNoticeHub> _hubContext;
public ITaskRepository Repository => BaseDal;
- public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IMaterielInfoService materielInfoService, IInboundOrderDetail_HtyService inboundOrderDetail_HtyService, IOutboundOrder_HtyService outboundOrder_HtyService, IOutboundOrderDetail_HtyService outboundOrderDetail_HtyService, IInboundOrder_HtyService inboundOrder_HtyService, IStockRepository stockRepository, IInboundOrderDetailService inboundOrderDetailService, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService, IOutboundOrderDetailRepository outboundOrderDetailRepository, IBasicRepository basicRepository, IStockInfoDetailRepository stockInfoDetailRepository, IPalletTypeInfoRepository palletTypeInfoRepository, IReturnOrderRepository returnOrderRepository, IProductionRepository productionRepository, IInboundRepository inboundRepository, INewOutboundOrderDetailRepository newOutboundOrderDetailRepository, ITakeStockOrderCPRepository takeStockOrderCPRepository, ITakeStockOrderDetailCPRepository takeStockOrderDetailCPRepository, IStockInfoDetailCPRepository stockInfoDetailCPRepository) : base(BaseDal)
+ public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IMaterielInfoService materielInfoService, IInboundOrderDetail_HtyService inboundOrderDetail_HtyService, IOutboundOrder_HtyService outboundOrder_HtyService, IOutboundOrderDetail_HtyService outboundOrderDetail_HtyService, IInboundOrder_HtyService inboundOrder_HtyService, IStockRepository stockRepository, IInboundOrderDetailService inboundOrderDetailService, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService, IOutboundOrderDetailRepository outboundOrderDetailRepository, IBasicRepository basicRepository, IStockInfoDetailRepository stockInfoDetailRepository, IPalletTypeInfoRepository palletTypeInfoRepository, IReturnOrderRepository returnOrderRepository, IProductionRepository productionRepository, IInboundRepository inboundRepository, INewOutboundOrderDetailRepository newOutboundOrderDetailRepository, ITakeStockOrderCPRepository takeStockOrderCPRepository, ITakeStockOrderDetailCPRepository takeStockOrderDetailCPRepository, IStockInfoDetailCPRepository stockInfoDetailCPRepository,
+ IHubContext<WMSNoticeHub> hubContext) : base(BaseDal)
{
_mapper = mapper;
_stockRepository = stockRepository;
@@ -163,6 +165,7 @@
_takeStockOrderCPRepository = takeStockOrderCPRepository;
_takeStockOrderDetailCPRepository = takeStockOrderDetailCPRepository;
_stockInfoDetailCPRepository = stockInfoDetailCPRepository;
+ _hubContext = hubContext;
}
public string ReceiveWMSTaskin = WIDESEA_Core.Helper.AppSettings.Configuration["ReceiveWMSTaskin"];
--
Gitblit v1.9.3