From 23eb635e97bbad7a46662938b23b66efc5c22242 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 7 Aug 2024 08:11:19 +0800 Subject: [PATCH] =?UTF-8?q?#=E6=96=87=E4=BB=B6=E5=91=BD=E5=90=8D=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../train/controller/SafetyTrainController.java | 68 +++++++++++++++++++++ .../train/controller/TrainController.java | 70 ---------------------- 2 files changed, 68 insertions(+), 70 deletions(-) create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/SafetyTrainController.java delete mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/TrainController.java diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/SafetyTrainController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/SafetyTrainController.java new file mode 100644 index 0000000..540355d --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/SafetyTrainController.java @@ -0,0 +1,68 @@ +package com.hnac.hzims.safeproduct.train.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.safeproduct.Constants; +import com.hnac.hzims.safeproduct.train.entity.TrainEntity; +import com.hnac.hzims.safeproduct.train.service.ITrainService; +import com.hnac.hzims.safeproduct.train.vo.TrainParamVo; +import com.hnac.hzims.safeproduct.train.vo.TrainSummaryVo; +import com.hnac.hzinfo.log.annotation.Business; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +/** + * @author ysj + */ +@RestController +@AllArgsConstructor +@RequestMapping("/train") +@Business(module = Constants.APP_NAME, value = "安全培训") +@Api(value = "安全培训", tags = "安全培训接口") +public class SafetyTrainController extends BladeController { + + private final ITrainService service; + + @PostMapping("/save") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增安全培训", notes = "传入TrainEntity") + public R save(@RequestBody TrainEntity entity) { + return R.status(service.save(entity)); + } + + @PostMapping("/update") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "修改安全培训", notes = "传入TrainEntity") + public R update(@RequestBody TrainEntity entity) { + return R.status(service.updateById(entity)); + } + + @PostMapping("/remove") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "删除安全培训", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + return R.status(service.removeByIds(Func.toLongList(ids))); + } + + @GetMapping("/pages") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "分页查询安全培训", notes = "查询条件:entity") + public R> pageCondition(TrainParamVo params, Query query) { + return R.data(service.pageCondition(params, Condition.getPage(query))); + } + + @GetMapping("/summary") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "汇总", notes = "查询条件:站点ID、月份") + public R> summary(TrainParamVo params, Query query) { + return R.data(service.summary(params, Condition.getPage(query))); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/TrainController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/TrainController.java deleted file mode 100644 index 1ccc218..0000000 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/TrainController.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.hnac.hzims.safeproduct.train.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.hnac.hzims.safeproduct.Constants; -import com.hnac.hzims.safeproduct.train.entity.RectificationEntity; -import com.hnac.hzims.safeproduct.train.entity.TrainEntity; -import com.hnac.hzims.safeproduct.train.service.ITrainService; -import com.hnac.hzims.safeproduct.train.vo.RectificationParamVo; -import com.hnac.hzims.safeproduct.train.vo.TrainParamVo; -import com.hnac.hzims.safeproduct.train.vo.TrainSummaryVo; -import com.hnac.hzinfo.log.annotation.Business; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.mp.support.Condition; -import org.springblade.core.mp.support.Query; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.Func; -import org.springframework.web.bind.annotation.*; - -/** - * @author ysj - */ -@RestController -@AllArgsConstructor -@RequestMapping("/train") -@Business(module = Constants.APP_NAME, value = "安全培训") -@Api(value = "安全培训", tags = "安全培训接口") -public class TrainController extends BladeController { - - private final ITrainService service; - - @PostMapping("/save") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "新增安全培训", notes = "传入TrainEntity") - public R save(@RequestBody TrainEntity entity) { - return R.status(service.save(entity)); - } - - @PostMapping("/update") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "修改安全培训", notes = "传入TrainEntity") - public R update(@RequestBody TrainEntity entity) { - return R.status(service.updateById(entity)); - } - - @PostMapping("/remove") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "删除安全培训", notes = "ids") - public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { - return R.status(service.removeByIds(Func.toLongList(ids))); - } - - @GetMapping("/pages") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "分页查询安全培训", notes = "查询条件:entity") - public R> pageCondition(TrainParamVo params, Query query) { - return R.data(service.pageCondition(params, Condition.getPage(query))); - } - - @GetMapping("/summary") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "汇总", notes = "查询条件:站点ID、月份") - public R> summary(TrainParamVo params, Query query) { - return R.data(service.summary(params, Condition.getPage(query))); - } -}