|
|
@@ -22,6 +22,10 @@ using System.Text.RegularExpressions;
|
|
|
using MSharp.Framework;
|
|
|
using System.Net.Http.Headers;
|
|
|
using System.Net.Http;
|
|
|
+using SQLData;
|
|
|
+using NHibernate.Mapping;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
|
|
|
public partial class uploadFile : System.Web.UI.Page
|
|
|
{
|
|
|
@@ -259,7 +263,7 @@ public partial class uploadFile : System.Web.UI.Page
|
|
|
entity.FinishPlaceTime = DateTime.Now;
|
|
|
}
|
|
|
}
|
|
|
- if ((((entity.seller_memo.Contains("条幅彩色") && !entity.seller_memo.Contains("辽宁") && !entity.seller_memo.Contains("山东")) || entity.seller_memo.Contains("贡锻布") || entity.seller_memo.Contains("贡缎布") || entity.seller_memo.Contains("旗帜布")) && !entity.seller_memo.Contains("双喷")) || (entity.seller_memo.Contains("帆布") && !entity.seller_memo.Contains("帆布袋")))
|
|
|
+ if (((((entity.seller_memo.Contains("条幅彩色") && !entity.seller_memo.Contains("辽宁") && !entity.seller_memo.Contains("山东")) || entity.seller_memo.Contains("贡锻布") || entity.seller_memo.Contains("贡缎布") || entity.seller_memo.Contains("旗帜布")) && !entity.seller_memo.Contains("双喷")) || (entity.seller_memo.Contains("帆布") && !entity.seller_memo.Contains("帆布袋") && !entity.seller_memo.Contains("封边尺寸"))) && !entity.seller_memo.Contains("电子稿"))
|
|
|
{
|
|
|
entity.IsVerifyToSupplier = true;
|
|
|
entity.SupplierId = 98;
|
|
|
@@ -528,6 +532,182 @@ public partial class uploadFile : System.Web.UI.Page
|
|
|
}
|
|
|
conErc("空文件!");
|
|
|
}
|
|
|
+
|
|
|
+ private int getsupplierId(CeErpTradeCell entity)
|
|
|
+ {
|
|
|
+ int supplierId = 0;
|
|
|
+ StringBuilder sql = new StringBuilder();
|
|
|
+ sql.AppendFormat("select * from CE_ErpUpFileSupplier ");
|
|
|
+ DataTable cellEx = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0];
|
|
|
+
|
|
|
+ int num = getProductCount(entity.seller_memo);
|
|
|
+ foreach (DataRow row in cellEx.Rows)
|
|
|
+ {
|
|
|
+ bool isIn = true;
|
|
|
+ //判断材质工艺都要符合
|
|
|
+ if (Convert.IsDBNull(row["seller_memo"]))
|
|
|
+ {
|
|
|
+ string memo = row["seller_memo"].ToString();
|
|
|
+
|
|
|
+ string[] memolist = memo.Split('+');
|
|
|
+ for (int i = 0; i < memolist.Length; i++)
|
|
|
+ {
|
|
|
+ if (!Regex.IsMatch(entity.seller_memo, memolist[i].Replace("/", "|")))
|
|
|
+ {
|
|
|
+ isIn = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!isIn)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //判断金额符不符合
|
|
|
+ if (!Convert.IsDBNull(row["payment"]))
|
|
|
+ {
|
|
|
+ string payment = row["payment"].ToString();
|
|
|
+ string[] paymentList = payment.Split('-');
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(paymentList[0]))
|
|
|
+ {
|
|
|
+ if (entity.payment < Convert.ToDouble(paymentList[0]))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(paymentList[1]))
|
|
|
+ {
|
|
|
+ if (entity.payment > Convert.ToDouble(paymentList[1]))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!Convert.IsDBNull(row["size"]))
|
|
|
+ {
|
|
|
+ string pattern = @"\b(\d{1,5}[x\*]\d{1,5}(mm|cm))\b";
|
|
|
+ string memo = entity.seller_memo.Replace("MM", "mm").Replace("CM", "cm");
|
|
|
+ Regex reg = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Multiline, TimeSpan.FromSeconds(2));//2秒后超时
|
|
|
+ MatchCollection matches = reg.Matches(memo);//设定要查找的字符串
|
|
|
+ double width = 0;
|
|
|
+ double height = 0;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (matches[0].Success)
|
|
|
+ {
|
|
|
+ string sizematches = matches[0].Groups[0].Value;
|
|
|
+ sizematches = sizematches.Replace("mm", "");
|
|
|
+ sizematches = sizematches.Replace("cm", "");
|
|
|
+ string[] size_list = sizematches.Split('x');
|
|
|
+ if (size_list.Length > 1)
|
|
|
+ {
|
|
|
+ width = Convert.ToDouble(size_list[0]);
|
|
|
+ height = Convert.ToDouble(size_list[1]);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ string size = row["size"].ToString();
|
|
|
+ string[] sizeList = size.Split('-');
|
|
|
+ if (!string.IsNullOrEmpty(sizeList[0]))
|
|
|
+ {
|
|
|
+ string[] sizeItemList = sizeList[0].Split('x');
|
|
|
+ //第一个尺寸格式不正确
|
|
|
+ if (sizeItemList.Length < 2)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ double sizeWidth = Convert.ToDouble(sizeItemList[0]);
|
|
|
+ double sizeheight = Convert.ToDouble(sizeItemList[1]);
|
|
|
+ //备注尺寸要大于第一个尺寸
|
|
|
+
|
|
|
+ if (!((width > sizeWidth && height > sizeheight) || (width > sizeheight && height > sizeWidth)))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(sizeList[1]))
|
|
|
+ {
|
|
|
+ string[] sizeItemList = sizeList[1].Split('x');
|
|
|
+ //第二个尺寸格式不正确
|
|
|
+ if (sizeItemList.Length < 2)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ double sizeWidth = Convert.ToDouble(sizeItemList[0]);
|
|
|
+ double sizeheight = Convert.ToDouble(sizeItemList[1]);
|
|
|
+ //备注尺寸要大于第二个尺寸
|
|
|
+
|
|
|
+ if (!((width < sizeWidth && height < sizeheight) || (width < sizeheight && height < sizeWidth)))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //判断数量是否符合
|
|
|
+ if (!Convert.IsDBNull(row["number"]))
|
|
|
+ {
|
|
|
+ string numberText = row["number"].ToString();
|
|
|
+
|
|
|
+ string[] numberTextList = numberText.Split('-');
|
|
|
+ int number = 0;
|
|
|
+ if (!string.IsNullOrEmpty(numberTextList[0]))
|
|
|
+ {
|
|
|
+ number = Convert.ToInt32(numberTextList[0]);
|
|
|
+ if (number > num)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(numberTextList[1]))
|
|
|
+ {
|
|
|
+ number = Convert.ToInt32(numberTextList[1]);
|
|
|
+ if (number < num)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //判断店铺符不符合
|
|
|
+ if (!Convert.IsDBNull(row["shopIds"]))
|
|
|
+ {
|
|
|
+ List<string> shopids = row["shopIds"].ToString().Split(',').ToList();
|
|
|
+
|
|
|
+ if (!shopids.Contains(entity.ShopId.ToString()))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //地区不符合
|
|
|
+ if (!Convert.IsDBNull(row["address"]))
|
|
|
+ {
|
|
|
+ if (!Regex.IsMatch(entity.seller_memo, row["address"].ToString().Replace("、", "|")))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //限制条件
|
|
|
+ if (!Convert.IsDBNull(row["filterText"]))
|
|
|
+ {
|
|
|
+ if (!Regex.IsMatch(entity.seller_memo, row["filterText"].ToString().Replace("/", "|")))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return supplierId;
|
|
|
+ }
|
|
|
class CdrConvert
|
|
|
{
|
|
|
private object lockObject = new object();
|