|
@@ -4,6 +4,8 @@ import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
+import com.middle.platform.common.constant.Global;
|
|
|
|
|
+import com.middle.platform.common.exception.BusinessException;
|
|
|
import com.middle.platform.manage.api.enums.DeviceStatus;
|
|
import com.middle.platform.manage.api.enums.DeviceStatus;
|
|
|
import com.middle.platform.manage.biz.domain.req.ChangeStatus;
|
|
import com.middle.platform.manage.biz.domain.req.ChangeStatus;
|
|
|
import com.middle.platform.manage.biz.domain.req.IotProjectPara;
|
|
import com.middle.platform.manage.biz.domain.req.IotProjectPara;
|
|
@@ -19,6 +21,7 @@ import org.springframework.stereotype.Service;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 项目
|
|
* 项目
|
|
@@ -74,6 +77,10 @@ public class IotProjectService extends ServiceImpl<IotProjectMapper, IotProject>
|
|
|
* @date 2023-12-23 14:35
|
|
* @date 2023-12-23 14:35
|
|
|
*/
|
|
*/
|
|
|
public int remove(Long id) {
|
|
public int remove(Long id) {
|
|
|
|
|
+ IotProject iotProject = iotProjectMapper.selectById(id);
|
|
|
|
|
+ if (Objects.isNull(iotProject)|| iotProject.getDelFlag() == Global.DEL) {
|
|
|
|
|
+ throw new BusinessException("项目不存在");
|
|
|
|
|
+ }
|
|
|
return iotProjectMapper.delete(id);
|
|
return iotProjectMapper.delete(id);
|
|
|
}
|
|
}
|
|
|
|
|
|