平台修改意见20251120-设备列表查询接口增加设备类型参数
This commit is contained in:
@ -54,10 +54,11 @@ public class EmsSiteConfigController extends BaseController{
|
|||||||
* 获取设备列表-分页
|
* 获取设备列表-分页
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getDeviceInfoList")
|
@GetMapping("/getDeviceInfoList")
|
||||||
public TableDataInfo getDeviceInfoList(@RequestParam String siteId)
|
public TableDataInfo getDeviceInfoList(@RequestParam String siteId,
|
||||||
|
@RequestParam String deviceCategory)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
List<SiteDeviceListVo> list = iEmsSiteService.getAllDeviceList(siteId);
|
List<SiteDeviceListVo> list = iEmsSiteService.getAllDeviceList(siteId, deviceCategory);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +77,7 @@ public class EmsSiteConfigController extends BaseController{
|
|||||||
@GetMapping("/getDeviceList")
|
@GetMapping("/getDeviceList")
|
||||||
public AjaxResult getDeviceInfoList2(@RequestParam String siteId)
|
public AjaxResult getDeviceInfoList2(@RequestParam String siteId)
|
||||||
{
|
{
|
||||||
return success(iEmsSiteService.getAllDeviceList(siteId));
|
return success(iEmsSiteService.getAllDeviceList(siteId, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -89,7 +89,7 @@ public interface EmsSiteSettingMapper
|
|||||||
* 获取站点的设备列表
|
* 获取站点的设备列表
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<SiteDeviceListVo> getAllSiteDeviceList(String siteId);
|
public List<SiteDeviceListVo> getAllSiteDeviceList(@Param("siteId") String siteId, @Param("deviceCategory") String deviceCategory);
|
||||||
|
|
||||||
public List<String> getAllSiteId();
|
public List<String> getAllSiteId();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ public interface IEmsSiteService
|
|||||||
|
|
||||||
public List<EmsSiteSetting> getAllSiteInfoList(String siteName, String startTime, String endTime);
|
public List<EmsSiteSetting> getAllSiteInfoList(String siteName, String startTime, String endTime);
|
||||||
|
|
||||||
public List<SiteDeviceListVo> getAllDeviceList(String siteId);
|
public List<SiteDeviceListVo> getAllDeviceList(String siteId, String deviceCategory);
|
||||||
|
|
||||||
public List<Map<String,Object>> getAllPcsInfo(String siteId);
|
public List<Map<String,Object>> getAllPcsInfo(String siteId);
|
||||||
|
|
||||||
|
|||||||
@ -80,20 +80,20 @@ public class EmsSiteServiceImpl implements IEmsSiteService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SiteDeviceListVo> getAllDeviceList(String siteId) {
|
public List<SiteDeviceListVo> getAllDeviceList(String siteId, String deviceCategory) {
|
||||||
List<SiteDeviceListVo> resultData = emsSiteMapper.getAllSiteDeviceList(siteId);
|
List<SiteDeviceListVo> resultData = emsSiteMapper.getAllSiteDeviceList(siteId, deviceCategory);
|
||||||
if(resultData == null || resultData.size() == 0){
|
if(resultData == null || resultData.size() == 0){
|
||||||
return resultData;
|
return resultData;
|
||||||
}
|
}
|
||||||
for (SiteDeviceListVo siteDeviceListVo : resultData) {
|
for (SiteDeviceListVo siteDeviceListVo : resultData) {
|
||||||
String clusterId = siteDeviceListVo.getDeviceId();
|
String clusterId = siteDeviceListVo.getDeviceId();
|
||||||
String deviceCategory = siteDeviceListVo.getDeviceCategory();
|
String category = siteDeviceListVo.getDeviceCategory();
|
||||||
if(DeviceCategory.CLUSTER.getCode().equals(deviceCategory)){
|
if(DeviceCategory.CLUSTER.getCode().equals(category)){
|
||||||
// 获取该stack下面有多少单体电池
|
// 获取该stack下面有多少单体电池
|
||||||
List<EmsBatteryData> batteryDataList = redisCache.getCacheList(RedisKeyConstants.BATTERY + siteId + "_" + clusterId);
|
List<EmsBatteryData> batteryDataList = redisCache.getCacheList(RedisKeyConstants.BATTERY + siteId + "_" + clusterId);
|
||||||
siteDeviceListVo.setBatteryNum(batteryDataList == null ? 0 : batteryDataList.size());
|
siteDeviceListVo.setBatteryNum(batteryDataList == null ? 0 : batteryDataList.size());
|
||||||
}
|
}
|
||||||
String categoryName = DeviceCategory.getInfoByCode(deviceCategory);
|
String categoryName = DeviceCategory.getInfoByCode(category);
|
||||||
siteDeviceListVo.setCategoryName(categoryName);
|
siteDeviceListVo.setCategoryName(categoryName);
|
||||||
}
|
}
|
||||||
return resultData;
|
return resultData;
|
||||||
|
|||||||
@ -146,6 +146,9 @@
|
|||||||
<if test="siteId != null and siteId != ''">
|
<if test="siteId != null and siteId != ''">
|
||||||
and es.site_id = #{siteId}
|
and es.site_id = #{siteId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="deviceCategory != null and deviceCategory != ''">
|
||||||
|
and ed.device_category = #{deviceCategory}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getAllSiteId" resultType="String">
|
<select id="getAllSiteId" resultType="String">
|
||||||
|
|||||||
Reference in New Issue
Block a user