فهرست منبع

新增售前共创判断

zhuyiyi 5 ماه پیش
والد
کامیت
e35399de6b
5فایلهای تغییر یافته به همراه114 افزوده شده و 7 حذف شده
  1. 0 1
      SiteCore/LogHelper.cs
  2. 14 0
      SiteCore/taoObj/preToWhereVo.cs
  3. 9 5
      SiteCore/taobao/commonHelper.cs
  4. 90 0
      SiteCore/taobao/preSalesHelper.cs
  5. 1 1
      Web/EOrder/OrderList.aspx

+ 0 - 1
SiteCore/LogHelper.cs

@@ -48,7 +48,6 @@ namespace SiteCore
             log.tid = ctid;
             log.Con = con;
             log.Type = type;
-            log.AfterSaleBackReason = reason;
             log.AfterSaleBackImg = img;
             log.createdTime = DateTime.Now;
             log.Create();

+ 14 - 0
SiteCore/taoObj/preToWhereVo.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SiteCore.taoObj
+{
+    public class preToWhereVo
+    {
+        public string ctid { get; set; }
+        public string to { get; set; }
+    }
+}

+ 9 - 5
SiteCore/taobao/commonHelper.cs

@@ -1903,7 +1903,7 @@ namespace SiteCore
 
                 if (need_send && !has_design)
                 {
-                    string sql_pay = "update CE_ErpTradeCell with(rowlock) set DispatchSort=2 where tid='" + tid + "' AND OrderState < 5;";
+                    string sql_pay = "update CE_ErpTradeCell with(rowlock) set DispatchSort=2 where ctid='" + ctid + "' AND OrderState < 5;";
                     CeErpTradeCell.ExecuteNonQuery(sql_pay.ToString());
                     return new designApiResponseVo(200, "");
                 }
@@ -1924,6 +1924,10 @@ namespace SiteCore
             {
                 return new designApiResponseVo(-1, "订单无品类");
             }
+            if (ceErpTradeCell.ShopId == 0)
+            {
+                return new designApiResponseVo(-1, "订单无店铺");
+            }
 
             if (ceErpTradeCell.ProductId == 1797 && ceErpTradeCell.seller_memo.Contains("手绘"))
             {
@@ -1960,7 +1964,7 @@ namespace SiteCore
                 }
 
                 //卡片五款
-                if (products.IndexOf(ceErpTradeCell.ProductId) > -1 && ceErpTradeCell.ShopId > 0)
+                /*if (products.IndexOf(ceErpTradeCell.ProductId) > -1 && ceErpTradeCell.ShopId > 0)
                 {
                     bool num_bool = true;
                     bool size_bool = false;
@@ -1969,10 +1973,10 @@ namespace SiteCore
                     int num = 0;
                     if (shops.IndexOf(ceErpTradeCell.ShopId) == -1)//限制不是全品的店铺限制
                     {
-                        /*if (ceErpTradeCell.payment >= 500)
+                        *//*if (ceErpTradeCell.payment >= 500)
                         {
                             return new designApiResponseVo(-1, "订单价格超出");
-                        }*/
+                        }*//*
                         string pattern = @"\b(\d{1,5}[x\*]\d{1,5}(mm|cm))\b";
                         string memo = ceErpTradeCell.seller_memo.Replace("MM", "mm").Replace("CM", "cm");
                         Regex reg = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Multiline, TimeSpan.FromSeconds(2));//2秒后超时
@@ -2057,7 +2061,7 @@ namespace SiteCore
                             return new designApiResponseVo(-1, "尺寸小于90x90或款数小于2");
                         }
                     }
-                }
+                }*/
             }
             return new designApiResponseVo(200, "");
         }

+ 90 - 0
SiteCore/taobao/preSalesHelper.cs

@@ -16,6 +16,7 @@ using System.Data;
 using System.Linq;
 using System.Net;
 using System.Reflection;
+using System.Security.Cryptography;
 using System.Security.Cryptography.X509Certificates;
 using System.Text;
 using System.Threading.Tasks;
@@ -2498,6 +2499,95 @@ namespace SiteCore.Handler
             return;
         }
 
