Ver código fonte

定时任务

Jxing 6 anos atrás
pai
commit
8bbf02708e

+ 5 - 3
src/main/java/com/sagacloud/route/processors/PeriodTask/StatisticsProcessor.java

@@ -42,9 +42,11 @@ public class StatisticsProcessor implements Processor {
         addContractCount(venderStatisticsMap, contracts);
         addContractCount(venderStatisticsMap, warranties);
         ProjectStatistics ps = new ProjectStatistics();
-        if(venderStatisticsMap.size() == 0)
-            return;
-        ps.setCriterias(new ArrayList<>(venderStatisticsMap.values()));
+        if(venderStatisticsMap.size() == 0){
+            ps.setCriterias(new ArrayList<>());
+        }else {
+            ps.setCriterias(new ArrayList<>(venderStatisticsMap.values()));
+        }
         ps.setProjectId(projectId);
         exchange.getIn().setBody(JSONObject.toJSONString(ps));
         exchange.getIn().setHeader(Exchange.HTTP_URI, String.join("", InitEnvRoute.venders, "/auxiliary/property/create_by_project?method=POST"));