Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
precision-effect
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
precision-effect
Commits
6dc2f81f
Commit
6dc2f81f
authored
Jun 10, 2023
by
王晓倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
非admin账户,只能维护本部门交易项目
parent
9fb4acde
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
TTransactionProjectController.java
...controller/transaction/TTransactionProjectController.java
+18
-0
No files found.
precision-effect-admin/src/main/java/com/zehong/web/controller/transaction/TTransactionProjectController.java
View file @
6dc2f81f
...
...
@@ -3,9 +3,14 @@ package com.zehong.web.controller.transaction;
import
com.zehong.common.annotation.Log
;
import
com.zehong.common.core.controller.BaseController
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.core.domain.entity.SysUser
;
import
com.zehong.common.core.domain.model.LoginUser
;
import
com.zehong.common.core.page.TableDataInfo
;
import
com.zehong.common.enums.BusinessType
;
import
com.zehong.common.utils.ServletUtils
;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.framework.web.service.TokenService
;
import
com.zehong.system.domain.TTransactionProject
;
import
com.zehong.system.service.ITTransactionProjectService
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -26,6 +31,8 @@ public class TTransactionProjectController extends BaseController
{
@Autowired
private
ITTransactionProjectService
tTransactionProjectService
;
@Autowired
private
TokenService
tokenService
;
/**
* 查询交易项目列表
...
...
@@ -35,8 +42,14 @@ public class TTransactionProjectController extends BaseController
public
TableDataInfo
list
(
TTransactionProject
tTransactionProject
)
{
startPage
();
// 获取当前用户
SysUser
user
=
tokenService
.
getLoginUser
(
ServletUtils
.
getRequest
()).
getUser
();
if
(
StringUtils
.
isNotNull
(
user
)
&&
!
user
.
isAdmin
())
{
tTransactionProject
.
setDeptId
(
user
.
getDeptId
());
}
List
<
TTransactionProject
>
list
=
tTransactionProjectService
.
selectTTransactionProjectList
(
tTransactionProject
);
return
getDataTable
(
list
);
}
...
...
@@ -82,6 +95,11 @@ public class TTransactionProjectController extends BaseController
@PostMapping
public
AjaxResult
add
(
@RequestBody
TTransactionProject
tTransactionProject
)
{
// 获取当前用户
SysUser
user
=
tokenService
.
getLoginUser
(
ServletUtils
.
getRequest
()).
getUser
();
if
(
StringUtils
.
isNotNull
(
user
)
&&
!
user
.
isAdmin
())
{
tTransactionProject
.
setDeptId
(
user
.
getDeptId
());
}
return
toAjax
(
tTransactionProjectService
.
insertTTransactionProject
(
tTransactionProject
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment