|
|
@@ -2,10 +2,13 @@ package com.middle.platform.manage.biz.controller;
|
|
|
|
|
|
import com.middle.platform.common.exception.BusinessException;
|
|
|
import com.middle.platform.common.utils.Result;
|
|
|
+import com.middle.platform.excel.core.util.ExcelUtils;
|
|
|
import com.middle.platform.manage.biz.domain.req.DevicePage;
|
|
|
import com.middle.platform.manage.biz.domain.req.IotDeviceFlag;
|
|
|
import com.middle.platform.manage.biz.domain.req.IotDevicePara;
|
|
|
+import com.middle.platform.manage.biz.domain.vo.IotDeviceRespVo;
|
|
|
import com.middle.platform.manage.biz.service.IotDeviceService;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
import jakarta.validation.constraints.NotNull;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.apache.commons.io.FilenameUtils;
|
|
|
@@ -15,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
|
@@ -49,7 +53,7 @@ public class IotDeviceController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/list")
|
|
|
- public Result<Object> get( Long productId) {
|
|
|
+ public Result<Object> get(Long productId) {
|
|
|
return Result.ok(iotDeviceService.list(productId), "查询成功");
|
|
|
}
|
|
|
|
|
|
@@ -86,7 +90,7 @@ public class IotDeviceController {
|
|
|
return Result.ok(iotDeviceService.detail(id), "查询成功");
|
|
|
}
|
|
|
|
|
|
-// /**
|
|
|
+ // /**
|
|
|
// * 设备物模型数据详情
|
|
|
// *
|
|
|
// * @param id 设备id
|
|
|
@@ -97,6 +101,19 @@ public class IotDeviceController {
|
|
|
// return Result.ok(iotDeviceService.detail(id), "查询成功");
|
|
|
// }
|
|
|
|
|
|
+ /**
|
|
|
+ * 导入模板
|
|
|
+ *
|
|
|
+ * @param response
|
|
|
+ * @return
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
+ @GetMapping("/importTemplate")
|
|
|
+ public Result<Object> importTemplate(HttpServletResponse response) throws IOException {
|
|
|
+ ExcelUtils.write(response, "设备导入模板.xlsx", "设备", IotDeviceRespVo.class, new ArrayList<>());
|
|
|
+ return Result.ok(true);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 导入设备
|
|
|
*
|