zhuyiyi 7 сар өмнө
parent
commit
1ebfb223dd

+ 5 - 0
BizCom/Dao/CeErpTradeCell.cs

@@ -1050,6 +1050,11 @@ namespace BizCom
         /// </summary>
         [Property]
         public DateTime? UpdateTime { get; set; }
+        /// <summary>
+        /// 查货完成时间
+        /// </summary>
+        [Property]
+        public DateTime? CheckedOrderTime { get; set; }
 
         public static CeErpTradeCell GetByTid(string tid)
         {

+ 38 - 6
SiteCore/Handler/sync.order.cs

@@ -57,7 +57,7 @@ namespace SiteCore.Handler
 
             string poscode = CurrentUser.UserPost.Post.Code;
             DataStruct dStruct = GetPostStruct();
-            //jiemiUtils.ossFileDecrypt("C:\\Users\\231010\\Downloads\\店铺.xlsx");
+            //jiemiUtils.ossFileDecrypt("C:\\Users\\231010\\Downloads\\CE_ErpProduct(3).xlsx");
             //apiHelper.Api_SyncOrderByTime("598825");
             //apiHelper.API_GetWaybill("ZTO-CAINIAO-TZJK", "4233447147588233939");
             //apiHelper.Api_SyacOrder("2460143282114312263", "yujia");
@@ -7331,6 +7331,7 @@ namespace SiteCore.Handler
                             newentity.CheckMemo = "";
                             newentity.OutSid = "";
                             newentity.CheckOrderTime = null;
+                            newentity.MemoOpt = 0;
                             LogHelper.addLog(newentity.ctid, CurrentUser.UserID, "售后处理生成:" + newMemo, entity.OrderState, 1);
                         }
                         newentity.isAfterSaleOrder = 1;
@@ -12899,13 +12900,11 @@ namespace SiteCore.Handler
 
                     string result = designHelper.API_CheckOrderTo(ceErpTradeCellExtend.ctid, ceErpTradeCellExtend.spu_id, ceErpTradeCell.ShopId);
                     ceErpTradeCellExtend.ToType = result;
-                    List<int> products = new List<int>() { 4, 13, 19, 24, 28, 32, 40, 51, 57, 1971, 2319, 2377, 2521, 2524, 2533, 2538, 2542, 2554, 2556, 2557, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2568, 2569, 2570, 2571, 2572, 2619, 2625, 2634, 2636, 2637, 2638, 2645, 2646 };
-                    List<int> shopIds = new List<int>() { 5, 6, 8, 10, 11, 12, 14, 15, 16, 18, 24, 27, 28, 31, 32, 56, 61 };
-                    if (products.Contains(ceErpTradeCell.ProductId) || ceErpTradeCell.seller_memo.IndexOf("手绘") > -1 || ceErpTradeCell.seller_memo.IndexOf("电子稿") > -1 || ceErpTradeCell.isDianziOrder > 0)
+                    if (commonHelper.spu_products.Contains(ceErpTradeCell.ProductId) || ceErpTradeCell.seller_memo.IndexOf("手绘") > -1 || ceErpTradeCell.seller_memo.IndexOf("电子稿") > -1 || ceErpTradeCell.isDianziOrder > 0)
                     {
                         ceErpTradeCellExtend.ToType = "外协";
                     }
-                    if ((ceErpTradeCell.seller_memo.Contains("改稿") || ceErpTradeCell.OtherMemo.Contains("改稿")) && shopIds.Contains(ceErpTradeCell.ShopId))
+                    if ((ceErpTradeCell.seller_memo.Contains("改稿") || ceErpTradeCell.OtherMemo.Contains("改稿")) && commonHelper.spu_shopIds.Contains(ceErpTradeCell.ShopId) && !commonHelper.spu_oldProducts.Contains(ceErpTradeCell.ProductId))
                     {
                         ceErpTradeCellExtend.ToType = "内部";
                     }
