Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
signal
traffic-signal-platform
Commits
15230d6d
Commit
15230d6d
authored
Jun 28, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 添加本地配置文件,优化灯态数据解析
parent
4171d22c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
10 deletions
+26
-10
SignalStatusController.java
...java/net/wanji/utc/controller/SignalStatusController.java
+3
-2
WanJiCommonRunningStatusServiceImpl.java
...runninginfo/impl/WanJiCommonRunningStatusServiceImpl.java
+6
-5
SignalStatusTask.java
...ce/src/main/java/net/wanji/utc/task/SignalStatusTask.java
+1
-2
bootstrap-local.yaml
signal-utc-service/src/main/resources/bootstrap-local.yaml
+15
-0
bootstrap.yaml
signal-utc-service/src/main/resources/bootstrap.yaml
+1
-1
No files found.
signal-utc-service/src/main/java/net/wanji/utc/controller/SignalStatusController.java
View file @
15230d6d
...
@@ -58,10 +58,11 @@ public class SignalStatusController {
...
@@ -58,10 +58,11 @@ public class SignalStatusController {
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
LightsStatusVO
.
class
)
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
LightsStatusVO
.
class
)
})
})
public
JsonViewObject
lightStatus
()
throws
Exception
{
public
JsonViewObject
lightStatus
()
throws
Exception
{
List
<
LightsStatusVO
>
lightsStatusVOList
=
signalStatusService
.
lightStatus
();
// List<LightsStatusVO> lightsStatusVOList = signalStatusService.lightStatus();
List
<
LightsStatusVO
>
lightsStatusVOList1
=
signalStatusService
.
lightStatus
(
"12F7L08J8S0"
);
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
return
jsonViewObject
.
success
(
lightsStatusVOList
);
return
jsonViewObject
.
success
(
lightsStatusVOList
1
);
}
}
}
}
signal-utc-service/src/main/java/net/wanji/utc/service/runninginfo/impl/WanJiCommonRunningStatusServiceImpl.java
View file @
15230d6d
package
net
.
wanji
.
utc
.
service
.
runninginfo
.
impl
;
package
net
.
wanji
.
utc
.
service
.
runninginfo
.
impl
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.framework.rest.JsonViewObject
;
...
@@ -47,14 +49,13 @@ public class WanJiCommonRunningStatusServiceImpl implements WanJiCommonRunningSt
...
@@ -47,14 +49,13 @@ public class WanJiCommonRunningStatusServiceImpl implements WanJiCommonRunningSt
@Override
@Override
public
List
<
LightsStatusVO
>
lightsStatus
(
List
<
String
>
crossIdList
)
throws
Exception
{
public
List
<
LightsStatusVO
>
lightsStatus
(
List
<
String
>
crossIdList
)
throws
Exception
{
Set
<
String
>
set
=
new
HashSet
<>();
Set
<
String
>
set
=
new
HashSet
<>();
List
<
LightsStatusVO
>
result
=
new
ArrayList
<>();
for
(
String
crossId
:
crossIdList
)
{
for
(
String
crossId
:
crossIdList
)
{
String
manufacturerIdCode
=
crossInfoCache
.
getManufacturerCodeByCrossId
(
crossId
);
String
manufacturerIdCode
=
crossInfoCache
.
getManufacturerCodeByCrossId
(
crossId
);
set
.
add
(
manufacturerIdCode
);
set
.
add
(
manufacturerIdCode
);
}
JsonViewObject
jsonViewObject
=
utcFeignClientCache
.
getUtcFeignClientService
(
manufacturerIdCode
).
lightStatus
(
crossId
);
List
<
LightsStatusVO
>
result
=
new
ArrayList
<>();
ObjectMapper
objectMapper
=
new
ObjectMapper
();
for
(
String
manufacturerIdCode
:
set
)
{
result
=
objectMapper
.
convertValue
(
jsonViewObject
.
getContent
(),
new
TypeReference
<
List
<
LightsStatusVO
>>()
{});
JsonViewObject
jsonViewObject
=
utcFeignClientCache
.
getUtcFeignClientService
(
manufacturerIdCode
).
lightStatus
();
result
=
(
List
<
LightsStatusVO
>)
jsonViewObject
.
getContent
();
}
}
return
result
;
return
result
;
}
}
...
...
signal-utc-service/src/main/java/net/wanji/utc/task/SignalStatusTask.java
View file @
15230d6d
...
@@ -2,7 +2,6 @@ package net.wanji.utc.task;
...
@@ -2,7 +2,6 @@ package net.wanji.utc.task;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.framework.rest.JsonViewObject
;
...
@@ -86,7 +85,7 @@ public class SignalStatusTask {
...
@@ -86,7 +85,7 @@ public class SignalStatusTask {
}
else
{
}
else
{
JsonViewObject
jsonViewObject
=
utcDTFeignClients
.
lightStatus
(
crossId
);
JsonViewObject
jsonViewObject
=
utcDTFeignClients
.
lightStatus
(
crossId
);
ObjectMapper
mapper
=
new
ObjectMapper
();
ObjectMapper
mapper
=
new
ObjectMapper
();
lightsStatusVOS
=
mapper
.
convertValue
(
jsonViewObject
.
getContent
(),
new
TypeReference
<
List
<
LightsStatusVO
>>()
{});
//
lightsStatusVOS = mapper.convertValue(jsonViewObject.getContent(), new TypeReference<List<LightsStatusVO>>() {});
}
}
long
end
=
System
.
currentTimeMillis
();
long
end
=
System
.
currentTimeMillis
();
log
.
info
(
"当前路口编号:{},海康返回灯态时间:{}ms"
,
crossId
,
(
end
-
start
));
log
.
info
(
"当前路口编号:{},海康返回灯态时间:{}ms"
,
crossId
,
(
end
-
start
));
...
...
signal-utc-service/src/main/resources/bootstrap-local.yaml
0 → 100644
View file @
15230d6d
spring
:
application
:
# dubbo启动需要程序名称
name
:
utc
main
:
allow-circular-references
:
true
cloud
:
nacos
:
config
:
server-addr
:
10.102.1.182:8848
file-extension
:
yaml
group
:
signal
namespace
:
signal
username
:
nacos
password
:
nacos
\ No newline at end of file
signal-utc-service/src/main/resources/bootstrap.yaml
View file @
15230d6d
spring
:
spring
:
profiles
:
profiles
:
active
:
dev
active
:
local
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment