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
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
...
@@ -37,20 +37,8 @@ class Galanz extends BaseController
...
@@ -37,20 +37,8 @@ class Galanz extends BaseController
$values
=
$obj
->
GetValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'out_trade_no'
],
'queryOrder'
,
$param
);
$this
->
saveLog
(
$values
[
'out_trade_no'
],
'queryOrder'
,
$param
);
//搜索订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
],
$obj
);
$order
=
$this
->
getCallOrder
(
$values
[
'out_trade_no'
],
$sourceGalanzObj
);
$search
=
$sourceGalanzObj
->
SearchOrder
(
$values
[
'out_trade_no'
]);
if
(
empty
(
$search
))
{
$obj
->
ReturnMessage
(
false
,
'查询的订单不存在'
);
}
//订单详情
$order
=
$sourceGalanzObj
->
OrderDetail
(
$search
[
0
][
0
]);
if
(
!
isset
(
$order
[
'new_name'
])
&&
!
$order
[
'new_name'
])
{
$obj
->
ReturnMessage
(
false
,
'查询的订单不存在'
);
}
//字段过滤
//字段过滤
$fields
=
[
$fields
=
[
...
@@ -78,20 +66,8 @@ class Galanz extends BaseController
...
@@ -78,20 +66,8 @@ class Galanz extends BaseController
$values
=
$obj
->
GetValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'work_order_no'
],
'queryWorkOrder'
,
$param
);
$this
->
saveLog
(
$values
[
'work_order_no'
],
'queryWorkOrder'
,
$param
);
//搜索订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
],
$obj
);
$order
=
$this
->
getWorkOrder
(
$values
[
'work_order_no'
],
$sourceGalanzObj
);
$search
=
$sourceGalanzObj
->
SearchWorkOrder
(
$values
[
'work_order_no'
]);
if
(
empty
(
$search
))
{
$obj
->
ReturnMessage
(
false
,
'查询的维修单不存在'
);
}
//订单详情
$order
=
$sourceGalanzObj
->
WorkOrderDetail
(
$search
[
0
][
0
]);
if
(
!
isset
(
$order
[
'new_name'
])
&&
!
$order
[
'new_name'
])
{
$obj
->
ReturnMessage
(
false
,
'查询的维修单不存在'
);
}
$obj
->
ReturnMessage
(
true
,
''
,
$order
);
$obj
->
ReturnMessage
(
true
,
''
,
$order
);
}
}
...
@@ -107,26 +83,12 @@ class Galanz extends BaseController
...
@@ -107,26 +83,12 @@ class Galanz extends BaseController
$values
=
$obj
->
GetValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'up_order_no'
],
'queryUserProfileOrder'
,
$param
);
$this
->
saveLog
(
$values
[
'up_order_no'
],
'queryUserProfileOrder'
,
$param
);
//搜索订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
],
$obj
);
$order
=
$this
->
getUserProfileOrder
(
$values
[
'mobile'
],
$values
[
'up_order_no'
],
$sourceGalanzObj
);
$search
=
$sourceGalanzObj
->
SearchUserProfieOrder
(
$values
[
'mobile'
],
$values
[
'up_order_no'
]);
if
(
empty
(
$search
))
{
$obj
->
ReturnMessage
(
false
,
'查询的安装单不存在'
);
}
//订单详情
$order
=
$sourceGalanzObj
->
UserProfileOrderDetail
(
$search
[
0
][
0
]);
if
(
!
isset
(
$order
[
'new_number'
])
&&
!
$order
[
'new_number'
])
{
$obj
->
ReturnMessage
(
false
,
'查询的安装单不存在'
);
}
$obj
->
ReturnMessage
(
true
,
''
,
$order
);
$obj
->
ReturnMessage
(
true
,
''
,
$order
);
}
}
//搜索维修单
//保存订单
//保存订单
public
function
saveOrder
()
public
function
saveOrder
()
{
{
...
@@ -139,20 +101,8 @@ class Galanz extends BaseController
...
@@ -139,20 +101,8 @@ class Galanz extends BaseController
$values
=
$obj
->
GetValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'out_trade_no'
],
'saveOrder'
,
$param
);
$this
->
saveLog
(
$values
[
'out_trade_no'
],
'saveOrder'
,
$param
);
//搜索订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
],
$obj
);
$order
=
$this
->
getCallOrder
(
$values
[
'out_trade_no'
],
$sourceGalanzObj
);
$search
=
$sourceGalanzObj
->
SearchOrder
(
$values
[
'out_trade_no'
]);
if
(
empty
(
$search
))
{
$obj
->
ReturnMessage
(
false
,
'查询的订单不存在'
);
}
//订单详情
$order
=
$sourceGalanzObj
->
OrderDetail
(
$search
[
0
][
0
]);
if
(
!
isset
(
$order
[
'new_name'
])
&&
!
$order
[
'new_name'
])
{
$obj
->
ReturnMessage
(
false
,
'查询的订单不存在'
);
}
//处理参数
//处理参数
if
(
$values
[
'new_sitecontacttime'
]
!=
''
)
{
if
(
$values
[
'new_sitecontacttime'
]
!=
''
)
{
...
@@ -230,19 +180,8 @@ class Galanz extends BaseController
...
@@ -230,19 +180,8 @@ class Galanz extends BaseController
$this
->
saveLog
(
$values
[
'out_trade_no'
],
'createWorkOrder'
,
$param
);
$this
->
saveLog
(
$values
[
'out_trade_no'
],
'createWorkOrder'
,
$param
);
//搜索订单
//搜索订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
],
$obj
);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$search
=
$sourceGalanzObj
->
SearchOrder
(
$values
[
'out_trade_no'
]);
$order
=
$this
->
getWorkOrder
(
$values
[
'out_trade_no'
],
$sourceGalanzObj
);
if
(
empty
(
$search
))
{
$obj
->
ReturnMessage
(
false
,
'查询的订单不存在'
);
}
//订单详情
$order
=
$sourceGalanzObj
->
OrderDetail
(
$search
[
0
][
0
]);
if
(
!
isset
(
$order
[
'new_name'
])
&&
!
$order
[
'new_name'
])
{
$obj
->
ReturnMessage
(
false
,
'查询的订单不存在'
);
}
//保存订单
//保存订单
$result
=
$sourceGalanzObj
->
CreateWorkOrder
(
$order
[
'new_id'
],
$order
);
$result
=
$sourceGalanzObj
->
CreateWorkOrder
(
$order
[
'new_id'
],
$order
);
...
@@ -265,62 +204,77 @@ class Galanz extends BaseController
...
@@ -265,62 +204,77 @@ class Galanz extends BaseController
$obj
->
SetValues
(
$param
);
$obj
->
SetValues
(
$param
);
$obj
->
CheckCreateUserProfileOrderValues
();
$obj
->
CheckCreateUserProfileOrderValues
();
$values
=
$obj
->
GetValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'
out_trade
_no'
],
'createUserprofileOrder'
,
$param
);
$this
->
saveLog
(
$values
[
'
up_order
_no'
],
'createUserprofileOrder'
,
$param
);
//搜索订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
],
$obj
);
$order
=
$this
->
getUserProfileOrder
(
$values
[
'mobile'
],
$values
[
'up_order_no'
],
$sourceGalanzObj
);
$search
=
$sourceGalanzObj
->
SearchOrder
(
$values
[
'out_trade_no'
]);
if
(
empty
(
$search
))
{
//保存订单
$obj
->
ReturnMessage
(
false
,
'查询的订单不存在'
);
$result
=
$sourceGalanzObj
->
CreateUserProfileOrder
(
$order
[
'new_id'
],
$order
);
}
//订单详情
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$order
=
$sourceGalanzObj
->
OrderDetail
(
$search
[
0
][
0
]);
}
if
(
!
isset
(
$order
[
'new_name'
])
&&
!
$order
[
'new_name'
])
{
public
function
saveUserProfileOrder
()
$obj
->
ReturnMessage
(
false
,
'查询的订单不存在'
);
{
}
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveGalanzObj
();
$obj
->
SetValues
(
$param
);
$obj
->
CheckSaveUserProfileOrderValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'up_order_no'
],
'saveUserProfileOrder'
,
$param
);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$this
->
getUserProfileOrder
(
$values
[
'mobile'
],
$values
[
'up_order_no'
],
$sourceGalanzObj
);
//保存订单
//保存订单
$result
=
$sourceGalanzObj
->
Creat
eUserProfileOrder
(
$order
[
'new_id'
],
$order
);
$result
=
$sourceGalanzObj
->
Sav
eUserProfileOrder
(
$order
[
'new_id'
],
$order
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
}
//保存维修单
public
function
sendUserProfileOrder
()
public
function
saveWorkOrder
()
{
{
$param
=
$this
->
input
->
post
();
$param
=
$this
->
input
->
post
();
//验证参数
//验证参数
$obj
=
$this
->
receiveGalanzObj
();
$obj
=
$this
->
receiveGalanzObj
();
$obj
->
SetValues
(
$param
);
$obj
->
SetValues
(
$param
);
$obj
->
CheckS
aveWork
OrderValues
();
$obj
->
CheckS
endUserProfile
OrderValues
();
$values
=
$obj
->
GetValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'
work_order_no'
],
'saveWork
Order'
,
$param
);
$this
->
saveLog
(
$values
[
'
up_order_no'
],
'sendUserProfile
Order'
,
$param
);
//搜索订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
],
$obj
);
$order
=
$this
->
getUserProfileOrder
(
$values
[
'mobile'
],
$values
[
'up_order_no'
],
$sourceGalanzObj
);
$search
=
$sourceGalanzObj
->
SearchWorkOrder
(
$values
[
'out_trade_no'
]);
if
(
empty
(
$search
))
{
//发送订单
$obj
->
ReturnMessage
(
false
,
'查询的维修单不存在'
);
$result
=
$sourceGalanzObj
->
SendUserProfileOrder
(
$order
[
'new_id'
],
$order
);
}
//订单详情
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$order
=
$sourceGalanzObj
->
WorkOrderDetail
(
$search
[
0
][
0
]);
}
if
(
!
isset
(
$order
[
'new_name'
])
&&
!
$order
[
'new_name'
])
{
//保存维修单
$obj
->
ReturnMessage
(
false
,
'查询的维修单不存在'
);
public
function
saveWorkOrder
()
}
{
$param
=
$this
->
input
->
post
();
//保存订单
//验证参数
$obj
=
$this
->
receiveGalanzObj
();
$obj
->
SetValues
(
$param
);
$obj
->
CheckSaveWorkOrderValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'work_order_no'
],
'saveWorkOrder'
,
$param
);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$this
->
getWorkOrder
(
$values
[
'work_order_no'
],
$sourceGalanzObj
);
$result
=
$sourceGalanzObj
->
SaveWorkOrder
(
$order
[
'new_id'
],
$order
);
$result
=
$sourceGalanzObj
->
SaveWorkOrder
(
$order
[
'new_id'
],
$order
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
}
//发送维修单
public
function
sendWorkOrder
()
public
function
sendWorkOrder
()
{
{
$param
=
$this
->
input
->
post
();
$param
=
$this
->
input
->
post
();
...
@@ -332,96 +286,242 @@ class Galanz extends BaseController
...
@@ -332,96 +286,242 @@ class Galanz extends BaseController
$values
=
$obj
->
GetValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'work_order_no'
],
'sendWorkOrder'
,
$param
);
$this
->
saveLog
(
$values
[
'work_order_no'
],
'sendWorkOrder'
,
$param
);
//搜索订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$
sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
],
$o
bj
);
$
order
=
$this
->
getWorkOrder
(
$values
[
'work_order_no'
],
$sourceGalanzO
bj
);
$
search
=
$sourceGalanzObj
->
SearchWorkOrder
(
$values
[
'out_trade_no'
]
);
$
result
=
$sourceGalanzObj
->
SendWorkOrder
(
$order
[
'new_id'
],
$order
);
if
(
empty
(
$search
))
{
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$obj
->
ReturnMessage
(
false
,
'查询的维修单不存在'
);
}
}
//订单详情
//维修单-添加机器信息
$order
=
$sourceGalanzObj
->
WorkOrderDetail
(
$search
[
0
][
0
]);
public
function
addProdWorkOrder
()
{
$param
=
$this
->
input
->
post
();
if
(
!
isset
(
$order
[
'new_name'
])
&&
!
$order
[
'new_name'
])
{
//验证参数
$obj
->
ReturnMessage
(
false
,
'查询的维修单不存在'
);
$obj
=
$this
->
receiveGalanzObj
();
}
$obj
->
SetValues
(
$param
);
$obj
->
CheckAddProdWorkOrderValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'work_order_no'
],
'addProdWorkOrder'
,
$param
);
//发送订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$sourceGalanzObj
->
SendWorkOrder
(
$order
[
'new_id'
],
$order
);
$order
=
$this
->
getWorkOrder
(
$values
[
'work_order_no'
],
$sourceGalanzObj
);
$result
=
$sourceGalanzObj
->
ProdGetWorkOrder
(
$order
[
'new_id'
],
$order
,
$values
[
'txtproducenumber'
]);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
}
public
function
saveUserProfileOrder
()
//维修单-添加故障信息
public
function
addErrorWorkOrder
()
{
{
$param
=
$this
->
input
->
post
();
$param
=
$this
->
input
->
post
();
//验证参数
//验证参数
$obj
=
$this
->
receiveGalanzObj
();
$obj
=
$this
->
receiveGalanzObj
();
$obj
->
SetValues
(
$param
);
$obj
->
SetValues
(
$param
);
$obj
->
Check
SaveUserProfile
OrderValues
();
$obj
->
Check
AddErrorWork
OrderValues
();
$values
=
$obj
->
GetValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'
up_order_no'
],
'saveUserProfile
Order'
,
$param
);
$this
->
saveLog
(
$values
[
'
work_order_no'
],
'addErrorWork
Order'
,
$param
);
//搜索订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$
sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
],
$o
bj
);
$
order
=
$this
->
getWorkOrder
(
$values
[
'work_order_no'
],
$sourceGalanzO
bj
);
$
search
=
$sourceGalanzObj
->
SearchUserProfieOrder
(
$values
[
'mobile'
],
$values
[
'up_order_no'
]
);
$
result
=
$sourceGalanzObj
->
ErrorAddWorkOrder
(
$order
[
'new_id'
],
$order
);
if
(
empty
(
$search
))
{
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$obj
->
ReturnMessage
(
false
,
'查询的安装单不存在'
);
}
}
//订单详情
//维修单-添加配件信息
$order
=
$sourceGalanzObj
->
UserProfileOrderDetail
(
$search
[
0
][
0
]);
public
function
addPartsWorkOrder
()
{
$param
=
$this
->
input
->
post
();
if
(
!
isset
(
$order
[
'new_number'
])
&&
!
$order
[
'new_number'
])
{
//验证参数
$obj
->
ReturnMessage
(
false
,
'查询的安装单不存在'
);
$obj
=
$this
->
receiveGalanzObj
();
}
$obj
->
SetValues
(
$param
);
$obj
->
CheckAddPartsWorkOrderValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'work_order_no'
],
'addPartsWorkOrder'
,
$param
);
//保存订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$sourceGalanzObj
->
SaveUserProfileOrder
(
$order
[
'new_id'
],
$order
);
$order
=
$this
->
getWorkOrder
(
$values
[
'work_order_no'
],
$sourceGalanzObj
);
$result
=
$sourceGalanzObj
->
PartsAddAddWorkOrder
(
$order
[
'new_id'
],
$order
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
}
public
function
sendUserProfileOrder
()
//维修单:故障信息-故障现象
public
function
lookupErrormModule
()
{
{
$param
=
$this
->
input
->
post
();
$param
=
$this
->
input
->
post
();
//验证参数
//验证参数
$obj
=
$this
->
receiveGalanzObj
();
$obj
=
$this
->
receiveGalanzObj
();
$obj
->
SetValues
(
$param
);
$obj
->
SetValues
(
$param
);
$obj
->
Check
SendUserProfileOrder
Values
();
$obj
->
Check
LookupErrormModule
Values
();
$values
=
$obj
->
GetValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'
up_order_no'
],
'sendUserProfileOrder
'
,
$param
);
$this
->
saveLog
(
$values
[
'
workorderproductid'
],
'lookupErrormModule
'
,
$param
);
//搜索订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
],
$obj
);
$result
=
$sourceGalanzObj
->
LookupErrormModule
(
$values
[
'workorderproductid'
]);
$search
=
$sourceGalanzObj
->
SearchUserProfieOrder
(
$values
[
'mobile'
],
$values
[
'up_order_no'
]);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
//维修单:故障信息-原因分类
public
function
lookupErrorGroup
()
{
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveGalanzObj
();
$obj
->
SetValues
(
$param
);
$obj
->
CheckLookupErrorGroupValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'errormoduleid'
],
'lookupErrorGroup'
,
$param
);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$sourceGalanzObj
->
LookupErrorGroup
(
$values
[
'errormoduleid'
]);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
//维修单:故障信息-维修措施
public
function
lookupErrorSolution
()
{
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveGalanzObj
();
$obj
->
SetValues
(
$param
);
$obj
->
CheckLookupErrorSolutionValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'errorgroupid'
],
'lookupErrorSolution'
,
$param
);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$sourceGalanzObj
->
LookupErrorSolution
(
$values
[
'errorgroupid'
]);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
//维修单:换件信息-不良品名称
public
function
lookupErrorParts
()
{
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveGalanzObj
();
$obj
->
SetValues
(
$param
);
$obj
->
CheckLookupErrorPartsValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'errorsolutionid'
],
'lookupErrorParts'
,
$param
);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$sourceGalanzObj
->
LookupErrorParts
(
$values
[
'errorsolutionid'
],
$values
[
'workorderproductid'
]);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
//维修单:换件信息-良品名称
public
function
lookupParts
()
{
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveGalanzObj
();
$obj
->
SetValues
(
$param
);
$obj
->
CheckLookupPartsValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'errorpartsid'
],
'lookupParts'
,
$param
);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$result
=
$sourceGalanzObj
->
LookupParts
(
$values
[
'siteid'
],
$values
[
'errorpartsid'
]);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
/**
* 获取派工单单信息
* @param $order_no
* @param $sourceGalanzObj
* @return mixed
*/
private
function
getCallOrder
(
$order_no
,
$sourceGalanzObj
)
{
$search
=
$sourceGalanzObj
->
SearchOrder
(
$order_no
);
if
(
empty
(
$search
))
{
if
(
empty
(
$search
))
{
$obj
->
ReturnMessage
(
false
,
'查询的安装
单不存在'
);
return_msg
(
false
,
'查询的派工
单不存在'
);
}
}
//订单详情
//订单详情
$order
=
$sourceGalanzObj
->
UserProfile
OrderDetail
(
$search
[
0
][
0
]);
$order
=
$sourceGalanzObj
->
OrderDetail
(
$search
[
0
][
0
]);
if
(
!
isset
(
$order
[
'new_n
umber'
])
&&
!
$order
[
'new_number
'
])
{
if
(
!
isset
(
$order
[
'new_n
ame'
])
&&
!
$order
[
'new_name
'
])
{
$obj
->
ReturnMessage
(
false
,
'查询的安装
单不存在'
);
return_msg
(
false
,
'查询的派工
单不存在'
);
}
}
//发送订单
return
$order
;
$result
=
$sourceGalanzObj
->
SendUserProfileOrder
(
$order
[
'new_id'
],
$order
);
}
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
/**
* 获取维修单信息
* @param $order_no
* @param $sourceGalanzObj
* @return mixed
*/
private
function
getWorkOrder
(
$order_no
,
$sourceGalanzObj
)
{
//搜索订单
$search
=
$sourceGalanzObj
->
SearchWorkOrder
(
$order_no
);
if
(
empty
(
$search
))
{
return_msg
(
false
,
'查询的维修单不存在'
);
}
//订单详情
$order
=
$sourceGalanzObj
->
WorkOrderDetail
(
$search
[
0
][
0
]);
if
(
!
isset
(
$order
[
'new_name'
])
&&
!
$order
[
'new_name'
])
{
return_msg
(
false
,
'查询的维修单不存在'
);
}
return
$order
;
}
}
private
function
diff
(
$data
,
$keys
)
/**
* 获取安装单信息
* @param $mobile
* @param $order_no
* @param $sourceGalanzObj
* @return mixed
*/
private
function
getUserProfileOrder
(
$mobile
,
$order_no
,
$sourceGalanzObj
)
{
{
return
array_diff_key
(
$data
,
array_fill_keys
(
$keys
,
''
));
//搜索订单
$search
=
$sourceGalanzObj
->
SearchUserProfieOrder
(
$mobile
,
$order_no
);
if
(
empty
(
$search
))
{
return_msg
(
false
,
'查询的安装单不存在'
);
}
//订单详情
$order
=
$sourceGalanzObj
->
UserProfileOrderDetail
(
$search
[
0
][
0
]);
if
(
!
isset
(
$order
[
'new_number'
])
&&
!
$order
[
'new_number'
])
{
return_msg
(
false
,
'查询的安装单不存在'
);
}
return
$order
;
}
}
/**
* 保存日志
*
* @param $search
* @param $method
* @param $data
*/
private
function
saveLog
(
$search
,
$method
,
$data
)
private
function
saveLog
(
$search
,
$method
,
$data
)
{
{
//记录日志
//记录日志
...
@@ -429,28 +529,28 @@ class Galanz extends BaseController
...
@@ -429,28 +529,28 @@ class Galanz extends BaseController
$this
->
api_log_model
->
add
(
$search
,
'galanz'
,
$method
,
$data
);
$this
->
api_log_model
->
add
(
$search
,
'galanz'
,
$method
,
$data
);
}
}
/**
* 格兰仕接口类
* @return ReceiveGalanz
*/
private
function
receiveGalanzObj
()
private
function
receiveGalanzObj
()
{
{
$this
->
load
->
library
(
'Receive/ReceiveGalanz'
,
null
,
'ReceiveGalanz'
);
$this
->
load
->
library
(
'Receive/ReceiveGalanz'
,
null
,
'ReceiveGalanz'
);
return
$this
->
ReceiveGalanz
;
return
$this
->
ReceiveGalanz
;
}
}
private
function
sourceGalanzObj
(
$username
,
$pwd
,
$obj
)
/**
* 格兰仕抓取类
* @param $username
* @param $pwd
* @return SourceGalanz
*/
private
function
sourceGalanzObj
(
$username
,
$pwd
)
{
{
// $this->load->config('account', true);
// $account = $this->config->item('account');
// $galanzAccount = $account['galanz'];
//
// if (!array_key_exists($username, $galanzAccount)) {
// $obj->ReturnMessage(false, '用户名不存在');
// }
//$this->load->library('Source/SourceGalanz', $galanzAccount[$username], 'SourceGalanz');
$pwd
=
str_aes
(
$pwd
,
''
,
'de'
);
$pwd
=
str_aes
(
$pwd
,
''
,
'de'
);
if
(
!
$pwd
)
{
if
(
!
$pwd
)
{
$obj
->
ReturnMessage
(
false
,
'密码无效'
);
return_msg
(
false
,
'密码无效'
);
}
}
$account
=
[
$account
=
[
...
@@ -463,4 +563,9 @@ class Galanz extends BaseController
...
@@ -463,4 +563,9 @@ class Galanz extends BaseController
return
$this
->
SourceGalanz
;
return
$this
->
SourceGalanz
;
}
}
private
function
diff
(
$data
,
$keys
)
{
return
array_diff_key
(
$data
,
array_fill_keys
(
$keys
,
''
));
}
}
}
\ No newline at end of file
application/controllers/test/Rgalanz.php
View file @
2c4eec27
...
@@ -16,44 +16,121 @@ defined('BASEPATH') OR exit('No direct script access allowed');
...
@@ -16,44 +16,121 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class
Rgalanz
extends
BaseController
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/'
;
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'
;
$url
=
self
::
$apiUrl
.
"api/galanz/addProdWorkOrder"
;
$data
[
'username1'
]
=
'CALL2016082400507'
;
$result
=
$this
->
curlPost
(
$url
,
$values
);
$data
[
'username2'
]
=
'c01000005'
;
$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
();
$obj
=
$this
->
galanzObj
();
$data
[
'appid'
]
=
'10001'
;
$data
[
'appid'
]
=
'10001'
;
$data
[
'out_trade_no'
]
=
'CALL2016082400507'
;
$data
[
'account'
]
=
'R75510005'
;
$data
[
'account'
]
=
'c01000005'
;
$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
();
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetValues
(
$data
);
$obj
->
SetSign
();
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$values
=
$obj
->
GetValues
();
$url
=
self
::
$apiUrl
.
"api/galanz/
CreateWorkOrder
"
;
$url
=
self
::
$apiUrl
.
"api/galanz/
lookupErrorGroup
"
;
$result
=
$this
->
curlPost
(
$url
,
$values
);
$result
=
$this
->
curlPost
(
$url
,
$values
);
$result
=
json_decode
(
$result
[
'data'
],
true
);
$result
[
'data'
]
=
json_decode
(
$result
[
'data'
],
true
);
$this
->
show
(
$result
);
$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
()
public
function
queryOrder
()
{
{
$obj
=
$this
->
galanzObj
();
$obj
=
$this
->
galanzObj
();
...
...
application/controllers/test/Sgalanz.php
View file @
2c4eec27
...
@@ -65,7 +65,7 @@ class Sgalanz extends BaseController
...
@@ -65,7 +65,7 @@ class Sgalanz extends BaseController
public
function
orderDetail
()
public
function
orderDetail
()
{
{
$obj
=
$this
->
galanzObj
();
$obj
=
$this
->
galanzObj
();
$list
=
$obj
->
OrderDetail
(
'
3911c4cd-6855-4a2c-8085-6e489972e6a3
'
);
$list
=
$obj
->
OrderDetail
(
'
07be1e36-75bd-4394-8a6f-d09e387e869e
'
);
$this
->
show
(
$list
);
$this
->
show
(
$list
);
}
}
...
@@ -73,15 +73,53 @@ class Sgalanz extends BaseController
...
@@ -73,15 +73,53 @@ class Sgalanz extends BaseController
public
function
workOrderDetail
()
public
function
workOrderDetail
()
{
{
$obj
=
$this
->
galanzObj
();
$obj
=
$this
->
galanzObj
();
$list
=
$obj
->
WorkOrderDetail
(
'
511626f5-c8d8-4840-92ce-a01902f522d4
'
);
$list
=
$obj
->
WorkOrderDetail
(
'
b4562475-1eac-415d-8713-653f8ea7d7c3
'
);
$this
->
show
(
$list
);
$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
()
private
function
galanzObj
()
{
{
// $account = [
// 'username' => 'c01000005',
// 'pwd' => 'weixiuhui010'
// ];
$account
=
[
$account
=
[
'username'
=>
'
c0100
0005'
,
'username'
=>
'
R7551
0005'
,
'pwd'
=>
'
weixiuhui010
'
'pwd'
=>
'
dgqh!769
'
];
];
$this
->
load
->
library
(
'Source/SourceGalanz'
,
$account
,
'SourceGalanz'
);
$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')
...
@@ -43,6 +43,43 @@ function str_aes($str, $key='', $type='en')
return
$result
;
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
)
{
function
curl_get
(
$url
)
{
$curl
=
curl_init
();
$curl
=
curl_init
();
curl_setopt
(
$curl
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$curl
,
CURLOPT_URL
,
$url
);
...
...
application/libraries/Receive/Receive.php
View file @
2c4eec27
...
@@ -186,8 +186,22 @@ class Receive
...
@@ -186,8 +186,22 @@ class Receive
if
(
!
is_array
(
$data
))
{
if
(
!
is_array
(
$data
))
{
$return
[
'return_data'
]
=
$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
);
return
json_encode
(
$return
,
JSON_UNESCAPED_UNICODE
);
...
...
application/libraries/Receive/ReceiveGalanz.php
View file @
2c4eec27
...
@@ -15,13 +15,13 @@ class ReceiveGalanz extends Receive
...
@@ -15,13 +15,13 @@ class ReceiveGalanz extends Receive
*/
*/
public
function
CheckQueryOrderValues
()
public
function
CheckQueryOrderValues
()
{
{
$fileds
=
[
'out_trade_no'
,
'account'
];
$fileds
=
[
'out_trade_no'
];
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
}
}
public
function
CheckQueryWorkOrderValues
()
public
function
CheckQueryWorkOrderValues
()
{
{
$fileds
=
[
'work_order_no'
,
'account'
];
$fileds
=
[
'work_order_no'
];
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
}
}
...
@@ -30,7 +30,7 @@ class ReceiveGalanz extends Receive
...
@@ -30,7 +30,7 @@ class ReceiveGalanz extends Receive
*/
*/
public
function
CheckSearchOrderValues
()
public
function
CheckSearchOrderValues
()
{
{
$fileds
=
[
'out_trade_no'
,
'account'
];
$fileds
=
[
'out_trade_no'
];
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
}
}
...
@@ -39,7 +39,7 @@ class ReceiveGalanz extends Receive
...
@@ -39,7 +39,7 @@ class ReceiveGalanz extends Receive
*/
*/
public
function
CheckSaveOrderValues
()
public
function
CheckSaveOrderValues
()
{
{
$fileds
=
[
'out_trade_no'
,
'account'
];
$fileds
=
[
'out_trade_no'
];
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
$dfields
=
[
$dfields
=
[
...
@@ -78,7 +78,7 @@ class ReceiveGalanz extends Receive
...
@@ -78,7 +78,7 @@ class ReceiveGalanz extends Receive
*/
*/
public
function
CheckCreateWorkOrderValues
()
public
function
CheckCreateWorkOrderValues
()
{
{
$fileds
=
[
'out_trade_no'
,
'account'
];
$fileds
=
[
'out_trade_no'
];
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
}
}
...
@@ -87,31 +87,79 @@ class ReceiveGalanz extends Receive
...
@@ -87,31 +87,79 @@ class ReceiveGalanz extends Receive
*/
*/
public
function
CheckCreateUserProfileOrderValues
()
public
function
CheckCreateUserProfileOrderValues
()
{
{
$fileds
=
[
'out_trade_no'
,
'account'
];
$fileds
=
[
'out_trade_no'
];
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
}
}
public
function
CheckSaveWorkOrderValues
()
public
function
CheckSaveWorkOrderValues
()
{
{
$fileds
=
[
'work_order_no'
,
'account'
];
$fileds
=
[
'work_order_no'
];
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
}
}
public
function
CheckSendWorkOrderValues
()
public
function
CheckSendWorkOrderValues
()
{
{
$fileds
=
[
'work_order_no'
,
'account'
];
$fileds
=
[
'work_order_no'
];
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
}
}
public
function
CheckSaveUserProfileOrderValues
()
public
function
CheckSaveUserProfileOrderValues
()
{
{
$fileds
=
[
'up_order_no'
,
'account'
];
$fileds
=
[
'up_order_no'
];
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
}
}
public
function
CheckSendUserProfileOrderValues
()
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
);
$this
->
CheckValues
(
$fileds
);
}
}
...
@@ -133,6 +181,14 @@ class ReceiveGalanz extends Receive
...
@@ -133,6 +181,14 @@ class ReceiveGalanz extends Receive
$this
->
ReturnMessage
(
false
,
'签名错误!'
);
$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
)
{
if
(
$fields
)
{
foreach
(
$fields
as
$v
)
{
foreach
(
$fields
as
$v
)
{
if
(
!
array_key_exists
(
$v
,
$this
->
values
)
||
$this
->
values
[
$v
]
==
''
)
{
if
(
!
array_key_exists
(
$v
,
$this
->
values
)
||
$this
->
values
[
$v
]
==
''
)
{
...
...
application/libraries/Source/SourceGalanz.php
View file @
2c4eec27
...
@@ -15,16 +15,6 @@ class SourceGalanz extends Source
...
@@ -15,16 +15,6 @@ class SourceGalanz extends Source
public
function
__construct
(
$account
)
public
function
__construct
(
$account
)
{
{
//默认账号
// $CI =& get_instance();
// $CI->load->config('account', true);
// $accountConfig = $CI->config->item('account');
// $galanzAccount = $accountConfig['galanz'];
//
// if (!array_key_exists($account['username'], $galanzAccount)) {
// die("galanz系统账号({$account['username']})不存在");
// }
self
::
$account
=
$account
;
self
::
$account
=
$account
;
self
::
$cookieFilePath
=
PUBDIR
.
"cookie/galanz_"
.
self
::
$account
[
'username'
]
.
".cookie"
;
self
::
$cookieFilePath
=
PUBDIR
.
"cookie/galanz_"
.
self
::
$account
[
'username'
]
.
".cookie"
;
self
::
$captchaFilePath
=
PUBDIR
.
"captcha/galanz_"
.
self
::
$account
[
'username'
]
.
".gif"
;
self
::
$captchaFilePath
=
PUBDIR
.
"captcha/galanz_"
.
self
::
$account
[
'username'
]
.
".gif"
;
...
@@ -32,9 +22,61 @@ class SourceGalanz extends Source
...
@@ -32,9 +22,61 @@ class SourceGalanz extends Source
//判断是否登陆
//判断是否登陆
$result
=
$this
->
IsLogin
();
$result
=
$this
->
IsLogin
();
if
(
$result
==
false
)
{
if
(
$result
==
false
)
{
echo
json_encode
([
'return_code'
=>
'FAIL'
,
'return_msg'
=>
'登陆失败'
],
JSON_UNESCAPED_UNICODE
);
return_msg
(
false
,
'登陆失败'
);
die
();
}
}
public
function
IsLogin
()
{
$url
=
self
::
$host
.
'/Complaint/new_srv_callinMP.aspx?type=unsubscribe'
;
$result
=
$this
->
GetUrlContents
(
$url
);
if
(
strlen
(
addslashes
(
$result
))
<
2000
)
{
$flag
=
false
;
//登陆
$result
=
$this
->
Login
();
if
(
$result
[
'code'
]
==
302
)
{
$flag
=
true
;
}
else
{
if
(
file_exists
(
self
::
$cookieFilePath
))
{
unlink
(
self
::
$cookieFilePath
);
}
}
}
else
{
$flag
=
true
;
}
}
return
$flag
;
}
public
function
Login
()
{
$loginUrl
=
self
::
$host
.
"/FLoginNew.aspx"
;
$captchaUrl
=
self
::
$host
.
"/SystemSetting/CheckCode.aspx"
;
$content
=
$this
->
SetUrlCookie
(
$loginUrl
);
$this
->
SaveUrlCaptcha
(
$captchaUrl
);
$post
=
[
'__EVENTTARGET'
=>
''
,
'__EVENTARGUMENT'
=>
''
,
'loguser'
=>
''
,
'txtUserCode'
=>
self
::
$account
[
'username'
],
'txtPassword'
=>
self
::
$account
[
'pwd'
],
'txtCheckCode'
=>
get_uuapi
(
self
::
$captchaFilePath
),
];
preg_match_all
(
'/<input[^>]+name="([^"]+)"[^>]+value="([^"]*)"/'
,
$content
,
$arr
);
foreach
(
$arr
[
1
]
as
$k
=>
$v
)
{
$post
[
$v
]
=
$arr
[
2
][
$k
];
}
$headers
=
$this
->
Header
(
$loginUrl
);
return
$this
->
CurlPost
(
$loginUrl
,
$post
,
$headers
);
}
}
/**
/**
...
@@ -132,7 +174,7 @@ class SourceGalanz extends Source
...
@@ -132,7 +174,7 @@ class SourceGalanz extends Source
$result
=
$this
->
CurlPost
(
$url
,
$post
,
$headers
);
$result
=
$this
->
CurlPost
(
$url
,
$post
,
$headers
);
$result
=
gzdecode
(
$result
[
'data'
]);
$result
=
gzdecode
(
$result
[
'data'
]);
preg_match_all
(
'/
(<tr>\s+<td class="checkbox">[\s\S]+?<\/tr>)
/'
,
$result
,
$tr
);
preg_match_all
(
'/
<tr>\s+<td class="checkbox">[\s\S]+?<\/tr>
/'
,
$result
,
$tr
);
$orders
=
[];
$orders
=
[];
...
@@ -187,7 +229,7 @@ class SourceGalanz extends Source
...
@@ -187,7 +229,7 @@ class SourceGalanz extends Source
$result
=
$this
->
CurlPost
(
$url
,
$post
,
$headers
);
$result
=
$this
->
CurlPost
(
$url
,
$post
,
$headers
);
$result
=
gzdecode
(
$result
[
'data'
]);
$result
=
gzdecode
(
$result
[
'data'
]);
preg_match_all
(
'/
(<tr>\s+<td class="checkbox">[\s\S]+?<\/tr>)
/'
,
$result
,
$tr
);
preg_match_all
(
'/
<tr>\s+<td class="checkbox">[\s\S]+?<\/tr>
/'
,
$result
,
$tr
);
$orders
=
[];
$orders
=
[];
...
@@ -258,7 +300,7 @@ class SourceGalanz extends Source
...
@@ -258,7 +300,7 @@ class SourceGalanz extends Source
$result
=
$this
->
CurlPost
(
$url
,
$post
,
$headers
);
$result
=
$this
->
CurlPost
(
$url
,
$post
,
$headers
);
$result
=
gzdecode
(
$result
[
'data'
]);
$result
=
gzdecode
(
$result
[
'data'
]);
preg_match_all
(
'/
(<tr>\s+<td class="checkbox">[\s\S]+?<\/tr>)
/'
,
$result
,
$tr
);
preg_match_all
(
'/
<tr>\s+<td class="checkbox">[\s\S]+?<\/tr>
/'
,
$result
,
$tr
);
$orders
=
[];
$orders
=
[];
...
@@ -328,8 +370,8 @@ class SourceGalanz extends Source
...
@@ -328,8 +370,8 @@ class SourceGalanz extends Source
preg_match_all
(
'/<td[^>]*>[\s\S]+?<\/td>/'
,
$v
,
$td
);
preg_match_all
(
'/<td[^>]*>[\s\S]+?<\/td>/'
,
$v
,
$td
);
if
(
$td
[
0
])
{
if
(
$td
[
0
])
{
//
$reg = $this->OrderFormReg('chk');
$reg
=
$this
->
OrderFormReg
(
'chk'
);
//
$temp['chk'] = $this->OrderFormValue($td[0][0], $reg);
$temp
[
'chk'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
0
],
$reg
);
$reg
=
$this
->
OrderFormReg
(
'cbiserror'
,
'checkbox'
);
$reg
=
$this
->
OrderFormReg
(
'cbiserror'
,
'checkbox'
);
$temp
[
'cbiserror'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
1
],
$reg
,
'checkbox'
);
$temp
[
'cbiserror'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
1
],
$reg
,
'checkbox'
);
...
@@ -337,14 +379,14 @@ class SourceGalanz extends Source
...
@@ -337,14 +379,14 @@ class SourceGalanz extends Source
$reg
=
$this
->
OrderFormReg
(
'txtproducenumber'
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'txtproducenumber'
,
'text'
);
$temp
[
'txtproducenumber'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
2
],
$reg
,
'text'
);
$temp
[
'txtproducenumber'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
2
],
$reg
,
'text'
);
//
$reg = $this->OrderFormReg('new_producttypeid', 'text');
$reg
=
$this
->
OrderFormReg
(
'new_producttypeid'
,
'text'
);
//
$temp['new_producttypeid'] = $this->OrderFormValue($td[0][3], $reg, 'text');
$temp
[
'new_producttypeid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
3
],
$reg
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_producttypeidName'
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_producttypeidName'
,
'text'
);
$temp
[
'new_producttypeidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
3
],
$reg
,
'text'
);
$temp
[
'new_producttypeidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
3
],
$reg
,
'text'
);
//
$reg = $this->OrderFormReg('new_productmodelid', 'text');
$reg
=
$this
->
OrderFormReg
(
'new_productmodelid'
,
'text'
);
//
$temp['new_productmodelid'] = $this->OrderFormValue($td[0][4], $reg, 'text');
$temp
[
'new_productmodelid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
4
],
$reg
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_productmodelidName'
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_productmodelidName'
,
'text'
);
$temp
[
'new_productmodelidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
4
],
$reg
,
'text'
);
$temp
[
'new_productmodelidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
4
],
$reg
,
'text'
);
...
@@ -387,14 +429,14 @@ class SourceGalanz extends Source
...
@@ -387,14 +429,14 @@ class SourceGalanz extends Source
preg_match_all
(
'/<td[^>]*>[\s\S]+?<\/td>/'
,
$v
,
$td
);
preg_match_all
(
'/<td[^>]*>[\s\S]+?<\/td>/'
,
$v
,
$td
);
if
(
$td
[
0
])
{
if
(
$td
[
0
])
{
//
$reg = $this->OrderFormReg('chk');
$reg
=
$this
->
OrderFormReg
(
'chk'
);
//
$temp['chk'] = $this->OrderFormValue($td[0][0], $reg);
$temp
[
'chk'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
0
],
$reg
);
//
//
$reg = $this->OrderFormReg('new_srv_workorderproductid', 'text');
$reg
=
$this
->
OrderFormReg
(
'new_srv_workorderproductid'
,
'text'
);
//
$temp['new_srv_workorderproductid'] = $this->OrderFormValue($td[0][0], $reg, 'text');
$temp
[
'new_srv_workorderproductid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
0
],
$reg
,
'text'
);
//
//
$reg = $this->OrderFormReg('New_srv_wokordererrorid', 'text');
$reg
=
$this
->
OrderFormReg
(
'New_srv_wokordererrorid'
,
'text'
);
//
$temp['New_srv_wokordererrorid'] = $this->OrderFormValue($td[0][0], $reg, 'text');
$temp
[
'New_srv_wokordererrorid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
0
],
$reg
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_name'
,
'span'
);
$reg
=
$this
->
OrderFormReg
(
'new_name'
,
'span'
);
$temp
[
'new_name'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
1
],
$reg
,
'span'
);
$temp
[
'new_name'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
1
],
$reg
,
'span'
);
...
@@ -402,8 +444,8 @@ class SourceGalanz extends Source
...
@@ -402,8 +444,8 @@ class SourceGalanz extends Source
$reg
=
$this
->
OrderFormReg
(
'new_errorpart'
,
'span'
);
$reg
=
$this
->
OrderFormReg
(
'new_errorpart'
,
'span'
);
$temp
[
'new_errorpart'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
2
],
$reg
,
'span'
);
$temp
[
'new_errorpart'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
2
],
$reg
,
'span'
);
//
$reg = $this->OrderFormReg('new_errormoduleid', 'text');
$reg
=
$this
->
OrderFormReg
(
'new_errormoduleid'
,
'text'
);
//
$temp['new_errormoduleid'] = $this->OrderFormValue($td[0][3], $reg, 'text');
$temp
[
'new_errormoduleid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
3
],
$reg
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_errormoduleidName'
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_errormoduleidName'
,
'text'
);
$temp
[
'new_errormoduleidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
3
],
$reg
,
'text'
);
$temp
[
'new_errormoduleidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
3
],
$reg
,
'text'
);
...
@@ -411,8 +453,8 @@ class SourceGalanz extends Source
...
@@ -411,8 +453,8 @@ class SourceGalanz extends Source
$reg
=
$this
->
OrderFormReg
(
'new_errordesc'
,
'span'
);
$reg
=
$this
->
OrderFormReg
(
'new_errordesc'
,
'span'
);
$temp
[
'new_errordesc'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
4
],
$reg
,
'span'
);
$temp
[
'new_errordesc'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
4
],
$reg
,
'span'
);
//
$reg = $this->OrderFormReg('new_errorgroupid', 'text');
$reg
=
$this
->
OrderFormReg
(
'new_errorgroupid'
,
'text'
);
//
$temp['new_errorgroupid'] = $this->OrderFormValue($td[0][5], $reg, 'text');
$temp
[
'new_errorgroupid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
5
],
$reg
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_errorgroupidName'
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_errorgroupidName'
,
'text'
);
$temp
[
'new_errorgroupidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
5
],
$reg
,
'text'
);
$temp
[
'new_errorgroupidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
5
],
$reg
,
'text'
);
...
@@ -420,8 +462,8 @@ class SourceGalanz extends Source
...
@@ -420,8 +462,8 @@ class SourceGalanz extends Source
$reg
=
$this
->
OrderFormReg
(
'new_causedesc'
,
'span'
);
$reg
=
$this
->
OrderFormReg
(
'new_causedesc'
,
'span'
);
$temp
[
'new_causedesc'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
6
],
$reg
,
'span'
);
$temp
[
'new_causedesc'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
6
],
$reg
,
'span'
);
//
$reg = $this->OrderFormReg('new_srv_errorsolutionid', 'text');
$reg
=
$this
->
OrderFormReg
(
'new_srv_errorsolutionid'
,
'text'
);
//
$temp['new_srv_errorsolutionid'] = $this->OrderFormValue($td[0][7], $reg, 'text');
$temp
[
'new_srv_errorsolutionid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
7
],
$reg
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_srv_errorsolutionidName'
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_srv_errorsolutionidName'
,
'text'
);
$temp
[
'new_srv_errorsolutionidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
7
],
$reg
,
'span'
);
$temp
[
'new_srv_errorsolutionidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
7
],
$reg
,
'span'
);
...
@@ -449,11 +491,11 @@ class SourceGalanz extends Source
...
@@ -449,11 +491,11 @@ class SourceGalanz extends Source
preg_match_all
(
'/<td[^>]*>[\s\S]+?<\/td>/'
,
$v
,
$td
);
preg_match_all
(
'/<td[^>]*>[\s\S]+?<\/td>/'
,
$v
,
$td
);
if
(
$td
[
0
])
{
if
(
$td
[
0
])
{
//
$reg = $this->OrderFormReg('chk');
$reg
=
$this
->
OrderFormReg
(
'chk'
);
//
$temp['chk'] = $this->OrderFormValue($td[0][0], $reg);
$temp
[
'chk'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
0
],
$reg
);
//
//
$reg = $this->OrderFormReg('new_srv_wokordererrorid', 'text');
$reg
=
$this
->
OrderFormReg
(
'new_srv_wokordererrorid'
,
'text'
);
//
$temp['new_srv_wokordererrorid'] = $this->OrderFormValue($td[0][1], $reg, 'text');
$temp
[
'new_srv_wokordererrorid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
1
],
$reg
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_srv_wokordererroridName'
,
'span'
);
$reg
=
$this
->
OrderFormReg
(
'new_srv_wokordererroridName'
,
'span'
);
$temp
[
'new_srv_wokordererroridName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
1
],
$reg
,
'span'
);
$temp
[
'new_srv_wokordererroridName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
1
],
$reg
,
'span'
);
...
@@ -461,8 +503,8 @@ class SourceGalanz extends Source
...
@@ -461,8 +503,8 @@ class SourceGalanz extends Source
$reg
=
$this
->
OrderFormReg
(
'new_oldpartsid'
,
'span'
);
$reg
=
$this
->
OrderFormReg
(
'new_oldpartsid'
,
'span'
);
$temp
[
'new_oldpartsid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
2
],
$reg
,
'span'
);
$temp
[
'new_oldpartsid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
2
],
$reg
,
'span'
);
//
$reg = $this->OrderFormReg('new_errorpartsid', 'text');
$reg
=
$this
->
OrderFormReg
(
'new_errorpartsid'
,
'text'
);
//
$temp['new_errorpartsid'] = $this->OrderFormValue($td[0][2], $reg, 'text');
$temp
[
'new_errorpartsid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
2
],
$reg
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_errorpartsidName'
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_errorpartsidName'
,
'text'
);
$temp
[
'new_errorpartsidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
2
],
$reg
,
'text'
);
$temp
[
'new_errorpartsidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
2
],
$reg
,
'text'
);
...
@@ -470,8 +512,8 @@ class SourceGalanz extends Source
...
@@ -470,8 +512,8 @@ class SourceGalanz extends Source
$reg
=
$this
->
OrderFormReg
(
'new_newpartsid'
,
'span'
);
$reg
=
$this
->
OrderFormReg
(
'new_newpartsid'
,
'span'
);
$temp
[
'new_newpartsid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
3
],
$reg
,
'span'
);
$temp
[
'new_newpartsid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
3
],
$reg
,
'span'
);
//
$reg = $this->OrderFormReg('new_partsid', 'text');
$reg
=
$this
->
OrderFormReg
(
'new_partsid'
,
'text'
);
//
$temp['new_partsid'] = $this->OrderFormValue($td[0][4], $reg, 'text');
$temp
[
'new_partsid'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
4
],
$reg
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_partsidName'
,
'text'
);
$reg
=
$this
->
OrderFormReg
(
'new_partsidName'
,
'text'
);
$temp
[
'new_partsidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
4
],
$reg
,
'text'
);
$temp
[
'new_partsidName'
]
=
$this
->
OrderFormValue
(
$td
[
0
][
4
],
$reg
,
'text'
);
...
@@ -532,85 +574,229 @@ class SourceGalanz extends Source
...
@@ -532,85 +574,229 @@ class SourceGalanz extends Source
return
$result
;
return
$result
;
}
}
public
function
Save
Work
Order
(
$id
,
$data
)
public
function
Save
UserProfile
Order
(
$id
,
$data
)
{
{
$result
=
$this
->
Handel
Work
Order
(
$id
,
$data
,
'save'
);
$result
=
$this
->
Handel
UserProfile
Order
(
$id
,
$data
,
'save'
);
return
$result
;
return
$result
;
}
}
public
function
Send
Work
Order
(
$id
,
$data
)
public
function
Send
UserProfile
Order
(
$id
,
$data
)
{
{
$result
=
$this
->
Handel
Work
Order
(
$id
,
$data
,
'send'
);
$result
=
$this
->
Handel
UserProfile
Order
(
$id
,
$data
,
'send'
);
return
$result
;
return
$result
;
}
}
public
function
Save
UserProfile
Order
(
$id
,
$data
)
public
function
Save
Work
Order
(
$id
,
$data
)
{
{
$result
=
$this
->
Handel
UserProfileOrder
(
$id
,
$data
,
's
ave'
);
$result
=
$this
->
Handel
WorkOrder
(
$id
,
$data
,
'S
ave'
);
return
$result
;
return
$result
;
}
}
public
function
Send
UserProfile
Order
(
$id
,
$data
)
public
function
Send
Work
Order
(
$id
,
$data
)
{
{
$result
=
$this
->
Handel
UserProfileOrder
(
$id
,
$data
,
's
end'
);
$result
=
$this
->
Handel
WorkOrder
(
$id
,
$data
,
'S
end'
);
return
$result
;
return
$result
;
}
}
public
function
IsLogin
()
/**
* 维修单 - 保存机器信息
* @param $id
* @param $data
* @param $producenumber
* @return mixed
*/
public
function
ProdGetWorkOrder
(
$id
,
$data
,
$producenumber
)
{
{
$url
=
self
::
$host
.
'/Complaint/new_srv_callinMP.aspx?type=unsubscribe'
;
if
(
empty
(
$data
[
'machine'
]))
{
$result
=
$this
->
GetUrlContents
(
$url
);
$order
=
$this
->
ProdAddWorkOrder
(
$id
,
$data
);
}
else
{
$flag
=
true
;
foreach
(
$data
[
'machine'
]
as
$k
=>
$v
)
{
if
(
$v
[
'txtproducenumber'
]
==
''
)
{
$flag
=
false
;
}
if
(
strlen
(
addslashes
(
$result
))
<
2000
)
{
if
(
$v
[
'txtproducenumber'
]
==
$producenumber
)
{
$flag
=
false
;
return_msg
(
false
,
'条码'
.
$producenumber
.
'已存在'
);
}
}
//登陆
if
(
$flag
)
{
$result
=
$this
->
Login
();
$order
=
$this
->
ProdAddWorkOrder
(
$id
,
$data
);
if
(
$result
[
'code'
]
==
302
)
{
$flag
=
true
;
}
else
{
}
else
{
if
(
file_exists
(
self
::
$cookieFilePath
))
{
$order
=
$data
;
unlink
(
self
::
$cookieFilePath
);
}
}
}
}
}
else
{
foreach
(
$order
[
'machine'
]
as
$k
=>
$v
)
{
$flag
=
true
;
if
(
$v
[
'txtproducenumber'
]
==
''
)
{
$order
[
'machine'
][
$k
][
'txtproducenumber'
]
=
$producenumber
;
}
}
}
return
$flag
;
$result
=
$this
->
HandelWorkOrder
(
$id
,
$order
,
'ProdGet'
);
$this
->
WorkOrderError
(
$result
);
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
}
public
function
Login
()
/**
* 维修单 - 新增机器信息
*
* @param $id
* @param $data
* @return mixed
*/
public
function
ProdAddWorkOrder
(
$id
,
$data
)
{
{
$loginUrl
=
self
::
$host
.
"/FLoginNew.aspx"
;
$this
->
HandelWorkOrder
(
$id
,
$data
,
'ProdAdd'
);
$captchaUrl
=
self
::
$host
.
"/SystemSetting/CheckCode.aspx"
;
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
$content
=
$this
->
SetUrlCookie
(
$loginUrl
);
/**
$this
->
SaveUrlCaptcha
(
$captchaUrl
);
* 维修单 - 新增故障信息
*
* @param $id
* @param $data
* @return mixed
*/
public
function
ErrorAddWorkOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelWorkOrder
(
$id
,
$data
,
'ErrorAdd'
);
$this
->
WorkOrderError
(
$result
);
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
$post
=
[
/**
'__EVENTTARGET'
=>
''
,
* 维修单 - 新增换件信息
'__EVENTARGUMENT'
=>
''
,
*
'loguser'
=>
''
,
* @param $id
'txtUserCode'
=>
self
::
$account
[
'username'
],
* @param $data
'txtPassword'
=>
self
::
$account
[
'pwd'
],
* @return mixed
'txtCheckCode'
=>
get_uuapi
(
self
::
$captchaFilePath
),
*/
];
public
function
PartsAddAddWorkOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelWorkOrder
(
$id
,
$data
,
'PartsAdd'
);
$this
->
WorkOrderError
(
$result
);
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
preg_match_all
(
'/<input[^>]+name="([^"]+)"[^>]+value="([^"]*)"/'
,
$content
,
$arr
);
/**
* 故障信息 - 故障现象
* @param $workorderproductid
* @return array
*/
public
function
LookupErrormModule
(
$workorderproductid
)
{
return
$this
->
LookupSingle
(
'lookupErrormodule'
,
$workorderproductid
);
}
foreach
(
$arr
[
1
]
as
$k
=>
$v
)
{
/**
$post
[
$v
]
=
$arr
[
2
][
$k
];
* 故障信息 - 原因分类
}
* @param $errormoduleid
* @return array
*/
public
function
LookupErrorGroup
(
$errormoduleid
)
{
return
$this
->
LookupSingle
(
'lookupErrorgroup'
,
$errormoduleid
);
}
$headers
=
$this
->
Header
(
$loginUrl
);
/**
* 故障信息 - 维修措施
* @param $errorgroupid
* @return array
*/
public
function
LookupErrorSolution
(
$errorgroupid
)
{
return
$this
->
LookupSingle
(
'lookupErrorsolution'
,
$errorgroupid
);
}
return
$this
->
CurlPost
(
$loginUrl
,
$post
,
$headers
);
/**
* 换件信息 - 不良品名称
* @param $errorsolutionid
* @param $workorderproductid
* @return array
*/
public
function
LookupErrorParts
(
$errorsolutionid
,
$workorderproductid
)
{
return
$this
->
LookupSingle
(
'lookupErrorparts'
,
$errorsolutionid
.
'%20'
.
$workorderproductid
);
}
/**
* 换件信息 - 良品名称
* @param $siteid
* @param $errorpartsid
* @return array
*/
public
function
LookupParts
(
$siteid
,
$errorpartsid
)
{
return
$this
->
LookupSingle
(
'lookupParts'
,
$siteid
.
'%20'
.
$errorpartsid
);
}
private
function
LookupSingle
(
$key
,
$val
)
{
$url
=
self
::
$host
.
"/Common/lookupSingle.aspx?lookupname=
{
$key
}
¶m=
{
$val
}
"
;
$result
=
$this
->
GetUrlContents
(
$url
);
preg_match_all
(
'/<tr[^>]+style="Cursor:hand"[^>]*>[\s\S]+?<\/tr>/'
,
$result
,
$tr
);
$list
=
[];
if
(
$tr
[
0
])
{
switch
(
$key
)
{
case
'lookupErrorsolution'
:
foreach
(
$tr
[
0
]
as
$k
=>
$v
)
{
preg_match_all
(
'/<font color="#333333">([^<]+)</'
,
$v
,
$txt
);
if
(
isset
(
$txt
[
1
])
&&
$txt
[
1
])
{
$temp
[
'id'
]
=
$txt
[
1
][
1
];
$temp
[
'no'
]
=
$txt
[
1
][
3
];
$temp
[
'name'
]
=
$txt
[
1
][
2
];
$list
[]
=
$temp
;
}
}
break
;
case
'lookupParts'
:
foreach
(
$tr
[
0
]
as
$k
=>
$v
)
{
preg_match_all
(
'/<font color="#333333">([^<]+)</'
,
$v
,
$txt
);
if
(
isset
(
$txt
[
1
])
&&
$txt
[
1
])
{
$temp
[
'id'
]
=
$txt
[
1
][
1
];
$temp
[
'no'
]
=
$txt
[
1
][
2
];
$temp
[
'name'
]
=
$txt
[
1
][
3
];
$temp
[
'line'
]
=
$txt
[
1
][
4
];
$temp
[
'superclass'
]
=
$txt
[
1
][
5
];
$temp
[
'subclass'
]
=
$txt
[
1
][
6
];
$temp
[
'stock'
]
=
$txt
[
1
][
7
];
$list
[]
=
$temp
;
}
}
break
;
default
:
foreach
(
$tr
[
0
]
as
$k
=>
$v
)
{
preg_match_all
(
'/<font color="#333333">([^<]+)</'
,
$v
,
$txt
);
if
(
isset
(
$txt
[
1
])
&&
$txt
[
1
])
{
$temp
[
'id'
]
=
$txt
[
1
][
1
];
$temp
[
'name'
]
=
$txt
[
1
][
2
];
$temp
[
'no'
]
=
$txt
[
1
][
3
];
$list
[]
=
$temp
;
}
}
}
}
return
$list
;
}
}
/**
/**
...
@@ -765,25 +951,15 @@ class SourceGalanz extends Source
...
@@ -765,25 +951,15 @@ class SourceGalanz extends Source
private
function
HandelWorkOrder
(
$id
,
$data
,
$type
)
private
function
HandelWorkOrder
(
$id
,
$data
,
$type
)
{
{
switch
(
$type
){
case
'save'
:
$target
=
'ctl00$ContentQuery$btnSave'
;
break
;
case
'send'
:
$target
=
'ctl00$ContentQuery$btnSend'
;
break
;
}
$post
=
[
$post
=
[
'__EVENTTARGET'
=>
$target
,
'__EVENTTARGET'
=>
''
,
'__EVENTARGUMENT'
=>
''
,
'__EVENTARGUMENT'
=>
''
,
'__LASTFOCUS'
=>
''
,
'__LASTFOCUS'
=>
''
,
'__VIEWSTATE'
=>
$data
[
'__VIEWSTATE'
],
'__VIEWSTATE'
=>
$data
[
'__VIEWSTATE'
],
'__SCROLLPOSITIONX'
=>
'0'
,
'__SCROLLPOSITIONX'
=>
'0'
,
'__SCROLLPOSITIONY'
=>
'0'
,
'__SCROLLPOSITIONY'
=>
'0'
,
'ctl00$hidPageSiteMapTitle'
=>
'维修单-编辑页面'
,
'ctl00$hidPageSiteMapTitle'
=>
'维修单-编辑页面'
,
'ctl00$ContentHeader$hidFormId'
=>
$
data
[
'new_id'
]
,
'ctl00$ContentHeader$hidFormId'
=>
$
id
,
'ctl00$ContentHeader$hidUserId'
=>
$data
[
'hidUserId'
],
'ctl00$ContentHeader$hidUserId'
=>
$data
[
'hidUserId'
],
'ctl00$ContentHeader$hidIsKT'
=>
$data
[
'hidIsKT'
],
'ctl00$ContentHeader$hidIsKT'
=>
$data
[
'hidIsKT'
],
'ctl00$ContentHeader$hidformPosition'
=>
$data
[
'hidformPosition'
],
'ctl00$ContentHeader$hidformPosition'
=>
$data
[
'hidformPosition'
],
...
@@ -804,15 +980,6 @@ class SourceGalanz extends Source
...
@@ -804,15 +980,6 @@ class SourceGalanz extends Source
'ctl00$ContentData$new_uninvsestreasonName'
=>
$data
[
'new_uninvsestreasonName'
],
'ctl00$ContentData$new_uninvsestreasonName'
=>
$data
[
'new_uninvsestreasonName'
],
'ctl00$ContentData$new_reconsidermemo'
=>
$data
[
'new_reconsidermemo'
],
'ctl00$ContentData$new_reconsidermemo'
=>
$data
[
'new_reconsidermemo'
],
'ctl00$ContentData$new_approvalremark'
=>
$data
[
'new_approvalremark'
],
'ctl00$ContentData$new_approvalremark'
=>
$data
[
'new_approvalremark'
],
'ctl00$ContentData$rptProd$ctl00$cbiserror'
=>
''
,
'ctl00$ContentData$rptProd$ctl00$txtproducenumber'
=>
''
,
'ctl00$ContentData$rptProd$ctl00$new_producttypeid'
=>
''
,
'ctl00$ContentData$rptProd$ctl00$new_producttypeidName'
=>
''
,
'ctl00$ContentData$rptProd$ctl00$new_productmodelid'
=>
''
,
'ctl00$ContentData$rptProd$ctl00$new_productmodelidName'
=>
''
,
'ctl00$ContentData$rptProd$ctl00$hidnew_productnumber'
=>
''
,
'ctl00$ContentData$rptProd$ctl00$hidnew_modelnumber'
=>
''
,
'ctl00$ContentData$rptProd$ctl00$new_goldcardno'
=>
''
,
'ctl00$ContentData$new_custname'
=>
$data
[
'new_custname'
],
'ctl00$ContentData$new_custname'
=>
$data
[
'new_custname'
],
'ctl00$ContentData$new_custmobile'
=>
$data
[
'new_custmobile'
],
'ctl00$ContentData$new_custmobile'
=>
$data
[
'new_custmobile'
],
'ctl00$ContentData$new_custtel'
=>
$data
[
'new_custtel'
],
'ctl00$ContentData$new_custtel'
=>
$data
[
'new_custtel'
],
...
@@ -844,25 +1011,6 @@ class SourceGalanz extends Source
...
@@ -844,25 +1011,6 @@ class SourceGalanz extends Source
'ctl00$ContentData$new_reliefmemo'
=>
$data
[
'new_reliefmemo'
],
'ctl00$ContentData$new_reliefmemo'
=>
$data
[
'new_reliefmemo'
],
'ctl00$ContentData$new_siteremark'
=>
$data
[
'new_siteremark'
],
'ctl00$ContentData$new_siteremark'
=>
$data
[
'new_siteremark'
],
'ctl00$ContentData$new_approvalstep'
=>
$data
[
'new_approvalstep'
],
'ctl00$ContentData$new_approvalstep'
=>
$data
[
'new_approvalstep'
],
'ctl00$ContentData$rptError$ctl00$chk'
=>
''
,
'ctl00$ContentData$rptError$ctl00$new_srv_workorderproductid'
=>
''
,
'ctl00$ContentData$rptError$ctl00$New_srv_wokordererrorid'
=>
''
,
'ctl00$ContentData$rptError$ctl00$new_errormoduleid'
=>
''
,
'ctl00$ContentData$rptError$ctl00$new_errormoduleidName'
=>
''
,
'ctl00$ContentData$rptError$ctl00$new_errorgroupid'
=>
''
,
'ctl00$ContentData$rptError$ctl00$new_errorgroupidName'
=>
''
,
'ctl00$ContentData$rptError$ctl00$new_srv_errorsolutionid'
=>
''
,
'ctl00$ContentData$rptError$ctl00$new_srv_errorsolutionidName'
=>
''
,
'ctl00$ContentData$rptError$ctl00$new_befpic'
=>
''
,
'ctl00$ContentData$rptError$ctl00$file_imgbef'
=>
''
,
'ctl00$ContentData$rptError$ctl00$new_aftpic'
=>
''
,
'ctl00$ContentData$rptError$ctl00$file_imgaft'
=>
''
,
'ctl00$ContentData$rptParts$ctl00$new_srv_wokordererrorid'
=>
''
,
'ctl00$ContentData$rptParts$ctl00$new_errorpartsid'
=>
''
,
'ctl00$ContentData$rptParts$ctl00$new_errorpartsidName'
=>
''
,
'ctl00$ContentData$rptParts$ctl00$new_partsid'
=>
''
,
'ctl00$ContentData$rptParts$ctl00$new_partsidName'
=>
''
,
'ctl00$ContentData$rptParts$ctl00$new_qty'
=>
''
,
'ctl00$ContentData$new_baseamount'
=>
$data
[
'new_baseamount'
],
'ctl00$ContentData$new_baseamount'
=>
$data
[
'new_baseamount'
],
'ctl00$ContentData$new_mileamount'
=>
$data
[
'new_mileamount'
],
'ctl00$ContentData$new_mileamount'
=>
$data
[
'new_mileamount'
],
'ctl00$ContentData$productname'
=>
$data
[
'productname'
],
'ctl00$ContentData$productname'
=>
$data
[
'productname'
],
...
@@ -873,7 +1021,40 @@ class SourceGalanz extends Source
...
@@ -873,7 +1021,40 @@ class SourceGalanz extends Source
'ctl00$ContentData$new_othersuggest'
=>
$data
[
'new_othersuggest'
],
'ctl00$ContentData$new_othersuggest'
=>
$data
[
'new_othersuggest'
],
];
];
return
$post
;
switch
(
$type
){
case
'Save'
:
$post
[
'__EVENTTARGET'
]
=
'ctl00$ContentQuery$btnSave'
;
break
;
case
'Send'
:
$post
[
'__EVENTTARGET'
]
=
'ctl00$ContentQuery$btnSend'
;
break
;
case
'ProdAdd'
:
$post
[
'__EVENTTARGET'
]
=
'ctl00$ContentData$btnProdAdd'
;
break
;
case
'ProdGet'
:
$post
[
'__EVENTTARGET'
]
=
'ctl00$ContentData$btnProdGet'
;
break
;
case
'ErrorAdd'
:
$post
[
'__EVENTTARGET'
]
=
'ctl00$ContentData$btnErrorAdd'
;
break
;
case
'PartsAdd'
:
$post
[
'__EVENTTARGET'
]
=
'ctl00$ContentData$btnPartsAdd'
;
break
;
}
$machine
=
$this
->
HandelWorkOrderMachineParam
(
$data
[
'machine'
]);
$post
=
array_merge
(
$post
,
$machine
);
$fault
=
$this
->
HandelWorkOrderFaultParam
(
$data
[
'fault'
]);
$post
=
array_merge
(
$post
,
$fault
);
$parts
=
$this
->
HandelWorkOrderPartsParam
(
$data
[
'parts'
]);
$post
=
array_merge
(
$post
,
$parts
);
$url
=
self
::
$host
.
'/repair/new_srv_workorderEP.aspx?mainid=&mainidname=&attrcode=&id='
.
$id
;
$url
=
self
::
$host
.
'/repair/new_srv_workorderEP.aspx?mainid=&mainidname=&attrcode=&id='
.
$id
;
$headers
=
$this
->
Header
(
$url
);
$headers
=
$this
->
Header
(
$url
);
...
@@ -886,6 +1067,88 @@ class SourceGalanz extends Source
...
@@ -886,6 +1067,88 @@ class SourceGalanz extends Source
return
$result
;
return
$result
;
}
}
private
function
HandelWorkOrderMachineParam
(
$data
)
{
$result
=
[];
if
(
$data
)
{
foreach
(
$data
as
$k
=>
$v
)
{
$tempKey
=
str_pad
(
$k
,
2
,
'0'
,
STR_PAD_LEFT
);
$post
=
[
'ctl00$ContentData$rptProd$ctl'
.
$tempKey
.
'$cbiserror'
=>
$v
[
'cbiserror'
]
?
'on'
:
''
,
'ctl00$ContentData$rptProd$ctl'
.
$tempKey
.
'$txtproducenumber'
=>
$v
[
'txtproducenumber'
],
'ctl00$ContentData$rptProd$ctl'
.
$tempKey
.
'$new_producttypeid'
=>
$v
[
'new_producttypeid'
],
'ctl00$ContentData$rptProd$ctl'
.
$tempKey
.
'$new_producttypeidName'
=>
$v
[
'new_producttypeidName'
],
'ctl00$ContentData$rptProd$ctl'
.
$tempKey
.
'$new_productmodelid'
=>
$v
[
'new_productmodelid'
],
'ctl00$ContentData$rptProd$ctl'
.
$tempKey
.
'$new_productmodelidName'
=>
$v
[
'new_productmodelidName'
],
'ctl00$ContentData$rptProd$ctl'
.
$tempKey
.
'$hidnew_productnumber'
=>
$v
[
'hidnew_productnumber'
],
'ctl00$ContentData$rptProd$ctl'
.
$tempKey
.
'$hidnew_modelnumber'
=>
$v
[
'hidnew_modelnumber'
],
'ctl00$ContentData$rptProd$ctl'
.
$tempKey
.
'$new_goldcardno'
=>
$v
[
'new_goldcardno'
],
];
$result
=
array_merge
(
$result
,
$post
);
}
}
return
$result
;
}
private
function
HandelWorkOrderFaultParam
(
$data
)
{
$result
=
[];
if
(
$data
)
{
foreach
(
$data
as
$k
=>
$v
)
{
$tempKey
=
str_pad
(
$k
,
2
,
'0'
,
STR_PAD_LEFT
);
$post
=
[
'ctl00$ContentData$rptError$ctl'
.
$tempKey
.
'$chk'
=>
$v
[
'chk'
],
'ctl00$ContentData$rptError$ctl'
.
$tempKey
.
'$new_srv_workorderproductid'
=>
$v
[
'new_srv_workorderproductid'
],
'ctl00$ContentData$rptError$ctl'
.
$tempKey
.
'$New_srv_wokordererrorid'
=>
$v
[
'New_srv_wokordererrorid'
],
'ctl00$ContentData$rptError$ctl'
.
$tempKey
.
'$new_errormoduleid'
=>
$v
[
'new_errormoduleid'
],
'ctl00$ContentData$rptError$ctl'
.
$tempKey
.
'$new_errormoduleidName'
=>
$v
[
'new_errormoduleidName'
],
'ctl00$ContentData$rptError$ctl'
.
$tempKey
.
'$new_errorgroupid'
=>
$v
[
'new_errorgroupid'
],
'ctl00$ContentData$rptError$ctl'
.
$tempKey
.
'$new_errorgroupidName'
=>
$v
[
'new_errorgroupidName'
],
'ctl00$ContentData$rptError$ctl'
.
$tempKey
.
'$new_srv_errorsolutionid'
=>
$v
[
'new_srv_errorsolutionid'
],
'ctl00$ContentData$rptError$ctl'
.
$tempKey
.
'$new_srv_errorsolutionidName'
=>
$v
[
'new_srv_errorsolutionidName'
],
'ctl00$ContentData$rptError$ctl'
.
$tempKey
.
'$new_befpic'
=>
''
,
'ctl00$ContentData$rptError$ctl'
.
$tempKey
.
'$file_imgbef'
=>
''
,
'ctl00$ContentData$rptError$ctl'
.
$tempKey
.
'$new_aftpic'
=>
''
,
'ctl00$ContentData$rptError$ctl'
.
$tempKey
.
'$file_imgaft'
=>
''
,
];
$result
=
array_merge
(
$result
,
$post
);
}
}
return
$result
;
}
private
function
HandelWorkOrderPartsParam
(
$data
)
{
$result
=
[];
if
(
$data
)
{
foreach
(
$data
as
$k
=>
$v
)
{
$tempKey
=
str_pad
(
$k
,
2
,
'0'
,
STR_PAD_LEFT
);
$post
=
[
'ctl00$ContentData$rptParts$ctl'
.
$tempKey
.
'$new_srv_wokordererrorid'
=>
$v
[
'new_srv_wokordererrorid'
],
'ctl00$ContentData$rptParts$ctl'
.
$tempKey
.
'$new_errorpartsid'
=>
$v
[
'new_errorpartsid'
],
'ctl00$ContentData$rptParts$ctl'
.
$tempKey
.
'$new_errorpartsidName'
=>
$v
[
'new_errorpartsidName'
],
'ctl00$ContentData$rptParts$ctl'
.
$tempKey
.
'$new_partsid'
=>
$v
[
'new_partsid'
],
'ctl00$ContentData$rptParts$ctl'
.
$tempKey
.
'$new_partsidName'
=>
$v
[
'new_partsidName'
],
'ctl00$ContentData$rptParts$ctl'
.
$tempKey
.
'$new_qty'
=>
$v
[
'new_qty'
],
];
$result
=
array_merge
(
$result
,
$post
);
}
}
return
$result
;
}
/**
/**
* 处理安装单
* 处理安装单
* @param $id
* @param $id
...
@@ -911,7 +1174,7 @@ class SourceGalanz extends Source
...
@@ -911,7 +1174,7 @@ class SourceGalanz extends Source
'__LASTFOCUS'
=>
''
,
'__LASTFOCUS'
=>
''
,
'__VIEWSTATE'
=>
$data
[
'__VIEWSTATE'
],
'__VIEWSTATE'
=>
$data
[
'__VIEWSTATE'
],
'ctl00$hidPageSiteMapTitle'
=>
'安装单录入—编辑页面'
,
'ctl00$hidPageSiteMapTitle'
=>
'安装单录入—编辑页面'
,
'ctl00$ContentHeader$hidFormId'
=>
$
data
[
'new_id'
]
,
'ctl00$ContentHeader$hidFormId'
=>
$
id
,
'ctl00$ContentHeader$hidproductgroupid'
=>
$data
[
'hidproductgroupid'
],
'ctl00$ContentHeader$hidproductgroupid'
=>
$data
[
'hidproductgroupid'
],
'ctl00$ContentData$new_number'
=>
$data
[
'new_number'
],
'ctl00$ContentData$new_number'
=>
$data
[
'new_number'
],
'ctl00$ContentData$new_srv_callinid'
=>
$data
[
'new_srv_callinid'
],
'ctl00$ContentData$new_srv_callinid'
=>
$data
[
'new_srv_callinid'
],
...
@@ -1294,9 +1557,9 @@ class SourceGalanz extends Source
...
@@ -1294,9 +1557,9 @@ class SourceGalanz extends Source
'type'
=>
'text'
,
'type'
=>
'text'
,
'reg'
=>
$this
->
OrderFormReg
(
'new_countyid'
)
'reg'
=>
$this
->
OrderFormReg
(
'new_countyid'
)
],
],
'new_countyid
n
ame'
=>
[
'new_countyid
N
ame'
=>
[
'type'
=>
'text'
,
'type'
=>
'text'
,
'reg'
=>
$this
->
OrderFormReg
(
'new_countyid
n
ame'
)
'reg'
=>
$this
->
OrderFormReg
(
'new_countyid
N
ame'
)
],
//区/县
],
//区/县
'new_townid'
=>
[
'new_townid'
=>
[
'type'
=>
'text'
,
'type'
=>
'text'
,
...
@@ -1758,4 +2021,13 @@ class SourceGalanz extends Source
...
@@ -1758,4 +2021,13 @@ class SourceGalanz extends Source
return
$header
;
return
$header
;
}
}
private
function
WorkOrderError
(
$html
)
{
preg_match
(
'/<scriptt[^>]*>alert\("([^"]+)"\);?<\/scriptt>/'
,
$html
,
$arr
);
$error
=
isset
(
$arr
[
1
])
?
$arr
[
1
]
:
''
;
if
(
$error
)
{
return_msg
(
false
,
$error
);
}
}
}
}
\ 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