|
@@ -3244,5 +3244,269 @@ namespace SiteCore
|
|
|
|
|
|
|
|
return (total).ToString();
|
|
return (total).ToString();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public static string convertQNMemo(string itemMemo, ref CeErpTradeCell entity)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (string.IsNullOrEmpty(itemMemo))
|
|
|
|
|
+ {
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+ CeErpTrade father = CeErpTrade.Get(entity.tid);
|
|
|
|
|
+ //删除备注中的旺旺
|
|
|
|
|
+ if (father.type == "TMALL" || father.type == "TB")
|
|
|
|
|
+ {
|
|
|
|
|
+ string[] memoList = itemMemo.Split('-');
|
|
|
|
|
+
|
|
|
|
|
+ List<string> list = new List<string>(memoList);
|
|
|
|
|
+ string buyer_nick = "";
|
|
|
|
|
+ if ((itemMemo.IndexOf("logo") != -1 || itemMemo.IndexOf("LOGO") != -1))
|
|
|
|
|
+ {
|
|
|
|
|
+ if (list.Count > 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ buyer_nick = list[3];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (itemMemo.IndexOf("补差") != -1 && list.Count < 6)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (list.Count > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ buyer_nick = list[1];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (itemMemo.IndexOf("默拍单") != -1 && list.Count < 6)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (list.Count > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ buyer_nick = list[1];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (itemMemo.IndexOf("寄样") != -1)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (list.Count > 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ buyer_nick = list[3];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (itemMemo.IndexOf("拿样订单") != -1)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (list.Count > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ buyer_nick = list[1];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (itemMemo.IndexOf("礼物") != -1 && list.Count < 6)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (list.Count > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ buyer_nick = list[1];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (list.Count > 5)
|
|
|
|
|
+ {
|
|
|
|
|
+ buyer_nick = list[5];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ itemMemo = string.Join("-", list);
|
|
|
|
|
+ itemMemo = itemMemo.Replace("-" + buyer_nick, string.Empty);
|
|
|
|
|
+ }
|
|
|
|
|
+ itemMemo = itemMemo.Replace("\r", " ");
|
|
|
|
|
+ itemMemo = itemMemo.Replace("\n", " ");
|
|
|
|
|
+ string[] acclist = itemMemo.Split('-');
|
|
|
|
|
+ string newmemo = "";
|
|
|
|
|
+
|
|
|
|
|
+ if (itemMemo.Contains("logo") || itemMemo.Contains("LOGO"))
|
|
|
|
|
+ {
|
|
|
|
|
+ if (acclist.Length < 4) return null;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ string count = acclist[0];
|
|
|
|
|
+ string product = acclist[1];
|
|
|
|
|
+ string account = acclist[3];
|
|
|
|
|
+ DataRow cusInfo = tmcHelper.getUserInfoByAccount(account); //客服id
|
|
|
|
|
+
|
|
|
|
|
+ entity.ProductId = tmcHelper.getProductIdByName("logo");
|
|
|
|
|
+
|
|
|
|
|
+ entity.ProductCount = commonHelper.getProductCount(count);// commonHelper.changeCountFromChiness(count); ;
|
|
|
|
|
+
|
|
|
|
|
+ newmemo = "(" + entity.OrderSn + ")-";
|
|
|
|
|
+ string newOtherMemo = "";
|
|
|
|
|
+ for (int i = 0; i < acclist.Length; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (i == 3) continue;
|
|
|
|
|
+ if (i >= 4)
|
|
|
|
|
+ {
|
|
|
|
|
+ newOtherMemo += acclist[i];
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ newmemo += acclist[i];
|
|
|
|
|
+
|
|
|
|
|
+ if (i < acclist.Length - 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ newmemo += "-";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ string sName = tmcHelper.getShopSNameByName(father.seller_nick);//获取店铺简称
|
|
|
|
|
+ newmemo += ("-" + sName);
|
|
|
|
|
+ if (father.buyer_nick.IndexOf("*") < 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ newmemo += ("-" + father.buyer_nick);
|
|
|
|
|
+ }
|
|
|
|
|
+ newmemo += ("-" + father.receiver_state);
|
|
|
|
|
+ if (cusInfo != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ newmemo += ("-" + Convert.ToString(cusInfo["Tb"]));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ entity.seller_memo = newmemo;
|
|
|
|
|
+ entity.OtherMemo = newOtherMemo;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ bool isXianhuo = false;
|
|
|
|
|
+ if (acclist[0] == "现货")
|
|
|
|
|
+ {
|
|
|
|
|
+ isXianhuo = true;
|
|
|
|
|
+ System.Array.Copy(acclist, 1, acclist, 0, acclist.Length - 1);
|
|
|
|
|
+ System.Array.Resize(ref acclist, acclist.Length - 1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (acclist.Length < 6)
|
|
|
|
|
+ {
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ string size = acclist[0];
|
|
|
|
|
+ string count = acclist[1];
|
|
|
|
|
+ bool isBuGanJiao = false;
|
|
|
|
|
+ string product = "";
|
|
|
|
|
+ string mt = "", ct = "";
|
|
|
|
|
+ string account = "";
|
|
|
|
|
+
|
|
|
|
|
+ itemMemo = itemMemo.Replace("PVC", "pvc");
|
|
|
|
|
+ if ((acclist[3] == "不干胶" || itemMemo.IndexOf("电子稿") != -1 || itemMemo.IndexOf("pvc卡片") != -1 || itemMemo.IndexOf("海报") != -1) && itemMemo.IndexOf("礼物") == -1)
|
|
|
|
|
+ {
|
|
|
|
|
+ isBuGanJiao = true;
|
|
|
|
|
+ product = acclist[3];
|
|
|
|
|
+ mt = acclist[2];
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ product = acclist[2];
|
|
|
|
|
+ mt = acclist[3];
|
|
|
|
|
+ }
|
|
|
|
|
+ account = acclist[5];
|
|
|
|
|
+ ct = acclist[4];
|
|
|
|
|
+
|
|
|
|
|
+ if (acclist.Length >= 7)
|
|
|
|
|
+ {
|
|
|
|
|
+ acclist[6] = acclist[6].Replace("(", "");
|
|
|
|
|
+ acclist[6] = acclist[6].Replace(")", "");
|
|
|
|
|
+ acclist[6] = acclist[6].Replace("(", "");
|
|
|
|
|
+ acclist[6] = acclist[6].Replace(")", "");
|
|
|
|
|
+ entity.MakeSupplier = acclist[6];
|
|
|
|
|
+ acclist[6] = "(" + acclist[6] + ")";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ entity.ProductId = tmcHelper.getProductIdByName(product);
|
|
|
|
|
+ if (entity.ProductId == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+ DataRow cusInfo = tmcHelper.getUserInfoByAccount(account); //客服id
|
|
|
|
|
+ if (cusInfo != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ entity.CustomerUserId = Convert.ToInt32(cusInfo["ID"]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (mt.IndexOf("铜板纸") != -1)
|
|
|
|
|
+ {
|
|
|
|
|
+ mt = mt.Replace("铜板纸", "铜版纸");
|
|
|
|
|
+ }
|
|
|
|
|
+ entity.Material = mt;
|
|
|
|
|
+ entity.ProductSize = size;
|
|
|
|
|
+ entity.ProductCount = getProductCount(count); ;//commonHelper.changeCountFromChiness(count);
|
|
|
|
|
+ entity.Craft = ct;
|
|
|
|
|
+ newmemo = "(" + entity.OrderSn + ")-";
|
|
|
|
|
+ if (isXianhuo)
|
|
|
|
|
+ {
|
|
|
|
|
+ newmemo += "现货-";
|
|
|
|
|
+ }
|
|
|
|
|
+ string newOtherMemo = "";
|
|
|
|
|
+ bool isMulity = true;
|
|
|
|
|
+ if (string.IsNullOrEmpty(entity.SplitTag))
|
|
|
|
|
+ {
|
|
|
|
|
+ isMulity = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (acclist.Length >= 7 && !isMulity)
|
|
|
|
|
+ {
|
|
|
|
|
+ newmemo += acclist[6];
|
|
|
|
|
+ newmemo += "-";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isMulity && acclist.Length >= 8)
|
|
|
|
|
+ {
|
|
|
|
|
+ newmemo += acclist[7];
|
|
|
|
|
+ newmemo += "-";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < acclist.Length; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ if ((isMulity && i == 6) || i == 5)
|
|
|
|
|
+ {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ((i >= 7 && !isMulity) || (isMulity && i >= 8))
|
|
|
|
|
+ {
|
|
|
|
|
+ newOtherMemo += acclist[i];
|
|
|
|
|
+ newOtherMemo += "-";
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if ((i == 6 && !isMulity) || (isMulity && i == 7))
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ continue;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ newmemo += acclist[i];
|
|
|
|
|
+ if (i != 2 && i != 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ newmemo += "-";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ string sName = tmcHelper.getShopSNameByName(father.seller_nick);//获取店铺简称
|
|
|
|
|
+ newmemo += (sName);
|
|
|
|
|
+ if (father.buyer_nick.IndexOf("*") < 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ newmemo += ("-" + father.buyer_nick);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ newmemo += ("-" + father.receiver_state);
|
|
|
|
|
+ if (cusInfo != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ newmemo += ("-" + Convert.ToString(cusInfo["Tb"]));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!string.IsNullOrEmpty(entity.SplitTag))
|
|
|
|
|
+ {
|
|
|
|
|
+ newmemo += "-[" + entity.SplitTag + "]";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ newmemo = newmemo.Replace("\n", " ");
|
|
|
|
|
+
|
|
|
|
|
+ entity.seller_memo = newmemo;
|
|
|
|
|
+ entity.OtherMemo = newOtherMemo;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return newmemo;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|