From a8b458570fea9039e464150da723b9415b95a64c Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期四, 01 二月 2024 16:30:05 +0800 Subject: [PATCH] 代码提交 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceMedicalevaluationController.java | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceMedicalevaluationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceMedicalevaluationController.java index 2d9e1f1..9f8b375 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceMedicalevaluationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceMedicalevaluationController.java @@ -3,11 +3,13 @@ import java.util.Arrays; import java.util.List; +import com.ruoyi.common.annotation.NotRepeatCommit; import com.ruoyi.project.domain.vo.MedicalEvaluationVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -28,15 +30,14 @@ /** * 鍖诲璇勪及Controller - * + * * @author ruoyi * @date 2021-11-19 */ @Api("鍖荤枟璇勪及绠$悊") @RestController @RequestMapping("/project/medicalevaluation") -public class ServiceMedicalevaluationController extends BaseController -{ +public class ServiceMedicalevaluationController extends BaseController { @Autowired private IServiceMedicalevaluationService serviceMedicalevaluationService; @@ -46,8 +47,7 @@ @ApiOperation("鑾峰彇鍖荤枟璇勪及鍒楄〃") //@PreAuthorize("@ss.hasPermi('project:medicalevaluation:list')") @GetMapping("/list") - public TableDataInfo list(ServiceMedicalevaluation serviceMedicalevaluation) - { + public TableDataInfo list(ServiceMedicalevaluation serviceMedicalevaluation) { startPage(); List<ServiceMedicalevaluation> list = serviceMedicalevaluationService.queryList(serviceMedicalevaluation); return getDataTable(list); @@ -55,7 +55,7 @@ @ApiOperation("鑾峰彇鍖荤枟璇勪及鍒楄〃鏂�") @GetMapping("/listnew") - public TableDataInfo listnew(MedicalEvaluationVO medicalEvaluationVO){ + public TableDataInfo listnew(MedicalEvaluationVO medicalEvaluationVO) { startPage(); List<MedicalEvaluationVO> list = serviceMedicalevaluationService.selectVOList(medicalEvaluationVO); return getDataTable(list); @@ -68,8 +68,7 @@ //@PreAuthorize("@ss.hasPermi('project:medicalevaluation:export')") @Log(title = "鍖诲璇勪及", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(ServiceMedicalevaluation serviceMedicalevaluation) - { + public AjaxResult export(ServiceMedicalevaluation serviceMedicalevaluation) { List<ServiceMedicalevaluation> list = serviceMedicalevaluationService.queryList(serviceMedicalevaluation); ExcelUtil<ServiceMedicalevaluation> util = new ExcelUtil<ServiceMedicalevaluation>(ServiceMedicalevaluation.class); return util.exportExcel(list, "鍖诲璇勪及鏁版嵁"); @@ -81,8 +80,7 @@ @ApiOperation("閫氳繃id鑾峰彇鍖荤枟璇勪及淇℃伅") //@PreAuthorize("@ss.hasPermi('project:medicalevaluation:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { + public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(serviceMedicalevaluationService.getById(id)); } @@ -93,9 +91,8 @@ //@PreAuthorize("@ss.hasPermi('project:medicalevaluation:add')") @Log(title = "鍖诲璇勪及", businessType = BusinessType.INSERT) @PostMapping - @RepeatSubmit - public AjaxResult add(@RequestBody ServiceMedicalevaluation serviceMedicalevaluation) - { + @NotRepeatCommit(key = "param:arg[1]", value = 30000) + public AjaxResult add(@RequestBody ServiceMedicalevaluation serviceMedicalevaluation) { return toAjax(serviceMedicalevaluationService.save(serviceMedicalevaluation)); } @@ -105,10 +102,14 @@ @ApiOperation("淇敼鍖诲璇勪及") //@PreAuthorize("@ss.hasPermi('project:medicalevaluation:edit')") @Log(title = "鍖诲璇勪及", businessType = BusinessType.UPDATE) - @PutMapping - @RepeatSubmit - public AjaxResult edit(@RequestBody ServiceMedicalevaluation serviceMedicalevaluation) - { + @PostMapping("/edit") + @NotRepeatCommit(key = "param:arg[1]", value = 30000) + public AjaxResult edit(@RequestBody ServiceMedicalevaluation serviceMedicalevaluation) { + List<ServiceMedicalevaluation> list = serviceMedicalevaluationService.queryList(serviceMedicalevaluation); + if (CollectionUtils.isEmpty(list)) { + return error("鍖诲璇勪及鏁版嵁涓嶅瓨鍦�,璇锋鏌ュ悗鍐嶆淇敼"); + } + serviceMedicalevaluation.setId(list.get(0).getId()); return toAjax(serviceMedicalevaluationService.updateById(serviceMedicalevaluation)); } @@ -118,9 +119,8 @@ @ApiOperation("鍒犻櫎鍖诲璇勪及") //@PreAuthorize("@ss.hasPermi('project:medicalevaluation:remove')") @Log(title = "鍖诲璇勪及", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + @GetMapping("/remove/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(serviceMedicalevaluationService.removeByIds(Arrays.asList(ids))); } } -- Gitblit v1.9.3