zhuyiyi 6 сар өмнө
parent
commit
38ad277d52

+ 36 - 10
SiteCore/Handler/sync.order.cs

@@ -45,6 +45,7 @@ using static SiteCore.taoObj.Api_waybill_code_response_Obj;
 using static SiteCore.taoObj.work_core_vo;
 using static System.Net.Mime.MediaTypeNames;
 using System.Runtime.Remoting.Metadata.W3cXsd2001;
+using NPOI.Util;
 
 namespace SiteCore.Handler
 {
@@ -3755,10 +3756,17 @@ namespace SiteCore.Handler
                 dStruct.PageSize = 200;
             }
             DataTable dt = WebCache.GetData("view_Waitorderlist", dStruct);
+            List<string> tids = new List<string>();
             if (dt != null)
             {
+                dt.Columns.Add("compenPrice", typeof(double));
                 foreach (DataRow dr in dt.Rows)
                 {
+                    if (Convert.IsDBNull(dr["compenPrice"]))
+                    {
+                        dr["compenPrice"] = 0;
+                    }
+                    tids.Add("'" + dr["tid"].ToString() + "'");
                     dr["receiver_address"] = dr["receiver_name"].ToString() + "   " + dr["receiver_mobile"].ToString() + "   " + dr["receiver_state"].ToString() + dr["receiver_city"].ToString() + dr["receiver_district"].ToString() + dr["receiver_address"].ToString();
                     if (Convert.IsDBNull(dr["SupplierId"]) || Convert.ToInt32(dr["SupplierId"]) == 0)
                     {
@@ -3771,6 +3779,24 @@ namespace SiteCore.Handler
                     }
                 }
             }
+            string sql = string.Format("select ptid,payment from CE_ErpTradeCell where ptid in (" + string.Join(",", tids) + ") and  IsSample = 2");
+            DataTable dt_price = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
+            if (dt_price != null && dt_price.Rows.Count > 0)
+            {
+
+                foreach (DataRow dr in dt_price.Rows)
+                {
+                    foreach (DataRow row in dt.Rows)
+                    {
+
+                        if (row["tid"].Equals(dr["ptid"]))
+                        {
+                            row["compenPrice"] = Convert.ToDouble(row["compenPrice"]) + Convert.ToDouble(dr["payment"]);
+                            break;
+                        }
+                    }
+                }
+            }
             writeGridDataTableJson(dStruct.TotalCount, dt);
         }
 
@@ -4400,11 +4426,11 @@ namespace SiteCore.Handler
                     if (tids.Count > 0 && tids.Count < 10)
                     {
                         tid_sql = string.Format("tid in ({0}) ", string.Join(",", tids));
-                        List<string> receiverIds = getReceiverIdByCtidLike(tids);
-                        if (receiverIds.Count > 0 && receiverIds.Count < 10)
-                        {
-                            tid_sql = string.Format("(tid in ({0}) or receiverId in ({1}))  ", string.Join(",", tids), string.Join(",", receiverIds));
-                        }
+                        /* List<string> receiverIds = getReceiverIdByCtidLike(tids);
+                         if (receiverIds.Count > 0 && receiverIds.Count < 10)
+                         {
+                             tid_sql = string.Format("(tid in ({0}) or receiverId in ({1}))  ", string.Join(",", tids), string.Join(",", receiverIds));
+                         }*/
                     }
                 }
 
@@ -4566,11 +4592,11 @@ namespace SiteCore.Handler
                     if (tids.Count > 0 && tids.Count < 10)
                     {
                         tid_sql = string.Format("tid in ({0}) ", string.Join(",", tids));
-                        List<string> receiverIds = getReceiverIdByCtidLike(tids);
-                        if (receiverIds.Count > 0 && receiverIds.Count < 10)
-                        {
-                            tid_sql = string.Format("(tid in ({0}) or receiverId in ({1}))  ", string.Join(",", tids), string.Join(",", receiverIds));
-                        }
+                        /* List<string> receiverIds = getReceiverIdByCtidLike(tids);
+                         if (receiverIds.Count > 0 && receiverIds.Count < 10)
+                         {
+                             tid_sql = string.Format("(tid in ({0}) or receiverId in ({1}))  ", string.Join(",", tids), string.Join(",", receiverIds));
+                         }*/
                     }
                 }
 

+ 1 - 0
Web/EDelivery/WaitingOrder.aspx

@@ -35,6 +35,7 @@
                 <div field="pay_time" width="80" align="center" headeralign="center" renderer="orderPTimeRenderer">付款时间</div>
                 <div field="SupplierName" width="60" align="center" headeralign="center">供应商</div>
                 <div field="payment" width="40" align="center" headeralign="center">金额</div>
+                <div field="compenPrice" width="80" align="center" headeralign="center">补差金额</div>
                 <div field="payment_cyt" width="80" align="center" headeralign="center">成本金额</div>
                 <div field="urgentCharge" width="40" align="center" headeralign="center">加急金额</div>
                 <div field="CustomerUserName" width="60" align="center" headeralign="center" renderer="orderCusRenderer">客服/设计</div>