diff --git a/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java b/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java index 54f4cc4f..332fa798 100644 --- a/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java +++ b/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java @@ -66,7 +66,7 @@ public class WeatherForecastController extends BaseController { /*** * 定时查询气象预警信息并上报 */ - @Scheduled(cron = "0 0/5 * * * ?") + @Scheduled(cron = "0 0/15 * * * ?") public void updateDeviceState() { HashMap hashMap = new HashMap<>(); @@ -80,6 +80,7 @@ public class WeatherForecastController extends BaseController { return; } JSONArray data = (JSONArray) JSON.toJSON(ajaxResult.get("data")); + List dcNoStakeWarningTables = noStakeWarningTableService.listDcNoStakeWarningTable(new DcNoStakeWarningTable(),null,null); data.forEach(item -> { JSONObject jsonObject = (JSONObject) JSON.toJSON(item); String earlyWorningSignal = jsonObject.getString("earlyWorningSignal"); @@ -188,7 +189,6 @@ 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 dcNoStakeWarningTables = noStakeWarningTableService.listDcNoStakeWarningTable(new DcNoStakeWarningTable(),null,null); List collect = dcNoStakeWarningTables.stream().filter(ite -> Objects.equals(ite.getWarningTime(), jsonObject.getDate("earlyWorningIssueDate")) && Objects.equals(ite.getWarningDescription(), jsonObject.getString("earlyWorningContent")) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java index 2c2fb80c..02864f49 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java @@ -782,7 +782,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { .map(String::valueOf) .collect(Collectors.joining(UniversalEnum.COMMA.getValue())); // 存储设备id 到 deviceIds 中 - deviceIds.append(UniversalEnum.COLON.getNumber()); + deviceIds.append(UniversalEnum.COLON.getValue()); deviceIds.append(deviceId); } catch (Exception e) { e.printStackTrace(); @@ -875,7 +875,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { SimpleDateFormat dateFormat = new SimpleDateFormat(UniversalEnum.TIME_FORMAT_ALL.getValue()); Calendar calendar = Calendar.getInstance(); remark.append(dateFormat.format(calendar.getTime())); - remark.append(UniversalEnum.INVOKE.getNumber()); + remark.append(UniversalEnum.INVOKE.getValue()); remark.append(device.getDeviceName()); try { if (device.getDeviceType().equals(DeviceTypeConstants.DRIVING_GUIDANCE.toString())) { @@ -909,10 +909,10 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { if (ajaxResult.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber())) { status = UniversalEnum.ZERO.getNumber(); - remark.append(UniversalEnum.SUCCESSFUL.getNumber()); + remark.append(UniversalEnum.SUCCESSFUL.getValue()); } else { status = UniversalEnum.ONE.getNumber(); - remark.append(UniversalEnum.LOSE.getNumber()); + remark.append(UniversalEnum.LOSE.getValue()); } result.put("result", ajaxResult); resultArray.add(result); @@ -935,10 +935,10 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { resultArray.add(result); if (ajaxResult1B.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber())) { status = UniversalEnum.ZERO.getNumber(); - remark.append(UniversalEnum.SUCCESSFUL.getNumber()); + remark.append(UniversalEnum.SUCCESSFUL.getValue()); } else { status = UniversalEnum.ONE.getNumber(); - remark.append(UniversalEnum.LOSE.getNumber()); + remark.append(UniversalEnum.LOSE.getValue()); } } else { // 情报板发布全流程 @@ -958,18 +958,18 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { JSONObject result = new JSONObject(); result.put("result",errorResult); result.put("code",UniversalEnum.FIVE_HUNDRED.getNumber()); - result.put("msg",UniversalEnum.OPERATION_FAILURE.getNumber()); + result.put("msg",UniversalEnum.OPERATION_FAILURE.getValue()); resultArray.add(result); status = UniversalEnum.ONE.getNumber(); - remark.append(UniversalEnum.LOSE.getNumber()); + remark.append(UniversalEnum.LOSE.getValue()); } else { JSONObject jsonObject = new JSONObject(); jsonObject.put("dcInfoBoardTemplate", foundContent); status = boardReleaseProcess(props, iotDeviceId, jsonObject, device, resultArray, functionList); if (status.equals(UniversalEnum.ZERO.getNumber())) { - remark.append(UniversalEnum.SUCCESSFUL.getNumber()); + remark.append(UniversalEnum.SUCCESSFUL.getValue()); } else { - remark.append(UniversalEnum.LOSE.getNumber()); + remark.append(UniversalEnum.LOSE.getValue()); } } @@ -1021,10 +1021,10 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { resultArray.add(result); if (Objects.equals(returnResult.getString("retCode"), UniversalEnum.ZERO.getValue())) { status = UniversalEnum.ZERO.getNumber(); - remark.append(UniversalEnum.SUCCESSFUL.getNumber()); + remark.append(UniversalEnum.SUCCESSFUL.getValue()); } else { status = UniversalEnum.ONE.getNumber(); - remark.append(UniversalEnum.LOSE.getNumber()); + remark.append(UniversalEnum.LOSE.getValue()); } @@ -1057,10 +1057,10 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { if (ajaxResultState.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber()) && ajaxResult.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber())) { status = UniversalEnum.ZERO.getNumber(); - remark.append(UniversalEnum.SUCCESSFUL.getNumber()); + remark.append(UniversalEnum.SUCCESSFUL.getValue()); } else { status = UniversalEnum.ONE.getNumber(); - remark.append(UniversalEnum.LOSE.getNumber()); + remark.append(UniversalEnum.LOSE.getValue()); } }