lyhzzz 1 éve
szülő
commit
6d1e7c5478

+ 4 - 3
src/main/java/com/fdkankan/manage/task/DingdingService.java

@@ -1,7 +1,6 @@
 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;
@@ -28,6 +27,8 @@ public class DingdingService {
 
     @Value("${main.url}")
     String mainUrl;
+    @Value("${dingtalk.threshold:0.2}")
+    String threshold;
 
     public void sendDingDingMsg(Integer count){
         try {
@@ -48,8 +49,8 @@ public class DingdingService {
             BigDecimal dbCount = new BigDecimal(size);
 
             BigDecimal divideCount = dbCount.divide(totalCount,2,RoundingMode.HALF_DOWN);
-            BigDecimal thresholdCount = new BigDecimal(NacosScopeConfig.threshold).setScale(2,RoundingMode.HALF_DOWN);
-            log.info("modelThreshold--{},{},{},{}",NacosScopeConfig.threshold,divideCount,thresholdCount,divideCount.compareTo(thresholdCount));
+            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);
             }