Commit 795a3da3 authored by duanruiming's avatar duanruiming

[add] 策略推荐优化

parent ae1c02ff
......@@ -7,6 +7,8 @@ import io.swagger.annotations.ApiResponses;
import net.wanji.common.annotation.aspect.AspectLog;
import net.wanji.common.enums.BaseEnum;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.bo.CrossIdBO;
import net.wanji.databus.vo.ControlCommandVO;
import net.wanji.databus.vo.SchemeOptSendVO;
import net.wanji.opt.service.signalcontrol.FeignProxyService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -23,7 +25,7 @@ import javax.ws.rs.core.MediaType;
* @author duanruiming
* @date 2023/03/01 20:44
*/
@Api(value = "SignalCommandOptController", description = "信号优化")
@Api(value = "SignalCommandOptController", description = "信号机控制")
@RequestMapping("/signalControl")
@RestController
public class SignalCommandOptController {
......@@ -53,4 +55,59 @@ public class SignalCommandOptController {
return jsonViewObject;
}
@AspectLog(description = "全红控制", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "全红控制", notes = "全红控制", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/allRedControl",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class)})
public JsonViewObject allRedControl(@RequestBody ControlCommandVO vo) throws Exception {
JsonViewObject jsonViewObject = feignProxyService.allRedControl(vo);
return jsonViewObject;
}
@AspectLog(description = "黄闪控制", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "黄闪控制", notes = "黄闪控制", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/yellowLightControl",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class)})
public JsonViewObject yellowLightControl(@RequestBody ControlCommandVO vo) throws Exception {
JsonViewObject jsonViewObject = feignProxyService.yellowLightControl(vo);
return jsonViewObject;
}
@AspectLog(description = "步进控制", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "步进控制", notes = "步进控制", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/stepControl",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class)})
public JsonViewObject stepControl(String crossId, Integer command, Integer stepNum) throws Exception {
JsonViewObject jsonViewObject = feignProxyService.stepControl(crossId, command, stepNum);
return jsonViewObject;
}
@AspectLog(description = "相位锁定", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "相位锁定", notes = "相位锁定", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/lockControl",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class)})
public JsonViewObject lockControl(@RequestBody ControlCommandVO vo) throws Exception {
JsonViewObject jsonViewObject = feignProxyService.lockControl(vo);
return jsonViewObject;
}
@AspectLog(description = "恢复时间表", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "恢复时间表", notes = "恢复时间表", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/recoverSchedule",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class)})
public JsonViewObject recoverSchedule(@RequestBody CrossIdBO crossIdBO) throws Exception {
JsonViewObject jsonViewObject = feignProxyService.recoverSchedule(crossIdBO);
return jsonViewObject;
}
}
package net.wanji.opt.service.signalcontrol;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.bo.CrossIdBO;
import net.wanji.databus.vo.ControlCommandVO;
import net.wanji.databus.vo.SchemeOptSendVO;
/**
......@@ -10,4 +12,20 @@ import net.wanji.databus.vo.SchemeOptSendVO;
public interface FeignProxyService {
JsonViewObject schemeOptSend(SchemeOptSendVO schemeOptSendVO) throws Exception;
JsonViewObject schemeOptRestore(String crossId) throws Exception;
/** 增加路口红闪,黄闪,步进,相位锁定服务 20250315 /
*
* @param vo
* @return
* @throws Exception
*/
JsonViewObject allRedControl(ControlCommandVO vo) throws Exception;
JsonViewObject yellowLightControl(ControlCommandVO vo) throws Exception;
JsonViewObject stepControl(String crossId, Integer command, Integer stepNum) throws Exception;
JsonViewObject lockControl(ControlCommandVO vo) throws Exception;
JsonViewObject recoverSchedule(CrossIdBO crossIdBO) throws Exception;
}
......@@ -4,7 +4,10 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.wanji.common.framework.exception.FeignServiceException;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.bo.CrossIdBO;
import net.wanji.databus.entity.develop.servicedevelop.develop.StatusCodeEnum;
import net.wanji.databus.vo.ControlCommandVO;
import net.wanji.databus.vo.LockControlVO;
import net.wanji.databus.vo.SchemeSendVO;
import net.wanji.feign.service.UtcFeignClients;
import net.wanji.opt.cache.CrossDirTurnPhaseCache;
......@@ -127,4 +130,35 @@ public class FeignProxyServiceImpl implements FeignProxyService {
}
return crossSchemeOptLogPOS;
}
@Override
public JsonViewObject allRedControl(ControlCommandVO vo) throws Exception {
return utcFeignClients.allRedControl(vo);
}
@Override
public JsonViewObject yellowLightControl(ControlCommandVO vo) throws Exception {
return utcFeignClients.yellowLightControl(vo);
}
@Override
public JsonViewObject stepControl(String crossId, Integer command, Integer stepNum) throws Exception {
return utcFeignClients.stepControl(crossId, command, stepNum);
}
@Override
public JsonViewObject lockControl(ControlCommandVO vo) throws Exception {
LockControlVO lockControlVO = new LockControlVO();
lockControlVO.setCrossCode(vo.getCrossCode());
lockControlVO.setCommand(vo.getCommand());
lockControlVO.setDuration(vo.getDuration());
lockControlVO.setPhaseList(vo.getPhaseList());
return utcFeignClients.lockControl(lockControlVO);
}
@Override
public JsonViewObject recoverSchedule(CrossIdBO crossIdBO) throws Exception {
return utcFeignClients.recoverSchedule(crossIdBO.getCrossId());
}
}
......@@ -28,7 +28,7 @@ public class ControlCommandVO {
@Min(value = 0, message = "控制类型:1是;0否")
private Integer command;
@ApiModelProperty(value = "1关灯 2黄闪 3全红")
@ApiModelProperty(value = "1关灯 2黄闪 3全红 锁定步进时,不需要发送")
private Integer controlType;
@ApiModelProperty(value = "持续时间")
......
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