入库计划后台添加箱号查询

sdgslk
ZR20090193-陈敬勇 2 years ago
parent 9c8b0ee17f
commit c0b83b0bd7

@ -17,6 +17,9 @@ using Microsoft.EntityFrameworkCore;
using VOL.Core.ManageUser; using VOL.Core.ManageUser;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
using ConvertHelper;
using VOL.System.Repositories;
using VOL.WMS.Repositories;
namespace VOL.WMS.Services namespace VOL.WMS.Services
{ {
@ -60,22 +63,45 @@ namespace VOL.WMS.Services
//queryable = queryable.DataFilterExtension(); //queryable = queryable.DataFilterExtension();
if (UserContext.Current.UserInfo.LimitInCompany) //if (UserContext.Current.UserInfo.LimitInCompany)
{ //{
//IQueryable<string> userQuery = RoleContext.GetCurrentAllChildUser(); // //IQueryable<string> 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) //if (UserContext.Current.UserInfo.LimitBySTORAGE)
{ //{
//IQueryable<string> userQuery = RoleContext.GetCurrentAllChildUser(); // //IQueryable<string> 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<VW_OP_WMS_IN_PLAN>(Query.Condition.AndAlso));
}
if (list[1].Count > 0)
{
queryable = queryable.Where(list[1].AsExpression<VW_OP_WMS_IN_PLAN>(Query.Condition.OrElse));
} }
//queryable = queryable.Where(x => x.BSSOURCE == "入库受理" || (x.BSSOURCE == "入库计划" && x.BILLSTATUS!="1000") || x.BSSOURCE == "贸易公司" ); //queryable = queryable.Where(x => x.BSSOURCE == "入库受理" || (x.BSSOURCE == "入库计划" && x.BILLSTATUS!="1000") || x.BSSOURCE == "贸易公司" );
#region 处理箱号查询
var CNTRNO = string.Empty;
var searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
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; return queryable;
}; };

Loading…
Cancel
Save