From 1dc08ab054882d7c0bb48495af1a3eeb2b536c2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com>
Date: Tue, 29 Oct 2024 18:07:15 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A3=80=E6=B5=8B?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../inspection/DlInspectionProjectMapper.xml | 27 +++++++++++++++++++
1 file changed, 27 insertions(+)
create mode 100644 dl-module-inspection/src/main/resources/mapper/inspection/DlInspectionProjectMapper.xml
diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/DlInspectionProjectMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/DlInspectionProjectMapper.xml
new file mode 100644
index 00000000..93c01800
--- /dev/null
+++ b/dl-module-inspection/src/main/resources/mapper/inspection/DlInspectionProjectMapper.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
From 573671450636d078161f8bfca9f9a62e3f5bc2fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com>
Date: Tue, 29 Oct 2024 18:08:28 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A3=80=E6=B5=8B?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DlInspectionProjectController.java | 85 +++++++++++++++++++
.../entity/DlInspectionProject.java | 41 +++++++++
.../mapper/DlInspectionProjectMapper.java | 19 +++++
.../service/DlInspectionProjectService.java | 57 +++++++++++++
.../impl/DlInspectionProjectServiceImpl.java | 68 +++++++++++++++
.../vo/DlInspectionProjectPageReqVO.java | 17 ++++
.../vo/DlInspectionProjectRespVO.java | 15 ++++
.../vo/DlInspectionProjectSaveReqVO.java | 13 +++
8 files changed, 315 insertions(+)
create mode 100644 dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/DlInspectionProjectController.java
create mode 100644 dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/DlInspectionProject.java
create mode 100644 dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/DlInspectionProjectMapper.java
create mode 100644 dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/DlInspectionProjectService.java
create mode 100644 dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/DlInspectionProjectServiceImpl.java
create mode 100644 dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/DlInspectionProjectPageReqVO.java
create mode 100644 dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/DlInspectionProjectRespVO.java
create mode 100644 dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/DlInspectionProjectSaveReqVO.java
diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/DlInspectionProjectController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/DlInspectionProjectController.java
new file mode 100644
index 00000000..076a74f4
--- /dev/null
+++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/DlInspectionProjectController.java
@@ -0,0 +1,85 @@
+package cn.iocoder.yudao.module.inspection.controller;
+
+import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
+import cn.iocoder.yudao.module.inspection.service.DlInspectionProjectService;
+import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectPageReqVO;
+import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectRespVO;
+import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectSaveReqVO;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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;
+
+
+@Tag(name = "管理后台 - 检测项目")
+@RestController
+@RequestMapping("/admin-api/inspection/dl-inspection-project")
+@Validated
+public class DlInspectionProjectController {
+
+ @Resource
+ private DlInspectionProjectService dlInspectionProjectService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建检测项目")
+ @PreAuthorize("@ss.hasPermission('inspection:dl-inspection-project:create')")
+ public CommonResult createDlInspectionProject(@Valid @RequestBody DlInspectionProjectSaveReqVO createReqVO) {
+ return success(dlInspectionProjectService.createDlInspectionProject(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新检测项目")
+ @PreAuthorize("@ss.hasPermission('inspection:dl-inspection-project:update')")
+ public CommonResult updateDlInspectionProject(@Valid @RequestBody DlInspectionProjectSaveReqVO updateReqVO) {
+ dlInspectionProjectService.updateDlInspectionProject(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除检测项目")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('inspection:dl-inspection-project:delete')")
+ public CommonResult deleteDlInspectionProject(@RequestParam("id") String id) {
+ dlInspectionProjectService.deleteDlInspectionProject(id);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得检测项目")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('inspection:dl-inspection-project:query')")
+ public CommonResult getDlInspectionProject(@RequestParam("id") String id) {
+ DlInspectionProject dlInspectionProject = dlInspectionProjectService.getDlInspectionProject(id);
+ return success(BeanUtils.toBean(dlInspectionProject, DlInspectionProjectRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得检测项目分页")
+ @PreAuthorize("@ss.hasPermission('inspection:dl-inspection-project:query')")
+ public CommonResult> getDlInspectionProjectPage(@Valid DlInspectionProjectPageReqVO pageReqVO,
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+ IPage page = new Page<>(pageNo, pageSize);
+ IPage pageResult = dlInspectionProjectService.getDlInspectionProjectPage(page,pageReqVO);
+ return success(pageResult);
+ }
+
+
+}
\ No newline at end of file
diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/DlInspectionProject.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/DlInspectionProject.java
new file mode 100644
index 00000000..7e68bd8c
--- /dev/null
+++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/DlInspectionProject.java
@@ -0,0 +1,41 @@
+package cn.iocoder.yudao.module.inspection.entity;
+
+import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+/**
+ * 检测项目
+ *
+ * @author 若依
+ */
+@TableName("inspection_project")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class DlInspectionProject extends TenantBaseDO {
+
+ /**
+ * 主键
+ */
+ @TableId(type = IdType.ASSIGN_UUID)
+ private String id;
+ /**
+ * 检测项目名称
+ */
+ private String projectName;
+ /**
+ * 角色id(system_role表的id)
+ */
+ private Long roleId;
+ /**
+ * 备注
+ */
+ private String remark;
+
+}
\ No newline at end of file
diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/DlInspectionProjectMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/DlInspectionProjectMapper.java
new file mode 100644
index 00000000..b00d94c0
--- /dev/null
+++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/DlInspectionProjectMapper.java
@@ -0,0 +1,19 @@
+package cn.iocoder.yudao.module.inspection.mapper;
+
+import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
+import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectPageReqVO;
+import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectRespVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 检测项目 Mapper
+ *
+ * @author 若依
+ */
+@Mapper
+public interface DlInspectionProjectMapper extends BaseMapper {
+ IPage selectListPage(@Param("page") IPage page,@Param("entity") DlInspectionProjectPageReqVO pageReqVO);
+}
\ No newline at end of file
diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/DlInspectionProjectService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/DlInspectionProjectService.java
new file mode 100644
index 00000000..70a8df08
--- /dev/null
+++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/DlInspectionProjectService.java
@@ -0,0 +1,57 @@
+package cn.iocoder.yudao.module.inspection.service;
+
+import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
+import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectPageReqVO;
+import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectRespVO;
+import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectSaveReqVO;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import javax.validation.Valid;
+
+/**
+ * 检测项目 Service 接口
+ *
+ * @author 若依
+ */
+public interface DlInspectionProjectService extends IService {
+
+ /**
+ * 创建检测项目
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ String createDlInspectionProject(@Valid DlInspectionProjectSaveReqVO createReqVO);
+
+ /**
+ * 更新检测项目
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updateDlInspectionProject(@Valid DlInspectionProjectSaveReqVO updateReqVO);
+
+ /**
+ * 删除检测项目
+ *
+ * @param id 编号
+ */
+ void deleteDlInspectionProject(String id);
+
+ /**
+ * 获得检测项目
+ *
+ * @param id 编号
+ * @return 检测项目
+ */
+ DlInspectionProject getDlInspectionProject(String id);
+
+ /**
+ * 获得检测项目分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 检测项目分页
+ */
+ IPage getDlInspectionProjectPage(IPage page, DlInspectionProjectPageReqVO pageReqVO);
+
+}
\ No newline at end of file
diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/DlInspectionProjectServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/DlInspectionProjectServiceImpl.java
new file mode 100644
index 00000000..9e460e00
--- /dev/null
+++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/DlInspectionProjectServiceImpl.java
@@ -0,0 +1,68 @@
+package cn.iocoder.yudao.module.inspection.service.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
+import cn.iocoder.yudao.module.inspection.mapper.DlInspectionProjectMapper;
+import cn.iocoder.yudao.module.inspection.service.DlInspectionProjectService;
+import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectPageReqVO;
+import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectRespVO;
+import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectSaveReqVO;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+
+
+/**
+ * 检测项目 Service 实现类
+ *
+ * @author 若依
+ */
+@Service
+@Validated
+public class DlInspectionProjectServiceImpl extends ServiceImpl implements DlInspectionProjectService {
+
+ @Resource
+ private DlInspectionProjectMapper dlInspectionProjectMapper;
+
+ @Override
+ public String createDlInspectionProject(DlInspectionProjectSaveReqVO createReqVO) {
+ // 插入
+ DlInspectionProject dlInspectionProject = BeanUtils.toBean(createReqVO, DlInspectionProject.class);
+ dlInspectionProject.setDeleted(false);
+ dlInspectionProjectMapper.insert(dlInspectionProject);
+ // 返回
+ return dlInspectionProject.getId();
+ }
+
+ @Override
+ public void updateDlInspectionProject(DlInspectionProjectSaveReqVO updateReqVO) {
+
+ // 更新
+ DlInspectionProject updateObj = BeanUtils.toBean(updateReqVO, DlInspectionProject.class);
+ dlInspectionProjectMapper.updateById(updateObj);
+ }
+
+ @Override
+ public void deleteDlInspectionProject(String id) {
+ // 删除
+ dlInspectionProjectMapper.deleteById(id);
+ }
+
+
+
+ @Override
+ public DlInspectionProject getDlInspectionProject(String id) {
+ return dlInspectionProjectMapper.selectById(id);
+ }
+
+ @Override
+ public IPage getDlInspectionProjectPage(IPage page, DlInspectionProjectPageReqVO pageReqVO) {
+ return baseMapper.selectListPage(page, pageReqVO);
+ }
+
+}
\ No newline at end of file
diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/DlInspectionProjectPageReqVO.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/DlInspectionProjectPageReqVO.java
new file mode 100644
index 00000000..b5a38270
--- /dev/null
+++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/DlInspectionProjectPageReqVO.java
@@ -0,0 +1,17 @@
+package cn.iocoder.yudao.module.inspection.vo;
+
+import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@Schema(description = "管理后台 - 检测项目分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class DlInspectionProjectPageReqVO extends DlInspectionProject {
+
+
+
+}
\ No newline at end of file
diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/DlInspectionProjectRespVO.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/DlInspectionProjectRespVO.java
new file mode 100644
index 00000000..bcea03b4
--- /dev/null
+++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/DlInspectionProjectRespVO.java
@@ -0,0 +1,15 @@
+package cn.iocoder.yudao.module.inspection.vo;
+
+import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 检测项目 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class DlInspectionProjectRespVO extends DlInspectionProject {
+
+
+
+}
\ No newline at end of file
diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/DlInspectionProjectSaveReqVO.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/DlInspectionProjectSaveReqVO.java
new file mode 100644
index 00000000..935351f2
--- /dev/null
+++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/vo/DlInspectionProjectSaveReqVO.java
@@ -0,0 +1,13 @@
+package cn.iocoder.yudao.module.inspection.vo;
+
+import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 检测项目新增/修改 Request VO")
+@Data
+public class DlInspectionProjectSaveReqVO extends DlInspectionProject {
+
+
+
+}
\ No newline at end of file