zhuyiyi 4 月之前
父節點
當前提交
9304dd36c2
共有 3 個文件被更改,包括 19 次插入9 次删除
  1. 4 1
      SiteCore/Handler/sync.order.cs
  2. 0 3
      SiteCore/taobao/tmcHelper.cs
  3. 15 5
      ecomServer/MainForm.cs

文件差異過大導致無法顯示
+ 4 - 1
SiteCore/Handler/sync.order.cs


+ 0 - 3
SiteCore/taobao/tmcHelper.cs

@@ -730,9 +730,6 @@ namespace SiteCore
                     if (item.refSpuId != null && item.refSpuId != "")
                     {
                         order.spu_id = item.refSpuId;
-
-
-
                     }
 
                     if (item.refSkuId != null && item.standards != null && (item.standards.IndexOf("现货") != -1 || item.standards.IndexOf("封酒贴") != -1 || item.standards.IndexOf("兔团团") != -1 || item.standards.IndexOf("帆布") != -1 || item.standards.IndexOf("手拉旗") != -1 || item.standards.IndexOf("kt") != -1 || item.standards.IndexOf("条幅") != -1 || item.standards.IndexOf("#") != -1) && item.standards.IndexOf("定制") == -1)

+ 15 - 5
ecomServer/MainForm.cs

@@ -152,6 +152,7 @@ namespace ErpServer
         string dinggaolvSync = "";
         string unusualSync = "";
         string refundSync = "";
+        List<int> shop_list = new List<int>() { 5, 6, 8, 10, 11, 12, 14, 15, 16, 18, 24, 28, 31, 32, 56, 61, 126, 128 };
 
         private void MainForm_Load(object sender, EventArgs e)
         {
@@ -950,10 +951,12 @@ namespace ErpServer
                                     {
                                         continue;
                                     }
+                                    int[] uv_productIds = new int[] { 14, 43, 2487, 2531, 2654, 2656 };
+
                                     CeErpTrade ceErpTrade = CeErpTrade.Get(dr["tid"].ToString());
-                                    if (ceErpTrade != null && !string.IsNullOrEmpty(ceErpTrade.buyer_nick))
+                                    if ("normal".Equals(syncType) && ceErpTrade != null && !string.IsNullOrEmpty(ceErpTrade.buyer_nick) && shop_list.Contains(Convert.ToInt32(dr["shopid"])))
                                     {
-                                        string design_order_sql = string.Format("SELECT top 1 DesignUserId,DesignUserName,OnDuty,BeOnDuty FROM [dbo].[view_ErpTradeCell] WHERE (buyer_nick = '{0}' or buyer_id = '{1}' ) and seller_nick = '{2}' and DesignUserId > 0 order by pay_time desc;", ceErpTrade.buyer_nick, ceErpTrade.buyer_id, ceErpTrade.seller_nick);
+                                        string design_order_sql = string.Format("SELECT top 1 DesignUserId,DesignUserName,OnDuty,BeOnDuty,OldOrder FROM [dbo].[view_ErpTradeCell] WHERE (buyer_nick = '{0}' or buyer_id = '{1}' ) and seller_nick = '{2}' and DesignUserId > 0 order by pay_time desc;", ceErpTrade.buyer_nick, ceErpTrade.buyer_id, ceErpTrade.seller_nick);
                                         DataTable dataTable = SqlHelper.ExecuteDataset(design_order_sql).Tables[0];
                                         if (dataTable != null && dataTable.Rows != null && dataTable.Rows.Count > 0)
                                         {
@@ -963,13 +966,16 @@ namespace ErpServer
                                                 CeErpUser ceErpUser = CeErpUser.Get(designUserId);
                                                 int beOnDuty = Convert.IsDBNull(dataTable.Rows[0]["BeOnDuty"]) ? 0 : Convert.ToInt32(dataTable.Rows[0]["BeOnDuty"]);
                                                 int onduty = Convert.IsDBNull(dataTable.Rows[0]["OnDuty"]) ? 0 : Convert.ToInt32(dataTable.Rows[0]["OnDuty"]);
+                                                int oldOrder = Convert.IsDBNull(dataTable.Rows[0]["oldOrder"]) ? 0 : Convert.ToInt32(dataTable.Rows[0]["oldOrder"]);
+                                                int shopId = ceErpShop.ID;
                                                 string designUserName = Convert.IsDBNull(dataTable.Rows[0]["DesignUserName"]) ? "" : dataTable.Rows[0]["DesignUserName"].ToString();
                                                 List<string> desingList = ceErpUser.pemDesign.Split(',').ToList();
+                                                List<string> shopList = ceErpUser.pemShop.Split(',').ToList();
                                                 bool isOnline = false;
                                                 if (selfTime.Hour < 12)
                                                 {
                                                     if (beOnDuty != 2)
-                                                    {                                                                                                                                              
+                                                    {
                                                         isOnline = true;
                                                     }
                                                 }
@@ -991,8 +997,13 @@ namespace ErpServer
                                                 {
                                                     isOnline = true;
                                                 }
+                                                //老客户单子上个设计师不支持老客户 UV设计不用管
+                                                if ("1".Equals(IsOldCustomer) && oldOrder == 0 && !uv_productIds.Contains(ProductId))
+                                                {
+                                                    isOnline = false;
+                                                }
 
-                                                if (onduty > 0 && designUserId > 0 && desingList.Contains(ProductId.ToString()) && isOnline)//设计师在线
+                                                if (onduty > 0 && designUserId > 0 && desingList.Contains(ProductId.ToString()) && shopList.Contains(shopId.ToString()) && isOnline)//设计师在线
                                                 {
                                                     string update_sql = string.Format("update CE_ErpTradeCell set OrderState=3,IsAutoDispatch=1,WaitDesignTime=getdate(),UpdateTime=getdate(),DesignUserId={1},DispatchSort=0 where ctid='{0}' and OrderState=2; update view_ErpUser set DayOrderReceive=DayOrderReceive+1,DayOrderPer=CAST((CAST(((DayOrderReceive + 1)) as decimal(8,5))/DayOrderLimit) as decimal(8,3)) where id={1}; insert into CE_ErpTradeLog(tid,OrderState,UserId,OperateTime,Con) select ctid,OrderState,0,getdate(),'2自动派单:{2}'+CONVERT(varchar,{1}) from ce_erptradecell where ctid='{0}';", dr["ctid"].ToString(), designUserId, designUserName);
                                                     SqlHelper.ExecuteNonQuery(update_sql);
@@ -1002,7 +1013,6 @@ namespace ErpServer
                                             }
                                         }
                                     }
-                                    int[] uv_productIds = new int[] { 14, 43, 2487, 2531, 2654, 2656 };
                                     //指定店铺老客户和指定店铺单价500以上分给指定部门
                                     if (!uv_productIds.Contains(ProductId) && ((IsOldCustomer == "1" && userId == 241)))
                                     {

部分文件因文件數量過多而無法顯示