|
|
@@ -19,6 +19,9 @@ using System.Security.Principal;
|
|
|
using System.Threading.Tasks;
|
|
|
using System.Data;
|
|
|
using System.Text.RegularExpressions;
|
|
|
+using MSharp.Framework;
|
|
|
+using System.Net.Http.Headers;
|
|
|
+using System.Net.Http;
|
|
|
|
|
|
public partial class uploadFile : System.Web.UI.Page
|
|
|
{
|
|
|
@@ -76,7 +79,6 @@ public partial class uploadFile : System.Web.UI.Page
|
|
|
// return;
|
|
|
//}
|
|
|
//CeErpTradeCell.GetByCtid("1717009344450030601");
|
|
|
-
|
|
|
if (Request.Files.Count < 1)
|
|
|
{
|
|
|
conErc("空文件!");
|
|
|
@@ -102,7 +104,7 @@ public partial class uploadFile : System.Web.UI.Page
|
|
|
MatchCollection nameMatches = nameReg.Matches(file_name);//设定要查找的字符串
|
|
|
if (nameMatches.Count > 0)
|
|
|
{
|
|
|
- foreach (System.Text.RegularExpressions.Match match in nameMatches)
|
|
|
+ foreach (Match match in nameMatches)
|
|
|
{
|
|
|
file_name = file_name.Replace(match.Value, "");
|
|
|
}
|
|
|
@@ -264,7 +266,8 @@ public partial class uploadFile : System.Web.UI.Page
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- if (!entity.seller_memo.Contains("出货"))
|
|
|
+ string patterns = "出货|加急|顺丰|打印|专版|当天发";
|
|
|
+ if (!Regex.IsMatch(entity.seller_memo, patterns) && string.IsNullOrEmpty(entity.OtherMemo) && !entity.ctid.Contains("S_"))
|
|
|
{
|
|
|
if (entity.payment <= 300 && num >= 200 && num <= 3000 && entity.ShopId != 14 && entity.ShopId != 99)
|
|
|
{
|
|
|
@@ -420,7 +423,9 @@ public partial class uploadFile : System.Web.UI.Page
|
|
|
entity.Update();
|
|
|
//CeErpTradeCell.UpdateRelationOrder(entity);
|
|
|
CeErpTradeCell.UpdateRelationOrder(entity.ctid);
|
|
|
-
|
|
|
+ CeErpProduct product = CeErpProduct.GetById(entity.ProductId);
|
|
|
+ string param = "[{ \"product_type\": \"" + product.PType + "\", \"remark\": \"" + entity.seller_memo + "\" }]";
|
|
|
+ sysHttpClient(param);
|
|
|
CeErpTradeLog.AddLog(entity.ctid, entity.OrderState, userId, "上传设计文件-" + saveFile);
|
|
|
if (ctid.IndexOf("S_") >= -1)
|
|
|
{
|
|
|
@@ -622,8 +627,41 @@ public partial class uploadFile : System.Web.UI.Page
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public void sysHttpClient(string param)
|
|
|
+ {
|
|
|
+ Task.Run(async () =>
|
|
|
+ {
|
|
|
+ var client = new HttpClient();
|
|
|
+ var request = new HttpRequestMessage
|
|
|
+ {
|
|
|
+ Method = HttpMethod.Post,
|
|
|
+ RequestUri = new Uri("http://47.122.57.102:11004/quotations/batch"),
|
|
|
+ Content = new StringContent(param)
|
|
|
+ {
|
|
|
+ Headers =
|
|
|
+ {
|
|
|
+ ContentType = new MediaTypeHeaderValue("application/json")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var task = Task.Run(() =>
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var response = client.SendAsync(request).Result;
|
|
|
+ response.EnsureSuccessStatusCode();
|
|
|
+ return response.Content.ReadAsStringAsync().Result;
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
|
|
|
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
private void Decompress(string GzipFile, string targetPath)
|
|
|
{
|
|
|
//string directoryName = Path.GetDirectoryName(targetPath + "\\") + "\\";
|