设置运维时间表数据判断修改

serial
liuguijing 1 year ago
parent 65c858ba1b
commit 4445591a12

@ -72,47 +72,46 @@ public class SimUtil {
sendmessage = content + " OK";
sendtype = SmsTypeEnum.REBOOT2.value();
} else if (content.contains(SmsTypeEnum.SET_YW_SCHEDULE.value())) {
ifmessageCorrect = true;
String[] split1 = StringUtils.splitString1(content);
if (split1 != null && split1.length > 1) {
if (split1 != null && split1.length == 2) {
String s = split1[1];
String[] split2 = StringUtils.splitString2(s);
if (split2 != null && split2.length >= 1) {
int length = split2.length;
if (length % 2 == 1) {
String num = split2[0];
Integer integer = StringUtils.convert2Int(num);
if (integer != null) {
if (integer == 0) {//删除所有运维
ifmessageCorrect = true;
} else {
if (length == integer + 1) {
int times = 0;
for (int i = 0; i < split2.length; i++) {
if (i == 0) {
continue;
int spilt2len = split2.length;
if (split2 != null && spilt2len > 1 && spilt2len % 2 == 1) {
String num = split2[0];
Integer integer = StringUtils.convert2Int(num);
if (integer != null) {
if (integer == 0) {//删除所有运维
ifmessageCorrect = true;
} else {
if (spilt2len == integer * 2 + 1) {
int times = 0;
for (int i = 0; i < spilt2len; i++) {
if (i == 0) {
continue;
}
String ts = split2[i];
Integer time = StringUtils.convert2Int(ts);
if (i % 2 == 1) {
if (time > 23) {
ifmessageCorrect = false;
break;
}
String ts = split2[i];
Integer time = StringUtils.convert2Int(ts);
if (i % 2 == 1) {
if (time > 23) {
ifmessageCorrect = false;
break;
}
times = time * 60;
} else {
if (time > 59) {
ifmessageCorrect = false;
break;
}
times += time;
abslist.add(times);
times = time * 60;
} else {
if (time > 59) {
ifmessageCorrect = false;
break;
}
times += time;
abslist.add(times);
}
}
}
if (ifmessageCorrect) {
UpdateSysConfigUtil.setAbsHeartbeats(context, abslist);
}
}
if (ifmessageCorrect) {
UpdateSysConfigUtil.setAbsHeartbeats(context, abslist);
}
}
}

Loading…
Cancel
Save