Commit 863a98b4 authored by duanruiming's avatar duanruiming

Merge remote-tracking branch 'origin/master'

parents e8557443 a210e9d9
......@@ -249,29 +249,38 @@ public class CrossManageServiceImpl implements CrossManageService {
String crossId = areaDetailPOExt.getCrossId();
// 获取当前计划
Integer planId = findPlanId(datetime, dateStr, crossId);
// 当前时段
CrossSectionPO currentCrossSection = null;
if (planId != null) {
List<CrossSectionPO> crossSectionPOList = crossSectionMapper.selectByCrossAndPlan(crossId, planId);
// 获取当前时间整数字面量
SimpleDateFormat formatter = new SimpleDateFormat("HHmm");
String timeString = formatter.format(datetime);
int nowTimeInt = Integer.parseInt(timeString);
for (CrossSectionPO crossSectionPO : crossSectionPOList) {
String startTime = crossSectionPO.getStartTime();
String endTime = crossSectionPO.getEndTime();
Integer startTimeInt = timeStrToInt(startTime);
Integer endTimeInt = timeStrToInt(endTime);
if (nowTimeInt <= endTimeInt && nowTimeInt >= startTimeInt) {
Integer controlModeFromDb = crossSectionPO.getControlMode();
if (controlMode == null || 0 == controlMode) { // 不筛选控制模式
areaDetailVO.setControlMode(controlModeFromDb);
} else if (Objects.equals(controlModeFromDb, controlMode)) { // 筛选控制模式
areaDetailVO.setControlMode(controlModeFromDb);
}
currentCrossSection = crossSectionPO;
}
}
}
if (areaDetailVO.getControlMode() != null) {
// 筛选控制模式
if (currentCrossSection != null && controlMode != null) {
Integer currentControlMode = currentCrossSection.getControlMode();
if (controlMode.equals(currentControlMode)) {
areaDetailVO.setControlMode(currentControlMode);
voList.add(areaDetailVO);
}
} else if (controlMode == null){
if (currentCrossSection != null) {
Integer currentControlMode = currentCrossSection.getControlMode();
areaDetailVO.setControlMode(currentControlMode);
}
voList.add(areaDetailVO);
} else {
voList.add(areaDetailVO);
}
}
......@@ -304,6 +313,8 @@ public class CrossManageServiceImpl implements CrossManageService {
Integer sectionId = findCurrentSection(crossId);
if (sectionId != null && 0 != sectionId) {
crossSectionMapper.updateControlMode(sectionId, controlMode);
} else {
throw new RuntimeException("此路口无时段信息");
}
}
......
......@@ -82,7 +82,9 @@
JOIN t_signal_utc_changsha.t_cross_info t_signal ON t_signal.id = t_cross.id
JOIN t_signal_utc_changsha.t_manufacturer_info t_manu ON t_signal.manufacturer_id = t_manu.id
<where>
t_area.id = #{areaId}
<if test="areaId != null and areaId != 0">
AND t_area.id = #{areaId}
</if>
<if test="crossName != null and crossName != ''">
AND t_cross.name like concat('%',#{crossName},'%')
</if>
......
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