From c0b83b0bd71309a6501704fe6c7947fc81d75c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZR20090193-=E9=99=88=E6=95=AC=E5=8B=87?= Date: Tue, 10 Jan 2023 14:50:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93=E8=AE=A1=E5=88=92=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E6=B7=BB=E5=8A=A0=E7=AE=B1=E5=8F=B7=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Partial/VW_OP_WMS_IN_PLANService.cs | 48 ++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/Vue.Net/VOL.WMS/Services/WMSINPLAN/Partial/VW_OP_WMS_IN_PLANService.cs b/Vue.Net/VOL.WMS/Services/WMSINPLAN/Partial/VW_OP_WMS_IN_PLANService.cs index fcbffd30..b4f92f79 100644 --- a/Vue.Net/VOL.WMS/Services/WMSINPLAN/Partial/VW_OP_WMS_IN_PLANService.cs +++ b/Vue.Net/VOL.WMS/Services/WMSINPLAN/Partial/VW_OP_WMS_IN_PLANService.cs @@ -17,6 +17,9 @@ using Microsoft.EntityFrameworkCore; using VOL.Core.ManageUser; using System.Collections.Generic; using System; +using ConvertHelper; +using VOL.System.Repositories; +using VOL.WMS.Repositories; namespace VOL.WMS.Services { @@ -60,22 +63,45 @@ namespace VOL.WMS.Services //queryable = queryable.DataFilterExtension(); - if (UserContext.Current.UserInfo.LimitInCompany) - { - //IQueryable userQuery = RoleContext.GetCurrentAllChildUser(); + //if (UserContext.Current.UserInfo.LimitInCompany) + //{ + // //IQueryable userQuery = RoleContext.GetCurrentAllChildUser(); - queryable = queryable.Where(x => x.CORPID == UserContext.Current.UserInfo.CompanyId); - } + // queryable = queryable.Where(x => x.CORPID == UserContext.Current.UserInfo.CompanyId); + //} - //如果该用户角色受仓库权限限制 ,则必须 - if (UserContext.Current.UserInfo.LimitBySTORAGE) - { - //IQueryable userQuery = RoleContext.GetCurrentAllChildUser(); + ////如果该用户角色受仓库权限限制 ,则必须 + //if (UserContext.Current.UserInfo.LimitBySTORAGE) + //{ + // //IQueryable userQuery = RoleContext.GetCurrentAllChildUser(); - queryable = queryable.Where(x => (UserContext.Current.UserInfo.STOREHOUSEList.Contains(x.STOREHOUSE)) || (x.STOREHOUSE == "" || x.STOREHOUSE == null)); + // queryable = queryable.Where(x => (UserContext.Current.UserInfo.STOREHOUSEList.Contains(x.STOREHOUSE)) || (x.STOREHOUSE == "" || x.STOREHOUSE == null)); + //} + var list = queryable.DataFilter(); + if (list[0].Count > 0) + { + queryable = queryable.Where(list[0].AsExpression(Query.Condition.AndAlso)); + } + if (list[1].Count > 0) + { + queryable = queryable.Where(list[1].AsExpression(Query.Condition.OrElse)); } - //queryable = queryable.Where(x => x.BSSOURCE == "入库受理" || (x.BSSOURCE == "入库计划" && x.BILLSTATUS!="1000") || x.BSSOURCE == "贸易公司" ); + #region 处理箱号查询 + var CNTRNO = string.Empty; + var searchParametersList = options.Wheres.DeserializeObject>(); + if (searchParametersList.Exists(x => x.Name == "CNTRNO")) + { + CNTRNO = searchParametersList.First(x => x.Name == "CNTRNO").Value; + + var goodslist = OP_WMS_IN_PLAN_GOODSRepository.Instance.FindAsIQueryable(x => x.CNTRNO.Contains(CNTRNO)).Select(n => n.WMSPLANID).Distinct().ToList(); + + if (goodslist.Count > 0) + { + queryable = queryable.Where(x => (goodslist.Contains(x.WMSPLANID))); + } + } + #endregion return queryable; };