public class QualityUtils {
public static void main(String[] args) {
User user = new User();
user.setName("ww");
user.setWindDir(new BigDecimal(-22));
Boolean windDir = getAirTemp(user.getWindDir());
System.out.println(windDir);
}
/**
* @description: 判断风向是否在范围内,不在返回true BigDecimal、
* 风向的范围 0到360
* */
public static Boolean getWindDir(BigDecimal bigDecimal){
if(bigDecimal!=null){
// 进行比较
BigDecimal zeroinfo = new BigDecimal(0);
BigDecimal threell = new BigDecimal(360);
if(bigDecimal.compareTo(zeroinfo) >=0 && bigDecimal.compareTo(threell) <0){
return false;
// 如果 传过来的 在 0 到 360 之间
}else {
return true;
}
}
return true;
}
//
/**
* @description: 判断本站气压 是否在范围内,不在返回true BigDecimal
* 400 到 1080
* */
public static Boolean getStaPress(BigDecimal bigDecimal){
if(bigDecimal!=null){
// 进行比较
BigDecimal zeroinfo = new BigDecimal(400);
BigDecimal threell = new BigDecimal(1080);
if(bigDecimal.compareTo(zeroinfo) >=0 && bigDecimal.compareTo(threell) <0){
return false;
// 如果 传过来的 在 400 到 1080 之间
}else {
return true;
}
}
return true;
}
//
/**
* @description: 判断气温 是否在范围内,不在返回true
* -75 到 80
* */
public static Boolean getAirTemp(BigDecimal bigDecimal){
if(bigDecimal!=null){
// 进行比较
BigDecimal zeroinfo = new BigDecimal(-75);
BigDecimal threell = new BigDecimal(80);
if(bigDecimal.compareTo(zeroinfo) >=0 && bigDecimal.compareTo(threell) <0){
return false;
// 如果 传过来的 在 -75 到 80 之间
}else {
return true;
}
}
return true;
}
//
/**
* @description: 判断风速 是否在范围内,不在返回true
* 0 到 75
* */
public static Boolean getWindSpd(BigDecimal bigDecimal){
if(bigDecimal!=null){
// 进行比较
BigDecimal zeroinfo = new BigDecimal(0);
BigDecimal threell = new BigDecimal(75);
if(bigDecimal.compareTo(zeroinfo) >=0 && bigDecimal.compareTo(threell) <0){
return false;
// 如果 传过来的 在 -75 到 80 之间
}else {
return true;
}
}
return true;
}
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有