|
@@ -6,10 +6,13 @@ import java.util.List;
|
|
|
|
|
|
|
|
import cn.hutool.json.JSONArray;
|
|
import cn.hutool.json.JSONArray;
|
|
|
import cn.hutool.json.JSONObject;
|
|
import cn.hutool.json.JSONObject;
|
|
|
|
|
+import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
|
|
|
+import com.ruoyi.common.core.domain.entity.SysDictType;
|
|
|
import com.ruoyi.data.domain.*;
|
|
import com.ruoyi.data.domain.*;
|
|
|
import com.ruoyi.data.domain.bo.*;
|
|
import com.ruoyi.data.domain.bo.*;
|
|
|
import com.ruoyi.data.domain.vo.*;
|
|
import com.ruoyi.data.domain.vo.*;
|
|
|
import com.ruoyi.data.service.*;
|
|
import com.ruoyi.data.service.*;
|
|
|
|
|
+import com.ruoyi.system.service.ISysDictTypeService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -42,6 +45,8 @@ public class TblDataController extends BaseController {
|
|
|
|
|
|
|
|
private final ITblUnitService iTblUnitService;
|
|
private final ITblUnitService iTblUnitService;
|
|
|
|
|
|
|
|
|
|
+ private final ISysDictTypeService iSysDictTypeService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 查询网关设备列表
|
|
* 查询网关设备列表
|
|
@@ -50,6 +55,7 @@ public class TblDataController extends BaseController {
|
|
|
public TableDataInfo<GateWaySensor> list(TblEquipmentBo bo, PageQuery pageQuery) {
|
|
public TableDataInfo<GateWaySensor> list(TblEquipmentBo bo, PageQuery pageQuery) {
|
|
|
TableDataInfo<GateWaySensor> obj = new TableDataInfo<GateWaySensor>();
|
|
TableDataInfo<GateWaySensor> obj = new TableDataInfo<GateWaySensor>();
|
|
|
TblGatewayBo tblGatewayBo = new TblGatewayBo();
|
|
TblGatewayBo tblGatewayBo = new TblGatewayBo();
|
|
|
|
|
+ List<SysDictData> sysDictTypeList = iSysDictTypeService.selectDictDataByType("protocal_type");
|
|
|
List<TblGatewayVo> gatewayVoList = iTblGatewayService.queryList(tblGatewayBo);
|
|
List<TblGatewayVo> gatewayVoList = iTblGatewayService.queryList(tblGatewayBo);
|
|
|
TblEquipmentBo tblEquipmentBo = new TblEquipmentBo();
|
|
TblEquipmentBo tblEquipmentBo = new TblEquipmentBo();
|
|
|
List<GateWaySensor> gateWaySensorList = new ArrayList<GateWaySensor>();
|
|
List<GateWaySensor> gateWaySensorList = new ArrayList<GateWaySensor>();
|
|
@@ -71,6 +77,16 @@ public class TblDataController extends BaseController {
|
|
|
gateWaySensor.setSensorPointList(sensorPoints);
|
|
gateWaySensor.setSensorPointList(sensorPoints);
|
|
|
gateWaySensorList.add(gateWaySensor);
|
|
gateWaySensorList.add(gateWaySensor);
|
|
|
}
|
|
}
|
|
|
|
|
+ for(GateWaySensor gateWaySensor:gateWaySensorList){
|
|
|
|
|
+ System.out.println(gateWaySensor.getTblGateway().getProtocalType());
|
|
|
|
|
+ for(SysDictData sysDictData:sysDictTypeList){
|
|
|
|
|
+ System.out.println(sysDictData.getDictValue());
|
|
|
|
|
+ if(gateWaySensor.getTblGateway().getProtocalType() == Integer.valueOf(sysDictData.getDictValue())){
|
|
|
|
|
+ gateWaySensor.setSn(gateWaySensor.getTblGateway().getSn());
|
|
|
|
|
+ gateWaySensor.setProtocalTypeName(sysDictData.getDictLabel());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
obj.setRows(gateWaySensorList);
|
|
obj.setRows(gateWaySensorList);
|
|
|
return obj;
|
|
return obj;
|
|
|
}
|
|
}
|
|
@@ -92,9 +108,7 @@ public class TblDataController extends BaseController {
|
|
|
for(Object pointObject:pointArry){
|
|
for(Object pointObject:pointArry){
|
|
|
JSONObject jsonObject = new JSONObject(pointObject);
|
|
JSONObject jsonObject = new JSONObject(pointObject);
|
|
|
Long pointId = Long.valueOf((String) jsonObject.get("dataPointId"));
|
|
Long pointId = Long.valueOf((String) jsonObject.get("dataPointId"));
|
|
|
- System.out.println(pointId);
|
|
|
|
|
for(TblDatapointVo tblDatapointVo:tblDatapointVoList){
|
|
for(TblDatapointVo tblDatapointVo:tblDatapointVoList){
|
|
|
- System.out.println(tblDatapointVo.getId());
|
|
|
|
|
if(pointId == tblDatapointVo.getId()) {
|
|
if(pointId == tblDatapointVo.getId()) {
|
|
|
PointData pointData = new PointData();
|
|
PointData pointData = new PointData();
|
|
|
pointData.setName((String) jsonObject.get("name"));
|
|
pointData.setName((String) jsonObject.get("name"));
|