private void ExtractWaybillInfo(PrintWayBillParam param)
        {
            

            this.zdBpostWaybillAnalyser.TryCorrectFileName();

            string dhlFileName = this.zdBpostWaybillAnalyser.GetDHLFile(param.Recipient,param.NameIndex);

            string bpostFileName = this.zdBpostWaybillAnalyser.GetBpostFile(param.Recipient, param.NameIndex);

            string bpostCN23FileName = this.zdBpostWaybillAnalyser.GetBpostCN23File(param.Recipient, param.NameIndex);

            string dhlContent = this.pdfTextExtractor.GetTextByCommandLine(dhlFileName);

            string bpostContent = this.pdfTextExtractor.GetTextByCommandLine(bpostFileName);
            string bpostCN23Content = this.pdfTextExtractor.GetTextByCommandLine(bpostCN23FileName);

            string dhlWaybillSn = RexHelper.ExtractDHLWaybillSn(dhlContent);
            string bpostWaybillsn = RexHelper.ExtractZdBpostWaybillSn(bpostContent);

  
            param.Order.DhlSn = "{0};{1}".FormatAs(dhlWaybillSn, bpostWaybillsn);

            nameToWaybillSnDict.Add(param.Recipient.Name + param.NameIndex, bpostWaybillsn);

        }
Пример #2
0
        public string GetQueryMsgComplete(PrintWayBillParam param, string dhlWaybillSn, string bpostWaybillsn,string emsCode = "")
        {
            StringBuilder msg = new StringBuilder(100);

            msg.AppendLine("==========包裹追踪===========");
            msg.AppendLine(param.Recipient.ToString());
            msg.AppendLine(string.Join(";",param.Order.Content.ToLines()));
            msg.AppendLine();
            msg.AppendLine("德国境内运单号:{0}".FormatAs(dhlWaybillSn));
            string dhlTemplate = "http://nolp.dhl.de/nextt-online-public/set_identcodes.do?lang=en&idc={0}&rfn=&extendedSearch=true";
            string dhlSearchLink = string.Format("查询链接   " + dhlTemplate, dhlWaybillSn);
            msg.AppendLine(dhlSearchLink);

            msg.AppendLine();
            msg.AppendLine("国际运单号:{0}".FormatAs(bpostWaybillsn));
            string bpostTempalte = "http://www.bpost2.be/bpi/track_trace/find.php?search=s&lng=en&trackcode={0}";
            string bpostSearchLink = string.Format("查询链接  " + bpostTempalte, bpostWaybillsn);
            msg.AppendLine(bpostSearchLink);

            string queryEms;

            queryEms = (!emsCode.IsNullOrEmpty()) ? emsCode : this.GetEMSCodeByBpostCode(bpostWaybillsn);

            if (emsCode.IsNullOrEmpty() && !queryEms.IsNullOrEmpty())
            {
                param.Order.DhlSn += ";" + queryEms;

                this.orderService.Save(param.Order);
            }

            if (queryEms.IsNullOrEmpty())
            {              
                msg.AppendLine();
                msg.AppendLine("待包裹转交给中国EMS之后,国际运单查询里会生成 中国EMS转单号【Local Barcode】");
                msg.AppendLine("可以通过中国EMS网站进行更进一步的查询:http://www.ems.com.cn");
            }
            else
            {
                msg.AppendLine();
                msg.AppendLine("中国EMS,转单号: {0}".FormatAs(queryEms));
                msg.AppendLine("可以通过中国EMS网站进行更进一步的查询:http://www.ems.com.cn");
            }

            msg.AppendLine();
            msg.AppendLine("本包裹于发自德国吕贝克");

            msg.AppendLine("==============================");

            return msg.ToString();
        }
        private void PrintRecipientWayBill(PrintWayBillParam param)
        {

            domain.Recipient recipient = param.Recipient;
            domain.Order order = param.Order;
            
            this.zdBpostWaybillAnalyser.TryCorrectFileName();

            List<string> recipientPdfFileList = this.zdBpostWaybillAnalyser.GetRecipientPdfFileList(recipient,param.NameIndex);
            
            foreach (var fileName in recipientPdfFileList)
            {
                this.AddWatermark(fileName, recipient,order);
            }

            string combinedPdfFilename = this.CombinePDFFiles(recipientPdfFileList, recipient, order);


            foreach (var fileName in recipientPdfFileList)
            {
                this.DeleteProcessedFile(fileName);
            }
        }