Commit 81a6ff7e authored by caotao's avatar caotao

全景监控大屏功率曲线不显示问题处理。

parent 58f336f5
......@@ -868,9 +868,8 @@ public Map<String,Object> gettimedateyfd( ){
// List<String> fdGatewayId = stationBasicListfd.stream().map(StationBasic::getBoosterGatewayId).collect(Collectors.joining(","));
// List<String> gfGatewayId = stationBasicListgf.stream().map(StationBasic::getBoosterGatewayId).collect(Collectors.toList());
String fdGatewayIds= stationBasicListfd.stream().map(StationBasic::getBoosterGatewayId).collect(Collectors.joining(","));
String gfGatewayIds=stationBasicListgf.stream().map(StationBasic::getBoosterGatewayId).collect(Collectors.joining(","));
String fdGatewayIds= stationBasicListfd.stream().map(stationBasic -> "'"+stationBasic.getBoosterGatewayId()+"'").collect(Collectors.joining(","));
String gfGatewayIds=stationBasicListgf.stream().map(stationBasic -> "'"+stationBasic.getBoosterGatewayId()+"'").collect(Collectors.joining(","));
List<StationBasic> stationBasicListAll=new ArrayList<>();
......@@ -891,22 +890,22 @@ public Map<String,Object> gettimedateyfd( ){
List<IndicatorData> activePowerListGF = new ArrayList<>();
// String startTime = cn.hutool.core.date.DateUtil.today() + " 00:00:00";
// String endTime = cn.hutool.core.date.DateUtil.today() + " 23:59:59";
Date currentDayStartTime = DateUtils.getCurrentDayStartTime(new Date());
Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
String startTime = sdf.format(currentDayStartTime);
String endTime= sdf.format(currentDayEndTime);
// Date currentDayStartTime = DateUtils.getCurrentDayStartTime(new Date());
// Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
// Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
// sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
// String startTime = sdf.format(currentDayStartTime);
// String endTime= sdf.format(currentDayEndTime);
activePowerListFD = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeqg(CommonConstans.xiazaoActivePowerPoint, startTime, endTime, fdGatewayIds);
activePowerListFD = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeqgNew(CommonConstans.xiazaoActivePowerPoint, fdGatewayIds);
activePowerListGF = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeqg(CommonConstans.taiheActivePowerPoint, startTime, endTime, gfGatewayIds);
activePowerListGF = indicatorDataMapper.selectDataByequipmentIndexNameAndtimeqgNew(CommonConstans.taiheActivePowerPoint, gfGatewayIds);
System.out.println(JSON.toJSONString(activePowerListFD));
for (int i = 0; i < activePowerListFD.size(); i++) {
IndicatorData indicatorData = activePowerListFD.get(i);
IndicatorData indicatorData2 = activePowerListGF.get(i);
time.add(indicatorData.getXtime());
time.add(cn.hutool.core.date.DateUtil.format(indicatorData.getCreatedTime(), "HH:mm"));
// Double vl= indicatorData.getValueF()+indicatorData2.getValueF() * CommonConstans.kwToMv;
Double vl= Double.valueOf(String.format(CommonConstans.Twodecimalplaces, indicatorData.getValueF()))+
Double.valueOf(String.format(CommonConstans.Twodecimalplaces, indicatorData2.getValueF() * CommonConstans.kwToMv));
......
......@@ -25,7 +25,11 @@ public interface IndicatorDataMapper extends BaseMapper<IndicatorData> {
@Select("select sum(valueFs) valueF,xtime from (select SUBSTR(`created_time`, 11,6) xtime, `value_f` as valueFs from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and ts >= #{startTime} and ts <= #{endTime} and gateway_id in (#{gatewayId})) group by xtime order by xtime ")
List<IndicatorData> selectDataByequipmentIndexNameAndtimeqg(@Param("equipmentIndexName") String equipmentIndexName, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("gatewayId") String gatewayId);
@Select("select `value`, created_time, `value_f` as valueF from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and equipment_number = #{equipmentNumber} and ts >= #{startTime} and ts <= #{endTime} and gateway_id =#{gatewayId}")
@Select("select `value`, created_time, `value_f` as valueF from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and ts >= TODAY()-8h and gateway_id in ( ${gatewayId} )")
List<IndicatorData> selectDataByequipmentIndexNameAndtimeqgNew(@Param("equipmentIndexName") String equipmentIndexName, @Param("gatewayId") String gatewayId);
@Select("select `value`, created_time, `value_f` as valueF from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and equipment_number = #{equipmentNumber} and ts >= #{startTime} and ts <= #{endTime} and gateway_id = #{gatewayId}")
List<IndicatorData> selectDataByequipmentIndexNameAndtimeAndEquipmentNumber(@Param("equipmentIndexName") String equipmentIndexName, @Param("equipmentNumber") String equipmentNumber, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("gatewayId") String gatewayId);
@Select("select `value`, created_time, `value_f` as valueF, equipment_index_name from iot_data.indicator_data where equipment_index_name like '%路电流%' and equipment_number = #{equipmentNumber} and ts >= #{startTime} and ts <= #{endTime} and gateway_id =#{gatewayId}")
......
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