|
|
|
@ -17,7 +17,11 @@ import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
@ -42,6 +46,9 @@ public class NowDataController { |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
DeviceFloorService deviceFloorService; |
|
|
|
DeviceFloorService deviceFloorService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
CollectionParamsManageService collectingManagerService; |
|
|
|
|
|
|
|
|
|
|
|
@SysLogger(title = "实时监控", optDesc = "实时查看每楼栋热水运行情况") |
|
|
|
@SysLogger(title = "实时监控", optDesc = "实时查看每楼栋热水运行情况") |
|
|
|
@PostMapping("/queryNow") |
|
|
|
@PostMapping("/queryNow") |
|
|
|
public HttpResult queryNowData(@RequestParam(value = "buildingId") String buildingId) { |
|
|
|
public HttpResult queryNowData(@RequestParam(value = "buildingId") String buildingId) { |
|
|
|
@ -51,15 +58,22 @@ public class NowDataController { |
|
|
|
String maxWaterTemp = nowDataService.selectMaxTemp(buildingId); |
|
|
|
String maxWaterTemp = nowDataService.selectMaxTemp(buildingId); |
|
|
|
String buildingName = buildingService.queryBuildingName(buildingId);//获取楼栋名称
|
|
|
|
String buildingName = buildingService.queryBuildingName(buildingId);//获取楼栋名称
|
|
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
Date date = new Date(); |
|
|
|
// SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
String curDate = sdf1.format(date); |
|
|
|
// Date date = new Date();
|
|
|
|
curDate = curDate.substring(0, 13) + ":00:00"; |
|
|
|
// String curDate = sdf1.format(date);
|
|
|
|
|
|
|
|
// curDate = curDate.substring(0, 13) + ":00:00";
|
|
|
|
|
|
|
|
String curDate = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:00:00")); |
|
|
|
|
|
|
|
|
|
|
|
NowPublicDataEntity nowPublicData = new NowPublicDataEntity(); |
|
|
|
NowPublicDataEntity nowPublicData = new NowPublicDataEntity(); |
|
|
|
nowPublicData.setBuildingId(buildingId); |
|
|
|
nowPublicData.setBuildingId(buildingId); |
|
|
|
nowPublicData.setBuildingName(buildingName); |
|
|
|
nowPublicData.setBuildingName(buildingName); |
|
|
|
if (avgWaterTemp != null) { |
|
|
|
|
|
|
|
|
|
|
|
// 判断是否有回水温度
|
|
|
|
|
|
|
|
CollectionParamsManageEntity collectionParamsManageEntity = collectingManagerService.selectDeviceInstallByOtherName("回水温度", buildingId); |
|
|
|
|
|
|
|
if (collectionParamsManageEntity != null && collectionParamsManageEntity.getCurValue().compareTo(BigDecimal.ZERO) > 0) { |
|
|
|
|
|
|
|
nowPublicData.setBackWaterTemp(collectionParamsManageEntity.getCurValue().setScale(1, RoundingMode.HALF_UP).toString()); |
|
|
|
|
|
|
|
} else if (avgWaterTemp != null) { |
|
|
|
nowPublicData.setBackWaterTemp(avgWaterTemp); |
|
|
|
nowPublicData.setBackWaterTemp(avgWaterTemp); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
nowPublicData.setBackWaterTemp("0"); |
|
|
|
nowPublicData.setBackWaterTemp("0"); |
|
|
|
@ -117,10 +131,12 @@ public class NowDataController { |
|
|
|
String maxWaterTemp = nowDataService.selectMaxTemp(buildingId); |
|
|
|
String maxWaterTemp = nowDataService.selectMaxTemp(buildingId); |
|
|
|
String buildingName = buildingService.queryBuildingName(buildingId);//获取楼栋名称
|
|
|
|
String buildingName = buildingService.queryBuildingName(buildingId);//获取楼栋名称
|
|
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
// SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
Date date = new Date(); |
|
|
|
// Date date = new Date();
|
|
|
|
String curDate = sdf1.format(date); |
|
|
|
// String curDate = sdf1.format(date);
|
|
|
|
curDate = curDate.substring(0, 13) + ":00:00"; |
|
|
|
// curDate = curDate.substring(0, 13) + ":00:00";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String curDate = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:00:00")); |
|
|
|
|
|
|
|
|
|
|
|
NowPublicDataEntity nowPublicData = new NowPublicDataEntity(); |
|
|
|
NowPublicDataEntity nowPublicData = new NowPublicDataEntity(); |
|
|
|
nowPublicData.setBuildingId(buildingId); |
|
|
|
nowPublicData.setBuildingId(buildingId); |
|
|
|
|