lipenghui il y a 3 mois
Parent
commit
0ea8cf2b24
11 fichiers modifiés avec 498 ajouts et 8 suppressions
  1. 1 0
      yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/enums/ErrorCodeConstant.java
  2. 102 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/plan/IotInspectPlanController.java
  3. 48 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/plan/vo/IotInspectPlanPageReqVO.java
  4. 57 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/plan/vo/IotInspectPlanRespVO.java
  5. 48 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/plan/vo/IotInspectPlanSaveReqVO.java
  6. 65 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/inspect/IotInspectPlanDO.java
  7. 4 1
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/inspect/IotInspectRouteDO.java
  8. 34 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/inspect/IotInspectPlanMapper.java
  9. 56 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/inspect/IotInspectPlanService.java
  10. 79 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/inspect/IotInspectPlanServiceImpl.java
  11. 4 7
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/inspect/IotInspectRouteServiceImpl.java

+ 1 - 0
yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/enums/ErrorCodeConstant.java

@@ -40,4 +40,5 @@ public interface ErrorCodeConstant{
     ErrorCode IOT_MAINTENANCE_BOM_NOT_EXISTS = new ErrorCode(135, "PMS 保养计划明细BOM不存在");
     ErrorCode IOT_MAIN_PLAN_BOM_MATERIAL_NOT_EXISTS = new ErrorCode(136, "PMS 保养计划明细设备BOM挂载物料关联不存在");
     ErrorCode IOT_INSPECT_ROUTE_NOT_EXISTS = new ErrorCode(134, "巡检项不存在");
+    ErrorCode IOT_INSPECT_PLAN_NOT_EXISTS = new ErrorCode(135, "巡检计划不存在");
 }

+ 102 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/plan/IotInspectPlanController.java

