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 b6ef1d3d
authored
Nov 09, 2023
by
zhouhaibao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]代码提交
1 parent
fb5d1c53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 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/controller/PileControController.java
View file @
b6ef1d3
...
@@ -28,6 +28,7 @@ import com.glsx.plat.core.annotation.ResponseResultBody;
...
@@ -28,6 +28,7 @@ import com.glsx.plat.core.annotation.ResponseResultBody;
import
com.glsx.plat.core.web.R
;
import
com.glsx.plat.core.web.R
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
java.math.BigDecimal
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -92,8 +93,10 @@ public class PileControController extends BaseController {
...
@@ -92,8 +93,10 @@ public class PileControController extends BaseController {
ModelSetReqData
data
=
new
ModelSetReqData
();
ModelSetReqData
data
=
new
ModelSetReqData
();
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
pileId
,
data
.
getPileId
()));
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
pileId
,
data
.
getPileId
()));
byte
[]
modelcodeByte
=
new
byte
[]{(
byte
)
0x00
,
0x01
};
byte
[]
modelcodeByte
=
new
byte
[]{(
byte
)
0x00
,
0x01
};
BigDecimal
bigDecimal
=
Ocpp16Helper
.
bytesBinToBigDecimal
(
modelcodeByte
,
0
);
data
.
setModelCode
(
modelcodeByte
);
data
.
setModelCode
(
modelcodeByte
);
byte
[]
byteArray
=
new
byte
[]{(
byte
)
0x9C
,
0x40
,
0x0
0
,
0x00
};
byte
[]
byteArray
=
new
byte
[]{(
byte
)
0x9C
,
0x40
,
0x0
1
,
0x00
};
data
.
setValleyDreRate
(
byteArray
);
data
.
setValleyDreRate
(
byteArray
);
data
.
setValleyEleRate
(
byteArray
);
data
.
setValleyEleRate
(
byteArray
);
data
.
setTopDreRate
(
byteArray
);
data
.
setTopDreRate
(
byteArray
);
...
@@ -157,4 +160,14 @@ public class PileControController extends BaseController {
...
@@ -157,4 +160,14 @@ public class PileControController extends BaseController {
TcpRsp
tcpRsp
=
tcpRspTcpCallback
.
get
();
TcpRsp
tcpRsp
=
tcpRspTcpCallback
.
get
();
return
R
.
ok
().
data
(
tcpRsp
);
return
R
.
ok
().
data
(
tcpRsp
);
}
}
public
static
void
main
(
String
[]
args
)
{
byte
[]
modelcodeByte
=
new
byte
[]{(
byte
)
0x00
,
0x01
};
BigDecimal
bigDecimal
=
Ocpp16Helper
.
bytesBinToBigDecimal
(
modelcodeByte
,
0
);
System
.
out
.
println
(
bigDecimal
);
byte
[]
byteArray
=
new
byte
[]{(
byte
)
0x9C
,
0x40
,
0x01
,
0x00
};
BigDecimal
bigDecimal1
=
Ocpp16Helper
.
bytesBinToBigDecimal
(
byteArray
,
5
);
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