From c80135e5c3f7bfab96ba558a910a06f1e587c53c Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 07 一月 2026 16:14:04 +0800
Subject: [PATCH] 1.新增@AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") 2.将新增orgid的拦截器关掉 3.登陆新增campusid
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java | 42 ++++++++++++++++--------------------------
1 files changed, 16 insertions(+), 26 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
index c9aa093..8df0110 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
@@ -2,6 +2,8 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.annotation.AddOrgId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
@@ -30,8 +32,7 @@
*/
@RestController
@RequestMapping("/system/post")
-public class SysPostController extends BaseController
-{
+public class SysPostController extends BaseController {
@Autowired
private ISysPostService postService;
@@ -40,8 +41,7 @@
*/
//@PreAuthorize("@ss.hasPermi('system:post:list')")
@GetMapping("/list")
- public TableDataInfo list(SysPost post)
- {
+ public TableDataInfo list(SysPost post) {
startPage();
List<SysPost> list = postService.selectPostList(post);
return getDataTable(list);
@@ -50,8 +50,7 @@
@Log(title = "宀椾綅绠$悊", businessType = BusinessType.EXPORT)
//@PreAuthorize("@ss.hasPermi('system:post:export')")
@PostMapping("/export")
- public void export(HttpServletResponse response, SysPost post)
- {
+ public void export(HttpServletResponse response, SysPost post) {
List<SysPost> list = postService.selectPostList(post);
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
util.exportExcel(response, list, "宀椾綅鏁版嵁");
@@ -62,8 +61,7 @@
*/
//@PreAuthorize("@ss.hasPermi('system:post:query')")
@GetMapping(value = "/{postId}")
- public AjaxResult getInfo(@PathVariable Long postId)
- {
+ public AjaxResult getInfo(@PathVariable Long postId) {
return success(postService.selectPostById(postId));
}
@@ -72,15 +70,12 @@
*/
//@PreAuthorize("@ss.hasPermi('system:post:add')")
@Log(title = "宀椾綅绠$悊", businessType = BusinessType.INSERT)
+ @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
@PostMapping("/add")
- public AjaxResult add(@Validated @RequestBody SysPost post)
- {
- if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
- {
+ public AjaxResult add(@Validated @RequestBody SysPost post) {
+ if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) {
return error("鏂板宀椾綅'" + post.getPostName() + "'澶辫触锛屽矖浣嶅悕绉板凡瀛樺湪");
- }
- else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
- {
+ } else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) {
return error("鏂板宀椾綅'" + post.getPostName() + "'澶辫触锛屽矖浣嶇紪鐮佸凡瀛樺湪");
}
post.setCreateBy(getUsername());
@@ -92,15 +87,12 @@
*/
//@PreAuthorize("@ss.hasPermi('system:post:edit')")
@Log(title = "宀椾綅绠$悊", businessType = BusinessType.UPDATE)
+ @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
@PostMapping("/edit")
- public AjaxResult edit(@Validated @RequestBody SysPost post)
- {
- if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
- {
+ public AjaxResult edit(@Validated @RequestBody SysPost post) {
+ if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) {
return error("淇敼宀椾綅'" + post.getPostName() + "'澶辫触锛屽矖浣嶅悕绉板凡瀛樺湪");
- }
- else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
- {
+ } else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) {
return error("淇敼宀椾綅'" + post.getPostName() + "'澶辫触锛屽矖浣嶇紪鐮佸凡瀛樺湪");
}
post.setUpdateBy(getUsername());
@@ -113,8 +105,7 @@
//@PreAuthorize("@ss.hasPermi('system:post:remove')")
@Log(title = "宀椾綅绠$悊", businessType = BusinessType.DELETE)
@GetMapping("/remove/{postIds}")
- public AjaxResult remove(@PathVariable Long[] postIds)
- {
+ public AjaxResult remove(@PathVariable Long[] postIds) {
return toAjax(postService.deletePostByIds(postIds));
}
@@ -122,8 +113,7 @@
* 鑾峰彇宀椾綅閫夋嫨妗嗗垪琛�
*/
@GetMapping("/optionselect")
- public AjaxResult optionselect()
- {
+ public AjaxResult optionselect() {
List<SysPost> posts = postService.selectPostAll();
return success(posts);
}
--
Gitblit v1.9.3