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
cdbaae0c
Commit
cdbaae0c
authored
Dec 14, 2024
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 方案同步优化:同步相位灯组、车道灯组
parent
565d938a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
15 deletions
+25
-15
PlanSendServiceImpl.java
.../java/net/wanji/web/service/impl/PlanSendServiceImpl.java
+25
-15
No files found.
signal-control-service/src/main/java/net/wanji/web/service/impl/PlanSendServiceImpl.java
View file @
cdbaae0c
...
@@ -449,8 +449,8 @@ public class PlanSendServiceImpl implements PlanSendService {
...
@@ -449,8 +449,8 @@ public class PlanSendServiceImpl implements PlanSendService {
List
<
CrossBaseLaneInfoPO
>
crossBaseLaneInfoPOS
=
crossBaseLaneInfoMapper
.
selectList
(
queryWrapper
);
List
<
CrossBaseLaneInfoPO
>
crossBaseLaneInfoPOS
=
crossBaseLaneInfoMapper
.
selectList
(
queryWrapper
);
// 车道灯组关系列表
// 车道灯组关系列表
List
<
CrossLaneLightsPO
>
crossLaneLightsPOS
=
new
ArrayList
<>();
List
<
CrossLaneLightsPO
>
crossLaneLightsPOS
=
new
ArrayList
<>();
List
<
BaseCrossLightsPO
>
insertedList
=
baseCrossLightsMapper
.
selectByCrossId
(
crossId
);
List
<
BaseCrossLightsPO
>
crossLightsPOS
=
baseCrossLightsMapper
.
selectByCrossId
(
crossId
);
for
(
BaseCrossLightsPO
baseCrossLightsPO
:
insertedList
)
{
for
(
BaseCrossLightsPO
baseCrossLightsPO
:
crossLightsPOS
)
{
Integer
dir
=
baseCrossLightsPO
.
getDir
();
Integer
dir
=
baseCrossLightsPO
.
getDir
();
Integer
turn
=
baseCrossLightsPO
.
getTurn
();
Integer
turn
=
baseCrossLightsPO
.
getTurn
();
Integer
type
=
baseCrossLightsPO
.
getType
();
Integer
type
=
baseCrossLightsPO
.
getType
();
...
@@ -486,24 +486,35 @@ public class PlanSendServiceImpl implements PlanSendService {
...
@@ -486,24 +486,35 @@ public class PlanSendServiceImpl implements PlanSendService {
baseCrossLaneLightsMapper
.
deleteByCrossId
(
crossId
);
baseCrossLaneLightsMapper
.
deleteByCrossId
(
crossId
);
baseCrossLaneLightsMapper
.
insertBatch
(
crossLaneLightsPOS
);
baseCrossLaneLightsMapper
.
insertBatch
(
crossLaneLightsPOS
);
List
<
CrossPhaseLightsPO
>
crossPhaseLightsPOS
=
new
ArrayList
<>();
List
<
CrossPhaseLightsPO
>
crossPhaseLightsPOS
=
new
ArrayList
<>();
CrossPhasePO
crossPhasePO
=
new
CrossPhasePO
();
CrossPhasePO
crossPhasePO
=
new
CrossPhasePO
();
crossPhasePO
.
setCrossId
(
crossId
);
crossPhasePO
.
setCrossId
(
crossId
);
List
<
CrossPhasePO
>
crossPhasePOS
=
baseCrossPhaseMapper
.
listCrossPhasePO
(
crossPhasePO
);
List
<
CrossPhasePO
>
crossPhasePOS
=
baseCrossPhaseMapper
.
listCrossPhasePO
(
crossPhasePO
);
// 灯组
//
//
灯组
//
insertedList.stream()
//
// 相位
// 相位
List
<
CrossPhaseLightsPO
>
insertPhaseLightList
=
new
ArrayList
<>();
List
<
CrossPhaseLightsPO
>
crossPhaseLightsPOList
=
schemePhaseLightsVO
.
getCrossPhaseLightsPOList
();
List
<
CrossPhaseLightsPO
>
crossPhaseLightsPOList
=
schemePhaseLightsVO
.
getCrossPhaseLightsPOList
();
if
(!
CollectionUtils
.
isEmpty
(
crossPhaseLightsPOList
)
&&
!
CollectionUtils
.
isEmpty
(
crossPhasePOS
))
{
for
(
CrossPhaseLightsPO
crossPhaseLightsPO
:
crossPhaseLightsPOList
)
{
for
(
CrossPhaseLightsPO
crossPhaseLightsPO
:
crossPhaseLightsPOList
)
{
Integer
lightsId
=
crossPhaseLightsPO
.
getLightsId
();
Integer
phaseId
=
crossPhaseLightsPO
.
getPhaseId
();
Integer
phaseId
=
crossPhaseLightsPO
.
getPhaseId
();
Integer
lightsId
=
crossPhaseLightsPO
.
getLightsId
();
CrossPhaseLightsPO
entity
=
new
CrossPhaseLightsPO
();
entity
.
setCrossId
(
crossId
);
for
(
CrossPhasePO
phasePO
:
crossPhasePOS
)
{
Integer
phaseCurr
=
Integer
.
valueOf
(
phasePO
.
getPhaseNo
());
if
(
Objects
.
equals
(
phaseId
,
phaseCurr
))
{
entity
.
setPhaseId
(
phasePO
.
getId
());
}
}
for
(
BaseCrossLightsPO
crossLightsPO
:
crossLightsPOS
)
{
Integer
lightCurr
=
Integer
.
valueOf
(
crossLightsPO
.
getLightsNo
());
if
(
Objects
.
equals
(
lightsId
,
lightCurr
))
{
entity
.
setLightsId
(
crossLightsPO
.
getId
());
}
}
}
}
baseCrossPhaseLightsMapper
.
insertBatch
(
crossPhaseLightsPOS
);
insertPhaseLightList
.
add
(
entity
);
}
List
<
CrossPhaseLightsPO
>
distinctPhaseLights
=
insertPhaseLightList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
baseCrossPhaseLightsMapper
.
insertBatch
(
distinctPhaseLights
);
syncSchedules
(
crossId
,
schemePhaseLightsVO
);
syncSchedules
(
crossId
,
schemePhaseLightsVO
);
}
}
...
@@ -537,8 +548,7 @@ public class PlanSendServiceImpl implements PlanSendService {
...
@@ -537,8 +548,7 @@ public class PlanSendServiceImpl implements PlanSendService {
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
throw
new
Exception
(
"信号机静态信息获取-调度信息-UTC服务调用异常"
);
throw
new
Exception
(
"信号机静态信息获取-调度信息-UTC服务调用异常"
);
}
}
List
<
CrossSchedulesPO
>
crossSchedulesPOList
=
mapper
.
convertValue
(
jsonViewObject
.
getContent
(),
new
TypeReference
<
List
<
CrossSchedulesPO
>>()
{
List
<
CrossSchedulesPO
>
crossSchedulesPOList
=
mapper
.
convertValue
(
jsonViewObject
.
getContent
(),
new
TypeReference
<
List
<
CrossSchedulesPO
>>()
{});
});
insertSchedulesInfo
(
crossId
,
crossSchedulesPOList
,
crossPlanPOList
);
insertSchedulesInfo
(
crossId
,
crossSchedulesPOList
,
crossPlanPOList
);
}
}
...
...
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