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
04da49e2
Commit
04da49e2
authored
Sep 21, 2016
by
蒋林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 安装单保存, 及对外接口
parent
64b18fee
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
333 additions
and
75 deletions
+333
-75
Galanz.php
application/controllers/api/Galanz.php
+3
-8
Rgalanz.php
application/controllers/test/Rgalanz.php
+67
-4
ReceiveGalanz.php
application/libraries/Receive/ReceiveGalanz.php
+99
-32
SourceGalanz.php
application/libraries/Source/SourceGalanz.php
+164
-31
No files found.
application/controllers/api/Galanz.php
View file @
04da49e2
...
...
@@ -213,8 +213,6 @@ class Galanz extends BaseController
//搜索订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$this
->
getCallOrder
(
$values
[
'out_trade_no'
],
$sourceGalanzObj
);
//保存订单
$result
=
$sourceGalanzObj
->
CreateWorkOrder
(
$order
[
'new_id'
],
$order
);
if
(
$result
)
{
...
...
@@ -240,8 +238,6 @@ class Galanz extends BaseController
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$this
->
getCallOrder
(
$values
[
'out_trade_no'
],
$sourceGalanzObj
);
//保存订单
$result
=
$sourceGalanzObj
->
CreateUserProfileOrder
(
$order
[
'new_id'
],
$order
);
if
(
$result
)
{
...
...
@@ -252,6 +248,7 @@ class Galanz extends BaseController
}
}
//保存安装单
public
function
saveUserProfileOrder
()
{
$param
=
$this
->
input
->
post
();
...
...
@@ -265,13 +262,13 @@ class Galanz extends BaseController
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$sourceGalanzObj
->
UserProfileOrderDetail
(
$values
[
'id'
]);
//保存订单
$order
=
$obj
->
SetSaveUserProfileOrderValues
(
$order
,
$values
);
$result
=
$sourceGalanzObj
->
SaveUserProfileOrder
(
$order
[
'new_id'
],
$order
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
//发送安装单
public
function
sendUserProfileOrder
()
{
$param
=
$this
->
input
->
post
();
...
...
@@ -285,8 +282,6 @@ class Galanz extends BaseController
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$sourceGalanzObj
->
UserProfileOrderDetail
(
$values
[
'id'
]);
//发送订单
$result
=
$sourceGalanzObj
->
SendUserProfileOrder
(
$order
[
'new_id'
],
$order
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
...
...
application/controllers/test/Rgalanz.php
View file @
04da49e2
...
...
@@ -30,7 +30,10 @@ class Rgalanz extends BaseController
// self::$testu = 'K75516022';
// self::$testp = '123456';
self
::
$testu
=
'W75509345'
;
// self::$testu = 'W75509345';
// self::$testp = 'dgqh!769';
self
::
$testu
=
'C75500035'
;
self
::
$testp
=
'dgqh!769'
;
// self::$testu = 'c01000005';
...
...
@@ -69,7 +72,7 @@ class Rgalanz extends BaseController
$data
[
'appid'
]
=
'10001'
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'mobile'
]
=
'13
717705860
'
;
$data
[
'mobile'
]
=
'13
925524202
'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
...
...
@@ -92,7 +95,7 @@ class Rgalanz extends BaseController
$data
[
'appid'
]
=
'10001'
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'out_trade_no'
]
=
'CALL201
5111004668
'
;
$data
[
'out_trade_no'
]
=
'CALL201
6091301455
'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
...
...
@@ -137,7 +140,7 @@ class Rgalanz extends BaseController
$data
[
'appid'
]
=
'10001'
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'id'
]
=
'
b1c8bece-378a-4b53-946b-61abd1b7c097
'
;
$data
[
'id'
]
=
'
05a20b81-0a7d-4c3c-a478-c0a456ce309c
'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
...
...
@@ -175,6 +178,28 @@ class Rgalanz extends BaseController
$this
->
show
(
$result
);
}
public
function
createUserProfileOrder
()
{
$obj
=
$this
->
galanzObj
();
$data
[
'appid'
]
=
'10001'
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'out_trade_no'
]
=
'CALL2016091301455'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$url
=
self
::
$apiUrl
.
"api/galanz/createUserProfileOrder"
;
$result
=
$this
->
curlPost
(
$url
,
$values
);
$result
[
'data'
]
=
json_decode
(
$result
[
'data'
],
true
);
$this
->
show
(
$result
);
}
public
function
saveOrder
()
{
$obj
=
$this
->
galanzObj
();
...
...
@@ -527,6 +552,44 @@ class Rgalanz extends BaseController
$this
->
show
(
$result
[
'data'
]);
}
public
function
saveUserProfileOrder
()
{
$obj
=
$this
->
galanzObj
();
$data
=
[
'appid'
=>
'10001'
,
'account'
=>
self
::
$testu
,
'pwd'
=>
self
::
$testp
,
'id'
=>
'05a20b81-0a7d-4c3c-a478-c0a456ce309c'
,
'contactname'
=>
''
,
//姓名
'mobile'
=>
''
,
//手机
'telephone'
=>
''
,
//电话
'accountaddr'
=>
''
,
//地址
'email'
=>
''
,
//邮箱
'broughtdate'
=>
''
,
//购买时间
'installdate'
=>
''
,
//安装时间
'appointmenttime'
=>
''
,
//上门时间
'salesite'
=>
''
,
//商场
'installer'
=>
''
,
//安装人员
'goldcard'
=>
''
,
//金卡
'remarks'
=>
''
,
//备注
'qualityresult'
=>
'1'
,
'custadvice'
=>
' '
,
//顾客意见
];
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$url
=
self
::
$apiUrl
.
"api/galanz/saveUserProfileOrder"
;
$result
=
$this
->
curlPost
(
$url
,
$values
);
$result
[
'data'
]
=
json_decode
(
$result
[
'data'
],
true
);
$this
->
show
(
$result
[
'data'
]);
}
private
function
show
(
$data
)
{
echo
"<pre>"
;
...
...
application/libraries/Receive/ReceiveGalanz.php
View file @
04da49e2
...
...
@@ -52,15 +52,15 @@ class ReceiveGalanz extends Receive
$this
->
CheckValues
(
$fileds
);
$dfields
=
[
'sitecontacttime'
,
'siteappointmenttime'
,
'actualvisittime'
,
'isguaranty'
,
'finishstatus'
,
'unfinishreason'
,
'complete_reason'
,
'sitedealremarks'
,
'servicePersonnel'
,
'sitecontacttime'
,
//联络时间
'siteappointmenttime'
,
//预约时间
'actualvisittime'
,
//上门时间
'isguaranty'
,
//是否保内
'finishstatus'
,
//完成状态
'unfinishreason'
,
//未完成原因
'complete_reason'
,
//完成方式
'sitedealremarks'
,
//备注
'servicePersonnel'
,
//服务人员
];
$this
->
SetDefaultValues
(
$dfields
);
}
...
...
@@ -84,16 +84,16 @@ class ReceiveGalanz extends Receive
$order
[
'new_finishstatus'
]
=
$values
[
'finishstatus'
]
?
'True'
:
'False'
;
}
if
(
$values
[
'unfinishreason'
])
{
$order
[
'new_unfinishreason'
]
=
$values
[
'unfinishreason'
]
;
$order
[
'new_unfinishreason'
]
=
trim
(
$values
[
'unfinishreason'
])
;
}
if
(
$values
[
'complete_reason'
])
{
$order
[
'new_complete_reason'
]
=
$values
[
'complete_reason'
]
;
$order
[
'new_complete_reason'
]
=
trim
(
$values
[
'complete_reason'
])
;
}
if
(
$values
[
'sitedealremarks'
])
{
$order
[
'new_sitedealremarks'
]
=
$values
[
'sitedealremarks'
]
;
$order
[
'new_sitedealremarks'
]
=
trim
(
$values
[
'sitedealremarks'
])
;
}
if
(
$values
[
'servicePersonnel'
])
{
$order
[
'new_ServicePersonnel'
]
=
$values
[
'servicePersonnel'
]
;
$order
[
'new_ServicePersonnel'
]
=
trim
(
$values
[
'servicePersonnel'
])
;
}
return
$order
;
...
...
@@ -143,19 +143,19 @@ class ReceiveGalanz extends Receive
$this
->
CheckValues
(
$fileds
);
$dfields
=
[
'custname'
,
'custmobile'
,
'address'
,
'shipdate'
,
'broughtdate'
,
'installdate'
,
'visittime'
,
'actualvisittime'
,
'finishtime'
,
'repairapply'
,
'machine'
,
'fault'
,
'parts'
,
'custname'
,
//姓名
'custmobile'
,
//手机
'address'
,
//地址
'shipdate'
,
//生产日期
'broughtdate'
,
//购买日期
'installdate'
,
//安装日期
'visittime'
,
//预约上门时间
'actualvisittime'
,
//实际上门时间
'finishtime'
,
//完成时间
'repairapply'
,
//维修人员
'machine'
,
//机器信息
'fault'
,
//故障信息
'parts'
,
//换件信息
];
$this
->
SetDefaultValues
(
$dfields
);
}
...
...
@@ -164,13 +164,13 @@ class ReceiveGalanz extends Receive
{
//处理基本信息参数
if
(
$values
[
'custname'
])
{
$order
[
'new_custname'
]
=
$values
[
'custname'
]
;
$order
[
'new_custname'
]
=
trim
(
$values
[
'custname'
])
;
}
if
(
$values
[
'custmobile'
])
{
$order
[
'new_custmobile'
]
=
$values
[
'custmobile'
]
;
$order
[
'new_custmobile'
]
=
trim
(
$values
[
'custmobile'
])
;
}
if
(
$values
[
'address'
])
{
$order
[
'new_address'
]
=
$values
[
'address'
]
;
$order
[
'new_address'
]
=
trim
(
$values
[
'address'
])
;
}
if
(
$values
[
'shipdate'
])
{
$order
[
'new_shipdate'
]
=
date
(
'Y/m/d'
,
$values
[
'shipdate'
]);
...
...
@@ -268,6 +268,73 @@ class ReceiveGalanz extends Receive
{
$fileds
=
[
'id'
];
$this
->
CheckValues
(
$fileds
);
$dfields
=
[
'contactname'
,
//姓名
'mobile'
,
//手机
'telephone'
,
//电话
'accountaddr'
,
//地址
'email'
,
//邮箱
'broughtdate'
,
//购买时间
'installdate'
,
//安装时间
'appointmenttime'
,
//上门时间
'salesite'
,
//商场
'installer'
,
//安装人员
'goldcard'
,
//金卡
'remarks'
,
//备注
'qualityresult'
,
//质量评价
'custadvice'
,
//顾客意见
];
$this
->
SetDefaultValues
(
$dfields
);
}
public
function
SetSaveUserProfileOrderValues
(
$order
,
$values
)
{
//处理基本信息参数
if
(
$values
[
'contactname'
])
{
$order
[
'new_contactname'
]
=
trim
(
$values
[
'contactname'
]);
}
if
(
$values
[
'mobile'
])
{
$order
[
'new_mobile'
]
=
trim
(
$values
[
'mobile'
]);
}
if
(
$values
[
'telephone'
])
{
$order
[
'new_telephone'
]
=
trim
(
$values
[
'telephone'
]);
}
if
(
$values
[
'accountaddr'
])
{
$order
[
'new_accountaddr'
]
=
trim
(
$values
[
'accountaddr'
]);
}
if
(
$values
[
'email'
])
{
$order
[
'new_email'
]
=
trim
(
$values
[
'email'
]);
}
if
(
$values
[
'broughtdate'
])
{
$order
[
'new_broughtdate'
]
=
date
(
'Y/m/d'
,
$values
[
'broughtdate'
]);
}
if
(
$values
[
'installdate'
])
{
$order
[
'new_installdate'
]
=
date
(
'Y/m/d H:i'
,
$values
[
'installdate'
]);
}
if
(
$values
[
'appointmenttime'
])
{
$order
[
'new_appointmenttime'
]
=
date
(
'Y/m/d H:i'
,
$values
[
'appointmenttime'
]);
}
if
(
$values
[
'salesite'
])
{
$order
[
'new_salesite'
]
=
trim
(
$values
[
'salesite'
]);
}
if
(
$values
[
'installer'
])
{
$order
[
'new_installer'
]
=
trim
(
$values
[
'installer'
]);
}
if
(
$values
[
'goldcard'
])
{
$order
[
'new_goldcard'
]
=
trim
(
$values
[
'goldcard'
]);
}
if
(
$values
[
'remarks'
])
{
$order
[
'new_remarks'
]
=
trim
(
$values
[
'remarks'
]);
}
if
(
$values
[
'qualityresult'
])
{
$order
[
'new_qualityresult'
]
=
trim
(
$values
[
'qualityresult'
]);
}
if
(
$values
[
'custadvice'
])
{
$order
[
'new_custadvice'
]
=
trim
(
$values
[
'custadvice'
]);
}
return
$order
;
}
public
function
CheckSendUserProfileOrderValues
()
...
...
@@ -444,13 +511,13 @@ class ReceiveGalanz extends Receive
if
(
!
array_key_exists
(
'account'
,
$this
->
values
)
||
$this
->
values
[
'account'
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"account参数错误!"
);
}
else
{
$this
->
values
[
'account'
]
=
urldecode
(
$this
->
values
[
'account'
]
);
$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'
]
=
urldecode
(
$this
->
values
[
'pwd'
]
);
$this
->
values
[
'pwd'
]
=
trim
(
urldecode
(
$this
->
values
[
'pwd'
])
);
}
if
(
$fields
)
{
...
...
@@ -458,7 +525,7 @@ class ReceiveGalanz extends Receive
if
(
!
array_key_exists
(
$v
,
$this
->
values
)
||
$this
->
values
[
$v
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"
{
$v
}
参数错误!"
);
}
else
{
$this
->
values
[
$v
]
=
urldecode
(
$this
->
values
[
$v
]
);
$this
->
values
[
$v
]
=
trim
(
urldecode
(
$this
->
values
[
$v
])
);
}
}
}
...
...
application/libraries/Source/SourceGalanz.php
View file @
04da49e2
...
...
@@ -26,6 +26,10 @@ class SourceGalanz extends Source
}
}
/**
* 是否登录
* @return bool
*/
public
function
IsLogin
()
{
$url
=
self
::
$host
.
'/Complaint/new_srv_callinMP.aspx?type=unsubscribe'
;
...
...
@@ -51,6 +55,10 @@ class SourceGalanz extends Source
return
$flag
;
}
/**
* 处理登录
* @return array
*/
public
function
Login
()
{
$loginUrl
=
self
::
$host
.
"/FLoginNew.aspx"
;
...
...
@@ -80,7 +88,7 @@ class SourceGalanz extends Source
}
/**
*
保存订单
*
派工单保存
* @param $id
* @param $data
* @return array|mixed|string
...
...
@@ -88,14 +96,14 @@ class SourceGalanz extends Source
public
function
SaveOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelCallOrder
(
$id
,
$data
,
'Save'
);
$this
->
Work
OrderError
(
$result
);
$this
->
Handel
OrderError
(
$result
);
$order
=
$this
->
OrderDetail
(
$id
);
return
$order
;
}
/**
*
接受订单
*
派工单接受
* @param $id
* @param $data
* @return array|mixed|string
...
...
@@ -103,14 +111,14 @@ class SourceGalanz extends Source
public
function
AcceptOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelCallOrder
(
$id
,
$data
,
'Accept'
);
$this
->
Work
OrderError
(
$result
);
$this
->
Handel
OrderError
(
$result
);
$order
=
$this
->
OrderDetail
(
$id
);
return
$order
;
}
/**
*
拒绝订单
*
派工单拒绝
* @param $id
* @param $data
* @return array|mixed|string
...
...
@@ -118,14 +126,14 @@ class SourceGalanz extends Source
public
function
RefuseOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelCallOrder
(
$id
,
$data
,
'Refuse'
);
$this
->
Work
OrderError
(
$result
);
$this
->
Handel
OrderError
(
$result
);
$order
=
$this
->
OrderDetail
(
$id
);
return
$order
;
}
/**
*
订
单转维修单
*
派工
单转维修单
* @param $id
* @param $data
* @return array
...
...
@@ -148,7 +156,7 @@ class SourceGalanz extends Source
}
/**
*
订
单转安装单
*
派工
单转安装单
* @param $id
* @param $data
* @return array
...
...
@@ -169,7 +177,15 @@ class SourceGalanz extends Source
return
$order
;
}
/**
* 派工单搜索
* @param string $new_name
* @param string $mobile
* @param string $startTime
* @param string $endTime
* @return array
*/
public
function
SearchOrder
(
$new_name
=
''
,
$mobile
=
''
,
$startTime
=
''
,
$endTime
=
''
)
{
$post
=
[
...
...
@@ -203,7 +219,7 @@ class SourceGalanz extends Source
}
/**
*
查询维修单
*
维修单搜索
* @param string $new_number
* @param string $mobile
* @param string $approvalstatus 单据状态
...
...
@@ -242,6 +258,12 @@ class SourceGalanz extends Source
return
$orders
;
}
/**
* 安装单搜索
* @param string $mobile
* @param string $new_number
* @return array
*/
public
function
SearchUserProfieOrder
(
$mobile
=
''
,
$new_number
=
''
)
{
$post
=
[
...
...
@@ -290,6 +312,12 @@ class SourceGalanz extends Source
return
$orders
;
}
/**
* 处理搜索订单业务
* @param $url
* @param $post
* @return array
*/
private
function
HandelSearchOrder
(
$url
,
$post
)
{
$content
=
$this
->
GetUrlContents
(
$url
);
...
...
@@ -313,6 +341,11 @@ class SourceGalanz extends Source
return
$orders
;
}
/**
* 派工单详情
* @param $id
* @return mixed
*/
public
function
OrderDetail
(
$id
)
{
$orderField
=
$this
->
OrderFormFields
();
...
...
@@ -330,6 +363,11 @@ class SourceGalanz extends Source
return
$order
;
}
/**
* 维修单详情
* @param $id
* @return mixed
*/
public
function
WorkOrderDetail
(
$id
)
{
$orderField
=
$this
->
WorkOrderFormFields
();
...
...
@@ -358,6 +396,11 @@ class SourceGalanz extends Source
return
$order
;
}
/**
* 维修单机器信息
* @param $html
* @return array
*/
private
function
WorkOrderMachine
(
$html
)
{
$result
=
[];
...
...
@@ -417,6 +460,11 @@ class SourceGalanz extends Source
return
$result
;
}
/**
* 维修单故障信息
* @param $html
* @return array
*/
private
function
WorkOrderFault
(
$html
)
{
$result
=
[];
...
...
@@ -479,6 +527,11 @@ class SourceGalanz extends Source
return
$result
;
}
/**
* 维修单换件信息
* @param $html
* @return array
*/
private
function
WorkOrderParts
(
$html
)
{
$result
=
[];
...
...
@@ -529,6 +582,11 @@ class SourceGalanz extends Source
return
$result
;
}
/**
* 安装单详情
* @param $id
* @return mixed
*/
public
function
UserProfileOrderDetail
(
$id
)
{
$orderField
=
$this
->
UserProfileOrderFormFields
();
...
...
@@ -551,6 +609,11 @@ class SourceGalanz extends Source
return
$order
;
}
/**
* 安装单明细信息
* @param $html
* @return array
*/
private
function
UserProfileOrderMingxi
(
$html
)
{
$result
=
[];
...
...
@@ -573,22 +636,36 @@ class SourceGalanz extends Source
return
$result
;
}
/**
* 安装单保存
* @param $id
* @param $data
* @return mixed
*/
public
function
SaveUserProfileOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelUserProfileOrder
(
$id
,
$data
,
'save'
);
return
$result
;
$result
=
$this
->
HandelUserProfileOrder
(
$id
,
$data
,
'Save'
);
$this
->
HandelOrderError
(
$result
);
$order
=
$this
->
UserProfileOrderDetail
(
$id
);
return
$order
;
}
/**
* 安装单发送
* @param $id
* @param $data
* @return mixed
*/
public
function
SendUserProfileOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelUserProfileOrder
(
$id
,
$data
,
'send'
);
return
$result
;
$result
=
$this
->
HandelUserProfileOrder
(
$id
,
$data
,
'Send'
);
$this
->
HandelOrderError
(
$result
);
$order
=
$this
->
UserProfileOrderDetail
(
$id
);
return
$order
;
}
/**
*
保存维修单
*
维修单保存
* @param $id
* @param $data
* @return array|mixed|string
...
...
@@ -596,13 +673,13 @@ class SourceGalanz extends Source
public
function
SaveWorkOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelWorkOrder
(
$id
,
$data
,
'Save'
);
$this
->
Work
OrderError
(
$result
);
$this
->
Handel
OrderError
(
$result
);
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
/**
*
发送维修单
*
维修单发送
* @param $id
* @param $data
* @return array|mixed|string
...
...
@@ -610,7 +687,7 @@ class SourceGalanz extends Source
public
function
SendWorkOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelWorkOrder
(
$id
,
$data
,
'Send'
);
$this
->
Work
OrderError
(
$result
);
$this
->
Handel
OrderError
(
$result
);
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
...
...
@@ -652,7 +729,7 @@ class SourceGalanz extends Source
}
$result
=
$this
->
HandelWorkOrder
(
$id
,
$order
,
'ProdGet'
);
$this
->
Work
OrderError
(
$result
);
$this
->
Handel
OrderError
(
$result
);
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
...
...
@@ -667,7 +744,7 @@ class SourceGalanz extends Source
public
function
ProdAddWorkOrder
(
$id
,
$data
)
{
$this
->
HandelWorkOrder
(
$id
,
$data
,
'ProdAdd'
);
$this
->
Work
OrderError
(
$id
);
$this
->
Handel
OrderError
(
$id
);
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
...
...
@@ -682,7 +759,7 @@ class SourceGalanz extends Source
public
function
ProdDelWorkOrder
(
$id
,
$data
)
{
$this
->
HandelWorkOrder
(
$id
,
$data
,
'ProdDel'
);
$this
->
Work
OrderError
(
$id
);
$this
->
Handel
OrderError
(
$id
);
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
...
...
@@ -697,7 +774,7 @@ class SourceGalanz extends Source
public
function
ErrorAddWorkOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelWorkOrder
(
$id
,
$data
,
'ErrorAdd'
);
$this
->
Work
OrderError
(
$result
);
$this
->
Handel
OrderError
(
$result
);
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
...
...
@@ -712,7 +789,7 @@ class SourceGalanz extends Source
public
function
ErrorDelWorkOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelWorkOrder
(
$id
,
$data
,
'ErrorDel'
);
$this
->
Work
OrderError
(
$result
);
$this
->
Handel
OrderError
(
$result
);
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
...
...
@@ -727,7 +804,7 @@ class SourceGalanz extends Source
public
function
PartsAddWorkOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelWorkOrder
(
$id
,
$data
,
'PartsAdd'
);
$this
->
Work
OrderError
(
$result
);
$this
->
Handel
OrderError
(
$result
);
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
...
...
@@ -742,7 +819,7 @@ class SourceGalanz extends Source
public
function
PartsDelWorkOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelWorkOrder
(
$id
,
$data
,
'PartsDel'
);
$this
->
Work
OrderError
(
$result
);
$this
->
Handel
OrderError
(
$result
);
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
...
...
@@ -845,6 +922,13 @@ class SourceGalanz extends Source
}
}
/**
* 查询返回值处理
* @param $result
* @param $type
* @param string $tag
* @return array
*/
private
function
LookupSingleFields
(
$result
,
$type
,
$tag
=
'font'
)
{
preg_match_all
(
'/<tr[^>]+style="[^"]*Cursor:hand"[^>]*>[\s\S]+?<\/tr>/'
,
$result
,
$tr
);
...
...
@@ -941,6 +1025,12 @@ class SourceGalanz extends Source
return
$this
->
GetData
(
'getProductTypeById'
,
$id
);
}
/**
* 查询明细
* @param $type
* @param $id
* @return array
*/
private
function
GetData
(
$type
,
$id
)
{
$url
=
self
::
$host
.
"/common/GetData.aspx?configname=
{
$type
}
¶mslist=
{
$id
}
"
;
...
...
@@ -1069,6 +1159,13 @@ class SourceGalanz extends Source
return
$result
;
}
/**
* 处理维修单
* @param $id
* @param $data
* @param $type
* @return array|mixed|string
*/
private
function
HandelWorkOrder
(
$id
,
$data
,
$type
)
{
$post
=
[
...
...
@@ -1201,6 +1298,11 @@ class SourceGalanz extends Source
return
$result
;
}
/**
* 处理维修单-机器信息
* @param $data
* @return array
*/
private
function
HandelWorkOrderMachineParam
(
$data
)
{
$result
=
[];
...
...
@@ -1233,6 +1335,11 @@ class SourceGalanz extends Source
return
$result
;
}
/**
* 处理维修单-故障信息
* @param $data
* @return array
*/
private
function
HandelWorkOrderFaultParam
(
$data
)
{
$result
=
[];
...
...
@@ -1268,6 +1375,11 @@ class SourceGalanz extends Source
return
$result
;
}
/**
* 处理维修单-换件信息
* @param $data
* @return array
*/
private
function
HandelWorkOrderPartsParam
(
$data
)
{
$result
=
[];
...
...
@@ -1307,11 +1419,11 @@ class SourceGalanz extends Source
private
function
HandelUserProfileOrder
(
$id
,
$data
,
$type
)
{
switch
(
$type
){
case
'
s
ave'
:
case
'
S
ave'
:
$target
=
'ctl00$ContentQuery$btnSave'
;
break
;
case
'
s
end'
:
case
'
S
end'
:
$target
=
'ctl00$ContentQuery$btnSend'
;
break
;
}
...
...
@@ -1387,6 +1499,10 @@ class SourceGalanz extends Source
return
$result
;
}
/**
* 派工单表单字段
* @return array
*/
private
function
OrderFormFields
()
{
return
[
...
...
@@ -1579,6 +1695,10 @@ class SourceGalanz extends Source
];
}
/**
* 维修单表单字段
* @return array
*/
private
function
WorkOrderFormFields
()
{
return
[
...
...
@@ -1842,6 +1962,10 @@ class SourceGalanz extends Source
];
}
/**
* 安装单表单字段
* @return array
*/
private
function
UserProfileOrderFormFields
()
{
return
[
...
...
@@ -2066,7 +2190,7 @@ class SourceGalanz extends Source
}
/**
* 匹配
订
单值
* 匹配
表
单值
* @param $html
* @param $reg
* @param string $type
...
...
@@ -2151,6 +2275,11 @@ class SourceGalanz extends Source
return
$td
[
0
];
}
/**
* 请求头信息
* @param $referer
* @return array
*/
public
function
Header
(
$referer
)
{
$header
=
[
...
...
@@ -2167,7 +2296,11 @@ class SourceGalanz extends Source
return
$header
;
}
private
function
WorkOrderError
(
$html
)
/**
* 处理订单页面错误信息(alert)
* @param $html
*/
private
function
HandelOrderError
(
$html
)
{
preg_match
(
'/<scriptt[^>]*>alert\("([^"]+)"\);?<\/scriptt>/'
,
$html
,
$arr
);
$error
=
isset
(
$arr
[
1
])
?
$arr
[
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