Browse Source

Merge branch '20200918' of http://114.135.61.188:53000/ZONIOT/water-iot into 20200918

oppadmin 4 years ago
parent
commit
d1e619d569

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/commom/util/jsonSerializer/ValveStateJsonSerializer.java

@@ -18,7 +18,7 @@ public class ValveStateJsonSerializer extends JsonSerializer<String> {
     @Override
     public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
         if(value != null && value .equals("0")){
-            gen.writeString("阀");
+            gen.writeString("阀");
         }else
         if(value != null && value .equals("1")){
             gen.writeString("阀开");

+ 6 - 2
smart-city-platform/src/main/java/com/bz/smart_city/quartz/service/impl/EstimatedDayServiceImpl.java

@@ -57,11 +57,15 @@ public class EstimatedDayServiceImpl implements EstimatedDayService, Initializin
         // modify by pengdi ,判断定时任务是否存在,不存在才进行新增
 
         boolean exists = jobAndTriggerService.isExists(entity);
-        if(!exists) {
+        if(exists)
+            //先删除之前Job
+            jobAndTriggerService.deleteJob(entity);
+
+        if(true) {
             //String cron = "0 */2 * * * ?";
             //String cron = "0 0 0 * * ?";
             //String cron = "0 0 15 * * ?";
-            String cron = String.format("%s %s %s * * ?",0,0,10);
+            String cron = String.format("%s %s %s * * ?",0,30,0);
             log.info("预计费每天统计:" + cron);
             log.info("预计费每天统计:" + "站点ID:"+siteId+"水司ID:"+customerId);
             entity.setCronExpression(cron);