|
@@ -7,6 +7,7 @@ function __construct(){
|
|
|
//$ys = 1;//延时获取运单
|
|
|
public function get_data($data)
|
|
|
{
|
|
|
+ $duty_type = '';//区分快递承担税费人的选项 DDU或DDP ddp好像是收件人承担税费
|
|
|
if($data['printcode'] == "HUALEI-FEDEX")
|
|
|
{
|
|
|
$product_id = 6021;
|
|
@@ -52,6 +53,7 @@ function __construct(){
|
|
|
$product_id = 7141;
|
|
|
$link = 'param=';
|
|
|
$ys = 0;//
|
|
|
+ $duty_type = "DDP";
|
|
|
}
|
|
|
$rs = $this->curlRequest('http://123.207.33.169:8082/selectAuth.htm',"username=LY&password=ly999");
|
|
|
$reData = json_decode(str_replace("'", "\"", $rs['result']));
|
|
@@ -67,86 +69,88 @@ function __construct(){
|
|
|
*/
|
|
|
if($data['ioss'] != '')//如果有IOSS
|
|
|
{
|
|
|
- //预报数据
|
|
|
- $count = Array(
|
|
|
- 'buyerid' => '',//买家ID
|
|
|
- 'consignee_address' => ($data['address2'] != '')?$data['address'].' '.$data['address2']:$data['address'],//地址
|
|
|
- 'consignee_city' => $data['city'],//城市
|
|
|
- 'consignee_mobile' => '',//收货人手机号 选填
|
|
|
- 'consignee_name' => $data['name'],//收件人
|
|
|
- 'trade_type' => 'ZYXT',//交易类型
|
|
|
- 'consignee_postcode' => $data['zipcode'],//邮编
|
|
|
- 'consignee_state' => $data['province'],//省/州
|
|
|
- 'consignee_telephone' => $data['phone'],//收货人电话 必填
|
|
|
- 'country' => $data['lb'],//收货人国家二字码
|
|
|
- 'shipper_taxno' => $data['ioss'],
|
|
|
- 'shipper_taxnotype'=>'IOSS',
|
|
|
- 'shipper_taxnocountry' => 'NL',
|
|
|
- 'customer_id' => $customer_id,
|
|
|
- 'customer_userid' => $customer_userid,
|
|
|
- 'orderInvoiceParam' => Array(
|
|
|
- '0' => Array
|
|
|
- (
|
|
|
- 'invoice_amount' => $data['zsbjz'],
|
|
|
- 'invoice_pcs' => $data['ts'],
|
|
|
- 'invoice_title' => $data['sbpm'],
|
|
|
- 'invoice_weight' => sprintf("%.3f",$data['zzl']/$data['ts']),//单条重量
|
|
|
- 'item_id' => '',
|
|
|
- 'item_transactionid' => '',
|
|
|
- 'sku' => $data['zwpm'],
|
|
|
- 'sku_code' => $data['zwpm'],
|
|
|
- 'hs_code'=> $data['hgbm'],//海关编码
|
|
|
+ //预报数据
|
|
|
+ $count = Array(
|
|
|
+ 'buyerid' => '',//买家ID
|
|
|
+ 'consignee_address' => ($data['address2'] != '')?$data['address'].' '.$data['address2']:$data['address'],//地址
|
|
|
+ 'consignee_city' => $data['city'],//城市
|
|
|
+ 'consignee_mobile' => '',//收货人手机号 选填
|
|
|
+ 'consignee_name' => $data['name'],//收件人
|
|
|
+ 'trade_type' => 'ZYXT',//交易类型
|
|
|
+ 'consignee_postcode' => $data['zipcode'],//邮编
|
|
|
+ 'consignee_state' => $data['province'],//省/州
|
|
|
+ 'consignee_telephone' => $data['phone'],//收货人电话 必填
|
|
|
+ 'country' => $data['lb'],//收货人国家二字码
|
|
|
+ 'shipper_taxno' => $data['ioss'],
|
|
|
+ 'shipper_taxnotype'=>'IOSS',
|
|
|
+ 'shipper_taxnocountry' => 'NL',
|
|
|
+ 'customer_id' => $customer_id,
|
|
|
+ 'customer_userid' => $customer_userid,
|
|
|
+ 'orderInvoiceParam' => Array(
|
|
|
+ '0' => Array
|
|
|
+ (
|
|
|
+ 'invoice_amount' => $data['zsbjz'],
|
|
|
+ 'invoice_pcs' => $data['ts'],
|
|
|
+ 'invoice_title' => $data['sbpm'],
|
|
|
+ 'invoice_weight' => sprintf("%.3f",$data['zzl']/$data['ts']),//单条重量
|
|
|
+ 'item_id' => '',
|
|
|
+ 'item_transactionid' => '',
|
|
|
+ 'sku' => $data['zwpm'],
|
|
|
+ 'sku_code' => $data['zwpm'],
|
|
|
+ 'hs_code'=> $data['hgbm'],//海关编码
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- 'order_customerinvoicecode' => $data['number'],//原单号
|
|
|
- 'product_id' => $product_id,
|
|
|
- 'weight' => 0,
|
|
|
- 'product_imagepath' => '',
|
|
|
- 'consignee_email'=>isset($data['email'])?$data['email']:'',
|
|
|
- 'consignee_companyname'=>$data['client'],//收件公司
|
|
|
- //'order_cargoamount'=>'',//订单实际金额
|
|
|
- //'order_insurance'=>'',//保险金额
|
|
|
- );
|
|
|
+ 'order_customerinvoicecode' => $data['number'],//原单号
|
|
|
+ 'product_id' => $product_id,
|
|
|
+ 'weight' => 0,
|
|
|
+ 'product_imagepath' => '',
|
|
|
+ 'consignee_email'=>isset($data['email'])?$data['email']:'',
|
|
|
+ 'consignee_companyname'=>$data['client'],//收件公司
|
|
|
+ //'order_cargoamount'=>'',//订单实际金额
|
|
|
+ //'order_insurance'=>'',//保险金额
|
|
|
+ 'duty_type'=>$duty_type,
|
|
|
+ );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//预报数据
|
|
|
- $count = Array(
|
|
|
- 'buyerid' => '',//买家ID
|
|
|
- 'consignee_address' => ($data['address2'] != '')?$data['address'].' '.$data['address2']:$data['address'],//地址
|
|
|
- 'consignee_city' => $data['city'],//城市
|
|
|
- 'consignee_mobile' => '',//收货人手机号 选填
|
|
|
- 'consignee_name' => $data['name'],//收件人
|
|
|
- 'trade_type' => 'ZYXT',//交易类型
|
|
|
- 'consignee_postcode' => $data['zipcode'],//邮编
|
|
|
- 'consignee_state' => $data['province'],//省/州
|
|
|
- 'consignee_telephone' => $data['phone'],//收货人电话 必填
|
|
|
- 'country' => $data['lb'],//收货人国家二字码
|
|
|
- 'customer_id' => $customer_id,
|
|
|
- 'customer_userid' => $customer_userid,
|
|
|
- 'orderInvoiceParam' => Array(
|
|
|
- '0' => Array
|
|
|
- (
|
|
|
- 'invoice_amount' => $data['zsbjz'],
|
|
|
- 'invoice_pcs' => $data['ts'],
|
|
|
- 'invoice_title' => $data['sbpm'],
|
|
|
- 'invoice_weight' => sprintf("%.3f",$data['zzl']/$data['ts']),//单条重量
|
|
|
- 'item_id' => '',
|
|
|
- 'item_transactionid' => '',
|
|
|
- 'sku' => $data['zwpm'],
|
|
|
- 'sku_code' => $data['zwpm'],
|
|
|
- 'hs_code'=> $data['hgbm'],//海关编码
|
|
|
+ $count = Array(
|
|
|
+ 'buyerid' => '',//买家ID
|
|
|
+ 'consignee_address' => ($data['address2'] != '')?$data['address'].' '.$data['address2']:$data['address'],//地址
|
|
|
+ 'consignee_city' => $data['city'],//城市
|
|
|
+ 'consignee_mobile' => '',//收货人手机号 选填
|
|
|
+ 'consignee_name' => $data['name'],//收件人
|
|
|
+ 'trade_type' => 'ZYXT',//交易类型
|
|
|
+ 'consignee_postcode' => $data['zipcode'],//邮编
|
|
|
+ 'consignee_state' => $data['province'],//省/州
|
|
|
+ 'consignee_telephone' => $data['phone'],//收货人电话 必填
|
|
|
+ 'country' => $data['lb'],//收货人国家二字码
|
|
|
+ 'customer_id' => $customer_id,
|
|
|
+ 'customer_userid' => $customer_userid,
|
|
|
+ 'orderInvoiceParam' => Array(
|
|
|
+ '0' => Array
|
|
|
+ (
|
|
|
+ 'invoice_amount' => $data['zsbjz'],
|
|
|
+ 'invoice_pcs' => $data['ts'],
|
|
|
+ 'invoice_title' => $data['sbpm'],
|
|
|
+ 'invoice_weight' => sprintf("%.3f",$data['zzl']/$data['ts']),//单条重量
|
|
|
+ 'item_id' => '',
|
|
|
+ 'item_transactionid' => '',
|
|
|
+ 'sku' => $data['zwpm'],
|
|
|
+ 'sku_code' => $data['zwpm'],
|
|
|
+ 'hs_code'=> $data['hgbm'],//海关编码
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- 'order_customerinvoicecode' => $data['number'],//原单号
|
|
|
- 'product_id' => $product_id,
|
|
|
- 'weight' => 0,
|
|
|
- 'product_imagepath' => '',
|
|
|
- 'consignee_email'=>isset($data['email'])?$data['email']:'',
|
|
|
- 'consignee_companyname'=>$data['client'],//收件公司
|
|
|
- //'order_cargoamount'=>'',//订单实际金额
|
|
|
- //'order_insurance'=>'',//保险金额
|
|
|
- );
|
|
|
+ 'order_customerinvoicecode' => $data['number'],//原单号
|
|
|
+ 'product_id' => $product_id,
|
|
|
+ 'weight' => 0,
|
|
|
+ 'product_imagepath' => '',
|
|
|
+ 'consignee_email'=>isset($data['email'])?$data['email']:'',
|
|
|
+ 'consignee_companyname'=>$data['client'],//收件公司
|
|
|
+ //'order_cargoamount'=>'',//订单实际金额
|
|
|
+ //'order_insurance'=>'',//保险金额
|
|
|
+ 'duty_type'=>$duty_type,
|
|
|
+ );
|
|
|
}
|
|
|
$result = $this->curlRequest('http://123.207.33.169:8082/createOrderApi.htm',$link.json_encode($count));
|
|
|
$resultData = json_decode($result['result'], true);
|