林颖晨 2 years ago
commit 6e2a65f766
  1. 4
      psdc-business/src/main/java/com/psdc/service/IPsdcModelService.java
  2. 6
      psdc-business/src/main/java/com/psdc/service/impl/PsdcModelServiceImpl.java
  3. 31
      psdc-ui/src/views/control/manual/index.vue
  4. 12
      psdc-ui/src/views/system/cl/index.vue
  5. 46
      psdc-web/src/main/java/com/psdc/controller/monitor/TotalElectricMeterController.java

@ -2,6 +2,8 @@ package com.psdc.service;
import com.psdc.entity.vo.ModelVo;
import java.util.List;
/**
* @AuthorStone
* @Projectpsdc
@ -13,4 +15,6 @@ public interface IPsdcModelService {
ModelVo queryControlModel(String modelName, String sceneKey);
List<ModelVo> selDevIsControlByModelName(String modelName);
}

@ -6,6 +6,7 @@ import com.psdc.service.IPsdcModelService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author戴仕崑
@ -24,4 +25,9 @@ public class PsdcModelServiceImpl implements IPsdcModelService {
public ModelVo queryControlModel(String modelName, String sceneKey) {
return modelMapper.queryControlModel(modelName, sceneKey);
}
@Override
public List<ModelVo> selDevIsControlByModelName(String modelName) {
return modelMapper.selDevIsControlByModelName(modelName);
}
}

@ -42,10 +42,10 @@
<el-table :data="controlLogList" height="305px">
<el-table-column label="序号" type="index" :index="indexMethod1" width="60"></el-table-column>
<el-table-column label="设备名称" align="center" prop="deviceName"/>
<el-table-column label="操作内容" align="center" prop="controlValue" width="700"/>
<el-table-column label="操作内容" align="center" prop="controlValue" width="700" :formatter="formatControlKeyValue"/>
<el-table-column label="操作时间" align="center" prop="createTime"/>
<el-table-column label="操作人员" align="center" prop="createBy"/>
<el-table-column label="操作结果" align="center" prop="controlResult"></el-table-column>
<el-table-column label="操作结果" align="center" prop="controlContext" :formatter="formatControlResult"></el-table-column>
</el-table>
<el-pagination
v-model:current-page="currentPage"
@ -160,6 +160,25 @@ function getControlLogListFun(){
})
}
//
function formatControlKeyValue(row){
// console.log(row)
if(!isNaN(row.controlValue)){
row.controlValue = row.controlValue + '℃'
}
return row.controlKey + ':' + row.controlValue
}
//
// function formatControlResult(row){
// if(row.controlResult == ''){
// return '<span style="color: #14FF00"></span>';
// }
// if(row.controlResult == ''){
// return '<span style="color: red"></span>';
// }
// }
//
function indexMethod1(index){
return index+(currentPage.value-1)*pageSize.value+1
@ -203,7 +222,7 @@ function selectCeLue(item){
}
//
console.log(JSON.stringify(dataArr, null, 4));
// console.log(JSON.stringify(dataArr, null, 4));
SenceControlArr.value = JSON.stringify(dataArr, null, 4)
}
//
@ -211,7 +230,10 @@ function confirmClick() {
ElMessageBox.confirm(`确定执行 ${radio.value} ?`).then(() => {
drawerIshow.value = false;
getSenceControl(SenceControlArr.value).then((res)=>{
console.log(res)
if(res.code == 200){
ElMessage.success('策略导入成功')
getControlLogListFun()
}
})
})
}
@ -263,6 +285,7 @@ function getSetTemperatureFun(item){
}).then((res)=>{
if(res.code == 200){
ElMessage.success('设置温度成功!')
getControlLogListFun()
}
})

@ -70,9 +70,9 @@
<el-checkbox-group v-model="data.checkedSblb" @change="handleCheckedCitiesChange">
<el-checkbox v-for="item in data.sblb" :label="item.deviceId" :key="item.deviceId" label-width="120" style="margin-bottom: 10px">
<span style="width: 70px;display: inline-block">{{item.deviceName}}</span>
<el-input type="number" v-model="item.intemp" placeholder="进水温度" style="width: 120px ;margin: 10px"/>
<el-input type="number" v-model="item.outtemp" placeholder="出水温度" style="width: 120px ;margin: 10px"/>
<el-input type="number" v-model="item.temp" placeholder="温度" style="width: 120px ;margin: 10px"/>
<el-input :disabled="item.inTemp" type="number" v-model="item.intemp" placeholder="进水温度" style="width: 120px ;margin: 10px"/>
<el-input :disabled="item.outTemp" type="number" v-model="item.outtemp" placeholder="出水温度" style="width: 120px ;margin: 10px"/>
<el-input :disabled="item.Temp" type="number" v-model="item.temp" placeholder="温度" style="width: 120px ;margin: 10px"/>
</el-checkbox>
</el-checkbox-group>
<!-- <el-col :span="12">-->
@ -192,6 +192,12 @@ onMounted(()=>{
for(var i in crr){
arr=arr.concat(crr[i].children)
}
for(let j in arr){
arr[j].Temp=!arr[j].Temp
arr[j].inTemp=!arr[j].inTemp
arr[j].outTemp=!arr[j].outTemp
}
console.log('sblb',arr)
data.sblb=arr
var brr = []

@ -61,28 +61,32 @@ public class TotalElectricMeterController {
Map<String, Object> map2 = new HashMap<>();
map2.put("deviceId", dev.getDeviceId());
map2.put("deviceName", dev.getDeviceName());
map2.put("deviceId", dev.getDeviceId());
boolean b1 = false;
boolean b2 = false;
boolean b3 = false;
ModelVo modelVo1 = psdcModelService.queryControlModel(dd.getDeviceModel(), "intemp");
if (null != modelVo1){
b1 = true;
}
ModelVo modelVo2 = psdcModelService.queryControlModel(dd.getDeviceModel(), "outtemp");
if (null != modelVo2){
b2 = true;
}
ModelVo modelVo3 = psdcModelService.queryControlModel(dd.getDeviceModel(), "temp");
if (null != modelVo3){
b3 = true;
// map2.put("deviceId", dev.getDeviceId());
// boolean b1 = false;
// boolean b2 = false;
// boolean b3 = false;
// ModelVo modelVo1 = psdcModelService.queryControlModel(dd.getDeviceModel(), "intemp");
// if (null != modelVo1){
// b1 = true;
// }
// ModelVo modelVo2 = psdcModelService.queryControlModel(dd.getDeviceModel(), "outtemp");
// if (null != modelVo2){
// b2 = true;
// }
// ModelVo modelVo3 = psdcModelService.queryControlModel(dd.getDeviceModel(), "temp");
// if (null != modelVo3){
// b3 = true;
// }
// map2.put("intemp", null);
// map2.put("outtemp", null);
// map2.put("temp", null);
// map2.put("inTemp", b1);
// map2.put("outTemp", b2);
// map2.put("Temp", b3);
List<ModelVo> modelVoList = psdcModelService.selDevIsControlByModelName(dd.getDeviceModel());
for (ModelVo scr : modelVoList){
map2.put(scr.getRelationField(), null);
}
map2.put("intemp", null);
map2.put("outtemp", null);
map2.put("temp", null);
map2.put("inTemp", b1);
map2.put("outTemp", b2);
map2.put("Temp", b3);
maps2.add(map2);
}
} else {

Loading…
Cancel
Save