Browse Source

添加惠城的切换

lvhao 1 day ago
parent
commit
c85122cc57

+ 7 - 1
core/CoreApp/controllers/Systemprint.php

@@ -39,6 +39,7 @@ class Systemprint extends Start_Controller {
 		$this->load->_model('Model_whlabelbarcode','whlabelbarcode');
 		$this->load->_model('Model_yswaybill','yswaybill');
 		$this->load->_model('Model_hualei','hualei');
+		$this->load->_model('Model_hualeiv1','hualeiv1');
 		$this->load->_model('Model_apiyy','apiyy');
 		$this->load->_model('Model_classid','classid');
 		$this->load->_model('Model_fullorderxw','fullorderxw');
@@ -1521,7 +1522,12 @@ class Systemprint extends Start_Controller {
 				}
 				else if($fullorder['printcode'] == "HUALEI-FEDEX" || $fullorder['printcode'] == "HUALEI-ARAMEX-S" || $fullorder['printcode'] == "HUALEI-ARAMEX-G" || $fullorder['printcode'] == "HUALEI-GES-EU" || $fullorder['printcode'] == "HUALEI-DHL-A1" || $fullorder['printcode'] == "HUALEI-WMS"||$fullorder['printcode'] == 'HUALEI-DHL' || $fullorder['printcode'] == 'HUALEI-MLXY' || $fullorder['printcode'] == 'HUALEI-MGLB' || $fullorder['printcode'] == 'HUALEI-UNI')
 				{
-					$barcode = $this->hualei->get_data($fullorder);
+					if($fullorder['printcode'] == 'HUALEI-UNI'){
+						$barcode = $this->hualei->get_data($fullorder);
+					}else{
+						$barcode = $this->hualeiv1->get_data($fullorder);
+					}
+					
 					$bctime = date('Ymd',$time);
 					if(!isset($barcode['x']))
 					{

+ 66 - 57
core/CoreApp/models/Model_hualei.php

@@ -9,66 +9,75 @@ function __construct(){
     public function get_data($data)
 	{
 		$duty_type = '';//区分快递承担税费人的选项   DDU或DDP  ddp好像是收件人承担税费
-		if($data['printcode'] == "HUALEI-FEDEX")
-		{
-			$product_id = 6021;
-			$link = 'param=';
-			$ys = 0;//非延时获取运单
-		}
-		else if($data['printcode'] == "HUALEI-ARAMEX-G")
-		{
-			$product_id = 3361;
-			$link = 'param=';
-			$ys = 0;//非延时获取运单
-		}
-		else if($data['printcode'] == "HUALEI-ARAMEX-S")
-		{
-			$product_id = 8161;//南非
-			$link = 'param=';
-			$ys = 0;//非延时获取运单
-		}
-		else if ($data['printcode'] == "HUALEI-GES-EU")
-		{
-			$product_id = 4301;
-			$link = 'param=';
-			$ys = 0;//非延时获取运单
-			if($data['printnumber'] > 0)
-			{
-				$data['number'] = $data['number'].'-'.($data['printnumber']+1);
-			}
-		}
-		else if ($data['printcode'] == "HUALEI-WMS")//DPEX
-		{
-			$product_id = 5781;
-			$link = 'param=';
-			$ys = 0;//非延时获取运单
-		}
-		else if ($data['printcode'] == "HUALEI-DHL-A1")//TNT
-		{
-			$product_id = 7281;
-			$link = 'param=';
-			$ys = 0;//非延时获取运单
-		}
-		else if ($data['printcode'] == "HUALEI-DHL")//TNT
-		{
-			$product_id = 7141;
-			$link = 'param=';
-			$ys = 0;//
-			$duty_type = "DDP";
-		}
-		else if($data['printcode'] == 'HUALEI-MLXY'){
-			$product_id  = 7581;
-			$link = 'param=';
-			$ys = 0;//
-			//$duty_type = "DDP";
-		}else if($data['printcode'] == 'HUALEI-MGLB'){
-			$product_id  = 8641;
-			$link = 'param=';
-			$ys = 0;//
-		}else if($data['printcode'] == 'HUALEI-UNI'){
+		// if($data['printcode'] == "HUALEI-FEDEX")
+		// {
+		// 	$product_id = 6021;
+		// 	$link = 'param=';
+		// 	$ys = 0;//非延时获取运单
+		// }
+		// else if($data['printcode'] == "HUALEI-ARAMEX-G")
+		// {
+		// 	$product_id = 3361;
+		// 	$link = 'param=';
+		// 	$ys = 0;//非延时获取运单
+		// }
+		// else if($data['printcode'] == "HUALEI-ARAMEX-S")
+		// {
+		// 	$product_id = 8161;//南非
+		// 	$link = 'param=';
+		// 	$ys = 0;//非延时获取运单
+		// }
+		// else if ($data['printcode'] == "HUALEI-GES-EU")
+		// {
+		// 	$product_id = 4301;
+		// 	$link = 'param=';
+		// 	$ys = 0;//非延时获取运单
+		// 	if($data['printnumber'] > 0)
+		// 	{
+		// 		$data['number'] = $data['number'].'-'.($data['printnumber']+1);
+		// 	}
+		// }
+		// else if ($data['printcode'] == "HUALEI-WMS")//DPEX
+		// {
+		// 	$product_id = 5781;
+		// 	$link = 'param=';
+		// 	$ys = 0;//非延时获取运单
+		// }
+		// else if ($data['printcode'] == "HUALEI-DHL-A1")//TNT
+		// {
+		// 	$product_id = 7281;
+		// 	$link = 'param=';
+		// 	$ys = 0;//非延时获取运单
+		// }
+		// else if ($data['printcode'] == "HUALEI-DHL")//TNT
+		// {
+		// 	$product_id = 7141;
+		// 	$link = 'param=';
+		// 	$ys = 0;//
+		// 	$duty_type = "DDP";
+		// }
+		// else if($data['printcode'] == 'HUALEI-MLXY'){
+		// 	$product_id  = 7581;
+		// 	$link = 'param=';
+		// 	$ys = 0;//
+		// 	//$duty_type = "DDP";
+		// }else if($data['printcode'] == 'HUALEI-MGLB'){
+		// 	$product_id  = 8641;
+		// 	$link = 'param=';
+		// 	$ys = 0;//
+		// }else if($data['printcode'] == 'HUALEI-UNI'){
+		// 	$product_id  = 2;
+		// 	$link = 'param=';
+		// 	$ys = 0;//
+		// }
+
+		if($data['printcode'] == 'HUALEI-UNI'){
 			$product_id  = 2;
 			$link = 'param=';
 			$ys = 0;//
+		}else{
+			$g = array('x'=>'0','Description'=>'系统没有开通该渠道');
+			return $g;
 		}
 
 

+ 5 - 10
core/CoreApp/models/Model_hualeiv1.php

@@ -56,12 +56,7 @@ function __construct(){
 			$ys = 0;//
 			$duty_type = "DDP";
 		}
-		else if($data['printcode'] == 'HUALEI-MLXY'){
-			$product_id  = 7581;
-			$link = 'param=';
-			$ys = 0;//
-			//$duty_type = "DDP";
-		}else if($data['printcode'] == 'HUALEI-MGLB'){
+		else if($data['printcode'] == 'HUALEI-MGLB'){
 			$product_id  = 8641;
 			$link = 'param=';
 			$ys = 0;//
@@ -171,17 +166,17 @@ function __construct(){
 		}
 // 		var_dump($link);
 // 		var_dump(json_encode($count));
-		$this->logic_ding->sendToDing("hualei发货单请求的报文".$link.json_encode($count));
+		$this->logic_ding->sendToDing("hualeiv1发货单请求的报文".$link.json_encode($count));
 		$start_time = time();
 		$result = $this->curlRequest('http://123.207.33.169:8082/createOrderApi.htm',$link.json_encode($count));
-		$this->logic_ding->sendToDing("hualei发货单回执的报文result".json_encode($result,JSON_UNESCAPED_UNICODE));
+		$this->logic_ding->sendToDing("hualeiv1发货单回执的报文result".json_encode($result,JSON_UNESCAPED_UNICODE));
 		
 		$resultData = json_decode($result['result'], true);
 		
 		if(isset($resultData['message'])){
 			$resultData['message'] = urldecode($resultData['message']);
 		}
-		$this->logic_ding->sendToDing("hualei发货单回执的报文resultData".json_encode($resultData,JSON_UNESCAPED_UNICODE));
+		$this->logic_ding->sendToDing("hualeiv1发货单回执的报文resultData".json_encode($resultData,JSON_UNESCAPED_UNICODE));
 		if($resultData['ack'] == 'true')
 		{
 			//if($resultData['tracking_number'] == $resultData['reference_number'])
@@ -221,7 +216,7 @@ function __construct(){
 			}
 		}
 		
-		$this->logic_ding->sendToDing("hualei发货单回执的pdf报文".json_encode($g,JSON_UNESCAPED_UNICODE));
+		$this->logic_ding->sendToDing("hualeiv1发货单回执的pdf报文".json_encode($g,JSON_UNESCAPED_UNICODE));
 		return $g;exit;
 	}