Browse Source

新增自动退单

zhuyiyi 3 weeks ago
parent
commit
7e0a6523e5
2 changed files with 90 additions and 84 deletions
  1. 2 1
      supplierDownload.aspx.cs
  2. 88 83
      uploadFile.aspx.cs

+ 2 - 1
supplierDownload.aspx.cs

@@ -55,6 +55,7 @@ public partial class supplierDownload : System.Web.UI.Page
     {
         if (!IsPostBack)
         {
+
             Response.Buffer = true;
             downloadMore();
         }
@@ -359,7 +360,7 @@ public partial class supplierDownload : System.Web.UI.Page
 
     private string getDesignDate(object v)
     {
-        return DateTime.Now.ToString("yyyy-MM-dd");
+        return DateTime.Now.ToString("yyyy") + "\\" + DateTime.Now.ToString("MM") + "\\" + DateTime.Now.ToString("dd");
         /*if (v.ToString() == "") return "";
         return Convert.ToDateTime(v).ToString("yyyy-MM-dd");*/
     }

+ 88 - 83
uploadFile.aspx.cs

@@ -17,11 +17,8 @@ using System.Drawing.Imaging;
 using CorelDRAW;
 using System.Security.Principal;
 using System.Threading.Tasks;
-using System.Threading;
-using System.Runtime.InteropServices;
 using System.Data;
 using System.Text.RegularExpressions;
-using NHibernate.Mapping;
 
 public partial class uploadFile : System.Web.UI.Page
 {
@@ -247,6 +244,7 @@ public partial class uploadFile : System.Web.UI.Page
                     {
                         entity.MemoOpt = 0;
                     }
+
                     if (entity.payment < 500)
                     {
                         if (entity.seller_memo.Contains("插卡") && entity.ProductCount != null && !entity.seller_memo.Contains("S_"))
@@ -266,108 +264,116 @@ public partial class uploadFile : System.Web.UI.Page
                         }
 
                     }
-                    if (entity.payment <= 300 && num >= 200 && num <= 3000 && entity.ShopId != 14 && entity.ShopId != 99)
+                    if (!entity.seller_memo.Contains("出货"))
                     {
-                        //300克铜板纸/铜版纸300克-覆哑膜/覆膜/不覆膜-直角/裁切
-                        if (!entity.seller_memo.Contains("opp") && !entity.seller_memo.Contains("按文件") && !entity.seller_memo.Contains("流苏"))
+                        if (entity.payment <= 300 && num >= 200 && num <= 3000 && entity.ShopId != 14 && entity.ShopId != 99)
                         {
-                            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("不覆膜")))
+                            //300克铜板纸/铜版纸300克-覆哑膜/覆膜/不覆膜-直角/裁切
+                            if (!entity.seller_memo.Contains("opp") && !entity.seller_memo.Contains("按文件") && !entity.seller_memo.Contains("流苏") && !entity.seller_memo.Contains("排序"))
                             {
-                                entity.IsVerifyToSupplier = true;
-                                entity.SupplierId = 14;
-                                entity.FinishPlaceTime = DateTime.Now;
+                                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 (entity.payment <= 100 && num > 500 && num <= 1500)
                         {
-                            if (matches[0].Success)
+                            //数量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
                             {
-                                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)
+                                if (matches[0].Success)
                                 {
-                                    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;
+                                    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;
+                                    }
+                                    if (width < 30 || height < 30)
+                                    {
+                                        isIn = false;
+                                    }
                                 }
 
                             }
+                            catch (Exception ex)
+                            {
 
-                        }
-                        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 (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("透明不干胶"))
+                        if (entity.payment <= 500 && num > 200 && num <= 5000)
                         {
-                            entity.IsVerifyToSupplier = true;
-                            entity.SupplierId = 64;
-                            entity.FinishPlaceTime = DateTime.Now;
+                            //数量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("覆哑膜"))
+                        if (entity.payment <= 100 && num > 200 && num <= 1000)
                         {
-                            entity.IsVerifyToSupplier = true;
-                            entity.SupplierId = 64;
-                            entity.FinishPlaceTime = DateTime.Now;
+                            //数量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("领淘户外写真海报"))
+                        if (entity.payment <= 500 && num > 0 && num <= 50)
                         {
-                            entity.IsVerifyToSupplier = true;
-                            entity.SupplierId = 59;
-                            entity.FinishPlaceTime = DateTime.Now;
+                            //数量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("净裁"))))
+                        if (entity.payment <= 500 && num > 0 && num <= 50)
                         {
-                            entity.IsVerifyToSupplier = true;
-                            entity.SupplierId = 90;
-                            entity.FinishPlaceTime = DateTime.Now;
+                            //数量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;
@@ -380,7 +386,6 @@ public partial class uploadFile : System.Web.UI.Page
                         entity.SupplierId = 98;
                         entity.FinishPlaceTime = DateTime.Now;
                     }
-
                     string dPath = entity.FinishDesignTime.GetValueOrDefault().ToString("yyyyMMdd");
                     //XLog.SaveLog(5, dPath);
                     string sPath = Path.Combine(upPath, dPath);