|
|
@@ -7,6 +7,7 @@ using System.Linq.Dynamic.Core;
|
|
|
using System.Reflection;
|
|
|
using System.Text.RegularExpressions;
|
|
|
using System.Threading.Tasks;
|
|
|
+using System.Web.Http.Results;
|
|
|
using System.Web.Mvc;
|
|
|
using System.Web.UI.WebControls;
|
|
|
using System.Xml;
|
|
|
@@ -733,8 +734,15 @@ namespace ShwasherSys.Common
|
|
|
{
|
|
|
identityResult.CheckErrors(LocalizationManager);
|
|
|
}
|
|
|
+ protected virtual void CheckErrors(String error)
|
|
|
+ {
|
|
|
+ var identityResult = IdentityResult.Failed(error);
|
|
|
+ CheckErrors(identityResult);
|
|
|
|
|
|
- public ShortMessage GetShortMsgDetailInfo(ShortMsgDetailDto input)
|
|
|
+
|
|
|
+ //identityResult.CheckErrors(LocalizationManager);
|
|
|
+ }
|
|
|
+ public ShortMessage GetShortMsgDetailInfo(ShortMsgDetailDto input)
|
|
|
{
|
|
|
var entity = ShortMessageRepository.FirstOrDefault(input.MsgID);
|
|
|
var detailInfo = ShortMsgDetailRepository.FirstOrDefault(input.Id);
|
|
|
@@ -1261,6 +1269,32 @@ namespace ShwasherSys.Common
|
|
|
|
|
|
#region 2023
|
|
|
|
|
|
+ private void GetPropertiesNo(List<MultiSearchDto> searchList,ref string modelNo, ref string materialNo, ref string rigidityNo, ref string surfaceColorNo)
|
|
|
+ {
|
|
|
+ foreach (var o in searchList)
|
|
|
+ {
|
|
|
+ if (o.KeyWords.IsNullOrEmpty())
|
|
|
+ continue;
|
|
|
+ object keyWords = o.KeyWords;
|
|
|
+ if (o.KeyField?.ToLower() == "modelno")
|
|
|
+ {
|
|
|
+ modelNo = keyWords.ToString();
|
|
|
+ }
|
|
|
+ if (o.KeyField?.ToLower() == "materialno")
|
|
|
+ {
|
|
|
+ materialNo = keyWords.ToString();
|
|
|
+ }
|
|
|
+ if (o.KeyField?.ToLower() == "rigidityno")
|
|
|
+ {
|
|
|
+ rigidityNo = keyWords.ToString();
|
|
|
+ }
|
|
|
+ if (o.KeyField?.ToLower() == "surfacecolorno")
|
|
|
+ {
|
|
|
+ surfaceColorNo = keyWords.ToString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public async Task<PagedResultDto<ProductionOrderDto>> QueryProductionOrderDtoByProNo(PagedRequestDto input)
|
|
|
{
|
|
|
var query = ProductionOrderRepository.GetAll();
|
|
|
@@ -1309,16 +1343,29 @@ namespace ShwasherSys.Common
|
|
|
var searchList = input.SearchList;
|
|
|
if (searchList != null && searchList.Count > 0)
|
|
|
{
|
|
|
- List<LambdaObject> objList = new List<LambdaObject>();
|
|
|
- foreach (var o in searchList)
|
|
|
+ //List<LambdaObject> objList = new List<LambdaObject>();
|
|
|
+ string modelNo = "", materialNo = "", rigidityNo = "", surfaceColorNo = "";
|
|
|
+ GetPropertiesNo(searchList,ref modelNo, ref materialNo, ref rigidityNo, ref surfaceColorNo);
|
|
|
+ if (modelNo.IsNullOrEmpty())
|
|
|
{
|
|
|
- if (o.KeyWords.IsNullOrEmpty())
|
|
|
- continue;
|
|
|
- object keyWords = o.KeyWords;
|
|
|
- if (o.KeyField?.ToLower() == "productno")
|
|
|
- {
|
|
|
- result = result.Where(a => a.SemiProductNo.StartsWith(o.KeyWords));
|
|
|
- }
|
|
|
+ CheckErrors("规格不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //111,110,100,000
|
|
|
+ if ((materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty())||(!materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty())|| (!materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()))
|
|
|
+ {
|
|
|
+ result = result.Where(i => i.SemiProductNo.StartsWith("s" + modelNo + materialNo + rigidityNo + surfaceColorNo));
|
|
|
+
|
|
|
+ }//101,001,011
|
|
|
+ else if((!materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()))
|
|
|
+ {
|
|
|
+ result = result.Where(i => i.SemiProductNo.StartsWith("s" + modelNo + materialNo) && i.SemiProductNo.Contains(rigidityNo + surfaceColorNo));
|
|
|
+ }//010
|
|
|
+ else if (materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty())
|
|
|
+ {
|
|
|
+ result = result.Where(i => i.SemiProductNo.StartsWith("s" + modelNo));
|
|
|
+ result = result.Where(i => i.SemiProductNo.Contains( rigidityNo));
|
|
|
}
|
|
|
}
|
|
|
var totalCount = await AsyncQueryableExecuter.CountAsync(result);
|
|
|
@@ -1339,16 +1386,38 @@ namespace ShwasherSys.Common
|
|
|
var searchList = input.SearchList;
|
|
|
if (searchList != null && searchList.Count > 0)
|
|
|
{
|
|
|
- List<LambdaObject> objList = new List<LambdaObject>();
|
|
|
- foreach (var o in searchList)
|
|
|
+ //List<LambdaObject> objList = new List<LambdaObject>();
|
|
|
+ //foreach (var o in searchList)
|
|
|
+ //{
|
|
|
+ // if (o.KeyWords.IsNullOrEmpty())
|
|
|
+ // continue;
|
|
|
+ // object keyWords = o.KeyWords;
|
|
|
+ // if (o.KeyField?.ToLower() == "productno")
|
|
|
+ // {
|
|
|
+ // query = query.Where(a => a.ProductNo.StartsWith(o.KeyWords));
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ string modelNo = "", materialNo = "", rigidityNo = "", surfaceColorNo = "";
|
|
|
+ GetPropertiesNo(searchList, ref modelNo, ref materialNo, ref rigidityNo, ref surfaceColorNo);
|
|
|
+ if (modelNo.IsNullOrEmpty())
|
|
|
{
|
|
|
- if (o.KeyWords.IsNullOrEmpty())
|
|
|
- continue;
|
|
|
- object keyWords = o.KeyWords;
|
|
|
- if (o.KeyField?.ToLower() == "productno")
|
|
|
- {
|
|
|
- query = query.Where(a => a.ProductNo.StartsWith(o.KeyWords));
|
|
|
- }
|
|
|
+ CheckErrors("规格不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+ //111,110,100,000
|
|
|
+ if ((materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()))
|
|
|
+ {
|
|
|
+ query = query.Where(i => i.ProductNo.StartsWith("s" + modelNo + materialNo + rigidityNo + surfaceColorNo));
|
|
|
+ }//101,001,011
|
|
|
+ else if ((!materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()))
|
|
|
+ {
|
|
|
+ query = query.Where(i => i.ProductNo.StartsWith("s" + modelNo + materialNo) && i.ProductNo.Contains(rigidityNo + surfaceColorNo));
|
|
|
+ //query = query.Where(i => i.ProductNo.EndsWith(rigidityNo + surfaceColorNo));
|
|
|
+ }//010
|
|
|
+ else if (materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty())
|
|
|
+ {
|
|
|
+ query = query.Where(i => i.ProductNo.StartsWith("s" + modelNo));
|
|
|
+ query = query.Where(i => i.ProductNo.Contains(rigidityNo));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1369,16 +1438,37 @@ namespace ShwasherSys.Common
|
|
|
var searchList = input.SearchList;
|
|
|
if (searchList != null && searchList.Count > 0)
|
|
|
{
|
|
|
- List<LambdaObject> objList = new List<LambdaObject>();
|
|
|
- foreach (var o in searchList)
|
|
|
+ //List<LambdaObject> objList = new List<LambdaObject>();
|
|
|
+ //foreach (var o in searchList)
|
|
|
+ //{
|
|
|
+ // if (o.KeyWords.IsNullOrEmpty())
|
|
|
+ // continue;
|
|
|
+ // object keyWords = o.KeyWords;
|
|
|
+ // if (o.KeyField?.ToLower() == "productno")
|
|
|
+ // {
|
|
|
+ // query = query.Where(a => a.SemiProductNo.StartsWith(o.KeyWords));
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ string modelNo = "", materialNo = "", rigidityNo = "", surfaceColorNo = "";
|
|
|
+ GetPropertiesNo(searchList, ref modelNo, ref materialNo, ref rigidityNo, ref surfaceColorNo);
|
|
|
+ if (modelNo.IsNullOrEmpty())
|
|
|
+ {
|
|
|
+ CheckErrors("规格不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+ //111,110,100,000
|
|
|
+ if ((materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()))
|
|
|
+ {
|
|
|
+ query = query.Where(i => i.SemiProductNo.StartsWith("s" + modelNo + materialNo + rigidityNo + surfaceColorNo));
|
|
|
+ }//101,001,011
|
|
|
+ else if ((!materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()))
|
|
|
+ {
|
|
|
+ query = query.Where(i => i.SemiProductNo.StartsWith("s" + modelNo + materialNo)&& i.SemiProductNo.Contains(rigidityNo + surfaceColorNo));
|
|
|
+ }//010
|
|
|
+ else if (materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty())
|
|
|
{
|
|
|
- if (o.KeyWords.IsNullOrEmpty())
|
|
|
- continue;
|
|
|
- object keyWords = o.KeyWords;
|
|
|
- if (o.KeyField?.ToLower() == "productno")
|
|
|
- {
|
|
|
- query = query.Where(a => a.SemiProductNo.StartsWith(o.KeyWords));
|
|
|
- }
|
|
|
+ query = query.Where(i => i.SemiProductNo.StartsWith("s" + modelNo));
|
|
|
+ query = query.Where(i => i.SemiProductNo.Contains(rigidityNo));
|
|
|
}
|
|
|
}
|
|
|
query = query.Where(i => i.ActualQuantity > 0);
|