diff --git a/psdc-business/src/main/java/com/psdc/service/IPsdcModelService.java b/psdc-business/src/main/java/com/psdc/service/IPsdcModelService.java index 8c2e14d..106c196 100644 --- a/psdc-business/src/main/java/com/psdc/service/IPsdcModelService.java +++ b/psdc-business/src/main/java/com/psdc/service/IPsdcModelService.java @@ -2,6 +2,8 @@ package com.psdc.service; import com.psdc.entity.vo.ModelVo; +import java.util.List; + /** * @Author:Stone * @Project:psdc @@ -13,4 +15,6 @@ public interface IPsdcModelService { ModelVo queryControlModel(String modelName, String sceneKey); + List selDevIsControlByModelName(String modelName); + } diff --git a/psdc-business/src/main/java/com/psdc/service/impl/PsdcModelServiceImpl.java b/psdc-business/src/main/java/com/psdc/service/impl/PsdcModelServiceImpl.java index 8654206..03bc9ff 100644 --- a/psdc-business/src/main/java/com/psdc/service/impl/PsdcModelServiceImpl.java +++ b/psdc-business/src/main/java/com/psdc/service/impl/PsdcModelServiceImpl.java @@ -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 selDevIsControlByModelName(String modelName) { + return modelMapper.selDevIsControlByModelName(modelName); + } } diff --git a/psdc-ui/src/views/control/manual/index.vue b/psdc-ui/src/views/control/manual/index.vue index cd5e9cf..9215988 100644 --- a/psdc-ui/src/views/control/manual/index.vue +++ b/psdc-ui/src/views/control/manual/index.vue @@ -42,10 +42,10 @@ - + - + 控制成功'; +// } +// if(row.controlResult == '控制失败'){ +// return '控制失败'; +// } +// } + //翻页时不刷新序号 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() } }) diff --git a/psdc-ui/src/views/system/cl/index.vue b/psdc-ui/src/views/system/cl/index.vue index 20cd66f..7bf4f2b 100644 --- a/psdc-ui/src/views/system/cl/index.vue +++ b/psdc-ui/src/views/system/cl/index.vue @@ -70,9 +70,9 @@ {{item.deviceName}} - - - + + + @@ -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 = [] diff --git a/psdc-web/src/main/java/com/psdc/controller/monitor/TotalElectricMeterController.java b/psdc-web/src/main/java/com/psdc/controller/monitor/TotalElectricMeterController.java index a74f9ff..2f36607 100644 --- a/psdc-web/src/main/java/com/psdc/controller/monitor/TotalElectricMeterController.java +++ b/psdc-web/src/main/java/com/psdc/controller/monitor/TotalElectricMeterController.java @@ -61,28 +61,32 @@ public class TotalElectricMeterController { Map 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 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 {