Commit e5fa710a authored by wuqinghua's avatar wuqinghua

2022-3-11 吴卿华 修改首页没有下级数据就不显示

parent ec9b1ab2
...@@ -62,27 +62,30 @@ public class PipeInterfaceController extends BaseController { ...@@ -62,27 +62,30 @@ public class PipeInterfaceController extends BaseController {
public DeviceList selectDeviceDatas(){ public DeviceList selectDeviceDatas(){
//最后返回的封装类型 //最后返回的封装类型
DeviceList deviceList=new DeviceList(); DeviceList deviceList=new DeviceList();
List<DeviceData> list=new ArrayList<>();
//调压箱数据查询方法 //调压箱数据查询方法
List<DeviceData> deviceData = iPipeInterfaceService.selectDeviceData(); List<DeviceData> deviceData = iPipeInterfaceService.selectDeviceData();
//查询下级全部数据方法
List<PressureFlow> pressureFlows1 = iPipeInterfaceService.selectPressureFlows("1");
for (int i=0;i<deviceData.size();i++){ for (int i=0;i<deviceData.size();i++){
boolean bo=false;
for (int s=0;s<pressureFlows1.size();s++){
if (pressureFlows1.get(s).getDeviceId().equals(deviceData.get(i).getDeviceId())){
bo=true;
break;
}
}
if (bo){
deviceData.get(i).setIconType(2); deviceData.get(i).setIconType(2);
list.add(deviceData.get(i));
} }
deviceList.setData(deviceData); }
deviceList.setData(list);
return deviceList; return deviceList;
} }
/**
* 查询下级 调压箱/阀门井
* @param deviceId
* @return
*/
@RequestBody
@RequestMapping("/selectPressureFlowList")
public List<PressureFlowList> selectPressureFlowList(String deviceId){
List<PressureFlowList> lists=new ArrayList<>();
return lists;
}
/** /**
* 查询下级设备关联数据接口 * 查询下级设备关联数据接口
...@@ -308,25 +311,40 @@ public class PipeInterfaceController extends BaseController { ...@@ -308,25 +311,40 @@ public class PipeInterfaceController extends BaseController {
TSiteStationInfoDataList tSiteStationInfoDataList=new TSiteStationInfoDataList(); TSiteStationInfoDataList tSiteStationInfoDataList=new TSiteStationInfoDataList();
//场站信息查询方法 //场站信息查询方法
List<TSiteStationInfoData> tSiteStationInfoData = iPipeInterfaceService.selectTSiteStationInfoData(); List<TSiteStationInfoData> tSiteStationInfoData = iPipeInterfaceService.selectTSiteStationInfoData();
//查询下级全部数据方法
List<PressureFlow> pressureFlows1 = iPipeInterfaceService.selectPressureFlows("2");
List<TSiteStationInfoData> list=new ArrayList<>();
for (int i=0;i<tSiteStationInfoData.size();i++){ for (int i=0;i<tSiteStationInfoData.size();i++){
boolean bo=false;
for (int s=0;s<pressureFlows1.size();s++){
if (pressureFlows1.get(s).getDeviceId()!=null){
if (pressureFlows1.get(s).getDeviceId().equals(tSiteStationInfoData.get(i).getSiteStationId())){
bo=true;
break;
}
}
}
if (bo){
tSiteStationInfoData.get(i).setIconType(4); tSiteStationInfoData.get(i).setIconType(4);
list.add(tSiteStationInfoData.get(i));
} }
tSiteStationInfoDataList.setData(tSiteStationInfoData); }
tSiteStationInfoDataList.setData(list);
return tSiteStationInfoDataList; return tSiteStationInfoDataList;
} }
/** /**
* 查询场站下级设备关联数据接口 * 查询场站下级设备关联数据接口
* @param SiteStationId * @param deviceId
* @return * @return
*/ */
@RequestBody @RequestBody
@RequestMapping("/selecttSiteStationInfoData") @RequestMapping("/selecttSiteStationInfoData")
public TSiteStationInfoDataList selecttSiteStationInfoData(String SiteStationId){ public TSiteStationInfoDataList selecttSiteStationInfoData(String deviceId){
TSiteStationInfoDataList tSiteStationInfoDataList = new TSiteStationInfoDataList(); TSiteStationInfoDataList tSiteStationInfoDataList = new TSiteStationInfoDataList();
List<TSiteStationInfoData> TSiteStationInfoDataList=new ArrayList<>(); List<TSiteStationInfoData> TSiteStationInfoDataList=new ArrayList<>();
//查询场站下级设备数据 //查询场站下级设备数据
List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList(SiteStationId); List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList(deviceId);
//临时存储压力表数据数组 //临时存储压力表数据数组
List<PressureFlow> pressureList=new ArrayList<>(); List<PressureFlow> pressureList=new ArrayList<>();
//临时存储流量计数据数组 //临时存储流量计数据数组
...@@ -521,12 +539,25 @@ public class PipeInterfaceController extends BaseController { ...@@ -521,12 +539,25 @@ public class PipeInterfaceController extends BaseController {
public DeviceDataList selectvalveData(){ public DeviceDataList selectvalveData(){
//最后返回的封装类型 //最后返回的封装类型
DeviceDataList deviceDataList=new DeviceDataList(); DeviceDataList deviceDataList=new DeviceDataList();
List<DeviceData> list =new ArrayList<>();
//查询阀门井数据 //查询阀门井数据
List<DeviceData> pipeDates = iPipeInterfaceService.selectvalveData(); List<DeviceData> pipeDates = iPipeInterfaceService.selectvalveData();
//查询下级全部数据方法
List<PressureFlow> pressureFlows1 = iPipeInterfaceService.selectPressureFlows("1");
for (int i=0;i<pipeDates.size();i++){ for (int i=0;i<pipeDates.size();i++){
boolean bo=false;
for (int s=0;s<pressureFlows1.size();s++){
if (pressureFlows1.get(s).getDeviceId().equals(pipeDates.get(i).getDeviceId())){
bo=true;
break;
}
}
if (bo){
pipeDates.get(i).setIconType(3); pipeDates.get(i).setIconType(3);
list.add(pipeDates.get(i));
} }
deviceDataList.setData(pipeDates); }
deviceDataList.setData(list);
return deviceDataList; return deviceDataList;
} }
......
...@@ -109,4 +109,17 @@ public interface PipeInterfaceMapper { ...@@ -109,4 +109,17 @@ public interface PipeInterfaceMapper {
* @return * @return
*/ */
List<TAssociatedEquipment> selectSensingDevice(@Param("devId")String devId, @Param("relationDeviceType")String relationDeviceType); List<TAssociatedEquipment> selectSensingDevice(@Param("devId")String devId, @Param("relationDeviceType")String relationDeviceType);
/**
* 查询上级设备是否有下级设备
* @param deviceId
*/
int selectValveWellIsNUll(@Param("deviceId") String deviceId,@Param("type")int type);
/**
* 查询下级全部数据方法
* @param type
* @return
*/
List<PressureFlow> selectPressureFlows(String type);
} }
...@@ -106,4 +106,18 @@ public interface IPipeInterfaceService { ...@@ -106,4 +106,18 @@ public interface IPipeInterfaceService {
* @return * @return
*/ */
List<TAssociatedEquipment> selectSensingDevice(String devId, String relationDeviceType); List<TAssociatedEquipment> selectSensingDevice(String devId, String relationDeviceType);
/**
* 查询上级设备是否有下级设备
* @param deviceId
* @return
*/
int selectValveWellIsNUll(String deviceId,int type);
/**
* 查询下级全部数据方法
* @param type
* @return
*/
List<PressureFlow> selectPressureFlows(String type);
} }
...@@ -173,4 +173,25 @@ public class PipeInterfaceServiceImpl implements IPipeInterfaceService { ...@@ -173,4 +173,25 @@ public class PipeInterfaceServiceImpl implements IPipeInterfaceService {
List<TAssociatedEquipment> tAssociatedEquipments = pipeInterfaceMapper.selectSensingDevice(devId, relationDeviceType); List<TAssociatedEquipment> tAssociatedEquipments = pipeInterfaceMapper.selectSensingDevice(devId, relationDeviceType);
return tAssociatedEquipments; return tAssociatedEquipments;
} }
/**
* 查询上级设备是否有下级设备
* @param deviceId
* @return
*/
@Override
public int selectValveWellIsNUll(String deviceId,int type) {
return pipeInterfaceMapper.selectValveWellIsNUll(deviceId,type);
}
/**
* 查询下级全部数据方法
* @param type
* @return
*/
@Override
public List<PressureFlow> selectPressureFlows(String type) {
List<PressureFlow> flows = pipeInterfaceMapper.selectPressureFlows(type);
return flows;
}
} }
...@@ -201,4 +201,15 @@ ...@@ -201,4 +201,15 @@
where a.device_id=#{devId} and b.relation_device_type=#{relationDeviceType} where a.device_id=#{devId} and b.relation_device_type=#{relationDeviceType}
</select> </select>
<!--查询上级设备是否有下级设备-->
<select id="selectValveWellIsNUll" resultType="java.lang.Integer">
select count(relation_device_detail_id) from t_relation_device_detail_info where relation_device_id = #{deviceId} and relation_device_type=#{type}
</select>
<!--查询下级全部数据方法-->
<select id="selectPressureFlows" resultMap="PressureFlowResult">
select device_model,device_type,create_time,relation_device_id,iot_no from t_relation_device_detail_info
where relation_device_type=#{type}
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment