修改买手单号状态

This commit is contained in:
wule committed 2026-06-27 00:11:07 +08:00
1 parent 1e27c0b1e1
commit adde7e6fca
22 files changed
+6451 -514

No files matched your search

+26 -1
View File
@@ -22,7 +22,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\KJD Cef138\Bin\</OutputPath>
<OutputPath>..\Bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
@@ -80,6 +80,31 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.6.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.8.6\lib\net40\BouncyCastle.Crypto.dll</HintPath>
+41 -2
View File
@@ -8,6 +8,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
@@ -21,7 +22,7 @@ namespace AllBase
/// 版本ID
/// </summary>
public static int VersionCount = 100;
public static int VersionCount = 109;
public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
public static string DebugUrl { get; set; } = "http://localhost:9000";
@@ -631,6 +632,17 @@ namespace AllBase
return (int)(time - startTime).TotalSeconds;
}
/// <summary>
/// C#格式时间转换为Unix时间戳(毫秒)
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
public static long DateTimeToTimestampMilliseconds(DateTime time)
{
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
return (long)(time - startTime).TotalMilliseconds;
}
/// <summary>
/// 计算字节长度
/// </summary>
@@ -756,6 +768,29 @@ namespace AllBase
return Convert.ToInt64(BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(Encoding.Default.GetBytes(url)), 4, 8).Replace("-", ""), 16);
}
/// <summary>
/// 获取文件MD5值
/// </summary>
/// <param name="FilePath"></param>
/// <returns></returns>
public static string GetFileMd5(string FilePath)
{
try
{
FileStream get_file = new FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.Read);
System.Security.Cryptography.MD5CryptoServiceProvider get_md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] hash_byte = get_md5.ComputeHash(get_file);
string resule = System.BitConverter.ToString(hash_byte);
resule = resule.Replace("-", "");
get_file.Close();
return resule;
}
catch (Exception e)
{
return e.ToString();
}
}
/// <summary>
/// 签名算法
/// </summary>
@@ -812,6 +847,11 @@ namespace AllBase
return LoginApiUrl + "index.php?obj=" + BaseClass.MainPath + "/" + file;
}
public static string BuildDefaultObjString(string file, bool IsLoginDef = false)
{
return LoginApiUrl + "/" + file + "?obj=" + "/" + file;
}
public static string Build29WxObjString(string file, bool IsLoginDef = false)
{
return LoginApiUrl + "/wxxd_" + file + "?obj=" + BaseClass.MainPath + "/wxxd_" + file;
@@ -842,7 +882,6 @@ namespace AllBase
}
return word;
}
}
public class KeyValueBase
+139
View File
@@ -6,6 +6,7 @@
*/
using System;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
@@ -639,6 +640,144 @@ namespace AllBase
return temp;
}
/// <summary>
/// 获取字符串值,多个参数,返回第一个匹配的
/// </summary>
/// <param name="html"></param>
/// <param name="reg"></param>
/// <returns></returns>
public static string GetStringJsonByRegs(ref string html, string defaultValue, params string[] regs)
{
foreach (var reg in regs)
{
string temp = GetMatchRegexString(html, @"[""]" + reg + @"[""][\s]*:[\s]*[""]([^""]+?)[""]");
if (temp != null)
return temp;
temp = GetMatchRegexString(html, @"[""]" + reg + @"[""][\s]*:[\s]*[""]([^""]*?)[""]");
if (temp != null)
return temp;
temp = GetMatchRegexString(html, @"[']" + reg + @"['][\s]*:[\s]*[']([^']*?)[']");
if (temp != null)
return temp;
temp = GetMatchRegexString(html, @"['""]" + reg + @"['""][\s]*:[\s]*([\d]+)");
if (temp != null)
return temp;
}
return defaultValue;
}
public static string GetOneJsonObjStrJson(ref string html, string reg)
{
return GetJsonObjStrJson(ref html, reg).FirstOrDefault();
}
public static System.Collections.Generic.List<string> GetJsonObjStrJson(ref string html, string reg, int level = 0)
{
var startTime = DateTime.Now;
System.Collections.Generic.List<string> rstLst = new System.Collections.Generic.List<string>();
if (html == null)
return rstLst;
string htmlTmp = html.Replace("\\{", "\\这里是正花括号占位符").Replace("\\}", "\\这里是反花括号占位符").Replace("\"" + reg + "\": {", "\"" + reg + "\":{");
retry:
string lvStr = "";
if (level == 1)
{
lvStr += "\"";
}
var index1 = htmlTmp.IndexOf("\"" + reg + "\":" + lvStr + "{");
if (index1 < 0)
return rstLst;
htmlTmp = htmlTmp.Substring(index1 + ("\"" + reg + "\":" + lvStr + "{").Length - 1);
// 括号计数
int braceNum = 0;
//string rst = "{";
//while (htmlTmp.Length > 0)
for (int i = 0; i < htmlTmp.Length; i++)
{
//rst += htmlTmp.Substring(0, 1);
//if (htmlTmp.StartsWith("{"))
// braceNum++;
//else if (htmlTmp.StartsWith("}"))
// braceNum--;
if (htmlTmp[i] == '{')
braceNum++;
else if (htmlTmp[i] == '}')
braceNum--;
//htmlTmp = htmlTmp.Substring(1);
if (braceNum == 0)
{
var endTime1 = DateTime.Now;
if ((endTime1 - startTime).TotalSeconds > 1)
{
}
rstLst.Add(htmlTmp.Substring(0, i + 1).Replace("\\这里是正花括号占位符", "\\{").Replace("\\这里是反花括号占位符", "\\}"));
htmlTmp = htmlTmp.Substring(i + 1);
//rstLst.Add(rst.Replace("\\这里是正花括号占位符", "\\{").Replace("\\这里是反花括号占位符", "\\}"));
break;
}
// 循环完了还没结果返回空列表
if (i == htmlTmp.Length - 1)
return rstLst;
}
if (htmlTmp.Length > 0)
goto retry;
var endTime2 = DateTime.Now;
if ((endTime2 - startTime).TotalSeconds > 1)
{
}
return rstLst;
}
public static System.Collections.Generic.List<string> GetJsonArrStrJson(ref string html, string reg)
{
var startTime = DateTime.Now;
System.Collections.Generic.List<string> rstLst = new System.Collections.Generic.List<string>();
if (html == null)
return rstLst;
string htmlTmp = html.Replace("\\[", "\\这里是正方括号占位符").Replace("\\]", "\\这里是反方括号占位符").Replace("\"" + reg + "\": [", "\"" + reg + "\":[");
retry:
var index1 = htmlTmp.IndexOf("\"" + reg + "\":[");
if (index1 < 0)
return rstLst;
htmlTmp = htmlTmp.Substring(index1 + ("\"" + reg + "\":[").Length);
// 括号计数
int braceNum = 1;
string rst = "[";
while (htmlTmp.Length > 0)
{
rst += htmlTmp.Substring(0, 1);
if (htmlTmp.StartsWith("["))
braceNum++;
else if (htmlTmp.StartsWith("]"))
braceNum--;
htmlTmp = htmlTmp.Substring(1);
if (braceNum == 0)
{
rstLst.Add(rst.Replace("\\这里是正方括号占位符", "\\[").Replace("\\这里是反方括号占位符", "\\]"));
break;
}
}
if (htmlTmp.Length > 0)
goto retry;
var endTime = DateTime.Now;
if ((endTime - startTime).TotalSeconds > 1)
{
}
return rstLst;
}
/// <summary>
/// 获取值
/// </summary>
@@ -22,6 +22,26 @@ namespace AllBase.Model.Local
public string buyer_account { get; set; }
public int? out_amount { get; set; }
public string purchaser_note { get; set; }
public string express_1_company { get; set; }
public string express_1_waybill { get; set; }
public string express_2_company { get; set; }
public string express_2_waybill { get; set; }
public string refund_status { get; set; }
public DateTime pickup_time { get; set; }
/// <summary>
/// 中转仓状态:0 未使用,1 已创建,2 创建失败
/// </summary>
public int? transfer_warehouse_status { get; set; }
public string raw_message { get; set; }
public DateTime created_time { get; set; }
public DateTime updated_time { get; set; }
public string platform { get; set; }
public string order_platform_code { get; set; }
public string order_code { get; set; }
/// <summary>
/// 1正常取号 2提前取号
/// </summary>
public int? pre_allocated_order_no { get; set; }
}
}
+161 -20
View File
@@ -1,4 +1,8 @@
using System;
using AllBase.Model.Local;
using AllBase.Model.MvvmBaseClasses;
using NaiBa.Util.Extension;
using NaiBa.Util.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -6,19 +10,13 @@ using System.Threading.Tasks;
namespace AllBase.Model.Result
{
public class PddBuyerOrderLiteInfo
public class PddBuyerOrderLiteInfo : PropertyNotifyObject
{
//平台快递编码 微信快递名称 PDD
//EMS EMS 邮政快递包裹
//EMS EMS 邮政电商标快
//JTSD 极兔速递 极兔速递
//STO 申通快递 申通快递
//YD 韵达速递 韵达快递
//YTO 圆通速递 圆通快递
//ZTO 中通快递 中通快递
//BTWL 百世快运
//HTKY 百世快递
/// <summary>
/// 获取中转仓物流公司编码
/// </summary>
/// <param name="expressCompanyName"></param>
/// <returns></returns>
public static string GetPddToTransitWarehouseExpressCompanyCode(string expressCompanyName)
{
if (expressCompanyName == null || expressCompanyName == "") return "";
@@ -37,14 +35,24 @@ namespace AllBase.Model.Result
if (expressCompanyName.Contains("京东大件物流")) return "JDKD";
if (expressCompanyName.Contains("极兔速递")) return "JTSD";
if (expressCompanyName.Contains("极兔快递")) return "JTSD";
return "";
//SF 顺丰 //EMS 邮政快递 //YTO 圆通 //ZTO 中通 //HTKY 百世 //STO 申通 //YUNDA 韵达 //JDKD 京东快递 //JTSD 极兔
return "OTHER";
//SF 顺丰 //EMS 邮政快递 //YTO 圆通 //ZTO 中通 //HTKY 百世 //STO 申通 //YUNDA 韵达 //JDKD 京东快递 //JTSD 极兔
}
// 微信快递编码
//平台快递编码 微信快递名称 PDD
//EMS EMS 邮政快递包裹
//EMS EMS 邮政电商标快
//JTSD 极兔速递 极兔速递
//STO 申通快递 申通快递
//YD 韵达速递 韵达快递
//YTO 圆通速递 圆通快递
//ZTO 中通快递 中通快递
//BTWL 百世快运
//HTKY 百世快递
public static string GetPddToWxExpressCompanyCode(string expressCompanyName)
{
if (expressCompanyName == null || expressCompanyName == "") return "";
@@ -86,13 +94,137 @@ namespace AllBase.Model.Result
if (expressCompanyName.Contains("其他快递")) return "OTHER";
return "";
}
public string ShopOrderIdStr
{
get { return this.GetValue(x => x.ShopOrderIdStr); }
set { this.SetValue(x => x.ShopOrderIdStr, value); }
}
public string ShopOrderSkuIdStr
{
get { return this.GetValue(x => x.ShopOrderSkuIdStr); }
set { this.SetValue(x => x.ShopOrderSkuIdStr, value); }
}
public string ShopOrderSkuNameStr
{
get { return this.GetValue(x => x.ShopOrderSkuNameStr); }
set { this.SetValue(x => x.ShopOrderSkuNameStr, value); }
}
public string TransitWarehouseIdStr
{
get { return this.GetValue(x => x.TransitWarehouseIdStr); }
set { this.SetValue(x => x.TransitWarehouseIdStr, value); }
}
// 拍单物流
public string Express1CompanyStr
{
get { return this.GetValue(x => x.Express1CompanyStr); }
set { this.SetValue(x => x.Express1CompanyStr, value); }
}
public string Express1WaybillStr
{
get { return this.GetValue(x => x.Express1WaybillStr); }
set { this.SetValue(x => x.Express1WaybillStr, value); }
}
// 中转仓物流
public string Express2CompanyStr
{
get { return this.GetValue(x => x.Express2CompanyStr); }
set { this.SetValue(x => x.Express2CompanyStr, value); }
}
public string Express2WaybillStr
{
get { return this.GetValue(x => x.Express2WaybillStr); }
set { this.SetValue(x => x.Express2WaybillStr, value); }
}
/// <summary>
/// 中转仓状态:0 未使用,1 已创建,2 创建失败 ?3 已提交创建
/// </summary>
public string TransferWareHouseStatus
{
get { return this.GetValue(x => x.TransferWareHouseStatus); }
set { this.SetValue(x => x.TransferWareHouseStatus, value); }
}
/// <summary>
/// 1正常取号 2提前取号
/// </summary>
public string PreAllocatedOrderNoStr
{
get { return this.GetValue(x => x.PreAllocatedOrderNoStr); }
set { this.SetValue(x => x.PreAllocatedOrderNoStr, value); }
}
public string TransitOrderStatus
{
get
{
if ((TransferWareHouseStatus == "1" || TransferWareHouseStatus == "3") &&
//Express1CompanyStr == this.outExpressCompanyCode && !this.outExpressCompanyCode.IsNullOrEmpty() &&
Express1WaybillStr == this.tracking_number && !this.tracking_number.IsNullOrEmpty())
{
return "已取号";
}
if (string.IsNullOrEmpty(Express1CompanyStr) && string.IsNullOrEmpty(Express1WaybillStr) &&
!string.IsNullOrEmpty(Express2CompanyStr) && !string.IsNullOrEmpty(Express2WaybillStr))
{
return "提前取号";
}
if (/*!string.IsNullOrEmpty(Express1CompanyStr) && Express1CompanyStr != this.outExpressCompanyCode && !this.outExpressCompanyCode.IsNullOrEmpty() &&*/
!string.IsNullOrEmpty(Express1WaybillStr) && Express1WaybillStr != this.tracking_number && !this.tracking_number.IsNullOrEmpty())
{
return "提前取号";
}
if ((TransferWareHouseStatus == "1" || TransferWareHouseStatus == "3") && (string.IsNullOrEmpty(Express1CompanyStr) || string.IsNullOrEmpty(Express1WaybillStr)))
{
return "提前取号";
}
if (TransferWareHouseStatus == "0" && !string.IsNullOrEmpty(Express1CompanyStr) && Express1CompanyStr == outExpressCompanyCode &&
!string.IsNullOrEmpty(Express1WaybillStr) && Express1WaybillStr == tracking_number)
{
return "已提交";
}
if (TransferWareHouseStatus == "2" && !string.IsNullOrEmpty(Express1CompanyStr) && Express1CompanyStr == outExpressCompanyCode &&
!string.IsNullOrEmpty(Express1WaybillStr) && Express1WaybillStr == tracking_number)
{
return "取号失败";
}
return "";
}
set { }
}
public string OrderTimeStr
{
get { return BaseClass.StampToDateTime(order_time.ParseToInt()).ToString("yy-MM-dd HH:mm:ss"); }
set { }
}
/// <summary>
/// 商品信息
/// </summary>
public string ProdInfoStr
{
get { return order_Goods == null ? "" : string.Join("\r\n", order_Goods.Select(g => g.goods_name + " x" + g.goods_number)); }
set { }
}
public decimal AmoutValue
{
get { return order_amount.ParseToInt() * 0.01m; }
set { }
}
public string outExpressCompanyMsg { get; set; } // 物流公司名称,可以尝试直接从列表中匹配
/// <summary>
/// 中转仓物流公司编码
/// </summary>
public string outExpressCompanyCode
{
get
{
return GetPddToWxExpressCompanyCode(outExpressCompanyName);
//return GetPddToWxExpressCompanyCode(outExpressCompanyName);
return GetPddToTransitWarehouseExpressCompanyCode(outExpressCompanyName);
}
}
public string outExpressCompanyName
@@ -120,14 +252,20 @@ namespace AllBase.Model.Result
return "物流名称获取失败";
}
}
public string sendStatus { get; set; } = "";
public string sendStatus
{
get { return this.GetValue(x => x.sendStatus); }
set { this.SetValue(x => x.sendStatus, value); }
}
/// <summary>
/// 微信退款单状态
/// </summary>
public string wxRefundStatus { get; set; } = "";
public string buyerId { get; set; } // 买手Id
public string buyerName { get; set; } // 买手名称
/// <summary>
/// 买手订单号
/// </summary>
public string order_sn { get; set; } // "260409-440915730042665",
public string parent_order_sn { get; set; } // "",
public int? order_amount { get; set; } // 2090,
@@ -136,6 +274,9 @@ namespace AllBase.Model.Result
public int? service_amount { get; set; } // 0,
public string display_amount { get; set; } // 2090 实付款
public long? order_time { get; set; } // 1775731637
/// <summary>
/// 物流单号
/// </summary>
public string tracking_number { get; set; } // "JT5474027114111", 物流单号
public string order_link_url { get; set; } // "order.html?order_sn=260408-386657164922665&page_from=1",