Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-charging-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b547e099
authored
Nov 09, 2023
by
叶立庆
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
http://192.168.3.233:8090/platform/platform-charging-server
2 parents
89107f5c
3cdc6831
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
platform-charging/src/main/java/cn/com/glsx/charging/modules/controller/PileControController.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/server/ProxyHelper.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/controller/PileControController.java
View file @
b547e09
...
...
@@ -9,8 +9,10 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpCallback;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.client.TcpClient
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.ShutdownMachineReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.StartMachineReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.TransactionRecordsReqData
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.ShutdownMachineReq
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.StartMachineReq
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.TransactionRecordsReq
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.server.TcpServer
;
import
cn.com.glsx.charging.modules.model.UserBO
;
...
...
@@ -49,16 +51,18 @@ public class PileControController extends BaseController {
@Operation
(
summary
=
"开启充电桩"
,
description
=
"开启充电桩"
)
@GetMapping
(
"/start"
)
public
R
<
Boolean
>
start
(
String
pileId
)
{
TransactionRecordsReq
req
=
new
TransactionRecordsReq
();
TransactionRecordsReqData
data
=
new
TransactionRecordsReqData
();
data
.
setTransactionSerialNumber
(
Ocpp16Helper
.
strToBcd
(
"55031412782305012018061910262392"
,
data
.
getTransactionSerialNumber
()));
data
.
setGunNumber
((
byte
)
1
);
StartMachineReq
req
=
new
StartMachineReq
();
StartMachineReqData
data
=
new
StartMachineReqData
();
data
.
setTransactionSerialNumber
(
Ocpp16Helper
.
strToBcd
(
"32010200000000111511161555350261"
,
data
.
getTransactionSerialNumber
()));
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
pileId
,
data
.
getPileId
()));
data
.
setTopUnitPrice
(
Ocpp16Helper
.
strToBcd
(
"D0FB0100"
,
data
.
getTopUnitPrice
()));
data
.
setVehicleIdentifier
(
Ocpp16Helper
.
strToBcd
(
"0000000000000000000000000000000001"
,
data
.
getVehicleIdentifier
()));
data
.
setGunNumber
((
byte
)
1
);
data
.
setLogicalCardNumber
(
Ocpp16Helper
.
strToBcd
(
"0000001000000573"
,
data
.
getLogicalCardNumber
()));
byte
[]
bytes
=
Ocpp16Helper
.
binToBytes
(
Ocpp16Helper
.
hexToBinStr
(
"00000000D14B0A54"
));
data
.
setPhysicalCardNumber
(
bytes
);
byte
[]
accountBytes
=
Ocpp16Helper
.
binToBytes
(
Ocpp16Helper
.
hexToBinStr
(
"A0860100"
));
data
.
setAccountBalance
(
accountBytes
);
req
.
setData
(
data
);
TcpCallback
<
TcpRsp
>
tcpRspTcpCallback
=
ServerMain
.
getServer
().
sendSync
(
req
);
TcpRsp
tcpRsp
=
tcpRspTcpCallback
.
get
();
...
...
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/server/ProxyHelper.java
View file @
b547e09
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
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 post a comment