|
|
@@ -23,6 +23,9 @@ using NHibernate.Loader.Custom;
|
|
|
using System.Runtime.Remoting.Metadata.W3cXsd2001;
|
|
|
using NPOI.OpenXmlFormats.Shared;
|
|
|
using static SiteCore.taoObj.work_core_vo;
|
|
|
+using System.Linq;
|
|
|
+using NHibernate.Mapping;
|
|
|
+using System.Reflection.Emit;
|
|
|
|
|
|
namespace SiteCore
|
|
|
{
|
|
|
@@ -1758,6 +1761,80 @@ namespace SiteCore
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public static void getuserId()
|
|
|
+ {
|
|
|
+ string createtime = "2024-01-22 13:50:39.000";
|
|
|
+ string textContent = "";
|
|
|
+ int row_num = 100;
|
|
|
+ Dictionary<string, List<string>> shop_userNick = new Dictionary<string, List<string>>();
|
|
|
+ while (row_num == 100)
|
|
|
+ {
|
|
|
+ string conSql = string.Format("SELECT TOP 100 posCode, buyer_nick,pay_time FROM [dbo].[CE_ErpTrade] WHERE pay_time > '{0}' AND ( buyer_id IS NULL OR buyer_id = '' ) AND posCode != '' AND buyer_nick != '' ORDER By pay_time ASC", createtime);
|
|
|
+ DataTable table = DbHelper.DbConn.ExecuteDataset(conSql).Tables[0];
|
|
|
+ if (table != null)
|
|
|
+ {
|
|
|
+ row_num = table.Rows.Count;
|
|
|
+ foreach (DataRow row in table.Rows)
|
|
|
+ {
|
|
|
+ string posCode = row["posCode"].ToString();
|
|
|
+ string buyer_nick = row["buyer_nick"].ToString();
|
|
|
+ createtime = row["pay_time"].ToString();
|
|
|
+ List<string> userNickName = new List<string>();
|
|
|
+ if (shop_userNick.ContainsKey(posCode))
|
|
|
+ {
|
|
|
+ shop_userNick.TryGetValue(posCode, out userNickName);
|
|
|
+ }
|
|
|
+ userNickName.Add(buyer_nick);
|
|
|
+ userNickName = userNickName.Distinct().ToList();
|
|
|
+ if (userNickName.Count == 10)
|
|
|
+ {
|
|
|
+ sendApi(posCode, userNickName);
|
|
|
+ userNickName = new List<string>();
|
|
|
+ }
|
|
|
+ if (shop_userNick.ContainsKey(posCode))
|
|
|
+ {
|
|
|
+ shop_userNick[posCode] = userNickName;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ shop_userNick.Add(posCode, userNickName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ foreach (string key in shop_userNick.Keys)
|
|
|
+ {
|
|
|
+ List<string> nameList = shop_userNick[key];
|
|
|
+ sendApi(key, nameList);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ static void sendApi(string posCode, List<string> userNickName)
|
|
|
+ {
|
|
|
+ string textContent = "";
|
|
|
+ List<api_userId_response.ContentItem> buyerIds = apiHelper.API_GetUserId(posCode, string.Join(",", userNickName));
|
|
|
+ if (buyerIds != null && buyerIds.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (api_userId_response.ContentItem item in buyerIds)
|
|
|
+ {
|
|
|
+ if (item != null && !string.IsNullOrEmpty(item.buyerOpenUid))
|
|
|
+ {
|
|
|
+ textContent += string.Format("update [dbo].[CE_ErpTrade] set buyer_id='{2}' WHERE posCode='{0}' and buyer_nick='{1}';\r\n", posCode, item.buyerNick, item.buyerOpenUid);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ try
|
|
|
+ {
|
|
|
+ StreamWriter fs = new StreamWriter("C:/Users/231010/Desktop/updateSql.txt", true);
|
|
|
+ fs.WriteLine(textContent);
|
|
|
+ fs.Close();
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
public static designApiResponseVo checkOrderListDesignInfo(string tid)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(tid))
|
|
|
@@ -1802,6 +1879,7 @@ namespace SiteCore
|
|
|
return new designApiResponseVo(-1, check_info);
|
|
|
}
|
|
|
static List<int> products = new List<int>() { 29, 2489, 2517, 2518, 2519, 2520, 2533, 2534, 2558, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2583, 2584, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2634, 2644, 2645, 2646, 2648, 2649, 2650 };
|
|
|
+ static List<int> shops = new List<int>() { 2, 77, 121, 122, 65, 87, 26, 45, 17, 21, 52, 54, 103, 107, 108, 109, 118, 63, 64, 66, 49, 67, 105, 35, 57, 29, 53, 62 };
|
|
|
public static designApiResponseVo checkOrderDesignInfo(CeErpTradeCell ceErpTradeCell, string post = "")
|
|
|
{
|
|
|
if (ceErpTradeCell.DispatchSort == 2)
|
|
|
@@ -1855,105 +1933,105 @@ namespace SiteCore
|
|
|
int min_num = 2;
|
|
|
|
|
|
int num = 0;
|
|
|
- /*if (a < 15)//限制不是全品的店铺限制
|
|
|
- {*/
|
|
|
- /*if (ceErpTradeCell.payment >= 500)
|
|
|
- {
|
|
|
- return new designApiResponseVo(-1, "订单价格超出");
|
|
|
- }*/
|
|
|
- string pattern = @"\b(\d{1,5}[x\*]\d{1,5}(mm|cm))\b";
|
|
|
- string memo = ceErpTradeCell.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 = 90;
|
|
|
- double min_height = 90;
|
|
|
- double width = 0;
|
|
|
- double height = 0;
|
|
|
- try
|
|
|
+ if (shops.IndexOf(ceErpTradeCell.ShopId) == -1)//限制不是全品的店铺限制
|
|
|
{
|
|
|
- num = matches.Count;
|
|
|
- foreach (System.Text.RegularExpressions.Match match in matches)
|
|
|
+ /*if (ceErpTradeCell.payment >= 500)
|
|
|
+ {
|
|
|
+ return new designApiResponseVo(-1, "订单价格超出");
|
|
|
+ }*/
|
|
|
+ string pattern = @"\b(\d{1,5}[x\*]\d{1,5}(mm|cm))\b";
|
|
|
+ string memo = ceErpTradeCell.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 = 90;
|
|
|
+ double min_height = 90;
|
|
|
+ double width = 0;
|
|
|
+ double height = 0;
|
|
|
+ try
|
|
|
{
|
|
|
- if (match.Success)
|
|
|
+ num = matches.Count;
|
|
|
+ foreach (System.Text.RegularExpressions.Match match in matches)
|
|
|
{
|
|
|
- size = match.Groups[0].Value;
|
|
|
- if (size.Contains("cm"))
|
|
|
+ if (match.Success)
|
|
|
{
|
|
|
- size = size.Replace("cm", "");
|
|
|
- string[] size_list = size.Split('x');
|
|
|
- if (size_list.Length > 1)
|
|
|
+ size = match.Groups[0].Value;
|
|
|
+ if (size.Contains("cm"))
|
|
|
{
|
|
|
- width = Convert.ToDouble(size_list[0]) * 10;
|
|
|
- height = Convert.ToDouble(size_list[1]) * 10;
|
|
|
+ size = size.Replace("cm", "");
|
|
|
+ string[] size_list = size.Split('x');
|
|
|
+ if (size_list.Length > 1)
|
|
|
+ {
|
|
|
+ width = Convert.ToDouble(size_list[0]) * 10;
|
|
|
+ height = Convert.ToDouble(size_list[1]) * 10;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- else if (size.Contains("mm"))
|
|
|
- {
|
|
|
- size = size.Replace("mm", "");
|
|
|
- string[] size_list = size.Split('x');
|
|
|
- if (size_list.Length > 1)
|
|
|
+ else if (size.Contains("mm"))
|
|
|
{
|
|
|
- width = Convert.ToDouble(size_list[0]);
|
|
|
- height = Convert.ToDouble(size_list[1]);
|
|
|
+ size = size.Replace("mm", "");
|
|
|
+ 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)
|
|
|
- {
|
|
|
- size_bool = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- size_bool = false;
|
|
|
+ if (width >= min_width && height >= min_height && height >= min_width && width >= min_height)
|
|
|
+ {
|
|
|
+ size_bool = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ size_bool = false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- if (ceErpTradeCell.seller_memo.Contains("刮刮"))
|
|
|
- {
|
|
|
- num = Math.Max(num - 1, 1);
|
|
|
- }
|
|
|
- pattern = @"(\d+)款";
|
|
|
- matches = Regex.Matches(ceErpTradeCell.seller_memo, pattern);
|
|
|
- try
|
|
|
- {
|
|
|
- num = Math.Max(num - matches.Count, 0);
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
|
|
|
- foreach (System.Text.RegularExpressions.Match match in matches)
|
|
|
+ }
|
|
|
+ if (ceErpTradeCell.seller_memo.Contains("刮刮"))
|
|
|
+ {
|
|
|
+ num = Math.Max(num - 1, 1);
|
|
|
+ }
|
|
|
+ pattern = @"(\d+)款";
|
|
|
+ matches = Regex.Matches(ceErpTradeCell.seller_memo, pattern);
|
|
|
+ try
|
|
|
{
|
|
|
- if (match.Success)
|
|
|
+ num = Math.Max(num - matches.Count, 0);
|
|
|
+
|
|
|
+ foreach (System.Text.RegularExpressions.Match match in matches)
|
|
|
{
|
|
|
- num += Convert.ToInt32(match.Groups[1].Value);
|
|
|
- break;
|
|
|
+ if (match.Success)
|
|
|
+ {
|
|
|
+ num += Convert.ToInt32(match.Groups[1].Value);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
|
|
|
- }
|
|
|
- //2款不进
|
|
|
- if (num < min_num)
|
|
|
- {
|
|
|
- num_bool = false;
|
|
|
- }
|
|
|
+ }
|
|
|
+ //2款不进
|
|
|
+ if (num < min_num)
|
|
|
+ {
|
|
|
+ num_bool = false;
|
|
|
+ }
|
|
|
|
|
|
- if (!num_bool && !size_bool)
|
|
|
- {
|
|
|
- return new designApiResponseVo(-1, "尺寸小于90x90或款数小于2");
|
|
|
+ if (!num_bool && !size_bool)
|
|
|
+ {
|
|
|
+ return new designApiResponseVo(-1, "尺寸小于90x90或款数小于2");
|
|
|
+ }
|
|
|
}
|
|
|
- /*}*/
|
|
|
}
|
|
|
}
|
|
|
return new designApiResponseVo(200, "");
|
|
|
}
|
|
|
-
|
|
|
+ private static string cytUserId = "77886";
|
|
|
public static void sendCytAfterSale(CeErpTradeCell entity)
|
|
|
{
|
|
|
try
|
|
|
@@ -1979,7 +2057,7 @@ namespace SiteCore
|
|
|
}
|
|
|
JObject jsonObject12 = new JObject
|
|
|
{
|
|
|
- { "Userid", "77886" },
|
|
|
+ { "Userid",cytUserId },
|
|
|
//{ "pwd", "lt666888" },
|
|
|
{ "LTOrderId", entity.ctid },
|
|
|
{ "RefundType", refund_type },
|
|
|
@@ -2008,6 +2086,33 @@ namespace SiteCore
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public static void sendCytExpress(CeErpExpressInfo exinfo)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (exinfo == null)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JObject jsonObject12 = new JObject
|
|
|
+ {
|
|
|
+ { "Userid",cytUserId },
|
|
|
+ //{ "pwd", "lt666888" },
|
|
|
+ { "LTOrderId", exinfo.tid },
|
|
|
+ { "CourierNumber", exinfo.out_sid },
|
|
|
+ { "ExpressCompanyName", exinfo.company_name }
|
|
|
+ };
|
|
|
+ string response1 = HttpPost("http://www.kiy.cn/webapi/Himall.NewShop.UpdOrderExpress", jsonObject12.ToString());
|
|
|
+ JObject jsonObjects1 = JObject.Parse(response1);
|
|
|
+ string msg = (string)jsonObjects1["msg"];
|
|
|
+ LogHelper.addLog(exinfo.tid, 0, "CYT售后单推送:" + msg);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ LogHelper.addLog(exinfo.tid, 0, "CYT售后单推送:" + ex.ToString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static void getCytPrice(CeErpTradeCell entity)
|
|
|
{
|
|
|
try
|
|
|
@@ -2022,7 +2127,7 @@ namespace SiteCore
|
|
|
{
|
|
|
JObject jsonObject12 = new JObject
|
|
|
{
|
|
|
- { "UserId", "77886" },
|
|
|
+ { "UserId", cytUserId },
|
|
|
{ "Pwd", "lt666888" },
|
|
|
{ "Filename", entity.seller_memo }
|
|
|
};
|
|
|
@@ -2058,7 +2163,7 @@ namespace SiteCore
|
|
|
|
|
|
JObject jsonObject = new JObject
|
|
|
{
|
|
|
- { "UserId", "77886" },
|
|
|
+ { "UserId", cytUserId },
|
|
|
{ "Pwd", "lt666888" },
|
|
|
{ "Filename", chanp }
|
|
|
};
|