|
|
@@ -228,6 +228,49 @@ namespace SiteCore.Handler
|
|
|
}
|
|
|
if (entity != null)
|
|
|
{
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string[] cpCodeList = cpCode.Split(',');
|
|
|
+ if (cpCodeList.Length > 1)
|
|
|
+ {
|
|
|
+ string newCpCode = "";
|
|
|
+ //拼多多
|
|
|
+ if (entity.tid.Contains("-"))
|
|
|
+ {
|
|
|
+ if (cpCodeList[0].Contains("PDD") || cpCodeList[0].Contains("pdd"))
|
|
|
+ {
|
|
|
+ newCpCode = cpCodeList[0];
|
|
|
+ }
|
|
|
+ if (cpCodeList[1].Contains("PDD") || cpCodeList[1].Contains("pdd"))
|
|
|
+ {
|
|
|
+ newCpCode = cpCodeList[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (!cpCodeList[0].Contains("PDD") && !cpCodeList[0].Contains("pdd"))
|
|
|
+ {
|
|
|
+ newCpCode = cpCodeList[0];
|
|
|
+ }
|
|
|
+ if (!cpCodeList[1].Contains("PDD") && !cpCodeList[1].Contains("pdd"))
|
|
|
+ {
|
|
|
+ newCpCode = cpCodeList[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (string.IsNullOrEmpty(newCpCode))
|
|
|
+ {
|
|
|
+ returnErrorMsg("快递编码错误");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ cpCode = newCpCode;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ XLog.SaveLog(0, "解析快递编码错误" + e);
|
|
|
+ returnErrorMsg("解析快递编码错误");
|
|
|
+ return;
|
|
|
+ }
|
|
|
CeErpTrade mainEn = CeErpTrade.Get(entity.tid);
|
|
|
string posCode = mainEn.posCode;
|
|
|
|