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
Expand all
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
...
@@ -213,8 +213,6 @@ 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
);
//保存订单
$result
=
$sourceGalanzObj
->
CreateWorkOrder
(
$order
[
'new_id'
],
$order
);
$result
=
$sourceGalanzObj
->
CreateWorkOrder
(
$order
[
'new_id'
],
$order
);
if
(
$result
)
{
if
(
$result
)
{
...
@@ -240,8 +238,6 @@ class Galanz extends BaseController
...
@@ -240,8 +238,6 @@ 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
);
//保存订单
$result
=
$sourceGalanzObj
->
CreateUserProfileOrder
(
$order
[
'new_id'
],
$order
);
$result
=
$sourceGalanzObj
->
CreateUserProfileOrder
(
$order
[
'new_id'
],
$order
);
if
(
$result
)
{
if
(
$result
)
{
...
@@ -252,6 +248,7 @@ class Galanz extends BaseController
...
@@ -252,6 +248,7 @@ class Galanz extends BaseController
}
}
}
}
//保存安装单
public
function
saveUserProfileOrder
()
public
function
saveUserProfileOrder
()
{
{
$param
=
$this
->
input
->
post
();
$param
=
$this
->
input
->
post
();
...
@@ -265,13 +262,13 @@ class Galanz extends BaseController
...
@@ -265,13 +262,13 @@ class Galanz extends BaseController
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$sourceGalanzObj
->
UserProfileOrderDetail
(
$values
[
'id'
]);
$order
=
$sourceGalanzObj
->
UserProfileOrderDetail
(
$values
[
'id'
]);
$order
=
$obj
->
SetSaveUserProfileOrderValues
(
$order
,
$values
);
//保存订单
$result
=
$sourceGalanzObj
->
SaveUserProfileOrder
(
$order
[
'new_id'
],
$order
);
$result
=
$sourceGalanzObj
->
SaveUserProfileOrder
(
$order
[
'new_id'
],
$order
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
}
//发送安装单
public
function
sendUserProfileOrder
()
public
function
sendUserProfileOrder
()
{
{
$param
=
$this
->
input
->
post
();
$param
=
$this
->
input
->
post
();
...
@@ -285,8 +282,6 @@ class Galanz extends BaseController
...
@@ -285,8 +282,6 @@ class Galanz extends BaseController
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$sourceGalanzObj
->
UserProfileOrderDetail
(
$values
[
'id'
]);
$order
=
$sourceGalanzObj
->
UserProfileOrderDetail
(
$values
[
'id'
]);
//发送订单
$result
=
$sourceGalanzObj
->
SendUserProfileOrder
(
$order
[
'new_id'
],
$order
);
$result
=
$sourceGalanzObj
->
SendUserProfileOrder
(
$order
[
'new_id'
],
$order
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
...
...
application/controllers/test/Rgalanz.php
View file @
04da49e2
...
@@ -30,7 +30,10 @@ class Rgalanz extends BaseController
...
@@ -30,7 +30,10 @@ class Rgalanz extends BaseController
// self::$testu = 'K75516022';
// self::$testu = 'K75516022';
// self::$testp = '123456';
// self::$testp = '123456';
self
::
$testu
=
'W75509345'
;
// self::$testu = 'W75509345';
// self::$testp = 'dgqh!769';
self
::
$testu
=
'C75500035'
;
self
::
$testp
=
'dgqh!769'
;
self
::
$testp
=
'dgqh!769'
;
// self::$testu = 'c01000005';
// self::$testu = 'c01000005';
...
@@ -69,7 +72,7 @@ class Rgalanz extends BaseController
...
@@ -69,7 +72,7 @@ class Rgalanz extends BaseController
$data
[
'appid'
]
=
'10001'
;
$data
[
'appid'
]
=
'10001'
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'mobile'
]
=
'13
717705860
'
;
$data
[
'mobile'
]
=
'13
925524202
'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetValues
(
$data
);
...
@@ -92,7 +95,7 @@ class Rgalanz extends BaseController
...
@@ -92,7 +95,7 @@ class Rgalanz extends BaseController
$data
[
'appid'
]
=
'10001'
;
$data
[
'appid'
]
=
'10001'
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'out_trade_no'
]
=
'CALL201
5111004668
'
;
$data
[
'out_trade_no'
]
=
'CALL201
6091301455
'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetValues
(
$data
);
...
@@ -137,7 +140,7 @@ class Rgalanz extends BaseController
...
@@ -137,7 +140,7 @@ class Rgalanz extends BaseController
$data
[
'appid'
]
=
'10001'
;
$data
[
'appid'
]
=
'10001'
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'id'
]
=
'
b1c8bece-378a-4b53-946b-61abd1b7c097
'
;
$data
[
'id'
]
=
'
05a20b81-0a7d-4c3c-a478-c0a456ce309c
'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetValues
(
$data
);
...
@@ -175,6 +178,28 @@ class Rgalanz extends BaseController
...
@@ -175,6 +178,28 @@ class Rgalanz extends BaseController
$this
->
show
(
$result
);
$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
()
public
function
saveOrder
()
{
{
$obj
=
$this
->
galanzObj
();
$obj
=
$this
->
galanzObj
();
...
@@ -527,6 +552,44 @@ class Rgalanz extends BaseController
...
@@ -527,6 +552,44 @@ class Rgalanz extends BaseController
$this
->
show
(
$result
[
'data'
]);
$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
)
private
function
show
(
$data
)
{
{
echo
"<pre>"
;
echo
"<pre>"
;
...
...
application/libraries/Receive/ReceiveGalanz.php
View file @
04da49e2
...
@@ -52,15 +52,15 @@ class ReceiveGalanz extends Receive
...
@@ -52,15 +52,15 @@ class ReceiveGalanz extends Receive
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
$dfields
=
[
$dfields
=
[
'sitecontacttime'
,
'sitecontacttime'
,
//联络时间
'siteappointmenttime'
,
'siteappointmenttime'
,
//预约时间
'actualvisittime'
,
'actualvisittime'
,
//上门时间
'isguaranty'
,
'isguaranty'
,
//是否保内
'finishstatus'
,
'finishstatus'
,
//完成状态
'unfinishreason'
,
'unfinishreason'
,
//未完成原因
'complete_reason'
,
'complete_reason'
,
//完成方式
'sitedealremarks'
,
'sitedealremarks'
,
//备注
'servicePersonnel'
,
'servicePersonnel'
,
//服务人员
];
];
$this
->
SetDefaultValues
(
$dfields
);
$this
->
SetDefaultValues
(
$dfields
);
}
}
...
@@ -84,16 +84,16 @@ class ReceiveGalanz extends Receive
...
@@ -84,16 +84,16 @@ class ReceiveGalanz extends Receive
$order
[
'new_finishstatus'
]
=
$values
[
'finishstatus'
]
?
'True'
:
'False'
;
$order
[
'new_finishstatus'
]
=
$values
[
'finishstatus'
]
?
'True'
:
'False'
;
}
}
if
(
$values
[
'unfinishreason'
])
{
if
(
$values
[
'unfinishreason'
])
{
$order
[
'new_unfinishreason'
]
=
$values
[
'unfinishreason'
]
;
$order
[
'new_unfinishreason'
]
=
trim
(
$values
[
'unfinishreason'
])
;
}
}
if
(
$values
[
'complete_reason'
])
{
if
(
$values
[
'complete_reason'
])
{
$order
[
'new_complete_reason'
]
=
$values
[
'complete_reason'
]
;
$order
[
'new_complete_reason'
]
=
trim
(
$values
[
'complete_reason'
])
;
}
}
if
(
$values
[
'sitedealremarks'
])
{
if
(
$values
[
'sitedealremarks'
])
{
$order
[
'new_sitedealremarks'
]
=
$values
[
'sitedealremarks'
]
;
$order
[
'new_sitedealremarks'
]
=
trim
(
$values
[
'sitedealremarks'
])
;
}
}
if
(
$values
[
'servicePersonnel'
])
{
if
(
$values
[
'servicePersonnel'
])
{
$order
[
'new_ServicePersonnel'
]
=
$values
[
'servicePersonnel'
]
;
$order
[
'new_ServicePersonnel'
]
=
trim
(
$values
[
'servicePersonnel'
])
;
}
}
return
$order
;
return
$order
;
...
@@ -143,19 +143,19 @@ class ReceiveGalanz extends Receive
...
@@ -143,19 +143,19 @@ class ReceiveGalanz extends Receive
$this
->
CheckValues
(
$fileds
);
$this
->
CheckValues
(
$fileds
);
$dfields
=
[
$dfields
=
[
'custname'
,
'custname'
,
//姓名
'custmobile'
,
'custmobile'
,
//手机
'address'
,
'address'
,
//地址
'shipdate'
,
'shipdate'
,
//生产日期
'broughtdate'
,
'broughtdate'
,
//购买日期
'installdate'
,
'installdate'
,
//安装日期
'visittime'
,
'visittime'
,
//预约上门时间
'actualvisittime'
,
'actualvisittime'
,
//实际上门时间
'finishtime'
,
'finishtime'
,
//完成时间
'repairapply'
,
'repairapply'
,
//维修人员
'machine'
,
'machine'
,
//机器信息
'fault'
,
'fault'
,
//故障信息
'parts'
,
'parts'
,
//换件信息
];
];
$this
->
SetDefaultValues
(
$dfields
);
$this
->
SetDefaultValues
(
$dfields
);
}
}
...
@@ -164,13 +164,13 @@ class ReceiveGalanz extends Receive
...
@@ -164,13 +164,13 @@ class ReceiveGalanz extends Receive
{
{
//处理基本信息参数
//处理基本信息参数
if
(
$values
[
'custname'
])
{
if
(
$values
[
'custname'
])
{
$order
[
'new_custname'
]
=
$values
[
'custname'
]
;
$order
[
'new_custname'
]
=
trim
(
$values
[
'custname'
])
;
}
}
if
(
$values
[
'custmobile'
])
{
if
(
$values
[
'custmobile'
])
{
$order
[
'new_custmobile'
]
=
$values
[
'custmobile'
]
;
$order
[
'new_custmobile'
]
=
trim
(
$values
[
'custmobile'
])
;
}
}
if
(
$values
[
'address'
])
{
if
(
$values
[
'address'
])
{
$order
[
'new_address'
]
=
$values
[
'address'
]
;
$order
[
'new_address'
]
=
trim
(
$values
[
'address'
])
;
}
}
if
(
$values
[
'shipdate'
])
{
if
(
$values
[
'shipdate'
])
{
$order
[
'new_shipdate'
]
=
date
(
'Y/m/d'
,
$values
[
'shipdate'
]);
$order
[
'new_shipdate'
]
=
date
(
'Y/m/d'
,
$values
[
'shipdate'
]);
...
@@ -268,6 +268,73 @@ class ReceiveGalanz extends Receive
...
@@ -268,6 +268,73 @@ class ReceiveGalanz extends Receive
{
{
$fileds
=
[
'id'
];
$fileds
=
[
'id'
];
$this
->
CheckValues
(
$fileds
);
$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
()
public
function
CheckSendUserProfileOrderValues
()
...
@@ -444,13 +511,13 @@ class ReceiveGalanz extends Receive
...
@@ -444,13 +511,13 @@ class ReceiveGalanz extends Receive
if
(
!
array_key_exists
(
'account'
,
$this
->
values
)
||
$this
->
values
[
'account'
]
==
''
)
{
if
(
!
array_key_exists
(
'account'
,
$this
->
values
)
||
$this
->
values
[
'account'
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"account参数错误!"
);
$this
->
ReturnMessage
(
false
,
"account参数错误!"
);
}
else
{
}
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'
]
==
''
)
{
if
(
!
array_key_exists
(
'pwd'
,
$this
->
values
)
||
$this
->
values
[
'pwd'
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"pwd参数错误!"
);
$this
->
ReturnMessage
(
false
,
"pwd参数错误!"
);
}
else
{
}
else
{
$this
->
values
[
'pwd'
]
=
urldecode
(
$this
->
values
[
'pwd'
]
);
$this
->
values
[
'pwd'
]
=
trim
(
urldecode
(
$this
->
values
[
'pwd'
])
);
}
}
if
(
$fields
)
{
if
(
$fields
)
{
...
@@ -458,7 +525,7 @@ class ReceiveGalanz extends Receive
...
@@ -458,7 +525,7 @@ class ReceiveGalanz extends Receive
if
(
!
array_key_exists
(
$v
,
$this
->
values
)
||
$this
->
values
[
$v
]
==
''
)
{
if
(
!
array_key_exists
(
$v
,
$this
->
values
)
||
$this
->
values
[
$v
]
==
''
)
{
$this
->
ReturnMessage
(
false
,
"
{
$v
}
参数错误!"
);
$this
->
ReturnMessage
(
false
,
"
{
$v
}
参数错误!"
);
}
else
{
}
else
{
$this
->
values
[
$v
]
=
urldecode
(
$this
->
values
[
$v
]
);
$this
->
values
[
$v
]
=
trim
(
urldecode
(
$this
->
values
[
$v
])
);
}
}
}
}
}
}
...
...
application/libraries/Source/SourceGalanz.php
View file @
04da49e2
This diff is collapsed.
Click to expand it.
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