提交修改设备更新时关联组态更新
This commit is contained in:
@@ -275,7 +275,7 @@ public class ScadaController extends BaseController
|
||||
@ApiOperation("获取绑定设备物模型列表")
|
||||
@PreAuthorize("@ss.hasPermi('scada:center:query')")
|
||||
@GetMapping("/listDeviceThingsModel")
|
||||
public TableDataInfo getBindDatalist(Integer pageNum, Integer pageSize, String scadaGuid, String serialNumber)
|
||||
public TableDataInfo getBindDatalist(Integer pageNum, Integer pageSize, String scadaGuid, String serialNumber,String deviceName,String identifier)
|
||||
{
|
||||
List<DeviceRealDataVO> list= new ArrayList<>();
|
||||
if(StringUtils.isEmpty(scadaGuid)){
|
||||
@@ -365,6 +365,7 @@ public class ScadaController extends BaseController
|
||||
}
|
||||
}
|
||||
}
|
||||
list = filterDevices(list,deviceName,identifier);
|
||||
List resultList = ScadaCollectionUtils.startPage(list, pageNum, pageSize);
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
@@ -374,6 +375,22 @@ public class ScadaController extends BaseController
|
||||
return rspData;
|
||||
}
|
||||
|
||||
public List<DeviceRealDataVO> filterDevices(List<DeviceRealDataVO> list, String deviceName, String identifier) {
|
||||
return list.stream()
|
||||
.filter(device -> {
|
||||
// 过滤条件:deviceName 非空且匹配(忽略大小写)
|
||||
boolean nameMatch = deviceName == null || deviceName.isEmpty() ||
|
||||
device.getDeviceName().equalsIgnoreCase(deviceName);
|
||||
|
||||
// 过滤条件:identifier 非空且匹配(忽略大小写)
|
||||
boolean idMatch = identifier == null || identifier.isEmpty() ||
|
||||
device.getIdentifier().equalsIgnoreCase(identifier);
|
||||
|
||||
return nameMatch && idMatch;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入json文件
|
||||
* @param file 文件
|
||||
|
||||
@@ -121,4 +121,5 @@ public interface ScadaMapper
|
||||
|
||||
|
||||
Long selectDeptIdBySn(@Param("serialNumber") String serialNumber);
|
||||
|
||||
}
|
||||
|
||||
@@ -126,4 +126,6 @@ public interface IScadaService
|
||||
List<ScadaVO> listScadaVO(Scada scadaQuery);
|
||||
|
||||
AjaxResult importJson(MultipartFile file, String guid) throws IOException;
|
||||
|
||||
int updateScadaDept(Scada scada);
|
||||
}
|
||||
|
||||
@@ -238,6 +238,12 @@ public class ScadaServiceImpl implements IScadaService
|
||||
return scadaMapper.updateScada(scada);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int updateScadaDept(Scada scada) {
|
||||
return scadaMapper.updateScada(scada);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除组态中心
|
||||
*
|
||||
|
||||
@@ -339,10 +339,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectDeptIdBySn" resultType="java.lang.Long">
|
||||
<select id="selectDeptIdBySn" parameterType="String" resultType="java.lang.Long">
|
||||
select agencies_id
|
||||
from iot_device
|
||||
where serial_number = #{serial_number}
|
||||
where serial_number = #{serialNumber}
|
||||
and del_flag = '0'
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user