Commit dbed7d67 authored by 蒋林's avatar 蒋林

1. 安装单相关接口

2. 维修单相关接口
parent 47cb6f79
...@@ -6,9 +6,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ...@@ -6,9 +6,15 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*/ */
class Welcome extends BaseController { class Welcome extends BaseController {
public function t() public function postd()
{ {
echo '11'; $str = '';
} }
protected function handel($str)
{
return '';
}
} }
This diff is collapsed.
...@@ -37,7 +37,7 @@ class Galanz extends BaseController ...@@ -37,7 +37,7 @@ class Galanz extends BaseController
$galanzAccount = $account['galanz']; $galanzAccount = $account['galanz'];
$orders = []; $orders = [];
foreach ($galanzAccount as $v) { foreach ($galanzAccount as $k => $v) {
$orders[] = $this->galanzHandle($v); $orders[] = $this->galanzHandle($v);
} }
......
...@@ -15,19 +15,101 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ...@@ -15,19 +15,101 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*/ */
class Rgalanz extends BaseController class Rgalanz extends BaseController
{ {
public function getOrderDetail()
protected static $apiUrl = 'http://wxh.pp.cn/';
public function t()
{
$url = "http://localhost/test/weixiuhui.php";
$data['username'] = '10001';
$data['username1'] = 'CALL2016082400507';
$data['username2'] = 'c01000005';
$result = $this->curlPost($url, $data);
print_r($result);
}
public function createWorkOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['out_trade_no'] = 'CALL2016082400507';
$data['account'] = 'c01000005';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/CreateWorkOrder";
$result = $this->curlPost($url, $values);
$result = json_decode($result['data'], true);
$this->show($result);
}
public function queryOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['out_trade_no'] = 'CALL2015100900929';
$data['account'] = 'c01000005';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/queryOrder";
$result = $this->curlPost($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function queryWorkOrder()
{ {
$obj = $this->galanzObj(); $obj = $this->galanzObj();
$data['appid'] = '10001'; $data['appid'] = '10001';
$data['out_trade_no'] = 'CALL2016082200544'; $data['work_order_no'] = 'WO2016082204280';
$data['account'] = 'c01000005';
$data['nonce_str'] = $obj->GetNonceStr(); $data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/queryWorkOrder";
$result = $this->curlPost($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function queryUserProfileOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['up_order_no'] = 'N2016082303159';
$data['mobile'] = '18631653945';
$data['account'] = 'c01000005';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data); $obj->SetValues($data);
$obj->SetSign(); $obj->SetSign();
$values = $obj->GetValues(); $values = $obj->GetValues();
$url = "http://wxh.pp.cn/api/galanz/getOrderDetail"; $url = self::$apiUrl . "api/galanz/queryUserProfileOrder";
$result = $this->curlPost($url, $values); $result = $this->curlPost($url, $values);
$result['data'] = json_decode($result['data'], true); $result['data'] = json_decode($result['data'], true);
...@@ -52,6 +134,7 @@ class Rgalanz extends BaseController ...@@ -52,6 +134,7 @@ class Rgalanz extends BaseController
curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post)); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
$result = curl_exec($curl); $result = curl_exec($curl);
$code = curl_getinfo($curl, CURLINFO_HTTP_CODE); $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
......
...@@ -15,17 +15,36 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ...@@ -15,17 +15,36 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*/ */
class Sgalanz extends BaseController class Sgalanz extends BaseController
{ {
public function searchOrder()
public function userProfileOrderDetail()
{ {
$obj = $this->galanzObj(); $obj = $this->galanzObj();
$list = $obj->SearchOrder('CALL2016082203611'); $list = $obj->UserProfileOrderDetail('cede5a21-0c3a-42ad-8f43-cc9810c1f1f1');
$this->show($list); $this->show($list);
} }
public function orderDetail() public function saveOrder()
{ {
$obj = $this->galanzObj(); $obj = $this->galanzObj();
$list = $obj->OrderDetail('3911c4cd-6855-4a2c-8085-6e489972e6a3'); $order = $obj->OrderDetail('a7babae4-df15-4405-b5d2-2301554b6292');
$result = $obj->SaveOrder($order['new_id'], $order);
$this->show($result);
}
public function createWorkOrder()
{
$obj = $this->galanzObj();
$order = $obj->OrderDetail('a7babae4-df15-4405-b5d2-2301554b6292');
$result = $obj->CreateWorkOrder($order['new_id'], $order);
$this->show($result);
}
public function searchOrder()
{
$obj = $this->galanzObj();
$list = $obj->SearchOrder('CALL2016082203611');
$this->show($list); $this->show($list);
} }
...@@ -35,10 +54,26 @@ class Sgalanz extends BaseController ...@@ -35,10 +54,26 @@ class Sgalanz extends BaseController
$list = $obj->SearchWorkOrder('WO2016082204280'); $list = $obj->SearchWorkOrder('WO2016082204280');
$this->show($list); $this->show($list);
} }
public function searchUserProfieOrder()
{
$obj = $this->galanzObj();
$list = $obj->SearchUserProfieOrder('18631653945', 'N2016082303159');
$this->show($list);
}
public function orderDetail()
{
$obj = $this->galanzObj();
$list = $obj->OrderDetail('3911c4cd-6855-4a2c-8085-6e489972e6a3');
$this->show($list);
}
public function workOrderDetail() public function workOrderDetail()
{ {
$obj = $this->galanzObj(); $obj = $this->galanzObj();
$list = $obj->WorkOrderDetail('07ef7b0e-9788-4d05-88a5-25adc4406aef'); $list = $obj->WorkOrderDetail('511626f5-c8d8-4840-92ce-a01902f522d4');
$this->show($list); $this->show($list);
} }
......
...@@ -10,32 +10,28 @@ require 'Receive.php'; ...@@ -10,32 +10,28 @@ require 'Receive.php';
class ReceiveGalanz extends Receive class ReceiveGalanz extends Receive
{ {
/**
public function CheckPublicValues() * 订单详情
*/
public function CheckQueryOrderValues()
{ {
if (!$this->GetValues()) { $fileds = ['out_trade_no', 'account'];
$this->ReturnMessage(false, '参数错误!'); $this->CheckValues($fileds);
} }
if ($this->CheckAppid() == false) {
$this->ReturnMessage(false, '缺少appid参数!');
}
if ($this->CheckSign() == false) { public function CheckQueryWorkOrderValues()
$this->ReturnMessage(false, '签名错误!'); {
} $fileds = ['work_order_no', 'account'];
$this->CheckValues($fileds);
} }
/** /**
* 订单详情 * 搜索订单
*/ */
public function CheckGetOrderDetailValues() public function CheckSearchOrderValues()
{ {
$this->CheckPublicValues(); $fileds = ['out_trade_no', 'account'];
$this->CheckValues($fileds);
if (!array_key_exists('out_trade_no', $this->values) || $this->values['out_trade_no'] == '') {
$this->ReturnMessage(false, '缺少out_trade_no参数!');
}
} }
/** /**
...@@ -43,8 +39,20 @@ class ReceiveGalanz extends Receive ...@@ -43,8 +39,20 @@ class ReceiveGalanz extends Receive
*/ */
public function CheckSaveOrderValues() public function CheckSaveOrderValues()
{ {
$this->CheckPublicValues(); $fileds = ['out_trade_no', 'account'];
$this->CheckValues($fileds);
$dfields = [
'sitecontacttime',
'actualvisittime',
'isguaranty',
'finishstatus',
'unfinishreason',
'complete_reason',
'sitedealremarks',
'servicePersonnel',
];
$this->SetDefaultValues($dfields);
} }
/** /**
...@@ -52,7 +60,7 @@ class ReceiveGalanz extends Receive ...@@ -52,7 +60,7 @@ class ReceiveGalanz extends Receive
*/ */
public function CheckRefuseOrderValues() public function CheckRefuseOrderValues()
{ {
$this->CheckPublicValues(); $this->CheckValues();
} }
...@@ -61,7 +69,7 @@ class ReceiveGalanz extends Receive ...@@ -61,7 +69,7 @@ class ReceiveGalanz extends Receive
*/ */
public function CheckAcceptOrderValues() public function CheckAcceptOrderValues()
{ {
$this->CheckPublicValues(); $this->CheckValues();
} }
...@@ -70,16 +78,83 @@ class ReceiveGalanz extends Receive ...@@ -70,16 +78,83 @@ class ReceiveGalanz extends Receive
*/ */
public function CheckCreateWorkOrderValues() public function CheckCreateWorkOrderValues()
{ {
$this->CheckPublicValues(); $fileds = ['out_trade_no', 'account'];
$this->CheckValues($fileds);
} }
/** /**
* 转录安装单 * 转录安装单
*/ */
public function CheckCreateUserprofileOrderValues() public function CheckCreateUserProfileOrderValues()
{
$fileds = ['out_trade_no', 'account'];
$this->CheckValues($fileds);
}
public function CheckSaveWorkOrderValues()
{ {
$this->CheckPublicValues(); $fileds = ['work_order_no', 'account'];
$this->CheckValues($fileds);
}
public function CheckSendWorkOrderValues()
{
$fileds = ['work_order_no', 'account'];
$this->CheckValues($fileds);
}
public function CheckSaveUserProfileOrderValues()
{
$fileds = ['up_order_no', 'account'];
$this->CheckValues($fileds);
}
public function CheckSendUserProfileOrderValues()
{
$fileds = ['up_order_no', 'account'];
$this->CheckValues($fileds);
}
/**
* 检查参数
* @param array $fields
*/
private function CheckValues($fields = [])
{
if (!$this->GetValues()) {
$this->ReturnMessage(false, '参数错误!');
}
if ($this->CheckAppid() == false) {
$this->ReturnMessage(false, 'appid参数错误!');
}
if ($this->CheckSign() == false) {
$this->ReturnMessage(false, '签名错误!');
}
if ($fields) {
foreach ($fields as $v) {
if (!array_key_exists($v, $this->values) || $this->values[$v] == '') {
$this->ReturnMessage(false, "{$v}参数错误!");
}
}
}
}
/**
* 给指定参数增加默认值
* @param $fields
*/
private function SetDefaultValues($fields)
{
if ($fields) {
foreach ($fields as $v) {
if (!array_key_exists($v, $this->values)) {
$this->values[$v] == '';
}
}
}
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment