From a1cf719d268a9d16db81ece94e75037c844f898f Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期二, 18 二月 2020 14:47:23 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue --- ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java | 238 +++++++++++++++++++++++++++++----------------------------- 1 files changed, 119 insertions(+), 119 deletions(-) diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java b/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java index 4236206..82d93d9 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java @@ -1,119 +1,119 @@ -package com.ruoyi.project.system.controller; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.enums.BusinessType; -import com.ruoyi.framework.web.controller.BaseController; -import com.ruoyi.framework.web.domain.AjaxResult; -import com.ruoyi.framework.web.page.TableDataInfo; -import com.ruoyi.project.system.domain.SysDictType; -import com.ruoyi.project.system.service.ISysDictTypeService; - -/** - * 鏁版嵁瀛楀吀淇℃伅 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/system/dict/type") -public class SysDictTypeController extends BaseController -{ - @Autowired - private ISysDictTypeService dictTypeService; - - @PreAuthorize("@ss.hasPermi('system:dict:list')") - @GetMapping("/list") - public TableDataInfo list(SysDictType dictType) - { - startPage(); - List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); - return getDataTable(list); - } - - @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:dict:export')") - @GetMapping("/export") - public AjaxResult export(SysDictType dictType) - { - List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); - ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); - return util.exportExcel(list, "瀛楀吀绫诲瀷"); - } - - /** - * 鏌ヨ瀛楀吀绫诲瀷璇︾粏 - */ - @PreAuthorize("@ss.hasPermi('system:dict:query')") - @GetMapping(value = "/{dictId}") - public AjaxResult getInfo(@PathVariable Long dictId) - { - return AjaxResult.success(dictTypeService.selectDictTypeById(dictId)); - } - - /** - * 鏂板瀛楀吀绫诲瀷 - */ - @PreAuthorize("@ss.hasPermi('system:dict:add')") - @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysDictType dict) - { - if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) - { - return AjaxResult.error("鏂板瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪"); - } - dict.setCreateBy(SecurityUtils.getUsername()); - return toAjax(dictTypeService.insertDictType(dict)); - } - - /** - * 淇敼瀛楀吀绫诲瀷 - */ - @PreAuthorize("@ss.hasPermi('system:dict:edit')") - @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDictType dict) - { - if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) - { - return AjaxResult.error("淇敼瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪"); - } - dict.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(dictTypeService.updateDictType(dict)); - } - - /** - * 鍒犻櫎瀛楀吀绫诲瀷 - */ - @PreAuthorize("@ss.hasPermi('system:dict:remove')") - @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.DELETE) - @DeleteMapping("/{dictIds}") - public AjaxResult remove(@PathVariable Long[] dictIds) - { - return toAjax(dictTypeService.deleteDictTypeByIds(dictIds)); - } - - /** - * 鑾峰彇瀛楀吀閫夋嫨妗嗗垪琛� - */ - @GetMapping("/optionselect") - public AjaxResult optionselect() - { - List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); - return AjaxResult.success(dictTypes); - } -} +package com.ruoyi.project.system.controller; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.system.domain.SysDictType; +import com.ruoyi.project.system.service.ISysDictTypeService; + +/** + * 鏁版嵁瀛楀吀淇℃伅 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/system/dict/type") +public class SysDictTypeController extends BaseController +{ + @Autowired + private ISysDictTypeService dictTypeService; + + @PreAuthorize("@ss.hasPermi('system:dict:list')") + @GetMapping("/list") + public TableDataInfo list(SysDictType dictType) + { + startPage(); + List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); + return getDataTable(list); + } + + @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('system:dict:export')") + @GetMapping("/export") + public AjaxResult export(SysDictType dictType) + { + List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); + ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); + return util.exportExcel(list, "瀛楀吀绫诲瀷"); + } + + /** + * 鏌ヨ瀛楀吀绫诲瀷璇︾粏 + */ + @PreAuthorize("@ss.hasPermi('system:dict:query')") + @GetMapping(value = "/{dictId}") + public AjaxResult getInfo(@PathVariable Long dictId) + { + return AjaxResult.success(dictTypeService.selectDictTypeById(dictId)); + } + + /** + * 鏂板瀛楀吀绫诲瀷 + */ + @PreAuthorize("@ss.hasPermi('system:dict:add')") + @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysDictType dict) + { + if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) + { + return AjaxResult.error("鏂板瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪"); + } + dict.setCreateBy(SecurityUtils.getUsername()); + return toAjax(dictTypeService.insertDictType(dict)); + } + + /** + * 淇敼瀛楀吀绫诲瀷 + */ + @PreAuthorize("@ss.hasPermi('system:dict:edit')") + @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysDictType dict) + { + if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) + { + return AjaxResult.error("淇敼瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪"); + } + dict.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(dictTypeService.updateDictType(dict)); + } + + /** + * 鍒犻櫎瀛楀吀绫诲瀷 + */ + @PreAuthorize("@ss.hasPermi('system:dict:remove')") + @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.DELETE) + @DeleteMapping("/{dictIds}") + public AjaxResult remove(@PathVariable Long[] dictIds) + { + return toAjax(dictTypeService.deleteDictTypeByIds(dictIds)); + } + + /** + * 鑾峰彇瀛楀吀閫夋嫨妗嗗垪琛� + */ + @GetMapping("/optionselect") + public AjaxResult optionselect() + { + List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); + return AjaxResult.success(dictTypes); + } +} -- Gitblit v1.9.3