Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
287b6ed3e4
@ -1,7 +1,10 @@
|
|||||||
package com.das.modules.node.command;
|
package com.das.modules.node.command;
|
||||||
|
|
||||||
|
import com.das.common.constant.EquipmentTypeIds;
|
||||||
import com.das.common.utils.AdminRedisTemplate;
|
import com.das.common.utils.AdminRedisTemplate;
|
||||||
import com.das.common.utils.StringUtils;
|
import com.das.common.utils.StringUtils;
|
||||||
|
import com.das.modules.cache.domain.DeviceInfoCache;
|
||||||
|
import com.das.modules.cache.service.CacheService;
|
||||||
import com.das.modules.node.constant.NodeConstant;
|
import com.das.modules.node.constant.NodeConstant;
|
||||||
import com.das.modules.node.domain.bo.TerminalMessage;
|
import com.das.modules.node.domain.bo.TerminalMessage;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
@ -17,6 +20,9 @@ public class HeartbeatCommand implements BaseCommand{
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
AdminRedisTemplate adminRedisTemplate;
|
AdminRedisTemplate adminRedisTemplate;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
CacheService cacheService;
|
||||||
@Override
|
@Override
|
||||||
public void doCommand(TerminalMessage data) {
|
public void doCommand(TerminalMessage data) {
|
||||||
JsonNode dataInfo = data.getData();
|
JsonNode dataInfo = data.getData();
|
||||||
@ -39,6 +45,27 @@ public class HeartbeatCommand implements BaseCommand{
|
|||||||
adminRedisTemplate.expire(key, 300L);
|
adminRedisTemplate.expire(key, 300L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
JsonNode devices = data.getData().get("devices");
|
||||||
|
if (devices != null && devices.isArray()) {
|
||||||
|
for (JsonNode device : devices) {
|
||||||
|
Long deviceId = device.get("deviceId").asLong();
|
||||||
|
Boolean online = device.get("online").asBoolean();
|
||||||
|
DeviceInfoCache deviceInfoCacheById = cacheService.getEquipmentCache().getDeviceInfoCacheById(deviceId);
|
||||||
|
if (deviceInfoCacheById == null || !deviceInfoCacheById.getObjectType().equals(EquipmentTypeIds.EQUIPMENT_TYPE_STATION_WTG)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//判断是不是风机
|
||||||
|
String keyPLCDeviceStatus = String.format("RT:%d:iturbineoperationmode", deviceId);
|
||||||
|
String keyDeviceStatus = String.format("RT:%d:commfaultstate");
|
||||||
|
Integer plcDeviceStatus = adminRedisTemplate.get(keyPLCDeviceStatus);
|
||||||
|
if (plcDeviceStatus == null){
|
||||||
|
adminRedisTemplate.set(keyDeviceStatus, online ? 1 : 0);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
adminRedisTemplate.set(keyDeviceStatus, online && plcDeviceStatus == 1 ? 1 : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -349,7 +349,15 @@ PS: 同一节点只允许建立一条连接。
|
|||||||
"linkId": "123",
|
"linkId": "123",
|
||||||
"online": false
|
"online": false
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
//设备监控信息
|
||||||
|
"devices": [
|
||||||
|
{
|
||||||
|
//设备ID
|
||||||
|
"deviceId": "1123451235464",
|
||||||
|
//设备状态
|
||||||
|
"online": true
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -118,12 +118,15 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="生产厂家:">
|
<el-form-item label="生产厂家:">
|
||||||
<el-input v-model="editDeviceData.madeinFactory" placeholder="请输入生产厂家" clearable />
|
<el-input disabled v-model="editDeviceData.madeinFactory" placeholder="请选择规格型号" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="规格型号:">
|
<el-form-item label="规格型号:">
|
||||||
<el-input v-model="editDeviceData.model" style="width: 200px" placeholder="请输入规格型号" clearable />
|
<!-- <el-input v-model="editDeviceData.model" style="width: 200px" placeholder="请输入规格型号" clearable /> -->
|
||||||
|
<el-select v-model="editDeviceData.model" placeholder="请选择规格型号" style="width: 200px" @change="selectEditModel">
|
||||||
|
<el-option v-for="item in modelList" :key="item.model" :value="item.model"></el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -284,12 +287,14 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="生产厂家:">
|
<el-form-item label="生产厂家:">
|
||||||
<el-input v-model="editAddDeviceData.madeinFactory" placeholder="请输入生产厂家" clearable />
|
<el-input disabled v-model="editAddDeviceData.madeinFactory" placeholder="请选择规格型号" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="规格型号:">
|
<el-form-item label="规格型号:">
|
||||||
<el-input v-model="editAddDeviceData.model" style="width: 200px" placeholder="请输入规格型号" clearable />
|
<el-select v-model="editAddDeviceData.model" placeholder="请选择规格型号" style="width: 200px" @change="selectAddModel">
|
||||||
|
<el-option v-for="item in modelList" :key="item.model" :value="item.model"></el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -486,6 +491,7 @@ import { encrypt_aes, generateRandomNumber } from '/@/utils/crypto'
|
|||||||
import ControlPage from './control.vue'
|
import ControlPage from './control.vue'
|
||||||
import MeasurementPage from './measurement.vue'
|
import MeasurementPage from './measurement.vue'
|
||||||
import { ModelAttributeType } from '/@/views/backend/auth/model/type'
|
import { ModelAttributeType } from '/@/views/backend/auth/model/type'
|
||||||
|
import { theoreticalpowerCurveList } from '/@/api/backend/theoreticalpowerCurve/request'
|
||||||
|
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
interface Tree {
|
interface Tree {
|
||||||
@ -728,6 +734,28 @@ const editDeviceData = reactive({
|
|||||||
nominalCapacity: null,
|
nominalCapacity: null,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const modelList = ref<{ model: string; madeinFactory: string }[]>([])
|
||||||
|
|
||||||
|
const getModelList = () => {
|
||||||
|
theoreticalpowerCurveList().then((res) => {
|
||||||
|
if (res.rows) {
|
||||||
|
console.log(res);
|
||||||
|
|
||||||
|
modelList.value = (res.rows as any[]).map((item: any) => {
|
||||||
|
return {
|
||||||
|
model: item.model,
|
||||||
|
madeinFactory: item.madeinfactory,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const selectEditModel = (value:string)=>{
|
||||||
|
editDeviceData.madeinFactory = modelList.value.find((item) => item.model == value)?.madeinFactory || ''
|
||||||
|
}
|
||||||
|
const selectAddModel = (value:string)=>{
|
||||||
|
editAddDeviceData.madeinFactory = modelList.value.find((item) => item.model == value)?.madeinFactory || ''
|
||||||
|
}
|
||||||
const size = ref<'default' | 'large' | 'small'>('default')
|
const size = ref<'default' | 'large' | 'small'>('default')
|
||||||
|
|
||||||
const handleCloseEditDevice = () => {
|
const handleCloseEditDevice = () => {
|
||||||
@ -1026,6 +1054,8 @@ const openMeasure = (data: any) => {
|
|||||||
watch(showMeasure, (newVal: boolean) => {
|
watch(showMeasure, (newVal: boolean) => {
|
||||||
!newVal && (measureData.autoUpdate = false)
|
!newVal && (measureData.autoUpdate = false)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
getModelList()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
Loading…
Reference in New Issue
Block a user