Commit 104db640 authored by 张森's avatar 张森

获取物联信息查询 iot数据

parent 8b1cc1a3
package com.yeejoin.equipmanage.controller;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.utils.CommonPageable;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
......@@ -20,6 +21,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -98,6 +100,19 @@ public class SystemStatisticController extends AbstractBaseController {
@ApiOperation(httpMethod = "GET", value = "获取物联信息", notes = "获取物联信息")
public ResponseModel getIotInfo(@RequestParam(required = false) String bizOrgCode) {
Map<String, Object> map = fireFightingSystemMapper.getIotInfo(bizOrgCode);
// 获取当天开始时间(0点0分0秒)
Date startOfDay = DateUtil.beginOfDay(new Date());
String startOfDayStr = DateUtil.formatDateTime(startOfDay);
// 获取当天结束时间(23点59分59秒)
Date endOfDay = DateUtil.endOfDay(new Date());
String endOfDayStr = DateUtil.formatDateTime(endOfDay);
ResponseModel<Map<String, Object>> mapResponseModel = iotFeign.queryIotDataNum(startOfDayStr, endOfDayStr);
if (200 == mapResponseModel.getStatus() && 200 == mapResponseModel.getStatus()) {
Map<String, Object> result = mapResponseModel.getResult();
Object totalNum = result.get("totalNum");
map.put("indexMonitorNum", totalNum);
}
return CommonResponseUtil.success(map);
}
......
......@@ -81,4 +81,9 @@ public interface IotFeign {
@RequestParam("deviceName") String deviceName,
@RequestParam("timeStart") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date timeStart,
@RequestParam("timeEnd") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")Date timeEnd);
@RequestMapping(value = "v1/livedata/queryIotDataNum", method = RequestMethod.GET, consumes = "application/json")
ResponseModel<Map<String ,Object>> queryIotDataNum(@RequestParam("timeStart") String timeStart,
@RequestParam("timeEnd") String timeEnd);
}
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