Ver código fonte

巡检项巡检路线

lipenghui 4 meses atrás
pai
commit
79216a4eb9
15 arquivos alterados com 480 adições e 14 exclusões
  1. 4 4
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/item/IotInspectItemController.java
  2. 1 1
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/item/vo/IotInspectItemPageReqVO.java
  3. 1 1
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/item/vo/IotInspectItemRespVO.java
  4. 1 1
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/item/vo/IotInspectItemSaveReqVO.java
  5. 97 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/route/IotInspectRouteController.java
  6. 46 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/route/vo/IotInspectRoutePageReqVO.java
  7. 55 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/route/vo/IotInspectRouteRespVO.java
  8. 42 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/route/vo/IotInspectRouteSaveReqVO.java
  9. 63 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/inspect/IotInspectRouteDO.java
  10. 1 1
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/inspect/IotInspectItemMapper.java
  11. 34 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/inspect/IotInspectRouteMapper.java
  12. 2 4
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/inspect/IotInspectItemService.java
  13. 2 2
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/inspect/IotInspectItemServiceImpl.java
  14. 56 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/inspect/IotInspectRouteService.java
  15. 75 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/inspect/IotInspectRouteServiceImpl.java

+ 4 - 4
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/IotInspectItemController.java → yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/item/IotInspectItemController.java

@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.pms.controller.admin.inspect;
+package cn.iocoder.yudao.module.pms.controller.admin.inspect.item;
 
 import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
@@ -6,9 +6,9 @@ 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.vo.IotInspectItemPageReqVO;
-import cn.iocoder.yudao.module.pms.controller.admin.inspect.vo.IotInspectItemRespVO;
-import cn.iocoder.yudao.module.pms.controller.admin.inspect.vo.IotInspectItemSaveReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo.IotInspectItemPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo.IotInspectItemRespVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo.IotInspectItemSaveReqVO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectItemDO;
 import cn.iocoder.yudao.module.pms.service.inspect.IotInspectItemService;
 import io.swagger.v3.oas.annotations.Operation;

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/vo/IotInspectItemPageReqVO.java → yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/item/vo/IotInspectItemPageReqVO.java

@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.pms.controller.admin.inspect.vo;
+package cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo;
 
 import lombok.*;
 import java.util.*;

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/vo/IotInspectItemRespVO.java → yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/item/vo/IotInspectItemRespVO.java

@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.pms.controller.admin.inspect.vo;
+package cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo;
 
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/vo/IotInspectItemSaveReqVO.java → yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/item/vo/IotInspectItemSaveReqVO.java

@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.pms.controller.admin.inspect.vo;
+package cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo;
 
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;

+ 97 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/route/IotInspectRouteController.java

@@ -0,0 +1,97 @@
+package cn.iocoder.yudao.module.pms.controller.admin.inspect.route;
+
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.route.vo.IotInspectRoutePageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.route.vo.IotInspectRouteRespVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.route.vo.IotInspectRouteSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectRouteDO;
+import cn.iocoder.yudao.module.pms.service.inspect.IotInspectRouteService;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.constraints.*;
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
+
+
+@Tag(name = "管理后台 - 巡检路线")
+@RestController
+@RequestMapping("/rq/iot-inspect-route")
+@Validated
+public class IotInspectRouteController {
+
+    @Resource
+    private IotInspectRouteService iotInspectRouteService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建巡检路线")
+    @PreAuthorize("@ss.hasPermission('rq:iot-inspect-route:create')")
+    public CommonResult<Long> createIotInspectRoute(@Valid @RequestBody IotInspectRouteSaveReqVO createReqVO) {
+        return success(iotInspectRouteService.createIotInspectRoute(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新巡检路线")
+    @PreAuthorize("@ss.hasPermission('rq:iot-inspect-route:update')")
+    public CommonResult<Boolean> updateIotInspectRoute(@Valid @RequestBody IotInspectRouteSaveReqVO updateReqVO) {
+        iotInspectRouteService.updateIotInspectRoute(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除巡检路线")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('rq:iot-inspect-route:delete')")
+    public CommonResult<Boolean> deleteIotInspectRoute(@RequestParam("id") Long id) {
+        iotInspectRouteService.deleteIotInspectRoute(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得巡检路线")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('rq:iot-inspect-route:query')")
+    public CommonResult<IotInspectRouteRespVO> getIotInspectRoute(@RequestParam("id") Long id) {
+        IotInspectRouteDO iotInspectRoute = iotInspectRouteService.getIotInspectRoute(id);
+        return success(BeanUtils.toBean(iotInspectRoute, IotInspectRouteRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得巡检路线分页")
+    @PreAuthorize("@ss.hasPermission('rq:iot-inspect-route:query')")
+    public CommonResult<PageResult<IotInspectRouteRespVO>> getIotInspectRoutePage(@Valid IotInspectRoutePageReqVO pageReqVO) {
+        PageResult<IotInspectRouteDO> pageResult = iotInspectRouteService.getIotInspectRoutePage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, IotInspectRouteRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出巡检路线 Excel")
+    @PreAuthorize("@ss.hasPermission('rq:iot-inspect-route:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportIotInspectRouteExcel(@Valid IotInspectRoutePageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<IotInspectRouteDO> list = iotInspectRouteService.getIotInspectRoutePage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "巡检路线.xls", "数据", IotInspectRouteRespVO.class,
+                        BeanUtils.toBean(list, IotInspectRouteRespVO.class));
+    }
+
+}

+ 46 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/route/vo/IotInspectRoutePageReqVO.java

@@ -0,0 +1,46 @@
+package cn.iocoder.yudao.module.pms.controller.admin.inspect.route.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+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 IotInspectRoutePageReqVO extends PageParam {
+
+    @Schema(description = "路线名称", example = "张三")
+    private String routeName;
+
+    @Schema(description = "设备分类")
+    private Long deviceClassify;
+
+    @Schema(description = "设备id", example = "6972")
+    private Long deviceId;
+
+    @Schema(description = "设备分类名称", example = "李四")
+    private String deviceClassifyName;
+
+    @Schema(description = "设备名称", example = "王五")
+    private String deviceName;
+
+    @Schema(description = "巡检项")
+    private String itemJson;
+
+    @Schema(description = "备注", example = "随便")
+    private String remark;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+    @Schema(description = "部门id", example = "27993")
+    private Long deptId;
+
+}

+ 55 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/route/vo/IotInspectRouteRespVO.java

@@ -0,0 +1,55 @@
+package cn.iocoder.yudao.module.pms.controller.admin.inspect.route.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 巡检路线 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IotInspectRouteRespVO {
+
+    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25340")
+    @ExcelProperty("主键id")
+    private Long id;
+
+    @Schema(description = "路线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
+    @ExcelProperty("路线名称")
+    private String routeName;
+
+    @Schema(description = "设备分类", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("设备分类")
+    private Long deviceClassify;
+
+    @Schema(description = "设备id", example = "6972")
+    @ExcelProperty("设备id")
+    private Long deviceId;
+
+    @Schema(description = "设备分类名称", example = "李四")
+    @ExcelProperty("设备分类名称")
+    private String deviceClassifyName;
+
+    @Schema(description = "设备名称", example = "王五")
+    @ExcelProperty("设备名称")
+    private String deviceName;
+
+    @Schema(description = "巡检项", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("巡检项")
+    private String itemJson;
+
+    @Schema(description = "备注", example = "随便")
+    @ExcelProperty("备注")
+    private String remark;
+
+    @Schema(description = "创建时间")
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "部门id", example = "27993")
+    @ExcelProperty("部门id")
+    private Long deptId;
+
+}

+ 42 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/inspect/route/vo/IotInspectRouteSaveReqVO.java

@@ -0,0 +1,42 @@
+package cn.iocoder.yudao.module.pms.controller.admin.inspect.route.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 巡检路线新增/修改 Request VO")
+@Data
+public class IotInspectRouteSaveReqVO {
+
+    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25340")
+    private Long id;
+
+    @Schema(description = "路线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
+    @NotEmpty(message = "路线名称不能为空")
+    private String routeName;
+
+    @Schema(description = "设备分类", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "设备分类不能为空")
+    private Long deviceClassify;
+
+    @Schema(description = "设备id", example = "6972")
+    private Long deviceId;
+
+    @Schema(description = "设备分类名称", example = "李四")
+    private String deviceClassifyName;
+
+    @Schema(description = "设备名称", example = "王五")
+    private String deviceName;
+
+    @Schema(description = "巡检项", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "巡检项不能为空")
+    private String itemJson;
+
+    @Schema(description = "备注", example = "随便")
+    private String remark;
+
+    @Schema(description = "部门id", example = "27993")
+    private Long deptId;
+
+}

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

@@ -0,0 +1,63 @@
+package cn.iocoder.yudao.module.pms.dal.dataobject.inspect;
+
+import lombok.*;
+import java.util.*;
+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_route")
+@KeySequence("rq_iot_inspect_route_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class IotInspectRouteDO extends BaseDO {
+
+    /**
+     * 主键id
+     */
+    @TableId
+    private Long id;
+    /**
+     * 路线名称
+     */
+    private String routeName;
+    /**
+     * 设备分类
+     */
+    private Long deviceClassify;
+    /**
+     * 设备id
+     */
+    private Long deviceId;
+    /**
+     * 设备分类名称
+     */
+    private String deviceClassifyName;
+    /**
+     * 设备名称
+     */
+    private String deviceName;
+    /**
+     * 巡检项
+     */
+    private String itemJson;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 部门id
+     */
+    private Long deptId;
+
+}

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/inspect/IotInspectItemMapper.java

@@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.pms.dal.mysql.inspect;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
-import cn.iocoder.yudao.module.pms.controller.admin.inspect.vo.IotInspectItemPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo.IotInspectItemPageReqVO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectItemDO;
 import org.apache.ibatis.annotations.Mapper;
 

+ 34 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/inspect/IotInspectRouteMapper.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.route.vo.IotInspectRoutePageReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectRouteDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 巡检路线 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface IotInspectRouteMapper extends BaseMapperX<IotInspectRouteDO> {
+
+    default PageResult<IotInspectRouteDO> selectPage(IotInspectRoutePageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<IotInspectRouteDO>()
+                .likeIfPresent(IotInspectRouteDO::getRouteName, reqVO.getRouteName())
+                .eqIfPresent(IotInspectRouteDO::getDeviceClassify, reqVO.getDeviceClassify())
+                .eqIfPresent(IotInspectRouteDO::getDeviceId, reqVO.getDeviceId())
+                .likeIfPresent(IotInspectRouteDO::getDeviceClassifyName, reqVO.getDeviceClassifyName())
+                .likeIfPresent(IotInspectRouteDO::getDeviceName, reqVO.getDeviceName())
+                .eqIfPresent(IotInspectRouteDO::getItemJson, reqVO.getItemJson())
+                .eqIfPresent(IotInspectRouteDO::getRemark, reqVO.getRemark())
+                .betweenIfPresent(IotInspectRouteDO::getCreateTime, reqVO.getCreateTime())
+                .eqIfPresent(IotInspectRouteDO::getDeptId, reqVO.getDeptId())
+                .orderByDesc(IotInspectRouteDO::getId));
+    }
+
+}

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

@@ -1,11 +1,9 @@
 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.vo.IotInspectItemPageReqVO;
-import cn.iocoder.yudao.module.pms.controller.admin.inspect.vo.IotInspectItemSaveReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo.IotInspectItemPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo.IotInspectItemSaveReqVO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectItemDO;
 
 /**

+ 2 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/inspect/IotInspectItemServiceImpl.java

@@ -2,8 +2,8 @@ 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.vo.IotInspectItemPageReqVO;
-import cn.iocoder.yudao.module.pms.controller.admin.inspect.vo.IotInspectItemSaveReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo.IotInspectItemPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo.IotInspectItemSaveReqVO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.IotProductClassifyDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectItemDO;
 import cn.iocoder.yudao.module.pms.dal.mysql.inspect.IotInspectItemMapper;

+ 56 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/inspect/IotInspectRouteService.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.route.vo.IotInspectRoutePageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.route.vo.IotInspectRouteSaveReqVO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectRouteDO;
+
+/**
+ * 巡检路线 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface IotInspectRouteService {
+
+    /**
+     * 创建巡检路线
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createIotInspectRoute(@Valid IotInspectRouteSaveReqVO createReqVO);
+
+    /**
+     * 更新巡检路线
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateIotInspectRoute(@Valid IotInspectRouteSaveReqVO updateReqVO);
+
+    /**
+     * 删除巡检路线
+     *
+     * @param id 编号
+     */
+    void deleteIotInspectRoute(Long id);
+
+    /**
+     * 获得巡检路线
+     *
+     * @param id 编号
+     * @return 巡检路线
+     */
+    IotInspectRouteDO getIotInspectRoute(Long id);
+
+    /**
+     * 获得巡检路线分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 巡检路线分页
+     */
+    PageResult<IotInspectRouteDO> getIotInspectRoutePage(IotInspectRoutePageReqVO pageReqVO);
+
+}

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

@@ -0,0 +1,75 @@
+package cn.iocoder.yudao.module.pms.service.inspect;
+
+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.inspect.IotInspectRouteDO;
+import cn.iocoder.yudao.module.pms.dal.mysql.inspect.IotInspectRouteMapper;
+import cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant;
+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 static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+
+/**
+ * 巡检路线 Service 实现类
+ *
+ * @author 芋道源码
+ */
+@Service
+@Validated
+public class IotInspectRouteServiceImpl implements IotInspectRouteService {
+
+    @Resource
+    private IotInspectRouteMapper iotInspectRouteMapper;
+
+    @Override
+    public Long createIotInspectRoute(IotInspectRouteSaveReqVO createReqVO) {
+        // 插入
+        IotInspectRouteDO iotInspectRoute = BeanUtils.toBean(createReqVO, IotInspectRouteDO.class);
+        iotInspectRouteMapper.insert(iotInspectRoute);
+        // 返回
+        return iotInspectRoute.getId();
+    }
+
+    @Override
+    public void updateIotInspectRoute(IotInspectRouteSaveReqVO updateReqVO) {
+        // 校验存在
+        validateIotInspectRouteExists(updateReqVO.getId());
+        // 更新
+        IotInspectRouteDO updateObj = BeanUtils.toBean(updateReqVO, IotInspectRouteDO.class);
+        iotInspectRouteMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteIotInspectRoute(Long id) {
+        // 校验存在
+        validateIotInspectRouteExists(id);
+        // 删除
+        iotInspectRouteMapper.deleteById(id);
+    }
+
+    private void validateIotInspectRouteExists(Long id) {
+        if (iotInspectRouteMapper.selectById(id) == null) {
+            throw exception(ErrorCodeConstant.IOT_INSPECT_ROUTE_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public IotInspectRouteDO getIotInspectRoute(Long id) {
+        return iotInspectRouteMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<IotInspectRouteDO> getIotInspectRoutePage(IotInspectRoutePageReqVO pageReqVO) {
+        return iotInspectRouteMapper.selectPage(pageReqVO);
+    }
+
+}