Browse Source

添加日志

yq 3 years ago
parent
commit
c79d835358

+ 1 - 0
mhfire-service/src/main/java/com/bizmatics/mhfire/service/api/AlertAndSiteApi.java

@@ -94,6 +94,7 @@ public class AlertAndSiteApi {
         header.put("Authorization",token);
         try {
             String result = HttpUtils.postJson(ALERT_URL, params, header);
+            log.info("alertjob---------获取到的数据"+result);
             JsonNode arrNode = MAPPER.readTree(result);
             if ("200".equals(arrNode.get("code").asText())){
                 JsonNode data = arrNode.get("data");

+ 1 - 3
mhfire-service/src/main/java/com/bizmatics/mhfire/service/job/AlertJob.java

@@ -55,7 +55,6 @@ public class AlertJob{
 
     public void executeCore(Integer page,Integer size,Date startTime,Date endTime,String token){
         boolean nextFlag = true;
-        int count = 0;
         while (StringUtils.isNotBlank(token) && nextFlag){
             try {
                 long l = System.currentTimeMillis();
@@ -65,7 +64,6 @@ public class AlertJob{
                 if (null != startTime && null != endTime){
                     alerts = alerts.stream().filter(alert -> DateUtils.isEffectiveDate(alert.getDcsj(), startTime, endTime)).collect(Collectors.toList());
                 }
-                count+=alerts.size();
                 if (CollectionUtils.isNotEmpty(alerts)){
                     alertService.saveOrUpdateBatch(alerts);
                     page++;
@@ -78,6 +76,6 @@ public class AlertJob{
                 log.info("alertJob----异常"+e.getMessage());
             }
         }
-        log.info("alertJob----完成,获取警情记录:"+ count);
+        log.info("获取警情定时任务完成----完成");
     }
 }