@@ -0,0 +1,102 @@
+package cn.iocoder.yudao.module.pms.controller.admin.inspect.plan;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.plan.vo.IotInspectPlanPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.plan.vo.IotInspectPlanRespVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.plan.vo.IotInspectPlanSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectPlanDO;
+import cn.iocoder.yudao.module.pms.service.inspect.IotInspectPlanService;
+import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserUpdateStatusReqVO;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+
+@Tag(name = "管理后台 - 巡检计划")
+@RestController
+@RequestMapping("/rq/iot-inspect-plan")
+@Validated
+public class IotInspectPlanController {
+
+    @Resource
+    private IotInspectPlanService iotInspectPlanService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建巡检计划")
+    @PreAuthorize("@ss.hasPermission('rq:iot-inspect-plan:create')")
+    public CommonResult<Long> createIotInspectPlan(@Valid @RequestBody IotInspectPlanSaveReqVO createReqVO) {
+        return success(iotInspectPlanService.createIotInspectPlan(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新巡检计划")
+    @PreAuthorize("@ss.hasPermission('rq:iot-inspect-plan:update')")
+    public CommonResult<Boolean> updateIotInspectPlan(@Valid @RequestBody IotInspectPlanSaveReqVO updateReqVO) {
+        iotInspectPlanService.updateIotInspectPlan(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除巡检计划")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('rq:iot-inspect-plan:delete')")
+    public CommonResult<Boolean> deleteIotInspectPlan(@RequestParam("id") Long id) {
+        iotInspectPlanService.deleteIotInspectPlan(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得巡检计划")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('rq:iot-inspect-plan:query')")
+    public CommonResult<IotInspectPlanRespVO> getIotInspectPlan(@RequestParam("id") Long id) {
+        IotInspectPlanDO iotInspectPlan = iotInspectPlanService.getIotInspectPlan(id);
+        return success(BeanUtils.toBean(iotInspectPlan, IotInspectPlanRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得巡检计划分页")
+    @PreAuthorize("@ss.hasPermission('rq:iot-inspect-plan:query')")
+    public CommonResult<PageResult<IotInspectPlanRespVO>> getIotInspectPlanPage(@Valid IotInspectPlanPageReqVO pageReqVO) {
+        PageResult<IotInspectPlanDO> pageResult = iotInspectPlanService.getIotInspectPlanPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, IotInspectPlanRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出巡检计划 Excel")
+    @PreAuthorize("@ss.hasPermission('rq:iot-inspect-plan:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportIotInspectPlanExcel(@Valid IotInspectPlanPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<IotInspectPlanDO> list = iotInspectPlanService.getIotInspectPlanPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "巡检计划.xls", "数据", IotInspectPlanRespVO.class,
+                        BeanUtils.toBean(list, IotInspectPlanRespVO.class));
+    }
+
+    @PutMapping("/update-status")
+    @Operation(summary = "修改巡检计划状态")
+    @PreAuthorize("@ss.hasPermission('rq:iot-inspect-plan:update')")
+    public CommonResult<Boolean> updateUserStatus(@Valid @RequestBody UserUpdateStatusReqVO reqVO) {
+        iotInspectPlanService.updateInspectPlanStatus(reqVO.getId(), reqVO.getStatus());
+        return success(true);
+    }
+}

+ 48 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/plan/vo/IotInspectPlanPageReqVO.java

@@ -0,0 +1,48 @@
+package cn.iocoder.yudao.module.pms.controller.admin.inspect.plan.vo;
+
+import lombok.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 巡检计划分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class IotInspectPlanPageReqVO extends PageParam {
+
+    @Schema(description = "巡检计划标题")
+    private String planTitle;
+
+    @Schema(description = "巡检计划编号")
+    private String planCode;
+
+    @Schema(description = "周期")
+    private BigDecimal planCycle;
+
+    @Schema(description = "单位")
+    private String planUnit;
+
+    @Schema(description = "负责人")
+    private String charge;
+
+    @Schema(description = "设备")
+    private String deviceIds;
+
+    @Schema(description = "备注", example = "随便")
+    private String remark;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+    @Schema(description = "部门id", example = "21365")
+    private Long deptId;
+
+    @Schema(description = "状态")
+    private Integer status;
+}

+ 57 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/plan/vo/IotInspectPlanRespVO.java

@@ -0,0 +1,57 @@
+package cn.iocoder.yudao.module.pms.controller.admin.inspect.plan.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 巡检计划 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IotInspectPlanRespVO {
+
+    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6280")
+    @ExcelProperty("主键id")
+    private Long id;
+
+    @Schema(description = "巡检计划标题", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("巡检计划标题")
+    private String planTitle;
+
+    @Schema(description = "巡检计划编号", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("巡检计划编号")
+    private String planCode;
+
+    @Schema(description = "周期", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("周期")
+    private BigDecimal planCycle;
+
+    @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("单位")
+    private String planUnit;
+
+    @Schema(description = "负责人", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("负责人")
+    private String charge;
+
+    @Schema(description = "设备", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("设备")
+    private String deviceIds;
+
+    @Schema(description = "备注", example = "随便")
+    @ExcelProperty("备注")
+    private String remark;
+
+    @Schema(description = "创建时间")
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "部门id", example = "21365")
+    @ExcelProperty("部门id")
+    private Long deptId;
+
+    @Schema(description = "状态")
+    private Integer status;
+}

+ 48 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/plan/vo/IotInspectPlanSaveReqVO.java

@@ -0,0 +1,48 @@
+package cn.iocoder.yudao.module.pms.controller.admin.inspect.plan.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import javax.validation.constraints.*;
+import java.math.BigDecimal;
+
+@Schema(description = "管理后台 - 巡检计划新增/修改 Request VO")
+@Data
+public class IotInspectPlanSaveReqVO {
+
+    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6280")
+    private Long id;
+
+    @Schema(description = "巡检计划标题", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "巡检计划标题不能为空")
+    private String planTitle;
+
+    @Schema(description = "巡检计划编号", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "巡检计划编号不能为空")
+    private String planCode;
+
+    @Schema(description = "周期", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "周期不能为空")
+    private BigDecimal planCycle;
+
+    @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "单位不能为空")
+    private String planUnit;
+
+    @Schema(description = "负责人", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "负责人不能为空")
+    private String charge;
+
+    @Schema(description = "设备", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "设备不能为空")
+    private String deviceIds;
+
+    @Schema(description = "备注", example = "随便")
+    private String remark;
+
+    @Schema(description = "部门id", example = "21365")
+    private Long deptId;
+
+    @Schema(description = "状态")
+    private Integer status;
+}

+ 65 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/inspect/IotInspectPlanDO.java

@@ -0,0 +1,65 @@
+package cn.iocoder.yudao.module.pms.dal.dataobject.inspect;
+
+import lombok.*;
+import java.util.*;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 巡检计划 DO
+ *
+ * @author 芋道源码
+ */
+@TableName("rq_iot_inspect_plan")
+@KeySequence("rq_iot_inspect_plan_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class IotInspectPlanDO extends BaseDO {
+
+    /**
+     * 主键id
+     */
+    @TableId
+    private Long id;
+    /**
+     * 巡检计划标题
+     */
+    private String planTitle;
+    /**
+     * 巡检计划编号
+     */
+    private String planCode;
+    /**
+     * 周期
+     */
+    private BigDecimal planCycle;
+    /**
+     * 单位
+     */
+    private String planUnit;
+    /**
+     * 负责人
+     */
+    private String charge;
+    /**
+     * 设备
+     */
+    private String deviceIds;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 部门id
+     */
+    private Long deptId;
+
+    private Integer status;
+}

+ 4 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/inspect/IotInspectRouteDO.java

@@ -59,5 +59,8 @@ public class IotInspectRouteDO extends BaseDO {
      * 部门id
      */
     private Long deptId;
-
+    /**
+     * 设备编码
+     */
+    private String deviceCode;
 }

+ 34 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/inspect/IotInspectPlanMapper.java

@@ -0,0 +1,34 @@
+package cn.iocoder.yudao.module.pms.dal.mysql.inspect;
+
+import java.util.*;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.plan.vo.IotInspectPlanPageReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectPlanDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 巡检计划 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface IotInspectPlanMapper extends BaseMapperX<IotInspectPlanDO> {
+
+    default PageResult<IotInspectPlanDO> selectPage(IotInspectPlanPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<IotInspectPlanDO>()
+                .eqIfPresent(IotInspectPlanDO::getPlanTitle, reqVO.getPlanTitle())
+                .eqIfPresent(IotInspectPlanDO::getPlanCode, reqVO.getPlanCode())
+                .eqIfPresent(IotInspectPlanDO::getPlanCycle, reqVO.getPlanCycle())
+                .eqIfPresent(IotInspectPlanDO::getPlanUnit, reqVO.getPlanUnit())
+                .eqIfPresent(IotInspectPlanDO::getCharge, reqVO.getCharge())
+                .eqIfPresent(IotInspectPlanDO::getDeviceIds, reqVO.getDeviceIds())
+                .eqIfPresent(IotInspectPlanDO::getRemark, reqVO.getRemark())
+                .betweenIfPresent(IotInspectPlanDO::getCreateTime, reqVO.getCreateTime())
+                .eqIfPresent(IotInspectPlanDO::getDeptId, reqVO.getDeptId())
+                .orderByDesc(IotInspectPlanDO::getId));
+    }
+
+}

+ 56 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/inspect/IotInspectPlanService.java

@@ -0,0 +1,56 @@
+package cn.iocoder.yudao.module.pms.service.inspect;
+
+import java.util.*;
+import javax.validation.*;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.plan.vo.IotInspectPlanPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.plan.vo.IotInspectPlanSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectPlanDO;
+
+/**
+ * 巡检计划 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface IotInspectPlanService {
+    void updateInspectPlanStatus(Long id, Integer status);
+    /**
+     * 创建巡检计划
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createIotInspectPlan(@Valid IotInspectPlanSaveReqVO createReqVO);
+
+    /**
+     * 更新巡检计划
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateIotInspectPlan(@Valid IotInspectPlanSaveReqVO updateReqVO);
+
+    /**
+     * 删除巡检计划
+     *
+     * @param id 编号
+     */
+    void deleteIotInspectPlan(Long id);
+
+    /**
+     * 获得巡检计划
+     *
+     * @param id 编号
+     * @return 巡检计划
+     */
+    IotInspectPlanDO getIotInspectPlan(Long id);
+
+    /**
+     * 获得巡检计划分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 巡检计划分页
+     */
+    PageResult<IotInspectPlanDO> getIotInspectPlanPage(IotInspectPlanPageReqVO pageReqVO);
+
+}

+ 79 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/inspect/IotInspectPlanServiceImpl.java

@@ -0,0 +1,79 @@
+package cn.iocoder.yudao.module.pms.service.inspect;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.plan.vo.IotInspectPlanPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.plan.vo.IotInspectPlanSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectPlanDO;
+import cn.iocoder.yudao.module.pms.dal.mysql.inspect.IotInspectPlanMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_INSPECT_PLAN_NOT_EXISTS;
+
+/**
+ * 巡检计划 Service 实现类
+ *
+ * @author 芋道源码
+ */
+@Service
+@Validated
+public class IotInspectPlanServiceImpl implements IotInspectPlanService {
+
+    @Resource
+    private IotInspectPlanMapper iotInspectPlanMapper;
+
+    @Override
+    public void updateInspectPlanStatus(Long id, Integer status) {
+        IotInspectPlanDO iotInspectPlanDO = iotInspectPlanMapper.selectById(id).setStatus(status);
+        iotInspectPlanMapper.updateById(iotInspectPlanDO);
+    }
+
+    @Override
+    public Long createIotInspectPlan(IotInspectPlanSaveReqVO createReqVO) {
+        // 插入
+        IotInspectPlanDO iotInspectPlan = BeanUtils.toBean(createReqVO, IotInspectPlanDO.class);
+        iotInspectPlan.setDeleted(false);
+        iotInspectPlan.setStatus(0);
+        iotInspectPlanMapper.insert(iotInspectPlan);
+        // 返回
+        return iotInspectPlan.getId();
+    }
+
+    @Override
+    public void updateIotInspectPlan(IotInspectPlanSaveReqVO updateReqVO) {
+        // 校验存在
+        validateIotInspectPlanExists(updateReqVO.getId());
+        // 更新
+        IotInspectPlanDO updateObj = BeanUtils.toBean(updateReqVO, IotInspectPlanDO.class);
+        iotInspectPlanMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteIotInspectPlan(Long id) {
+        // 校验存在
+        validateIotInspectPlanExists(id);
+        // 删除
+        iotInspectPlanMapper.deleteById(id);
+    }
+
+    private void validateIotInspectPlanExists(Long id) {
+        if (iotInspectPlanMapper.selectById(id) == null) {
+            throw exception(IOT_INSPECT_PLAN_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public IotInspectPlanDO getIotInspectPlan(Long id) {
+        return iotInspectPlanMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<IotInspectPlanDO> getIotInspectPlanPage(IotInspectPlanPageReqVO pageReqVO) {
+        return iotInspectPlanMapper.selectPage(pageReqVO);
+    }
+
+}

+ 4 - 7
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/inspect/IotInspectRouteServiceImpl.java

@@ -1,5 +1,7 @@
 package cn.iocoder.yudao.module.pms.service.inspect;
 
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 import cn.iocoder.yudao.module.pms.controller.admin.inspect.route.vo.IotInspectRoutePageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.inspect.route.vo.IotInspectRouteSaveReqVO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.IotProductClassifyDO;
@@ -8,15 +10,10 @@ import cn.iocoder.yudao.module.pms.dal.mysql.inspect.IotInspectRouteMapper;
 import cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant;
 import cn.iocoder.yudao.module.pms.service.IotProductClassifyService;
 import org.springframework.stereotype.Service;
-import javax.annotation.Resource;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.*;
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.common.pojo.PageParam;
-import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 
+import javax.annotation.Resource;
+import java.util.Objects;
 
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;