Commit d904a93f authored by duanruiming's avatar duanruiming

[add] 添加易购海信灯态推送

parent 8d632358
......@@ -247,6 +247,9 @@ public class StrategyControlServiceImpl implements StrategyControlService {
histVO.setId(crossId);
histVO.setName(resultEntity.getCrossName());
String coordinateByCrossId = BaseCrossInfoCache.getCoordinateByCrossId(crossId);
if (StringUtils.isBlank(coordinateByCrossId)) {
continue;
}
histVO.setWkt(coordinateByCrossId.replace("POINT(", "").replace(" ", ",").replace(")", ""));
histVO.setStrategy(resultEntity.getCurrentAlgo());
histVO.setStrategyName(StrategyCrossAlgoEnum.getDescByCode(resultEntity.getCurrentAlgo()));
......
......@@ -54,6 +54,8 @@ public class SignalStatusServiceImpl implements SignalStatusService {
private String shensiUrl;
@Value("${hisenseLightsStatus.baiduUrl}")
private String baiduUrl;
@Value("${hisenseLightsStatus.yiGouUrl}")
private String yiGouUrl;
@Override
public List<SignalStatusLogPO> runningStatusAlarm(String crossId) throws DocumentException {
......@@ -193,7 +195,7 @@ public class SignalStatusServiceImpl implements SignalStatusService {
public void receiveLightStatus(List<HisenseLightStatusPojo> hisenseLightStatusPojos) throws Exception {
ObjectMapper jackson = JacksonUtils.getInstance();
pushOtherCompany(hisenseLightStatusPojos, jackson, shensiUrl, baiduUrl);
pushOtherCompany(hisenseLightStatusPojos, jackson, shensiUrl, baiduUrl, yiGouUrl);
if (!CollectionUtils.isEmpty(hisenseLightStatusPojos)) {
for (HisenseLightStatusPojo hisenseLightStatusPojo : hisenseLightStatusPojos) {
......@@ -260,7 +262,7 @@ public class SignalStatusServiceImpl implements SignalStatusService {
}
private static void pushOtherCompany(List<HisenseLightStatusPojo> hisenseLightStatusPojos, ObjectMapper jackson,
String shensiUrl, String baiduUrl) {
String shensiUrl, String baiduUrl, String yiGouUrl) {
try {
OkHttpClientUtil.jsonPost(shensiUrl, jackson.writeValueAsString(hisenseLightStatusPojos));
} catch (Exception e) {
......@@ -271,6 +273,11 @@ public class SignalStatusServiceImpl implements SignalStatusService {
} catch (Exception e) {
log.error("海信灯态推送百度失败:{}", e.getMessage());
}
try {
OkHttpClientUtil.jsonPost(yiGouUrl, jackson.writeValueAsString(hisenseLightStatusPojos));
} catch (Exception e) {
log.error("海信灯态推送易购失败:{}", e.getMessage());
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment