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 c2f37e6a
authored
Nov 14, 2023
by
chenxi
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
实现功能:修改读取实时监测数据接口,增加异常打印
1 parent
3931d931
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
platform-charging/src/main/java/cn/com/glsx/charging/modules/controller/GetDataController.java
platform-charging/src/main/java/cn/com/glsx/charging/util/ByteUtils.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/controller/GetDataController.java
View file @
c2f37e6
...
@@ -38,14 +38,14 @@ public class GetDataController extends BaseController {
...
@@ -38,14 +38,14 @@ public class GetDataController extends BaseController {
RealTimeReq
req
=
new
RealTimeReq
();
RealTimeReq
req
=
new
RealTimeReq
();
RealTimeDataReqData
data
=
new
RealTimeDataReqData
();
RealTimeDataReqData
data
=
new
RealTimeDataReqData
();
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
pileId
,
data
.
getPileId
()));
data
.
setPileId
(
Ocpp16Helper
.
strToBcd
(
pileId
,
data
.
getPileId
()));
data
.
setGunNumber
(
Ocpp16Helper
.
strToBcd
(
gunNumber
,
new
byte
[
1
])[
0
]
);
data
.
setGunNumber
(
(
byte
)
1
);
TcpCallback
<
TcpRsp
>
tcpRspTcpCallback
=
ServerMain
.
getServer
().
sendSync
(
req
);
TcpCallback
<
TcpRsp
>
tcpRspTcpCallback
=
ServerMain
.
getServer
().
sendSync
(
req
);
TcpRsp
tcpRsp
=
tcpRspTcpCallback
.
get
();
TcpRsp
tcpRsp
=
tcpRspTcpCallback
.
get
();
return
R
.
ok
().
data
(
tcpRsp
);
return
R
.
ok
().
data
(
tcpRsp
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"读取实时监测数据error:{}"
,
e
.
getMessage
());
log
.
error
(
"读取实时监测数据error:{}"
,
e
,
e
.
getMessage
());
return
R
.
error
();
}
}
return
R
.
ok
();
}
}
}
}
platform-charging/src/main/java/cn/com/glsx/charging/util/ByteUtils.java
View file @
c2f37e6
...
@@ -212,7 +212,8 @@ public class ByteUtils {
...
@@ -212,7 +212,8 @@ public class ByteUtils {
* @date 2018年1月17日 上午9:36:49
* @date 2018年1月17日 上午9:36:49
* @since 1.0.0
* @since 1.0.0
*/
*/
public
static
byte
getByte
(
byte
[]
buff
,
int
offset
)
{
public
static
byte
getByte
(
byte
[]
buff
,
int
offset
)
{
return
buff
[
offset
];
return
buff
[
offset
];
}
}
...
...
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