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
2053d6d5
Commit
2053d6d5
authored
Nov 20, 2018
by
banice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加of命令
parent
0b01c7ed
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
3 deletions
+21
-3
.idea/workspace.xml
+0
-0
application/controller/business/power/ShutdownController.php
+10
-1
application/route/Api.php
+1
-1
lib/cdz/order/state/WaitingState.php
+1
-1
src/BroadcastToAgent.php
+9
-0
No files found.
.idea/workspace.xml
View file @
2053d6d5
This diff is collapsed.
Click to expand it.
application/controller/business/power/ShutdownController.php
View file @
2053d6d5
...
@@ -10,13 +10,15 @@ namespace Application\controller\business\power;
...
@@ -10,13 +10,15 @@ namespace Application\controller\business\power;
use
Application\controller\Controller
;
use
Application\controller\Controller
;
use
Lib\Gateway
;
use
Lib\log\Log
;
class
ShutdownController
extends
Controller
class
ShutdownController
extends
Controller
{
{
protected
$parameterMap
=
[
protected
$parameterMap
=
[
'0
4
'
=>
[]
'0
F
'
=>
[]
];
];
public
function
__construct
(
string
$clientId
,
string
$message
,
string
$command
)
public
function
__construct
(
string
$clientId
,
string
$message
,
string
$command
)
...
@@ -27,6 +29,13 @@ class ShutdownController extends Controller
...
@@ -27,6 +29,13 @@ class ShutdownController extends Controller
public
function
shutdown
()
public
function
shutdown
()
{
{
if
(
isset
(
$_SESSION
[
'gateway_mac'
]))
{
try
{
Gateway
::
closeCurrentClient
();
}
catch
(
\Exception
$exception
)
{
Log
::
error
(
$exception
->
getMessage
());
}
}
}
}
...
...
application/route/Api.php
View file @
2053d6d5
...
@@ -33,7 +33,7 @@ class Api
...
@@ -33,7 +33,7 @@ class Api
$this
->
add
(
'08'
,
'business\port\OnlineController@online'
);
$this
->
add
(
'08'
,
'business\port\OnlineController@online'
);
$this
->
add
(
'09'
,
'business\port\OfflineController@offline'
);
$this
->
add
(
'09'
,
'business\port\OfflineController@offline'
);
//
$this->add('0F', 'business\power\ShutdownController@shutdown');
$this
->
add
(
'0F'
,
'business\power\ShutdownController@shutdown'
);
$this
->
add
(
'0A'
,
'setting\SettingController@get'
);
$this
->
add
(
'0A'
,
'setting\SettingController@get'
);
$this
->
add
(
'31'
,
'card\PayRuleController@get'
);
$this
->
add
(
'31'
,
'card\PayRuleController@get'
);
...
...
lib/cdz/order/state/WaitingState.php
View file @
2053d6d5
...
@@ -142,7 +142,7 @@ class WaitingState extends State
...
@@ -142,7 +142,7 @@ class WaitingState extends State
];
];
//更新订单状态
//更新订单状态
$startCapacity
=
$this
->
order
->
getStartCapacity
();
$startCapacity
=
$this
->
order
->
getStartCapacity
();
if
(
$startCapacity
!==
-
2
&&
$startCapacity
>
0
)
{
if
(
$startCapacity
!==
-
2
&&
$startCapacity
>
=
0
)
{
$update
[
'start_capacity'
]
=
(
int
)
$this
->
order
->
getStartCapacity
();
$update
[
'start_capacity'
]
=
(
int
)
$this
->
order
->
getStartCapacity
();
}
}
$orderModel
=
new
OrderModel
();
$orderModel
=
new
OrderModel
();
...
...
src/BroadcastToAgent.php
View file @
2053d6d5
...
@@ -10,6 +10,7 @@ namespace Src;
...
@@ -10,6 +10,7 @@ namespace Src;
use
Lib\Gateway
;
use
Lib\Gateway
;
use
Lib\log\Log
;
class
BroadcastToAgent
class
BroadcastToAgent
{
{
...
@@ -26,11 +27,19 @@ class BroadcastToAgent
...
@@ -26,11 +27,19 @@ class BroadcastToAgent
public
function
broadcast
(
array
$data
)
public
function
broadcast
(
array
$data
)
{
{
Log
::
debug
(
'agent_id'
.
$this
->
agentId
);
$redis
=
\Events
::
getRedis
();
$superAgentIds
=
$redis
->
hGetAll
(
'cdz:super_agent_id:hash'
);
foreach
(
$superAgentIds
as
$id
=>
$value
)
{
Gateway
::
sendToUid
(
$id
,
json_encode
(
$data
));
}
if
(
$this
->
agentId
!==
''
)
{
if
(
$this
->
agentId
!==
''
)
{
Gateway
::
sendToUid
(
$this
->
agentId
,
json_encode
(
$data
));
Gateway
::
sendToUid
(
$this
->
agentId
,
json_encode
(
$data
));
return
true
;
return
true
;
}
else
{
}
else
{
Log
::
error
(
'agent_id can not find'
);
return
false
;
return
false
;
}
}
}
}
...
...
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