|
@@ -1,6 +1,7 @@
|
|
|
package com.fdkankan.manage.task;
|
|
|
|
|
|
import com.fdkankan.dingtalk.DingTalkSendUtils;
|
|
|
+import com.fdkankan.manage.config.NacosScopeConfig;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -27,8 +28,6 @@ public class DingdingService {
|
|
|
|
|
|
@Value("${main.url}")
|
|
|
String mainUrl;
|
|
|
- @Value("${dingtalk.threshold:0.2}")
|
|
|
- String threshold;
|
|
|
|
|
|
public void sendDingDingMsg(Integer count){
|
|
|
try {
|
|
@@ -49,8 +48,8 @@ public class DingdingService {
|
|
|
BigDecimal dbCount = new BigDecimal(size);
|
|
|
|
|
|
BigDecimal divideCount = dbCount.divide(totalCount,2,RoundingMode.HALF_DOWN);
|
|
|
- BigDecimal thresholdCount = new BigDecimal(threshold).setScale(2,RoundingMode.HALF_DOWN);
|
|
|
- log.info("modelThreshold--{},{},{},{}",threshold,divideCount,thresholdCount,divideCount.compareTo(thresholdCount));
|
|
|
+ BigDecimal thresholdCount = new BigDecimal(NacosScopeConfig.threshold).setScale(2,RoundingMode.HALF_DOWN);
|
|
|
+ log.info("modelThreshold--{},{},{},{}",NacosScopeConfig.threshold,divideCount,thresholdCount,divideCount.compareTo(thresholdCount));
|
|
|
if(divideCount.compareTo(thresholdCount) >= 0 ){
|
|
|
this.sendDingDingMsg(size);
|
|
|
}
|