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
c8183734
Commit
c8183734
authored
Nov 09, 2016
by
蒋林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
呼叫受理-安装业务
parent
6f7520ad
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
460 additions
and
275 deletions
+460
-275
Chigo.php
application/controllers/api/Chigo.php
+72
-0
Chigo.php
application/controllers/test/Chigo.php
+121
-14
Receive.php
application/libraries/Receive/Receive.php
+96
-0
ReceiveChigo.php
application/libraries/Receive/ReceiveChigo.php
+40
-115
ReceiveGalanz.php
application/libraries/Receive/ReceiveGalanz.php
+1
-59
ReceiveSuning.php
application/libraries/Receive/ReceiveSuning.php
+5
-71
SourceChigo.php
application/libraries/Source/SourceChigo.php
+125
-16
No files found.
application/controllers/api/Chigo.php
View file @
c8183734
...
@@ -55,6 +55,78 @@ class Chigo extends BaseController
...
@@ -55,6 +55,78 @@ class Chigo extends BaseController
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
}
//家用安装业务-业务-安装单录入
public
function
queryInstallBill
()
{
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveObj
();
$obj
->
SetValues
(
$param
);
$obj
->
CheckQueryInstallBillValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
''
,
'queryInstallBill'
,
$values
);
$sourceObj
=
$this
->
sourceObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$sourceObj
->
QueryInstallBill
(
$values
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
//家用安装业务-业务-安装单据结算
public
function
browseCloseAccount
()
{
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveObj
();
$obj
->
SetValues
(
$param
);
$obj
->
CheckBrowseCloseAccountValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
''
,
'browseCloseAccount'
,
$values
);
$sourceObj
=
$this
->
sourceObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$sourceObj
->
BrowseCloseAccount
(
$values
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
//服务商编号
public
function
pickupAllSerNodeForUser
()
{
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveObj
();
$obj
->
SetValues
(
$param
);
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
''
,
'pickupAllSerNodeForUser'
,
$values
);
$sourceObj
=
$this
->
sourceObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$sourceObj
->
PickupAllSerNodeForUser
();
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
//服务中心
public
function
pickupAllForUser
()
{
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveObj
();
$obj
->
SetValues
(
$param
);
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
''
,
'pickupAllForUser'
,
$values
);
$sourceObj
=
$this
->
sourceObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$sourceObj
->
PickupAllForUser
();
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
/**
/**
* 保存日志
* 保存日志
*
*
...
...
application/controllers/test/Chigo.php
View file @
c8183734
This diff is collapsed.
Click to expand it.
application/libraries/Receive/Receive.php
View file @
c8183734
...
@@ -168,4 +168,100 @@ class Receive
...
@@ -168,4 +168,100 @@ class Receive
return_msg
(
$code
,
$msg
,
$data
);
return_msg
(
$code
,
$msg
,
$data
);
}
}
/**
* 检查参数
* @param array $fields
*/
protected
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
(
!
array_key_exists
(
'account'
,
$this
->
values
)
||
$this
->
values
[
'account'
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"account参数错误!"
);
}
else
{
$this
->
values
[
'account'
]
=
trim
(
urldecode
(
$this
->
values
[
'account'
]));
}
if
(
!
array_key_exists
(
'pwd'
,
$this
->
values
)
||
$this
->
values
[
'pwd'
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"pwd参数错误!"
);
}
else
{
$this
->
values
[
'pwd'
]
=
trim
(
urldecode
(
$this
->
values
[
'pwd'
]));
}
if
(
$fields
)
{
foreach
(
$fields
as
$v
)
{
if
(
!
array_key_exists
(
$v
,
$this
->
values
)
||
$this
->
values
[
$v
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"
{
$v
}
参数错误!"
);
}
else
{
$this
->
values
[
$v
]
=
trim
(
urldecode
(
$this
->
values
[
$v
]));
}
}
}
}
/**
* 给指定参数增加默认值
* @param $fields
*/
protected
function
SetDefaultValues
(
$fields
)
{
if
(
$fields
)
{
foreach
(
$fields
as
$v
)
{
if
(
!
array_key_exists
(
$v
,
$this
->
values
))
{
$this
->
values
[
$v
]
=
''
;
}
else
{
$this
->
values
[
$v
]
=
urldecode
(
$this
->
values
[
$v
]);
}
}
}
}
protected
function
SelectValues
(
$val
,
$options
,
$default
=
''
)
{
if
(
empty
(
$val
))
{
return
$val
;
}
return
isset
(
$options
[
$val
])
?
$options
[
$val
]
:
$default
;
}
protected
function
IntValues
(
$val
,
$out
=
'int'
)
{
if
(
empty
(
$val
))
{
return
$val
;
}
$val
=
intval
(
$val
);
return
$out
==
'int'
?
$val
:
strval
(
$val
);
}
protected
function
DateFormatValues
(
$date
,
$format
=
'Y-m-d'
)
{
if
(
empty
(
$val
))
{
return
$date
;
}
return
date
(
$format
,
strtotime
(
$date
));
}
protected
function
TimeFormatValues
(
$time
,
$format
=
'Y-m-d'
)
{
if
(
empty
(
$val
))
{
return
$time
;
}
return
date
(
$format
,
$time
);
}
}
}
\ No newline at end of file
application/libraries/Receive/ReceiveChigo.php
View file @
c8183734
...
@@ -26,26 +26,10 @@ class ReceiveChigo extends Receive
...
@@ -26,26 +26,10 @@ class ReceiveChigo extends Receive
];
];
$this
->
SetDefaultValues
(
$dfields
);
$this
->
SetDefaultValues
(
$dfields
);
if
(
$this
->
values
[
'adat_begin'
])
{
$this
->
values
[
'adat_begin'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'adat_begin'
]);
$this
->
values
[
'adat_begin'
]
=
date
(
'Y-m-d'
,
strtotime
(
$this
->
values
[
'adat_begin'
]));
$this
->
values
[
'adat_end'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'adat_end'
]);
}
$select
=
[
''
,
'Y'
,
'N'
];
if
(
$this
->
values
[
'adat_end'
])
{
$this
->
values
[
'read_state'
]
=
$this
->
SelectValues
(
$this
->
values
[
'read_state'
],
$select
);
$this
->
values
[
'adat_end'
]
=
date
(
'Y-m-d'
,
strtotime
(
$this
->
values
[
'adat_end'
]));
}
if
(
$this
->
values
[
'read_state'
])
{
switch
(
$this
->
values
[
'read_state'
])
{
case
1
:
$this
->
values
[
'read_state'
]
=
'Y'
;
break
;
case
2
:
$this
->
values
[
'read_state'
]
=
'N'
;
break
;
default
:
$this
->
values
[
'read_state'
]
=
''
;
}
}
}
}
public
function
CheckVisitingServiceValues
()
public
function
CheckVisitingServiceValues
()
...
@@ -65,109 +49,50 @@ class ReceiveChigo extends Receive
...
@@ -65,109 +49,50 @@ class ReceiveChigo extends Receive
];
];
$this
->
SetDefaultValues
(
$dfields
);
$this
->
SetDefaultValues
(
$dfields
);
if
(
$this
->
values
[
'adat_begin'
])
{
$this
->
values
[
'adat_begin'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'adat_begin'
]);
$this
->
values
[
'adat_begin'
]
=
date
(
'Y-m-d'
,
strtotime
(
$this
->
values
[
'adat_begin'
]));
$this
->
values
[
'adat_end'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'adat_end'
]);
}
$this
->
values
[
'bxcd'
]
=
$this
->
IntValues
(
$this
->
values
[
'bxcd'
],
'str'
);
if
(
$this
->
values
[
'adat_end'
])
{
$select
=
[
'0'
,
'1'
,
'2'
];
$this
->
values
[
'adat_end'
]
=
date
(
'Y-m-d'
,
strtotime
(
$this
->
values
[
'adat_end'
]));
$this
->
values
[
'proc_state'
]
=
$this
->
SelectValues
(
$this
->
values
[
'proc_state'
],
$select
);
}
$select
=
[
''
,
'家用'
,
'制冷设备'
,
'商用'
];
if
(
$this
->
values
[
'bxcd'
])
{
$this
->
values
[
'ctype'
]
=
$this
->
SelectValues
(
$this
->
values
[
'proc_state'
],
$select
);
$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
:
public
function
CheckQueryInstallBillValues
()
$this
->
values
[
'ctype'
]
=
'制冷设备'
;
break
;
case
3
:
$this
->
values
[
'ctype'
]
=
'商用'
;
break
;
default
:
$this
->
values
[
'ctype'
]
=
''
;
}
}
}
/**
* 检查参数
* @param array $fields
*/
private
function
CheckValues
(
$fields
=
[])
{
{
if
(
!
$this
->
GetValues
())
{
$fileds
=
[];
$this
->
ReturnMessage
(
false
,
'参数错误!'
);
$this
->
CheckValues
(
$fileds
);
}
if
(
$this
->
CheckAppid
()
==
false
)
{
$this
->
ReturnMessage
(
false
,
'appid参数错误!'
);
}
if
(
$this
->
CheckSign
()
==
false
)
{
$dfields
=
[
$this
->
ReturnMessage
(
false
,
'签名错误!'
);
'input_date_begin'
,
//20161011
}
'input_date_end'
,
'node_id'
,
//0200145
'install_date_begin'
,
//20161011
'install_date_end'
,
'customer_name'
,
//菲菲
'warranty'
//
];
$this
->
SetDefaultValues
(
$dfields
);
if
(
!
array_key_exists
(
'account'
,
$this
->
values
)
||
$this
->
values
[
'account'
]
==
''
)
{
$this
->
values
[
'input_date_begin'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'input_date_begin'
]);
$this
->
ReturnMessage
(
false
,
"account参数错误!"
);
$this
->
values
[
'input_date_end'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'input_date_end'
]
);
}
else
{
$this
->
values
[
'install_date_begin'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'install_date_begin'
]);
$this
->
values
[
'account'
]
=
trim
(
urldecode
(
$this
->
values
[
'account'
])
);
$this
->
values
[
'install_date_end'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'install_date_end'
]
);
}
}
if
(
!
array_key_exists
(
'pwd'
,
$this
->
values
)
||
$this
->
values
[
'pwd'
]
==
''
)
{
public
function
CheckBrowseCloseAccountValues
()
$this
->
ReturnMessage
(
false
,
"pwd参数错误!"
);
{
}
else
{
$fileds
=
[];
$this
->
values
[
'pwd'
]
=
trim
(
urldecode
(
$this
->
values
[
'pwd'
]));
$this
->
CheckValues
(
$fileds
);
}
if
(
$fields
)
{
$dfields
=
[
foreach
(
$fields
as
$v
)
{
'periodb'
,
//201610
if
(
!
array_key_exists
(
$v
,
$this
->
values
)
||
$this
->
values
[
$v
]
==
''
)
{
'periode'
,
$this
->
ReturnMessage
(
false
,
"
{
$v
}
参数错误!"
);
'ser_node_id'
,
}
else
{
'center_code'
,
$this
->
values
[
$v
]
=
trim
(
urldecode
(
$this
->
values
[
$v
]));
];
}
$this
->
SetDefaultValues
(
$dfields
);
}
}
}
}
/**
* 给指定参数增加默认值
* @param $fields
*/
private
function
SetDefaultValues
(
$fields
)
{
if
(
$fields
)
{
foreach
(
$fields
as
$v
)
{
if
(
!
array_key_exists
(
$v
,
$this
->
values
))
{
$this
->
values
[
$v
]
=
''
;
}
else
{
$this
->
values
[
$v
]
=
urldecode
(
$this
->
values
[
$v
]);
}
}
}
}
}
}
\ No newline at end of file
application/libraries/Receive/ReceiveGalanz.php
View file @
c8183734
...
@@ -592,62 +592,4 @@ class ReceiveGalanz extends Receive
...
@@ -592,62 +592,4 @@ class ReceiveGalanz extends Receive
$this
->
CheckValues
(
$fileds
);
$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
(
!
array_key_exists
(
'account'
,
$this
->
values
)
||
$this
->
values
[
'account'
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"account参数错误!"
);
}
else
{
$this
->
values
[
'account'
]
=
trim
(
urldecode
(
$this
->
values
[
'account'
]));
}
if
(
!
array_key_exists
(
'pwd'
,
$this
->
values
)
||
$this
->
values
[
'pwd'
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"pwd参数错误!"
);
}
else
{
$this
->
values
[
'pwd'
]
=
trim
(
urldecode
(
$this
->
values
[
'pwd'
]));
}
if
(
$fields
)
{
foreach
(
$fields
as
$v
)
{
if
(
!
array_key_exists
(
$v
,
$this
->
values
)
||
$this
->
values
[
$v
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"
{
$v
}
参数错误!"
);
}
else
{
$this
->
values
[
$v
]
=
trim
(
urldecode
(
$this
->
values
[
$v
]));
}
}
}
}
/**
* 给指定参数增加默认值
* @param $fields
*/
private
function
SetDefaultValues
(
$fields
)
{
if
(
$fields
)
{
foreach
(
$fields
as
$v
)
{
if
(
!
array_key_exists
(
$v
,
$this
->
values
))
{
$this
->
values
[
$v
]
=
''
;
}
else
{
$this
->
values
[
$v
]
=
urldecode
(
$this
->
values
[
$v
]);
}
}
}
}
}
}
\ No newline at end of file
application/libraries/Receive/ReceiveSuning.php
View file @
c8183734
...
@@ -26,12 +26,8 @@ class ReceiveSuning extends Receive
...
@@ -26,12 +26,8 @@ class ReceiveSuning extends Receive
];
];
$this
->
SetDefaultValues
(
$dfields
);
$this
->
SetDefaultValues
(
$dfields
);
if
(
$this
->
values
[
'startTime'
])
{
$this
->
values
[
'startTime'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'startTime'
]);
$this
->
values
[
'startTime'
]
=
date
(
'Y-m-d'
,
strtotime
(
$this
->
values
[
'startTime'
]));
$this
->
values
[
'endTime'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'endTime'
]);
}
if
(
$this
->
values
[
'endTime'
])
{
$this
->
values
[
'endTime'
]
=
date
(
'Y-m-d'
,
strtotime
(
$this
->
values
[
'endTime'
]));
}
}
}
public
function
CheckReceiveServiceOrderValues
()
public
function
CheckReceiveServiceOrderValues
()
...
@@ -66,70 +62,8 @@ class ReceiveSuning extends Receive
...
@@ -66,70 +62,8 @@ class ReceiveSuning extends Receive
];
];
$this
->
SetDefaultValues
(
$dfields
);
$this
->
SetDefaultValues
(
$dfields
);
if
(
$this
->
values
[
'startTime'
])
{
$this
->
values
[
'startTime'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'startTime'
]);
$this
->
values
[
'startTime'
]
=
date
(
'Y-m-d'
,
strtotime
(
$this
->
values
[
'startTime'
]));
$this
->
values
[
'endTime'
]
=
$this
->
DateFormatValues
(
$this
->
values
[
'endTime'
]);
}
if
(
$this
->
values
[
'endTime'
])
{
$this
->
values
[
'endTime'
]
=
date
(
'Y-m-d'
,
strtotime
(
$this
->
values
[
'endTime'
]));
}
}
/**
* 检查参数
* @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
(
!
array_key_exists
(
'account'
,
$this
->
values
)
||
$this
->
values
[
'account'
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"account参数错误!"
);
}
else
{
$this
->
values
[
'account'
]
=
trim
(
urldecode
(
$this
->
values
[
'account'
]));
}
if
(
!
array_key_exists
(
'pwd'
,
$this
->
values
)
||
$this
->
values
[
'pwd'
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"pwd参数错误!"
);
}
else
{
$this
->
values
[
'pwd'
]
=
trim
(
urldecode
(
$this
->
values
[
'pwd'
]));
}
}
if
(
$fields
)
{
foreach
(
$fields
as
$v
)
{
if
(
!
array_key_exists
(
$v
,
$this
->
values
)
||
$this
->
values
[
$v
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"
{
$v
}
参数错误!"
);
}
else
{
$this
->
values
[
$v
]
=
trim
(
urldecode
(
$this
->
values
[
$v
]));
}
}
}
}
/**
* 给指定参数增加默认值
* @param $fields
*/
private
function
SetDefaultValues
(
$fields
)
{
if
(
$fields
)
{
foreach
(
$fields
as
$v
)
{
if
(
!
array_key_exists
(
$v
,
$this
->
values
))
{
$this
->
values
[
$v
]
=
''
;
}
else
{
$this
->
values
[
$v
]
=
urldecode
(
$this
->
values
[
$v
]);
}
}
}
}
}
}
\ No newline at end of file
application/libraries/Source/SourceChigo.php
View file @
c8183734
...
@@ -39,7 +39,7 @@ class SourceChigo extends Source
...
@@ -39,7 +39,7 @@ class SourceChigo extends Source
{
{
$post
=
[
$post
=
[
'adat_begin'
=>
$condition
[
'adat_begin'
],
//开始时间
'adat_begin'
=>
$condition
[
'adat_begin'
],
//开始时间
2011-11-11
'adat_end'
=>
$condition
[
'adat_end'
],
//结束时间
'adat_end'
=>
$condition
[
'adat_end'
],
//结束时间
'mobile'
=>
$condition
[
'mobile'
],
//手机
'mobile'
=>
$condition
[
'mobile'
],
//手机
'phone'
=>
$condition
[
'phone'
],
//电话
'phone'
=>
$condition
[
'phone'
],
//电话
...
@@ -49,10 +49,7 @@ class SourceChigo extends Source
...
@@ -49,10 +49,7 @@ class SourceChigo extends Source
'check_state'
=>
'N'
,
'check_state'
=>
'N'
,
];
];
//debug
$data
=
$this
->
HandelAction
(
'CallAcceptAction'
,
'QuerySerNode'
,
$post
);
$this
->
Debug
(
'FacilitatorReservation'
,
$post
);
$data
=
$this
->
CallAcceptAction
(
'QuerySerNode'
,
$post
);
return
$data
;
return
$data
;
}
}
...
@@ -64,7 +61,7 @@ class SourceChigo extends Source
...
@@ -64,7 +61,7 @@ class SourceChigo extends Source
public
function
VisitingService
(
$condition
)
public
function
VisitingService
(
$condition
)
{
{
$post
=
[
$post
=
[
'adat_begin'
=>
$condition
[
'adat_begin'
],
//开始时间
'adat_begin'
=>
$condition
[
'adat_begin'
],
//开始时间
2011-11-11
'adat_end'
=>
$condition
[
'adat_end'
],
//结束时间
'adat_end'
=>
$condition
[
'adat_end'
],
//结束时间
'mobile'
=>
$condition
[
'mobile'
],
//手机
'mobile'
=>
$condition
[
'mobile'
],
//手机
'phone'
=>
$condition
[
'phone'
],
//电话
'phone'
=>
$condition
[
'phone'
],
//电话
...
@@ -75,25 +72,132 @@ class SourceChigo extends Source
...
@@ -75,25 +72,132 @@ class SourceChigo extends Source
'bxcd'
=>
$condition
[
'bxcd'
],
//报修催单: 1:选中; 0:未选中
'bxcd'
=>
$condition
[
'bxcd'
],
//报修催单: 1:选中; 0:未选中
];
];
//debug
//转码
$this
->
Debug
(
'VisitingService'
,
$post
);
$post
[
'ctype'
]
=
$this
->
Utf8ToGbk
(
$post
[
'ctype'
]);
$data
=
$this
->
HandelAction
(
'CallAcceptAction'
,
'QuerySerNode'
,
$post
);
return
$data
;
}
/**
* 家用安装业务-业务-安装单录入-浏览
* @param $condition
* @return array
*/
public
function
QueryInstallBill
(
$condition
)
{
$post
=
[
'input_date_begin'
=>
$condition
[
'input_date_begin'
],
//输单日期 2011-11-11
'input_date_end'
=>
$condition
[
'input_date_end'
],
'telephone_no'
=>
''
,
//用户电话
'node_id'
=>
$condition
[
'node_id'
],
//服务商编号, PickupAllSerNodeForUser->node_id
'install_date_begin'
=>
$condition
[
'install_date_begin'
],
//安装日期 2011-11-11
'install_date_end'
=>
$condition
[
'install_date_end'
],
'customer_name'
=>
$condition
[
'customer_name'
],
//用户名称
'warranty'
=>
$condition
[
'warranty'
],
//保修卡号
];
//转码
$post
[
'customer_name'
]
=
$this
->
Utf8ToGbk
(
$post
[
'customer_name'
]);
$data
=
$this
->
HandelAction
(
'InstallBillAction'
,
'QueryInstallBill'
,
$post
);
return
$data
;
}
/**
* 家用安装业务-业务-安装单据结算-浏览
* @param $condition
* @return array
*/
public
function
BrowseCloseAccount
(
$condition
)
{
$post
=
[
'periodb'
=>
$condition
[
'periodb'
],
//'201610'
'periode'
=>
$condition
[
'periode'
],
'ser_node_id'
=>
$condition
[
'ser_node_id'
],
//服务商, PickupAllSerNodeForUser->node_id
'center_code'
=>
$condition
[
'center_code'
],
//中心, PickupAllForUser->center_code
'ins_rep'
=>
'I'
,
'wxqx'
=>
''
,
];
$data
=
$this
->
HandelAction
(
'BrowseCloseAccount'
,
'BrowseCloseAccount'
,
$post
);
return
$data
;
}
//服务商编号
public
function
PickupAllSerNodeForUser
()
{
$post
=
[
'type'
=>
'家用'
,
];
//转码
$post
[
'type'
]
=
$this
->
Utf8ToGbk
(
$post
[
'type'
]);
$data
=
$this
->
HandelAction
(
'SerNodeAction'
,
'PickupAllSerNodeForUser'
,
$post
);
return
$data
;
}
//服务中心
public
function
PickupAllForUser
()
{
$post
=
[
'type'
=>
'家用'
,
];
//转码
//转码
$post
[
'
ctype'
]
=
iconv
(
'UTF-8'
,
'GBK'
,
$post
[
'c
type'
]);
$post
[
'
type'
]
=
$this
->
Utf8ToGbk
(
$post
[
'
type'
]);
$data
=
$this
->
CallAcceptAction
(
'QuerySerNode
'
,
$post
);
$data
=
$this
->
HandelAction
(
'SerCenterAction'
,
'PickupAllForUser
'
,
$post
);
return
$data
;
return
$data
;
}
}
/**
/**
* 呼叫受理订单处理
* 查询处理
* @param $action
* @param $type
* @param $type
* @param $post
* @param $post
* @return array
* @return array
*/
*/
private
function
CallAcceptAction
(
$type
,
$post
)
private
function
HandelAction
(
$action
,
$type
,
$post
)
{
{
switch
(
$action
)
{
//服务商编号
case
'SerNodeAction'
:
$url
=
"http://58.254.204.86:9001/cus/SerNodeAction.do"
;
break
;
//家用安装业务-录入
case
'InstallBillAction'
:
$url
=
"http://58.254.204.86:9001/cus/InstallBillAction.do"
;
break
;
//呼叫受理
case
'CallAcceptAction'
:
$url
=
"http://58.254.204.86:9001/cus/CallAcceptAction.do"
;
$url
=
"http://58.254.204.86:9001/cus/CallAcceptAction.do"
;
break
;
//服务中心
case
'SerCenterAction'
:
$url
=
"http://58.254.204.86:9001/cus/SerCenterAction.do"
;
break
;
//家用安装业务-结算
case
'BrowseCloseAccount'
:
$url
=
"http://58.254.204.86:9001/cus/BrowseCloseAccount.do"
;
break
;
default
:
$url
=
''
;
}
if
(
$url
==
''
)
{
return_msg
(
false
,
'请求参数错误'
);
}
//debug
$this
->
Debug
(
$type
,
$post
);
$xml
=
$this
->
ArrayToXml
(
$type
,
$post
);
$xml
=
$this
->
ArrayToXml
(
$type
,
$post
);
$data
=
$this
->
CurlPostXml
(
$url
,
$xml
);
$data
=
$this
->
CurlPostXml
(
$url
,
$xml
);
...
@@ -228,7 +332,7 @@ class SourceChigo extends Source
...
@@ -228,7 +332,7 @@ class SourceChigo extends Source
}
}
//匹配数据
//匹配数据
preg_match_all
(
'/<ROW\s+([^>]+)\/
?
>/'
,
$xml
,
$data
);
preg_match_all
(
'/<ROW\s+([^>]+)\/>/'
,
$xml
,
$data
);
//debug
//debug
$this
->
Debug
(
'XmlToArray'
,
$data
);
$this
->
Debug
(
'XmlToArray'
,
$data
);
...
@@ -236,8 +340,8 @@ class SourceChigo extends Source
...
@@ -236,8 +340,8 @@ class SourceChigo extends Source
if
(
isset
(
$data
[
1
])
&&
$data
[
1
])
{
if
(
isset
(
$data
[
1
])
&&
$data
[
1
])
{
//数据处理个数
//数据处理个数
if
(
count
(
$data
[
1
])
>
5
0
)
{
if
(
count
(
$data
[
1
])
>
20
0
)
{
$data
[
1
]
=
array_slice
(
$data
[
1
],
0
,
5
0
);
$data
[
1
]
=
array_slice
(
$data
[
1
],
0
,
20
0
);
}
}
foreach
(
$data
[
1
]
as
$key
=>
$val
)
{
foreach
(
$data
[
1
]
as
$key
=>
$val
)
{
...
@@ -331,4 +435,9 @@ class SourceChigo extends Source
...
@@ -331,4 +435,9 @@ class SourceChigo extends Source
return
$header
;
return
$header
;
}
}
private
function
Utf8ToGbk
(
$txt
)
{
return
iconv
(
'UTF-8'
,
'GBK'
,
$txt
);
}
}
}
\ No newline at end of file
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