|
|
@@ -19,8 +19,9 @@ using System.Security.Principal;
|
|
|
using System.Threading.Tasks;
|
|
|
using System.Threading;
|
|
|
using System.Runtime.InteropServices;
|
|
|
-using System.Text.RegularExpressions;
|
|
|
using System.Data;
|
|
|
+using System.Text.RegularExpressions;
|
|
|
+using NHibernate.Mapping;
|
|
|
|
|
|
public partial class uploadFile : System.Web.UI.Page
|
|
|
{
|
|
|
@@ -104,7 +105,7 @@ public partial class uploadFile : System.Web.UI.Page
|
|
|
MatchCollection nameMatches = nameReg.Matches(file_name);//设定要查找的字符串
|
|
|
if (nameMatches.Count > 0)
|
|
|
{
|
|
|
- foreach (Match match in nameMatches)
|
|
|
+ foreach (System.Text.RegularExpressions.Match match in nameMatches)
|
|
|
{
|
|
|
file_name = file_name.Replace(match.Value, "");
|
|
|
}
|
|
|
@@ -241,6 +242,7 @@ public partial class uploadFile : System.Web.UI.Page
|
|
|
//}
|
|
|
}
|
|
|
entity.IsReturn = 0;
|
|
|
+ int num = getProductCount(entity.seller_memo);
|
|
|
if (entity.MemoOpt == 1 || entity.MemoOpt == 2)
|
|
|
{
|
|
|
entity.MemoOpt = 0;
|
|
|
@@ -249,26 +251,6 @@ public partial class uploadFile : System.Web.UI.Page
|
|
|
{
|
|
|
if (entity.seller_memo.Contains("插卡") && entity.ProductCount != null && !entity.seller_memo.Contains("S_"))
|
|
|
{
|
|
|
- int num = 0;
|
|
|
- try
|
|
|
- {
|
|
|
- string text = entity.ProductCount;
|
|
|
- string pattern = @"(\d+)\s*张";
|
|
|
-
|
|
|
- MatchCollection matches = Regex.Matches(text, pattern);
|
|
|
- foreach (Match match in matches)
|
|
|
- {
|
|
|
- if (match.Success)
|
|
|
- {
|
|
|
- num = Convert.ToInt32(match.Groups[1].Value);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
if (num >= 100)
|
|
|
{
|
|
|
entity.IsVerifyToSupplier = true;
|
|
|
@@ -284,13 +266,115 @@ public partial class uploadFile : System.Web.UI.Page
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- if(entity.ProductId == 2690)
|
|
|
+ if (entity.payment <= 300 && num >= 200 && num <= 3000 && entity.ShopId != 14 && entity.ShopId != 99)
|
|
|
+ {
|
|
|
+ //300克铜板纸/铜版纸300克-覆哑膜/覆膜/不覆膜-直角/裁切
|
|
|
+ if (!entity.seller_memo.Contains("opp") && !entity.seller_memo.Contains("按文件") && !entity.seller_memo.Contains("流苏"))
|
|
|
+ {
|
|
|
+ if ((entity.seller_memo.Contains("直角") || entity.seller_memo.Contains("裁切")) && (entity.seller_memo.Contains("300克铜板纸") || entity.seller_memo.Contains("300克铜板纸")) && (entity.seller_memo.Contains("覆哑膜") || entity.seller_memo.Contains("覆膜") || entity.seller_memo.Contains("不覆膜")))
|
|
|
+ {
|
|
|
+ entity.IsVerifyToSupplier = true;
|
|
|
+ entity.SupplierId = 14;
|
|
|
+ entity.FinishPlaceTime = DateTime.Now;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (entity.payment <= 100 && num > 200 && num <= 1500)
|
|
|
+ {
|
|
|
+ //数量0-1500
|
|
|
+ //0-80*54
|
|
|
+ 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);//设定要查找的字符串
|
|
|
+ string size = "";
|
|
|
+ double min_width = 80;
|
|
|
+ double min_height = 54;
|
|
|
+ double width = 0;
|
|
|
+ double height = 0;
|
|
|
+ bool isIn = false;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (matches[0].Success)
|
|
|
+ {
|
|
|
+ size = matches[0].Groups[0].Value;
|
|
|
+ size = size.Replace("mm", "");
|
|
|
+ size = size.Replace("cm", "");
|
|
|
+ string[] size_list = size.Split('x');
|
|
|
+ if (size_list.Length > 1)
|
|
|
+ {
|
|
|
+ width = Convert.ToDouble(size_list[0]);
|
|
|
+ height = Convert.ToDouble(size_list[1]);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((width <= min_width && height <= min_height) || (height <= min_width && width <= min_height))
|
|
|
+ {
|
|
|
+ isIn = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ //铜版纸不干胶-覆亮膜
|
|
|
+ if (isIn && entity.seller_memo.Contains("铜版纸不干胶") && entity.seller_memo.Contains("覆亮膜") && !entity.seller_memo.Contains("烫金") && !entity.seller_memo.Contains("排序"))
|
|
|
+ {
|
|
|
+ entity.IsVerifyToSupplier = true;
|
|
|
+ entity.SupplierId = 64;
|
|
|
+ entity.FinishPlaceTime = DateTime.Now;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (entity.payment <= 500 && num > 200 && num <= 5000)
|
|
|
+ {
|
|
|
+ //数量0-5000
|
|
|
+ if (entity.seller_memo.Contains("透明不干胶"))
|
|
|
+ {
|
|
|
+ entity.IsVerifyToSupplier = true;
|
|
|
+ entity.SupplierId = 64;
|
|
|
+ entity.FinishPlaceTime = DateTime.Now;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (entity.payment <= 100 && num > 200 && num <= 1000)
|
|
|
+ {
|
|
|
+ //数量0-1000
|
|
|
+ if (entity.seller_memo.Contains("铜版纸不干胶") && entity.seller_memo.Contains("覆哑膜"))
|
|
|
+ {
|
|
|
+ entity.IsVerifyToSupplier = true;
|
|
|
+ entity.SupplierId = 64;
|
|
|
+ entity.FinishPlaceTime = DateTime.Now;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (entity.payment <= 500 && num > 0 && num <= 50)
|
|
|
+ {
|
|
|
+ //数量0-50
|
|
|
+ if (entity.seller_memo.Contains("领淘550灯布海报") || entity.seller_memo.Contains("领淘户外写真海报"))
|
|
|
+ {
|
|
|
+ entity.IsVerifyToSupplier = true;
|
|
|
+ entity.SupplierId = 59;
|
|
|
+ entity.FinishPlaceTime = DateTime.Now;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (entity.payment <= 500 && num > 0 && num <= 50)
|
|
|
+ {
|
|
|
+ //数量0-50
|
|
|
+ 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.IsVerifyToSupplier = true;
|
|
|
+ entity.SupplierId = 90;
|
|
|
+ entity.FinishPlaceTime = DateTime.Now;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (entity.ProductId == 2690)
|
|
|
{
|
|
|
entity.IsVerifyToSupplier = true;
|
|
|
entity.SupplierId = 97;
|
|
|
entity.FinishPlaceTime = DateTime.Now;
|
|
|
}
|
|
|
- if(entity.ProductId == 2701)
|
|
|
+ if (entity.ProductId == 2701)
|
|
|
{
|
|
|
entity.IsVerifyToSupplier = true;
|
|
|
entity.SupplierId = 98;
|
|
|
@@ -492,6 +576,28 @@ public partial class uploadFile : System.Web.UI.Page
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ public static int getProductCount(string txt)
|
|
|
+ {
|
|
|
+ // 提取"个"或"张"前面的数字
|
|
|
+ int unit = 0;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string unitPattern = @"(\d+)(?=个|张|本|套|件|卷|劵|条|箱 )";
|
|
|
+ Match unitMatch = Regex.Match(txt, unitPattern);
|
|
|
+ string unitNum = unitMatch.Success ? unitMatch.Groups[1].Value : "1";
|
|
|
+
|
|
|
+ if (!int.TryParse(unitNum, out unit))
|
|
|
+ {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ return unit;
|
|
|
+ }
|
|
|
private void DecompressZIPandRAR(string zipFile, string targetPath, string filename)
|
|
|
{
|
|
|
|
|
|
@@ -513,6 +619,8 @@ public partial class uploadFile : System.Web.UI.Page
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
private void Decompress(string GzipFile, string targetPath)
|
|
|
{
|
|
|
//string directoryName = Path.GetDirectoryName(targetPath + "\\") + "\\";
|