Commit 90ef44c4 authored by duanruiming's avatar duanruiming

[update] 优化代码2

parent 1ba6a77c
......@@ -31,6 +31,7 @@ import java.util.stream.Collectors;
*/
@Component
@Slf4j
@SuppressWarnings("unused")
public class SignalStatus4StaticSchemeTask {
public static final Map<String, LightsStatusVO> currentCrossLightStatusCache = new HashMap<>();
......@@ -96,7 +97,7 @@ public class SignalStatus4StaticSchemeTask {
String code = crossInfoPO.getCode();
LightsStatusVO lightsStatusVO = new LightsStatusVO();
List<CrossSectionPO> crossSectionPOS = crossSectionMapper.selectByCrossId(crossId);
List<CrossSchedulesPO> crossSchedulesPOS = crossSchedulesMapper.selectByCrossIds(Arrays.asList(crossId));
List<CrossSchedulesPO> crossSchedulesPOS = crossSchedulesMapper.selectByCrossIds(Collections.singletonList(crossId));
if (!CollectionUtils.isEmpty(crossSchedulesPOS)) {
Map<Integer, List<CrossSchedulesPO>> schedulesMap = crossSchedulesPOS.stream().collect(Collectors.groupingBy(CrossSchedulesPO::getPlanId));
// 判断当前执行的调度,获取日计划号
......@@ -148,9 +149,7 @@ public class SignalStatus4StaticSchemeTask {
LightsStatusVO lightsStatusVO = currentCrossLightStatusCache.get(crossId);
if (Objects.nonNull(lightsStatusVO)) {
String currentSchemeNo = lightsStatusVO.getSchemeId();
if (StringUtils.equalsIgnoreCase(schemeNo, currentSchemeNo)) {
return true;
}
return StringUtils.equalsIgnoreCase(schemeNo, currentSchemeNo);
}
}
return false;
......@@ -305,9 +304,6 @@ public class SignalStatus4StaticSchemeTask {
if (redCountDown <= 0) {
redCountDown = cycleLen - runtime;
}
//if (redCountDown <= 0) {
// redCountDown = 1;
//}
if (type == 2) { // 圆饼灯
List<Integer> dirList = Arrays.asList(1, 2, 3);
for (Integer commonTurn : dirList) {
......@@ -374,7 +370,6 @@ public class SignalStatus4StaticSchemeTask {
/**
* 统一方向转向倒计时
*
* @param phaseMap
* @param dir
* @param turnCountDown
......
......@@ -10,6 +10,7 @@ import java.text.SimpleDateFormat;
import java.util.*;
@Slf4j
@SuppressWarnings("all")
public class DateUtils {
private static final ThreadLocal<SimpleDateFormat> threadLocal = new ThreadLocal<>();
......
......@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.Objects;
@Component
@SuppressWarnings("all")
public class HttpRestUtil {
private static final Logger LOGGER = LoggerFactory.getLogger(HttpRestUtil.class);
......
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