+        public void checkOrderToWhere()
+        {
+            if (UrlPostParmsCheck("data"))
+            {
+                string result = "内部";
+                string data = GetPostString("data");
+                Api_trade_info info = null;
+                try
+                {
+                    info = JsonConvert.DeserializeObject<Api_trade_info>(data);
+                }
+                catch (Exception ex)
+                {
+                    XLog.SaveLog(0, "checkOrderToWhere|1|" + ex.Message);
+                    returnErrorMsg(ex.Message);
+                    return;
+                }
+                if (info == null)
+                {
+                    XLog.SaveLog(0, "checkOrderToWhere Api_trade_info isNull");
+                    returnErrorMsg("接口对象处理错误Api_trade_info=null");
+                    return;
+                }
+
+                BizOrder bizOrder = info.bizOrder;
+                if (bizOrder == null)
+                {
+                    returnErrorMsg("接口对象处理错误bizOrder=null");
+                    return;
+                }
+                string none_wh = "内部";
+                List<string> none_list = new List<string>();
+                List<preToWhereVo> list = new List<preToWhereVo>();
+                foreach (Api_trade_info.bizOrderSplit item in bizOrder.bizOrderSplits)
+                {
+                    preToWhereVo preToWhereVo = new preToWhereVo();
+                    CeErpTradeCell ceErpTradeCell = new CeErpTradeCell();
+                    CeErpTradeCellExtend ceErpTradeCellExtend = new CeErpTradeCellExtend();
+                    preToWhereVo.ctid = item.splitNo;
+                    ceErpTradeCell.ctid = item.splitNo;
+                    ceErpTradeCell.seller_memo = item.systemRemark;
+                    ceErpTradeCell.OtherMemo = item.otherRemark;
+                    CeErpShop nShop = CeErpShop.GetShopIdByName(GetNull_tostring(bizOrder.openSellerNick));
+                    if (nShop != null)
+                    {
+                        ceErpTradeCell.ShopId = nShop.ID;
+                    }
+                    ceErpTradeCell.ProductId = tmcHelper.getProductIdByName(item.cate3Id);
+                    ceErpTradeCell.isDianziOrder = item.isDianziOrder;
+                    ceErpTradeCellExtend.spu_id = item.spuId;
+                    ceErpTradeCellExtend = commonHelper.sendSpuData(ceErpTradeCell, ceErpTradeCellExtend);
+                    if (ceErpTradeCellExtend != null)
+                    {
+                        if ("外协".Equals(ceErpTradeCellExtend.ToType))
+                        {
+                            result = "外协";
+                        }
+                        if ("内部".Equals(ceErpTradeCellExtend.ToType))
+                        {
+                            result = "内部";
+                        }
+                    }
+                    if (result == "无")
+                    {
+                        none_list.Add(ceErpTradeCell.ctid);
+                        designApiResponseVo designApiResponseVo = commonHelper.checkOrderDesignInfo(ceErpTradeCell, "");
+                        if (designApiResponseVo.code == 200)
+                        {
+                            result = none_wh = "外协";
+                        }
+                    }
+                    preToWhereVo.to = result;
+                    list.Add(preToWhereVo);
+                }
+                if ("外协".Equals(none_wh))
+                {
+                    foreach (preToWhereVo item in list)
+                    {
+                        if (none_list.Contains(item.ctid))
+                        {
+                            item.to = none_wh;
+                        }
+                    }
+                }
+                returnSuccess(JsonConvert.SerializeObject(list));
+                return;
+            }
+        }
+
         public static apiUploaderResponse CopyDesignFile(string ctid, string oldCtid, int userId)
         {
 

+ 1 - 1
Web/EOrder/OrderList.aspx

@@ -1039,7 +1039,7 @@
             for (let i = 0; i < list.length; i++) {
                 let data_row = list[i];
                 let { tid, seller_memo, number, memo, province, city, area, address, receiver, mobile } = list[i];
-                if (Object.keys(data_row).filter(value => { return data_row[value] == "" }).length == data_row.length) {
+                if (Object.keys(data_row).filter(value => { return data_row[value] == "" }).length == Object.keys(data_row).length) {
                     continue;
                 }
                 if (!tid || !seller_memo || !number || !province || !city || !area || !address || !receiver || !mobile) {