|
@@ -314,8 +314,8 @@ public class ThresholdService {
|
|
|
for (KwsThreshold threshold : kwsThreshold) {
|
|
for (KwsThreshold threshold : kwsThreshold) {
|
|
|
ThresholdBean bean = new ThresholdBean();
|
|
ThresholdBean bean = new ThresholdBean();
|
|
|
bean.setLevel(threshold.getLevel());
|
|
bean.setLevel(threshold.getLevel());
|
|
|
- bean.setMax(Integer.valueOf(threshold.getMax()));
|
|
|
|
|
- bean.setMin(Integer.valueOf(threshold.getMin()));
|
|
|
|
|
|
|
+ bean.setMax(threshold.getMax());
|
|
|
|
|
+ bean.setMin(threshold.getMin());
|
|
|
beanList.add(bean);
|
|
beanList.add(bean);
|
|
|
}
|
|
}
|
|
|
vo.setThreshold(beanList);
|
|
vo.setThreshold(beanList);
|
|
@@ -342,7 +342,7 @@ public class ThresholdService {
|
|
|
}
|
|
}
|
|
|
//页面阈值等级校验
|
|
//页面阈值等级校验
|
|
|
//当前使用阈值123级硬编码校验
|
|
//当前使用阈值123级硬编码校验
|
|
|
- checkThresholdLevel(configurationDTO, headerData);
|
|
|
|
|
|
|
+ //checkThresholdLevel(configurationDTO, headerData);
|
|
|
//后期阈值等级扩容可调用此方法
|
|
//后期阈值等级扩容可调用此方法
|
|
|
//checkLevelMax(threshold, configurationDTO, headerData);
|
|
//checkLevelMax(threshold, configurationDTO, headerData);
|
|
|
for (ThresholdBean thresholdBean : threshold) {
|
|
for (ThresholdBean thresholdBean : threshold) {
|
|
@@ -420,24 +420,24 @@ public class ThresholdService {
|
|
|
String min = twoKwsThreshold.getMin();
|
|
String min = twoKwsThreshold.getMin();
|
|
|
if (min.contains("-")) {
|
|
if (min.contains("-")) {
|
|
|
// min = StringUtils.deleteCharString(min, "-");
|
|
// min = StringUtils.deleteCharString(min, "-");
|
|
|
- if (Long.parseLong(min) < thresholdBean.getMin()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(min) < Double.parseDouble(thresholdBean.getMin())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMin(), min);
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMin(), min);
|
|
|
throw new BusinessException("一级最小值阈值设置数据填写错误");
|
|
throw new BusinessException("一级最小值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (Long.parseLong(min) > thresholdBean.getMin()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(min) > Double.parseDouble(thresholdBean.getMin())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMin(), min);
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMin(), min);
|
|
|
throw new BusinessException("一级最小值阈值设置数据填写错误");
|
|
throw new BusinessException("一级最小值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
String max = twoKwsThreshold.getMax();
|
|
String max = twoKwsThreshold.getMax();
|
|
|
if (max.contains("-")) {
|
|
if (max.contains("-")) {
|
|
|
- if (Long.parseLong(max) > thresholdBean.getMax()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMax(), max);
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMax(), max);
|
|
|
throw new BusinessException("一级最大值阈值设置数据填写错误");
|
|
throw new BusinessException("一级最大值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (Long.parseLong(max) > thresholdBean.getMax()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMax(), max);
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMax(), max);
|
|
|
throw new BusinessException("一级最大值阈值设置数据填写错误");
|
|
throw new BusinessException("一级最大值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
@@ -446,24 +446,24 @@ public class ThresholdService {
|
|
|
if (threeKwsThreshold != null) {
|
|
if (threeKwsThreshold != null) {
|
|
|
String min = threeKwsThreshold.getMin();
|
|
String min = threeKwsThreshold.getMin();
|
|
|
if (min.contains("-")) {
|
|
if (min.contains("-")) {
|
|
|
- if (Long.parseLong(min) < thresholdBean.getMin()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(min) < Double.parseDouble(thresholdBean.getMin())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMin(), min);
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMin(), min);
|
|
|
throw new BusinessException("一级最小值阈值设置数据填写错误");
|
|
throw new BusinessException("一级最小值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (Long.parseLong(min) < thresholdBean.getMin()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(min) < Double.parseDouble(thresholdBean.getMin())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMin(), min);
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMin(), min);
|
|
|
throw new BusinessException("一级最小值阈值设置数据填写错误");
|
|
throw new BusinessException("一级最小值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
String max = threeKwsThreshold.getMax();
|
|
String max = threeKwsThreshold.getMax();
|
|
|
if (max.contains("-")) {
|
|
if (max.contains("-")) {
|
|
|
- if (Long.parseLong(max) > thresholdBean.getMax()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMax(), max);
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMax(), max);
|
|
|
throw new BusinessException("一级最大值阈值设置数据填写错误");
|
|
throw new BusinessException("一级最大值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (Long.parseLong(max) > thresholdBean.getMax()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMax(), max);
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMax(), max);
|
|
|
throw new BusinessException("一级最大值阈值设置数据填写错误");
|
|
throw new BusinessException("一级最大值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
@@ -476,12 +476,12 @@ public class ThresholdService {
|
|
|
String min = oneKwsThreshold.getMin();
|
|
String min = oneKwsThreshold.getMin();
|
|
|
if (min.contains("-")) {
|
|
if (min.contains("-")) {
|
|
|
// min = StringUtils.deleteCharString(min, "-");
|
|
// min = StringUtils.deleteCharString(min, "-");
|
|
|
- if (Long.parseLong(min) > thresholdBean.getMin()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(min) > Double.parseDouble(thresholdBean.getMin())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMin(), min);
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMin(), min);
|
|
|
throw new BusinessException("二级最小值阈值设置数据填写错误");
|
|
throw new BusinessException("二级最小值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (Long.parseLong(min) > thresholdBean.getMin()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(min) > Double.parseDouble(thresholdBean.getMin())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMin(), min);
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMin(), min);
|
|
|
throw new BusinessException("阈值设置数据填写错误");
|
|
throw new BusinessException("阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
@@ -489,12 +489,12 @@ public class ThresholdService {
|
|
|
String max = oneKwsThreshold.getMax();
|
|
String max = oneKwsThreshold.getMax();
|
|
|
if (max.contains("-")) {
|
|
if (max.contains("-")) {
|
|
|
// min = StringUtils.deleteCharString(min, "-");
|
|
// min = StringUtils.deleteCharString(min, "-");
|
|
|
- if (Long.parseLong(max) > thresholdBean.getMax()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMax(), max);
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMax(), max);
|
|
|
throw new BusinessException("阈值设置数据填写错误");
|
|
throw new BusinessException("阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (Long.parseLong(max) < thresholdBean.getMax()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(max) < Double.parseDouble(thresholdBean.getMax())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMax(), max);
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMax(), max);
|
|
|
throw new BusinessException("阈值设置数据填写错误");
|
|
throw new BusinessException("阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
@@ -503,24 +503,24 @@ public class ThresholdService {
|
|
|
if (threeKwsThreshold != null) {
|
|
if (threeKwsThreshold != null) {
|
|
|
String min = threeKwsThreshold.getMin();
|
|
String min = threeKwsThreshold.getMin();
|
|
|
if (min.contains("-")) {
|
|
if (min.contains("-")) {
|
|
|
- if (Long.parseLong(min) < thresholdBean.getMin()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(min) < Double.parseDouble(thresholdBean.getMin())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMin(), min);
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMin(), min);
|
|
|
throw new BusinessException("二级最小级阈值设置数据填写错误");
|
|
throw new BusinessException("二级最小级阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (Long.parseLong(min) < thresholdBean.getMin()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(min) < Double.parseDouble(thresholdBean.getMin())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMin(), min);
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMin(), min);
|
|
|
throw new BusinessException("二级最小级阈值设置数据填写错误");
|
|
throw new BusinessException("二级最小级阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
String max = threeKwsThreshold.getMax();
|
|
String max = threeKwsThreshold.getMax();
|
|
|
if (max.contains("-")) {
|
|
if (max.contains("-")) {
|
|
|
- if (Long.parseLong(max) > thresholdBean.getMax()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMax(), max);
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMax(), max);
|
|
|
throw new BusinessException("二级最大值阈值设置数据填写错误");
|
|
throw new BusinessException("二级最大值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (Long.parseLong(max) > thresholdBean.getMax()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(max) > Double.parseDouble(thresholdBean.getMax())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMax(), max);
|
|
log.error("当前等级:{},当前设置阈值:{},存在三级阈值:{}", level, thresholdBean.getMax(), max);
|
|
|
throw new BusinessException("二级最大值阈值设置数据填写错误");
|
|
throw new BusinessException("二级最大值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
@@ -532,24 +532,24 @@ public class ThresholdService {
|
|
|
if (oneKwsThreshold != null) {
|
|
if (oneKwsThreshold != null) {
|
|
|
String min = oneKwsThreshold.getMin();
|
|
String min = oneKwsThreshold.getMin();
|
|
|
if (min.contains("-")) {
|
|
if (min.contains("-")) {
|
|
|
- if (Long.parseLong(min) > thresholdBean.getMin()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(min) > Double.parseDouble(thresholdBean.getMin())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMin(), min);
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMin(), min);
|
|
|
throw new BusinessException("三级最小值阈值设置数据填写错误");
|
|
throw new BusinessException("三级最小值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (Long.parseLong(min) < thresholdBean.getMin()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(min) < Double.parseDouble(thresholdBean.getMin())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMin(), min);
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMin(), min);
|
|
|
throw new BusinessException("三级最小值阈值设置数据填写错误");
|
|
throw new BusinessException("三级最小值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
String max = oneKwsThreshold.getMax();
|
|
String max = oneKwsThreshold.getMax();
|
|
|
if (max.contains("-")) {
|
|
if (max.contains("-")) {
|
|
|
- if (Long.parseLong(max) < thresholdBean.getMax()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(max) < Double.parseDouble(thresholdBean.getMax())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMax(), max);
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMax(), max);
|
|
|
throw new BusinessException("三级最大值阈值设置数据填写错误");
|
|
throw new BusinessException("三级最大值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (Long.parseLong(max) < thresholdBean.getMax()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(max) < Double.parseDouble(thresholdBean.getMax())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMax(), max);
|
|
log.error("当前等级:{},当前设置阈值:{},存在一级阈值:{}", level, thresholdBean.getMax(), max);
|
|
|
throw new BusinessException("三级最大值阈值设置数据填写错误");
|
|
throw new BusinessException("三级最大值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
@@ -558,24 +558,24 @@ public class ThresholdService {
|
|
|
if (twoKwsThreshold != null) {
|
|
if (twoKwsThreshold != null) {
|
|
|
String min = twoKwsThreshold.getMin();
|
|
String min = twoKwsThreshold.getMin();
|
|
|
if (min.contains("-")) {
|
|
if (min.contains("-")) {
|
|
|
- if (Long.parseLong(min) > thresholdBean.getMin()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(min) > Double.parseDouble(thresholdBean.getMin())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMin(), min);
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMin(), min);
|
|
|
throw new BusinessException("三级最小值阈值设置数据填写错误");
|
|
throw new BusinessException("三级最小值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (Long.parseLong(min) > thresholdBean.getMin()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(min) > Double.parseDouble(thresholdBean.getMin())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMin(), min);
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMin(), min);
|
|
|
throw new BusinessException("三级最小值阈值设置数据填写错误");
|
|
throw new BusinessException("三级最小值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
String max = twoKwsThreshold.getMax();
|
|
String max = twoKwsThreshold.getMax();
|
|
|
if (max.contains("-")) {
|
|
if (max.contains("-")) {
|
|
|
- if (thresholdBean.getMax() > Long.parseLong(max)) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(thresholdBean.getMax()) > Double.parseDouble(max)) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMax(), max);
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMax(), max);
|
|
|
throw new BusinessException("三级最大值阈值设置数据填写错误");
|
|
throw new BusinessException("三级最大值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (Long.parseLong(max) < thresholdBean.getMax()) {
|
|
|
|
|
|
|
+ if (Double.parseDouble(max) < Double.parseDouble(thresholdBean.getMax())) {
|
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMax(), max);
|
|
log.error("当前等级:{},当前设置阈值:{},存在二级阈值:{}", level, thresholdBean.getMax(), max);
|
|
|
throw new BusinessException("三级最大值阈值设置数据填写错误");
|
|
throw new BusinessException("三级最大值阈值设置数据填写错误");
|
|
|
}
|
|
}
|
|
@@ -605,21 +605,21 @@ public class ThresholdService {
|
|
|
String min = String.valueOf(thresholdBeanTwo.getMin());//10
|
|
String min = String.valueOf(thresholdBeanTwo.getMin());//10
|
|
|
String max = String.valueOf(thresholdBeanTwo.getMax());//90
|
|
String max = String.valueOf(thresholdBeanTwo.getMax());//90
|
|
|
if (thresholdBeanThree != null) {
|
|
if (thresholdBeanThree != null) {
|
|
|
- long minThree = thresholdBeanThree.getMin();//8
|
|
|
|
|
|
|
+ double minThree = Double.parseDouble(thresholdBeanThree.getMin());//8
|
|
|
// if (minThree.contains("-")) {
|
|
// if (minThree.contains("-")) {
|
|
|
// minThree = com.sckw.core.utils.StringUtils.deleteCharString(minThree, "-");//-8
|
|
// minThree = com.sckw.core.utils.StringUtils.deleteCharString(minThree, "-");//-8
|
|
|
// }
|
|
// }
|
|
|
- long maxThree = thresholdBeanThree.getMax();//80
|
|
|
|
|
- if (BigDecimal.valueOf(Long.parseLong(max)).compareTo(BigDecimal.valueOf(maxThree)) < 0) {
|
|
|
|
|
|
|
+ double maxThree = Double.parseDouble(thresholdBeanThree.getMax());//80
|
|
|
|
|
+ if (max.compareTo(String.valueOf(maxThree)) < 0) {
|
|
|
throw new BusinessException("阈值填写错误");
|
|
throw new BusinessException("阈值填写错误");
|
|
|
}
|
|
}
|
|
|
if (min.contains("-")) {
|
|
if (min.contains("-")) {
|
|
|
// min = com.sckw.core.utils.StringUtils.deleteCharString(min, "-");//-10
|
|
// min = com.sckw.core.utils.StringUtils.deleteCharString(min, "-");//-10
|
|
|
- if (BigDecimal.valueOf(Long.parseLong(min)).compareTo(BigDecimal.valueOf(minThree)) > 0) {
|
|
|
|
|
|
|
+ if (min.compareTo(String.valueOf(maxThree)) > 0) {
|
|
|
throw new BusinessException("阈值填写错误");
|
|
throw new BusinessException("阈值填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (BigDecimal.valueOf(Long.parseLong(min)).compareTo(BigDecimal.valueOf(minThree)) > 0) {
|
|
|
|
|
|
|
+ if (min.compareTo(String.valueOf(maxThree)) > 0) {
|
|
|
throw new BusinessException("阈值填写错误");
|
|
throw new BusinessException("阈值填写错误");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -628,16 +628,16 @@ public class ThresholdService {
|
|
|
if (thresholdBeanOne != null) {
|
|
if (thresholdBeanOne != null) {
|
|
|
String minOne = String.valueOf(thresholdBeanOne.getMin()); //15
|
|
String minOne = String.valueOf(thresholdBeanOne.getMin()); //15
|
|
|
String maxThree = String.valueOf(thresholdBeanOne.getMax());//100
|
|
String maxThree = String.valueOf(thresholdBeanOne.getMax());//100
|
|
|
- if (BigDecimal.valueOf(Long.parseLong(max)).compareTo(BigDecimal.valueOf(Long.parseLong(maxThree))) > 0) {
|
|
|
|
|
|
|
+ if (max.compareTo(maxThree) > 0) {
|
|
|
throw new BusinessException("阈值填写错误");
|
|
throw new BusinessException("阈值填写错误");
|
|
|
}
|
|
}
|
|
|
if (minOne.contains("-")) {
|
|
if (minOne.contains("-")) {
|
|
|
// minOne = com.sckw.core.utils.StringUtils.deleteCharString(minOne, "-");//-15
|
|
// minOne = com.sckw.core.utils.StringUtils.deleteCharString(minOne, "-");//-15
|
|
|
- if (BigDecimal.valueOf(Long.parseLong(min)).compareTo(BigDecimal.valueOf(Long.parseLong(minOne))) < 0) {
|
|
|
|
|
|
|
+ if (min.compareTo(minOne) < 0) {
|
|
|
throw new BusinessException("阈值填写错误");
|
|
throw new BusinessException("阈值填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (BigDecimal.valueOf(Long.parseLong(min)).compareTo(BigDecimal.valueOf(Long.parseLong(minOne))) < 0) {
|
|
|
|
|
|
|
+ if (min.compareTo(minOne) < 0) {
|
|
|
throw new BusinessException("阈值填写错误");
|
|
throw new BusinessException("阈值填写错误");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -647,18 +647,18 @@ public class ThresholdService {
|
|
|
String minThree = String.valueOf(thresholdBeanThree.getMin());//8
|
|
String minThree = String.valueOf(thresholdBeanThree.getMin());//8
|
|
|
String maxThree = String.valueOf(thresholdBeanThree.getMax());//80
|
|
String maxThree = String.valueOf(thresholdBeanThree.getMax());//80
|
|
|
if (thresholdBeanTwo != null) {
|
|
if (thresholdBeanTwo != null) {
|
|
|
- long twoMax = thresholdBeanTwo.getMax();//90
|
|
|
|
|
- long twoMin = thresholdBeanTwo.getMin();//-10
|
|
|
|
|
- if (BigDecimal.valueOf(twoMax).compareTo(BigDecimal.valueOf(Long.parseLong(maxThree))) < 0) {
|
|
|
|
|
|
|
+ double twoMax = Double.parseDouble(thresholdBeanTwo.getMax());//90
|
|
|
|
|
+ double twoMin = Double.parseDouble(thresholdBeanTwo.getMin());//-10
|
|
|
|
|
+ if (String.valueOf(twoMax).compareTo(maxThree) < 0) {
|
|
|
throw new BusinessException("阈值填写错误");
|
|
throw new BusinessException("阈值填写错误");
|
|
|
}
|
|
}
|
|
|
if (minThree.contains("-")) {
|
|
if (minThree.contains("-")) {
|
|
|
// minThree = com.sckw.core.utils.StringUtils.deleteCharString(minThree, "-");//-8
|
|
// minThree = com.sckw.core.utils.StringUtils.deleteCharString(minThree, "-");//-8
|
|
|
- if (BigDecimal.valueOf(twoMin).compareTo(BigDecimal.valueOf(Long.parseLong(minThree))) > 0) {
|
|
|
|
|
|
|
+ if (String.valueOf(twoMin).compareTo(minThree) > 0) {
|
|
|
throw new BusinessException("阈值填写错误");
|
|
throw new BusinessException("阈值填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (BigDecimal.valueOf(twoMin).compareTo(BigDecimal.valueOf(Long.parseLong(minThree))) > 0) {
|
|
|
|
|
|
|
+ if (String.valueOf(twoMin).compareTo(minThree) > 0) {
|
|
|
throw new BusinessException("阈值填写错误");
|
|
throw new BusinessException("阈值填写错误");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -670,16 +670,16 @@ public class ThresholdService {
|
|
|
if (thresholdBeanOne != null) {
|
|
if (thresholdBeanOne != null) {
|
|
|
String oneMax = String.valueOf(thresholdBeanOne.getMax());//100
|
|
String oneMax = String.valueOf(thresholdBeanOne.getMax());//100
|
|
|
String oneMin = String.valueOf(thresholdBeanOne.getMin());//-15
|
|
String oneMin = String.valueOf(thresholdBeanOne.getMin());//-15
|
|
|
- if (BigDecimal.valueOf(Long.parseLong(oneMax)).compareTo(BigDecimal.valueOf(Long.parseLong(maxThree))) < 0) {
|
|
|
|
|
|
|
+ if (oneMax.compareTo(maxThree) < 0) {
|
|
|
throw new BusinessException("阈值填写错误");
|
|
throw new BusinessException("阈值填写错误");
|
|
|
}
|
|
}
|
|
|
if (oneMin.contains("-")) {
|
|
if (oneMin.contains("-")) {
|
|
|
// oneMin = com.sckw.core.utils.StringUtils.deleteCharString(oneMin, "-");//-8
|
|
// oneMin = com.sckw.core.utils.StringUtils.deleteCharString(oneMin, "-");//-8
|
|
|
- if (BigDecimal.valueOf(Long.parseLong(oneMin)).compareTo(BigDecimal.valueOf(Long.parseLong(minThree))) > 0) {
|
|
|
|
|
|
|
+ if (oneMax.compareTo(maxThree) > 0) {
|
|
|
throw new BusinessException("阈值填写错误");
|
|
throw new BusinessException("阈值填写错误");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (BigDecimal.valueOf(Long.parseLong(oneMin)).compareTo(BigDecimal.valueOf(Long.parseLong(minThree))) > 0) {
|
|
|
|
|
|
|
+ if (oneMin.compareTo(minThree) > 0) {
|
|
|
throw new BusinessException("阈值填写错误");
|
|
throw new BusinessException("阈值填写错误");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -706,7 +706,7 @@ public class ThresholdService {
|
|
|
if (min.contains("-")) {
|
|
if (min.contains("-")) {
|
|
|
min = com.sckw.core.utils.StringUtils.deleteCharString(min, "-");
|
|
min = com.sckw.core.utils.StringUtils.deleteCharString(min, "-");
|
|
|
}
|
|
}
|
|
|
- if (BigDecimal.valueOf(Long.parseLong(max)).compareTo(BigDecimal.valueOf(thresholdBean.getMax())) > 0) {
|
|
|
|
|
|
|
+ if (BigDecimal.valueOf(Long.parseLong(max)).compareTo(BigDecimal.valueOf(Double.parseDouble(thresholdBean.getMax()))) > 0) {
|
|
|
throw new BusinessException("阈值填写错误");
|
|
throw new BusinessException("阈值填写错误");
|
|
|
}
|
|
}
|
|
|
if (BigDecimal.valueOf(Long.parseLong(min)).compareTo(BigDecimal.valueOf(Long.parseLong(thresholdBeanMin))) < 0) {
|
|
if (BigDecimal.valueOf(Long.parseLong(min)).compareTo(BigDecimal.valueOf(Long.parseLong(thresholdBeanMin))) < 0) {
|
|
@@ -721,8 +721,8 @@ public class ThresholdService {
|
|
|
int levelMax = level + 1;
|
|
int levelMax = level + 1;
|
|
|
int levelMin = level - 1;
|
|
int levelMin = level - 1;
|
|
|
if (maps.get(levelMax) != null) {
|
|
if (maps.get(levelMax) != null) {
|
|
|
- long min = value.getMin();
|
|
|
|
|
- long max = value.getMax();
|
|
|
|
|
|
|
+ double min = Double.parseDouble(value.getMin());
|
|
|
|
|
+ double max = Double.parseDouble(value.getMax());
|
|
|
}
|
|
}
|
|
|
if (maps.get(levelMin) != null) {
|
|
if (maps.get(levelMin) != null) {
|
|
|
|
|
|