diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/error/controller/DeviceFalutController.java b/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/error/controller/DeviceFalutController.java new file mode 100644 index 000000000..abf3082f0 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/pdm/error/controller/DeviceFalutController.java @@ -0,0 +1,42 @@ +package org.nl.b_lms.pdm.error.controller; + +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.nl.b_lms.pdm.error.service.DeviceFaultService; +import org.nl.common.TableDataInfo; +import org.nl.common.domain.query.PageQuery; +import org.nl.modules.logging.annotation.Log; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Map; + +/** + * @author lyd + * @date 2024-02-26 + **/ +@Slf4j +@RestController +@RequestMapping("/api/deviceFault") +public class DeviceFalutController { + + @Autowired + private DeviceFaultService deviceFaultService; + + @GetMapping + @Log("查询故障设备时长记录") + public ResponseEntity query(@RequestParam Map whereJson, PageQuery page) { + return new ResponseEntity<>(TableDataInfo.build(deviceFaultService.queryAll(whereJson, page)), HttpStatus.OK); + } + + @Log("导出数据") + @GetMapping(value = "/download") + public void download(@RequestParam Map map, HttpServletResponse response) throws IOException { + deviceFaultService.download(map, response); + } + +}