Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
Overview
Overview
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
吴迪
gs1-office-web-sit
Commits
22f2516a
Commit
22f2516a
authored
Aug 19, 2023
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】修改bug
parent
187d39b5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
132 additions
and
86 deletions
+132
-86
ClickDetailController.java
...fice/modules/manage/controller/ClickDetailController.java
+4
-1
ClickDetailDTO.java
...a/io/office/modules/manage/entity/dto/ClickDetailDTO.java
+2
-0
ClickDetailServiceImpl.java
...e/modules/manage/service/impl/ClickDetailServiceImpl.java
+0
-0
MedicalServiceImpl.java
...ffice/modules/manage/service/impl/MedicalServiceImpl.java
+14
-17
GLNSearchUtils.java
...n/java/io/office/modules/manage/utils/GLNSearchUtils.java
+46
-0
SysRoleController.java
...a/io/office/modules/sys/controller/SysRoleController.java
+20
-20
SysUserController.java
...a/io/office/modules/sys/controller/SysUserController.java
+20
-20
SysMenuServiceImpl.java
...o/office/modules/sys/service/impl/SysMenuServiceImpl.java
+9
-9
SysRoleServiceImpl.java
...o/office/modules/sys/service/impl/SysRoleServiceImpl.java
+5
-5
SysUserServiceImpl.java
...o/office/modules/sys/service/impl/SysUserServiceImpl.java
+12
-14
ClickDetailDao.xml
src/main/resources/mapper/manage/ClickDetailDao.xml
+0
-0
No files found.
src/main/java/io/office/modules/manage/controller/ClickDetailController.java
View file @
22f2516a
...
@@ -58,7 +58,7 @@ public class ClickDetailController {
...
@@ -58,7 +58,7 @@ public class ClickDetailController {
@RequestMapping
(
"/list"
)
@RequestMapping
(
"/list"
)
//@RequiresPermissions("datamanage:clickdetail:list")
//@RequiresPermissions("datamanage:clickdetail:list")
public
R
list
(
@RequestBody
ClickDetailDTO
clickDetailDTO
)
{
public
R
list
(
@RequestBody
ClickDetailDTO
clickDetailDTO
)
{
Page
page
=
null
;
Page
<
ClickDetailDTO
>
page
=
new
Page
()
;
if
(
StrUtil
.
equals
(
"1"
,
clickDetailDTO
.
getTypeValue
()))
{
if
(
StrUtil
.
equals
(
"1"
,
clickDetailDTO
.
getTypeValue
()))
{
page
=
clickDetailService
.
selectClickNewsList
(
clickDetailDTO
);
page
=
clickDetailService
.
selectClickNewsList
(
clickDetailDTO
);
}
else
if
(
StrUtil
.
equals
(
"2"
,
clickDetailDTO
.
getTypeValue
()))
{
}
else
if
(
StrUtil
.
equals
(
"2"
,
clickDetailDTO
.
getTypeValue
()))
{
...
@@ -78,6 +78,8 @@ public class ClickDetailController {
...
@@ -78,6 +78,8 @@ public class ClickDetailController {
}
else
if
(
StrUtil
.
equals
(
"12"
,
clickDetailDTO
.
getTypeValue
()))
{
}
else
if
(
StrUtil
.
equals
(
"12"
,
clickDetailDTO
.
getTypeValue
()))
{
page
=
clickDetailService
.
getListPageAnnounces
(
clickDetailDTO
);
page
=
clickDetailService
.
getListPageAnnounces
(
clickDetailDTO
);
}
}
PageUtils
pageUtils
=
new
PageUtils
(
page
);
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
}
...
@@ -108,6 +110,7 @@ public class ClickDetailController {
...
@@ -108,6 +110,7 @@ public class ClickDetailController {
clickDetailService
.
getListPageAnnouncesExport
(
clickDetailDTO
,
response
);
clickDetailService
.
getListPageAnnouncesExport
(
clickDetailDTO
,
response
);
}
}
}
}
...
...
src/main/java/io/office/modules/manage/entity/dto/ClickDetailDTO.java
View file @
22f2516a
...
@@ -86,5 +86,7 @@ public class ClickDetailDTO implements Serializable {
...
@@ -86,5 +86,7 @@ public class ClickDetailDTO implements Serializable {
private
String
order
;
private
String
order
;
private
String
releaseTimeStart
;
private
String
releaseTimeEnd
;
}
}
src/main/java/io/office/modules/manage/service/impl/ClickDetailServiceImpl.java
View file @
22f2516a
This diff is collapsed.
Click to expand it.
src/main/java/io/office/modules/manage/service/impl/MedicalServiceImpl.java
View file @
22f2516a
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.netty.util.internal.StringUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.modules.manage.dao.MedicalDao
;
import
io.office.modules.manage.dao.MedicalDao
;
import
io.office.modules.manage.entity.MedicalEntity
;
import
io.office.modules.manage.entity.MedicalEntity
;
import
io.office.modules.manage.service.MedicalService
;
import
io.office.modules.manage.service.MedicalService
;
...
@@ -11,11 +14,6 @@ import org.springframework.stereotype.Service;
...
@@ -11,11 +14,6 @@ import org.springframework.stereotype.Service;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
...
@@ -39,14 +37,14 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i
...
@@ -39,14 +37,14 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i
}
else
{
}
else
{
medicalEntityQueryWrapper
.
gt
(
"level"
,
0
);
medicalEntityQueryWrapper
.
gt
(
"level"
,
0
);
}
}
if
(
params
.
get
(
"sidx"
)!=
null
&&
StringUtils
.
isNotBlank
(
String
.
valueOf
(
params
.
get
(
"sidx"
)))){
//
if(params.get("sidx")!=null && StringUtils.isNotBlank(String.valueOf(params.get("sidx")))){
if
(
String
.
valueOf
(
params
.
get
(
"sidx"
)).
equalsIgnoreCase
(
"type"
))
{
//
if(String.valueOf(params.get("sidx")).equalsIgnoreCase("type")) {
params
.
put
(
"sidx"
,
"typeid"
);
//
params.put("sidx","typeid");
medicalEntityQueryWrapper
.
orderByAsc
(
"typeid"
);
//
medicalEntityQueryWrapper.orderByAsc("typeid");
}
//
}
}
else
{
//
} else{
medicalEntityQueryWrapper
.
orderByAsc
(
"typeid"
);
//
medicalEntityQueryWrapper.orderByAsc("typeid");
}
//
}
IPage
<
MedicalEntity
>
page
=
this
.
page
(
IPage
<
MedicalEntity
>
page
=
this
.
page
(
...
@@ -69,4 +67,4 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i
...
@@ -69,4 +67,4 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i
}
}
}
}
\ No newline at end of file
src/main/java/io/office/modules/manage/utils/GLNSearchUtils.java
View file @
22f2516a
...
@@ -5,6 +5,7 @@ import io.office.modules.manage.webservice.WebServiceXmlTemplate;
...
@@ -5,6 +5,7 @@ import io.office.modules.manage.webservice.WebServiceXmlTemplate;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
...
@@ -108,4 +109,49 @@ public class GLNSearchUtils {
...
@@ -108,4 +109,49 @@ public class GLNSearchUtils {
}
}
public
static
void
main
(
String
[]
args
)
{
String
smsTemplateXml
=
WebServiceXmlTemplate
.
SEND_MESSAGE_TEMPLATE
.
replaceAll
(
"\\$\\{cascade\\}"
,
"9"
).
replaceAll
(
"\\$\\{requestedKeyCode\\}"
,
"GLN"
)
.
replaceAll
(
"\\$\\{requestedKeyValue\\}"
,
"6929020221650"
).
replaceAll
(
"\\$\\{requestedLanguage\\}"
,
"en"
);
String
url
=
"http://webservice.anccnet.com:8080/gepir4/gepirv4.asmx"
;
RestTemplate
restTemplate
=
new
RestTemplate
();
//创建请求头
//创建请求头
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
TEXT_XML
);
HttpEntity
<
String
>
entity
=
new
HttpEntity
<>(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
+
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n"
+
" <soap:Header>\n"
+
" <gep:requestHeader xmlns=\"http://gepir4.ws.gs1.org/\">\n"
+
" <requesterGLN xmlns=\"\">6900000000007</requesterGLN>\n"
+
" <onBehalfOfGLN xmlns=\"\">6900000000007</onBehalfOfGLN>\n"
+
" <isAuthenticated xmlns=\"\">true</isAuthenticated>\n"
+
" <cascade xmlns=\"\">9</cascade>\n"
+
" </gep:requestHeader>\n"
+
" </soap:Header>\n"
+
" <soap:Body>\n"
+
" <getKeyLicensee xmlns=\"http://gepir4.ws.gs1.org/\">\n"
+
" <getKeyLicensee xmlns=\"\">\n"
+
" <getKeyLicensee>\n"
+
" <requestedKeyCode>GLN</requestedKeyCode>\n"
+
" <requestedKeyValue>6970974940012</requestedKeyValue>\n"
+
" <requestedLanguage>en</requestedLanguage>\n"
+
" </getKeyLicensee>\n"
+
" </getKeyLicensee>\n"
+
" </getKeyLicensee>\n"
+
" </soap:Body>\n"
+
"</soap:Envelope>\n"
,
headers
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
postForEntity
(
url
,
entity
,
String
.
class
);
System
.
out
.
println
(
responseEntity
);
}
}
}
src/main/java/io/office/modules/sys/controller/SysRoleController.java
View file @
22f2516a
...
@@ -44,15 +44,15 @@ public class SysRoleController extends AbstractController {
...
@@ -44,15 +44,15 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions
(
"sys:role:list"
)
@RequiresPermissions
(
"sys:role:list"
)
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
//如果不是超级管理员,则只查询自己创建的角色列表
//如果不是超级管理员,则只查询自己创建的角色列表
//
if(getUserId() != Constant.SUPER_ADMIN){
if
(
getUserId
()
!=
Constant
.
SUPER_ADMIN
){
//
params.put("createUserId", getUserId());
params
.
put
(
"createUserId"
,
getUserId
());
//
}
}
PageUtils
page
=
sysRoleService
.
queryPage
(
params
);
PageUtils
page
=
sysRoleService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
return
R
.
ok
().
put
(
"page"
,
page
);
}
}
/**
/**
* 角色列表
* 角色列表
*/
*/
...
@@ -60,16 +60,16 @@ public class SysRoleController extends AbstractController {
...
@@ -60,16 +60,16 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions
(
"sys:role:select"
)
@RequiresPermissions
(
"sys:role:select"
)
public
R
select
(){
public
R
select
(){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
//如果不是超级管理员,则只查询自己所拥有的角色列表
//如果不是超级管理员,则只查询自己所拥有的角色列表
//
if(getUserId() != Constant.SUPER_ADMIN){
if
(
getUserId
()
!=
Constant
.
SUPER_ADMIN
){
//
map.put("create_user_id", getUserId());
map
.
put
(
"create_user_id"
,
getUserId
());
//
}
}
List
<
SysRoleEntity
>
list
=
(
List
<
SysRoleEntity
>)
sysRoleService
.
listByMap
(
map
);
List
<
SysRoleEntity
>
list
=
(
List
<
SysRoleEntity
>)
sysRoleService
.
listByMap
(
map
);
return
R
.
ok
().
put
(
"list"
,
list
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
}
/**
/**
* 角色信息
* 角色信息
*/
*/
...
@@ -77,14 +77,14 @@ public class SysRoleController extends AbstractController {
...
@@ -77,14 +77,14 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions
(
"sys:role:info"
)
@RequiresPermissions
(
"sys:role:info"
)
public
R
info
(
@PathVariable
(
"roleId"
)
Long
roleId
){
public
R
info
(
@PathVariable
(
"roleId"
)
Long
roleId
){
SysRoleEntity
role
=
sysRoleService
.
getById
(
roleId
);
SysRoleEntity
role
=
sysRoleService
.
getById
(
roleId
);
//查询角色对应的菜单
//查询角色对应的菜单
List
<
Long
>
menuIdList
=
sysRoleMenuService
.
queryMenuIdList
(
roleId
);
List
<
Long
>
menuIdList
=
sysRoleMenuService
.
queryMenuIdList
(
roleId
);
role
.
setMenuIdList
(
menuIdList
);
role
.
setMenuIdList
(
menuIdList
);
return
R
.
ok
().
put
(
"role"
,
role
);
return
R
.
ok
().
put
(
"role"
,
role
);
}
}
/**
/**
* 保存角色
* 保存角色
*/
*/
...
@@ -93,13 +93,13 @@ public class SysRoleController extends AbstractController {
...
@@ -93,13 +93,13 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions
(
"sys:role:save"
)
@RequiresPermissions
(
"sys:role:save"
)
public
R
save
(
@RequestBody
SysRoleEntity
role
){
public
R
save
(
@RequestBody
SysRoleEntity
role
){
ValidatorUtils
.
validateEntity
(
role
);
ValidatorUtils
.
validateEntity
(
role
);
role
.
setCreateUserId
(
getUserId
());
role
.
setCreateUserId
(
getUserId
());
sysRoleService
.
saveRole
(
role
);
sysRoleService
.
saveRole
(
role
);
return
R
.
ok
();
return
R
.
ok
();
}
}
/**
/**
* 修改角色
* 修改角色
*/
*/
...
@@ -108,13 +108,13 @@ public class SysRoleController extends AbstractController {
...
@@ -108,13 +108,13 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions
(
"sys:role:update"
)
@RequiresPermissions
(
"sys:role:update"
)
public
R
update
(
@RequestBody
SysRoleEntity
role
){
public
R
update
(
@RequestBody
SysRoleEntity
role
){
ValidatorUtils
.
validateEntity
(
role
);
ValidatorUtils
.
validateEntity
(
role
);
role
.
setCreateUserId
(
getUserId
());
role
.
setCreateUserId
(
getUserId
());
sysRoleService
.
update
(
role
);
sysRoleService
.
update
(
role
);
return
R
.
ok
();
return
R
.
ok
();
}
}
/**
/**
* 删除角色
* 删除角色
*/
*/
...
@@ -123,7 +123,7 @@ public class SysRoleController extends AbstractController {
...
@@ -123,7 +123,7 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions
(
"sys:role:delete"
)
@RequiresPermissions
(
"sys:role:delete"
)
public
R
delete
(
@RequestBody
Long
[]
roleIds
){
public
R
delete
(
@RequestBody
Long
[]
roleIds
){
sysRoleService
.
deleteBatch
(
roleIds
);
sysRoleService
.
deleteBatch
(
roleIds
);
return
R
.
ok
();
return
R
.
ok
();
}
}
}
}
src/main/java/io/office/modules/sys/controller/SysUserController.java
View file @
22f2516a
...
@@ -50,14 +50,14 @@ public class SysUserController extends AbstractController {
...
@@ -50,14 +50,14 @@ public class SysUserController extends AbstractController {
@RequiresPermissions
(
"sys:user:list"
)
@RequiresPermissions
(
"sys:user:list"
)
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
//只有超级管理员,才能查看所有管理员列表
//只有超级管理员,才能查看所有管理员列表
//
if(getUserId() != Constant.SUPER_ADMIN){
if
(
getUserId
()
!=
Constant
.
SUPER_ADMIN
){
//
params.put("createUserId", getUserId());
params
.
put
(
"createUserId"
,
getUserId
());
//
}
}
PageUtils
page
=
sysUserService
.
queryPage
(
params
);
PageUtils
page
=
sysUserService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
return
R
.
ok
().
put
(
"page"
,
page
);
}
}
/**
/**
* 获取登录的用户信息
* 获取登录的用户信息
*/
*/
...
@@ -65,7 +65,7 @@ public class SysUserController extends AbstractController {
...
@@ -65,7 +65,7 @@ public class SysUserController extends AbstractController {
public
R
info
(){
public
R
info
(){
return
R
.
ok
().
put
(
"user"
,
getUser
());
return
R
.
ok
().
put
(
"user"
,
getUser
());
}
}
/**
/**
* 修改登录用户密码
* 修改登录用户密码
*/
*/
...
@@ -73,21 +73,21 @@ public class SysUserController extends AbstractController {
...
@@ -73,21 +73,21 @@ public class SysUserController extends AbstractController {
@RequestMapping
(
"/password"
)
@RequestMapping
(
"/password"
)
public
R
password
(
@RequestBody
PasswordForm
form
){
public
R
password
(
@RequestBody
PasswordForm
form
){
Assert
.
isBlank
(
form
.
getNewPassword
(),
"新密码不为能空"
);
Assert
.
isBlank
(
form
.
getNewPassword
(),
"新密码不为能空"
);
//sha256加密
//sha256加密
String
password
=
new
Sha256Hash
(
form
.
getPassword
(),
getUser
().
getSalt
()).
toHex
();
String
password
=
new
Sha256Hash
(
form
.
getPassword
(),
getUser
().
getSalt
()).
toHex
();
//sha256加密
//sha256加密
String
newPassword
=
new
Sha256Hash
(
form
.
getNewPassword
(),
getUser
().
getSalt
()).
toHex
();
String
newPassword
=
new
Sha256Hash
(
form
.
getNewPassword
(),
getUser
().
getSalt
()).
toHex
();
//更新密码
//更新密码
boolean
flag
=
sysUserService
.
updatePassword
(
getUserId
(),
password
,
newPassword
);
boolean
flag
=
sysUserService
.
updatePassword
(
getUserId
(),
password
,
newPassword
);
if
(!
flag
){
if
(!
flag
){
return
R
.
error
(
"原密码不正确"
);
return
R
.
error
(
"原密码不正确"
);
}
}
return
R
.
ok
();
return
R
.
ok
();
}
}
/**
/**
* 用户信息
* 用户信息
*/
*/
...
@@ -95,14 +95,14 @@ public class SysUserController extends AbstractController {
...
@@ -95,14 +95,14 @@ public class SysUserController extends AbstractController {
@RequiresPermissions
(
"sys:user:info"
)
@RequiresPermissions
(
"sys:user:info"
)
public
R
info
(
@PathVariable
(
"userId"
)
Long
userId
){
public
R
info
(
@PathVariable
(
"userId"
)
Long
userId
){
SysUserEntity
user
=
sysUserService
.
getById
(
userId
);
SysUserEntity
user
=
sysUserService
.
getById
(
userId
);
//获取用户所属的角色列表
//获取用户所属的角色列表
List
<
Long
>
roleIdList
=
sysUserRoleService
.
queryRoleIdList
(
userId
);
List
<
Long
>
roleIdList
=
sysUserRoleService
.
queryRoleIdList
(
userId
);
user
.
setRoleIdList
(
roleIdList
);
user
.
setRoleIdList
(
roleIdList
);
return
R
.
ok
().
put
(
"user"
,
user
);
return
R
.
ok
().
put
(
"user"
,
user
);
}
}
/**
/**
* 保存用户
* 保存用户
*/
*/
...
@@ -111,13 +111,13 @@ public class SysUserController extends AbstractController {
...
@@ -111,13 +111,13 @@ public class SysUserController extends AbstractController {
@RequiresPermissions
(
"sys:user:save"
)
@RequiresPermissions
(
"sys:user:save"
)
public
R
save
(
@RequestBody
SysUserEntity
user
){
public
R
save
(
@RequestBody
SysUserEntity
user
){
ValidatorUtils
.
validateEntity
(
user
,
AddGroup
.
class
);
ValidatorUtils
.
validateEntity
(
user
,
AddGroup
.
class
);
user
.
setCreateUserId
(
getUserId
());
user
.
setCreateUserId
(
getUserId
());
sysUserService
.
saveUser
(
user
);
sysUserService
.
saveUser
(
user
);
return
R
.
ok
();
return
R
.
ok
();
}
}
/**
/**
* 修改用户
* 修改用户
*/
*/
...
@@ -129,10 +129,10 @@ public class SysUserController extends AbstractController {
...
@@ -129,10 +129,10 @@ public class SysUserController extends AbstractController {
user
.
setCreateUserId
(
getUserId
());
user
.
setCreateUserId
(
getUserId
());
sysUserService
.
update
(
user
);
sysUserService
.
update
(
user
);
return
R
.
ok
();
return
R
.
ok
();
}
}
/**
/**
* 删除用户
* 删除用户
*/
*/
...
@@ -143,13 +143,13 @@ public class SysUserController extends AbstractController {
...
@@ -143,13 +143,13 @@ public class SysUserController extends AbstractController {
if
(
ArrayUtils
.
contains
(
userIds
,
1L
)){
if
(
ArrayUtils
.
contains
(
userIds
,
1L
)){
return
R
.
error
(
"系统管理员不能删除"
);
return
R
.
error
(
"系统管理员不能删除"
);
}
}
if
(
ArrayUtils
.
contains
(
userIds
,
getUserId
())){
if
(
ArrayUtils
.
contains
(
userIds
,
getUserId
())){
return
R
.
error
(
"当前用户不能删除"
);
return
R
.
error
(
"当前用户不能删除"
);
}
}
sysUserService
.
deleteBatch
(
userIds
);
sysUserService
.
deleteBatch
(
userIds
);
return
R
.
ok
();
return
R
.
ok
();
}
}
}
}
src/main/java/io/office/modules/sys/service/impl/SysMenuServiceImpl.java
View file @
22f2516a
...
@@ -30,14 +30,14 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
...
@@ -30,14 +30,14 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
private
SysUserService
sysUserService
;
private
SysUserService
sysUserService
;
@Autowired
@Autowired
private
SysRoleMenuService
sysRoleMenuService
;
private
SysRoleMenuService
sysRoleMenuService
;
@Override
@Override
public
List
<
SysMenuEntity
>
queryListParentId
(
Long
parentId
,
List
<
Long
>
menuIdList
)
{
public
List
<
SysMenuEntity
>
queryListParentId
(
Long
parentId
,
List
<
Long
>
menuIdList
)
{
List
<
SysMenuEntity
>
menuList
=
queryListParentId
(
parentId
);
List
<
SysMenuEntity
>
menuList
=
queryListParentId
(
parentId
);
if
(
menuIdList
==
null
){
if
(
menuIdList
==
null
){
return
menuList
;
return
menuList
;
}
}
List
<
SysMenuEntity
>
userMenuList
=
new
ArrayList
<>();
List
<
SysMenuEntity
>
userMenuList
=
new
ArrayList
<>();
for
(
SysMenuEntity
menu
:
menuList
){
for
(
SysMenuEntity
menu
:
menuList
){
if
(
menuIdList
.
contains
(
menu
.
getMenuId
())){
if
(
menuIdList
.
contains
(
menu
.
getMenuId
())){
...
@@ -60,10 +60,10 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
...
@@ -60,10 +60,10 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
@Override
@Override
public
List
<
SysMenuEntity
>
getUserMenuList
(
Long
userId
)
{
public
List
<
SysMenuEntity
>
getUserMenuList
(
Long
userId
)
{
//系统管理员,拥有最高权限
//系统管理员,拥有最高权限
//
if(userId == Constant.SUPER_ADMIN){
if
(
userId
==
Constant
.
SUPER_ADMIN
){
//
return getAllMenuList(null);
return
getAllMenuList
(
null
);
//
}
}
//用户菜单列表
//用户菜单列表
List
<
Long
>
menuIdList
=
sysUserService
.
queryAllMenuId
(
userId
);
List
<
Long
>
menuIdList
=
sysUserService
.
queryAllMenuId
(
userId
);
return
getAllMenuList
(
menuIdList
);
return
getAllMenuList
(
menuIdList
);
...
@@ -85,7 +85,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
...
@@ -85,7 +85,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
List
<
SysMenuEntity
>
menuList
=
queryListParentId
(
0L
,
menuIdList
);
List
<
SysMenuEntity
>
menuList
=
queryListParentId
(
0L
,
menuIdList
);
//递归获取子菜单
//递归获取子菜单
getMenuTreeList
(
menuList
,
menuIdList
);
getMenuTreeList
(
menuList
,
menuIdList
);
return
menuList
;
return
menuList
;
}
}
...
@@ -94,7 +94,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
...
@@ -94,7 +94,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
*/
*/
private
List
<
SysMenuEntity
>
getMenuTreeList
(
List
<
SysMenuEntity
>
menuList
,
List
<
Long
>
menuIdList
){
private
List
<
SysMenuEntity
>
getMenuTreeList
(
List
<
SysMenuEntity
>
menuList
,
List
<
Long
>
menuIdList
){
List
<
SysMenuEntity
>
subMenuList
=
new
ArrayList
<
SysMenuEntity
>();
List
<
SysMenuEntity
>
subMenuList
=
new
ArrayList
<
SysMenuEntity
>();
for
(
SysMenuEntity
entity
:
menuList
){
for
(
SysMenuEntity
entity
:
menuList
){
//目录
//目录
if
(
entity
.
getType
()
==
Constant
.
MenuType
.
CATALOG
.
getValue
()){
if
(
entity
.
getType
()
==
Constant
.
MenuType
.
CATALOG
.
getValue
()){
...
@@ -102,7 +102,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
...
@@ -102,7 +102,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
}
}
subMenuList
.
add
(
entity
);
subMenuList
.
add
(
entity
);
}
}
return
subMenuList
;
return
subMenuList
;
}
}
}
}
src/main/java/io/office/modules/sys/service/impl/SysRoleServiceImpl.java
View file @
22f2516a
...
@@ -87,7 +87,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
...
@@ -87,7 +87,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
this
.
save
(
role
);
this
.
save
(
role
);
//检查权限是否越权
//检查权限是否越权
checkPrems
(
role
);
//
checkPrems(role);
//保存角色与菜单关系
//保存角色与菜单关系
sysRoleMenuService
.
saveOrUpdate
(
role
.
getRoleId
(),
role
.
getMenuIdList
());
sysRoleMenuService
.
saveOrUpdate
(
role
.
getRoleId
(),
role
.
getMenuIdList
());
...
@@ -99,7 +99,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
...
@@ -99,7 +99,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
this
.
updateById
(
role
);
this
.
updateById
(
role
);
//检查权限是否越权
//检查权限是否越权
checkPrems
(
role
);
//
checkPrems(role);
//更新角色与菜单关系
//更新角色与菜单关系
sysRoleMenuService
.
saveOrUpdate
(
role
.
getRoleId
(),
role
.
getMenuIdList
());
sysRoleMenuService
.
saveOrUpdate
(
role
.
getRoleId
(),
role
.
getMenuIdList
());
...
@@ -129,9 +129,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
...
@@ -129,9 +129,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
*/
*/
private
void
checkPrems
(
SysRoleEntity
role
)
{
private
void
checkPrems
(
SysRoleEntity
role
)
{
//如果不是超级管理员,则需要判断角色的权限是否超过自己的权限
//如果不是超级管理员,则需要判断角色的权限是否超过自己的权限
//
if(role.getCreateUserId() == Constant.SUPER_ADMIN){
if
(
role
.
getCreateUserId
()
==
Constant
.
SUPER_ADMIN
){
//
return ;
return
;
//
}
}
//查询用户所拥有的菜单列表
//查询用户所拥有的菜单列表
List
<
Long
>
menuIdList
=
sysUserService
.
queryAllMenuId
(
role
.
getCreateUserId
());
List
<
Long
>
menuIdList
=
sysUserService
.
queryAllMenuId
(
role
.
getCreateUserId
());
...
...
src/main/java/io/office/modules/sys/service/impl/SysUserServiceImpl.java
View file @
22f2516a
...
@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...
@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.common.exception.RRException
;
import
io.office.common.exception.RRException
;
import
io.office.common.utils.Constant
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.common.utils.Query
;
import
io.office.modules.sys.dao.SysUserDao
;
import
io.office.modules.sys.dao.SysUserDao
;
...
@@ -84,10 +83,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
...
@@ -84,10 +83,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
user
.
setPassword
(
new
Sha256Hash
(
user
.
getPassword
(),
salt
).
toHex
());
user
.
setPassword
(
new
Sha256Hash
(
user
.
getPassword
(),
salt
).
toHex
());
user
.
setSalt
(
salt
);
user
.
setSalt
(
salt
);
this
.
save
(
user
);
this
.
save
(
user
);
//检查角色是否越权
//检查角色是否越权
checkRole
(
user
);
//
checkRole(user);
//保存用户与角色关系
//保存用户与角色关系
sysUserRoleService
.
saveOrUpdate
(
user
.
getUserId
(),
user
.
getRoleIdList
());
sysUserRoleService
.
saveOrUpdate
(
user
.
getUserId
(),
user
.
getRoleIdList
());
}
}
...
@@ -101,10 +100,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
...
@@ -101,10 +100,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
user
.
setPassword
(
new
Sha256Hash
(
user
.
getPassword
(),
user
.
getSalt
()).
toHex
());
user
.
setPassword
(
new
Sha256Hash
(
user
.
getPassword
(),
user
.
getSalt
()).
toHex
());
}
}
this
.
updateById
(
user
);
this
.
updateById
(
user
);
//检查角色是否越权
//检查角色是否越权
checkRole
(
user
);
//
checkRole(user);
//保存用户与角色关系
//保存用户与角色关系
sysUserRoleService
.
saveOrUpdate
(
user
.
getUserId
(),
user
.
getRoleIdList
());
sysUserRoleService
.
saveOrUpdate
(
user
.
getUserId
(),
user
.
getRoleIdList
());
}
}
...
@@ -121,7 +120,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
...
@@ -121,7 +120,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
return
this
.
update
(
userEntity
,
return
this
.
update
(
userEntity
,
new
QueryWrapper
<
SysUserEntity
>().
eq
(
"user_id"
,
userId
).
eq
(
"password"
,
password
));
new
QueryWrapper
<
SysUserEntity
>().
eq
(
"user_id"
,
userId
).
eq
(
"password"
,
password
));
}
}
/**
/**
* 检查角色是否越权
* 检查角色是否越权
*/
*/
...
@@ -130,10 +129,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
...
@@ -130,10 +129,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
return
;
return
;
}
}
//如果不是超级管理员,则需要判断用户的角色是否自己创建
//如果不是超级管理员,则需要判断用户的角色是否自己创建
//
if(user.getCreateUserId() == Constant.SUPER_ADMIN){
//
if(user.getCreateUserId() == Constant.SUPER_ADMIN){
//
return ;
//
return ;
//
}
//
}
//查询用户创建的角色列表
//查询用户创建的角色列表
List
<
Long
>
roleIdList
=
sysRoleService
.
queryRoleIdList
(
user
.
getCreateUserId
());
List
<
Long
>
roleIdList
=
sysRoleService
.
queryRoleIdList
(
user
.
getCreateUserId
());
...
@@ -142,4 +141,4 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
...
@@ -142,4 +141,4 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
throw
new
RRException
(
"新增用户所选角色,不是本人创建"
);
throw
new
RRException
(
"新增用户所选角色,不是本人创建"
);
}
}
}
}
}
}
\ No newline at end of file
src/main/resources/mapper/manage/ClickDetailDao.xml
View file @
22f2516a
This diff is collapsed.
Click to expand it.
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