Commit dfa508df authored by duanruiming's avatar duanruiming

[update] 添加异常判断处理

parent da45144c
...@@ -12,6 +12,7 @@ import net.wanji.common.enums.DateStyle; ...@@ -12,6 +12,7 @@ import net.wanji.common.enums.DateStyle;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.common.gts.GeometryUtil; import net.wanji.common.gts.GeometryUtil;
import net.wanji.common.utils.tool.CrossUtil; import net.wanji.common.utils.tool.CrossUtil;
import net.wanji.common.utils.tool.StringUtils;
import net.wanji.databus.bo.AreaDetailBO; import net.wanji.databus.bo.AreaDetailBO;
import net.wanji.databus.bo.AreaIdBO; import net.wanji.databus.bo.AreaIdBO;
import net.wanji.databus.bo.CrossIdBO; import net.wanji.databus.bo.CrossIdBO;
...@@ -46,6 +47,7 @@ import org.springframework.beans.BeanUtils; ...@@ -46,6 +47,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
...@@ -315,7 +317,7 @@ public class CrossManageServiceImpl implements CrossManageService { ...@@ -315,7 +317,7 @@ public class CrossManageServiceImpl implements CrossManageService {
} }
Map content = (Map) jsonViewObject.getContent(); Map content = (Map) jsonViewObject.getContent();
if (content != null) { if (content != null) {
areaDetailPOExt.setCode((String)content.get("code")); areaDetailPOExt.setCode((String) content.get("code"));
areaDetailPOExt.setManufacturerId((Integer) content.get("manufacturerId")); areaDetailPOExt.setManufacturerId((Integer) content.get("manufacturerId"));
areaDetailPOExt.setIp((String) content.get("ip")); areaDetailPOExt.setIp((String) content.get("ip"));
areaDetailPOExt.setPort((Integer) content.get("port")); areaDetailPOExt.setPort((Integer) content.get("port"));
...@@ -381,7 +383,7 @@ public class CrossManageServiceImpl implements CrossManageService { ...@@ -381,7 +383,7 @@ public class CrossManageServiceImpl implements CrossManageService {
} }
// 筛选控制模式 // 筛选控制模式
if (controlMode != null) { if (controlMode != null) {
if (currentCrossSection != null){ if (currentCrossSection != null) {
Integer currentControlMode = currentCrossSection.getControlMode(); Integer currentControlMode = currentCrossSection.getControlMode();
if (controlMode.equals(currentControlMode)) { if (controlMode.equals(currentControlMode)) {
areaDetailVO.setControlMode(currentControlMode); areaDetailVO.setControlMode(currentControlMode);
...@@ -459,14 +461,17 @@ public class CrossManageServiceImpl implements CrossManageService { ...@@ -459,14 +461,17 @@ public class CrossManageServiceImpl implements CrossManageService {
} }
private List<String> buildWktList(String polylines) { private List<String> buildWktList(String polylines) {
String[] strArray = polylines.substring(1, polylines.length() - 1).split(", "); String[] strArray = new String[0];
if (StringUtils.isNotBlank(polylines)) {
strArray = polylines.substring(1, polylines.length() - 1).split(", ");
}
return Arrays.asList(strArray); return Arrays.asList(strArray);
} }
private List<CrossIdAndNameVO> buildCrossIdAndNameList(Integer areaId) { private List<CrossIdAndNameVO> buildCrossIdAndNameList(Integer areaId) {
List<CrossIdAndNameVO> res = new ArrayList<>(); List<CrossIdAndNameVO> res = new ArrayList<>();
List<String> crossIds = areaCrossMapper.selectCrossIdsByAreaId(areaId); List<String> crossIds = areaCrossMapper.selectCrossIdsByAreaId(areaId);
if (!CollectionUtils.isEmpty(crossIds)) {
List<BaseCrossInfoPO> baseCrossInfoPOList = crossInfoMapper.selectByCrossIds(crossIds); List<BaseCrossInfoPO> baseCrossInfoPOList = crossInfoMapper.selectByCrossIds(crossIds);
for (BaseCrossInfoPO baseCrossInfoPO : baseCrossInfoPOList) { for (BaseCrossInfoPO baseCrossInfoPO : baseCrossInfoPOList) {
CrossIdAndNameVO crossIdAndNameVO = new CrossIdAndNameVO(); CrossIdAndNameVO crossIdAndNameVO = new CrossIdAndNameVO();
...@@ -474,6 +479,7 @@ public class CrossManageServiceImpl implements CrossManageService { ...@@ -474,6 +479,7 @@ public class CrossManageServiceImpl implements CrossManageService {
crossIdAndNameVO.setCrossName(baseCrossInfoPO.getName()); crossIdAndNameVO.setCrossName(baseCrossInfoPO.getName());
res.add(crossIdAndNameVO); res.add(crossIdAndNameVO);
} }
}
return res; return res;
} }
......
...@@ -372,7 +372,10 @@ public class CrossConfigServiceImpl implements CrossConfigService { ...@@ -372,7 +372,10 @@ public class CrossConfigServiceImpl implements CrossConfigService {
dirListElement.setDir(key); dirListElement.setDir(key);
// 获取是否有行人道 // 获取是否有行人道
CrossDirInfoPO crossDirInfoPO = crossDirInfoMapper.selectByCrossIdAndDirType(crossId, key); CrossDirInfoPO crossDirInfoPO = crossDirInfoMapper.selectByCrossIdAndDirType(crossId, key);
Integer isPedestrian = crossDirInfoPO.getIsPedestrian(); Integer isPedestrian = 0;
if (Objects.nonNull(crossDirInfoPO)) {
isPedestrian = crossDirInfoPO.getIsPedestrian();
}
dirListElement.setIsPersonCross(isPedestrian); dirListElement.setIsPersonCross(isPedestrian);
// 构造laneList // 构造laneList
List<LaneInfoPO> value = entry.getValue(); List<LaneInfoPO> value = entry.getValue();
......
...@@ -376,6 +376,7 @@ public class DiagnoServiceImpl implements DiagnoService { ...@@ -376,6 +376,7 @@ public class DiagnoServiceImpl implements DiagnoService {
// 获取当前时间之前45分钟的10位时间戳 // 获取当前时间之前45分钟的10位时间戳
long currentSeconds = DateUtil.currentSeconds(); long currentSeconds = DateUtil.currentSeconds();
long optStartTime = currentSeconds - 2 * 60 * 60; long optStartTime = currentSeconds - 2 * 60 * 60;
//long optStartTime = 1689525900l;
// 优化开始时间,两个小时内最早时间 // 优化开始时间,两个小时内最早时间
CrossSchemeOptLogPO optStartEntity = crossSchemeOptLogMapper.selectOptStartEntity(crossId, optReason, optStartTime); CrossSchemeOptLogPO optStartEntity = crossSchemeOptLogMapper.selectOptStartEntity(crossId, optReason, optStartTime);
if (Objects.nonNull(optStartEntity)) { if (Objects.nonNull(optStartEntity)) {
......
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