@@ -13560,8 +13559,9 @@ namespace SiteCore.Handler
                     returnErrorMsg("单次下载次数不能超过20个");
                     return;
                 }
+                string textCtids = "'" + ctids.Replace(",", "','") + "'";
                 StringBuilder sql = new StringBuilder();
-                sql.AppendFormat("select ctid,OrderState,SupplierId from CE_ErpTradeCell where ctid in ({0})", "'" + ctids.Replace(",", "','") + "'");
+                sql.AppendFormat("select ctid,OrderState,SupplierId from CE_ErpTradeCell where ctid in ({0})", textCtids);
                 DataTable dt = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0];
                 int supplierId = 0;
                 StringBuilder insterSql = new StringBuilder();
@@ -13598,12 +13598,44 @@ namespace SiteCore.Handler
                     string inSql = string.Format(insterSql.ToString(), ceErpPackData.ID);
                     DbHelper.DbConn.ExecuteNonQuery(inSql);
                 }
+                //DbHelper.DbConn.ExecuteNonQuery(string.Format("update CE_ErpTradeCell set OrderState=6,IsVerifyToSupplier=0 where ctid in ({0}) and OrderState=5 and IsVerifyToSupplier=1", textCtids));
                 returnSuccessMsg("打包成功");
                 return;
             }
             returnErrorMsg("缺少必要的参数");
         }
 
+        public void rePackOrderInfo()
+        {
+            string id = GetPostString("id");
+            if (!string.IsNullOrEmpty(id))
+            {
+                CeErpPackData ceErpPackData = CeErpPackData.Get(id);
+                if (ceErpPackData == null)
+                {
+                    returnSuccessMsg("查无数据");
+                    return;
+                }
+                ceErpPackData.upStatus = 0;
+                ceErpPackData.message = "";
+                ceErpPackData.Update();
+                returnSuccessMsg("打包成功");
+                return;
+            }
+            returnErrorMsg("缺少必要的参数");
+        }
+        public void addPackDownNum()
+        {
+            string id = GetPostString("id");
+            if (!string.IsNullOrEmpty(id))
+            {
+                DbHelper.DbConn.ExecuteNonQuery(string.Format("update CE_ErpPackData set downNum+=1 where id= {0}", id));
+                returnSuccessMsg("下载成功");
+                return;
+            }
+            returnErrorMsg("缺少必要的参数");
+        }
+
         public void get_pack_list()
         {
             DataStruct dStruct = GetPostStruct();

+ 1 - 1
SiteCore/Handler/sync.orderReport.cs

@@ -2177,7 +2177,7 @@ namespace SiteCore.Handler
 
             }
 
-            sql.AppendFormat("SELECT s.ShopName , COUNT ( * ) AS AllOrder, COUNT ( CASE WHEN o.AfterSaleState >= 1 THEN 1 END ) AS aftersaleOrder  FROM CE_ErpTradeCell o LEFT JOIN CE_ErpShop s ON o.ShopId = s.id  WHERE 1=1 {0}  GROUP BY s.ShopName", sqlDate);
+            sql.AppendFormat("SELECT s.ShopName , COUNT ( * ) AS AllOrder, COUNT ( CASE WHEN o.AfterSaleState >= 1 THEN 1 END ) AS aftersaleOrder,COUNT ( CASE WHEN e.CheckOut > 0 THEN 1 END ) AS checkout  FROM CE_ErpTradeCell o LEFT JOIN Ce_ErpTradeCellExtend e ON o.ctid = e.ctid LEFT JOIN CE_ErpShop s ON o.ShopId = s.id  WHERE 1=1 {0}  GROUP BY s.ShopName", sqlDate);
             DataTable dtafter = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0];
             int totalAfter = 0;
             DataTable dt = new DataTable();

+ 3 - 32
SiteCore/ReportBaseX.cs

@@ -4,6 +4,7 @@ using System.Web;
 using NPOI.HPSF;
 using NPOI.HSSF.UserModel;
 using NPOI.SS.UserModel;
