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
2c4eec27
Commit
2c4eec27
authored
Sep 07, 2016
by
蒋林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 维修单相关接口开发
parent
705ad4ec
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
914 additions
and
315 deletions
+914
-315
Galanz.php
application/controllers/api/Galanz.php
+261
-156
Rgalanz.php
application/controllers/test/Rgalanz.php
+90
-13
Sgalanz.php
application/controllers/test/Sgalanz.php
+42
-4
base_helper.php
application/helpers/base_helper.php
+37
-0
Receive.php
application/libraries/Receive/Receive.php
+16
-2
ReceiveGalanz.php
application/libraries/Receive/ReceiveGalanz.php
+66
-10
SourceGalanz.php
application/libraries/Source/SourceGalanz.php
+402
-130
No files found.
application/controllers/api/Galanz.php
View file @
2c4eec27
This diff is collapsed.
Click to expand it.
application/controllers/test/Rgalanz.php
View file @
2c4eec27
...
...
@@ -16,44 +16,121 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class
Rgalanz
extends
BaseController
{
//
protected static $apiUrl = 'http://wxh.pp.cn/';
//
protected static $apiUrl = 'http://wxh.pp.cn/';
protected
static
$apiUrl
=
'http://testwxh.pp.cc/'
;
public
function
t
()
public
function
t
est
()
{
$url
=
"http://localhost/test/weixiuhui.php"
;
$obj
=
$this
->
galanzObj
();
$data
[
'appid'
]
=
'10001'
;
$data
[
'account'
]
=
'R75510005'
;
$data
[
'pwd'
]
=
str_aes
(
'dgqh!769'
);
$data
[
'work_order_no'
]
=
'WO2016090100560'
;
$data
[
'txtproducenumber'
]
=
'15AA50100001295'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$data
[
'username'
]
=
'10001'
;
$data
[
'username1'
]
=
'CALL2016082400507'
;
$data
[
'username2'
]
=
'c01000005'
;
$url
=
self
::
$apiUrl
.
"api/galanz/addProdWorkOrder"
;
$result
=
$this
->
curlPost
(
$url
,
$values
);
$result
=
$this
->
curlPost
(
$url
,
$data
);
$result
[
'data'
]
=
json_decode
(
$result
[
'data'
],
true
);
print_r
(
$result
);
$this
->
show
(
$result
);
}
public
function
create
WorkOrder
()
public
function
addError
WorkOrder
()
{
$obj
=
$this
->
galanzObj
();
$data
[
'appid'
]
=
'10001'
;
$data
[
'out_trade_no'
]
=
'CALL2016082400507'
;
$data
[
'account'
]
=
'c01000005'
;
$data
[
'account'
]
=
'R75510005'
;
$data
[
'pwd'
]
=
str_aes
(
'dgqh!769'
);
$data
[
'work_order_no'
]
=
'WO2016090100560'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$url
=
self
::
$apiUrl
.
"api/galanz/addErrorWorkOrder"
;
$result
=
$this
->
curlPost
(
$url
,
$values
);
$result
[
'data'
]
=
json_decode
(
$result
[
'data'
],
true
);
$this
->
show
(
$result
);
}
public
function
lookupErrormModule
()
{
$obj
=
$this
->
galanzObj
();
$data
[
'appid'
]
=
'10001'
;
$data
[
'account'
]
=
'R75510005'
;
$data
[
'pwd'
]
=
str_aes
(
'dgqh!769'
);
$data
[
'workorderproductid'
]
=
'74da8159-d418-47d4-8397-b12aac319285'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$url
=
self
::
$apiUrl
.
"api/galanz/lookupErrormModule"
;
$result
=
$this
->
curlPost
(
$url
,
$values
);
$result
[
'data'
]
=
json_decode
(
$result
[
'data'
],
true
);
$this
->
show
(
$result
);
}
public
function
lookupErrorGroup
()
{
$obj
=
$this
->
galanzObj
();
$data
[
'appid'
]
=
'10001'
;
$data
[
'account'
]
=
'R75510005'
;
$data
[
'pwd'
]
=
str_aes
(
'dgqh!769'
);
$data
[
'errormoduleid'
]
=
'a5f47f85-d161-e411-80cb-00155d016a1c'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$url
=
self
::
$apiUrl
.
"api/galanz/
CreateWorkOrder
"
;
$url
=
self
::
$apiUrl
.
"api/galanz/
lookupErrorGroup
"
;
$result
=
$this
->
curlPost
(
$url
,
$values
);
$result
=
json_decode
(
$result
[
'data'
],
true
);
$result
[
'data'
]
=
json_decode
(
$result
[
'data'
],
true
);
$this
->
show
(
$result
);
}
public
function
lookupErrorSolution
()
{
$obj
=
$this
->
galanzObj
();
$data
[
'appid'
]
=
'10001'
;
$data
[
'account'
]
=
'R75510005'
;
$data
[
'pwd'
]
=
str_aes
(
'dgqh!769'
);
$data
[
'errorgroupid'
]
=
'9017fc9e-ebb7-4e06-bbd0-58f2a74e1ffe'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$url
=
self
::
$apiUrl
.
"api/galanz/lookupErrorSolution"
;
$result
=
$this
->
curlPost
(
$url
,
$values
);
$result
[
'data'
]
=
json_decode
(
$result
[
'data'
],
true
);
$this
->
show
(
$result
[
'data'
]);
}
public
function
queryOrder
()
{
$obj
=
$this
->
galanzObj
();
...
...
application/controllers/test/Sgalanz.php
View file @
2c4eec27
...
...
@@ -65,7 +65,7 @@ class Sgalanz extends BaseController
public
function
orderDetail
()
{
$obj
=
$this
->
galanzObj
();
$list
=
$obj
->
OrderDetail
(
'
3911c4cd-6855-4a2c-8085-6e489972e6a3
'
);
$list
=
$obj
->
OrderDetail
(
'
07be1e36-75bd-4394-8a6f-d09e387e869e
'
);
$this
->
show
(
$list
);
}
...
...
@@ -73,15 +73,53 @@ class Sgalanz extends BaseController
public
function
workOrderDetail
()
{
$obj
=
$this
->
galanzObj
();
$list
=
$obj
->
WorkOrderDetail
(
'
511626f5-c8d8-4840-92ce-a01902f522d4
'
);
$list
=
$obj
->
WorkOrderDetail
(
'
b4562475-1eac-415d-8713-653f8ea7d7c3
'
);
$this
->
show
(
$list
);
}
public
function
prodAddWorkOrder
()
{
$obj
=
$this
->
galanzObj
();
$list
=
$obj
->
WorkOrderDetail
(
'b4562475-1eac-415d-8713-653f8ea7d7c3'
);
$result
=
$obj
->
ProdGetWorkOrder
(
$list
[
'new_id'
],
$list
,
'15C1321000388166'
);
$this
->
show
(
$result
);
}
public
function
errorAddWorkOrder
()
{
$obj
=
$this
->
galanzObj
();
$list
=
$obj
->
WorkOrderDetail
(
'b4562475-1eac-415d-8713-653f8ea7d7c3'
);
$result
=
$obj
->
ErrorAddWorkOrder
(
$list
[
'new_id'
],
$list
);
$this
->
show
(
$result
);
}
public
function
lookupSingle
()
{
$obj
=
$this
->
galanzObj
();
//$list = $obj->WorkOrderDetail('b4562475-1eac-415d-8713-653f8ea7d7c3');
$result
[
'a'
]
=
$obj
->
LookupErrormModule
(
'c7d14361-df35-4147-966f-ee671298d3eb'
);
$result
[
'b'
]
=
$obj
->
LookupErrorGroup
(
$result
[
'a'
][
0
][
'id'
]);
$result
[
'c'
]
=
$obj
->
LookupErrorSolution
(
$result
[
'b'
][
0
][
'id'
]);
$result
[
'd1'
]
=
$obj
->
LookupErrorParts
(
$result
[
'c'
][
0
][
'id'
],
'c7d14361-df35-4147-966f-ee671298d3eb'
);
$result
[
'd2'
]
=
$obj
->
LookupParts
(
'6f562a61-3a22-4a16-9e42-f3306dcc10a0'
,
'48e24c55-7b53-46ae-8e43-c20e2435adbc'
);
$this
->
show
(
$result
);
}
private
function
galanzObj
()
{
// $account = [
// 'username' => 'c01000005',
// 'pwd' => 'weixiuhui010'
// ];
$account
=
[
'username'
=>
'
c0100
0005'
,
'pwd'
=>
'
weixiuhui010
'
'username'
=>
'
R7551
0005'
,
'pwd'
=>
'
dgqh!769
'
];
$this
->
load
->
library
(
'Source/SourceGalanz'
,
$account
,
'SourceGalanz'
);
...
...
application/helpers/base_helper.php
View file @
2c4eec27
...
...
@@ -43,6 +43,43 @@ function str_aes($str, $key='', $type='en')
return
$result
;
}
/**
* 接口返回值
* @param bool $code
* @param string $msg
* @param array $data
*/
function
return_msg
(
$code
=
true
,
$msg
=
''
,
$data
=
[])
{
$return
[
'return_code'
]
=
$code
?
'SUCCESS'
:
'FAIL'
;
$return
[
'return_msg'
]
=
$code
?
'成功'
:
$msg
;
if
(
$data
)
{
if
(
!
is_array
(
$data
))
{
$return
[
'return_data'
]
=
$data
;
}
if
(
is_array
(
$data
)
&&
$data
)
{
$flag
=
false
;
foreach
(
$data
as
$k
=>
$v
)
{
if
(
is_array
(
$v
))
{
$flag
=
true
;
break
;
}
}
if
(
$flag
)
{
$return
[
'return_data'
]
=
$data
;
}
else
{
$return
=
array_merge
(
$return
,
$data
);
}
}
}
echo
json_encode
(
$return
,
JSON_UNESCAPED_UNICODE
);
die
();
}
function
curl_get
(
$url
)
{
$curl
=
curl_init
();
curl_setopt
(
$curl
,
CURLOPT_URL
,
$url
);
...
...
application/libraries/Receive/Receive.php
View file @
2c4eec27
...
...
@@ -186,8 +186,22 @@ class Receive
if
(
!
is_array
(
$data
))
{
$return
[
'return_data'
]
=
$data
;
}
$return
=
array_merge
(
$return
,
$data
);
if
(
is_array
(
$data
)
&&
$data
)
{
$flag
=
false
;
foreach
(
$data
as
$k
=>
$v
)
{
if
(
is_array
(
$v
))
{
$flag
=
true
;
break
;
}
}
if
(
$flag
)
{
$return
[
'return_data'
]
=
$data
;
}
else
{
$return
=
array_merge
(
$return
,
$data
);
}
}
}
return
json_encode
(
$return
,
JSON_UNESCAPED_UNICODE
);
...
...
application/libraries/Receive/ReceiveGalanz.php
View file @
2c4eec27
...
...
@@ -15,13 +15,13 @@ class ReceiveGalanz extends Receive
*/
public
function
CheckQueryOrderValues
()
{
$fileds
=
[
'out_trade_no'
,
'account'
];
$fileds
=
[
'out_trade_no'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
CheckQueryWorkOrderValues
()
{
$fileds
=
[
'work_order_no'
,
'account'
];
$fileds
=
[
'work_order_no'
];
$this
->
CheckValues
(
$fileds
);
}
...
...
@@ -30,7 +30,7 @@ class ReceiveGalanz extends Receive
*/
public
function
CheckSearchOrderValues
()
{
$fileds
=
[
'out_trade_no'
,
'account'
];
$fileds
=
[
'out_trade_no'
];
$this
->
CheckValues
(
$fileds
);
}
...
...
@@ -39,7 +39,7 @@ class ReceiveGalanz extends Receive
*/
public
function
CheckSaveOrderValues
()
{
$fileds
=
[
'out_trade_no'
,
'account'
];
$fileds
=
[
'out_trade_no'
];
$this
->
CheckValues
(
$fileds
);
$dfields
=
[
...
...
@@ -78,7 +78,7 @@ class ReceiveGalanz extends Receive
*/
public
function
CheckCreateWorkOrderValues
()
{
$fileds
=
[
'out_trade_no'
,
'account'
];
$fileds
=
[
'out_trade_no'
];
$this
->
CheckValues
(
$fileds
);
}
...
...
@@ -87,31 +87,79 @@ class ReceiveGalanz extends Receive
*/
public
function
CheckCreateUserProfileOrderValues
()
{
$fileds
=
[
'out_trade_no'
,
'account'
];
$fileds
=
[
'out_trade_no'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
CheckSaveWorkOrderValues
()
{
$fileds
=
[
'work_order_no'
,
'account'
];
$fileds
=
[
'work_order_no'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
CheckSendWorkOrderValues
()
{
$fileds
=
[
'work_order_no'
,
'account'
];
$fileds
=
[
'work_order_no'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
CheckSaveUserProfileOrderValues
()
{
$fileds
=
[
'up_order_no'
,
'account'
];
$fileds
=
[
'up_order_no'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
CheckSendUserProfileOrderValues
()
{
$fileds
=
[
'up_order_no'
,
'account'
];
$fileds
=
[
'up_order_no'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
CheckAddProdWorkOrderValues
()
{
$fileds
=
[
'work_order_no'
,
'txtproducenumber'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
CheckAddErrorWorkOrderValues
()
{
$fileds
=
[
'work_order_no'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
CheckAddPartsWorkOrderValues
()
{
$fileds
=
[
'work_order_no'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
CheckLookupErrormModuleValues
()
{
$fileds
=
[
'workorderproductid'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
CheckLookupErrorGroupValues
()
{
$fileds
=
[
'errormoduleid'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
CheckLookupErrorSolutionValues
()
{
$fileds
=
[
'errorgroupid'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
CheckLookupErrorPartsValues
()
{
$fileds
=
[
'errorsolutionid'
,
'workorderproductid'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
CheckLookupPartsValues
()
{
$fileds
=
[
'siteid'
,
'errorpartsid'
];
$this
->
CheckValues
(
$fileds
);
}
...
...
@@ -133,6 +181,14 @@ class ReceiveGalanz extends Receive
$this
->
ReturnMessage
(
false
,
'签名错误!'
);
}
if
(
!
array_key_exists
(
'account'
,
$this
->
values
)
||
$this
->
values
[
'account'
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"account参数错误!"
);
}
if
(
!
array_key_exists
(
'pwd'
,
$this
->
values
)
||
$this
->
values
[
'pwd'
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"pwd参数错误!"
);
}
if
(
$fields
)
{
foreach
(
$fields
as
$v
)
{
if
(
!
array_key_exists
(
$v
,
$this
->
values
)
||
$this
->
values
[
$v
]
==
''
)
{
...
...
application/libraries/Source/SourceGalanz.php
View file @
2c4eec27
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