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