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
eae51012
Commit
eae51012
authored
Sep 08, 2016
by
蒋林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
维修单保存接口
parent
2c4eec27
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
270 additions
and
100 deletions
+270
-100
Welcome.php
application/controllers/Welcome.php
+7
-6
Galanz.php
application/controllers/api/Galanz.php
+10
-34
Rgalanz.php
application/controllers/test/Rgalanz.php
+115
-47
base_helper.php
application/helpers/base_helper.php
+2
-4
Receive.php
application/libraries/Receive/Receive.php
+2
-4
ReceiveGalanz.php
application/libraries/Receive/ReceiveGalanz.php
+116
-0
SourceGalanz.php
application/libraries/Source/SourceGalanz.php
+18
-5
galanz_c01000005.gif
public/captcha/galanz_c01000005.gif
+0
-0
No files found.
application/controllers/Welcome.php
View file @
eae51012
...
@@ -6,14 +6,15 @@ defined('BASEPATH') OR exit('No direct script access allowed');
...
@@ -6,14 +6,15 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*/
*/
class
Welcome
extends
BaseController
{
class
Welcome
extends
BaseController
{
public
function
postd
()
public
function
index
()
{
{
$str
=
''
;
$str
=
isset
(
$_GET
[
'p'
])
?
$_GET
[
'p'
]
:
'12345678'
;
}
protected
function
handel
(
$str
)
$en
=
str_aes
(
$str
,
'lyt9mBmcGo2UAw1P/IKtKA=='
);
{
$de
=
str_aes
(
$en
,
'lyt9mBmcGo2UAw1P/IKtKA=='
,
'de'
);
return
''
;
var_dump
(
$en
);
var_dump
(
$de
);
}
}
...
...
application/controllers/api/Galanz.php
View file @
eae51012
...
@@ -103,32 +103,7 @@ class Galanz extends BaseController
...
@@ -103,32 +103,7 @@ class Galanz extends BaseController
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$this
->
getCallOrder
(
$values
[
'out_trade_no'
],
$sourceGalanzObj
);
$order
=
$this
->
getCallOrder
(
$values
[
'out_trade_no'
],
$sourceGalanzObj
);
$order
=
$obj
->
SetSaveOrderValues
(
$order
,
$values
);
//处理参数
if
(
$values
[
'new_sitecontacttime'
]
!=
''
)
{
$order
[
'new_sitecontacttime'
]
=
$values
[
'sitecontacttime'
];
}
if
(
$values
[
'new_siteappointmenttime'
]
!=
''
)
{
$order
[
'new_siteappointmenttime'
]
=
$values
[
'siteappointmenttime'
];
}
if
(
$values
[
'new_actualvisittime'
]
!=
''
)
{
$order
[
'new_actualvisittime'
]
=
$values
[
'actualvisittime'
];
}
if
(
$values
[
'new_isguaranty'
]
!=
''
)
{
$order
[
'new_isguaranty'
]
=
$values
[
'isguaranty'
]
?
'True'
:
'False'
;
}
if
(
$values
[
'new_finishstatus'
]
!=
''
)
{
$order
[
'new_finishstatus'
]
=
$values
[
'finishstatus'
]
?
'True'
:
'False'
;
}
if
(
$values
[
'new_unfinishreason'
]
!=
''
)
{
$order
[
'new_unfinishreason'
]
=
$values
[
'unfinishreason'
];
}
if
(
$values
[
'new_sitedealremarks'
]
!=
''
)
{
$order
[
'new_sitedealremarks'
]
=
$values
[
'sitedealremarks'
];
}
if
(
$values
[
'new_ServicePersonnel'
]
!=
''
)
{
$order
[
'new_ServicePersonnel'
]
=
$values
[
'servicePersonnel'
];
}
//保存订单
//保存订单
//$sourceGalanzObj->SaveOrder($order['new_id'], $order);
//$sourceGalanzObj->SaveOrder($order['new_id'], $order);
...
@@ -181,7 +156,7 @@ class Galanz extends BaseController
...
@@ -181,7 +156,7 @@ class Galanz extends BaseController
//搜索订单
//搜索订单
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$this
->
get
Work
Order
(
$values
[
'out_trade_no'
],
$sourceGalanzObj
);
$order
=
$this
->
get
Call
Order
(
$values
[
'out_trade_no'
],
$sourceGalanzObj
);
//保存订单
//保存订单
$result
=
$sourceGalanzObj
->
CreateWorkOrder
(
$order
[
'new_id'
],
$order
);
$result
=
$sourceGalanzObj
->
CreateWorkOrder
(
$order
[
'new_id'
],
$order
);
...
@@ -204,10 +179,10 @@ class Galanz extends BaseController
...
@@ -204,10 +179,10 @@ class Galanz extends BaseController
$obj
->
SetValues
(
$param
);
$obj
->
SetValues
(
$param
);
$obj
->
CheckCreateUserProfileOrderValues
();
$obj
->
CheckCreateUserProfileOrderValues
();
$values
=
$obj
->
GetValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'
up_order
_no'
],
'createUserprofileOrder'
,
$param
);
$this
->
saveLog
(
$values
[
'
out_trade
_no'
],
'createUserprofileOrder'
,
$param
);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$this
->
get
UserProfileOrder
(
$values
[
'mobile'
],
$values
[
'up_order
_no'
],
$sourceGalanzObj
);
$order
=
$this
->
get
CallOrder
(
$values
[
'out_trade
_no'
],
$sourceGalanzObj
);
//保存订单
//保存订单
$result
=
$sourceGalanzObj
->
CreateUserProfileOrder
(
$order
[
'new_id'
],
$order
);
$result
=
$sourceGalanzObj
->
CreateUserProfileOrder
(
$order
[
'new_id'
],
$order
);
...
@@ -269,6 +244,7 @@ class Galanz extends BaseController
...
@@ -269,6 +244,7 @@ class Galanz extends BaseController
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$this
->
getWorkOrder
(
$values
[
'work_order_no'
],
$sourceGalanzObj
);
$order
=
$this
->
getWorkOrder
(
$values
[
'work_order_no'
],
$sourceGalanzObj
);
$order
=
$obj
->
SetSaveWorkOrderValues
(
$order
,
$values
);
$result
=
$sourceGalanzObj
->
SaveWorkOrder
(
$order
[
'new_id'
],
$order
);
$result
=
$sourceGalanzObj
->
SaveWorkOrder
(
$order
[
'new_id'
],
$order
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
...
@@ -547,11 +523,11 @@ class Galanz extends BaseController
...
@@ -547,11 +523,11 @@ class Galanz extends BaseController
*/
*/
private
function
sourceGalanzObj
(
$username
,
$pwd
)
private
function
sourceGalanzObj
(
$username
,
$pwd
)
{
{
$pwd
=
str_aes
(
$pwd
,
''
,
'de'
);
// $pwd = str_aes(urldecode($pwd)
, '', 'de');
//
if
(
!
$pwd
)
{
//
if (!$pwd) {
return_msg
(
false
,
'密码无效'
);
//
return_msg(false, '密码无效');
}
//
}
$account
=
[
$account
=
[
'username'
=>
$username
,
'username'
=>
$username
,
...
...
application/controllers/test/Rgalanz.php
View file @
eae51012
This diff is collapsed.
Click to expand it.
application/helpers/base_helper.php
View file @
eae51012
...
@@ -57,15 +57,13 @@ function return_msg($code= true, $msg = '', $data = [])
...
@@ -57,15 +57,13 @@ function return_msg($code= true, $msg = '', $data = [])
if
(
$data
)
{
if
(
$data
)
{
if
(
!
is_array
(
$data
))
{
if
(
!
is_array
(
$data
))
{
$return
[
'return_data'
]
=
$data
;
$return
[
'return_data'
]
=
$data
;
}
}
else
{
if
(
is_array
(
$data
)
&&
$data
)
{
$flag
=
false
;
$flag
=
false
;
foreach
(
$data
as
$k
=>
$v
)
{
foreach
(
$data
as
$k
=>
$v
)
{
if
(
is_array
(
$v
))
{
if
(
is_array
(
$v
))
{
$flag
=
true
;
$flag
=
true
;
break
;
}
}
break
;
}
}
if
(
$flag
)
{
if
(
$flag
)
{
...
...
application/libraries/Receive/Receive.php
View file @
eae51012
...
@@ -185,15 +185,13 @@ class Receive
...
@@ -185,15 +185,13 @@ class Receive
if
(
$data
)
{
if
(
$data
)
{
if
(
!
is_array
(
$data
))
{
if
(
!
is_array
(
$data
))
{
$return
[
'return_data'
]
=
$data
;
$return
[
'return_data'
]
=
$data
;
}
}
else
{
if
(
is_array
(
$data
)
&&
$data
)
{
$flag
=
false
;
$flag
=
false
;
foreach
(
$data
as
$k
=>
$v
)
{
foreach
(
$data
as
$k
=>
$v
)
{
if
(
is_array
(
$v
))
{
if
(
is_array
(
$v
))
{
$flag
=
true
;
$flag
=
true
;
break
;
}
}
break
;
}
}
if
(
$flag
)
{
if
(
$flag
)
{
...
...
application/libraries/Receive/ReceiveGalanz.php
View file @
eae51012
...
@@ -55,6 +55,37 @@ class ReceiveGalanz extends Receive
...
@@ -55,6 +55,37 @@ class ReceiveGalanz extends Receive
$this
->
SetDefaultValues
(
$dfields
);
$this
->
SetDefaultValues
(
$dfields
);
}
}
public
function
SetSaveOrderValues
(
$order
,
$values
)
{
//处理参数
if
(
$values
[
'sitecontacttime'
]
!=
''
)
{
$order
[
'new_sitecontacttime'
]
=
$values
[
'sitecontacttime'
];
}
if
(
$values
[
'siteappointmenttime'
]
!=
''
)
{
$order
[
'new_siteappointmenttime'
]
=
$values
[
'siteappointmenttime'
];
}
if
(
$values
[
'actualvisittime'
]
!=
''
)
{
$order
[
'new_actualvisittime'
]
=
$values
[
'actualvisittime'
];
}
if
(
$values
[
'isguaranty'
]
!=
''
)
{
$order
[
'new_isguaranty'
]
=
$values
[
'isguaranty'
]
?
'True'
:
'False'
;
}
if
(
$values
[
'finishstatus'
]
!=
''
)
{
$order
[
'new_finishstatus'
]
=
$values
[
'finishstatus'
]
?
'True'
:
'False'
;
}
if
(
$values
[
'unfinishreason'
]
!=
''
)
{
$order
[
'new_unfinishreason'
]
=
$values
[
'unfinishreason'
];
}
if
(
$values
[
'sitedealremarks'
]
!=
''
)
{
$order
[
'new_sitedealremarks'
]
=
$values
[
'sitedealremarks'
];
}
if
(
$values
[
'servicePersonnel'
]
!=
''
)
{
$order
[
'new_ServicePersonnel'
]
=
$values
[
'servicePersonnel'
];
}
return
$order
;
}
/**
/**
* 拒绝订单
* 拒绝订单
*/
*/
...
@@ -91,10 +122,95 @@ class ReceiveGalanz extends Receive
...
@@ -91,10 +122,95 @@ class ReceiveGalanz extends Receive
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
}
}
//保存维修单
public
function
CheckSaveWorkOrderValues
()
public
function
CheckSaveWorkOrderValues
()
{
{
$fileds
=
[
'work_order_no'
];
$fileds
=
[
'work_order_no'
];
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
$dfields
=
[
'custname'
,
'custmobile'
,
'address'
,
'broughtdate'
,
'installdate'
,
'visittime'
,
'finishtime'
,
'repairapply'
,
'fault'
,
'parts'
,
];
$this
->
SetDefaultValues
(
$dfields
);
}
public
function
SetSaveWorkOrderValues
(
$order
,
$values
)
{
//处理基本信息参数
if
(
$values
[
'custname'
]
!=
''
)
{
$order
[
'new_custname'
]
=
$values
[
'custname'
];
}
if
(
$values
[
'custmobile'
]
!=
''
)
{
$order
[
'new_custmobile'
]
=
$values
[
'custmobile'
];
}
if
(
$values
[
'address'
]
!=
''
)
{
$order
[
'new_address'
]
=
$values
[
'address'
];
}
if
(
$values
[
'broughtdate'
]
!=
''
)
{
$order
[
'new_broughtdate'
]
=
$values
[
'broughtdate'
];
}
if
(
$values
[
'installdate'
]
!=
''
)
{
$order
[
'new_installdate'
]
=
$values
[
'installdate'
];
}
if
(
$values
[
'visittime'
]
!=
''
)
{
$order
[
'new_visittime'
]
=
$values
[
'visittime'
];
}
if
(
$values
[
'finishtime'
]
!=
''
)
{
$order
[
'new_finishtime'
]
=
$values
[
'finishtime'
];
}
if
(
$values
[
'repairapply'
]
!=
''
)
{
$order
[
'new_repairapply'
]
=
$values
[
'repairapply'
];
}
//处理故障信息参数
if
(
$values
[
'fault'
]
!=
''
)
{
$fault
=
json_decode
(
$values
[
'fault'
],
true
);
if
(
is_array
(
$fault
)
&&
$fault
&&
$order
[
'fault'
])
{
foreach
(
$order
[
'fault'
]
as
$kk
=>
$vv
)
{
if
(
$fault
[
'chk'
]
==
$vv
[
'chk'
])
{
isset
(
$fault
[
'errormoduleid'
])
&&
$vv
[
'new_errormoduleid'
]
=
$fault
[
'errormoduleid'
];
isset
(
$fault
[
'errormoduleidName'
])
&&
$vv
[
'new_errormoduleidName'
]
=
$fault
[
'errormoduleidName'
];
isset
(
$fault
[
'errorgroupid'
])
&&
$vv
[
'new_errorgroupid'
]
=
$fault
[
'errorgroupid'
];
isset
(
$fault
[
'errorgroupidName'
])
&&
$vv
[
'new_errorgroupidName'
]
=
$fault
[
'errorgroupidName'
];
isset
(
$fault
[
'errorsolutionid'
])
&&
$vv
[
'new_srv_errorsolutionid'
]
=
$fault
[
'errorsolutionid'
];
isset
(
$fault
[
'errorsolutionidName'
])
&&
$vv
[
'new_srv_errorsolutionidName'
]
=
$fault
[
'errorsolutionidName'
];
$order
[
'fault'
][
$kk
]
=
$vv
;
}
}
}
}
//处理配件信息参数
if
(
$values
[
'parts'
]
!=
''
)
{
$parts
=
json_decode
(
$values
[
'parts'
],
true
);
if
(
is_array
(
$parts
)
&&
$parts
&&
$order
[
'parts'
])
{
foreach
(
$order
[
'parts'
]
as
$kk
=>
$vv
)
{
if
(
$parts
[
'chk'
]
==
$vv
[
'chk'
])
{
isset
(
$parts
[
'errorpartsid'
])
&&
$vv
[
'new_errorpartsid'
]
=
$parts
[
'errorpartsid'
];
isset
(
$parts
[
'errorpartsidName'
])
&&
$vv
[
'new_errorpartsidName'
]
=
$parts
[
'errorpartsidName'
];
isset
(
$parts
[
'partsid'
])
&&
$vv
[
'new_partsid'
]
=
$parts
[
'partsid'
];
isset
(
$parts
[
'partsidName'
])
&&
$vv
[
'new_partsidName'
]
=
$parts
[
'partsidName'
];
isset
(
$parts
[
'qty'
])
&&
$vv
[
'new_qty'
]
=
$parts
[
'qty'
];
$order
[
'parts'
][
$kk
]
=
$vv
;
}
}
}
}
return
$order
;
}
}
public
function
CheckSendWorkOrderValues
()
public
function
CheckSendWorkOrderValues
()
...
...
application/libraries/Source/SourceGalanz.php
View file @
eae51012
...
@@ -551,7 +551,6 @@ class SourceGalanz extends Source
...
@@ -551,7 +551,6 @@ class SourceGalanz extends Source
return
$order
;
return
$order
;
}
}
private
function
UserProfileOrderMingxi
(
$html
)
private
function
UserProfileOrderMingxi
(
$html
)
{
{
$result
=
[];
$result
=
[];
...
@@ -588,18 +587,32 @@ class SourceGalanz extends Source
...
@@ -588,18 +587,32 @@ class SourceGalanz extends Source
return
$result
;
return
$result
;
}
}
/**
* 保存维修单
* @param $id
* @param $data
* @return array|mixed|string
*/
public
function
SaveWorkOrder
(
$id
,
$data
)
public
function
SaveWorkOrder
(
$id
,
$data
)
{
{
$result
=
$this
->
HandelWorkOrder
(
$id
,
$data
,
'Save'
);
$result
=
$this
->
HandelWorkOrder
(
$id
,
$data
,
'Save'
);
$this
->
WorkOrderError
(
$result
);
return
$result
;
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
}
/**
* 发送维修单
* @param $id
* @param $data
* @return array|mixed|string
*/
public
function
SendWorkOrder
(
$id
,
$data
)
public
function
SendWorkOrder
(
$id
,
$data
)
{
{
$result
=
$this
->
HandelWorkOrder
(
$id
,
$data
,
'Send'
);
$result
=
$this
->
HandelWorkOrder
(
$id
,
$data
,
'Send'
);
$this
->
WorkOrderError
(
$result
);
return
$result
;
$order
=
$this
->
WorkOrderDetail
(
$id
);
return
$order
;
}
}
/**
/**
...
...
public/captcha/galanz_c01000005.gif
View replaced file @
2c4eec27
View file @
eae51012
1.32 KB
|
W:
|
H:
1.33 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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