2023-06-02 11:37:46 优化完善用户所属设备列表查询接口!

master
魔神煜修罗皇 2 years ago
parent 442a758192
commit a11322ca6f
  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. 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 com.psdc.entity.vo.ModelVo;
import java.util.List;
/** /**
* @AuthorStone * @AuthorStone
* @Projectpsdc * @Projectpsdc
@ -13,4 +15,6 @@ public interface IPsdcModelService {
ModelVo queryControlModel(String modelName, String sceneKey); 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 org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* @Author戴仕崑 * @Author戴仕崑
@ -24,4 +25,9 @@ public class PsdcModelServiceImpl implements IPsdcModelService {
public ModelVo queryControlModel(String modelName, String sceneKey) { public ModelVo queryControlModel(String modelName, String sceneKey) {
return modelMapper.queryControlModel(modelName, sceneKey); return modelMapper.queryControlModel(modelName, sceneKey);
} }
@Override
public List<ModelVo> selDevIsControlByModelName(String modelName) {
return modelMapper.selDevIsControlByModelName(modelName);
}
} }

@ -59,28 +59,32 @@ public class TotalElectricMeterController {
Map<String, Object> map2 = new HashMap<>(); Map<String, Object> map2 = new HashMap<>();
map2.put("deviceId", dev.getDeviceId()); map2.put("deviceId", dev.getDeviceId());
map2.put("deviceName", dev.getDeviceName()); map2.put("deviceName", dev.getDeviceName());
map2.put("deviceId", dev.getDeviceId()); // map2.put("deviceId", dev.getDeviceId());
boolean b1 = false; // boolean b1 = false;
boolean b2 = false; // boolean b2 = false;
boolean b3 = false; // boolean b3 = false;
ModelVo modelVo1 = psdcModelService.queryControlModel(dd.getDeviceModel(), "intemp"); // ModelVo modelVo1 = psdcModelService.queryControlModel(dd.getDeviceModel(), "intemp");
if (null != modelVo1){ // if (null != modelVo1){
b1 = true; // b1 = true;
} // }
ModelVo modelVo2 = psdcModelService.queryControlModel(dd.getDeviceModel(), "outtemp"); // ModelVo modelVo2 = psdcModelService.queryControlModel(dd.getDeviceModel(), "outtemp");
if (null != modelVo2){ // if (null != modelVo2){
b2 = true; // b2 = true;
} // }
ModelVo modelVo3 = psdcModelService.queryControlModel(dd.getDeviceModel(), "temp"); // ModelVo modelVo3 = psdcModelService.queryControlModel(dd.getDeviceModel(), "temp");
if (null != modelVo3){ // if (null != modelVo3){
b3 = true; // 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); maps2.add(map2);
} }
} else { } else {

Loading…
Cancel
Save