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 325e8eed
authored
Nov 09, 2023
by
zhouhaibao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]费率代码提交
1 parent
b547e099
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
1 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/data/ModelSetReqData.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/controller/PileControController.java
View file @
325e8ee
...
...
@@ -8,9 +8,11 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.ServerMain;
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.ModelSetReqData
;
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.ModelSetReq
;
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
;
...
...
@@ -81,4 +83,78 @@ public class PileControController extends BaseController {
TcpRsp
tcpRsp
=
tcpRspTcpCallback
.
get
();
return
R
.
ok
().
data
(
tcpRsp
);
}
@Operation
(
summary
=
"设置费率"
,
description
=
"设置费率"
)
@GetMapping
(
"/setModel"
)
public
R
<
Boolean
>
setModel
(
String
pileId
)
{
ModelSetReq
req
=
new
ModelSetReq
();
ModelSetReqData
data
=
new
ModelSetReqData
();
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
pileId
,
data
.
getPileId
()));
byte
[]
modelcodeByte
=
new
byte
[]{(
byte
)
0x00
,
0x00
};
data
.
setModelCode
(
modelcodeByte
);
byte
[]
byteArray
=
new
byte
[]{(
byte
)
0x9C
,
0x40
,
0x00
,
0x00
};
data
.
setValleyDreRate
(
byteArray
);
data
.
setValleyEleRate
(
byteArray
);
data
.
setTopDreRate
(
byteArray
);
data
.
setTopEleRate
(
byteArray
);
data
.
setFlatDreRate
(
byteArray
);
data
.
setFlatEleRate
(
byteArray
);
data
.
setPeakDreRate
(
byteArray
);
data
.
setPeakEleRate
(
byteArray
);
data
.
setPeriodRate1
((
byte
)
0x01
);
data
.
setPeriodRate2
((
byte
)
0x01
);
data
.
setPeriodRate3
((
byte
)
0x01
);
data
.
setPeriodRate4
((
byte
)
0x01
);
data
.
setPeriodRate5
((
byte
)
0x01
);
data
.
setPeriodRate6
((
byte
)
0x01
);
data
.
setPeriodRate7
((
byte
)
0x01
);
data
.
setPeriodRate8
((
byte
)
0x01
);
data
.
setPeriodRate9
((
byte
)
0x01
);
data
.
setPeriodRate10
((
byte
)
0x01
);
data
.
setPeriodRate11
((
byte
)
0x01
);
data
.
setPeriodRate12
((
byte
)
0x01
);
data
.
setPeriodRate13
((
byte
)
0x01
);
data
.
setPeriodRate14
((
byte
)
0x01
);
data
.
setPeriodRate15
((
byte
)
0x01
);
data
.
setPeriodRate16
((
byte
)
0x01
);
data
.
setPeriodRate17
((
byte
)
0x01
);
data
.
setPeriodRate18
((
byte
)
0x01
);
data
.
setPeriodRate19
((
byte
)
0x01
);
data
.
setPeriodRate20
((
byte
)
0x01
);
data
.
setPeriodRate21
((
byte
)
0x01
);
data
.
setPeriodRate22
((
byte
)
0x01
);
data
.
setPeriodRate23
((
byte
)
0x01
);
data
.
setPeriodRate24
((
byte
)
0x01
);
data
.
setPeriodRate25
((
byte
)
0x01
);
data
.
setPeriodRate26
((
byte
)
0x01
);
data
.
setPeriodRate27
((
byte
)
0x01
);
data
.
setPeriodRate28
((
byte
)
0x01
);
data
.
setPeriodRate29
((
byte
)
0x01
);
data
.
setPeriodRate30
((
byte
)
0x01
);
data
.
setPeriodRate31
((
byte
)
0x01
);
data
.
setPeriodRate32
((
byte
)
0x01
);
data
.
setPeriodRate33
((
byte
)
0x01
);
data
.
setPeriodRate34
((
byte
)
0x01
);
data
.
setPeriodRate35
((
byte
)
0x01
);
data
.
setPeriodRate36
((
byte
)
0x01
);
data
.
setPeriodRate37
((
byte
)
0x01
);
data
.
setPeriodRate38
((
byte
)
0x01
);
data
.
setPeriodRate39
((
byte
)
0x01
);
data
.
setPeriodRate40
((
byte
)
0x01
);
data
.
setPeriodRate41
((
byte
)
0x01
);
data
.
setPeriodRate42
((
byte
)
0x01
);
data
.
setPeriodRate43
((
byte
)
0x01
);
data
.
setPeriodRate44
((
byte
)
0x01
);
data
.
setPeriodRate45
((
byte
)
0x01
);
data
.
setPeriodRate46
((
byte
)
0x01
);
data
.
setPeriodRate47
((
byte
)
0x01
);
data
.
setPeriodRate48
((
byte
)
0x01
);
req
.
setData
(
data
);
TcpCallback
<
TcpRsp
>
tcpRspTcpCallback
=
ServerMain
.
getServer
().
sendSync
(
req
);
TcpRsp
tcpRsp
=
tcpRspTcpCallback
.
get
();
return
R
.
ok
().
data
(
tcpRsp
);
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/data/ModelSetReqData.java
View file @
325e8ee
...
...
@@ -25,7 +25,7 @@ public class ModelSetReqData extends TcpData {
/**
* 计费模型编号:固定值:01 00
*/
private
byte
modelCode
;
private
byte
[]
modelCode
=
new
byte
[
2
]
;
/**
* 尖费电费费率
...
...
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