From f1c938f579d23859cceea58893945ecc50557fc0 Mon Sep 17 00:00:00 2001 From: yangzhicheng Date: Tue, 9 Jul 2024 10:50:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InspectionStandardsController.java | 126 ++++++++++++++++++ .../leger/dto/InspectionStandardsDTO.java | 18 +++ .../leger/entity/InspectionStandards.java | 47 +++++++ .../mapper/InspectionStandardsMapper.java | 26 ++++ .../mapper/InspectionStandardsMapper.xml | 24 ++++ .../service/IInspectionStandardsService.java | 25 ++++ .../impl/InspectionStandardsServiceImpl.java | 25 ++++ .../leger/vo/InspectionStandardsVO.java | 20 +++ 8 files changed, 311 insertions(+) create mode 100644 src/main/java/org/energy/modules/leger/controller/InspectionStandardsController.java create mode 100644 src/main/java/org/energy/modules/leger/dto/InspectionStandardsDTO.java create mode 100644 src/main/java/org/energy/modules/leger/entity/InspectionStandards.java create mode 100644 src/main/java/org/energy/modules/leger/mapper/InspectionStandardsMapper.java create mode 100644 src/main/java/org/energy/modules/leger/mapper/InspectionStandardsMapper.xml create mode 100644 src/main/java/org/energy/modules/leger/service/IInspectionStandardsService.java create mode 100644 src/main/java/org/energy/modules/leger/service/impl/InspectionStandardsServiceImpl.java create mode 100644 src/main/java/org/energy/modules/leger/vo/InspectionStandardsVO.java diff --git a/src/main/java/org/energy/modules/leger/controller/InspectionStandardsController.java b/src/main/java/org/energy/modules/leger/controller/InspectionStandardsController.java new file mode 100644 index 0000000..004485a --- /dev/null +++ b/src/main/java/org/energy/modules/leger/controller/InspectionStandardsController.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.energy.modules.leger.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import com.dayu.daf.core.mp.support.Condition; +import com.dayu.daf.core.mp.support.Query; +import com.dayu.daf.core.tool.api.R; +import com.dayu.daf.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestParam; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.energy.modules.leger.entity.InspectionStandards; +import org.energy.modules.leger.vo.InspectionStandardsVO; +import org.energy.modules.leger.service.IInspectionStandardsService; +import com.dayu.daf.core.boot.ctrl.DafController; + +/** + * 检验标准一览 控制器 + * + * @author Daf + * @since 2024-07-09 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/inspectionstandards") +@Api(value = "检验标准一览", tags = "检验标准一览接口") +public class InspectionStandardsController extends DafController { + + private IInspectionStandardsService inspectionStandardsService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入inspectionStandards") + public R detail(InspectionStandards inspectionStandards) { + InspectionStandards detail = inspectionStandardsService.getOne(Condition.getQueryWrapper(inspectionStandards)); + return R.data(detail); + } + + /** + * 分页 检验标准一览 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入inspectionStandards") + public R> list(InspectionStandards inspectionStandards, Query query) { + IPage pages = inspectionStandardsService.page(Condition.getPage(query), Condition.getQueryWrapper(inspectionStandards)); + return R.data(pages); + } + + /** + * 自定义分页 检验标准一览 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入inspectionStandards") + public R> page(InspectionStandardsVO inspectionStandards, Query query) { + IPage pages = inspectionStandardsService.selectInspectionStandardsPage(Condition.getPage(query), inspectionStandards); + return R.data(pages); + } + + /** + * 新增 检验标准一览 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入inspectionStandards") + public R save(@Valid @RequestBody InspectionStandards inspectionStandards) { + return R.status(inspectionStandardsService.save(inspectionStandards)); + } + + /** + * 修改 检验标准一览 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入inspectionStandards") + public R update(@Valid @RequestBody InspectionStandards inspectionStandards) { + return R.status(inspectionStandardsService.updateById(inspectionStandards)); + } + + /** + * 新增或修改 检验标准一览 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入inspectionStandards") + public R submit(@Valid @RequestBody InspectionStandards inspectionStandards) { + return R.status(inspectionStandardsService.saveOrUpdate(inspectionStandards)); + } + + + /** + * 删除 检验标准一览 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(inspectionStandardsService.deleteLogic(Func.toLongList(ids))); + } + + +} diff --git a/src/main/java/org/energy/modules/leger/dto/InspectionStandardsDTO.java b/src/main/java/org/energy/modules/leger/dto/InspectionStandardsDTO.java new file mode 100644 index 0000000..8d4713e --- /dev/null +++ b/src/main/java/org/energy/modules/leger/dto/InspectionStandardsDTO.java @@ -0,0 +1,18 @@ +package org.energy.modules.leger.dto; + +import org.energy.modules.leger.entity.InspectionStandards; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 检验标准一览数据传输对象实体类 + * + * @author Daf + * @since 2024-07-09 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class InspectionStandardsDTO extends InspectionStandards { + private static final long serialVersionUID = 1L; + +} diff --git a/src/main/java/org/energy/modules/leger/entity/InspectionStandards.java b/src/main/java/org/energy/modules/leger/entity/InspectionStandards.java new file mode 100644 index 0000000..1d5803a --- /dev/null +++ b/src/main/java/org/energy/modules/leger/entity/InspectionStandards.java @@ -0,0 +1,47 @@ +package org.energy.modules.leger.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.dayu.daf.core.mp.base.BaseEntity; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 检验标准一览实体类 + * + * @author Daf + * @since 2024-07-09 + */ +@Data +@TableName("l_inspection_standards") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "InspectionStandards对象", description = "检验标准一览") +public class InspectionStandards extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ApiModelProperty(value = "主键") + private Long id; + /** + * 工器具编码 + */ + @ApiModelProperty(value = "工器具编码") + private Long toolsCodeId; + /** + * 检验内容 + */ + @ApiModelProperty(value = "检验内容") + private String inspectionContent; + /** + * 检验标准 + */ + @ApiModelProperty(value = "检验标准") + private String inspectionStandards; + + +} diff --git a/src/main/java/org/energy/modules/leger/mapper/InspectionStandardsMapper.java b/src/main/java/org/energy/modules/leger/mapper/InspectionStandardsMapper.java new file mode 100644 index 0000000..02dd7d4 --- /dev/null +++ b/src/main/java/org/energy/modules/leger/mapper/InspectionStandardsMapper.java @@ -0,0 +1,26 @@ +package org.energy.modules.leger.mapper; + +import org.energy.modules.leger.entity.InspectionStandards; +import org.energy.modules.leger.vo.InspectionStandardsVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 检验标准一览 Mapper 接口 + * + * @author Daf + * @since 2024-07-09 + */ +public interface InspectionStandardsMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param inspectionStandards + * @return + */ + List selectInspectionStandardsPage(IPage page, InspectionStandardsVO inspectionStandards); + +} diff --git a/src/main/java/org/energy/modules/leger/mapper/InspectionStandardsMapper.xml b/src/main/java/org/energy/modules/leger/mapper/InspectionStandardsMapper.xml new file mode 100644 index 0000000..e8f53ee --- /dev/null +++ b/src/main/java/org/energy/modules/leger/mapper/InspectionStandardsMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/energy/modules/leger/service/IInspectionStandardsService.java b/src/main/java/org/energy/modules/leger/service/IInspectionStandardsService.java new file mode 100644 index 0000000..1a1bcce --- /dev/null +++ b/src/main/java/org/energy/modules/leger/service/IInspectionStandardsService.java @@ -0,0 +1,25 @@ +package org.energy.modules.leger.service; + +import org.energy.modules.leger.entity.InspectionStandards; +import org.energy.modules.leger.vo.InspectionStandardsVO; +import com.dayu.daf.core.mp.base.BaseService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 检验标准一览 服务类 + * + * @author Daf + * @since 2024-07-09 + */ +public interface IInspectionStandardsService extends BaseService { + + /** + * 自定义分页 + * + * @param page + * @param inspectionStandards + * @return + */ + IPage selectInspectionStandardsPage(IPage page, InspectionStandardsVO inspectionStandards); + +} diff --git a/src/main/java/org/energy/modules/leger/service/impl/InspectionStandardsServiceImpl.java b/src/main/java/org/energy/modules/leger/service/impl/InspectionStandardsServiceImpl.java new file mode 100644 index 0000000..5537da0 --- /dev/null +++ b/src/main/java/org/energy/modules/leger/service/impl/InspectionStandardsServiceImpl.java @@ -0,0 +1,25 @@ +package org.energy.modules.leger.service.impl; + +import org.energy.modules.leger.entity.InspectionStandards; +import org.energy.modules.leger.vo.InspectionStandardsVO; +import org.energy.modules.leger.mapper.InspectionStandardsMapper; +import org.energy.modules.leger.service.IInspectionStandardsService; +import com.dayu.daf.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 检验标准一览 服务实现类 + * + * @author Daf + * @since 2024-07-09 + */ +@Service +public class InspectionStandardsServiceImpl extends BaseServiceImpl implements IInspectionStandardsService { + + @Override + public IPage selectInspectionStandardsPage(IPage page, InspectionStandardsVO inspectionStandards) { + return page.setRecords(baseMapper.selectInspectionStandardsPage(page, inspectionStandards)); + } + +} diff --git a/src/main/java/org/energy/modules/leger/vo/InspectionStandardsVO.java b/src/main/java/org/energy/modules/leger/vo/InspectionStandardsVO.java new file mode 100644 index 0000000..7932b25 --- /dev/null +++ b/src/main/java/org/energy/modules/leger/vo/InspectionStandardsVO.java @@ -0,0 +1,20 @@ +package org.energy.modules.leger.vo; + +import org.energy.modules.leger.entity.InspectionStandards; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 检验标准一览视图实体类 + * + * @author Daf + * @since 2024-07-09 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "InspectionStandardsVO对象", description = "检验标准一览") +public class InspectionStandardsVO extends InspectionStandards { + private static final long serialVersionUID = 1L; + +}