diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/DeviceController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/DeviceController.java index d4498589..5829f56e 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/DeviceController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/DeviceController.java @@ -12,6 +12,7 @@ package cc.iotkit.manager.controller; import cc.iotkit.common.api.PageRequest; import cc.iotkit.common.api.Paging; import cc.iotkit.common.api.Request; +import cc.iotkit.common.api.Response; import cc.iotkit.common.excel.utils.ExcelUtil; import cc.iotkit.common.thing.ThingModelMessage; import cc.iotkit.manager.dto.bo.device.*; @@ -34,6 +35,7 @@ import cc.iotkit.model.device.DeviceGroup; import cc.iotkit.model.device.DeviceInfo; import cc.iotkit.model.device.message.DeviceProperty; import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.IdUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -241,8 +243,8 @@ public class DeviceController { @ApiOperation(value = "导入设备分组") @SaCheckPermission("iot:deviceGroup:add") @PostMapping("/group/importData") - public String importGroup(@RequestPart("file") MultipartFile file, @RequestParam("requestId") String requestId) { - return deviceServiceImpl.importGroup(file); + public Response importGroup(@RequestPart("file") MultipartFile file, @RequestParam("requestId") String requestId) { + return new Response(200, deviceServiceImpl.importGroup(file), null, requestId); } /** diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/listener/DeviceGroupImportListener.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/listener/DeviceGroupImportListener.java index c514c34c..1ec6be3f 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/listener/DeviceGroupImportListener.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/listener/DeviceGroupImportListener.java @@ -5,6 +5,7 @@ import cc.iotkit.common.excel.core.ExcelResult; import cc.iotkit.common.exception.BizException; import cc.iotkit.common.satoken.utils.LoginHelper; import cc.iotkit.common.utils.SpringUtils; +import cc.iotkit.common.utils.StringUtils; import cc.iotkit.manager.dto.bo.devicegroup.DeviceGroupBo; import cc.iotkit.manager.dto.vo.devicegroup.DeviceGroupImportVo; import cc.iotkit.manager.dto.vo.devicegroup.DeviceGroupVo; @@ -69,6 +70,12 @@ public class DeviceGroupImportListener extends AnalysisEventListener