中铁项目定制
This commit is contained in:
parent
6d2b587c2d
commit
3191e927b5
@ -100,6 +100,10 @@ public class SewageAlarmServiceImpl extends ServiceImpl<SewageAlarmMapper, Sewag
|
||||
String alias = "sa.";
|
||||
QueryWrapper<SewageAlarm> queryWrapper = QueryGenerator.initPageQueryWrapper(SewageAlarm.class, paramMap, alias);
|
||||
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(SewageAlarm::getAlarmTime));
|
||||
String projectSn = MapUtils.getString(paramMap, "projectSn");
|
||||
if (Objects.equals(projectSn, "51E111F3FDFB41D0AB67F812F1B80794")) {
|
||||
paramMap.put("type", null);
|
||||
}
|
||||
if (Objects.equals(type, 1)) {
|
||||
queryWrapper.ge(alias + RefUtil.fieldNameUlc(SewageAlarm::getAlarmTime), DateUtil.today());
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ public class SewageTask {
|
||||
try {
|
||||
saveAllRecord(project);
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
log.error("获取污水实时数据错误", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -127,11 +127,7 @@ public class SewageTask {
|
||||
}
|
||||
if (CollUtil.isNotEmpty(records)) {
|
||||
for (SewageData record : records) {
|
||||
try {
|
||||
sewageDataService.add(record);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
sewageDataService.add(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -169,13 +165,13 @@ public class SewageTask {
|
||||
try {
|
||||
saveAllAlarm(project, start, end);
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
log.error("获取污水报警数据错误", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void saveAllAlarm(Project project, String start, String end) {
|
||||
private void saveAllAlarm(Project project, String start, String end) throws InterruptedException {
|
||||
List<SewageDev> devs = sewageDevService.list(new LambdaQueryWrapper<SewageDev>().eq(SewageDev::getProjectSn, project.getProjectSn()));
|
||||
if (CollUtil.isEmpty(devs)) {
|
||||
return;
|
||||
@ -184,11 +180,7 @@ public class SewageTask {
|
||||
String token = RenZhiUtil.getToken(project.getJnrzckAccount(), project.getJnrzckPw());
|
||||
for (SewageDev dev : devs) {
|
||||
JSONArray dataJa = RenZhiUtil.getAlarmRecordList(dev.getDevSn(), token, -1, start, end);
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Thread.sleep(200);
|
||||
if (CollUtil.isEmpty(dataJa)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user