|
|
@@ -135,17 +135,13 @@ public class IotTemplate2DeviceService {
|
|
|
}
|
|
|
|
|
|
public ResultContent deletes(IDsParam param) {
|
|
|
- IotTemplate2Device iotTemplate2Device = iotTemplate2DeviceDao.findTopById(id);
|
|
|
- if (ObjectUtils.isEmpty(iotTemplate2Device)) {
|
|
|
- return ResultContent.buildFail("数据不存在");
|
|
|
- }
|
|
|
- iotTemplate2DeviceDao.delete(iotTemplate2Device);
|
|
|
-
|
|
|
- IotTemplate iotTemplate = iotTemplate2Device.getIotTemplate();
|
|
|
- // 删除物模型
|
|
|
- if (ObjectUtils.isNotEmpty(iotTemplate)) {
|
|
|
- iotService.deleteTemplate(iotTemplate.getId());
|
|
|
+ List<String> ids = param.getIds();
|
|
|
+ if (ObjectUtils.isEmpty(ids)) {
|
|
|
+ return ResultContent.buildFail("ids不能为空");
|
|
|
}
|
|
|
+ ids.stream().forEach(id -> {
|
|
|
+ delete(id);
|
|
|
+ });
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
|
|