Commit 8d5e96c5 authored by duanruiming's avatar duanruiming

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

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