Compare commits
2 Commits
9b1acdd46e
...
6a19cccaef
Author | SHA1 | Date | |
---|---|---|---|
6a19cccaef | |||
6603fc3acb |
@ -23,45 +23,45 @@ public class DataProducerTask implements ApplicationRunner {
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
// Timer timer1 = new Timer();
|
||||
// timer1.schedule(new TimerTask() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// threadPoolTaskExecutor.execute(new Channel1DataProcess());
|
||||
// }
|
||||
// },1000,10000);
|
||||
//
|
||||
// Timer timer2 = new Timer();
|
||||
// timer2.schedule(new TimerTask() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// threadPoolTaskExecutor.execute(new Channel2DataProcess());
|
||||
// }
|
||||
// },5000,10000);
|
||||
//
|
||||
// Timer timer3 = new Timer();
|
||||
// timer3.schedule(new TimerTask() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// threadPoolTaskExecutor.execute(new Channel3DataProcess());
|
||||
// }
|
||||
// },10000,10000);
|
||||
//
|
||||
// Timer timer4 = new Timer();
|
||||
// timer4.schedule(new TimerTask() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// threadPoolTaskExecutor.execute(new Channel4DataProcess());
|
||||
// }
|
||||
// },14000,10000);
|
||||
//
|
||||
// Timer timer5 = new Timer();
|
||||
// timer5.schedule(new TimerTask() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// threadPoolTaskExecutor.execute(new Channel5DataProcess());
|
||||
// }
|
||||
// },19000,10000);
|
||||
Timer timer1 = new Timer();
|
||||
timer1.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
threadPoolTaskExecutor.execute(new Channel1DataProcess());
|
||||
}
|
||||
},1000,10000);
|
||||
|
||||
Timer timer2 = new Timer();
|
||||
timer2.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
threadPoolTaskExecutor.execute(new Channel2DataProcess());
|
||||
}
|
||||
},5000,10000);
|
||||
|
||||
Timer timer3 = new Timer();
|
||||
timer3.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
threadPoolTaskExecutor.execute(new Channel3DataProcess());
|
||||
}
|
||||
},10000,10000);
|
||||
|
||||
Timer timer4 = new Timer();
|
||||
timer4.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
threadPoolTaskExecutor.execute(new Channel4DataProcess());
|
||||
}
|
||||
},14000,10000);
|
||||
|
||||
Timer timer5 = new Timer();
|
||||
timer5.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
threadPoolTaskExecutor.execute(new Channel5DataProcess());
|
||||
}
|
||||
},19000,10000);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ public class AlarmRulesApiImpl implements AlarmRulesApi{
|
||||
updateData.setAlarmDataId(alarmData.getAlarmDataId());
|
||||
updateData.setAlarmValue(value);
|
||||
updateData.setLastAlarmTime(LocalDateTime.now());
|
||||
updateData.setAlarmLevel(rule.getAlarmLevel());
|
||||
updateData.setAlarmLevel(rule.getAlarmLevel() < alarmData.getAlarmLevel() ? rule.getAlarmLevel() : alarmData.getAlarmLevel());
|
||||
updateData.setEquipId(rule.getEquipId());
|
||||
updateData.setReasonDescription(rule.getReasonDescription());
|
||||
alarmDataService.updateAlarmData(updateData);
|
||||
@ -168,7 +168,8 @@ public class AlarmRulesApiImpl implements AlarmRulesApi{
|
||||
* 设备报警数据更新
|
||||
*/
|
||||
private String refreshEquipAlarmData(AlarmRulesRespDTO rule){
|
||||
List<EquipAlarmDataDO> equipAlarmData = equipAlarmDataService.getEquipAlarmDataByEquipId(rule.getEquipId(),null);
|
||||
//TODO 查询时要查询趋势报警信息
|
||||
List<EquipAlarmDataDO> equipAlarmData = equipAlarmDataService.getEquipAlarmDataByEquipId(rule.getEquipId(),0);
|
||||
if(equipAlarmData == null || equipAlarmData.size() == 0){
|
||||
return equipAlarmDataService.createEquipAlarmData(new EquipAlarmDataSaveReqVO(null,rule.getEquipId(),
|
||||
rule.getComponentId(),rule.getAlarmLevel(),0,LocalDateTime.now(),LocalDateTime.now(),0,null));
|
||||
@ -176,7 +177,7 @@ public class AlarmRulesApiImpl implements AlarmRulesApi{
|
||||
//如果没有则新增
|
||||
EquipAlarmDataSaveReqVO updateData = new EquipAlarmDataSaveReqVO();
|
||||
updateData.setEquipAlarmId(equipAlarmData.get(0).getEquipAlarmId());
|
||||
updateData.setAlarmLevel(rule.getAlarmLevel());
|
||||
updateData.setAlarmLevel(rule.getAlarmLevel() < equipAlarmData.get(0).getAlarmLevel() ? rule.getAlarmLevel() : equipAlarmData.get(0).getAlarmLevel());
|
||||
updateData.setLatestAlarmTime(LocalDateTime.now());
|
||||
equipAlarmDataService.updateEquipAlarmData(updateData);
|
||||
return equipAlarmData.get(0).getEquipAlarmId();
|
||||
@ -195,7 +196,7 @@ public class AlarmRulesApiImpl implements AlarmRulesApi{
|
||||
//如果没有则新增
|
||||
EquipAlarmDataSaveReqVO updateData = new EquipAlarmDataSaveReqVO();
|
||||
updateData.setEquipAlarmId(equipAlarmData.get(0).getEquipAlarmId());
|
||||
updateData.setAlarmLevel(rule.getAlarmLevel());
|
||||
updateData.setAlarmLevel(rule.getAlarmLevel() < equipAlarmData.get(0).getAlarmLevel() ? rule.getAlarmLevel() : equipAlarmData.get(0).getAlarmLevel());
|
||||
updateData.setLatestAlarmTime(LocalDateTime.now());
|
||||
// updateData.setEquipAnalyseStatus(judgeEquipAnalyzeStatusByAlarmLevel(rule.getAlarmLevel()));
|
||||
equipAlarmDataService.updateEquipAlarmData(updateData);
|
||||
|
@ -10,13 +10,17 @@
|
||||
label-width="68px"
|
||||
style="text-align:right"
|
||||
>
|
||||
<el-form-item label="机床设备" prop="equipId">
|
||||
<el-form-item
|
||||
label="机床设备"
|
||||
prop="equipId"
|
||||
>
|
||||
<el-cascader
|
||||
v-model="cascaderValue"
|
||||
:options="equipCascader"
|
||||
:props="{ value: 'id',label: 'name',children: 'children'}"
|
||||
clearable
|
||||
@change="cascaderChange"></el-cascader>
|
||||
@change="cascaderChange"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item
|
||||
label="机床组件id"
|
||||
@ -284,7 +288,10 @@
|
||||
<script>
|
||||
import * as EquipAlarmDataApi from "@/api/system/alarm/equipalarmdata";
|
||||
import EquipAlarmDataForm from "./EquipAlarmDataForm.vue";
|
||||
import {getEquipCascader, getEquipSelection} from "@/api/system/equip/equipInfo";
|
||||
import {
|
||||
getEquipCascader,
|
||||
getEquipSelection,
|
||||
} from "@/api/system/equip/equipInfo";
|
||||
export default {
|
||||
name: "EquipAlarmData",
|
||||
components: {
|
||||
@ -321,6 +328,7 @@ export default {
|
||||
latestAlarmTime: [],
|
||||
status: null,
|
||||
equipAnalyseStatus: null,
|
||||
alarmType: 0,
|
||||
},
|
||||
equipSelection: [],
|
||||
};
|
||||
@ -343,14 +351,14 @@ export default {
|
||||
const res = await EquipAlarmDataApi.getEquipAlarmDataPage(
|
||||
this.queryParams
|
||||
);
|
||||
await getEquipCascader().then(res=>{
|
||||
res.forEach(item=>{
|
||||
await getEquipCascader().then((res) => {
|
||||
res.forEach((item) => {
|
||||
if (item.children == null) {
|
||||
item.disabled = true;
|
||||
}
|
||||
})
|
||||
});
|
||||
this.equipCascader = res;
|
||||
})
|
||||
});
|
||||
this.list = res.data.list;
|
||||
this.total = res.data.total;
|
||||
} finally {
|
||||
|
@ -10,13 +10,17 @@
|
||||
label-width="68px"
|
||||
style="text-align:right"
|
||||
>
|
||||
<el-form-item label="机床设备" prop="equipId">
|
||||
<el-form-item
|
||||
label="机床设备"
|
||||
prop="equipId"
|
||||
>
|
||||
<el-cascader
|
||||
v-model="cascaderValue"
|
||||
:options="equipCascader"
|
||||
:props="{ value: 'id',label: 'name',children: 'children'}"
|
||||
clearable
|
||||
@change="cascaderChange"></el-cascader>
|
||||
@change="cascaderChange"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item
|
||||
label="机床组件id"
|
||||
@ -202,7 +206,7 @@
|
||||
<span>{{ parseTime(scope.row.latestAlarmTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
label="状态"
|
||||
align="center"
|
||||
prop="status"
|
||||
@ -213,7 +217,7 @@
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
label="状态"
|
||||
align="center"
|
||||
@ -275,7 +279,10 @@
|
||||
<script>
|
||||
import * as EquipAlarmDataApi from "@/api/system/alarm/equipalarmdata";
|
||||
import EquipAlarmDataForm from "./EquipAlarmDataForm.vue";
|
||||
import {getEquipCascader, getEquipSelection} from "@/api/system/equip/equipInfo";
|
||||
import {
|
||||
getEquipCascader,
|
||||
getEquipSelection,
|
||||
} from "@/api/system/equip/equipInfo";
|
||||
export default {
|
||||
name: "EquipAlarmData",
|
||||
components: {
|
||||
@ -335,14 +342,14 @@ export default {
|
||||
const res = await EquipAlarmDataApi.getEquipAlarmDataPage(
|
||||
this.queryParams
|
||||
);
|
||||
await getEquipCascader().then(res=>{
|
||||
res.forEach(item=>{
|
||||
await getEquipCascader().then((res) => {
|
||||
res.forEach((item) => {
|
||||
if (item.children == null) {
|
||||
item.disabled = true;
|
||||
}
|
||||
})
|
||||
});
|
||||
this.equipCascader = res;
|
||||
})
|
||||
});
|
||||
this.list = res.data.list;
|
||||
this.total = res.data.total;
|
||||
} finally {
|
||||
|
Loading…
Reference in New Issue
Block a user