From ec3daa05f122738f18d4474b9257e4cf794dc5cf Mon Sep 17 00:00:00 2001
From: Admin <Admin@ADMIN>
Date: 星期五, 06 三月 2026 10:36:01 +0800
Subject: [PATCH] 接口新增
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs | 27 +++++++++++++++++++--------
1 files changed, 19 insertions(+), 8 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs"
index 27fb0fd..bbc1ed2 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs"
@@ -315,21 +315,32 @@
#endregion 鍚敤绂佺敤璐т綅
#region 澶у睆搴撲綅鐘舵�佽幏鍙�
- public WebResponseContent LocationStatus()
+ public WebResponseContent LocationStatuskt()
{
WebResponseContent content = new WebResponseContent();
// 鑾峰彇鎵�鏈夊簱浣嶆暟鎹�
List<DtLocationInfo> locations = BaseDal.QueryData();
+ // 瀹氫箟鎵�鏈夊彲鑳界殑鐘舵�佸強鍏跺搴旂殑鏄剧ず鏂囨湰
+ var allStatuses = new Dictionary<int, string>
+{
+ { 0, "绌鸿揣浣�" },
+ { 1, "閿佸畾" },
+ { 2, "鏈夎揣" },
+ { 3, "鏈夎揣绂佺敤" }
+};
+
// 鎸塋ocationStatus鍒嗙粍缁熻
- var statusGroups = locations
- .GroupBy(l => l.LocationStatus)
- .Select(g => new
- {
- Status = g.Key==0?"绌鸿揣浣�": g.Key == 1 ? "閿佸畾": g.Key == 2 ? "鏈夎揣": "鏈夎揣绂佺敤",
- Count = g.Count(),
- })
+ var statusGroups = allStatuses
+ .GroupJoin(locations.GroupBy(l => l.LocationStatus),
+ status => status.Key,
+ group => group.Key,
+ (status, groups) => new
+ {
+ Status = status.Value,
+ Count = groups.SelectMany(g => g).Any() ? groups.First().Count() : 0
+ })
.ToList();
// 灏嗙粺璁$粨鏋滄斁鍏ュ搷搴斿唴瀹�
--
Gitblit v1.9.3