Browse Source

优化天气预警筛选

develop
zhaoxianglong 4 months ago
parent
commit
05f4319718
  1. 2
      zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java

2
zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java

@ -84,7 +84,6 @@ public class WeatherForecastController extends BaseController {
DcNoStakeWarningTable noStakeWarningTable = new DcNoStakeWarningTable();
noStakeWarningTable.setWarningType(UniversalEnum.TWO.getValue());
List<DcNoStakeWarningTable> dcNoStakeWarningTables = noStakeWarningTableService.listDcNoStakeWarningTable(noStakeWarningTable, null, null);
data.forEach(item -> {
JSONObject jsonObject = (JSONObject) JSON.toJSON(item);
String earlyWorningSignal = jsonObject.getString("earlyWorningSignal");
@ -193,6 +192,7 @@ public class WeatherForecastController extends BaseController {
// !Objects.equals(ite.getString("earlyWorningIssueDate"), jsonObject.getString("earlyWorningIssueDate"))
// && !Objects.equals(ite.getString("earlyWorningTitle"), jsonObject.getString("earlyWorningTitle"))
// && !Objects.equals(ite.getString("stationName"), jsonObject.getString("stationName"))).collect(Collectors.toList());
List<DcNoStakeWarningTable> dcNoStakeWarningTables = noStakeWarningTableService.listDcNoStakeWarningTable(noStakeWarningTable, null, null);
List<DcNoStakeWarningTable> collect = dcNoStakeWarningTables.stream().filter(ite ->
Objects.equals(ite.getWarningTime(), jsonObject.getDate("earlyWorningIssueDate"))
&& Objects.equals(ite.getWarningDescription(), jsonObject.getString("earlyWorningContent"))

Loading…
Cancel
Save