Merge branch 'dev' of http://101.43.41.9:13000/xzzn/emsback into dev
This commit is contained in:
@ -67,7 +67,8 @@ public class EmsSiteConfigController extends BaseController{
|
||||
@RequestParam(value = "deviceCategory", required = false) String deviceCategory)
|
||||
{
|
||||
startPage();
|
||||
List<SiteDeviceListVo> list = iEmsSiteService.getAllDeviceList(siteId, deviceCategory);
|
||||
List<SiteDeviceListVo> list = iEmsSiteService.getAllDeviceListNoDisp(siteId, deviceCategory);
|
||||
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@ -91,5 +91,8 @@ public interface EmsSiteSettingMapper
|
||||
*/
|
||||
public List<SiteDeviceListVo> getAllSiteDeviceList(@Param("siteId") String siteId, @Param("deviceCategory") String deviceCategory);
|
||||
|
||||
|
||||
public List<SiteDeviceListVo> getAllSiteDeviceListNoDisp(@Param("siteId") String siteId, @Param("deviceCategory") String deviceCategory);
|
||||
|
||||
public List<String> getAllSiteId();
|
||||
}
|
||||
|
||||
@ -27,6 +27,8 @@ public interface IEmsSiteService
|
||||
|
||||
public List<SiteDeviceListVo> getAllDeviceList(String siteId, String deviceCategory);
|
||||
|
||||
public List<SiteDeviceListVo> getAllDeviceListNoDisp(String siteId, String deviceCategory);
|
||||
|
||||
public List<Map<String,Object>> getAllPcsInfo(String siteId);
|
||||
|
||||
public List<Map<String,Object>> getParentCategoryDeviceId(String siteId, String deviceCategory);
|
||||
|
||||
@ -99,6 +99,31 @@ public class EmsSiteServiceImpl implements IEmsSiteService
|
||||
return resultData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备列表
|
||||
*
|
||||
* @param siteId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SiteDeviceListVo> getAllDeviceListNoDisp(String siteId, String deviceCategory) {
|
||||
List<SiteDeviceListVo> resultData = emsSiteMapper.getAllSiteDeviceListNoDisp(siteId, deviceCategory);
|
||||
if(resultData == null || resultData.size() == 0){
|
||||
return resultData;
|
||||
}
|
||||
for (SiteDeviceListVo siteDeviceListVo : resultData) {
|
||||
String clusterId = siteDeviceListVo.getDeviceId();
|
||||
String category = siteDeviceListVo.getDeviceCategory();
|
||||
if(DeviceCategory.CLUSTER.getCode().equals(category)){
|
||||
// 获取该stack下面有多少单体电池
|
||||
List<EmsBatteryData> batteryDataList = redisCache.getCacheList(RedisKeyConstants.BATTERY + siteId + "_" + clusterId);
|
||||
siteDeviceListVo.setBatteryNum(batteryDataList == null ? 0 : batteryDataList.size());
|
||||
}
|
||||
String categoryName = DeviceCategory.getInfoByCode(category);
|
||||
siteDeviceListVo.setCategoryName(categoryName);
|
||||
}
|
||||
return resultData;
|
||||
}
|
||||
/**
|
||||
* 根据site_id获取所有pcs
|
||||
* @param siteId
|
||||
|
||||
@ -398,7 +398,7 @@
|
||||
AND latest.max_update_time = t.data_update_time
|
||||
AND t.site_id = #{siteId}
|
||||
) AS pd
|
||||
WHERE rn = 1;
|
||||
WHERE rn = 1
|
||||
</select>
|
||||
|
||||
<select id="getElectDataList" resultType="com.xzzn.ems.domain.vo.ElectricIndexList">
|
||||
|
||||
@ -152,6 +152,24 @@
|
||||
order by ed.device_id
|
||||
</select>
|
||||
|
||||
<select id="getAllSiteDeviceListNoDisp" parameterType="String" resultType="com.xzzn.ems.domain.vo.SiteDeviceListVo">
|
||||
select es.site_id as siteId,es.site_name as siteName,
|
||||
ed.device_id as deviceId,ed.device_name as deviceName,
|
||||
ed.device_type as deviceType,ed.device_status as deviceStatus,ed.work_status as workStatus,
|
||||
ed.device_category as deviceCategory,
|
||||
ed.picture_url as pictureUrl,
|
||||
ed.id,
|
||||
ed.parent_id as parentId
|
||||
from ems_site_setting es INNER JOIN ems_devices_setting ed on es.site_id = ed.site_id and (ed.display_flg is null or ed.display_flg != '1')
|
||||
where 1 = 1
|
||||
<if test="siteId != null and siteId != ''">
|
||||
and es.site_id = #{siteId}
|
||||
</if>
|
||||
<if test="deviceCategory != null and deviceCategory != ''">
|
||||
and ed.device_category = #{deviceCategory}
|
||||
</if>
|
||||
order by ed.device_id
|
||||
</select>
|
||||
<select id="getAllSiteId" resultType="String">
|
||||
select distinct site_id from ems_site_setting
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user