From 4a1765ea61fb8706bddbf90b91b310e2ce0e9f7d Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期一, 02 三月 2026 14:59:48 +0800
Subject: [PATCH] 1
---
WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 48 insertions(+), 1 deletions(-)
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs
index a15eb27..68e0fdc 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs
@@ -1,6 +1,8 @@
锘縰sing AutoMapper;
+using Microsoft.AspNetCore.Http.Metadata;
using SqlSugar;
using System;
+using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -13,8 +15,8 @@
using WIDESEA_Core.Utilities;
using WIDESEA_DTO.Basic;
using WIDESEA_IBasicRepository;
-using WIDESEA_IRecordService;
using WIDESEA_IBasicService;
+using WIDESEA_IRecordService;
using WIDESEA_Model.Models;
namespace WIDESEA_BasicService
@@ -275,5 +277,50 @@
_recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locations, beforeEndStatus, StockChangeType.Relocation.ObjToInt(), "", TaskNum);
}
+
+ /// <summary>
+ /// 璐т綅璀﹀憡
+ /// </summary>
+ /// <returns></returns>
+ /// <exception cref="NotImplementedException"></exception>
+ public WebResponseContent LocationWarning()
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ List<Dt_Warehouse> warehouses = BaseDal.Db.Queryable<Dt_Warehouse>().ToList();
+ List<string> locationWarning = new List<string>();
+ foreach (var item in warehouses)
+ {
+
+ for(var i = 1; i < 3; i++)
+ {
+ int inStockNum = 0;
+ List<Dt_LocationInfo> locationInfos = BaseDal.QueryData(x => x.WarehouseId == item.WarehouseId && x.Row == i);
+ if(locationInfos != null && locationInfos.Count() != 0)
+ {
+ foreach (var item1 in locationInfos)
+ {
+ if (item1.LocationStatus == 2)
+ {
+ inStockNum++;
+ }
+ }
+ if (inStockNum != 0 && (double)inStockNum/locationInfos.Count() >= 0.8)
+ {
+ var locationName = $"{item.WarehouseName},绗瑊i}鎺�";
+ locationWarning.Add(locationName);
+ }
+ }
+ }
+ }
+ return content.OK(data: locationWarning);
+ }
+ catch (Exception ex)
+ {
+ return content.Error();
+ }
+
+ }
}
}
--
Gitblit v1.9.3