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
841c0ee0
Commit
841c0ee0
authored
Mar 05, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 易华录灯态优化
parent
7716be7f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
202 deletions
+46
-202
SignalStatusController.java
.../wanji/utc/hisense/controller/SignalStatusController.java
+9
-6
EhualuLightStatusPojo.java
...wanji/utc/hisense/pojo/convert/EhualuLightStatusPojo.java
+0
-99
LightStatusPojo.java
...a/net/wanji/utc/hisense/pojo/convert/LightStatusPojo.java
+1
-1
SignalStatusService.java
...va/net/wanji/utc/hisense/service/SignalStatusService.java
+3
-4
SignalStatusServiceImpl.java
...nji/utc/hisense/service/impl/SignalStatusServiceImpl.java
+29
-91
SignalStatusTask.java
...ce/src/main/java/net/wanji/utc/task/SignalStatusTask.java
+4
-1
No files found.
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/controller/SignalStatusController.java
View file @
841c0ee0
...
...
@@ -5,7 +5,8 @@ package net.wanji.utc.hisense.controller;
* @date 2022/12/1 15:07
*/
import
com.fasterxml.jackson.databind.JsonMappingException
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
...
...
@@ -15,10 +16,10 @@ import lombok.extern.slf4j.Slf4j;
import
net.wanji.common.annotation.aspect.AspectLog
;
import
net.wanji.common.enums.BaseEnum
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.utils.tool.JacksonUtils
;
import
net.wanji.databus.po.SignalStatusLogPO
;
import
net.wanji.databus.vo.LightsStatusVO
;
import
net.wanji.utc.hisense.pojo.convert.EhualuLightStatusPojo
;
import
net.wanji.utc.hisense.pojo.convert.HisenseLightStatusPojo
;
import
net.wanji.utc.hisense.pojo.convert.LightStatusPojo
;
import
net.wanji.utc.hisense.service.SignalStatusService
;
import
org.dom4j.DocumentException
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -76,10 +77,10 @@ public class SignalStatusController {
@AspectLog
(
description
=
"接收海信灯态"
,
operationType
=
BaseEnum
.
OperationTypeEnum
.
QUERY
)
@PostMapping
(
value
=
"/receiveLightStatus"
,
produces
=
MediaType
.
APPLICATION_JSON
)
@ApiOperation
(
value
=
"接收海信灯态"
,
notes
=
"接收海信灯态"
,
response
=
LightsStatusVO
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
)
public
JsonViewObject
receiveLightStatus
(
@RequestBody
List
<
HisenseLightStatusPojo
>
hisenseL
ightStatusPojos
)
throws
Exception
{
public
JsonViewObject
receiveLightStatus
(
@RequestBody
List
<
LightStatusPojo
>
l
ightStatusPojos
)
throws
Exception
{
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
try
{
signalStatusService
.
receiveLightStatus
(
hisenseL
ightStatusPojos
);
signalStatusService
.
receiveLightStatus
(
l
ightStatusPojos
);
}
catch
(
Exception
e
)
{
log
.
error
(
"海信接收灯态异常:{}"
,
e
);
}
...
...
@@ -89,9 +90,11 @@ public class SignalStatusController {
@AspectLog
(
description
=
"接收易华录灯态"
,
operationType
=
BaseEnum
.
OperationTypeEnum
.
QUERY
)
@PostMapping
(
value
=
"/receiveEhualu"
,
produces
=
MediaType
.
APPLICATION_JSON
)
@ApiOperation
(
value
=
"接收海信灯态"
,
notes
=
"接收海信灯态"
,
response
=
LightsStatusVO
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
)
public
JsonViewObject
receiveLightStatusEhualu
(
@RequestBody
List
<
EhualuLightStatusPojo
>
ehualuLightStatusPojos
)
throws
Exception
{
public
JsonViewObject
receiveLightStatusEhualu
(
@RequestBody
String
data
)
throws
Exception
{
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
ObjectMapper
jackson
=
JacksonUtils
.
getInstance
();
try
{
List
<
LightStatusPojo
>
ehualuLightStatusPojos
=
jackson
.
readValue
(
data
,
new
TypeReference
<
List
<
LightStatusPojo
>>()
{});
signalStatusService
.
receiveLightStatusEhualu
(
ehualuLightStatusPojos
);
}
catch
(
Exception
e
)
{
log
.
error
(
"易华录接收灯态异常:{}"
,
e
);
...
...
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/pojo/convert/EhualuLightStatusPojo.java
deleted
100644 → 0
View file @
7716be7f
package
net
.
wanji
.
utc
.
hisense
.
pojo
.
convert
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author duanruiming
* @date 2025/03/03 17:35
*/
@Data
public
class
EhualuLightStatusPojo
{
private
String
headers
;
private
String
body
;
@ApiModel
(
value
=
"来自滴滴海信灯态实体类"
)
@Data
public
static
class
Headers
{
@ApiModelProperty
(
value
=
"数据名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"滴滴数据大脑数据来源"
)
private
String
from
;
private
String
taskId
;
}
@Data
@ApiModel
(
value
=
"来自滴滴海信灯态实体类"
)
public
static
class
Body
{
@ApiModelProperty
(
value
=
"灯态数据内容"
)
private
ContentBody
content
;
@ApiModelProperty
(
value
=
"数据源,固定字符串,比如 “haixin”"
)
private
String
source
;
@ApiModelProperty
(
value
=
"数据类型,固定数字2,代表JSON格式"
)
private
Integer
type
;
}
@Data
@ApiModel
(
value
=
"来自滴滴海信灯态实体类"
)
public
static
class
ContentBody
{
@ApiModelProperty
(
value
=
"城市名称拼音,如“yinchuan”"
)
private
String
cityCode
;
@ApiModelProperty
(
value
=
"行政区编号,如“640104"
)
private
String
regionId
;
@ApiModelProperty
(
value
=
"置信度,1.0代表100%可信,若遇早晚高峰动态配时,可以降低置信度"
)
private
int
confidence
;
@ApiModelProperty
(
value
=
"控制模式,11:特殊控制-关灯,12:特殊控制-全红,13:特殊控制-黄闪,21:单点多时段控制,"
+
"22:单点感应控制,23:单点自适应控制,31:线协调控制,41:区域协调控制,51:干预控制-手动控制,"
+
"52:干预控制-锁定阶段控制,53:干预控制-指定方案,54:干预控制-锁定相位控制"
)
private
int
controlMode
;
@ApiModelProperty
(
value
=
"海信定义路口编号"
)
private
String
crossId
;
@ApiModelProperty
(
value
=
"信号机实时状态,0-正常,1-掉线"
)
private
int
crossRealStatus
;
@ApiModelProperty
(
value
=
"周期剩余时间"
)
private
int
cycleCountDown
;
@ApiModelProperty
(
value
=
"灯态JSON Object"
)
private
List
<
LampRealInfos
>
lampRealInfos
;
@ApiModelProperty
(
value
=
"信号灯周期(单位:秒),所有信号阶段时长之和"
)
private
int
period
;
@ApiModelProperty
(
value
=
"方案编号"
)
private
int
planId
;
@ApiModelProperty
(
value
=
"数据产生时间戳,精确到毫秒,与北京时间校准务必准确"
)
private
Long
signalMachineStamp
;
private
Integer
offset
;
private
Integer
periodCountDown
;
@Data
@ApiModel
(
value
=
"来自滴滴海信灯态实体类"
)
public
static
class
LampRealInfos
{
@ApiModelProperty
(
value
=
"当前灯色剩余时间,单位:秒,动态变化的具体数值,时效性要求高"
)
private
Integer
countDown
;
@ApiModelProperty
(
value
=
"当前灯色,22-黄灯,23-绿灯,21-红灯"
)
private
String
lampStatus
;
@ApiModelProperty
(
value
=
"下一灯色持续时长"
)
private
Integer
nextCountDown
;
@ApiModelProperty
(
value
=
"下一灯色"
)
private
Integer
nextLampStatus
;
/**
* 0 由北向南
* 1 东北向西南
* 2 由东向西
* 3 由东南向西北
* 4 由南向北 顺时针方向
*/
@ApiModelProperty
(
value
=
"交通流方向"
)
private
Integer
roadDirection
;
@ApiModelProperty
(
value
=
"交通流流向,11:直行,12:左转,13:右转, 31:掉头,99:其他"
)
private
Integer
roadFlowDirection
;
@ApiModelProperty
(
value
=
"相位编号"
)
private
String
phaseId
;
private
Integer
nextNextCountDown
;
private
Integer
nextNextLampStatus
;
}
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/pojo/convert/
Hisense
LightStatusPojo.java
→
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/pojo/convert/LightStatusPojo.java
View file @
841c0ee0
...
...
@@ -14,7 +14,7 @@ import java.util.List;
@Data
@ApiModel
(
value
=
"来自滴滴海信灯态实体类"
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
Hisense
LightStatusPojo
{
public
class
LightStatusPojo
{
private
Headers
headers
;
private
String
body
;
...
...
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/service/SignalStatusService.java
View file @
841c0ee0
...
...
@@ -2,8 +2,7 @@ package net.wanji.utc.hisense.service;
import
net.wanji.databus.po.SignalStatusLogPO
;
import
net.wanji.databus.vo.LightsStatusVO
;
import
net.wanji.utc.hisense.pojo.convert.EhualuLightStatusPojo
;
import
net.wanji.utc.hisense.pojo.convert.HisenseLightStatusPojo
;
import
net.wanji.utc.hisense.pojo.convert.LightStatusPojo
;
import
org.dom4j.DocumentException
;
import
java.util.List
;
...
...
@@ -23,6 +22,6 @@ public interface SignalStatusService {
List
<
SignalStatusLogPO
>
runningStatusAlarm
(
String
crossId
)
throws
DocumentException
;
List
<
LightsStatusVO
>
lightStatus
(
String
crossId
);
void
receiveLightStatus
(
List
<
HisenseLightStatusPojo
>
hisenseL
ightStatusPojos
)
throws
Exception
;
void
receiveLightStatusEhualu
(
List
<
Ehualu
LightStatusPojo
>
ehualuLightStatusPojos
)
throws
Exception
;
void
receiveLightStatus
(
List
<
LightStatusPojo
>
l
ightStatusPojos
)
throws
Exception
;
void
receiveLightStatusEhualu
(
List
<
LightStatusPojo
>
ehualuLightStatusPojos
)
throws
Exception
;
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/service/impl/SignalStatusServiceImpl.java
View file @
841c0ee0
...
...
@@ -23,8 +23,7 @@ import net.wanji.utc.hisense.common.enums.DataBrainControlModeEnum;
import
net.wanji.utc.hisense.common.enums.DataBrainLampStatusEnum
;
import
net.wanji.utc.hisense.common.enums.DataBrainTurnEnum
;
import
net.wanji.utc.hisense.pojo.CrossPhaseDirTurnPojo
;
import
net.wanji.utc.hisense.pojo.convert.EhualuLightStatusPojo
;
import
net.wanji.utc.hisense.pojo.convert.HisenseLightStatusPojo
;
import
net.wanji.utc.hisense.pojo.convert.LightStatusPojo
;
import
net.wanji.utc.hisense.pojo.dto.CrossSchemePhaseCountDownDTO
;
import
net.wanji.utc.hisense.pojo.dto.PhaseCountDownDTO
;
import
net.wanji.utc.hisense.service.SignalStatusService
;
...
...
@@ -127,88 +126,25 @@ public class SignalStatusServiceImpl implements SignalStatusService {
return
lightsStatusVOS
;
}
// @Override
// public List<LightsStatusVO> lightStatus(String crossId) {
// List<LightsStatusVO> lightsStatusVOS = new ArrayList<>();
// Map<String, RunningLightsStatusPojo> runningStateInfoCache = SignalDataCache.runningStateInfoCacheUdp;
// if (!runningStateInfoCache.isEmpty()) {
// RunningLightsStatusPojo runningLightsStatusPojo = runningStateInfoCache.get(crossId);
// LightsStatusVO lightsStatusVO = new LightsStatusVO();
// lightsStatusVO.setCrossId(crossId);
// String runMode = String.valueOf(ControlModelEnum.getWjControlMode(runningLightsStatusPojo.getCCT()));
// lightsStatusVO.setRunMode(runMode);
// lightsStatusVO.setCycleLen(runningLightsStatusPojo.getCC());
// // 相位剩余时长
// List<RunningLightsStatusPojo.Phase> phaseList = runningLightsStatusPojo.getPHASE();
// Integer phaseId = 0;
// Integer phaseCountDown = 0;
// for (RunningLightsStatusPojo.Phase phase : phaseList) {
// Integer ls = phase.getLS();
// if (Objects.equals(ls, 1)) { // 当前相位绿灯
// phaseId = phase.getPHN();
// phaseCountDown = phase.getPCD();
// }
// }
// lightsStatusVO.setCycleCountDown(phaseCountDown);
// lightsStatusVO.setPhaseId(String.valueOf(phaseId));
// lightsStatusVO.setSchemeId(String.valueOf(runningLightsStatusPojo.getPLN()));
//
// RunningLightsStatusPojo.Channel channel = runningLightsStatusPojo.getCHANNEL();
// Map<String, Object> dirLampGroupMap = new HashMap<>();
// List<Integer> scs = channel.getSCS();
// if (!CollectionUtils.isEmpty(scs)) {
// for (int i = 0; i < scs.size(); i++) {
// Map<Integer, String> turnColorMap = new HashMap<>();
// String lightsColor = String.valueOf(scs.get(i));
// String wjLightColor = PhaseLightColorEnum.getWjLightColor(lightsColor);
// Integer turn = null;
// turn = CommonUtils.getTurnByLightsId(i);
//
// // 复杂路口处理
//// Map<String, Map<Integer, Integer>> cacheMap = ComplexCrossCache.getCacheMap();
//// if (cacheMap.containsKey(crossId)) {
//// Map<Integer, Integer> innerMap = cacheMap.get(crossId);
//// if (innerMap.containsKey(i)) {
//// turn = innerMap.get(i);
//// }
//// }
//
// turnColorMap.put(turn, wjLightColor);
// String dir = String.valueOf(CommonUtils.getDirByLightsId(i));
// if (dirLampGroupMap.isEmpty() || Objects.isNull(dirLampGroupMap.get(dir))) {
// dirLampGroupMap.put(dir, turnColorMap);
// } else {
// Map<Integer, String> currentTurnColorMap = (Map<Integer, String>) dirLampGroupMap.get(dir);
// currentTurnColorMap.put(turn, wjLightColor);
// dirLampGroupMap.put(dir, currentTurnColorMap);
// }
// }
// }
// lightsStatusVO.setDirLampGroupMap(dirLampGroupMap);
// lightsStatusVOS.add(lightsStatusVO);
// }
// return lightsStatusVOS;
// }
/**
* @param
hisenseL
ightStatusPojos
* @param
l
ightStatusPojos
* @throws Exception
* @description 通过http形式接收海信灯态
*/
@Override
public
void
receiveLightStatus
(
List
<
HisenseLightStatusPojo
>
hisenseL
ightStatusPojos
)
throws
Exception
{
public
void
receiveLightStatus
(
List
<
LightStatusPojo
>
l
ightStatusPojos
)
throws
Exception
{
Date
date
=
new
Date
();
Long
time
=
date
.
getTime
();
ObjectMapper
jackson
=
JacksonUtils
.
getInstance
();
pushOtherCompany
(
hisenseL
ightStatusPojos
,
jackson
,
shensiUrl
,
baiduUrl
,
yiGouUrl
,
BaseEnum
.
VendorTypeEnum
.
HS
.
getNick
());
pushOtherCompany
(
l
ightStatusPojos
,
jackson
,
shensiUrl
,
baiduUrl
,
yiGouUrl
,
BaseEnum
.
VendorTypeEnum
.
HS
.
getNick
());
if
(!
CollectionUtils
.
isEmpty
(
hisenseL
ightStatusPojos
))
{
for
(
HisenseLightStatusPojo
hisenseLightStatusPojo
:
hisenseL
ightStatusPojos
)
{
String
bodyStr
=
hisenseL
ightStatusPojo
.
getBody
();
List
<
HisenseLightStatusPojo
.
Body
>
bodies
=
jackson
.
readValue
(
bodyStr
,
new
TypeReference
<
List
<
Hisense
LightStatusPojo
.
Body
>>()
{});
if
(!
CollectionUtils
.
isEmpty
(
l
ightStatusPojos
))
{
for
(
LightStatusPojo
lightStatusPojo
:
l
ightStatusPojos
)
{
String
bodyStr
=
l
ightStatusPojo
.
getBody
();
List
<
LightStatusPojo
.
Body
>
bodies
=
jackson
.
readValue
(
bodyStr
,
new
TypeReference
<
List
<
LightStatusPojo
.
Body
>>()
{});
if
(!
CollectionUtils
.
isEmpty
(
bodies
))
{
for
(
Hisense
LightStatusPojo
.
Body
body
:
bodies
)
{
Hisense
LightStatusPojo
.
ContentBody
content
=
body
.
getContent
();
for
(
LightStatusPojo
.
Body
body
:
bodies
)
{
LightStatusPojo
.
ContentBody
content
=
body
.
getContent
();
LightsStatusVO
lightsStatusVO
=
new
LightsStatusVO
();
String
hiCrossId
=
content
.
getCrossId
();
CrossInfoPO
crossInfo
=
CrossInfoCache
.
getCrossInfoBySignalCode
(
hiCrossId
);
...
...
@@ -265,19 +201,19 @@ public class SignalStatusServiceImpl implements SignalStatusService {
}
@Override
public
void
receiveLightStatusEhualu
(
List
<
Ehualu
LightStatusPojo
>
ehualuLightStatusPojos
)
throws
Exception
{
public
void
receiveLightStatusEhualu
(
List
<
LightStatusPojo
>
ehualuLightStatusPojos
)
throws
Exception
{
Date
date
=
new
Date
();
Long
time
=
date
.
getTime
();
ObjectMapper
jackson
=
JacksonUtils
.
getInstance
();
pushOtherCompany
(
ehualuLightStatusPojos
,
jackson
,
shensiUrl
,
baiduUrl
,
yiGouUrl
,
BaseEnum
.
VendorTypeEnum
.
EHUALU
.
getNick
());
if
(!
CollectionUtils
.
isEmpty
(
ehualuLightStatusPojos
))
{
for
(
EhualuLightStatusPojo
ehualu
LightStatusPojo
:
ehualuLightStatusPojos
)
{
String
bodyStr
=
ehualu
LightStatusPojo
.
getBody
();
List
<
EhualuLightStatusPojo
.
Body
>
bodies
=
jackson
.
readValue
(
bodyStr
,
new
TypeReference
<
List
<
Ehualu
LightStatusPojo
.
Body
>>()
{});
for
(
LightStatusPojo
LightStatusPojo
:
ehualuLightStatusPojos
)
{
String
bodyStr
=
LightStatusPojo
.
getBody
();
List
<
LightStatusPojo
.
Body
>
bodies
=
jackson
.
readValue
(
bodyStr
,
new
TypeReference
<
List
<
LightStatusPojo
.
Body
>>()
{});
if
(!
CollectionUtils
.
isEmpty
(
bodies
))
{
for
(
Ehualu
LightStatusPojo
.
Body
body
:
bodies
)
{
Ehualu
LightStatusPojo
.
ContentBody
content
=
body
.
getContent
();
for
(
LightStatusPojo
.
Body
body
:
bodies
)
{
LightStatusPojo
.
ContentBody
content
=
body
.
getContent
();
LightsStatusVO
lightsStatusVO
=
new
LightsStatusVO
();
String
hiCrossId
=
content
.
getCrossId
();
CrossInfoPO
crossInfo
=
CrossInfoCache
.
getCrossInfoBySignalCode
(
hiCrossId
);
...
...
@@ -320,20 +256,21 @@ public class SignalStatusServiceImpl implements SignalStatusService {
lightsStatusVO
.
setPhasePlanId
(
String
.
valueOf
(
planId
));
lightsStatusVO
.
setManufacturerCode
(
BaseEnum
.
VendorTypeEnum
.
EHUALU
.
getNick
());
// 易华录每1秒推送
List
<
Ehualu
LightStatusPojo
.
ContentBody
.
LampRealInfos
>
lampRealInfos
=
content
.
getLampRealInfos
();
List
<
LightStatusPojo
.
ContentBody
.
LampRealInfos
>
lampRealInfos
=
content
.
getLampRealInfos
();
String
currentPhaseId
=
""
;
Integer
curCycleCountDown
=
0
;
if
(!
CollectionUtils
.
isEmpty
(
lampRealInfos
))
{
Map
<
String
,
Object
>
dirLampGroupMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
phaseMap
=
new
HashMap
<>();
Map
<
Integer
,
List
<
EhualuLightStatusPojo
.
ContentBody
.
LampRealInfos
>>
dirGroupMap
=
lampRealInfos
.
stream
().
collect
(
Collectors
.
groupingBy
(
EhualuLightStatusPojo
.
ContentBody
.
LampRealInfos
::
getRoadDirection
));
for
(
Map
.
Entry
<
Integer
,
List
<
EhualuLightStatusPojo
.
ContentBody
.
LampRealInfos
>>
entry
:
dirGroupMap
.
entrySet
())
{
Map
<
Integer
,
List
<
LightStatusPojo
.
ContentBody
.
LampRealInfos
>>
dirGroupMap
=
lampRealInfos
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
net
.
wanji
.
utc
.
hisense
.
pojo
.
convert
.
LightStatusPojo
.
ContentBody
.
LampRealInfos
::
getRoadDirection
));
for
(
Map
.
Entry
<
Integer
,
List
<
LightStatusPojo
.
ContentBody
.
LampRealInfos
>>
entry
:
dirGroupMap
.
entrySet
())
{
Integer
roadDir
=
entry
.
getKey
();
Integer
dir
=
HiseseDirEnum
.
getWjLightsDir
(
roadDir
);
Map
<
Integer
,
String
>
turnColor
=
new
HashMap
<>();
Map
<
Integer
,
Integer
>
turnCountDown
=
new
HashMap
<>();
List
<
Ehualu
LightStatusPojo
.
ContentBody
.
LampRealInfos
>
value
=
entry
.
getValue
();
for
(
Ehualu
LightStatusPojo
.
ContentBody
.
LampRealInfos
lampRealInfo
:
value
)
{
List
<
LightStatusPojo
.
ContentBody
.
LampRealInfos
>
value
=
entry
.
getValue
();
for
(
LightStatusPojo
.
ContentBody
.
LampRealInfos
lampRealInfo
:
value
)
{
String
lampStatus
=
lampRealInfo
.
getLampStatus
();
String
wjLampStatus
=
DataBrainLampStatusEnum
.
getWjLampStatus
(
lampStatus
);
Integer
countDown
=
lampRealInfo
.
getCountDown
();
...
...
@@ -356,6 +293,7 @@ public class SignalStatusServiceImpl implements SignalStatusService {
}
lightsStatusVO
.
setPhasePlanId
(
currentPhaseId
);
lightsStatusVO
.
setPhaseId
(
currentPhaseId
);
lightsStatusVO
.
setCycleCountDown
(
curCycleCountDown
);
SignalDataCache
.
runningStateInfoCache
.
put
(
crossId
,
lightsStatusVO
);
log
.
error
(
"当前路口灯态:{}"
,
lightsStatusVO
);
}
...
...
@@ -390,12 +328,12 @@ public class SignalStatusServiceImpl implements SignalStatusService {
}
try
{
if
(
StringUtils
.
equalsIgnoreCase
(
type
,
BaseEnum
.
VendorTypeEnum
.
HS
.
getNick
()))
{
List
<
HisenseLightStatusPojo
>
result
=
(
List
<
Hisense
LightStatusPojo
>)
hisenseLightStatusPojos
;
HisenseLightStatusPojo
hisenseL
ightStatusPojo
=
result
.
get
(
0
);
String
bodyStr
=
hisenseL
ightStatusPojo
.
getBody
();
List
<
HisenseLightStatusPojo
.
Body
>
bodies
=
jackson
.
readValue
(
bodyStr
,
new
TypeReference
<
List
<
Hisense
LightStatusPojo
.
Body
>>()
{});
for
(
Hisense
LightStatusPojo
.
Body
body
:
bodies
)
{
Hisense
LightStatusPojo
.
ContentBody
content
=
body
.
getContent
();
List
<
LightStatusPojo
>
result
=
(
List
<
LightStatusPojo
>)
hisenseLightStatusPojos
;
LightStatusPojo
l
ightStatusPojo
=
result
.
get
(
0
);
String
bodyStr
=
l
ightStatusPojo
.
getBody
();
List
<
LightStatusPojo
.
Body
>
bodies
=
jackson
.
readValue
(
bodyStr
,
new
TypeReference
<
List
<
LightStatusPojo
.
Body
>>()
{});
for
(
LightStatusPojo
.
Body
body
:
bodies
)
{
LightStatusPojo
.
ContentBody
content
=
body
.
getContent
();
String
crossId
=
content
.
getCrossId
();
List
<
String
>
list
=
Arrays
.
asList
(
"255136"
,
"209723"
,
"198207"
,
"132163"
);
if
(
list
.
contains
(
crossId
))
{
...
...
signal-utc-service/src/main/java/net/wanji/utc/task/SignalStatusTask.java
View file @
841c0ee0
...
...
@@ -214,7 +214,10 @@ public class SignalStatusTask {
});
}
if
(
StringUtils
.
endsWithIgnoreCase
(
BasicEnum
.
ManufacturerEnum
.
EHULU
.
getCode
(),
manufacturerInfoPO
.
getCode
()))
{
JsonViewObject
jsonViewObject
=
eHualuFeignClients
.
lightStatus
(
crossId
);
//JsonViewObject jsonViewObject = eHualuFeignClients.lightStatus(crossId);
//return mapper.convertValue(jsonViewObject.getContent(), new TypeReference<List<LightsStatusVO>>() {
//});
JsonViewObject
jsonViewObject
=
utcHisenseFeignClients
.
lightStatus
(
crossId
);
return
mapper
.
convertValue
(
jsonViewObject
.
getContent
(),
new
TypeReference
<
List
<
LightsStatusVO
>>()
{
});
}
...
...
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