Browse Source

--气象预警增加规范文件提示信息

develop
mengff 3 weeks ago
parent
commit
af81955347
  1. 7
      zc-business/src/main/java/com/zc/business/utils/WeatherTrafficProposeUtil.java

7
zc-business/src/main/java/com/zc/business/utils/WeatherTrafficProposeUtil.java

@ -33,7 +33,8 @@ public class WeatherTrafficProposeUtil {
return condition; return condition;
} }
} }
throw new IllegalArgumentException("No matching WeatherCondition found for level: " + level + " and description: " + description); return null;
// throw new IllegalArgumentException("No matching WeatherCondition found for level: " + level + " and description: " + description);
} }
} }
@ -111,8 +112,12 @@ public class WeatherTrafficProposeUtil {
public static String content(int warningLevelStringNumber, String earlyWarningTypeStringNumber){ public static String content(int warningLevelStringNumber, String earlyWarningTypeStringNumber){
WeatherCondition condition = WeatherCondition.fromLevelAndDescription(warningLevelStringNumber, earlyWarningTypeStringNumber); WeatherCondition condition = WeatherCondition.fromLevelAndDescription(warningLevelStringNumber, earlyWarningTypeStringNumber);
if(condition !=null) {
System.out.println("Weather Condition: " + condition.name() + ", Level: " + condition.getLevel() + ", Description: " + condition.getDescription()); System.out.println("Weather Condition: " + condition.name() + ", Level: " + condition.getLevel() + ", Description: " + condition.getDescription());
return "建议速度为" + getSpeedLimit(condition) + " km/h ;\n" + getTrafficControlAdvice(condition) + "\n" + getVehicleControlAdvice(condition); return "建议速度为" + getSpeedLimit(condition) + " km/h ;\n" + getTrafficControlAdvice(condition) + "\n" + getVehicleControlAdvice(condition);
}else{
return "";
}
} }
public static void main(String[] args) { public static void main(String[] args) {

Loading…
Cancel
Save