Commit 0a488fb9 authored by duanruiming's avatar duanruiming

[update] 相位空放返回编码优化

parent f716d8f9
...@@ -41,29 +41,39 @@ public class CrossStrategyOptServiceImpl implements CrossStrategyOptService { ...@@ -41,29 +41,39 @@ public class CrossStrategyOptServiceImpl implements CrossStrategyOptService {
Integer countDown = idx.getCountDown(); Integer countDown = idx.getCountDown();
Integer rtnType = idx.getRtnType(); Integer rtnType = idx.getRtnType();
// rtnType大于0时,未执行 // rtnType大于0时,未执行
Long signalMachineStamp = idx.getSignalMachineStamp();
Long createStamp = idx.getCreateStamp();
Date date = new Date(curStamp);
CrossStrategyResultEntity entity = new CrossStrategyResultEntity();
entity.setCrossId(crossId);
entity.setSignalMachineStamp(String.valueOf(signalMachineStamp));
// 绿灯空放
entity.setCurrentAlgo(1);
entity.setRequestTime(date);
entity.setIssueTime(date);
entity.setInsertTime(new Date(createStamp));
entity.setCountDown(countDown);
entity.setExtendTime(countDown);
if (rtnType < 0) { if (rtnType < 0) {
Long signalMachineStamp = idx.getSignalMachineStamp(); if (Objects.nonNull(idx.getResponseCode()) && !Objects.equals(-1, idx.getResponseCode())) {
Long createStamp = idx.getCreateStamp(); entity.setResponseCode(idx.getResponseCode());
Date date = new Date(curStamp); } else {
CrossStrategyResultEntity entity = new CrossStrategyResultEntity(); entity.setResponseCode(200);
entity.setCrossId(crossId); }
entity.setSignalMachineStamp(String.valueOf(signalMachineStamp)); } else {
// 绿灯空放 if (Objects.nonNull(idx.getResponseCode()) && !Objects.equals(-1, idx.getResponseCode())) {
entity.setCurrentAlgo(1); entity.setResponseCode(idx.getResponseCode());
entity.setRequestTime(date); } else {
entity.setIssueTime(date); entity.setResponseCode(500);
entity.setInsertTime(new Date(createStamp)); }
entity.setCountDown(countDown);
entity.setExtendTime(countDown);
entity.setResponseCode(idx.getResponseCode());
entity.setRtnType(rtnType);
String name = CrossInfoCache.getName(crossId);
entity.setCrossName(name);
entity.setEmptyDir(PhaseEmptyEnum.getDir(rtnType));
entity.setEmptyTurn(PhaseEmptyEnum.getTurn(rtnType));
entity.setResponseContent(idx.getResponseContent());
crossStrategyResultMapper.insert(entity);
} }
entity.setRtnType(rtnType);
String name = CrossInfoCache.getName(crossId);
entity.setCrossName(name);
entity.setEmptyDir(PhaseEmptyEnum.getDir(rtnType));
entity.setEmptyTurn(PhaseEmptyEnum.getTurn(rtnType));
entity.setResponseContent(idx.getResponseContent());
crossStrategyResultMapper.insert(entity);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("相位空放优化结果入库异常:", e); log.error("相位空放优化结果入库异常:", e);
......
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