Changes提交修改
This commit is contained in:
@@ -41,7 +41,7 @@ public class DeviceDocController extends BaseController
|
||||
/**
|
||||
* 查询设备档案管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:deviecDoc:list')")
|
||||
//@PreAuthorize("@ss.hasPermi('iot:deviecDoc:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询设备档案管理列表")
|
||||
public TableDataInfo list(DeviceDoc deviceDoc)
|
||||
@@ -55,7 +55,7 @@ public class DeviceDocController extends BaseController
|
||||
* 导出设备档案管理列表
|
||||
*/
|
||||
@ApiOperation("导出设备档案管理列表")
|
||||
@PreAuthorize("@ss.hasPermi('iot:deviecDoc:export')")
|
||||
// @PreAuthorize("@ss.hasPermi('iot:deviecDoc:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeviceDoc deviceDoc)
|
||||
{
|
||||
@@ -67,7 +67,7 @@ public class DeviceDocController extends BaseController
|
||||
/**
|
||||
* 获取设备档案管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:deviecDoc:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('iot:deviecDoc:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取设备档案管理详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
@@ -78,7 +78,7 @@ public class DeviceDocController extends BaseController
|
||||
/**
|
||||
* 新增设备档案管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:deviecDoc:add')")
|
||||
// @PreAuthorize("@ss.hasPermi('iot:deviecDoc:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增设备档案管理")
|
||||
public AjaxResult add(@RequestBody DeviceDoc deviceDoc)
|
||||
@@ -89,7 +89,7 @@ public class DeviceDocController extends BaseController
|
||||
/**
|
||||
* 修改设备档案管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:deviecDoc:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('iot:deviecDoc:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改设备档案管理")
|
||||
public AjaxResult edit(@RequestBody DeviceDoc deviceDoc)
|
||||
@@ -100,7 +100,7 @@ public class DeviceDocController extends BaseController
|
||||
/**
|
||||
* 删除设备档案管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:deviecDoc:remove')")
|
||||
// @PreAuthorize("@ss.hasPermi('iot:deviecDoc:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除设备档案管理")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
|
||||
@@ -53,6 +53,15 @@ public class DocController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/alllist")
|
||||
@ApiOperation("查询档案管理列表")
|
||||
public TableDataInfo alllist(Doc doc)
|
||||
{
|
||||
startPage();
|
||||
List<Doc> list = docService.selectDocAllList(doc);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出档案管理列表
|
||||
*/
|
||||
|
||||
@@ -1,26 +1,33 @@
|
||||
package com.xinda.data.controller.datacenter;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinda.common.annotation.Anonymous;
|
||||
|
||||
import com.xinda.common.core.domain.AjaxResult;
|
||||
import com.xinda.common.utils.StringUtils;
|
||||
import com.xinda.iot.domain.DeviceLog;
|
||||
|
||||
import com.xinda.common.utils.poi.ExcelUtil;
|
||||
import com.xinda.iot.model.AlertCountVO;
|
||||
import com.xinda.iot.model.DeviceHistoryParam;
|
||||
import com.xinda.iot.model.HistoryModel;
|
||||
|
||||
import com.xinda.iot.model.ThingsModelLogCountVO;
|
||||
import com.xinda.iot.model.param.DataCenterParam;
|
||||
import com.xinda.iot.model.scenemodel.SceneHistoryParam;
|
||||
import com.xinda.iot.service.DataCenterService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.xinda.common.utils.SecurityUtils.getLoginUser;
|
||||
|
||||
@@ -32,6 +39,7 @@ import static com.xinda.common.utils.SecurityUtils.getLoginUser;
|
||||
*/
|
||||
@Api(tags = "数据中心管理")
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/data/center")
|
||||
public class DataCenterController {
|
||||
|
||||
@@ -55,6 +63,24 @@ public class DataCenterController {
|
||||
return AjaxResult.success(jsonObject);
|
||||
}
|
||||
|
||||
@ApiOperation("导出设备的历史数据为Excel")
|
||||
@PostMapping("/deviceHistoryExport")
|
||||
public void deviceHistoryExport(@RequestBody DeviceHistoryParam deviceHistoryParam, HttpServletResponse response) {
|
||||
if (StringUtils.isEmpty(deviceHistoryParam.getSerialNumber())) {
|
||||
try {
|
||||
response.setContentType("application/json");
|
||||
response.getWriter().print(JSON.toJSONString(AjaxResult.error("请选择设备")));
|
||||
} catch (IOException e) {
|
||||
log.error("导出失败", e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
dataCenterService.deviceHistoryExport(deviceHistoryParam, response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation("查询场景变量历史数据")
|
||||
@PreAuthorize("@ss.hasPermi('dataCenter:history:list')")
|
||||
@GetMapping("/sceneHistory")
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xinda.data.controller.datacenter;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.xinda.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DeviceHistoryData {
|
||||
@Excel(name = "时间")
|
||||
private String time;
|
||||
|
||||
@Excel(name = "数据")
|
||||
private String value;
|
||||
}
|
||||
Reference in New Issue
Block a user