Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wms_api
Project
Project
Details
Activity
Releases
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
高宇
wms_api
Commits
40219f22
Commit
40219f22
authored
Dec 18, 2024
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改门店权限
parent
63327e70
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
103 additions
and
7 deletions
+103
-7
CustInfoServiceImpl.java
...cisoft/bus/custinfo/service/impl/CustInfoServiceImpl.java
+24
-0
CustRechargeServiceImpl.java
...us/custrecharge/service/impl/CustRechargeServiceImpl.java
+23
-0
StoreGoodsApplyServiceImpl.java
...regoodsapply/service/impl/StoreGoodsApplyServiceImpl.java
+34
-3
StoreGoodsStockServiceImpl.java
...regoodsstock/service/impl/StoreGoodsStockServiceImpl.java
+21
-2
application-spbt.yml
src/main/resources/application-spbt.yml
+1
-2
No files found.
src/main/java/org/rcisoft/bus/custinfo/service/impl/CustInfoServiceImpl.java
View file @
40219f22
...
...
@@ -8,13 +8,18 @@ import org.rcisoft.bus.custinfo.dao.CustInfoRepository;
import
org.rcisoft.bus.custinfo.entity.CustInfo
;
import
org.rcisoft.bus.custinfo.service.CustInfoService
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.rcisoft.core.model.CyPageInfo
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
lombok.extern.slf4j.Slf4j
;
/**
...
...
@@ -26,6 +31,10 @@ import lombok.extern.slf4j.Slf4j;
public
class
CustInfoServiceImpl
extends
ServiceImpl
<
CustInfoRepository
,
CustInfo
>
implements
CustInfoService
{
@Value
(
"${cy.init.adminRole}"
)
private
String
[]
adminRoleIds
;
/**
* 保存 客户信息表
* @param custInfo
...
...
@@ -102,6 +111,21 @@ public class CustInfoServiceImpl extends ServiceImpl<CustInfoRepository,CustInfo
@Override
public
IPage
<
CustInfo
>
findAllByPagination
(
CyPageInfo
<
CustInfo
>
paginationUtility
,
CustInfo
custInfo
){
// 获取当前用户的角色ID
String
roleIds
=
CyUserUtil
.
getAuthenRoleIds
();
// 将角色ID字符串分割成数组,并去除每个ID前后的空白字符
Set
<
String
>
userRoles
=
Arrays
.
stream
(
roleIds
.
split
(
","
))
.
map
(
String:
:
trim
)
.
collect
(
Collectors
.
toSet
());
// 检查当前用户是否有管理员权限
boolean
isAdmin
=
Arrays
.
stream
(
adminRoleIds
)
.
anyMatch
(
userRoles:
:
contains
);
// 根据是否是管理员调整查询条件
if
(!
isAdmin
)
{
custInfo
.
setStoreId
(
CyUserUtil
.
getAuthenDept
());
}
return
baseMapper
.
queryCustInfosPaged
(
paginationUtility
,
custInfo
);
}
...
...
src/main/java/org/rcisoft/bus/custrecharge/service/impl/CustRechargeServiceImpl.java
View file @
40219f22
...
...
@@ -15,13 +15,18 @@ import org.rcisoft.bus.custrecharge.service.CustRechargeService;
import
org.rcisoft.core.service.CyBaseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.rcisoft.core.model.CyPageInfo
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
lombok.extern.slf4j.Slf4j
;
/**
...
...
@@ -33,6 +38,9 @@ import lombok.extern.slf4j.Slf4j;
public
class
CustRechargeServiceImpl
extends
ServiceImpl
<
CustRechargeRepository
,
CustRecharge
>
implements
CustRechargeService
{
@Value
(
"${cy.init.adminRole}"
)
private
String
[]
adminRoleIds
;
/**
* 保存 客户消费表
* @param custRecharge
...
...
@@ -108,6 +116,21 @@ public class CustRechargeServiceImpl extends ServiceImpl<CustRechargeRepository,
@Override
public
IPage
<
CustRecharge
>
findAllByPagination
(
CyPageInfo
<
CustRecharge
>
paginationUtility
,
CustRecharge
custRecharge
){
// 获取当前用户的角色ID
String
roleIds
=
CyUserUtil
.
getAuthenRoleIds
();
// 将角色ID字符串分割成数组,并去除每个ID前后的空白字符
Set
<
String
>
userRoles
=
Arrays
.
stream
(
roleIds
.
split
(
","
))
.
map
(
String:
:
trim
)
.
collect
(
Collectors
.
toSet
());
// 检查当前用户是否有管理员权限
boolean
isAdmin
=
Arrays
.
stream
(
adminRoleIds
)
.
anyMatch
(
userRoles:
:
contains
);
// 根据是否是管理员调整查询条件
if
(!
isAdmin
)
{
custRecharge
.
setStoreId
(
CyUserUtil
.
getAuthenDept
());
}
return
baseMapper
.
queryCustRechargesPaged
(
paginationUtility
,
custRecharge
);
}
...
...
src/main/java/org/rcisoft/bus/storegoodsapply/service/impl/StoreGoodsApplyServiceImpl.java
View file @
40219f22
...
...
@@ -22,6 +22,7 @@ import org.rcisoft.core.model.CyPersistModel;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
...
...
@@ -29,9 +30,8 @@ import org.springframework.transaction.annotation.Transactional;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* Created by cy on 2024年5月29日 下午1:21:49.
...
...
@@ -52,6 +52,9 @@ public class StoreGoodsApplyServiceImpl extends ServiceImpl<StoreGoodsApplyRepos
@Autowired
private
StoreGoodsStockRepository
storeGoodsStockRepository
;
@Value
(
"${cy.init.adminRole}"
)
private
String
[]
adminRoleIds
;
/**
* 保存 商品申请表
*
...
...
@@ -78,6 +81,7 @@ public class StoreGoodsApplyServiceImpl extends ServiceImpl<StoreGoodsApplyRepos
BeanUtils
.
copyProperties
(
addwmsGoodsApply
,
storeGoodsApply
);
storeGoodsApply
.
setIoType
(
"0"
);
storeGoodsApply
.
setDealStatus
(
"0"
);
storeGoodsApply
.
setStoreId
(
CyUserUtil
.
getAuthenDept
());
baseMapper
.
insert
(
storeGoodsApply
);
// 空
if
(
CollectionUtil
.
isEmpty
(
addwmsGoodsApply
.
getBoxList
()))
{
...
...
@@ -133,6 +137,7 @@ public class StoreGoodsApplyServiceImpl extends ServiceImpl<StoreGoodsApplyRepos
BeanUtils
.
copyProperties
(
addwmsGoodsApply
,
storeGoodsApplyOut
);
storeGoodsApplyOut
.
setIoType
(
"1"
);
storeGoodsApplyOut
.
setDealStatus
(
"1"
);
storeGoodsApplyOut
.
setStoreId
(
CyUserUtil
.
getAuthenDept
());
baseMapper
.
insert
(
storeGoodsApplyOut
);
// 2. 遍历
...
...
@@ -274,6 +279,19 @@ public class StoreGoodsApplyServiceImpl extends ServiceImpl<StoreGoodsApplyRepos
@Override
public
IPage
<
StoreGoodsApply
>
findAllByPagination
(
CyPageInfo
<
StoreGoodsApply
>
paginationUtility
,
StoreGoodsApply
storeGoodsApply
)
{
// 获取当前用户的角色ID
String
roleIds
=
CyUserUtil
.
getAuthenRoleIds
();
// 将角色ID字符串分割成数组,并去除每个ID前后的空白字符
Set
<
String
>
userRoles
=
Arrays
.
stream
(
roleIds
.
split
(
","
))
.
map
(
String:
:
trim
)
.
collect
(
Collectors
.
toSet
());
// 检查当前用户是否有管理员权限
boolean
isAdmin
=
Arrays
.
stream
(
adminRoleIds
)
.
anyMatch
(
userRoles:
:
contains
);
// 根据是否是管理员调整查询条件
if
(!
isAdmin
)
{
storeGoodsApply
.
setStoreId
(
CyUserUtil
.
getAuthenDept
());
}
return
baseMapper
.
queryWmsGoodsApplysPaged
(
paginationUtility
,
storeGoodsApply
);
}
...
...
@@ -281,6 +299,19 @@ public class StoreGoodsApplyServiceImpl extends ServiceImpl<StoreGoodsApplyRepos
@Override
public
IPage
<
StoreGoodsApply
>
OutfindAllByPagination
(
CyPageInfo
<
StoreGoodsApply
>
paginationUtility
,
StoreGoodsApply
storeGoodsApply
)
{
// 获取当前用户的角色ID
String
roleIds
=
CyUserUtil
.
getAuthenRoleIds
();
// 将角色ID字符串分割成数组,并去除每个ID前后的空白字符
Set
<
String
>
userRoles
=
Arrays
.
stream
(
roleIds
.
split
(
","
))
.
map
(
String:
:
trim
)
.
collect
(
Collectors
.
toSet
());
// 检查当前用户是否有管理员权限
boolean
isAdmin
=
Arrays
.
stream
(
adminRoleIds
)
.
anyMatch
(
userRoles:
:
contains
);
// 根据是否是管理员调整查询条件
if
(!
isAdmin
)
{
storeGoodsApply
.
setStoreId
(
CyUserUtil
.
getAuthenDept
());
}
return
baseMapper
.
queryWmsGoodsApplysOutPaged
(
paginationUtility
,
storeGoodsApply
);
}
...
...
src/main/java/org/rcisoft/bus/storegoodsstock/service/impl/StoreGoodsStockServiceImpl.java
View file @
40219f22
...
...
@@ -18,12 +18,16 @@ import org.rcisoft.core.model.CyPageInfo;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* Created by cy on 2024年5月29日 下午1:21:49.
...
...
@@ -36,6 +40,9 @@ public class StoreGoodsStockServiceImpl extends ServiceImpl<StoreGoodsStockRepos
@Autowired
StoreGoodsLogRepository
wmsGoodsLogRepository
;
@Value
(
"${cy.init.adminRole}"
)
private
String
[]
adminRoleIds
;
/**
* 保存 库存管理表
* @param storeGoodsStock
...
...
@@ -130,8 +137,20 @@ public class StoreGoodsStockServiceImpl extends ServiceImpl<StoreGoodsStockRepos
@Override
public
IPage
<
StoreGoodsStockPageResultsDto
>
findAllByPagination
(
CyPageInfo
<
StoreGoodsStockPageResultsDto
>
paginationUtility
,
StoreGoodsStockPageResultsDto
storeGoodsStock
){
return
baseMapper
.
queryWmsGoodsStocksPaged
(
paginationUtility
,
storeGoodsStock
);
// 获取当前用户的角色ID
String
roleIds
=
CyUserUtil
.
getAuthenRoleIds
();
// 将角色ID字符串分割成数组,并去除每个ID前后的空白字符
Set
<
String
>
userRoles
=
Arrays
.
stream
(
roleIds
.
split
(
","
))
.
map
(
String:
:
trim
)
.
collect
(
Collectors
.
toSet
());
// 检查当前用户是否有管理员权限
boolean
isAdmin
=
Arrays
.
stream
(
adminRoleIds
)
.
anyMatch
(
userRoles:
:
contains
);
// 根据是否是管理员调整查询条件
if
(!
isAdmin
)
{
storeGoodsStock
.
setStoreId
(
CyUserUtil
.
getAuthenDept
());
}
return
baseMapper
.
queryWmsGoodsStocksPaged
(
paginationUtility
,
storeGoodsStock
);
}
/**
...
...
src/main/resources/application-spbt.yml
View file @
40219f22
...
...
@@ -18,8 +18,7 @@ cy:
init
:
admin
:
-
"
1"
adminRole
:
-
"
1"
adminRole
:
"
1"
permission
:
-
"
44"
-
"
51"
...
...
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