bin 3 лет назад
Родитель
Сommit
1038656e61
1 измененных файлов: 10 добавлений и 9 удалений
  1. +10
    -9
      src/main/java/com/ssjl/zhaobiao/guizhou/service/impl/GZPlatformSettingService.java

+ 10
- 9
src/main/java/com/ssjl/zhaobiao/guizhou/service/impl/GZPlatformSettingService.java Просмотреть файл

@@ -76,8 +76,8 @@ public class GZPlatformSettingService implements IGZPlatformSettingService {
// 休眠免打扰时间
if(dbConfig.getSleepTime() == null || !dbConfig.getSleepTime().equals(config.getSleepTime())){
// if(true){
IotApiSleepTime sleepTime = new IotApiSleepTime();
sleepTime.setSerialNo(imei);
//IotApiSleepTime sleepTime = new IotApiSleepTime();
//sleepTime.setSerialNo(imei);
IotApiNotDisturb notDisturb = new IotApiNotDisturb();
notDisturb.setSerialNo(imei);
String[] strs = config.getSleepTime().split(",");
@@ -91,19 +91,20 @@ public class GZPlatformSettingService implements IGZPlatformSettingService {
String timeSet = times[1];
String startTime = timeSet.substring(0, 2) +":" + timeSet.substring(2, 4);
String endTime = timeSet.substring(4, 6) +":" + timeSet.substring(6, 8);
sleepTime.addTime(startTime, endTime, times[0]);
//sleepTime.addTime(startTime, endTime, times[0]);
notDisturb.addItem(startTime, endTime, 0, 1, times[0]);
// for (int j = 0; j < times[0].length(); j++) {
// char day = times[0].charAt(j);
// sleepTime.addTime(startTime, endTime, String.valueOf(day));
// }
}
System.out.println(JSON.toJSONString(sleepTime));
IotApiResponse rs = iotApiUtil.setSleepTime(sleepTime);
System.out.println(JSON.toJSONString(rs));
if(checkOffline(rs.getMessage())){
allSuccess = false;
}
//System.out.println(JSON.toJSONString(sleepTime));
// 不能设置休眠时间
// IotApiResponse rs = iotApiUtil.setSleepTime(sleepTime);
// System.out.println(JSON.toJSONString(rs));
// if(checkOffline(rs.getMessage())){
// allSuccess = false;
// }
IotApiResponse rs1 = iotApiUtil.setNotDisturb(notDisturb);
System.out.println(JSON.toJSONString(rs1));
if(checkOffline(rs1.getMessage())){


Загрузка…
Отмена
Сохранить