| | |
| | | package com.ruoyi.web.controller.system;
|
| | |
|
| | | import java.util.List;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | |
| | | import com.ruoyi.common.core.domain.entity.SysDictType;
|
| | | import com.ruoyi.common.core.page.TableDataInfo;
|
| | | import com.ruoyi.common.enums.BusinessType;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.system.service.ISysDictTypeService;
|
| | |
|
| | |
| | |
|
| | | @Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')")
|
| | | @GetMapping("/export")
|
| | | public AjaxResult export(SysDictType dictType)
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, SysDictType dictType)
|
| | | {
|
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
| | | ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
|
| | | return util.exportExcel(list, "字典类型");
|
| | | util.exportExcel(response, list, "字典类型");
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | {
|
| | | return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
| | | }
|
| | | dict.setCreateBy(SecurityUtils.getUsername());
|
| | | dict.setCreateBy(getUsername());
|
| | | return toAjax(dictTypeService.insertDictType(dict));
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
| | | }
|
| | | dict.setUpdateBy(SecurityUtils.getUsername());
|
| | | dict.setUpdateBy(getUsername());
|
| | | return toAjax(dictTypeService.updateDictType(dict));
|
| | | }
|
| | |
|