longyi 6 months ago
parent
commit
59686abd31
2 changed files with 20 additions and 5 deletions
  1. 19 4
      core/CoreApp/controllers/Ac.php
  2. 1 1
      core/CoreApp/models/Model_usps.php

+ 19 - 4
core/CoreApp/controllers/Ac.php

@@ -217,15 +217,19 @@ class Ac extends Start_Controller {
 		//$b = $this->yuntu->get_data($fullorder);
 		//$b = $this->usps->get_logistics($fullorder);
 	//	$fullorder['printcode'] = 'HUALEI-DHL';
-		//$fullorder['js'] = 1;
+		$fullorder['js'] = 2;
 // 		$fullorder['printcode'] = 'usps_priority';
 // 		$b  = $this->cne->get_data($fullorder);
 		//$b = $this->fedexv1->get_data($fullorder);
 		//echo $fullorder['zzl'];
-		//$b = $this->usps->get_data($fullorder);
+		echo  "<pre>";
 	
-		// echo "<pre>";
-		// print_r($b);
+		$b = $this->usps->get_data_new($fullorder);
+	
+		echo "<pre>";
+		print_r($b);
+		$this->_pdf($b['labelImage'],"test",date("Ymd"));
+		
 	}
 	
 	public function get_data($data)
@@ -412,6 +416,17 @@ class Ac extends Start_Controller {
 		
 	}
 	
+	public function _pdf($pdf,$title,$bctime)
+    {
+    	$pdf_path = './data/pdf/'.$bctime.'/';
+        $file_base64 = $pdf; 
+        $file_base64 = preg_replace('/data:.*;base64,/i', '', $file_base64);  
+        $file_base64 = base64_decode($file_base64);
+		if(!is_dir($pdf_path))mkdir($pdf_path,0777); //上传目录不存在则创建
+        file_put_contents($pdf_path.$title.'.pdf',$file_base64);
+		return $bctime;
+    }
+	
 	public function _qk()//清空用友数据
 	{
 		$sc = array();

+ 1 - 1
core/CoreApp/models/Model_usps.php

@@ -303,7 +303,7 @@ function __construct(){
 		}
 		else if($data['js'] == 2)
 		{
-			$rateIndicator = 'E4';
+			$rateIndicator = 'FP';
 			$mailClass = 'PRIORITY_MAIL_EXPRESS';
 		}
 		$list['packageDescription']['mailClass'] = $mailClass; // 邮寄类别