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