From d1fb3b15bd3c63737cd43b1c552c9925760aae8a Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Fri, 3 Apr 2026 15:36:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplierBuildFile.aspx.cs | 2 +- supplierDownload.aspx.cs | 2 +- uploadFile.aspx.cs | 182 +++++++++++++++++++++++++++++++++++++- 3 files changed, 183 insertions(+), 3 deletions(-) diff --git a/supplierBuildFile.aspx.cs b/supplierBuildFile.aspx.cs index 3c8a292..68b1c01 100644 --- a/supplierBuildFile.aspx.cs +++ b/supplierBuildFile.aspx.cs @@ -169,6 +169,7 @@ public partial class supplierBuildFile : System.Web.UI.Page try { copyFile(getDesignDate(row["FinishDesignTime"]), suppierName, fname, zipFileName.Replace(".zip", "")); + writeLog("打包复制文件!" + zipFileName.Replace(".zip", "") + ":" + fname); files.Add(fname); supplierId = 0; tids.Add("'" + ctid + "'"); @@ -185,7 +186,6 @@ public partial class supplierBuildFile : System.Web.UI.Page if (files.Count == 0) { updateSql += string.Format("update CE_ErpPackData set upStatus = 3,message='没有可打包文件!' where ID= {0} ;", packId); - continue; } else { diff --git a/supplierDownload.aspx.cs b/supplierDownload.aspx.cs index fa3eb3b..d556e7d 100644 --- a/supplierDownload.aspx.cs +++ b/supplierDownload.aspx.cs @@ -278,7 +278,7 @@ public partial class supplierDownload : System.Web.UI.Page catch (Exception ex) { conErc("错误的下载访问" + ex.Message); - XLog.SaveLog(0, "download" + ex.Message); + XLog.SaveLog(0, "supplierDownload download" + ex.Message); return; } diff --git a/uploadFile.aspx.cs b/uploadFile.aspx.cs index 852c063..0c9855d 100644 --- a/uploadFile.aspx.cs +++ b/uploadFile.aspx.cs @@ -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 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();