Browse Source

线上的数据先保存

longyi 5 months ago
parent
commit
a93750e596

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

@@ -168,10 +168,10 @@ class Ac extends Start_Controller {
 		$fullorder['time'] = date('Y-m-d',time());
 		$fullorder['times'] = date('Y-m-d H:i',time());
 		$declara_info = $this->customsdeclaration->find("ename like '%".$fullorder['sbpm']."%' ","*");
-	
+	    var_dump($declara_info);
 		$sbbm = "";
 		if(empty($declara_info)){
-			$sbbm = "67041100";
+			$sbbm = "";
 		}else{
 		    $sbbm = $declara_info['bname'];
 		}
@@ -232,12 +232,12 @@ class Ac extends Start_Controller {
 	//	$fullorder['printcode'] = 'HUALEI-DHL';
 // 		$fullorder['js'] = 2;
 // 		$fullorder['bx'] = 110;
-		$fullorder['qm'] = 1;
+		//$fullorder['qm'] = 1;
 // 		$fullorder['printcode'] = 'usps_priority';
 // 		$b  = $this->cne->get_data($fullorder);
 
         echo "<pre>";
-		$b = $this->fedexv1->get_data($fullorder);
+		$b = $this->dhl->get_data($fullorder);
 		var_dump($b);
 		//echo $fullorder['zzl'];
 	//	echo  "<pre>";

+ 12 - 8
core/CoreApp/controllers/Apipf.php

@@ -114,7 +114,7 @@ class Apipf extends Start_Controller{
        $data = [];
        $customer_ids = [];
        foreach($send_list as $item){
-           if(empty($item['orders'])){
+           if(empty($item['orders']) || empty($item['email'])){
                //直接同步更新了吧  都满足条件了 结果还没订单 就先不查询了 等有新的订单在判断一遍
                 $this->customer->save([
                     'more_three'=>3,
@@ -126,7 +126,7 @@ class Apipf extends Start_Controller{
            $customer_ids[] = $item['customer_id'];
        }
        var_dump(json_encode($customer_ids));
-    //   var_dump($data);
+       //var_dump($data);
        if(empty($data)){
             return ;
        }
@@ -148,7 +148,7 @@ class Apipf extends Start_Controller{
         if($api != $this->api){
              die("No data to be executed");
         }
-        $list = $this->customer->find_all("more_three = 3 and is_tb = 0","id,shop,source,name,email,phone,money,num,country,province,city,street,address,address2,zipcode",'id asc',0,100);
+        $list = $this->customer->find_all("more_three = 3 and is_tb = 0","id,shop,source,name,email,phone,money,num,country,province,city,street,address,address2,zipcode",'id asc',0,3);
         //$list = $this->customer->find_all("id = 71015","id,shop,source,name,email,phone,money,num,country,province,city,street,address,address2,zipcode",'id asc',0,100);
         if(empty($list)){
             die("This is a request without data");  
@@ -234,6 +234,7 @@ class Apipf extends Start_Controller{
                         
                         $flag_jishu = true;
                     } 
+                    
                 }
                 //var_dump($flag_jishu);
                 if(!$flag_jishu){
@@ -250,11 +251,14 @@ class Apipf extends Start_Controller{
                     $jisuan_qty =  $jisuan_qty + 1;
                 }
                 
-                $sku_list[] = [
-                    'sku'=>$item,
-                    'qty'=>isset($quantity_arr[$key])?$quantity_arr[$key]:1,
-                    'product_name'=>isset($product_arr[$key])?$product_arr[$key]:"",
-                ];
+                if(!empty($product_arr[$key])){
+                    $sku_list[] = [
+                        'sku'=>$item,
+                        'qty'=>isset($quantity_arr[$key])?$quantity_arr[$key]:1,
+                        'product_name'=>isset($product_arr[$key])?$product_arr[$key]:"",
+                    ];
+                }
+                
             }
             $goods_list = [];
             $fpdata_arr = explode(";",trim($v['fpdata'],";"));

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

@@ -48,6 +48,7 @@ class Systemprint extends Start_Controller {
 		$this->load->_model("Model_api","api");
 		$this->load->_model("Model_fedexv1",'fedexv1');
 		$this->load->_model("Model_customsdeclaration","customsdeclaration");
+		$this->load->_model("Model_logic_ding","logic_ding");
 	}
 	//定义方法的调用规则 获取URI第二段值
     public function _remap($arg,$arg_array)
@@ -816,8 +817,9 @@ class Systemprint extends Start_Controller {
 				 echo json_encode(array('msg'=>$fullorder['number'].' 状态异常,请提交给技术处理','success'=>false));exit;
 			}
 			$fullorder = $this->_text($fullorder);//获取所需信息
+			$this->logic_ding->sendToDing("打印快递单,订单的信息".json_encode($fullorder,JSON_UNESCAPED_UNICODE));
 			if(empty($fullorder['sbbm'])){
-			    echo json_encode(array('msg'=>$fullorder['number'].' 海关申报配置异常,请提交给技术处理','success'=>false));exit;
+			    echo json_encode(array('msg'=>$fullorder['number'].' 海关申报配置异常,请提交给技术处理'.$fullorder['sbbm'],'success'=>false));exit;
 			}
 			$oldprinttime = ($fullorder['printtime'] > 0)?$fullorder['oldprinttime'].$fullorder['printtime'].'-':'';
 			$fullorder['printtime'] = date('m-d H:i',$time);//打印用时间、发货单用,不能删

+ 4 - 0
core/CoreApp/models/Model_dhl.php

@@ -5,6 +5,7 @@ function __construct(){
 		$this->load->database();
 		$this->table = 'dhl';
     	$this->load_table('dhl');
+    	$this->load->_model("Model_logic_ding",'logic_ding');
 }
     public function get_data($data)
 	{
@@ -305,6 +306,9 @@ function __construct(){
 		$xml .= "<Resolution>200</Resolution>".$xmend;
 	    $xml .= "</Label>".$xmend;
         $xml .= "</req:ShipmentRequest>".$xmend;
+        
+        
+        $this->logic_ding->sendToDing("dhl发货单请求的报文".$xml);
 		$ch = curl_init(); 
 		curl_setopt($ch, CURLOPT_URL,'https://xml-api.dhl.com/XMLShippingServlet'); 
 		curl_setopt($ch, CURLOPT_POST, 1);