From 1e12c140c041c0cb52306a0db9ff0ba18354d0d8 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 03 四月 2025 18:01:52 +0800
Subject: [PATCH] 优化WMS前端首页,货位查询column数据库关键字处理
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockViewService.cs | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockViewService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockViewService.cs"
index f2fb085..85fac0c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockViewService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockViewService.cs"
@@ -12,8 +12,10 @@
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
+using WIDESEA_Core.DB.Models;
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
+using WIDESEA_Core.HostedService;
using WIDESEA_Core.Utilities;
using WIDESEA_DTO.Stock;
using WIDESEA_IStockRepository;
@@ -24,5 +26,33 @@
{
public partial class StockViewService : IStockViewService
{
+ private string GetDataRole(Type type)
+ {
+ try
+ {
+ UserRole? userRole = PermissionDataHostService.UserRoles.FirstOrDefault(x => x.UserId == App.User.UserId);
+ if (userRole == null)
+ throw new Exception($"鏃犳潈闄�");
+
+ if (type.IsAssignableFrom(typeof(BaseWarehouseEntity)) || type.GetProperty(nameof(BaseWarehouseEntity.WarehouseId)) != null)
+ {
+ if (userRole.WarehouseIds.Count > 0)
+ {
+ return $"{nameof(BaseWarehouseEntity.WarehouseId)} in ({userRole.WarehouseIds.Serialize().Replace("[", "").Replace("]", "")})";
+ }
+
+ else
+ return $"1 != 1";
+ }
+ else
+ {
+ return "1 = 1";
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new Exception($"鏃犳潈闄愶紝{ex.Message}");
+ }
+ }
}
}
--
Gitblit v1.9.3