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
6f7520ad
Commit
6f7520ad
authored
Nov 08, 2016
by
蒋林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
呼叫受理-上门服务
parent
5f8fbafe
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
214 additions
and
17 deletions
+214
-17
Chigo.php
application/controllers/api/Chigo.php
+23
-4
Chigo.php
application/controllers/test/Chigo.php
+60
-5
ReceiveChigo.php
application/libraries/Receive/ReceiveChigo.php
+66
-1
SourceChigo.php
application/libraries/Source/SourceChigo.php
+65
-7
No files found.
application/controllers/api/Chigo.php
View file @
6f7520ad
...
@@ -19,19 +19,38 @@ defined('BASEPATH') OR exit('No direct script access allowed');
...
@@ -19,19 +19,38 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class
Chigo
extends
BaseController
class
Chigo
extends
BaseController
{
{
public
function
callAcceptAction
()
//呼叫受理-业务-服务商预约
public
function
facilitatorReservation
()
{
{
$param
=
$this
->
input
->
post
();
$param
=
$this
->
input
->
post
();
//验证参数
//验证参数
$obj
=
$this
->
receiveObj
();
$obj
=
$this
->
receiveObj
();
$obj
->
SetValues
(
$param
);
$obj
->
SetValues
(
$param
);
$obj
->
Check
CallAcceptAc
tionValues
();
$obj
->
Check
FacilitatorReserva
tionValues
();
$values
=
$obj
->
GetValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
''
,
'
callAcceptAc
tion'
,
$values
);
$this
->
saveLog
(
''
,
'
facilitatorReserva
tion'
,
$values
);
$sourceObj
=
$this
->
sourceObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceObj
=
$this
->
sourceObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$sourceObj
->
CallAcceptAction
(
$values
);
$result
=
$sourceObj
->
FacilitatorReservation
(
$values
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
//呼叫受理-业务-上门服务
public
function
visitingService
()
{
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveObj
();
$obj
->
SetValues
(
$param
);
$obj
->
CheckVisitingServiceValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
''
,
'visitingService'
,
$values
);
$sourceObj
=
$this
->
sourceObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$sourceObj
->
VisitingService
(
$values
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
}
...
...
application/controllers/test/Chigo.php
View file @
6f7520ad
...
@@ -38,14 +38,38 @@ class Chigo extends BaseController
...
@@ -38,14 +38,38 @@ class Chigo extends BaseController
public
function
test
()
public
function
test
()
{
{
//
$sobj = $this->sourceObj();
$sobj
=
$this
->
sourceObj
();
//$res = $sobj->CallAcceptAction();
$data
=
[
'adat_begin'
=>
'20161001'
,
'adat_end'
=>
'20161130'
,
'mobile'
=>
''
,
'phone'
=>
''
,
'proc_state'
=>
''
,
//处理状态: 所有:"" 0:中心派工; 1:上门服务; 2:完成;
'ano'
=>
''
,
'ctype'
=>
''
,
//类型: 所有:"" ; 1:家用; 2:制冷设备; 3:商用;
'bxcd'
=>
'1'
,
//报修催单: 1:选中; 0:未选中
];
$res
=
$sobj
->
VisitingService
(
$data
);
print_r
(
$res
);
}
public
function
xml
()
{
$xml
=
'<?xml version="1.0" encoding="gbk" standalone="yes"?>
//$this->show($res);
<DATAPACKET Version="2.0"><METADATA><FIELDS><FIELD attrname="ANO" fieldtype="string" WIDTH="128" /><FIELD attrname="APEO" fieldtype="string" WIDTH="255" /><FIELD attrname="AUNI" fieldtype="string" WIDTH="512" /><FIELD attrname="ADAT" fieldtype="datetime" WIDTH="7" /><FIELD attrname="DUPL" fieldtype="string" WIDTH="1" /><FIELD attrname="ZCOD" fieldtype="string" WIDTH="64" /><FIELD attrname="TELE" fieldtype="string" WIDTH="16" /><FIELD attrname="EXTC" fieldtype="string" WIDTH="10" /><FIELD attrname="MOBI" fieldtype="string" WIDTH="64" /><FIELD attrname="CENT" fieldtype="string" WIDTH="40" /><FIELD attrname="CUNA" fieldtype="string" WIDTH="255" /><FIELD attrname="ADDR" fieldtype="string" WIDTH="500" /><FIELD attrname="SHOP" fieldtype="string" WIDTH="255" /><FIELD attrname="MDEL" fieldtype="string" WIDTH="200" /><FIELD attrname="BUYD" fieldtype="datetime" WIDTH="7" /><FIELD attrname="MAKE" fieldtype="string" WIDTH="20" /><FIELD attrname="INST" fieldtype="string" WIDTH="255" /><FIELD attrname="TTYP" fieldtype="string" WIDTH="20" /><FIELD attrname="URGE" fieldtype="string" WIDTH="20" /><FIELD attrname="REMO" fieldtype="string" WIDTH="1" /><FIELD attrname="INSU" fieldtype="string" WIDTH="1" /><FIELD attrname="FAPP" fieldtype="string" WIDTH="200" /><FIELD attrname="OAPP" fieldtype="string" WIDTH="200" /><FIELD attrname="AFBA" fieldtype="string" WIDTH="600" /><FIELD attrname="AREM" fieldtype="string" WIDTH="600" /><FIELD attrname="HWAY" fieldtype="string" WIDTH="30" /><FIELD attrname="SERN" fieldtype="string" WIDTH="128" /><FIELD attrname="SERC" fieldtype="string" WIDTH="255" /><FIELD attrname="REQU" fieldtype="datetime" WIDTH="7" /><FIELD attrname="OPEO" fieldtype="string" WIDTH="255" /><FIELD attrname="OPDT" fieldtype="datetime" WIDTH="7" /><FIELD attrname="IFCO" fieldtype="string" WIDTH="1" /><FIELD attrname="COTI" fieldtype="datetime" WIDTH="7" /><FIELD attrname="RENO" fieldtype="string" WIDTH="14" /><FIELD attrname="SERP" fieldtype="string" WIDTH="24" /><FIELD attrname="FIDA" fieldtype="datetime" WIDTH="7" /><FIELD attrname="SETI" fieldtype="string" WIDTH="20" /><FIELD attrname="NOTR" fieldtype="string" WIDTH="200" /><FIELD attrname="MRES" fieldtype="string" WIDTH="800" /><FIELD attrname="RESU" fieldtype="string" WIDTH="2" /><FIELD attrname="RECI" fieldtype="string" WIDTH="1" /><FIELD attrname="HAND" fieldtype="string" WIDTH="1" /><FIELD attrname="RETI" fieldtype="datetime" WIDTH="7" /><FIELD attrname="REQT" fieldtype="string" WIDTH="6" /><FIELD attrname="REPT" fieldtype="string" WIDTH="6" /><FIELD attrname="SMSM" fieldtype="string" WIDTH="200" /><FIELD attrname="UNID" fieldtype="string" WIDTH="32" /><FIELD attrname="LOCK_FLAG" fieldtype="r8" WIDTH="22" /><FIELD attrname="KAOHE_FLAG" fieldtype="string" WIDTH="1" /><FIELD attrname="REMO_DIST" fieldtype="r8" WIDTH="22" /><FIELD attrname="TYPE" fieldtype="string" WIDTH="20" /><FIELD attrname="RS_LOCK_BY" fieldtype="r8" WIDTH="22" /><FIELD attrname="RS_LOCK_TIME" fieldtype="datetime" WIDTH="7" /><FIELD attrname="NEED_REVISIT" fieldtype="r8" WIDTH="22" /><FIELD attrname="CTYPE" fieldtype="string" WIDTH="20" /><FIELD attrname="ISCHECK" fieldtype="string" WIDTH="1" /><FIELD attrname="CHECKDATE" fieldtype="datetime" WIDTH="7" /><FIELD attrname="CHECKTIME" fieldtype="datetime" WIDTH="7" /><FIELD attrname="CHECKDAY" fieldtype="string" WIDTH="10" /><FIELD attrname="CHECKJIANGLI" fieldtype="string" WIDTH="10" /><FIELD attrname="CHECK_BACK" fieldtype="string" WIDTH="200" /><FIELD attrname="REOR" fieldtype="string" WIDTH="1" /><FIELD attrname="SER_MOBILE" fieldtype="string" WIDTH="11" /><FIELD attrname="CENTER_TEL" fieldtype="string" WIDTH="20" /><FIELD attrname="SEND_TO_SER" fieldtype="string" WIDTH="1" /><FIELD attrname="SER_TEL" fieldtype="string" WIDTH="20" /><FIELD attrname="JYY" fieldtype="string" WIDTH="1" /><FIELD attrname="JWJ" fieldtype="string" WIDTH="1" /><FIELD attrname="DTWCL" fieldtype="string" WIDTH="1" /><FIELD attrname="ORG_TELE" fieldtype="string" WIDTH="20" /><FIELD attrname="ORG_MOBI" fieldtype="string" WIDTH="20" /><FIELD attrname="ORG_ANO" fieldtype="string" WIDTH="128" /><FIELD attrname="DAIB" fieldtype="string" WIDTH="1" /><FIELD attrname="SRC" fieldtype="string" WIDTH="1" /><FIELD attrname="DQBM" fieldtype="string" WIDTH="128" /><FIELD attrname="REMO_D" fieldtype="string" WIDTH="2" /><FIELD attrname="IFCO_D" fieldtype="string" WIDTH="2" /><FIELD attrname="REMAINTIME" fieldtype="r8" WIDTH="22" /><FIELD attrname="ELAPSE_TIME" fieldtype="r8" WIDTH="22" /></FIELDS><PARAMS statecode="1" message="1" /></METADATA><ROWDATA><ROW ANO="0020201610032406" APEO="林敏怡" AUNI="志高总部,客户服务部" ADAT="2016-10-03T10:57:15.0" DUPL="" ZCOD="0020" TELE="" EXTC="" MOBI="13477650906" CENT="广州中心" CUNA="胡女士" ADDR="广东省广州市南沙区大岗镇豪岗大道粤华大厦9号101号铺神奇天天瘦" SHOP="网上 " MDEL="KFR-72LW/N33+N3" BUYD="2016-06-01T00:00:00.0" MAKE="志高" INST="" TTYP="维修投诉" URGE="一般客户" REMO="0" INSU="1" FAPP="服务不及时,未在约定时间上门" OAPP="" AFBA="用户再次来电反映师傅一直就没联系上门 主动联系师傅 还一直拖不上门 请求尽快跟进" AREM="" HWAY="委派服务商上门服务" SERN="0200145" SERC="广州桥上网络科技有限公司" REQU="2016-10-03T12:15:06.0" OPEO="林晓玲" OPDT="2016-10-03T11:15:04.0" IFCO="1" COTI="2016-10-03T14:17:56.0" RENO="" SERP="陈强" FIDA="2016-10-07T14:18:23.0" SETI="99" NOTR="" MRES="漏雪种,加雪种正常" RESU="1" RECI="Y" HAND="2" RETI="2016-10-03T11:15:11.0" REQT="1" REPT="1" SMSM="" UNID="" LOCK_FLAG="" KAOHE_FLAG="" REMO_DIST="" TYPE="家用" RS_LOCK_BY="" RS_LOCK_TIME="" NEED_REVISIT="1" CTYPE="家用" ISCHECK="Y" CHECKDATE="2016-10-07T00:00:00.0" CHECKTIME="2016-10-07T14:17:39.0" CHECKDAY="上午" CHECKJIANGLI="0" CHECK_BACK="" REOR="" SER_MOBILE="13286688768" CENTER_TEL="36055720" SEND_TO_SER="0" SER_TEL="020-84347052" JYY="" JWJ="" DTWCL="1" ORG_TELE="" ORG_MOBI="13477650906" ORG_ANO="" DAIB="" SRC="" DQBM="" REMO_D="否" IFCO_D="是" REMAINTIME="0" ELAPSE_TIME="36.1215625" /></ROWDATA></DATAPACKET>'
;
$sobj
=
$this
->
sourceObj
();
$res
=
$sobj
->
XmlToArray
(
$xml
);
$this
->
show
(
$res
);
}
}
public
function
callAcceptAc
tion
()
public
function
facilitatorReserva
tion
()
{
{
$obj
=
$this
->
receiveObj
();
$obj
=
$this
->
receiveObj
();
...
@@ -66,7 +90,38 @@ class Chigo extends BaseController
...
@@ -66,7 +90,38 @@ class Chigo extends BaseController
$obj
->
SetSign
();
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$values
=
$obj
->
GetValues
();
$url
=
self
::
$apiUrl
.
"api/chigo/callAcceptAction"
;
$url
=
self
::
$apiUrl
.
"api/chigo/facilitatorReservation"
;
$result
=
curl_post
(
$url
,
$values
);
$result
=
json_decode
(
$result
[
'data'
],
true
);
$this
->
show
(
$result
);
}
public
function
visitingService
()
{
$obj
=
$this
->
receiveObj
();
$data
=
[
'appid'
=>
'10001'
,
'account'
=>
self
::
$testu
,
'pwd'
=>
self
::
$testp
,
'adat_begin'
=>
'20161001'
,
'adat_end'
=>
'20161130'
,
'mobile'
=>
''
,
'phone'
=>
''
,
'proc_state'
=>
''
,
//处理状态: 所有:"" 0:中心派工; 1:上门服务; 2:完成;
'ano'
=>
''
,
'ctype'
=>
'1'
,
//类型: 所有:"" ; 1:家用; 2:制冷设备; 3:商用;
'bxcd'
=>
'1'
,
//报修催单: 1:选中; 0:未选中
];
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$url
=
self
::
$apiUrl
.
"api/chigo/visitingService"
;
$result
=
curl_post
(
$url
,
$values
);
$result
=
curl_post
(
$url
,
$values
);
$result
=
json_decode
(
$result
[
'data'
],
true
);
$result
=
json_decode
(
$result
[
'data'
],
true
);
...
...
application/libraries/Receive/ReceiveChigo.php
View file @
6f7520ad
...
@@ -11,7 +11,7 @@ require 'Receive.php';
...
@@ -11,7 +11,7 @@ require 'Receive.php';
class
ReceiveChigo
extends
Receive
class
ReceiveChigo
extends
Receive
{
{
public
function
Check
CallAcceptAc
tionValues
()
public
function
Check
FacilitatorReserva
tionValues
()
{
{
$fileds
=
[];
$fileds
=
[];
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
...
@@ -48,6 +48,71 @@ class ReceiveChigo extends Receive
...
@@ -48,6 +48,71 @@ class ReceiveChigo extends Receive
}
}
}
}
public
function
CheckVisitingServiceValues
()
{
$fileds
=
[];
$this
->
CheckValues
(
$fileds
);
$dfields
=
[
'adat_begin'
,
//20161011
'adat_end'
,
'mobile'
,
'phone'
,
'proc_state'
,
//处理状态: 所有:"" 0:中心派工; 1:上门服务; 2:完成;
'ano'
,
'ctype'
,
//类型: 所有:"" ; 1:家用; 2:制冷设备; 3:商用;
'bxcd'
,
//报修催单: 1:选中; 0:未选中
];
$this
->
SetDefaultValues
(
$dfields
);
if
(
$this
->
values
[
'adat_begin'
])
{
$this
->
values
[
'adat_begin'
]
=
date
(
'Y-m-d'
,
strtotime
(
$this
->
values
[
'adat_begin'
]));
}
if
(
$this
->
values
[
'adat_end'
])
{
$this
->
values
[
'adat_end'
]
=
date
(
'Y-m-d'
,
strtotime
(
$this
->
values
[
'adat_end'
]));
}
if
(
$this
->
values
[
'bxcd'
])
{
$this
->
values
[
'bxcd'
]
=
strval
(
intval
(
$this
->
values
[
'bxcd'
]));
}
if
(
$this
->
values
[
'proc_state'
])
{
switch
(
$this
->
values
[
'proc_state'
])
{
case
0
:
$this
->
values
[
'proc_state'
]
=
'0'
;
break
;
case
1
:
$this
->
values
[
'proc_state'
]
=
'1'
;
break
;
case
2
:
$this
->
values
[
'proc_state'
]
=
'2'
;
break
;
default
:
$this
->
values
[
'proc_state'
]
=
''
;
}
}
if
(
$this
->
values
[
'ctype'
])
{
switch
(
$this
->
values
[
'ctype'
])
{
case
1
:
$this
->
values
[
'ctype'
]
=
'家用'
;
break
;
case
2
:
$this
->
values
[
'ctype'
]
=
'制冷设备'
;
break
;
case
3
:
$this
->
values
[
'ctype'
]
=
'商用'
;
break
;
default
:
$this
->
values
[
'ctype'
]
=
''
;
}
}
}
/**
/**
* 检查参数
* 检查参数
* @param array $fields
* @param array $fields
...
...
application/libraries/Source/SourceChigo.php
View file @
6f7520ad
...
@@ -35,9 +35,8 @@ class SourceChigo extends Source
...
@@ -35,9 +35,8 @@ class SourceChigo extends Source
* @param $condition
* @param $condition
* @return array
* @return array
*/
*/
public
function
CallAcceptAc
tion
(
$condition
)
public
function
FacilitatorReserva
tion
(
$condition
)
{
{
$url
=
"http://58.254.204.86:9001/cus/CallAcceptAction.do"
;
$post
=
[
$post
=
[
'adat_begin'
=>
$condition
[
'adat_begin'
],
//开始时间
'adat_begin'
=>
$condition
[
'adat_begin'
],
//开始时间
...
@@ -50,7 +49,53 @@ class SourceChigo extends Source
...
@@ -50,7 +49,53 @@ class SourceChigo extends Source
'check_state'
=>
'N'
,
'check_state'
=>
'N'
,
];
];
$xml
=
$this
->
ArrayToXml
(
'QuerySerNode'
,
$post
);
//debug
$this
->
Debug
(
'FacilitatorReservation'
,
$post
);
$data
=
$this
->
CallAcceptAction
(
'QuerySerNode'
,
$post
);
return
$data
;
}
/**
* 呼叫受理-业务-上门服务
* @param $condition
* @return array
*/
public
function
VisitingService
(
$condition
)
{
$post
=
[
'adat_begin'
=>
$condition
[
'adat_begin'
],
//开始时间
'adat_end'
=>
$condition
[
'adat_end'
],
//结束时间
'mobile'
=>
$condition
[
'mobile'
],
//手机
'phone'
=>
$condition
[
'phone'
],
//电话
'proc_state'
=>
$condition
[
'proc_state'
],
//处理状态: 所有:"" 0:中心派工; 1:上门服务; 2:完成;
'ano'
=>
$condition
[
'ano'
],
//受理单号
'check_state'
=>
'Y'
,
'ctype'
=>
$condition
[
'ctype'
],
//类型: 所有:"" ; 家用; 制冷设备; 商用;
'bxcd'
=>
$condition
[
'bxcd'
],
//报修催单: 1:选中; 0:未选中
];
//debug
$this
->
Debug
(
'VisitingService'
,
$post
);
//转码
$post
[
'ctype'
]
=
iconv
(
'UTF-8'
,
'GBK'
,
$post
[
'ctype'
]);
$data
=
$this
->
CallAcceptAction
(
'QuerySerNode'
,
$post
);
return
$data
;
}
/**
* 呼叫受理订单处理
* @param $type
* @param $post
* @return array
*/
private
function
CallAcceptAction
(
$type
,
$post
)
{
$url
=
"http://58.254.204.86:9001/cus/CallAcceptAction.do"
;
$xml
=
$this
->
ArrayToXml
(
$type
,
$post
);
$data
=
$this
->
CurlPostXml
(
$url
,
$xml
);
$data
=
$this
->
CurlPostXml
(
$url
,
$xml
);
$data
=
$this
->
XmlToArray
(
$data
[
'data'
]);
$data
=
$this
->
XmlToArray
(
$data
[
'data'
]);
...
@@ -183,17 +228,30 @@ class SourceChigo extends Source
...
@@ -183,17 +228,30 @@ class SourceChigo extends Source
}
}
//匹配数据
//匹配数据
preg_match_all
(
'/<ROW\s+([^\/|>]+)?/'
,
$xml
,
$data
);
preg_match_all
(
'/<ROW\s+([^>]+)\/?>/'
,
$xml
,
$data
);
//debug
$this
->
Debug
(
'XmlToArray'
,
$data
);
if
(
isset
(
$data
[
1
])
&&
$data
[
1
])
{
if
(
isset
(
$data
[
1
])
&&
$data
[
1
])
{
//数据处理个数
if
(
count
(
$data
[
1
])
>
50
)
{
$data
[
1
]
=
array_slice
(
$data
[
1
],
0
,
50
);
}
foreach
(
$data
[
1
]
as
$key
=>
$val
)
{
foreach
(
$data
[
1
]
as
$key
=>
$val
)
{
$val
=
preg_replace
(
'/"\s+/'
,
'"|||'
,
trim
(
$val
));
$val
=
html_entity_decode
(
trim
(
$val
));
$val
=
preg_replace
(
'/"\s+/'
,
'"|||'
,
$val
);
$val
=
str_replace
(
'="'
,
'||="'
,
$val
);
$val
=
explode
(
'|||'
,
str_replace
(
'"'
,
''
,
$val
));
$val
=
explode
(
'|||'
,
str_replace
(
'"'
,
''
,
$val
));
if
(
!
empty
(
$val
))
{
if
(
!
empty
(
$val
))
{
foreach
(
$val
as
$vall
)
{
foreach
(
$val
as
$vall
)
{
$vall
=
explode
(
"="
,
$vall
);
if
(
stripos
(
$vall
,
'||='
)
!==
false
)
{
$order
[
$key
][
strtolower
(
$vall
[
0
])]
=
html_entity_decode
(
$vall
[
1
]);
$vall
=
explode
(
"||="
,
$vall
);
$order
[
$key
][
strtolower
(
$vall
[
0
])]
=
$vall
[
1
];
}
}
}
}
}
}
}
...
...
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