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
6bd1296f
Commit
6bd1296f
authored
Jul 04, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 优化关联id关联关系
parent
9ee0946b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
3 deletions
+41
-3
WanJiCommonStaticInfoServiceImpl.java
...ice/staticinfo/impl/WanJiCommonStaticInfoServiceImpl.java
+32
-1
CrossLightsMapper.java
.../java/net/wanji/databus/dao/mapper/CrossLightsMapper.java
+2
-0
CrossPlanMapper.java
...in/java/net/wanji/databus/dao/mapper/CrossPlanMapper.java
+0
-2
CrossLightsMapper.xml
wj-databus/src/main/resources/mapper/CrossLightsMapper.xml
+7
-0
No files found.
signal-utc-service/src/main/java/net/wanji/utc/service/staticinfo/impl/WanJiCommonStaticInfoServiceImpl.java
View file @
6bd1296f
...
@@ -65,6 +65,14 @@ public class WanJiCommonStaticInfoServiceImpl implements WanJiCommonStaticInfoSe
...
@@ -65,6 +65,14 @@ public class WanJiCommonStaticInfoServiceImpl implements WanJiCommonStaticInfoSe
List
<
CrossPhasePO
>
crossPhaseList
=
content
.
getCrossPhaseList
();
List
<
CrossPhasePO
>
crossPhaseList
=
content
.
getCrossPhaseList
();
crossPhaseMapper
.
deleteBatch
(
crossId
,
null
);
crossPhaseMapper
.
deleteBatch
(
crossId
,
null
);
crossPhaseList
.
forEach
(
crossPhasePO
->
{
crossPhaseList
.
forEach
(
crossPhasePO
->
{
BaseCrossSchemePO
baseCrossSchemePO
=
crossSchemeMapper
.
selectByCrossIdAndSchemeNo
(
crossId
,
crossPhasePO
.
getPlanId
());
Integer
id
;
if
(
Objects
.
isNull
(
baseCrossSchemePO
))
{
id
=
-
1
;
}
else
{
id
=
baseCrossSchemePO
.
getId
();
}
crossPhasePO
.
setPlanId
(
id
);
crossPhaseMapper
.
insertOne
(
crossPhasePO
);
crossPhaseMapper
.
insertOne
(
crossPhasePO
);
});
});
...
@@ -78,6 +86,20 @@ public class WanJiCommonStaticInfoServiceImpl implements WanJiCommonStaticInfoSe
...
@@ -78,6 +86,20 @@ public class WanJiCommonStaticInfoServiceImpl implements WanJiCommonStaticInfoSe
List
<
CrossPhaseLightsPO
>
crossPhaseLightsPOList
=
content
.
getCrossPhaseLightsPOList
();
List
<
CrossPhaseLightsPO
>
crossPhaseLightsPOList
=
content
.
getCrossPhaseLightsPOList
();
if
(!
CollectionUtils
.
isEmpty
(
crossPhaseLightsPOList
))
{
if
(!
CollectionUtils
.
isEmpty
(
crossPhaseLightsPOList
))
{
crossPhaseLightsMapper
.
deleteByCrossId
(
crossPhaseLightsPOList
.
get
(
0
).
getCrossId
());
crossPhaseLightsMapper
.
deleteByCrossId
(
crossPhaseLightsPOList
.
get
(
0
).
getCrossId
());
for
(
CrossPhaseLightsPO
crossPhaseLightsPO
:
crossPhaseLightsPOList
)
{
String
currentCrossId
=
crossPhaseLightsPO
.
getCrossId
();
Integer
lightsId
=
crossPhaseLightsPO
.
getLightsId
();
Integer
phaseId
=
crossPhaseLightsPO
.
getPhaseId
();
List
<
Integer
>
list
=
crossPhaseMapper
.
selectIdsByPhaseNo
(
currentCrossId
,
phaseId
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
crossPhaseLightsPO
.
setPhaseId
(
list
.
get
(
0
));
}
CrossLightsPO
crossLightsPO
=
new
CrossLightsPO
();
crossLightsPO
.
setCrossId
(
currentCrossId
);
crossLightsPO
.
setLightsNo
(
String
.
valueOf
(
lightsId
));
CrossLightsPO
result
=
crossLightsMapper
.
selectEntity
(
crossLightsPO
);
crossPhaseLightsPO
.
setLightsId
(
result
.
getId
());
}
crossPhaseLightsMapper
.
insertBatch
(
crossPhaseLightsPOList
);
crossPhaseLightsMapper
.
insertBatch
(
crossPhaseLightsPOList
);
}
}
}
}
...
@@ -105,6 +127,10 @@ public class WanJiCommonStaticInfoServiceImpl implements WanJiCommonStaticInfoSe
...
@@ -105,6 +127,10 @@ public class WanJiCommonStaticInfoServiceImpl implements WanJiCommonStaticInfoSe
List
<
CrossSectionPO
>
crossSectionPOList
=
planSectionVO
.
getCrossSectionPOList
();
List
<
CrossSectionPO
>
crossSectionPOList
=
planSectionVO
.
getCrossSectionPOList
();
crossSectionPOList
.
forEach
(
crossSectionPO
->
{
crossSectionPOList
.
forEach
(
crossSectionPO
->
{
crossSectionMapper
.
deleteOne
(
crossId
,
Integer
.
parseInt
(
crossSectionPO
.
getSectionNo
()),
null
);
crossSectionMapper
.
deleteOne
(
crossId
,
Integer
.
parseInt
(
crossSectionPO
.
getSectionNo
()),
null
);
Integer
id
=
crossPlanMapper
.
selectIdByNo
(
crossSectionPO
.
getCrossId
(),
crossSectionPO
.
getPlanId
());
crossSectionPO
.
setPlanId
(
id
);
BaseCrossSchemePO
baseCrossSchemePO
=
crossSchemeMapper
.
selectByCrossIdAndSchemeNo
(
crossId
,
crossSectionPO
.
getSchemeId
());
crossSectionPO
.
setSchemeId
(
baseCrossSchemePO
.
getId
());
crossSectionMapper
.
insertOne
(
crossSectionPO
);
crossSectionMapper
.
insertOne
(
crossSectionPO
);
});
});
}
}
...
@@ -125,8 +151,13 @@ public class WanJiCommonStaticInfoServiceImpl implements WanJiCommonStaticInfoSe
...
@@ -125,8 +151,13 @@ public class WanJiCommonStaticInfoServiceImpl implements WanJiCommonStaticInfoSe
List
<
CrossSchedulesPO
>
content
=
mapper
.
convertValue
(
jsonViewObject
.
getContent
(),
new
TypeReference
<
List
<
CrossSchedulesPO
>>()
{});
List
<
CrossSchedulesPO
>
content
=
mapper
.
convertValue
(
jsonViewObject
.
getContent
(),
new
TypeReference
<
List
<
CrossSchedulesPO
>>()
{});
if
(
Objects
.
nonNull
(
content
))
{
if
(
Objects
.
nonNull
(
content
))
{
crossSchedulesMapper
.
deleteByCrossId
(
crossId
);
if
(!
CollectionUtils
.
isEmpty
(
content
))
{
if
(!
CollectionUtils
.
isEmpty
(
content
))
{
crossSchedulesMapper
.
deleteByCrossId
(
crossId
);
for
(
CrossSchedulesPO
crossSchedulesPO
:
content
)
{
Integer
planId
=
crossSchedulesPO
.
getPlanId
();
Integer
id
=
crossPlanMapper
.
selectIdByNo
(
crossId
,
planId
);
crossSchedulesPO
.
setPlanId
(
id
);
}
crossSchedulesMapper
.
insertBatch
(
content
);
crossSchedulesMapper
.
insertBatch
(
content
);
}
}
}
}
...
...
wj-databus/src/main/java/net/wanji/databus/dao/mapper/CrossLightsMapper.java
View file @
6bd1296f
...
@@ -18,4 +18,6 @@ public interface CrossLightsMapper {
...
@@ -18,4 +18,6 @@ public interface CrossLightsMapper {
List
<
CrossLightsPO
>
selectByCrossId
(
@Param
(
"crossId"
)
String
crossId
);
List
<
CrossLightsPO
>
selectByCrossId
(
@Param
(
"crossId"
)
String
crossId
);
void
deleteByCrossId
(
String
crossId
);
void
deleteByCrossId
(
String
crossId
);
CrossLightsPO
selectEntity
(
@Param
(
"entity"
)
CrossLightsPO
entity
);
}
}
wj-databus/src/main/java/net/wanji/databus/dao/mapper/CrossPlanMapper.java
View file @
6bd1296f
...
@@ -22,6 +22,4 @@ public interface CrossPlanMapper {
...
@@ -22,6 +22,4 @@ public interface CrossPlanMapper {
List
<
CrossPlanPO
>
selectByCrossIdAndPlanNo
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"planNo"
)
Integer
planNo
);
List
<
CrossPlanPO
>
selectByCrossIdAndPlanNo
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"planNo"
)
Integer
planNo
);
CrossPlanPO
selectById
(
@Param
(
"planId"
)
Integer
planId
);
}
}
wj-databus/src/main/resources/mapper/CrossLightsMapper.xml
View file @
6bd1296f
...
@@ -36,5 +36,12 @@
...
@@ -36,5 +36,12 @@
where cross_id = #{crossId}
where cross_id = #{crossId}
</select>
</select>
<select
id=
"selectEntity"
resultType=
"net.wanji.databus.dao.entity.CrossLightsPO"
parameterType=
"net.wanji.databus.dao.entity.CrossLightsPO"
>
select
id,lights_no,name,type,dir,turn,cross_id,in_out_type,gmt_create,gmt_modified
from t_cross_lights
where cross_id = #{entity.crossId} and lights_no = #{entity.lightsNo}
</select>
</mapper>
</mapper>
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