Commit 657b691f authored by hanbing's avatar hanbing

方案管理-优化运行计划

parent e8ac11d3
...@@ -14,5 +14,5 @@ public class LockPhaseDTO { ...@@ -14,5 +14,5 @@ public class LockPhaseDTO {
@ApiModelProperty(value = "路口ID,如:c7e7b1f352dd4acab4a60088eb391cca", required = true) @ApiModelProperty(value = "路口ID,如:c7e7b1f352dd4acab4a60088eb391cca", required = true)
private String crossId; private String crossId;
@ApiModelProperty(value = "相位ID", required = true) @ApiModelProperty(value = "相位ID", required = true)
private String phaseId; private Integer phaseId;
} }
...@@ -23,7 +23,7 @@ public interface CrossPlanMapper { ...@@ -23,7 +23,7 @@ public interface CrossPlanMapper {
CrossPlanPO selectByCrossIdAndName(@Param("crossId") String crossId, CrossPlanPO selectByCrossIdAndName(@Param("crossId") String crossId,
@Param("planName") String planName); @Param("planName") String planName);
List<RunningPlanDTO.DailyPlanListElement> selectDailyPlanList(@Param("crossId") String crossId); List<RunningPlanDTO.DailyPlanListElement> selectDailyPlanList(String crossId);
CrossPlanPO selectById(@Param("planId") Integer planId); CrossPlanPO selectById(@Param("planId") Integer planId);
} }
...@@ -98,6 +98,18 @@ public class SchemeSendServiceImpl implements SchemeSendService { ...@@ -98,6 +98,18 @@ public class SchemeSendServiceImpl implements SchemeSendService {
@Override @Override
public JsonViewObject lockPhase(LockPhaseDTO lockPhaseDTO) { public JsonViewObject lockPhase(LockPhaseDTO lockPhaseDTO) {
LockControlVO lockControlVO = new LockControlVO(); LockControlVO lockControlVO = new LockControlVO();
lockControlVO.setCrossCode(lockPhaseDTO.getCrossId());
lockControlVO.setCommand(1); // 控制标识:1是;0否
lockControlVO.setDuration(0); // 长期
Integer phaseId = lockPhaseDTO.getPhaseId();
CrossPhasePO crossPhasePO = crossPhaseMapper.selectById(phaseId);
String phaseNo = crossPhasePO.getPhaseNo();
List<Integer> phaseList = new ArrayList<>();
phaseList.add(Integer.parseInt(phaseNo));
lockControlVO.setPhaseList(phaseList);
JsonViewObject jsonViewObject = utcFeignClients.lockControl(lockControlVO); JsonViewObject jsonViewObject = utcFeignClients.lockControl(lockControlVO);
if (Objects.isNull(jsonViewObject) || jsonViewObject.getCode() != 200) { if (Objects.isNull(jsonViewObject) || jsonViewObject.getCode() != 200) {
return jsonViewObject.fail("信号机方案下发-锁定控制UTC服务调用异常"); return jsonViewObject.fail("信号机方案下发-锁定控制UTC服务调用异常");
......
...@@ -451,6 +451,11 @@ public class SchemeConfigServiceImpl implements SchemeConfigService { ...@@ -451,6 +451,11 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
for (int j = 0; j < phaseList.size(); j++) { for (int j = 0; j < phaseList.size(); j++) {
SaveSchemeConfigDTO.PhaseListElement phase = phaseList.get(j); SaveSchemeConfigDTO.PhaseListElement phase = phaseList.get(j);
String phaseNo = phase.getPhaseNo(); String phaseNo = phase.getPhaseNo();
try {
Integer.parseInt(phaseNo);
} catch (Exception e) {
throw new RuntimeException("相位编号必须为数字");
}
testPhaseNo(phaseNoSet, phaseNo); testPhaseNo(phaseNoSet, phaseNo);
Integer phaseType = phase.getPhaseType(); Integer phaseType = phase.getPhaseType();
if (phaseType != 3) { // 实相位或虚相位 if (phaseType != 3) { // 实相位或虚相位
...@@ -564,9 +569,14 @@ public class SchemeConfigServiceImpl implements SchemeConfigService { ...@@ -564,9 +569,14 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
for (int i = 0; i < specialControlModeList.size(); i++) { for (int i = 0; i < specialControlModeList.size(); i++) {
SaveSchemeConfigDTO.PhaseListElement phase = specialControlModeList.get(i); SaveSchemeConfigDTO.PhaseListElement phase = specialControlModeList.get(i);
String phaseNo = phase.getPhaseNo(); String phaseNo = phase.getPhaseNo();
try {
Integer.parseInt(phaseNo);
} catch (Exception e) {
throw new RuntimeException("相位编号必须为数字");
}
testPhaseNo(phaseNoSet, phaseNo); testPhaseNo(phaseNoSet, phaseNo);
CrossPhasePO crossPhasePO = new CrossPhasePO(); CrossPhasePO crossPhasePO = new CrossPhasePO();
crossPhasePO.setPhaseNo(phase.getPhaseNo()); crossPhasePO.setPhaseNo(phaseNo);
crossPhasePO.setSort(i + 1); crossPhasePO.setSort(i + 1);
crossPhasePO.setCrossId(crossId); crossPhasePO.setCrossId(crossId);
crossPhasePO.setPlanId(schemeId); crossPhasePO.setPlanId(schemeId);
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
ON t1.cross_id = t2.cross_id AND t1.id = t2.plan_id ON t1.cross_id = t2.cross_id AND t1.id = t2.plan_id
JOIN t_base_cross_scheme t3 JOIN t_base_cross_scheme t3
ON t2.cross_id = t3.cross_id AND t2.scheme_id = t3.id ON t2.cross_id = t3.cross_id AND t2.scheme_id = t3.id
WHERE t1.cross_id = 'c7e7b1f352dd4acab4a60088eb391cca' WHERE t1.cross_id = #{crossId}
</select> </select>
<select id="selectById" resultType="net.wanji.web.po.scheme.CrossPlanPO"> <select id="selectById" resultType="net.wanji.web.po.scheme.CrossPlanPO">
......
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