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
863a98b4
Commit
863a98b4
authored
Jun 27, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
e8557443
a210e9d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
9 deletions
+22
-9
CrossManageServiceImpl.java
...va/net/wanji/web/service/impl/CrossManageServiceImpl.java
+19
-8
BaseAreaInfoMapper.xml
wj-databus/src/main/resources/mapper/BaseAreaInfoMapper.xml
+3
-1
No files found.
signal-control-service/src/main/java/net/wanji/web/service/impl/CrossManageServiceImpl.java
View file @
863a98b4
...
...
@@ -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
(
"此路口无时段信息"
);
}
}
...
...
wj-databus/src/main/resources/mapper/BaseAreaInfoMapper.xml
View file @
863a98b4
...
...
@@ -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>
...
...
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