|
@@ -2158,17 +2158,17 @@ namespace SiteCore
|
|
|
|
|
|
|
|
public static void sendCytExpress(CeErpExpressInfo exinfo)
|
|
public static void sendCytExpress(CeErpExpressInfo exinfo)
|
|
|
{
|
|
{
|
|
|
|
|
+ if (exinfo == null)
|
|
|
|
|
+ {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(exinfo.tid);
|
|
|
|
|
+ if (ceErpTradeCell == null)
|
|
|
|
|
+ {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
- if (exinfo == null)
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(exinfo.tid);
|
|
|
|
|
- if (ceErpTradeCell == null)
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
JObject jsonObject12 = new JObject
|
|
JObject jsonObject12 = new JObject
|
|
|
{
|
|
{
|
|
|
{ "Userid",cytUserId },
|
|
{ "Userid",cytUserId },
|
|
@@ -2185,7 +2185,7 @@ namespace SiteCore
|
|
|
}
|
|
}
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
|
{
|
|
{
|
|
|
- LogHelper.addLog(exinfo.tid, 0, "CYT打单推送:" + ex.ToString());
|
|
|
|
|
|
|
+ LogHelper.addLog(exinfo.tid, 0, "CYT打单推送:" + ceErpTradeCell.OrderSn + "," + ceErpTradeCell.ctid + "," + exinfo.out_sid + "," + exinfo.company_name + "," + ex.ToString());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -3191,6 +3191,10 @@ namespace SiteCore
|
|
|
if (ceErpTrade.payment > 20)
|
|
if (ceErpTrade.payment > 20)
|
|
|
{
|
|
{
|
|
|
string sql = string.Format("SELECT count(*) as number FROM [dbo].[view_ErpTradeCell] WITH(NOLOCK) WHERE (buyer_nick = '{0}' or buyer_id = '{1}' ) and status = 'COMPLETE' and seller_nick = '{2}' and tid <> '{3}' AND end_time < '{4}' and IsSample = 0 and payment >= 20", ceErpTrade.buyer_nick, ceErpTrade.buyer_id, ceErpTrade.seller_nick, ceErpTrade.tid, ceErpTrade.pay_time);
|
|
string sql = string.Format("SELECT count(*) as number FROM [dbo].[view_ErpTradeCell] WITH(NOLOCK) WHERE (buyer_nick = '{0}' or buyer_id = '{1}' ) and status = 'COMPLETE' and seller_nick = '{2}' and tid <> '{3}' AND end_time < '{4}' and IsSample = 0 and payment >= 20", ceErpTrade.buyer_nick, ceErpTrade.buyer_id, ceErpTrade.seller_nick, ceErpTrade.tid, ceErpTrade.pay_time);
|
|
|
|
|
+ if (string.IsNullOrEmpty(ceErpTrade.buyer_nick))
|
|
|
|
|
+ {
|
|
|
|
|
+ sql = string.Format("SELECT tid FROM [dbo].[CE_ErpTrade] WITH(NOLOCK) WHERE (buyer_id = '{1}' ) and status = 'COMPLETE' and seller_nick = '{2}' and tid <> '{3}' AND end_time < '{4}' and payment >= 20", ceErpTrade.buyer_nick, ceErpTrade.buyer_id, ceErpTrade.seller_nick, ceErpTrade.tid, ceErpTrade.pay_time);
|
|
|
|
|
+ }
|
|
|
DataTable dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
|
|
DataTable dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
|
|
|
if (dataTable != null && dataTable.Rows.Count > 0)
|
|
if (dataTable != null && dataTable.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
@@ -3207,5 +3211,38 @@ namespace SiteCore
|
|
|
|
|
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public static string getProductCount(string txt)
|
|
|
|
|
+ {
|
|
|
|
|
+ txt = txt.Replace(",", ",");
|
|
|
|
|
+ string[] txtList = txt.Split(',');
|
|
|
|
|
+ int total = 0;
|
|
|
|
|
+ for (int i = 0; i < txtList.Length; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ string kuanPattern = @"(\d+)(?=款)";
|
|
|
|
|
+ Match kuanMatch = Regex.Match(txtList[i], kuanPattern);
|
|
|
|
|
+ string kuanNum = kuanMatch.Success ? kuanMatch.Groups[1].Value : "1";
|
|
|
|
|
+
|
|
|
|
|
+ // 提取"个"或"张"前面的数字
|
|
|
|
|
+ string unitPattern = @"(\d+)(?=个|张|本|套|件 )";
|
|
|
|
|
+ Match unitMatch = Regex.Match(txtList[i], unitPattern);
|
|
|
|
|
+ string unitNum = unitMatch.Success ? unitMatch.Groups[1].Value : "1";
|
|
|
|
|
+ int kuan = 1;
|
|
|
|
|
+ int unit = 1;
|
|
|
|
|
+ if (!int.TryParse(kuanNum, out kuan))
|
|
|
|
|
+ {
|
|
|
|
|
+ return txt;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!int.TryParse(unitNum, out unit))
|
|
|
|
|
+ {
|
|
|
|
|
+ return txt;
|
|
|
|
|
+ }
|
|
|
|
|
+ total += kuan * unit;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return (total).ToString();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|