|
@@ -49,7 +49,8 @@ public class DingdingService {
|
|
|
BigDecimal dbCount = new BigDecimal(size);
|
|
|
|
|
|
BigDecimal divideCount = dbCount.divide(totalCount,2,RoundingMode.HALF_DOWN);
|
|
|
- BigDecimal thresholdCount = new BigDecimal(this.threshold).setScale(2,RoundingMode.HALF_DOWN);
|
|
|
+ BigDecimal thresholdCount = new BigDecimal(threshold).setScale(2,RoundingMode.HALF_DOWN);
|
|
|
+ log.info("modelThreshold--{},{},{},{}",threshold,divideCount,thresholdCount,divideCount.compareTo(thresholdCount));
|
|
|
if(divideCount.compareTo(thresholdCount) >= 0 ){
|
|
|
this.sendDingDingMsg(size);
|
|
|
}
|
|
@@ -59,16 +60,4 @@ public class DingdingService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
- BigDecimal totalCount = new BigDecimal(5);
|
|
|
- BigDecimal dbCount = new BigDecimal(4);
|
|
|
-
|
|
|
- BigDecimal divideCount = dbCount.divide(totalCount,2,RoundingMode.HALF_DOWN);
|
|
|
- System.out.println(divideCount);
|
|
|
- BigDecimal thresholdCount = new BigDecimal(0.8).setScale(2,RoundingMode.HALF_DOWN);
|
|
|
- System.out.println(thresholdCount);
|
|
|
- if(divideCount.compareTo(thresholdCount) >= 0 ){
|
|
|
- System.out.println(1);
|
|
|
- }
|
|
|
- }
|
|
|
}
|