zhuyiyi před 6 měsíci
rodič
revize
135caf8c42

+ 34 - 1
SiteCore/Handler/sync.order.cs

@@ -3869,7 +3869,7 @@ namespace SiteCore.Handler
                 string needtids = string.Join(",", tLst.ToArray());
                 StringBuilder sql = new StringBuilder();
                 //sql.AppendFormat("update ce_erptradecell set IsVerifyToSupplier=1 where SupplierId!=0 and ctid in ({0});", needtids);
-                sql.AppendFormat("update ce_erptradecell set IsVerifyToSupplier=1,IsReturn=0,FinishPlaceTime=GETDATE(),PlaceUserId={1} where SupplierId!=0 and ctid in ({0});", needtids, CurrentUser.UserID);
+                sql.AppendFormat("update ce_erptradecell set IsVerifyToSupplier=1,IsReturn=0,FinishPlaceTime=GETDATE(),PlaceUserId={1},IsHaveNewOrder=0 where SupplierId!=0 and ctid in ({0});", needtids, CurrentUser.UserID);
                 sql.AppendFormat("insert into CE_ErpTradeLog(tid,UserId,Con,OperateTime) select ctid,{1},'审核给供应商',getdate() from ce_erptradecell where ctid in({0});", needtids, CurrentUser.UserID);
                 DbHelper.DbConn.ExecuteNonQuery(sql.ToString());
                 returnSuccessMsg("操作成功!");
@@ -3911,6 +3911,11 @@ namespace SiteCore.Handler
                 if (eid != "") entity = CeErpTradeCell.GetByCtid(eid);
                 if (entity != null)
                 {
+                    /*if (entity.IsHaveNewOrder == 2 && CurrentUser.UserPost.Post.Code != "SysAdmin")
+                    {
+                        returnErrorMsg("订单正在下载中无法退回!");
+                        return;
+                    }*/
                     if (CurrentUser.UserPost.Post.Code != "Supplier")//不是供应商打回
                     {
                         string key = "return_order_" + entity.SupplierId;
@@ -13714,6 +13719,34 @@ namespace SiteCore.Handler
             }
             returnErrorMsg("缺少必要的参数");
         }
+
+        public void checkSupplierOrder()
+        {
+            string ctids = GetPostString("ctids");
+            if (ctids != null)
+            {
+                List<string> list = new List<string>();
+                string sql = string.Format("SELECT ctid,seller_memo,OrderState,IsVerifyToSupplier FROM [dbo].[CE_ErpTradeCell] WHERE ctid in ({0});", "'" + ctids.Replace(",", "','") + "'");
+                DataTable dt = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
+                for (int i = 0; i < dt.Rows.Count; i++)
+                {
+                    DataRow row = dt.Rows[i];
+                    if (Convert.ToInt16(row["OrderState"]) == 6 && Convert.ToInt16(row["IsVerifyToSupplier"]) == 1)
+                    {
+                        continue;
+                    }
+                    list.Add(row["seller_memo"].ToString());
+                }
+                if (list.Count > 0)
+                {
+
+                    ReturnSuccess("{" + string.Format("\"data\":{0}", JsonConvert.SerializeObject(list)) + "}");
+                    return;
+                }
+            }
+            ReturnSuccess("{" + string.Format("\"data\":{0}", "[]") + "}");
+            return;
+        }
     }
 
 }

+ 1 - 1
SiteCore/taobao/commonHelper.cs

@@ -279,7 +279,7 @@ namespace SiteCore
                     //用昵称找之前的订单
                     string name = ceErpTrade.buyer_nick;
                     StringBuilder CeErpTradeSql = new StringBuilder();
-                    CeErpTradeSql.AppendFormat("select top 1 * from ce_erptrade o left join CE_ErpTradeCell c on c.tid=o.tid where o.buyer_nick='{0}' and o.tid <> '{1}' and c.SupplierId <> 35 AND c.SupplierId <> 33 order by created desc;", name, trade.tid);
+                    CeErpTradeSql.AppendFormat("select top 1 * from ce_erptrade o left join CE_ErpTradeCell c on c.tid=o.tid where o.buyer_nick='{0}' and o.tid <> '{1}' and c.SupplierId <> 35 AND c.SupplierId <> 33 and c.SupplierId > 0 order by created desc;", name, trade.tid);
                     DataSet data = DbHelper.DbConn.ExecuteDataset(CeErpTradeSql.ToString());
                     DataTable datatable = data.Tables[0];
 

+ 2 - 1
SiteCore/taobao/designHelper.cs

@@ -517,6 +517,7 @@ namespace SiteCore.Handler
             {
                 return result;
             }
+            return result;
             string post_url = pUrl + "discernOrder";
             System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; // 根据需要选择合适的协议版本
 
@@ -537,7 +538,7 @@ namespace SiteCore.Handler
             }
             catch (Exception ex)
             {
-                XLog.SaveLog(0, "API_refundOrder:" + ex.Message);
+                XLog.SaveLog(0, "discernOrder:" + ex.Message);
             }
             return result;
 

+ 5 - 0
SiteCore/taobao/tmcHelper.cs

@@ -4107,6 +4107,11 @@ namespace SiteCore
                     order.pic_path = item.picUrl;
                 order.num = Convert.ToDouble(item.num.ToString());
                 order.payment = Convert.ToDouble(item.price);
+                if (item.refSpuId != null && item.refSpuId != "")
+                {
+                    order.spu_id = item.refSpuId;
+
+                }
                 //order.adjust_fee = Convert.ToDouble(item.price);
 
                 if (item.refSkuId != null && item.standards != null && (item.standards.IndexOf("现货") != -1 || item.standards.IndexOf("封酒贴") != -1) && item.standards.IndexOf("定制") == -1)

+ 18 - 2
Web/EDelivery/js/SupplierOrder.js

@@ -79,7 +79,6 @@ function supplierBackFn(ctid) {
     //postAjax("upd_erp_supplierback", "ctid=" + ctid, function (data) {
     //    resultShow(data, "grid.reload();");
     //});   
-    console.log("1");
     var rec = grid.getSelected();
     if (rec != undefined && rec != "") {
         edit_id = rec.ctid;
@@ -226,7 +225,24 @@ function multiExport() {
         for (var i = 0; i < sels.length; i++) {
             pArr.push(sels[i].ctid);
         }
-        downOneFile(pArr);
+        postAjax("checkSupplierOrder", { ctids: pArr }, function (data) {
+            if (data.data.length > 0) {
+
+                let html = `<div style="text-align: center;font-size: 20px;">订单:<br/>${data.data.join("<br/>")}<br/>已被打回,请重新刷新后再选择下载!</div>`;
+                mini.showMessageBox({
+                    title: "提示!",
+                    iconCls: "mini-messagebox-question",
+                    maxWidth: 1200,
+                    maxHeight: 500,
+                    buttons: ["确认"],
+                    html,
+                    callback: function (action) { }
+                })
+
+            } else {
+                //downOneFile(pArr);
+            }
+        });
 
         //close_handler();
     } else {