|
|
@@ -508,7 +508,15 @@ namespace SiteCore
|
|
|
|
|
|
List<string> list = new List<string>(acclist);
|
|
|
string buyer_nick = "";
|
|
|
- if ((trade.seller_memo.IndexOf("logo") != -1 || trade.seller_memo.IndexOf("LOGO") != -1))
|
|
|
+ //配件-80x80mm-200张-卡片-yxmrebekah-甘露
|
|
|
+ if (trade.seller_memo.StartsWith("配件-"))
|
|
|
+ {
|
|
|
+ if (list.Count > 4)
|
|
|
+ {
|
|
|
+ buyer_nick = list[4];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if ((trade.seller_memo.IndexOf("logo") != -1 || trade.seller_memo.IndexOf("LOGO") != -1))
|
|
|
{
|
|
|
if (list.Count > 3)
|
|
|
{
|
|
|
@@ -731,7 +739,7 @@ namespace SiteCore
|
|
|
{
|
|
|
order.spu_id = item.refSpuId;
|
|
|
}
|
|
|
- List<string> standards_list = new List<string>() { "现货", "封酒贴", "兔团团", "帆布", "手拉旗", "kt", "条幅", "臂贴","挂画" };
|
|
|
+ List<string> standards_list = new List<string>() { "现货", "封酒贴", "兔团团", "帆布", "手拉旗", "kt", "条幅", "臂贴", "挂画" };
|
|
|
bool isInList = false;
|
|
|
foreach (string text in standards_list)
|
|
|
{
|
|
|
@@ -1685,7 +1693,11 @@ namespace SiteCore
|
|
|
// createDianziCell(isMulity, orderIdx, item, father, ref hePrice, memoList.Length);
|
|
|
//}
|
|
|
//else
|
|
|
- if (item.IndexOf("logo") != -1 || item.IndexOf("LOGO") != -1)
|
|
|
+ if (item.StartsWith("配件-"))
|
|
|
+ {
|
|
|
+ createPJCell(isMulity, orderIdx, item, father, ref hePrice, memoList.Length);
|
|
|
+ }
|
|
|
+ else if (item.IndexOf("logo") != -1 || item.IndexOf("LOGO") != -1)
|
|
|
{
|
|
|
createLogoCell(isMulity, orderIdx, item, father, ref hePrice, memoList.Length);
|
|
|
}
|
|
|
@@ -1698,7 +1710,9 @@ namespace SiteCore
|
|
|
createSmallGiftCell(isMulity, orderIdx, item, father, ref hePrice, memoList.Length);
|
|
|
}
|
|
|
else
|
|
|
+ {
|
|
|
createNotHeBaoCell(isMulity, orderIdx, item, father, ref hePrice, memoList.Length);
|
|
|
+ }
|
|
|
orderIdx = orderIdx + 1;
|
|
|
}
|
|
|
}
|
|
|
@@ -2277,6 +2291,204 @@ namespace SiteCore
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public static void createPJCell(bool isMulty, int orderIndex, string itemMemo, CeErpTrade father, ref decimal hePrice, int totalCount)
|
|
|
+ {
|
|
|
+ if (itemMemo.Length <= 0) return;
|
|
|
+
|
|
|
+ string ctid = "";
|
|
|
+ string splitTag = "";
|
|
|
+ if (isMulty && itemMemo.Length > 2)
|
|
|
+ {
|
|
|
+ string preStr = "C" + orderIndex + "_";
|
|
|
+ ctid = preStr + father.tid;
|
|
|
+ splitTag = "C" + orderIndex;
|
|
|
+ }
|
|
|
+ else if (itemMemo.Length > 2)
|
|
|
+ {
|
|
|
+ ctid = father.tid;
|
|
|
+ }
|
|
|
+ CeErpTradeCell entity = null;
|
|
|
+ entity = CeErpTradeCell.GetByCtid(ctid);
|
|
|
+ bool isNull = false;
|
|
|
+ if (entity == null)
|
|
|
+ {
|
|
|
+ entity = new CeErpTradeCell();
|
|
|
+ isNull = true;
|
|
|
+ entity.ctid = ctid;
|
|
|
+ //唯一标识
|
|
|
+ entity.OrderSn = ctid;
|
|
|
+ string orderSn = commonHelper.generateDateTimeRandomNos();
|
|
|
+ if (orderSn != "")
|
|
|
+ {
|
|
|
+ entity.OrderSn = orderSn;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ entity.UpdateTime = DateTime.Now;
|
|
|
+ entity.tid = father.tid;
|
|
|
+ entity.SplitTag = splitTag;
|
|
|
+ if (entity.ShopId == 0)
|
|
|
+ {
|
|
|
+ CeErpShop nShop = CeErpShop.GetShopIdByName(father.seller_nick);
|
|
|
+ int shopId = 0;
|
|
|
+ if (nShop != null)
|
|
|
+ {
|
|
|
+ shopId = nShop.ID;
|
|
|
+ }
|
|
|
+ entity.ShopId = shopId;
|
|
|
+ }
|
|
|
+
|
|
|
+ entity.IsSample = 4;
|
|
|
+ entity.SupplierId = Convert.ToInt32(webConfig.SampleOrderSupplier);
|
|
|
+
|
|
|
+ entity.isDianziOrder = 0;
|
|
|
+
|
|
|
+ string[] acclist = itemMemo.Split('-');
|
|
|
+ //配件-80x80mm-200张-卡片-甘露
|
|
|
+ if (acclist.Length <= 4) return;
|
|
|
+ //string count = acclist[0];
|
|
|
+ string product = acclist[3];
|
|
|
+ string account = acclist[4];
|
|
|
+ DataRow cusInfo = getUserInfoByAccount(account);
|
|
|
+ if (cusInfo != null)
|
|
|
+ {
|
|
|
+ entity.CustomerUserId = Convert.ToInt32(cusInfo["ID"]);
|
|
|
+ if (entity.OrderState > 6)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ entity.OrderState = Convert.ToInt32(OrderState.设计完成);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ entity.ProductId = getProductIdByName(product);
|
|
|
+ if (entity.ProductId == 0)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isMulty)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ string strPrice = acclist[5];
|
|
|
+ if (strPrice.IndexOf("元") != -1)
|
|
|
+ {
|
|
|
+ strPrice = strPrice.Replace("元", "");
|
|
|
+ }
|
|
|
+ entity.payment = Convert.ToDouble(strPrice);
|
|
|
+ hePrice = hePrice - Convert.ToDecimal(strPrice);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ //XLog.SaveLog(0, "createDianziCell,payment=acclist[4]" + "|" + ex.Message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ entity.payment = Convert.ToDouble(father.payment);
|
|
|
+ entity.AfterSalePayment = Convert.ToDouble(father.payment);
|
|
|
+ }
|
|
|
+ string newmemo = "(" + entity.OrderSn + ")-";
|
|
|
+ string newOtherMemo = "";
|
|
|
+ List<string> list = new List<string>();
|
|
|
+ for (int i = 0; i < acclist.Length; i++)
|
|
|
+ {
|
|
|
+ //配件-80x80mm-200张-卡片-甘露
|
|
|
+ if (i == 4) continue;
|
|
|
+ if (isMulty)
|
|
|
+ {
|
|
|
+ if (i == 5) continue;
|
|
|
+ }
|
|
|
+ list.Add(acclist[i]);
|
|
|
+ }
|
|
|
+ newmemo += string.Join("-", list);
|
|
|
+ string sName = 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 (isMulty)
|
|
|
+ {
|
|
|
+ newmemo += "-[C" + totalCount + "+" + orderIndex + "]";
|
|
|
+ }
|
|
|
+ if (itemMemo.IndexOf("顺丰到付") != -1)
|
|
|
+ {
|
|
|
+ if (newmemo.IndexOf("顺丰到付") == -1)
|
|
|
+ newmemo += ("-顺丰到付");
|
|
|
+ entity.IsSF = 2;
|
|
|
+ LogHelper.addLog(entity.ctid, entity.CustomerUserId, "顺丰到付", entity.OrderState);
|
|
|
+ }
|
|
|
+ else if (itemMemo.IndexOf("顺丰寄付") != -1)
|
|
|
+ {
|
|
|
+ if (newmemo.IndexOf("顺丰寄付") == -1)
|
|
|
+ newmemo += ("-顺丰寄付");
|
|
|
+ entity.IsSF = 1;
|
|
|
+ LogHelper.addLog(entity.ctid, entity.CustomerUserId, "顺丰寄付", entity.OrderState);
|
|
|
+ }
|
|
|
+ if (itemMemo.IndexOf("加急") != -1)
|
|
|
+ {
|
|
|
+ if (newmemo.IndexOf("加急") == -1)
|
|
|
+ newmemo += ("-加急");
|
|
|
+ entity.IsUrgency = true;
|
|
|
+ LogHelper.addLog(entity.ctid, entity.CustomerUserId, "加急", entity.OrderState);
|
|
|
+ }
|
|
|
+ entity.seller_memo = newmemo;
|
|
|
+ entity.OtherMemo = newOtherMemo;
|
|
|
+ entity.pay_time = father.pay_time;
|
|
|
+ entity.DesignUserId = Convert.ToInt32(webConfig.PlaceDesigner_id); //下单员
|
|
|
+ LogHelper.addLog(entity.ctid, 0, "配件单指派到下单部" + entity.DesignUserId, entity.OrderState);
|
|
|
+ entity.FinishDesignTime = DateTime.Now;
|
|
|
+ entity.StartDesignTime = DateTime.Now;
|
|
|
+ entity.WaitDesignTime = DateTime.Now;
|
|
|
+ entity.IsOldCustomer = 0;
|
|
|
+ int oldRes = isOldAndInsertCustomerInfo(father, entity);
|
|
|
+ if (oldRes > 0)
|
|
|
+ {
|
|
|
+ entity.IsOldCustomer = 1;
|
|
|
+ if (oldRes == 2)
|
|
|
+ {
|
|
|
+ entity.IsOldCustomer = 1;
|
|
|
+ entity.IsOldCustomerMore = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1 || commonHelper.isFarAddress(father.receiver_state))
|
|
|
+ {
|
|
|
+ entity.OrderState = -1;
|
|
|
+ entity.DesignUserId = 0;
|
|
|
+ entity.WaitDesignTime = null;
|
|
|
+ }
|
|
|
+ if (entity.ProductId > 0)
|
|
|
+ {
|
|
|
+ CeErpProduct ceErpProduct = CeErpProduct.GetById(entity.ProductId);
|
|
|
+ if (ceErpProduct.CreateTime != null && DateTime.Compare(ceErpProduct.CreateTime, DateTime.Now.AddDays(-90)) > 0)
|
|
|
+ {
|
|
|
+ entity.NewProduct = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isNull)
|
|
|
+ {
|
|
|
+ father.create_time = DateTime.Now;
|
|
|
+ father.Update();
|
|
|
+ entity.Create();
|
|
|
+ CeErpTradeCellExtend.createInfo(entity.ctid, 10, 10);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ entity.Update();
|
|
|
+ }
|
|
|
+ //dataHelper.sendErpTradeCellInfo(new dataSendTradeCellBean(entity, father));
|
|
|
+ CeErpSukuraData.createInfo(entity.ctid, 1);
|
|
|
+ LogHelper.addLog(entity.ctid, entity.CustomerUserId, "配件推送生成" + entity.seller_memo, entity.OrderState);
|
|
|
+
|
|
|
+ }
|
|
|
public static void createDemoCell(bool isMulty, int orderIndex, string itemMemo, CeErpTrade father, ref decimal hePrice, int totalCount)
|
|
|
{
|
|
|
if (itemMemo.Length <= 0) return;
|