|
@@ -276,16 +276,22 @@ public class MonitorIndicatorRecordServiceImpl extends ServiceImpl<MonitorIndica
|
|
|
// 获取不到锁,略过
|
|
|
return new AsyncResult<>("【监测指标数据计算线程】项目:" + projectDTO.getProjectId() + "被占用");
|
|
|
}
|
|
|
- long start = System.currentTimeMillis();
|
|
|
- AsyncResult<String> projectDTO1 = computeProjectIndicatorData(projectDTO, projectIndicatorCompute);
|
|
|
- if (projectDTO1 != null) {
|
|
|
- return projectDTO1;
|
|
|
- }
|
|
|
- // 释放锁
|
|
|
- lockUtil.unlock(projectDTO.getProjectId(), String.valueOf(time));
|
|
|
- latch.countDown();
|
|
|
- long end = System.currentTimeMillis();
|
|
|
- return new AsyncResult<>("【监测指标数据计算线程】计算项目指标数据用时:" + projectDTO.getProjectId() + ";" + (end - start));
|
|
|
+ try{
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ AsyncResult<String> projectDTO1 = computeProjectIndicatorData(projectDTO, projectIndicatorCompute);
|
|
|
+ if (projectDTO1 != null) {
|
|
|
+ return projectDTO1;
|
|
|
+ }
|
|
|
+ // 释放锁
|
|
|
+ long end = System.currentTimeMillis();
|
|
|
+ return new AsyncResult<>("【监测指标数据计算线程】计算项目指标数据用时:" + projectDTO.getProjectId() + ";" + (end - start));
|
|
|
+ }catch (Exception e){
|
|
|
+ throw(e);
|
|
|
+ }finally {
|
|
|
+ lockUtil.unlock(projectDTO.getProjectId(), String.valueOf(time));
|
|
|
+ latch.countDown();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private AsyncResult<String> computeProjectIndicatorData(ProjectDTO projectDTO, ProjectIndicatorCompute projectIndicatorCompute) throws Exception {
|
|
@@ -368,11 +374,18 @@ public class MonitorIndicatorRecordServiceImpl extends ServiceImpl<MonitorIndica
|
|
|
// 获取不到锁,略过
|
|
|
return new AsyncResult<>("发送指标数据:项目:" + projectDTO.getProjectId() + "被占用");
|
|
|
}
|
|
|
- sendIndicatorDataToAlarmServer(projectDTO);
|
|
|
- // 释放锁
|
|
|
- lockUtil.unlock(projectDTO.getProjectId() + "_sendData", String.valueOf(time));
|
|
|
- latch.countDown();
|
|
|
- return new AsyncResult<>("Task2 accomplished!");
|
|
|
+ try{
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ sendIndicatorDataToAlarmServer(projectDTO);
|
|
|
+ long end = System.currentTimeMillis();
|
|
|
+ return new AsyncResult<>("【监测指标数据计算线程】计算项目指标数据用时:" + projectDTO.getProjectId() + ";" + (end - start));
|
|
|
+ }catch (Exception e){
|
|
|
+ throw(e);
|
|
|
+ }finally {
|
|
|
+ lockUtil.unlock(projectDTO.getProjectId() + "_sendData", String.valueOf(time));
|
|
|
+ latch.countDown();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void sendIndicatorDataToAlarmServer(ProjectDTO projectDTO) throws Exception {
|
|
@@ -598,7 +611,7 @@ public class MonitorIndicatorRecordServiceImpl extends ServiceImpl<MonitorIndica
|
|
|
QueryAlarmConfigDTO queryAlarmConfigDTO = new QueryAlarmConfigDTO();
|
|
|
queryAlarmConfigDTO.setProjectId(projectId);
|
|
|
queryAlarmConfigDTO.setGroupCode("WD");
|
|
|
- queryAlarmConfigDTO.setCategory(Collections.singletonList("run"));
|
|
|
+ queryAlarmConfigDTO.setCategory(Collections.singletonList("Eqdx"));
|
|
|
queryAlarmConfigDTO.setOpen(1);
|
|
|
DmpResult<List<AlarmConfigItem>> configItemResult = alarmConfigService.query(queryAlarmConfigDTO);
|
|
|
itemList = DmpResultUtil.getData(configItemResult);
|