zss
9 天以前 51ec98113c6d49d0f7eec4e3c030e55e337e97db
cnas-server/src/main/java/com/yuanchu/mom/controller/DeviceStateController.java
@@ -29,7 +29,7 @@
 * 设备停用/启用 前端控制器
 * </p>
 *
 * @author 芯导软件(江苏)有限公司
 * @author
 * @since 2024-09-26 09:51:40
 */
@RestController
@@ -43,6 +43,7 @@
    private NumberGenerator<DeviceState> numberGenerator;
    @PostMapping("saveDeviceState")
    @ValueAuth
    public Result saveIncidentReportData(@RequestBody DeviceState deviceState) {
        if (ObjectUtils.isEmpty(deviceState.getProcessNumber())) {
            String year = new SimpleDateFormat("yy", Locale.CHINESE).format(new Date());
@@ -55,16 +56,19 @@
    }
    @GetMapping("/getDeviceStatePage")
    @ValueAuth
    public Result getDeviceStatePage(@RequestParam("deviceId") Integer deviceId, Page page, String processNumber){
        return Result.success(deviceStateService.getDeviceStatePage(deviceId, page, processNumber));
    }
    @DeleteMapping("/deleteDeviceState")
    @ValueAuth
    public Result deleteDeviceState(@RequestParam("stateId") Integer stateId){
        return Result.success(deviceStateService.removeById(stateId));
    }
    @PostMapping("/deviceStateExport")
    @ValueAuth
    public Result deviceStateExport(@RequestParam("deviceId") Integer deviceId, String processNumber, HttpServletResponse response) throws Exception {
        IPage<DeviceStateDto> deviceBorrows = deviceStateService.getDeviceStatePage(deviceId, new Page<>(1, -1), processNumber);
        List<DeviceStateExport> studentList  = JSONObject.parseArray(JSON.toJSONString(deviceBorrows.getRecords()), DeviceStateExport.class);