Commit 681a0346 authored by duanruiming's avatar duanruiming

[add] 优化记录优化;策略查询优化

parent 9abe1678
...@@ -94,6 +94,7 @@ public class CrossIndexServiceImpl implements CrossIndexService { ...@@ -94,6 +94,7 @@ public class CrossIndexServiceImpl implements CrossIndexService {
LocalDateTime startOfDay = LocalDateTime.of(currentDate, startTime); LocalDateTime startOfDay = LocalDateTime.of(currentDate, startTime);
queryWrapper.eq(StrategyCrossResultEntity::getCrossId, crossIdBO.getCrossId()); queryWrapper.eq(StrategyCrossResultEntity::getCrossId, crossIdBO.getCrossId());
queryWrapper.ge(StrategyCrossResultEntity::getIssueTime, startOfDay); queryWrapper.ge(StrategyCrossResultEntity::getIssueTime, startOfDay);
queryWrapper.eq(StrategyCrossResultEntity::getResponseCode, 200);
List<StrategyCrossResultEntity> list = strategyCrossResultMapper.selectList(queryWrapper); List<StrategyCrossResultEntity> list = strategyCrossResultMapper.selectList(queryWrapper);
List<CrossOptResult> crossOptResults = new ArrayList<>(); List<CrossOptResult> crossOptResults = new ArrayList<>();
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
......
...@@ -32,6 +32,7 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic ...@@ -32,6 +32,7 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic
ObjectMapper mapper = JacksonUtils.getInstance(); ObjectMapper mapper = JacksonUtils.getInstance();
String resultStr = RestTemplateTool.post(url, mapper.writeValueAsString(req)); String resultStr = RestTemplateTool.post(url, mapper.writeValueAsString(req));
if (StringUtils.isNotBlank(resultStr)) { if (StringUtils.isNotBlank(resultStr)) {
log.info("下发神思策略详情成功,内容: {}", req);
Result result = mapper.readValue(resultStr, Result.class); Result result = mapper.readValue(resultStr, Result.class);
return result; return result;
} else { } else {
...@@ -52,6 +53,7 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic ...@@ -52,6 +53,7 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic
ObjectMapper mapper = JacksonUtils.getInstance(); ObjectMapper mapper = JacksonUtils.getInstance();
String resultStr = RestTemplateTool.post(switchUrl, mapper.writeValueAsString(req)); String resultStr = RestTemplateTool.post(switchUrl, mapper.writeValueAsString(req));
if (StringUtils.isNotBlank(resultStr)) { if (StringUtils.isNotBlank(resultStr)) {
log.info("下发神思策略开关成功,内容: {}", req);
Result result = mapper.readValue(resultStr, Result.class); Result result = mapper.readValue(resultStr, Result.class);
return result; return result;
} else { } else {
......
...@@ -247,6 +247,8 @@ public class StrategyControlServiceImpl implements StrategyControlService { ...@@ -247,6 +247,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
} else { } else {
queryWrapper.ne(StrategyCrossResultEntity::getResponseCode, 200); queryWrapper.ne(StrategyCrossResultEntity::getResponseCode, 200);
} }
queryWrapper.orderByDesc(StrategyCrossResultEntity::getIssueTime);
queryWrapper.last("limit 3000");
} }
List<StrategyCrossResultEntity> resultEntities = strategyCrossResultMapper.selectList(queryWrapper); List<StrategyCrossResultEntity> resultEntities = strategyCrossResultMapper.selectList(queryWrapper);
if (!CollectionUtils.isEmpty(resultEntities)) { if (!CollectionUtils.isEmpty(resultEntities)) {
...@@ -265,11 +267,6 @@ public class StrategyControlServiceImpl implements StrategyControlService { ...@@ -265,11 +267,6 @@ public class StrategyControlServiceImpl implements StrategyControlService {
Date issueTime = resultEntity.getIssueTime(); Date issueTime = resultEntity.getIssueTime();
String format = DateUtil.format(issueTime, Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND); String format = DateUtil.format(issueTime, Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND);
histVO.setOptTime(format); histVO.setOptTime(format);
//if (resultEntity.getCurrentAlgo() != 1) {
// histVO.setResult(Objects.equals(200, resultEntity.getResponseCode()) ? "成功" : "失败");
//} else {
// histVO.setResult("成功");
//}
histVO.setResult(resultEntity.getResponseContent()); histVO.setResult(resultEntity.getResponseContent());
histVO.setCode(resultEntity.getResponseCode()); histVO.setCode(resultEntity.getResponseCode());
results.add(histVO); results.add(histVO);
......
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