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
e490edd7
Commit
e490edd7
authored
Feb 16, 2017
by
蒋林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
格兰仕-公告查询接口
parent
cb4a5cf2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
247 additions
and
4 deletions
+247
-4
Galanz.php
application/controllers/api/Galanz.php
+34
-0
Galanz.php
application/controllers/test/Galanz.php
+52
-3
Hisense.php
application/controllers/test/Hisense.php
+1
-1
ReceiveGalanz.php
application/libraries/Receive/ReceiveGalanz.php
+20
-0
SourceGalanz.php
application/libraries/Source/SourceGalanz.php
+86
-0
galanz.md
docs/galanz.md
+54
-0
No files found.
application/controllers/api/Galanz.php
View file @
e490edd7
...
@@ -25,6 +25,40 @@ class Galanz extends BaseController
...
@@ -25,6 +25,40 @@ class Galanz extends BaseController
parent
::
__construct
();
parent
::
__construct
();
}
}
public
function
noticeReadCondition
()
{
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveGalanzObj
();
$obj
->
SetValues
(
$param
);
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
''
,
'noticeReadCondition'
,
$param
);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$sourceGalanzObj
->
NoticeReadCondition
();
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
//查询订单
public
function
noticeRead
()
{
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveGalanzObj
();
$obj
->
SetValues
(
$param
);
$obj
->
CheckNoticeReadValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
''
,
'noticeRead'
,
$param
);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$result
=
$sourceGalanzObj
->
NoticeRead
(
$values
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
//查询订单
//查询订单
public
function
queryOrder
()
public
function
queryOrder
()
{
{
...
...
application/controllers/test/Galanz.php
View file @
e490edd7
...
@@ -57,11 +57,62 @@ class Galanz extends BaseController
...
@@ -57,11 +57,62 @@ class Galanz extends BaseController
{
{
$sobj
=
$this
->
sourceGalanzObj
();
$sobj
=
$this
->
sourceGalanzObj
();
$order
=
$sobj
->
LookupParts
(
'7a41b551-9aca-439e-99ed-5f05e54477fc'
,
'c6f7c2e0-7371-422b-95e2-625076ddfd5b'
,
'253019000135'
);
$order
=
$sobj
->
NoticeRead
(
);
print_r
(
$order
);
print_r
(
$order
);
}
}
public
function
noticeReadCondition
()
{
$obj
=
$this
->
galanzObj
();
$data
=
[
'appid'
=>
'10001'
,
'account'
=>
self
::
$testu
,
'pwd'
=>
self
::
$testp
,
];
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$url
=
self
::
$apiUrl
.
"api/galanz/noticeReadCondition"
;
$result
=
curl_post
(
$url
,
$values
);
//$result['data'] = json_decode($result['data'], true);
$this
->
show
(
$result
);
}
public
function
noticeRead
()
{
$obj
=
$this
->
galanzObj
();
$data
=
[
'appid'
=>
'10001'
,
'account'
=>
self
::
$testu
,
'pwd'
=>
self
::
$testp
,
'dateBegin'
=>
"20170109"
,
'dateEnd'
=>
'20170215'
,
'noticeType'
=>
''
,
'title'
=>
''
,
'status'
=>
'2'
,
];
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$url
=
self
::
$apiUrl
.
"api/galanz/noticeRead"
;
$result
=
curl_post
(
$url
,
$values
);
//$result['data'] = json_decode($result['data'], true);
$this
->
show
(
$result
);
}
public
function
lookupParts
()
public
function
lookupParts
()
{
{
$obj
=
$this
->
galanzObj
();
$obj
=
$this
->
galanzObj
();
...
@@ -90,8 +141,6 @@ class Galanz extends BaseController
...
@@ -90,8 +141,6 @@ class Galanz extends BaseController
$this
->
show
(
$result
);
$this
->
show
(
$result
);
}
}
public
function
mail
()
public
function
mail
()
{
{
// $mail= '18611475060@163.com';
// $mail= '18611475060@163.com';
...
...
application/controllers/test/Hisense.php
View file @
e490edd7
...
@@ -49,7 +49,7 @@ class Hisense extends BaseController
...
@@ -49,7 +49,7 @@ class Hisense extends BaseController
public
function
param
()
public
function
param
()
{
{
$str
=
'refuse_reason=&perPageCount=15&personlist=ZJ16122203844735&project_no=&contact_count=1&contact_count=0&personlist=ZJ16122203844595&project_no=&contact_count=1&contact_count=0&project_no=&contact_count=1&contact_count=0&project_no=&contact_count=1&contact_count=0&jump=1&pageNo=1&sortName=ROW_ID+desc&imgName=document.img_a&imgSort=false&pMethod='
;
$str
=
"__EVENTTARGET=&__EVENTARGUMENT=&__LASTFOCUS=&__VIEWSTATE=%2FwEPDwUJNzA3NzQwMTkxDxYCHhNWYWxpZGF0ZVJlcXVlc3RNb2RlAgEWAmYPZBYCAgMPZBYEAgcPZBYCAgUPEGQQFQgM6K%2B36YCJ5oupLi4uEue7k%2Beul%2BS4juaxh%2Basvuexuwzlhazlj7jpgJrnn6UG5YWs5ZGKDOaKgOacr%2BWfueiurQzljqjmiL%2FnlLXlmagWMjAxNeepuuiwg%2BaXuuWto%2BWNj%2Biurj%2FlhbPkuo7liLbkvZzmoLzlhbDku5XnqbrosIPmnI3liqHkurrlkZjmnI3liqHor4HnmoTmjIflvJXpgJrnn6UVCAItMSQyMWY2YmE4Mi05Yzg1LWU0MTEtODBj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dGwwNAUlY3RsMDAkQ29udGVudERhdGEkUGFnZXJUb29sQmFyMSRsbmtHb6A9%2B5Ln7wIDcXOxC3mXZ3xOvzx3piYPArtrx8SU6RG2&ctl00%24hidPageSiteMapTitle=%E5%85%AC%E5%91%8A%E9%98%85%E8%AF%BB%E5%8F%8A%E5%9B%9E%E5%A4%8D&ctl00%24ContentQuery%24txtDateBegin=2017%2F02%2F09&ctl00%24ContentQuery%24txtDateEnd=2017%2F02%2F16&ctl00%24ContentQuery%24ddlNoticeType=978d8c0f-50c2-e411-80cc-00155d016a1c&ctl00%24ContentQuery%24btnQuery=%E6%9F%A5%E8%AF%A2&ctl00%24ContentQuery%24txtTitle=&ctl00%24ContentQuery%24ddlStatus=2&ctl00%24ContentData%24rpt%24ctl00%24Hidden1=2&ctl00%24ContentData%24PagerToolBar1%24ctl00=50&ctl00%24ContentData%24PagerToolBar1%24ctl05=1"
;
parse_str
(
$str
,
$r
);
parse_str
(
$str
,
$r
);
$str
=
''
;
$str
=
''
;
...
...
application/libraries/Receive/ReceiveGalanz.php
View file @
e490edd7
...
@@ -10,6 +10,26 @@ require 'Receive.php';
...
@@ -10,6 +10,26 @@ require 'Receive.php';
class
ReceiveGalanz
extends
Receive
class
ReceiveGalanz
extends
Receive
{
{
public
function
CheckNoticeReadValues
()
{
$this
->
CheckValues
();
$dfields
=
[
'dateBegin'
,
'dateEnd'
,
'noticeType'
,
'title'
,
'status'
,
];
$this
->
SetDefaultValues
(
$dfields
);
$this
->
values
[
'status'
]
=
$this
->
values
[
'status'
]
+
0
;
$this
->
values
[
'status'
]
=
$this
->
values
[
'status'
]
==
2
?
'2'
:
'1'
;
$this
->
values
[
'dateBegin'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'dateBegin'
],
'Y/m/d'
);
$this
->
values
[
'dateEnd'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'dateEnd'
],
'Y/m/d'
);
}
/**
/**
* 订单详情
* 订单详情
*/
*/
...
...
application/libraries/Source/SourceGalanz.php
View file @
e490edd7
...
@@ -106,6 +106,92 @@ class SourceGalanz extends Source
...
@@ -106,6 +106,92 @@ class SourceGalanz extends Source
return
$result
;
return
$result
;
}
}
/**
* 公告查询
* @param array $condition
* @return array
*/
public
function
NoticeRead
(
$condition
=
[])
{
$post
=
[
'__EVENTTARGET'
=>
''
,
'__EVENTARGUMENT'
=>
''
,
'__LASTFOCUS'
=>
''
,
'__VIEWSTATE'
=>
''
,
'ctl00$hidPageSiteMapTitle'
=>
'公告阅读及回复'
,
'ctl00$ContentQuery$txtDateBegin'
=>
$condition
[
'dateBegin'
]
?
$condition
[
'dateBegin'
]
:
date
(
'Y/m/d'
,
strtotime
(
"-7 day"
)),
//2017/02/09
'ctl00$ContentQuery$txtDateEnd'
=>
$condition
[
'dateEnd'
]
?
$condition
[
'dateEnd'
]
:
date
(
'Y/m/d'
),
//2017/02/16
'ctl00$ContentQuery$ddlNoticeType'
=>
$condition
[
'noticeType'
]
?
$condition
[
'noticeType'
]
:
'-1'
,
'ctl00$ContentQuery$btnQuery'
=>
'查询'
,
'ctl00$ContentQuery$txtTitle'
=>
$condition
[
'title'
]
?
$condition
[
'title'
]
:
''
,
'ctl00$ContentQuery$ddlStatus'
=>
$condition
[
'status'
]
?
$condition
[
'status'
]
:
1
,
//'ctl00$ContentData$rpt$ctl00$Hidden1' => '2',
'ctl00$ContentData$PagerToolBar1$ctl00'
=>
'50'
,
'ctl00$ContentData$PagerToolBar1$ctl05'
=>
'1'
];
$url
=
self
::
$host
.
"/Notice/FNoticeReadMP.aspx"
;
$html
=
$this
->
GetUrlContents
(
$url
);
$post
[
'__VIEWSTATE'
]
=
$this
->
OrderFormValue
(
$html
,
$this
->
OrderFormReg
(
'__VIEWSTATE'
));
$headers
=
$this
->
Header
(
$url
);
$html
=
$this
->
CurlPost
(
$url
,
$post
,
$headers
);
$html
=
gzdecode
(
$html
[
'data'
]);
preg_match
(
'/id="tableList"[^>]+>[\s\S]+?<\/table>/'
,
$html
,
$tableHtml
);
preg_match
(
'/<tbody>[\s\S]+?<\/tbody>/'
,
$tableHtml
[
0
],
$tbodyHtml
);
preg_match_all
(
'/<tr>[\s\S]+?<\/tr>/'
,
$tbodyHtml
[
0
],
$trHtml
);
$result
=
[];
if
(
isset
(
$trHtml
[
0
]))
{
$fileds
=
[
'title'
,
'publishDate'
,
'publisher'
,
'bu'
,
'noticeType'
,
'isReply'
,
'isHaveNum'
,
'replyNum'
,
'isUrgent'
,
'status'
];
foreach
(
$trHtml
[
0
]
as
$value
)
{
$value
=
$this
->
PregTableTr
(
$value
);
array_shift
(
$value
);
$value
[
9
]
=
$value
[
9
]
==
1
?
"未读"
:
"已读"
;
$result
[]
=
array_combine
(
$fileds
,
$value
);
}
}
return
$result
;
}
/**
* 公告查询条件
* @return array
*/
public
function
NoticeReadCondition
()
{
$url
=
self
::
$host
.
"/Notice/FNoticeReadMP.aspx"
;
$html
=
$this
->
GetUrlContents
(
$url
);
$condition
=
$this
->
ConditionSelect
(
$html
);
if
(
$condition
)
{
$result
=
[
'noticeType'
=>
$condition
[
'ctl00$ContentQuery$ddlNoticeType'
],
'status'
=>
$condition
[
'ctl00$ContentQuery$ddlStatus'
]
];
return
$result
;
}
else
{
return_msg
(
false
,
'查询条件获取失败,请重试'
);
}
}
/**
/**
* 派工单保存
* 派工单保存
* @param $id
* @param $id
...
...
docs/galanz.md
View file @
e490edd7
...
@@ -1239,3 +1239,57 @@ Array
...
@@ -1239,3 +1239,57 @@ Array
[return_msg] => 安装单[0]发送成功
[return_msg] => 安装单[0]发送成功
)
)
```
```
## 四. 公告阅读
### 1. 查询公告条件
接口链接: /api/galanz/noticeReadCondition
字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述
---|---|---|---|---|---
账号ID | appid | 是 | String(32) | 10001 |
随机字符串 | nonce_str | 是 | String(32) | 76bt136lwffmhxdxykqmkej1hdhehcpn |
签名 | sign | 是 | String(32) | 5K8264ILTKCH16CQ2502SI8ZNMTM67VS |
[
签名算法
](
https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=4_3
)
账号 | account | 是 | String(32) | c01000005 | 系统账号
密码 | pwd | 是 | String(32) | c01000005 |
###### 返回结果
字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述
---|---|---|---|---|---
返回状态码 | return_code | 是 | String(32) | SUCCESS | SUCCESS/FAIL,是否成功需要查看result_code来判断
返回信息 | return_msg | 否 | String(128) | 签名失败 | 错误原因
```
{"return_code":"SUCCESS","return_msg":"成功","return_data":{"noticeType":{"key":["-1","21f6ba82-9c85-e411-80cb-00155d016a1c","9d4973e9-4fc1-e411-80cc-00155d016a1c","45c4f9f2-46c2-e411-80cc-00155d016a1c","978d8c0f-50c2-e411-80cc-00155d016a1c","0ab9ea0f-d0c2-e411-80cc-00155d016a1c","c13fa1d9-40ef-e411-80cc-00155d016a1c","372befd8-22fa-e411-80cc-00155d016a1c"],"val":["请选择...","结算与汇款类","公司通知","公告","技术培训","厨房电器","2015空调旺季协议","关于制作格兰仕空调服务人员服务证的指引通知"]},"status":{"key":["1","2"],"val":["未读","已读"]}}}
```
### 2. 查询公告
接口链接: /api/galanz/noticeRead
字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述
---|---|---|---|---|---
账号ID | appid | 是 | String(32) | 10001 |
随机字符串 | nonce_str | 是 | String(32) | 76bt136lwffmhxdxykqmkej1hdhehcpn |
签名 | sign | 是 | String(32) | 5K8264ILTKCH16CQ2502SI8ZNMTM67VS |
[
签名算法
](
https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=4_3
)
账号 | account | 是 | String(32) | c01000005 | 系统账号
密码 | pwd | 是 | String(32) | c01000005 |
开始日期 | dateBegin | 否 | String(32) | 20170109 |
结束日期 | dateEnd | 否 | String(32) | 20170216 |
公告类型 | noticeType | 否 | String(32) | | noticeReadCondition->noticeType
公告标题 | title | 否 | String(32) | |
公告状态 | status | 否 | String(32) | 1 | noticeReadCondition->status
###### 返回结果
字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述
---|---|---|---|---|---
返回状态码 | return_code | 是 | String(32) | SUCCESS | SUCCESS/FAIL,是否成功需要查看result_code来判断
返回信息 | return_msg | 否 | String(128) | 签名失败 | 错误原因
```
{"return_code":"SUCCESS","return_msg":"成功","return_data":[{"title":"关于ZG812T投币器不吃币故障的维修指引","publishDate":"2017\/02\/14 16:02","publisher":"汤强","bu":"格兰仕","noticeType":"技术培训","isReply":"是","isHaveNum":"是","replyNum":"","isUrgent":"否","status":"已读"},{"title":"关于E09维修操作指引","publishDate":"2017\/01\/13 14:09","publisher":"汤强","bu":"格兰仕","noticeType":"技术培训","isReply":"否","isHaveNum":"否","replyNum":"","isUrgent":"否","status":"已读"}]}
```
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