Commit a1879b60 authored by hanbing's avatar hanbing

方案下发-信号机方案同步

parent 3a722535
...@@ -25,7 +25,7 @@ public class CrossLightsPO { ...@@ -25,7 +25,7 @@ public class CrossLightsPO {
private Integer dir ; private Integer dir ;
/** 灯组序号 */ /** 灯组序号 */
@ApiModelProperty(name = "灯组序号",notes = "") @ApiModelProperty(name = "灯组序号",notes = "")
private Integer sort ; private Integer sort = 0 ;
/** 路口ID */ /** 路口ID */
@ApiModelProperty(name = "路口ID",notes = "") @ApiModelProperty(name = "路口ID",notes = "")
private String crossId ; private String crossId ;
......
...@@ -275,6 +275,7 @@ public class PlanSendServiceImpl implements PlanSendService { ...@@ -275,6 +275,7 @@ public class PlanSendServiceImpl implements PlanSendService {
} }
} }
List<CrossPhaseLightsPO> crossPhaseLightsPOList = schemePhaseLightsVO.getCrossPhaseLightsPOList(); List<CrossPhaseLightsPO> crossPhaseLightsPOList = schemePhaseLightsVO.getCrossPhaseLightsPOList();
if (crossPhaseLightsPOList != null) {
for (CrossPhaseLightsPO crossPhaseLightsPO : crossPhaseLightsPOList) { for (CrossPhaseLightsPO crossPhaseLightsPO : crossPhaseLightsPOList) {
Integer lightsId = crossPhaseLightsPO.getLightsId(); Integer lightsId = crossPhaseLightsPO.getLightsId();
Integer phaseId = crossPhaseLightsPO.getPhaseId(); Integer phaseId = crossPhaseLightsPO.getPhaseId();
...@@ -286,6 +287,7 @@ public class PlanSendServiceImpl implements PlanSendService { ...@@ -286,6 +287,7 @@ public class PlanSendServiceImpl implements PlanSendService {
} }
} }
} }
}
return jsonViewObject.success(); return jsonViewObject.success();
} }
......
...@@ -4,6 +4,7 @@ import net.wanji.utc.po.CrossPhaseLightsPO; ...@@ -4,6 +4,7 @@ import net.wanji.utc.po.CrossPhaseLightsPO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* @author Kent HAN * @author Kent HAN
...@@ -13,5 +14,9 @@ public interface CrossPhaseLightsMapper { ...@@ -13,5 +14,9 @@ public interface CrossPhaseLightsMapper {
void deleteByCrossId(@Param("crossId") String crossId); void deleteByCrossId(@Param("crossId") String crossId);
void insertBatch(@Param("entities") Set<CrossPhaseLightsPO> crossPhaseLightsPOSet);
void insertBatch(@Param("entities") List<CrossPhaseLightsPO> crossPhaseLightsPOList); void insertBatch(@Param("entities") List<CrossPhaseLightsPO> crossPhaseLightsPOList);
List<CrossPhaseLightsPO> selectByCrossId(String crossId);
} }
...@@ -62,7 +62,7 @@ public class HkSchemePhaseLightsServiceImpl implements HkSchemePhaseLightsServic ...@@ -62,7 +62,7 @@ public class HkSchemePhaseLightsServiceImpl implements HkSchemePhaseLightsServic
private void handleLightsData(String crossId, String crossCode, Map<Integer, PhaseCache> laneNoMap) private void handleLightsData(String crossId, String crossCode, Map<Integer, PhaseCache> laneNoMap)
throws Exception { throws Exception {
Map<String, String> path = PathUtil.getPathMapByApiCode("getCrossInfo"); Map<String, String> path = PathUtil.getPathMapByApiCode("getCrossInfo");
List<CrossPhaseLightsPO> crossPhaseLightsPOList = new ArrayList<>(); Set<CrossPhaseLightsPO> crossPhaseLightsPOSet = new HashSet<>();
JSONObject requestContent = new JSONObject(); JSONObject requestContent = new JSONObject();
// 海康固定入参字段名 // 海康固定入参字段名
requestContent.put("pageNo", 1); requestContent.put("pageNo", 1);
...@@ -118,7 +118,7 @@ public class HkSchemePhaseLightsServiceImpl implements HkSchemePhaseLightsServic ...@@ -118,7 +118,7 @@ public class HkSchemePhaseLightsServiceImpl implements HkSchemePhaseLightsServic
crossPhaseLightsPO.setLightsId(crossLightsPOId); crossPhaseLightsPO.setLightsId(crossLightsPOId);
crossPhaseLightsPO.setPhaseId(id); crossPhaseLightsPO.setPhaseId(id);
crossPhaseLightsPO.setCrossId(crossId); crossPhaseLightsPO.setCrossId(crossId);
crossPhaseLightsPOList.add(crossPhaseLightsPO); crossPhaseLightsPOSet.add(crossPhaseLightsPO);
} }
} }
} }
...@@ -127,7 +127,7 @@ public class HkSchemePhaseLightsServiceImpl implements HkSchemePhaseLightsServic ...@@ -127,7 +127,7 @@ public class HkSchemePhaseLightsServiceImpl implements HkSchemePhaseLightsServic
} }
// 更新相位-灯组关系 // 更新相位-灯组关系
crossPhaseLightsMapper.deleteByCrossId(crossId); crossPhaseLightsMapper.deleteByCrossId(crossId);
crossPhaseLightsMapper.insertBatch(crossPhaseLightsPOList); crossPhaseLightsMapper.insertBatch(crossPhaseLightsPOSet);
} }
private void handlePhaseData(String crossCode, Map<Integer, PhaseCache> phaseNoMap, private void handlePhaseData(String crossCode, Map<Integer, PhaseCache> phaseNoMap,
......
...@@ -36,6 +36,7 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -36,6 +36,7 @@ public class StaticInfoServiceImpl implements StaticInfoService {
private final CrossSchemeMapper crossSchemeMapper; private final CrossSchemeMapper crossSchemeMapper;
private final CrossPhaseMapper crossPhaseMapper; private final CrossPhaseMapper crossPhaseMapper;
private final CrossLightsMapper crossLightsMapper; private final CrossLightsMapper crossLightsMapper;
private final CrossPhaseLightsMapper crossPhaseLightsMapper;
private final CrossPlanMapper crossPlanMapper; private final CrossPlanMapper crossPlanMapper;
private final CrossSectionMapper crossSectionMapper; private final CrossSectionMapper crossSectionMapper;
private final CrossSchedulesMapper crossSchedulesMapper; private final CrossSchedulesMapper crossSchedulesMapper;
...@@ -143,11 +144,14 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -143,11 +144,14 @@ public class StaticInfoServiceImpl implements StaticInfoService {
List<CrossSchemePO> crossSchemePOList = crossSchemeMapper.selectByCrossId(crossId); List<CrossSchemePO> crossSchemePOList = crossSchemeMapper.selectByCrossId(crossId);
List<CrossPhasePO> crossPhasePOList = crossPhaseMapper.selectByCrossId(crossId); List<CrossPhasePO> crossPhasePOList = crossPhaseMapper.selectByCrossId(crossId);
List<CrossLightsPO> crossLightsPOList = crossLightsMapper.selectByCrossId(crossId); List<CrossLightsPO> crossLightsPOList = crossLightsMapper.selectByCrossId(crossId);
List<CrossPhaseLightsPO> crossPhaseLightsPOList = crossPhaseLightsMapper.selectByCrossId(crossId);
SchemePhaseLightsVO schemePhaseLightsVO = new SchemePhaseLightsVO(); SchemePhaseLightsVO schemePhaseLightsVO = new SchemePhaseLightsVO();
schemePhaseLightsVO.setCrossSchemeList(crossSchemePOList); schemePhaseLightsVO.setCrossSchemeList(crossSchemePOList);
schemePhaseLightsVO.setCrossPhaseList(crossPhasePOList); schemePhaseLightsVO.setCrossPhaseList(crossPhasePOList);
schemePhaseLightsVO.setCrossLightsList(crossLightsPOList); schemePhaseLightsVO.setCrossLightsList(crossLightsPOList);
schemePhaseLightsVO.setCrossPhaseLightsPOList(crossPhaseLightsPOList);
return schemePhaseLightsVO; return schemePhaseLightsVO;
} }
......
...@@ -24,5 +24,12 @@ ...@@ -24,5 +24,12 @@
where cross_id = #{crossId} where cross_id = #{crossId}
</delete> </delete>
<select id="selectByCrossId" resultType="net.wanji.utc.po.CrossPhaseLightsPO">
select
id,lights_id,phase_id,cross_id,gmt_create,gmt_modified
from t_cross_phase_lights
where crossId = #{crossId}
</select>
</mapper> </mapper>
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