Commit bf8a679a authored by duanruiming's avatar duanruiming

[add] 增加策略恢复接口

parent 2366e1f4
......@@ -166,6 +166,18 @@ public class StrategyControlController {
return strategyControlService.strategyLockSend(strategyLockSendVO);
}
@ApiOperation(value = "策略管理-路口详情-策略恢复", notes = "策略管理-路口详情-策略恢复",
response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/strategyLockRecoverSend",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = StrategyNameCrossVO.class),
})
public JsonViewObject strategyLockRecoverSend(@RequestBody StrategyLockSendVO strategyLockSendVO) throws Exception {
return strategyControlService.strategyLockRecoverSend(strategyLockSendVO);
}
@ApiOperation(value = "策略管理-路口详情-优化策略查询", notes = "策略管理-路口详情-优化策略查询",
response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
......
......@@ -42,4 +42,6 @@ public interface StrategyControlService {
JsonViewObject strategyNameCrossInfo(String crossId) throws Exception;
JsonViewObject strategyLockSend(StrategyLockSendVO strategyLockSendVO) throws Exception;
JsonViewObject strategyLockRecoverSend(StrategyLockSendVO strategyLockSendVO) throws Exception;
}
......@@ -1226,8 +1226,32 @@ public class StrategyControlServiceImpl implements StrategyControlService {
@Override
public JsonViewObject strategyLockSend(StrategyLockSendVO strategyLockSendVO) throws Exception {
ObjectMapper mapper = JacksonUtils.getInstance();
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
String crossId = strategyLockSendVO.getCrossId();
LambdaQueryWrapper<StrategyDailyPlanInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StrategyDailyPlanInfoEntity::getCrossId, crossId);
List<StrategyDailyPlanInfoEntity> dailyPlanInfos = strategyDailyPlanInfoMapper.selectList(queryWrapper);
if (!CollectionUtils.isEmpty(dailyPlanInfos)) {
for (StrategyDailyPlanInfoEntity dailyPlanInfo : dailyPlanInfos) {
String dailyPlanStr = dailyPlanInfo.getDailyPlanDetails();
StrategyControlDetailList.DailyPlan.DailyPlanDetail dailyPlanDetail = new StrategyControlDetailList.DailyPlan.DailyPlanDetail();
List<StrategyControlDetailList.DailyPlan.DailyPlanDetail> dailyPlanDetails = mapper.readValue(dailyPlanStr, new TypeReference<List<StrategyControlDetailList.DailyPlan.DailyPlanDetail>>() {});
if (!CollectionUtils.isEmpty(dailyPlanDetails)) {
for (StrategyControlDetailList.DailyPlan.DailyPlanDetail item : dailyPlanDetails) {
String strategyNo = item.getStrategyNo();
}
}
}
}
log.error("收到请求参数:{}", strategyLockSendVO);
return jsonViewObject.success("策略锁定成功");
}
@Override
public JsonViewObject strategyLockRecoverSend(StrategyLockSendVO strategyLockSendVO) throws Exception {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
log.error("收到请求参数:{}", strategyLockSendVO);
return jsonViewObject.success("策略恢复成功");
}
}
......@@ -14,6 +14,8 @@ import lombok.Data;
public class StrategyLockSendVO {
@ApiModelProperty(name = "路口ID",notes = "")
private String crossId;
@ApiModelProperty(name = "路口ID",notes = "")
@ApiModelProperty(name = "锁定时间",notes = "")
private Double lockTime;
@ApiModelProperty(name = "策略编号",notes = "")
private String strategyNo;
}
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