Browse Source

优化车辆故障事件上报描述内容

优化气象查询条件
develop
zhaoxianglong 4 months ago
parent
commit
0872cab14b
  1. 4
      zc-business/src/main/java/com/zc/business/controller/CodeScanningAlarmController.java
  2. 4
      zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java
  3. 8
      zc-business/src/main/java/com/zc/business/service/impl/DcNoStakeWarningTableServiceImpl.java

4
zc-business/src/main/java/com/zc/business/controller/CodeScanningAlarmController.java

@ -79,8 +79,12 @@ public class CodeScanningAlarmController extends BaseController {
dcWarning.setWarningSubclass(UniversalEnum.TEN_THREE.getValue());
break;
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mmXXX");
String warningTitle = "G35济菏高速" + dcWarning.getStakeMark() + (Objects.equals(roadCode, UniversalEnum.ONE.getValue()) ? UniversalEnum.DIRECTION_OF_JINAN.getValue() : UniversalEnum.DIRECTION_OF_HEZE.getValue()) + "发生" + (Integer.parseInt(accidentType) >= 4 ? UniversalEnum.TRAFFIC_ACCIDENT_EVENT.getValue() : UniversalEnum.VEHICLE_BREAKDOWN_EVENT.getValue());
dcWarning.setWarningTitle(warningTitle);
dcWarning.setRemark(simpleDateFormat.format(dcWarning.getWarningTime()) + warningTitle);
dcWarning.setWarningSource(UniversalEnum.FIVE.getNumber());
dcWarning.setWarningState(UniversalEnum.ONE.getNumber());
return AjaxResult.success(dcWarningService.insertDcWarning(dcWarning));

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

@ -84,7 +84,9 @@ public class WeatherForecastController extends BaseController {
JSONArray data = (JSONArray) JSON.toJSON(ajaxResult.get("data"));
if (data.size() > UniversalEnum.ZERO.getNumber()) {
List<DcNoStakeWarningTable> dcNoStakeWarningTables = noStakeWarningTableService.listDcNoStakeWarningTable(new DcNoStakeWarningTable(), null, null);
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");

8
zc-business/src/main/java/com/zc/business/service/impl/DcNoStakeWarningTableServiceImpl.java

@ -31,22 +31,22 @@ public class DcNoStakeWarningTableServiceImpl extends ServiceImpl<DcNoStakeWarni
queryWrapper.eq(DcNoStakeWarningTable::getId, dcNoStakeWarningTable.getId());
}
// 设备ID
// 预警描述
if (Objects.nonNull(dcNoStakeWarningTable.getWarningDescription())) {
queryWrapper.eq(DcNoStakeWarningTable::getWarningDescription, dcNoStakeWarningTable.getWarningDescription());
}
// 设备ID
// 预警时间
if (Objects.nonNull(dcNoStakeWarningTable.getWarningTime())) {
queryWrapper.eq(DcNoStakeWarningTable::getWarningTime, dcNoStakeWarningTable.getWarningTime());
}
// 设备ID
// 预警类型
if (Objects.nonNull(dcNoStakeWarningTable.getWarningType())) {
queryWrapper.eq(DcNoStakeWarningTable::getWarningType, dcNoStakeWarningTable.getWarningType());
}
// 设备ID
// 创建时间
if (Objects.nonNull(dcNoStakeWarningTable.getCreateTime())) {
queryWrapper.eq(DcNoStakeWarningTable::getCreateTime, dcNoStakeWarningTable.getCreateTime());
}

Loading…
Cancel
Save