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

serial
liuguijing 1 year ago
parent 65c858ba1b
commit 4445591a12

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

Loading…
Cancel
Save