Commit 8d5e96c5 authored by duanruiming's avatar duanruiming

[update] 添加新增前删除操作

parent 4cee8ba3
...@@ -366,6 +366,7 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy ...@@ -366,6 +366,7 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy
crossLightsMapper.insertOne(crossLightsPO); crossLightsMapper.insertOne(crossLightsPO);
} }
} }
List<CrossPhasePO> phasePOS = saveToUtcPO.getPhasePOS(); List<CrossPhasePO> phasePOS = saveToUtcPO.getPhasePOS();
crossPhaseMapper.deleteByCrossId(crossId); crossPhaseMapper.deleteByCrossId(crossId);
if (!CollectionUtils.isEmpty(phasePOS)) { if (!CollectionUtils.isEmpty(phasePOS)) {
...@@ -381,6 +382,8 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy ...@@ -381,6 +382,8 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy
List<CrossPhaseLightsPO> phaseLightsPOS = saveToUtcPO.getPhaseLightsPOS(); List<CrossPhaseLightsPO> phaseLightsPOS = saveToUtcPO.getPhaseLightsPOS();
crossPhaseLightsMapper.deleteByCrossId(crossId); crossPhaseLightsMapper.deleteByCrossId(crossId);
crossPhaseLightsMapper.insertBatch(phaseLightsPOS); crossPhaseLightsMapper.insertBatch(phaseLightsPOS);
crossSchemeMapper.deleteByCrossId(crossId);
List<BaseCrossSchemePO> schemePOS = saveToUtcPO.getSchemePOS(); List<BaseCrossSchemePO> schemePOS = saveToUtcPO.getSchemePOS();
if (!CollectionUtils.isEmpty(schemePOS)) { if (!CollectionUtils.isEmpty(schemePOS)) {
for (BaseCrossSchemePO schemePO : schemePOS) { for (BaseCrossSchemePO schemePO : schemePOS) {
...@@ -389,6 +392,7 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy ...@@ -389,6 +392,7 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy
crossSchemeMapper.insertOne(crossSchemePO); crossSchemeMapper.insertOne(crossSchemePO);
} }
} }
List<CrossSectionPO> sectionPOS = saveToUtcPO.getSectionPOS(); List<CrossSectionPO> sectionPOS = saveToUtcPO.getSectionPOS();
crossSectionMapper.deleteOne(crossId, null,null); crossSectionMapper.deleteOne(crossId, null,null);
if (!CollectionUtils.isEmpty(sectionPOS)) { if (!CollectionUtils.isEmpty(sectionPOS)) {
...@@ -398,6 +402,7 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy ...@@ -398,6 +402,7 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy
crossSectionMapper.insertOne(crossSectionPO); crossSectionMapper.insertOne(crossSectionPO);
} }
} }
List<BaseCrossPlanPO> planPOS = saveToUtcPO.getPlanPOS(); List<BaseCrossPlanPO> planPOS = saveToUtcPO.getPlanPOS();
if (!CollectionUtils.isEmpty(planPOS)) { if (!CollectionUtils.isEmpty(planPOS)) {
for (BaseCrossPlanPO planPO : planPOS) { for (BaseCrossPlanPO planPO : planPOS) {
......
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