From d06ef3f44d6dc19dae223ab420165369ea13cc16 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 20 五月 2026 16:29:35 +0800
Subject: [PATCH] Merge branch 'dev_New_pro' of http://114.132.189.42:9002/r/product-inventory-management-after into dev_New_pro
---
src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java | 265 ++++++++++++++++++++++++++--------------------------
1 files changed, 133 insertions(+), 132 deletions(-)
diff --git a/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java b/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java
index f1a026f..4415c0c 100644
--- a/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java
+++ b/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java
@@ -1,132 +1,133 @@
-package com.ruoyi.project.system.controller;
-
-import java.util.List;
-import jakarta.servlet.http.HttpServletResponse;
-import lombok.AllArgsConstructor;
-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.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")
-@AllArgsConstructor
-public class SysDictTypeController extends BaseController
-{
- 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')")
- @PostMapping("/export")
- public void export(HttpServletResponse response, SysDictType dictType)
- {
- List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
- ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
- util.exportExcel(response, list, "瀛楀吀绫诲瀷");
- }
-
- /**
- * 鏌ヨ瀛楀吀绫诲瀷璇︾粏
- */
- @PreAuthorize("@ss.hasPermi('system:dict:query')")
- @GetMapping(value = "/{dictId}")
- public AjaxResult getInfo(@PathVariable Long dictId)
- {
- return success(dictTypeService.selectDictTypeById(dictId));
- }
-
- /**
- * 鏂板瀛楀吀绫诲瀷
- */
- @PreAuthorize("@ss.hasPermi('system:dict:add')")
- @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@Validated @RequestBody SysDictType dict)
- {
- if (!dictTypeService.checkDictTypeUnique(dict))
- {
- return error("鏂板瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪");
- }
- dict.setCreateBy(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 (!dictTypeService.checkDictTypeUnique(dict))
- {
- return error("淇敼瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪");
- }
- dict.setUpdateBy(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)
- {
- dictTypeService.deleteDictTypeByIds(dictIds);
- return success();
- }
-
- /**
- * 鍒锋柊瀛楀吀缂撳瓨
- */
- @PreAuthorize("@ss.hasPermi('system:dict:remove')")
- @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.CLEAN)
- @DeleteMapping("/refreshCache")
- public AjaxResult refreshCache()
- {
- dictTypeService.resetDictCache();
- return success();
- }
-
- /**
- * 鑾峰彇瀛楀吀閫夋嫨妗嗗垪琛�
- */
- @GetMapping("/optionselect")
- public AjaxResult optionselect()
- {
- List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
- return success(dictTypes);
- }
-}
+package com.ruoyi.project.system.controller;
+
+import java.util.List;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.AllArgsConstructor;
+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.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.R;
+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")
+@AllArgsConstructor
+public class SysDictTypeController extends BaseController
+{
+ 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')")
+ @PostMapping("/export")
+ public void export(HttpServletResponse response, SysDictType dictType)
+ {
+ List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
+ ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
+ util.exportExcel(response, list, "瀛楀吀绫诲瀷");
+ }
+
+ /**
+ * 鏌ヨ瀛楀吀绫诲瀷璇︾粏
+ */
+ @PreAuthorize("@ss.hasPermi('system:dict:query')")
+ @GetMapping(value = "/{dictId}")
+ public R<?> getInfo(@PathVariable Long dictId)
+ {
+ return R.ok(dictTypeService.selectDictTypeById(dictId));
+ }
+
+ /**
+ * 鏂板瀛楀吀绫诲瀷
+ */
+ @PreAuthorize("@ss.hasPermi('system:dict:add')")
+ @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.INSERT)
+ @PostMapping
+ public R<?> add(@Validated @RequestBody SysDictType dict)
+ {
+ if (!dictTypeService.checkDictTypeUnique(dict))
+ {
+ return R.fail("鏂板瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪");
+ }
+ dict.setCreateBy(getUsername());
+ dictTypeService.insertDictType(dict);
+ return R.ok();
+ }
+
+ /**
+ * 淇敼瀛楀吀绫诲瀷
+ */
+ @PreAuthorize("@ss.hasPermi('system:dict:edit')")
+ @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public R<?> edit(@Validated @RequestBody SysDictType dict)
+ {
+ if (!dictTypeService.checkDictTypeUnique(dict))
+ {
+ return R.fail("淇敼瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪");
+ }
+ dict.setUpdateBy(getUsername());
+ dictTypeService.updateDictType(dict);
+ return R.ok();
+ }
+
+ /**
+ * 鍒犻櫎瀛楀吀绫诲瀷
+ */
+ @PreAuthorize("@ss.hasPermi('system:dict:remove')")
+ @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{dictIds}")
+ public R<?> remove(@PathVariable Long[] dictIds)
+ {
+ dictTypeService.deleteDictTypeByIds(dictIds);
+ return R.ok();
+ }
+
+ /**
+ * 鍒锋柊瀛楀吀缂撳瓨
+ */
+ @PreAuthorize("@ss.hasPermi('system:dict:remove')")
+ @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.CLEAN)
+ @DeleteMapping("/refreshCache")
+ public R<?> refreshCache()
+ {
+ dictTypeService.resetDictCache();
+ return R.ok();
+ }
+
+ /**
+ * 鑾峰彇瀛楀吀閫夋嫨妗嗗垪琛�
+ */
+ @GetMapping("/optionselect")
+ public R<?> optionselect()
+ {
+ List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
+ return R.ok(dictTypes);
+ }
+}
\ No newline at end of file
--
Gitblit v1.9.3