|
|
@@ -115,7 +115,8 @@ public class GZPlatformSettingService implements IGZPlatformSettingService { |
|
|
|
IotApiWhiteList whiteList = new IotApiWhiteList(); |
|
|
|
whiteList.setSerialNo(imei); |
|
|
|
if(dbConfig.getAffectionPhone() == null || !dbConfig.getAffectionPhone().equals(config.getAffectionPhone()) || |
|
|
|
dbConfig.getAddressBook() == null || !dbConfig.getAddressBook().equals(config.getAddressBook())){ |
|
|
|
dbConfig.getAddressBook() == null || !dbConfig.getAddressBook().equals(config.getAddressBook()) || |
|
|
|
dbConfig.getWhitePhone() == null || !dbConfig.getWhitePhone().equals(config.getWhiteList())){ |
|
|
|
// if(true){ |
|
|
|
// SOS |
|
|
|
String sos = config.getSosPhone(); |
|
|
@@ -161,6 +162,17 @@ public class GZPlatformSettingService implements IGZPlatformSettingService { |
|
|
|
hadSos = hadSos ? hadSos : isSos; |
|
|
|
whiteList.addPhone(aphone, relationship, "", (isSos? 1 : 0)); |
|
|
|
} |
|
|
|
// 允许呼入 |
|
|
|
String whitePhone = config.getWhiteList(); |
|
|
|
phones = whitePhone.split(","); |
|
|
|
for (int i = 0; i < phones.length; i++) { |
|
|
|
String aphone = phones[i]; |
|
|
|
if(!Strings.isNullOrEmpty(aphone) && aphone.indexOf("*") < 0){ |
|
|
|
isSos = aphone.equals(sos); |
|
|
|
hadSos = hadSos ? hadSos : isSos; |
|
|
|
whiteList.addPhone(aphone, "", "", 2, 3, (isSos? 1 : 0)); |
|
|
|
} |
|
|
|
} |
|
|
|
// sos不在通讯录或亲情号码中,则另外加入白名单 |
|
|
|
if(!hadSos){ |
|
|
|
whiteList.addPhone(sos, "", "", 1); |
|
|
@@ -174,11 +186,6 @@ public class GZPlatformSettingService implements IGZPlatformSettingService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(allSuccess){ |
|
|
|
// 存入数据库 |
|
|
|
dbConfig.setDeviceImei(imei); |
|
|
|