+using NPOI.XSSF.Streaming;
 using NPOI.XSSF.UserModel;
 
 namespace SiteCore
@@ -39,7 +40,7 @@ namespace SiteCore
 
         public string excelName = "";
         public int AIdx = 65;
-        public XSSFWorkbook xssfworkbook;
+        public SXSSFWorkbook xssfworkbook;
         public ISheet iSheet;
 
         #region custom_style
@@ -359,7 +360,7 @@ namespace SiteCore
         {
             //FileStream file = new FileStream(fname, FileMode.Open, FileAccess.Read);
            
-            xssfworkbook = new XSSFWorkbook();
+            xssfworkbook = new SXSSFWorkbook();
             //DocumentSummaryInformation dsi = PropertySetFactory.CreateDocumentSummaryInformation();
             //dsi.Company = SiteName;
             //xssfworkbook.DocumentSummaryInformation = dsi;
@@ -371,22 +372,7 @@ namespace SiteCore
             xssfworkbook.CreateSheet("Sheet1");
         }
 
-        public void initExcel(string fname)
-        {
-            using (FileStream file = new FileStream(fname, FileMode.Open, FileAccess.Read))
-            {
-                xssfworkbook = new XSSFWorkbook(file);
-            }
-
-            DocumentSummaryInformation dsi = PropertySetFactory.CreateDocumentSummaryInformation();
-
-            //dsi.Company = "龙岩鑫港";
-            //xssfworkbook.DocumentSummaryInformation = dsi;
 
-            //SummaryInformation si = PropertySetFactory.CreateSummaryInformation();
-            //si.Subject = excelName;
-            //xssfworkbook.SummaryInformation = si;
-        }
 
         public void DownLoadFile()
         {
@@ -446,21 +432,6 @@ namespace SiteCore
             }
         }
 
-        public void UploadFile(HttpPostedFile file)
-        {
-            //FileStream f = new FileStream(
-            Stream s = file.InputStream;
-            xssfworkbook = new XSSFWorkbook(s);
-            //DocumentSummaryInformation dsi = PropertySetFactory.CreateDocumentSummaryInformation();
-
-            //dsi.Company = "连城鑫港";
-            //xssfworkbook.DocumentSummaryInformation = dsi;
-
-            //SummaryInformation si = PropertySetFactory.CreateSummaryInformation();
-            //si.Subject = excelName;
-            //xssfworkbook.SummaryInformation = si;
-        }
-
         #endregion
     }
 }

+ 6 - 4
SiteCore/taobao/commonHelper.cs

@@ -2698,6 +2698,10 @@ namespace SiteCore
             return responseStr;
         }
 
