Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cdz_gateway_v2
Overview
Overview
Details
Activity
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨苏杭
cdz_gateway_v2
Commits
0b69f017
Commit
0b69f017
authored
Jan 08, 2019
by
杨苏杭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
card mac 修改为5字节
parent
00730ff9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
16 deletions
+29
-16
.idea/workspace.xml
+0
-0
application/Events.php
+1
-0
application/controller/business/charger/OverController.php
+8
-6
application/controller/business/power/PowerController.php
+1
-1
application/controller/card/BalanceController.php
+9
-3
application/controller/card/charger/RequestController.php
+5
-3
lib/Gateway.php
+1
-1
lib/remote/api/message/StartMessage.php
+4
-2
No files found.
.idea/workspace.xml
View file @
0b69f017
This diff is collapsed.
Click to expand it.
application/Events.php
View file @
0b69f017
...
...
@@ -64,6 +64,7 @@ class Events
static
::
$redis
->
select
(
'4'
);
\Lib\log\Log
::
bootLog
();
...
...
application/controller/business/charger/OverController.php
View file @
0b69f017
...
...
@@ -108,27 +108,27 @@ class OverController extends Controller
break
;
case
StateCode
::
FINISH_USER
:
//用户主动结束
$this
->
logRecord
->
setDesc
(
'用户主动结束充电
'
);
$this
->
logRecord
->
setDesc
(
'用户主动结束充电
->'
.
$state
);
$orderState
->
toUserFinish
();
break
;
case
StateCode
::
FINISH_SHED_TIMEOUT
:
//端口脱落超时
$this
->
logRecord
->
setDesc
(
'端口脱落超时结束
'
);
$this
->
logRecord
->
setDesc
(
'端口脱落超时结束
->'
.
$state
);
$orderState
->
toShedTimeoutState
();
break
;
case
StateCode
::
FINISH_REFUND
:
//充电失败退款
$this
->
logRecord
->
setDesc
(
'充电失败退款结束
'
);
$this
->
logRecord
->
setDesc
(
'充电失败退款结束
->'
.
$state
);
$orderState
->
toRefundFinish
();
break
;
case
StateCode
::
FINISH_EXCEED
:
//功率超限
$this
->
logRecord
->
setDesc
(
'功率超限充电结束
'
);
$this
->
logRecord
->
setDesc
(
'功率超限充电结束
->'
.
$state
);
$orderState
->
toPowerExceedState
();
break
;
case
StateCode
::
FINISH_FULL
:
//充满自停
$this
->
logRecord
->
setDesc
(
'充满自停结束
'
);
$this
->
logRecord
->
setDesc
(
'充满自停结束
->'
.
$state
);
$orderState
->
toPowerFullState
();
break
;
case
StateCode
::
FINISH_TIME_END
:
//充电时间结束
$this
->
logRecord
->
setDesc
(
'充电时间完结束
'
);
$this
->
logRecord
->
setDesc
(
'充电时间完结束
->'
.
$state
);
$orderState
->
toTimeoutState
();
break
;
...
...
@@ -164,6 +164,8 @@ class OverController extends Controller
}
}
else
{
Log
::
error
(
'redis can not find'
);
$this
->
logRecord
->
setException
(
0
);
$this
->
logRecord
->
setDesc
(
'redis副本订单状态异常,非可结束订单状态'
);
...
...
application/controller/business/power/PowerController.php
View file @
0b69f017
...
...
@@ -176,7 +176,7 @@ class PowerController extends Controller
if
(
$i
===
(
$count
-
1
))
{
$orderModel
=
new
OrderModel
();
$capacity
=
hexdec
(
$capacitys
[
$i
]);
$orderModel
->
update
([
'start_capacity'
=>
hexdec
(
$capacitys
[
0
])],
'id ='
.
$orderId
.
'and start_capacity = -1'
);
$orderModel
->
update
([
'start_capacity'
=>
hexdec
(
$capacitys
[
0
])],
'id ='
.
$orderId
.
'
and start_capacity = -1'
);
$orderModel
->
update
([
'end_capacity'
=>
$capacity
,
],
'id = '
.
$orderId
);
...
...
application/controller/card/BalanceController.php
View file @
0b69f017
...
...
@@ -12,6 +12,7 @@ namespace Application\controller\card;
use
Application\controller\Controller
;
use
Application\model\CardModel
;
use
Application\model\UserModel
;
use
Lib\log\Log
;
class
BalanceController
extends
Controller
{
...
...
@@ -19,7 +20,7 @@ class BalanceController extends Controller
'32'
=>
[
'card_id'
=>
4
'card_id'
=>
5
,
]
];
...
...
@@ -33,11 +34,16 @@ class BalanceController extends Controller
$cardModel
=
new
CardModel
();
$userId
=
$cardModel
->
getColumn
(
'user_id'
,
'card_number = '
.
$cardId
);
Log
::
debug
(
$cardId
);
$userId
=
$cardModel
->
getColumn
(
'user_id'
,
'mac = '
.
"'
$cardId
'"
);
Log
::
debug
(
$userId
);
if
(
isset
(
$userId
))
{
$userModel
=
new
UserModel
();
$balance
=
$userModel
->
getColumn
(
'balance'
,
'id = '
.
$userId
);
$balance
=
$userModel
->
getColumn
(
'
wallet_
balance'
,
'id = '
.
$userId
);
}
$balance
=
isset
(
$balance
)
?
$balance
:
0
;
...
...
application/controller/card/charger/RequestController.php
View file @
0b69f017
...
...
@@ -25,7 +25,7 @@ class RequestController extends Controller
'33'
=>
[
'type'
=>
1
,
'logic_id'
=>
1
,
'card_id'
=>
4
,
'card_id'
=>
5
,
'time'
=>
2
,
'price'
=>
2
,
],
...
...
@@ -62,11 +62,13 @@ class RequestController extends Controller
$cardModel
=
new
CardModel
();
$userId
=
$cardModel
->
getColumn
(
'user_id'
,
'card_number = '
.
$cardId
);
$userId
=
$cardModel
->
getColumn
(
'user_id'
,
'mac = '
.
"'
$cardId
'"
);
Log
::
debug
(
$userId
);
if
(
isset
(
$userId
))
{
$userModel
=
new
UserModel
();
$balance
=
$userModel
->
getColumn
(
'balance'
,
'id = '
.
$userId
);
$balance
=
$userModel
->
getColumn
(
'
wallet_
balance'
,
'id = '
.
$userId
);
}
$balance
=
isset
(
$balance
)
?
$balance
:
0
;
if
((
int
)
$balance
<
(
int
)
$price
)
{
...
...
lib/Gateway.php
View file @
0b69f017
...
...
@@ -35,7 +35,7 @@ class Gateway
*
* @var string
*/
public
static
$registerAddress
=
'
webapppush.default
:1239'
;
public
static
$registerAddress
=
'
100.124.0.5
:1239'
;
//public static $registerAddress = '127.0.0.1:1236';
...
...
lib/remote/api/message/StartMessage.php
View file @
0b69f017
...
...
@@ -16,7 +16,7 @@ class StartMessage extends Message
/**
* @var string
*/
private
$first
=
'
充电已经开始,请注意接收消息
'
;
private
$first
=
'
您的爱车已开始充电,预计在%s结束喔
'
;
/**
* @var string
...
...
@@ -38,6 +38,8 @@ class StartMessage extends Message
*/
private
$remark
=
'感谢您的使用'
;
private
$purchaseTime
=
0
;
/**
* StartMessage constructor.
*/
...
...
@@ -74,7 +76,7 @@ class StartMessage extends Message
'color'
=>
'#333'
,
],
'keyword3'
=>
[
'value'
=>
number_format
(
$this
->
amount
/
100
,
2
),
'value'
=>
'¥'
.
number_format
(
$this
->
amount
/
100
,
2
),
'color'
=>
'#333'
,
],
'remark'
=>
[
...
...
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