Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
weixiuhui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
蒋林
weixiuhui
Commits
dbed7d67
Commit
dbed7d67
authored
Sep 01, 2016
by
蒋林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 安装单相关接口
2. 维修单相关接口
parent
47cb6f79
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1714 additions
and
126 deletions
+1714
-126
Welcome.php
application/controllers/Welcome.php
+8
-2
Galanz.php
application/controllers/api/Galanz.php
+306
-20
Galanz.php
application/controllers/task/Galanz.php
+1
-1
Rgalanz.php
application/controllers/test/Rgalanz.php
+86
-3
Sgalanz.php
application/controllers/test/Sgalanz.php
+40
-5
ReceiveGalanz.php
application/libraries/Receive/ReceiveGalanz.php
+102
-27
SourceGalanz.php
application/libraries/Source/SourceGalanz.php
+1171
-68
No files found.
application/controllers/Welcome.php
View file @
dbed7d67
...
@@ -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
''
;
}
}
}
application/controllers/api/Galanz.php
View file @
dbed7d67
This diff is collapsed.
Click to expand it.
application/controllers/task/Galanz.php
View file @
dbed7d67
...
@@ -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
);
}
}
...
...
application/controllers/test/Rgalanz.php
View file @
dbed7d67
...
@@ -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
);
...
...
application/controllers/test/Sgalanz.php
View file @
dbed7d67
...
@@ -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
(
'CALL201608220361
1'
);
$list
=
$obj
->
UserProfileOrderDetail
(
'cede5a21-0c3a-42ad-8f43-cc9810c1f1f
1'
);
$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
);
}
}
...
...
application/libraries/Receive/ReceiveGalanz.php
View file @
dbed7d67
...
@@ -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
Check
GetOrderDetail
Values
()
public
function
Check
SearchOrder
Values
()
{
{
$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
->
Check
Public
Values
();
$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
->
Check
Public
Values
();
$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
application/libraries/Source/SourceGalanz.php
View file @
dbed7d67
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment