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 3b21ee30
authored
Nov 20, 2023
by
zhouhaibao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]代码提交
1 parent
0a7649f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
platform-charging/src/main/java/cn/com/glsx/charging/modules/controller/PileControController.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/controller/PileControController.java
View file @
3b21ee3
...
@@ -96,13 +96,13 @@ public class PileControController extends BaseController {
...
@@ -96,13 +96,13 @@ public class PileControController extends BaseController {
@Operation
(
summary
=
"设置费率"
,
description
=
"设置费率"
)
@Operation
(
summary
=
"设置费率"
,
description
=
"设置费率"
)
@GetMapping
(
"/setModel"
)
@GetMapping
(
"/setModel"
)
public
R
<
Boolean
>
setModel
(
String
pileId
,
String
modelcode
)
{
public
R
<
Boolean
>
setModel
(
String
pileId
,
String
modelcode
,
String
v1
,
String
v2
)
{
ModelSetReq
req
=
new
ModelSetReq
();
ModelSetReq
req
=
new
ModelSetReq
();
ModelSetReqData
data
=
new
ModelSetReqData
();
ModelSetReqData
data
=
new
ModelSetReqData
();
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
pileId
,
data
.
getPileId
()));
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
pileId
,
data
.
getPileId
()));
data
.
setModelCode
(
Ocpp16Helper
.
strToBcd
(
modelcode
,
data
.
getModelCode
()));
data
.
setModelCode
(
Ocpp16Helper
.
strToBcd
(
modelcode
,
data
.
getModelCode
()));
byte
[]
byteArray1
=
new
byte
[]{(
byte
)
0x9C
,
0x40
,
0x00
,
0x00
}
;
byte
[]
byteArray1
=
Ocpp16Helper
.
bigDecimalToByteArray
(
new
BigDecimal
(
v1
),
4
)
;
byte
[]
byteArray
=
new
byte
[]{(
byte
)
0x9C
,
0x40
,
0x01
,
0x00
}
;
byte
[]
byteArray
=
Ocpp16Helper
.
bigDecimalToByteArray
(
new
BigDecimal
(
v2
),
4
)
;
data
.
setValleyDreRate
(
byteArray1
);
data
.
setValleyDreRate
(
byteArray1
);
data
.
setValleyEleRate
(
byteArray1
);
data
.
setValleyEleRate
(
byteArray1
);
data
.
setTopDreRate
(
byteArray
);
data
.
setTopDreRate
(
byteArray
);
...
@@ -169,7 +169,12 @@ public class PileControController extends BaseController {
...
@@ -169,7 +169,12 @@ public class PileControController extends BaseController {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
byte
[]
byteArray1
=
new
byte
[]{(
byte
)
0x9C
,
0x40
,
0x00
,
0x00
};
byte
[]
byteArray1
=
new
byte
[]{(
byte
)
0x9C
,
0x40
,
0x00
,
0x00
};
BigDecimal
bigDecimal1
=
Ocpp16Helper
.
bytesBinToBigDecimal
(
byteArray1
,
5
);
BigDecimal
bigDecimal2
=
Ocpp16Helper
.
bytesBinToBigDecimal
(
byteArray1
,
5
);
System
.
out
.
println
(
bigDecimal2
);
System
.
out
.
println
(
new
BigDecimal
(
"0.16540"
));
byte
[]
bytes
=
Ocpp16Helper
.
bigDecimalToByteArray
(
new
BigDecimal
(
"0.16540"
),
4
);
BigDecimal
bigDecimal1
=
Ocpp16Helper
.
bytesBinToBigDecimal
(
bytes
,
5
);
System
.
out
.
println
(
bigDecimal1
);
System
.
out
.
println
(
bigDecimal1
);
}
}
...
...
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