+        public static List<int> spu_products = new List<int>() { 4, 13, 19, 24, 28, 32, 40, 51, 57, 1971, 2319, 2377, 2521, 2524, 2533, 2538, 2542, 2554, 2556, 2557, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2568, 2569, 2570, 2571, 2572, 2619, 2625, 2634, 2636, 2637, 2638, 2645, 2646 };
+        public static List<int> spu_shopIds = new List<int>() { 5, 6, 8, 10, 11, 12, 14, 15, 16, 18, 24, 27, 28, 31, 32, 56, 61 };
+        public static List<int> spu_oldProducts = new List<int>() { 4, 13, 2524, 2533, 2554, 2557 };
+
         public static void setSpuData(CeErpTrade father)
         {
             string orderSql = string.Format("SELECT * FROM [dbo].[CE_ErpTradeOrder] WHERE tid = '{0}' and total_fee > 0", father.tid);
@@ -2726,13 +2730,11 @@ namespace SiteCore
                         CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(ceErpTradeCellExtend.ctid);
                         string result = designHelper.API_CheckOrderTo(ceErpTradeCellExtend.ctid, ceErpTradeCellExtend.spu_id, ceErpTradeCell.ShopId);
                         ceErpTradeCellExtend.ToType = result;
-                        List<int> products = new List<int>() { 4, 13, 19, 24, 28, 32, 40, 51, 57, 1971, 2319, 2377, 2521, 2524, 2533, 2538, 2542, 2554, 2556, 2557, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2568, 2569, 2570, 2571, 2572, 2619, 2625, 2634, 2636, 2637, 2638, 2645, 2646 };
-                        List<int> shopIds = new List<int>() { 5, 6, 8, 10, 11, 12, 14, 15, 16, 18, 24, 27, 28, 31, 32, 56, 61 };
-                        if (products.Contains(ceErpTradeCell.ProductId) || ceErpTradeCell.seller_memo.IndexOf("手绘") > -1 || ceErpTradeCell.seller_memo.IndexOf("电子稿") > -1 || ceErpTradeCell.isDianziOrder > 0)
+                        if (spu_products.Contains(ceErpTradeCell.ProductId) || ceErpTradeCell.seller_memo.IndexOf("手绘") > -1 || ceErpTradeCell.seller_memo.IndexOf("电子稿") > -1 || ceErpTradeCell.isDianziOrder > 0)
                         {
                             ceErpTradeCellExtend.ToType = "外协";
                         }
-                        if ((ceErpTradeCell.seller_memo.Contains("改稿") || ceErpTradeCell.OtherMemo.Contains("改稿")) && shopIds.Contains(ceErpTradeCell.ShopId))
+                        if ((ceErpTradeCell.seller_memo.Contains("改稿") || ceErpTradeCell.OtherMemo.Contains("改稿")) && spu_shopIds.Contains(ceErpTradeCell.ShopId) && !spu_oldProducts.Contains(ceErpTradeCell.ProductId))
                         {
                             ceErpTradeCellExtend.ToType = "内部";
                         }

+ 3 - 4
SiteCore/taobao/preSalesHelper.cs

@@ -1921,13 +1921,12 @@ namespace SiteCore.Handler
                     {
                         string result = designHelper.API_CheckOrderTo(ceErpTradeCellExtend.ctid, ceErpTradeCellExtend.spu_id, entity.ShopId);
                         ceErpTradeCellExtend.ToType = result;
-                        List<int> products = new List<int>() { 4, 13, 19, 24, 28, 32, 40, 51, 57, 1971, 2319, 2377, 2521, 2524, 2533, 2538, 2542, 2554, 2556, 2557, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2568, 2569, 2570, 2571, 2572, 2619, 2625, 2634, 2636, 2637, 2638, 2645, 2646 };
-                        List<int> shopIds = new List<int>() { 5, 6, 8, 10, 11, 12, 14, 15, 16, 18, 24, 27, 28, 31, 32, 56, 61 };
-                        if (products.Contains(entity.ProductId) || entity.seller_memo.IndexOf("手绘") > -1 || entity.seller_memo.IndexOf("电子稿") > -1 || entity.isDianziOrder > 0)
+                       
+                        if (commonHelper.spu_products.Contains(entity.ProductId) || entity.seller_memo.IndexOf("手绘") > -1 || entity.seller_memo.IndexOf("电子稿") > -1 || entity.isDianziOrder > 0)
                         {
                             ceErpTradeCellExtend.ToType = "外协";
                         }
-                        if ((entity.seller_memo.Contains("改稿") || entity.OtherMemo.Contains("改稿")) && shopIds.Contains(entity.ShopId))
+                        if ((entity.seller_memo.Contains("改稿") || entity.OtherMemo.Contains("改稿")) && commonHelper.spu_shopIds.Contains(entity.ShopId) && !commonHelper.spu_oldProducts.Contains(entity.ProductId))
                         {
                             ceErpTradeCellExtend.ToType = "内部";
                         }

+ 1 - 0
Web/ECharts/AfterSaleGather.aspx

@@ -335,6 +335,7 @@
                                 <div field="aftersaleOrder" datatype="int" width="60" align="center" headeralign="center" allowsort="true">售后数量</div>
                                 <div field="rate" datatype="int" width="60" align="center" headeralign="center" allowsort="true">售后率</div>
                                 <div field="rateProp" datatype="int" width="60" align="center" headeralign="center" allowsort="true">售后占比</div>
+                                <div field="checkout" datatype="int" width="60" align="center" headeralign="center" allowsort="true">查货超时</div>
                             </div>
                         </div>
                     </div>

+ 13 - 1
Web/EDelivery/PackCenter.aspx

@@ -27,6 +27,9 @@
             html += "</div>";
             return html;
         }
+        function rePackData(id) {
+            postAjax("rePackOrderInfo", { id }, function (data) { resultShow(data, "grid.reload();"); });
+        }
         function supStateRenderer(e) {
             var record = e.record;
             var html = "<div style=\"display:flex;flex-direction:column;\">";
@@ -50,10 +53,19 @@
             var record = e.record;
             var html = "";
             if (!!record.fileUrl) {
-                html += getGridBtn("notify1", "下载", "downUrl('" + id + "')");
+                html += getGridBtn("notify1", "下载", "downUrl('" + record.fileUrl + "','" + record.ID + "')");
+            }
+            if (record.upStatus == 3) {
+                html += getGridBtn("notify", "重新打包", "rePackData(" + record.ID + ")");
             }
             return html;
         }
+        function downUrl(url, id) {
+            postAjax("addPackDownNum", { id }, function (data) {
+                window.open(url);
+                resultShow(data, "grid.reload();");
+            });
+        }
     </script>
 </asp:Content>
 <asp:Content ID="Content2" ContentPlaceHolderID="btn" runat="Server">

+ 1 - 1
Web/Reports/comExports.aspx.cs

@@ -164,6 +164,7 @@ public partial class Reports_comExports : ReportBaseX
         row.Height = 22 * 20;
         //row.RowStyle = GetExHeadStyle();
         List<string> cols = new List<string>();
+        //设置excel头
         foreach (Dictionary<string, object> dic in columns)
         {
             cols.Add(dic["field"].ToString());
@@ -260,7 +261,6 @@ public partial class Reports_comExports : ReportBaseX
             Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
             ms.WriteTo(Response.OutputStream);
             //Response.Flush();
-            xssfworkbook.Clear();
             xssfworkbook.Close();
             xssfworkbook = null;
             iSheet = null;

+ 10 - 2
ecomServer/MainForm.cs

@@ -10,6 +10,7 @@ using SiteCore.taobao;
 using SiteCore.taoObj;
 using System;
 using System.Collections.Generic;
+using System.Collections.Specialized;
 using System.Configuration;
 using System.Data;
 using System.Data.SqlClient;
@@ -17,6 +18,7 @@ using System.Diagnostics;
 using System.IO;
 using System.Linq;
 using System.Management;
+using System.Net;
 using System.Runtime.InteropServices;
 using System.Security.Cryptography;
 using System.Text;
@@ -221,6 +223,7 @@ namespace ErpServer
                 disTimerCall(null);
                 syncDataSendOrder();
                 sendOrderInfo();
+                connetUrl();
             }
             if (intHour == 2 && intMinute == 0)
             {
@@ -248,7 +251,6 @@ namespace ErpServer
                     reFundsDataTimerCall(null);
                 }
             }
-
             if (intMinute > 0 && intMinute % 10 != 0)
             {
                 syncBuChaJiaCall();
@@ -1323,7 +1325,13 @@ namespace ErpServer
 
             })).Start();
         }
-
+        public void connetUrl()
+        {
+            WebClient wc = new WebClient();
+            wc.Encoding = Encoding.GetEncoding("utf-8");
+            byte[] ret = wc.UploadValues("http://183.250.143.56:8088/supplierBuildFile.aspx", "POST", new NameValueCollection());
+            string remoteInfo = Encoding.GetEncoding("utf-8").GetString(ret);
+        }
 
         public static void addLog(string ctid, int userid, string con, int orderState = 0, int aftersaleState = 0)
         {