Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴学德
gdtel-gztel-school-center
Commits
bee4dde4
Commit
bee4dde4
authored
Mar 15, 2022
by
伍思炜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
脱敏2
parent
e95b9f7f
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
367 additions
and
115 deletions
+367
-115
apply-net/src/main/java/com/winsun/controller/ImgController.java
+30
-0
common/src/main/java/com/winsun/advice/ErrorControllerAdvice.java
+3
-1
common/src/main/java/com/winsun/mapper/PartnerMapper.java
+15
-9
core-service/src/main/java/com/winsun/intercept/AuthConfigurationSupport.java
+32
-0
core-service/src/main/java/com/winsun/intercept/AuthIntercept.java
+123
-0
service-manager/pom.xml
+4
-1
service-manager/src/main/java/com/winsun/controller/ImgController.java
+6
-6
service-manager/src/main/java/com/winsun/controller/PartnerController.java
+9
-0
service-manager/src/main/java/com/winsun/controller/StudentCardVerifyController.java
+119
-91
service-manager/src/main/java/com/winsun/intercept/AuthIntercept.java
+26
-7
No files found.
apply-net/src/main/java/com/winsun/controller/ImgController.java
View file @
bee4dde4
...
...
@@ -51,4 +51,34 @@ public class ImgController {
}
return
bytes
;
}
@RequestMapping
(
value
=
"/pictures/**"
,
produces
={
MediaType
.
IMAGE_JPEG_VALUE
,
MediaType
.
IMAGE_PNG_VALUE
}
)
public
byte
[]
getbackground2
(
HttpServletRequest
request
)
{
byte
[]
bytes
=
new
byte
[
10
];
if
(
request
.
getServletPath
().
contains
(
"Card"
)){
return
bytes
;
}
String
replace
=
request
.
getServletPath
().
replace
(
"pictures"
,
"images"
);
System
.
out
.
println
(
"url:"
+
replace
);
String
imgurl
=
pathPre
+
FilePath
.
BACKGROUNDIMG
.
getValue
()+
"/"
+
replace
;
imgurl
=
imgurl
.
replace
(
"//"
,
"/"
);
File
file
=
new
File
(
imgurl
);
FileInputStream
inputStream
=
null
;
try
{
inputStream
=
new
FileInputStream
(
file
);
bytes
=
new
byte
[
inputStream
.
available
()];
if
(
inputStream
!=
null
)
{
inputStream
.
read
(
bytes
,
0
,
inputStream
.
available
());
}
}
catch
(
IOException
e
)
{
log
.
error
(
"图片下载失败"
,
e
.
getMessage
());
}
finally
{
if
(
inputStream
!=
null
)
{
try
{
inputStream
.
close
();
}
catch
(
Exception
e
){}
}
}
return
bytes
;
}
}
common/src/main/java/com/winsun/advice/ErrorControllerAdvice.java
View file @
bee4dde4
...
...
@@ -3,6 +3,7 @@ package com.winsun.advice;
import
com.winsun.auth.core.common.model.ResponseData
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.RestControllerAdvice
;
...
...
@@ -12,11 +13,12 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
*/
@Slf4j
@RestControllerAdvice
@Order
(-
2
)
public
class
ErrorControllerAdvice
{
private
final
static
Integer
errorLength
=
20
;
@ExceptionHandler
(
Exception
.
class
)
@ExceptionHandler
(
Runtime
Exception
.
class
)
public
ResponseData
<
String
>
allErrorHandler
(
Exception
e
)
{
String
message
=
e
.
getMessage
();
if
(
StringUtils
.
isNotBlank
(
message
)
&&
message
.
length
()
>
errorLength
)
{
...
...
common/src/main/java/com/winsun/mapper/PartnerMapper.java
View file @
bee4dde4
...
...
@@ -18,22 +18,28 @@ import org.springframework.stereotype.Component;
@Component
public
interface
PartnerMapper
extends
BaseMapper
<
Partner
>
{
@Update
(
"update sys_user set phone = #{phone} ,name = #{name} ,account = #{account} ,sex = #{sex}, password = #{password}, roleid= #{roleId}, substName = #{subName} where id=#{id}"
)
@Update
(
"<script>update sys_user set "
+
"<if test=\"phone != null and phone != ''\">phone = #{phone} ,</if>"
+
"name = #{name} ,"
+
"<if test=\"account != null and account != ''\">account = #{account},</if> "
+
"sex = #{sex}, password = #{password}, roleid= #{roleId}, substName = #{subName} where id=#{id}</script>"
)
int
updateSysUser
(
@Param
(
"phone"
)
String
phone
,
@Param
(
"name"
)
String
name
,
@Param
(
"account"
)
String
account
,
@Param
(
"sex"
)
String
sex
,
@Param
(
"password"
)
String
password
,
@Param
(
"roleId"
)
String
roleId
,
@Param
(
"id"
)
String
id
,
@Param
(
"subName"
)
String
subName
);
@Update
(
"update hhr_user set ysm = #{ysm} ,grade = #{grade} ,id_card = #{idCard},position = #{position} ,parent_id = #{parentId} ,parent_ids = #{parentIds} where id=#{id}"
)
int
updateHhUser
(
@Param
(
"ysm"
)
String
ysm
,
@Param
(
"grade"
)
String
grade
,
@Param
(
"idCard"
)
String
idCard
,
@Param
(
"position"
)
String
position
,
@Param
(
"parentId"
)
String
parentId
,
@Param
(
"parentIds"
)
String
parentIds
,
@Param
(
"id"
)
String
id
);
@Update
(
"<script>update hhr_user set ysm = #{ysm} ,grade = #{grade} ,<if test=\"idCard != null and idCard != ''\">"
+
" id_card = #{idCard},</if> "
+
"position = #{position} ,parent_id = #{parentId} ,parent_ids = #{parentIds} where id=#{id}</script>"
)
int
updateHhUser
(
@Param
(
"ysm"
)
String
ysm
,
@Param
(
"grade"
)
String
grade
,
@Param
(
"idCard"
)
String
idCard
,
@Param
(
"position"
)
String
position
,
@Param
(
"parentId"
)
String
parentId
,
@Param
(
"parentIds"
)
String
parentIds
,
@Param
(
"id"
)
String
id
);
@Update
(
"update hhr_user_school set school_id = #{schoolId} where user_id=#{userId}"
)
int
updateSchoolRef
(
@Param
(
"schoolId"
)
String
schoolId
,
@Param
(
"userId"
)
String
userId
);
int
updateSchoolRef
(
@Param
(
"schoolId"
)
String
schoolId
,
@Param
(
"userId"
)
String
userId
);
@Select
(
"select * from `sys_user` where account = #{account} order by createtime desc"
)
List
<
Map
<
String
,
Object
>>
selectSysUser
(
String
account
);
@Insert
(
" replace into hhr_user_school(user_id,school_id) VALUES(#{userId},#{schoolId})"
)
int
saveSchoolRef
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"schoolId"
)
String
schoolId
);
int
saveSchoolRef
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"schoolId"
)
String
schoolId
);
@Select
(
" select id,name from sys_role "
)
List
<
Map
<
String
,
Object
>>
roleList
();
}
core-service/src/main/java/com/winsun/intercept/AuthConfigurationSupport.java
0 → 100644
View file @
bee4dde4
//package com.winsun.intercept;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
//
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * @author chengfengluo
// * @date 2022-03-15 14:58
// */
//@Slf4j
//@Configuration
//public class AuthConfigurationSupport extends WebMvcConfigurationSupport {
//
// @Autowired
// private AuthIntercept authIntercept;
//
// @Override
// protected void addInterceptors(InterceptorRegistry registry) {
// log.info("配置拦截中");
// List<String> s = new ArrayList<>();
// s.add("/login");
// s.add("/getPhoneCode");
// registry.addInterceptor(authIntercept).excludePathPatterns(s);
// super.addInterceptors(registry);
// }
//}
core-service/src/main/java/com/winsun/intercept/AuthIntercept.java
0 → 100644
View file @
bee4dde4
package
com
.
winsun
.
intercept
;
import
com.alibaba.fastjson.JSONObject
;
import
com.winsun.auth.core.common.model.ResponseData
;
import
com.winsun.auth.core.shiro.ShiroUser
;
import
com.winsun.auth.model.common.Menu
;
import
com.winsun.item.core.shiro.ShiroKit
;
import
com.winsun.item.util.LoginUtils
;
import
com.winsun.mapper.SysUserMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
/**
* @author chengfengluo
* @date 2022-03-15 14:47
*/
@Slf4j
@Component
public
class
AuthIntercept
extends
HandlerInterceptorAdapter
{
@Autowired
private
StringRedisTemplate
stringRedisTemplate
;
private
final
static
String
AUTH_REDIS_PREFIX
=
"authRedis:"
;
private
final
static
String
AUTH_REDIS_SECURITY
=
"authRedisSecurity:"
;
private
final
static
Integer
CACHE_TIME
=
60
;
@Autowired
private
SysUserMapper
sysUserMapper
;
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
try
{
ShiroUser
user
=
ShiroKit
.
getUser
();
if
(
user
==
null
)
{
log
.
error
(
"错误"
);
return
false
;
}
String
security
=
request
.
getHeader
(
"security"
).
trim
();
if
(
StringUtils
.
isBlank
(
security
))
{
log
.
error
(
"校验权限失败!"
);
return
false
;
}
List
<
Integer
>
roleList
=
user
.
getRoleList
();
if
(
roleList
.
size
()
==
0
)
{
log
.
error
(
"无权限"
);
return
false
;
}
String
key
=
AUTH_REDIS_PREFIX
+
StringUtils
.
join
(
roleList
.
toArray
(),
","
);
String
securityKey
=
AUTH_REDIS_SECURITY
+
security
;
String
securityValue
=
stringRedisTemplate
.
opsForValue
().
get
(
securityKey
);
if
(
StringUtils
.
isNotBlank
(
securityValue
))
{
return
false
;
}
ResponseData
<
String
>
stringResponseData
=
LoginUtils
.
pwdDecrypt
(
security
);
if
(!
stringResponseData
.
isSuccess
())
{
log
.
error
(
"鉴权失败"
);
return
false
;
}
String
data
=
stringResponseData
.
getData
();
String
s
=
stringRedisTemplate
.
opsForValue
().
get
(
key
);
List
<
Menu
>
roleMenu
=
null
;
if
(
StringUtils
.
isNotBlank
(
s
))
{
roleMenu
=
JSONObject
.
parseArray
(
s
,
Menu
.
class
);
}
else
{
roleMenu
=
sysUserMapper
.
getRoleMenu
(
roleList
);
stringRedisTemplate
.
opsForValue
().
set
(
key
,
JSONObject
.
toJSONString
(
roleMenu
),
CACHE_TIME
,
TimeUnit
.
SECONDS
);
}
if
(
roleMenu
==
null
||
roleMenu
.
isEmpty
())
{
return
false
;
}
log
.
info
(
"data: {}"
,
data
);
for
(
Menu
menu
:
roleMenu
)
{
if
(
menu
==
null
||
StringUtils
.
isBlank
(
menu
.
getUrl
()))
{
continue
;
}
log
.
info
(
menu
.
getUrl
());
if
(
StringUtils
.
equals
(
menu
.
getUrl
(),
data
))
{
log
.
info
(
"获取到相同的菜单"
);
stringRedisTemplate
.
opsForValue
().
set
(
securityKey
,
"1"
,
1
,
TimeUnit
.
HOURS
);
return
true
;
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
false
;
}
@Override
public
void
postHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
ModelAndView
modelAndView
)
throws
Exception
{
super
.
postHandle
(
request
,
response
,
handler
,
modelAndView
);
}
}
service-manager/pom.xml
View file @
bee4dde4
...
...
@@ -155,7 +155,10 @@
<groupId>
com.winsun.framework
</groupId>
<artifactId>
winsun-core-service
</artifactId>
</dependency>
<dependency>
<groupId>
com.winsun.framework
</groupId>
<artifactId>
winsun-core-common
</artifactId>
</dependency>
<dependency>
<groupId>
dom4j
</groupId>
<artifactId>
dom4j
</artifactId>
...
...
service-manager/src/main/java/com/winsun/controller/ImgController.java
View file @
bee4dde4
...
...
@@ -36,19 +36,18 @@ public class ImgController extends BaseController {
//menuname = "图片路径" 只支持jpeg 和 png
@Permission
(
menuname
=
"图片查询"
,
value
=
"/images"
,
method
=
RequestMethod
.
POST
,
produces
={
MediaType
.
IMAGE_JPEG_VALUE
,
MediaType
.
IMAGE_PNG_VALUE
})
public
ResponseData
<
String
>
getbackground
(
String
url
)
{
public
String
getbackground
(
String
url
)
{
ShiroUser
shiroUser
=
getShiroUser
();
if
(!
shiroUser
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
,
"系统管理员"
,
"县分管理员(订单)"
,
"合伙人"
)))
{
return
ResponseData
.
error
(
"无数据权限"
)
;
return
"无数据权限"
;
}
System
.
out
.
println
(
"url :"
+
url
);
url
=
url
.
replace
(
"
/api/
manager/ciop"
,
""
);
url
=
url
.
replace
(
"manager/ciop"
,
""
);
byte
[]
bytes
=
new
byte
[
10
];
String
imgurl
=
pathPre
+
FilePath
.
BACKGROUNDIMG
.
getValue
()+
"/"
+
url
;
imgurl
=
imgurl
.
replace
(
"//"
,
"/"
);
//File file = new File(imgurl);
File
file
=
new
File
(
"D:\\test.jpg"
);
File
file
=
new
File
(
imgurl
);
FileInputStream
inputStream
=
null
;
try
{
inputStream
=
new
FileInputStream
(
file
);
...
...
@@ -69,6 +68,7 @@ public class ImgController extends BaseController {
}
catch
(
Exception
e
){}
}
}
return
ResponseData
.
success
(
Base64
.
encodeBase64String
(
bytes
));
String
s
=
Base64
.
encodeBase64String
(
bytes
);
return
s
;
}
}
service-manager/src/main/java/com/winsun/controller/PartnerController.java
View file @
bee4dde4
...
...
@@ -81,6 +81,15 @@ public class PartnerController extends BaseController {
if
(
StringUtils
.
isEmpty
(
subName
)
||
!
subName
.
equals
(
school
.
getSubName
())){
return
ResponseData
.
error
(
"修改失败"
);
}
if
(
phone
.
contains
(
"*"
)){
phone
=
""
;
}
if
(
account
.
contains
(
"*"
)){
account
=
""
;
}
if
(
idCard
.
contains
(
"*"
)){
idCard
=
""
;
}
int
updateSysUse
=
partnerMapper
.
updateSysUser
(
phone
,
name
,
account
,
sex
,
password
,
roleId
,
id
,
subName
);
int
updateHhUser
=
partnerMapper
.
updateHhUser
(
ysm
,
grade
,
idCard
,
position
,
parentId
,
parentIds
,
id
);
int
updateSchoolRef
=
partnerMapper
.
updateSchoolRef
(
schoolId
,
id
);
...
...
service-manager/src/main/java/com/winsun/controller/StudentCardVerifyController.java
View file @
bee4dde4
...
...
@@ -15,6 +15,7 @@ import com.winsun.bean.StudentCard;
import
com.winsun.bean.SysUser
;
import
com.winsun.mapper.StudentCardMapper
;
import
com.winsun.mapper.SysUserMapper
;
import
com.winsun.utils.DesensitizationUtil
;
import
com.winsun.utils.ExcelDealUtils
;
import
com.winsun.utils.PicturesUtil
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -53,6 +54,7 @@ public class StudentCardVerifyController extends BaseController {
private
static
String
PATH2
=
"StudentCard2"
;
private
static
String
PATH3
=
"StudentCard3"
;
private
static
String
PATH4
=
"StudentCard4"
;
/**
* 学生不限量证件信息添加
*
...
...
@@ -67,12 +69,12 @@ public class StudentCardVerifyController extends BaseController {
}
HashMap
hashMap
=
JSON
.
parseObject
(
lzKpi
,
HashMap
.
class
);
Wrapper
<
SysUser
>
sysWrapper
=
new
EntityWrapper
<>();
String
account
=
hashMap
.
get
(
"account"
)
+
""
;
String
substName
=
hashMap
.
get
(
"substName"
)
+
""
;
sysWrapper
.
eq
(
StringUtils
.
isNotBlank
(
account
),
"account"
,
account
);
sysWrapper
.
eq
(
StringUtils
.
isNotBlank
(
substName
),
"name"
,
substName
);
String
account
=
hashMap
.
get
(
"account"
)
+
""
;
String
substName
=
hashMap
.
get
(
"substName"
)
+
""
;
sysWrapper
.
eq
(
StringUtils
.
isNotBlank
(
account
),
"account"
,
account
);
sysWrapper
.
eq
(
StringUtils
.
isNotBlank
(
substName
),
"name"
,
substName
);
List
<
SysUser
>
sysUserList
=
sysUserMapper
.
selectList
(
sysWrapper
);
if
(
sysUserList
.
size
()>
0
)
{
if
(
sysUserList
.
size
()
>
0
)
{
/*ManagerKpi managerKpi = new ManagerKpi();
managerKpi.setUserId(Integer.valueOf(sysUserList.get(0).getId()));
managerKpi.setMonth(hashMap.get("month")+"");
...
...
@@ -89,11 +91,12 @@ public class StudentCardVerifyController extends BaseController {
/**
* 学生不限量证件删除
*
* @param id 需要删除的id
* @return
*/
@Permission
(
menuname
=
"删除正则信息"
,
value
=
"delete"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
deleteProduct
(
@RequestParam
(
name
=
"id"
,
required
=
false
)
String
id
,
@RequestParam
(
name
=
"isdel"
,
required
=
false
)
String
isdel
)
{
public
ResponseData
<
String
>
deleteProduct
(
@RequestParam
(
name
=
"id"
,
required
=
false
)
String
id
,
@RequestParam
(
name
=
"isdel"
,
required
=
false
)
String
isdel
)
{
ShiroUser
user
=
getShiroUser
();
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
)))
{
return
ResponseData
.
error
(
"无数据权限"
);
...
...
@@ -103,7 +106,7 @@ public class StudentCardVerifyController extends BaseController {
//Map<String, Object> dataMapping = new HashMap<>();
//dataMapping.put("is_del", isdel);
//lzKpiMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping), wrapper);
if
(
StringUtils
.
isNotBlank
(
id
))
{
if
(
StringUtils
.
isNotBlank
(
id
))
{
/*lzWageMpapper.deleteById(id);*/
return
ResponseData
.
success
(
"操作成功!"
);
}
...
...
@@ -112,6 +115,7 @@ public class StudentCardVerifyController extends BaseController {
/**
* 学生证证件照上传
*
* @param idCard
* @param userName
* @param orderPhone
...
...
@@ -125,7 +129,7 @@ public class StudentCardVerifyController extends BaseController {
@RequestMapping
(
value
=
"uploadCard"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
ResponseData
<
String
>
uploadStuCard
(
String
userName
,
String
orderPhone
,
String
linkPhone
,
String
idCard
,
String
file1
,
String
file2
,
String
file3
,
String
file4
)
{
String
idCard
,
String
file1
,
String
file2
,
String
file3
,
String
file4
)
{
if
(
StringUtils
.
isNotBlank
(
userName
))
{
return
ResponseData
.
error
(
"请填写姓名"
);
...
...
@@ -152,26 +156,26 @@ public class StudentCardVerifyController extends BaseController {
student
.
setLinkPhone
(
linkPhone
);
student
.
setIdCard
(
idCard
);
student
.
setUploadDate
(
new
Date
());
if
(
StringUtils
.
isNotBlank
(
file1
))
{
String
file01
=
PicturesUtil
.
uploadPictures
(
file1
,
""
,
PATH1
);
if
(
StringUtils
.
isNotBlank
(
file1
))
{
String
file01
=
PicturesUtil
.
uploadPictures
(
file1
,
""
,
PATH1
);
student
.
setStudentCardUrl
(
file01
);
}
if
(
StringUtils
.
isNotBlank
(
file2
))
{
String
file02
=
PicturesUtil
.
uploadPictures
(
file2
,
""
,
PATH2
);
if
(
StringUtils
.
isNotBlank
(
file2
))
{
String
file02
=
PicturesUtil
.
uploadPictures
(
file2
,
""
,
PATH2
);
student
.
setOtherImgUrl1
(
file02
);
}
if
(
StringUtils
.
isNotBlank
(
file3
))
{
String
file03
=
PicturesUtil
.
uploadPictures
(
file3
,
""
,
PATH3
);
if
(
StringUtils
.
isNotBlank
(
file3
))
{
String
file03
=
PicturesUtil
.
uploadPictures
(
file3
,
""
,
PATH3
);
student
.
setOtherImgUrl2
(
file03
);
}
if
(
StringUtils
.
isNotBlank
(
file4
))
{
String
file04
=
PicturesUtil
.
uploadPictures
(
file4
,
""
,
PATH4
);
if
(
StringUtils
.
isNotBlank
(
file4
))
{
String
file04
=
PicturesUtil
.
uploadPictures
(
file4
,
""
,
PATH4
);
student
.
setOtherImgUrl3
(
file04
);
}
Integer
integer1
=
studentCardMapper
.
update
(
student
,
wrapper
);
if
(
integer1
==
1
)
{
Integer
integer1
=
studentCardMapper
.
update
(
student
,
wrapper
);
if
(
integer1
==
1
)
{
return
ResponseData
.
success
(
"更新成功!"
);
}
else
{
}
else
{
student
.
setIsFirstUpload
(
1
);
student
.
setFirstUploadDate
(
new
Date
());
studentCardMapper
.
insert
(
student
);
...
...
@@ -181,14 +185,15 @@ public class StudentCardVerifyController extends BaseController {
/**
* 修改学生不限量证件状态
*
* @param ids
* @param state
* @return
*/
@Permission
(
menuname
=
"修改学生不限量证件信息"
,
value
=
"update"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
updateProduct
(
@RequestParam
(
"ids"
)
String
ids
,
@RequestParam
(
"state"
)
Integer
state
)
{
public
ResponseData
<
String
>
updateProduct
(
@RequestParam
(
"ids"
)
String
ids
,
@RequestParam
(
"state"
)
Integer
state
)
{
ShiroUser
user
=
getShiroUser
();
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
,
"业务稽核"
,
"稽核员"
)))
{
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
,
"业务稽核"
,
"稽核员"
)))
{
return
ResponseData
.
error
(
"无数据权限"
);
}
List
<
String
>
list1
=
Arrays
.
asList
(
ids
.
split
(
","
));
//[a, b, c]
...
...
@@ -200,12 +205,11 @@ public class StudentCardVerifyController extends BaseController {
StudentCard
studentCard
=
new
StudentCard
();
studentCard
.
setAuditState
(
state
);
wrapper
.
in
(
"id"
,
list
);
studentCardMapper
.
update
(
studentCard
,
wrapper
);
studentCardMapper
.
update
(
studentCard
,
wrapper
);
return
ResponseData
.
success
(
"修改成功!"
);
}
/**
*
* @param ids
* @return
*/
...
...
@@ -217,13 +221,13 @@ public class StudentCardVerifyController extends BaseController {
}
List
<
String
>
list1
=
Arrays
.
asList
(
ids
.
split
(
","
));
//[a, b, c]
String
id
=
""
;
if
(
list1
.
size
()>
0
)
{
if
(
list1
.
size
()
>
0
)
{
id
=
list1
.
get
(
0
);
}
else
{
}
else
{
return
ResponseData
.
error
(
"查询ID不能为空!!!"
);
}
Wrapper
<
StudentCard
>
studentCardWrapper
=
new
EntityWrapper
<>();
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
StudentCard
studentCard
=
studentCardMapper
.
selectList
(
studentCardWrapper
).
get
(
0
);
return
ResponseData
.
success
(
studentCard
,
"查询成功!"
);
...
...
@@ -259,32 +263,42 @@ public class StudentCardVerifyController extends BaseController {
Page
<
StudentCard
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
Wrapper
<
StudentCard
>
studentCardWrapper
=
new
EntityWrapper
<>();
studentCardWrapper
.
like
(
StringUtils
.
isNotBlank
(
userName
),
"user_name"
,
userName
,
SqlLike
.
DEFAULT
);
studentCardWrapper
.
like
(
StringUtils
.
isNotBlank
(
auditName
),
"audit_name"
,
auditName
,
SqlLike
.
DEFAULT
);
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
orderPhone
),
"order_phone"
,
orderPhone
);
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
linkPhone
),
"link_phone"
,
linkPhone
);
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
auditState
),
"audit_state"
,
auditState
);
studentCardWrapper
.
like
(
StringUtils
.
isNotBlank
(
userName
),
"user_name"
,
userName
,
SqlLike
.
DEFAULT
);
studentCardWrapper
.
like
(
StringUtils
.
isNotBlank
(
auditName
),
"audit_name"
,
auditName
,
SqlLike
.
DEFAULT
);
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
orderPhone
),
"order_phone"
,
orderPhone
);
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
linkPhone
),
"link_phone"
,
linkPhone
);
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
auditState
),
"audit_state"
,
auditState
);
// studentCardWrapper.orderBy("audit_date",false);
studentCardWrapper
.
orderBy
(
"upload_date"
,
false
);
if
(
StringUtils
.
isNotBlank
(
uploadDate
))
{
if
(
StringUtils
.
isNotBlank
(
uploadDate
))
{
String
[]
dates
=
uploadDate
.
split
(
"\\,"
);
if
(!
uploadDate
.
equals
(
","
))
{
studentCardWrapper
.
between
(
"upload_date"
,
dates
[
0
],
dates
[
1
]);
if
(!
uploadDate
.
equals
(
","
))
{
studentCardWrapper
.
between
(
"upload_date"
,
dates
[
0
],
dates
[
1
]);
}
}
if
(
StringUtils
.
isNotBlank
(
auditDate
))
{
if
(
StringUtils
.
isNotBlank
(
auditDate
))
{
String
[]
dates
=
auditDate
.
split
(
"\\,"
);
if
(!
auditDate
.
equals
(
","
))
{
studentCardWrapper
.
between
(
"audit_date"
,
dates
[
0
],
dates
[
1
]);
if
(!
auditDate
.
equals
(
","
))
{
studentCardWrapper
.
between
(
"audit_date"
,
dates
[
0
],
dates
[
1
]);
}
}
List
<
StudentCard
>
aPackage
=
studentCardMapper
.
selectPage
(
page
,
studentCardWrapper
);
for
(
StudentCard
studentCard
:
aPackage
)
{
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIdCard
()))
{
studentCard
.
setIdCard
(
DesensitizationUtil
.
desensitizedIdNumber
(
studentCard
.
getIdCard
()));
}
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getLinkPhone
()))
{
studentCard
.
setLinkPhone
(
DesensitizationUtil
.
desensitizedPhoneNumber
(
studentCard
.
getLinkPhone
()));
}
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getOrderPhone
()))
{
studentCard
.
setOrderPhone
(
DesensitizationUtil
.
desensitizedPhoneNumber
(
studentCard
.
getOrderPhone
()));
}
}
page
.
setRecords
(
aPackage
);
return
ResponseData
.
success
(
page
,
"查询成功!"
);
}
/**
*
* @param auditState
* @throws IOException
*/
...
...
@@ -295,25 +309,25 @@ public class StudentCardVerifyController extends BaseController {
@RequestParam
(
name
=
"auditName"
,
required
=
false
)
String
auditName
,
@RequestParam
(
name
=
"auditState"
,
required
=
false
)
String
auditState
,
@RequestParam
(
name
=
"uploadDate"
,
required
=
false
)
String
uploadDate
,
@RequestParam
(
name
=
"auditDate"
,
required
=
false
)
String
auditDate
)
throws
IOException
{
@RequestParam
(
name
=
"auditDate"
,
required
=
false
)
String
auditDate
)
throws
IOException
{
Wrapper
<
StudentCard
>
studentCardWrapper
=
new
EntityWrapper
<>();
studentCardWrapper
.
like
(
StringUtils
.
isNotBlank
(
userName
),
"user_name"
,
userName
,
SqlLike
.
DEFAULT
);
studentCardWrapper
.
like
(
StringUtils
.
isNotBlank
(
auditName
),
"audit_name"
,
auditName
,
SqlLike
.
DEFAULT
);
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
orderPhone
),
"order_phone"
,
orderPhone
);
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
linkPhone
),
"link_phone"
,
linkPhone
);
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
auditState
),
"audit_state"
,
auditState
);
studentCardWrapper
.
orderBy
(
"audit_date"
,
false
);
if
(
StringUtils
.
isNotBlank
(
uploadDate
))
{
studentCardWrapper
.
like
(
StringUtils
.
isNotBlank
(
userName
),
"user_name"
,
userName
,
SqlLike
.
DEFAULT
);
studentCardWrapper
.
like
(
StringUtils
.
isNotBlank
(
auditName
),
"audit_name"
,
auditName
,
SqlLike
.
DEFAULT
);
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
orderPhone
),
"order_phone"
,
orderPhone
);
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
linkPhone
),
"link_phone"
,
linkPhone
);
studentCardWrapper
.
eq
(
StringUtils
.
isNotBlank
(
auditState
),
"audit_state"
,
auditState
);
studentCardWrapper
.
orderBy
(
"audit_date"
,
false
);
if
(
StringUtils
.
isNotBlank
(
uploadDate
))
{
String
[]
dates
=
uploadDate
.
split
(
"\\,"
);
if
(!
uploadDate
.
equals
(
","
))
{
studentCardWrapper
.
between
(
"upload_date"
,
dates
[
0
],
dates
[
1
]);
if
(!
uploadDate
.
equals
(
","
))
{
studentCardWrapper
.
between
(
"upload_date"
,
dates
[
0
],
dates
[
1
]);
}
}
if
(
StringUtils
.
isNotBlank
(
auditDate
))
{
if
(
StringUtils
.
isNotBlank
(
auditDate
))
{
String
[]
dates
=
auditDate
.
split
(
"\\,"
);
if
(!
auditDate
.
equals
(
","
))
{
studentCardWrapper
.
between
(
"audit_date"
,
dates
[
0
],
dates
[
1
]);
if
(!
auditDate
.
equals
(
","
))
{
studentCardWrapper
.
between
(
"audit_date"
,
dates
[
0
],
dates
[
1
]);
}
}
List
<
StudentCard
>
studentCards
=
studentCardMapper
.
selectList
(
studentCardWrapper
);
...
...
@@ -324,13 +338,13 @@ public class StudentCardVerifyController extends BaseController {
map
.
put
(
"orderPhone"
,
studentCard
.
getOrderPhone
());
map
.
put
(
"linkPhone"
,
studentCard
.
getLinkPhone
());
map
.
put
(
"auditName"
,
studentCard
.
getAuditName
());
if
(
null
!=
studentCard
.
getAuditDate
())
{
map
.
put
(
"auditDate"
,
DateUtil
.
formatDate
(
studentCard
.
getAuditDate
(),
"yyyy-mm-dd"
));
}
else
{
if
(
null
!=
studentCard
.
getAuditDate
())
{
map
.
put
(
"auditDate"
,
DateUtil
.
formatDate
(
studentCard
.
getAuditDate
(),
"yyyy-mm-dd"
));
}
else
{
map
.
put
(
"auditDate"
,
""
);
}
Integer
state
=
studentCard
.
getAuditState
();
if
(
state
==
1
)
if
(
state
==
1
)
map
.
put
(
"auditState"
,
"未审核"
);
else
if
(
state
==
2
)
map
.
put
(
"auditState"
,
"审核通过"
);
...
...
@@ -340,67 +354,81 @@ public class StudentCardVerifyController extends BaseController {
map
.
put
(
"auditState"
,
"无效"
);
map
.
put
(
"county"
,
studentCard
.
getCounty
());
map
.
put
(
"school"
,
studentCard
.
getSchool
());
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsComboMoney49
()+
""
))
{
map
.
put
(
"isComboMoney49"
,
studentCard
.
getIsComboMoney49
()
==
1
?
"是"
:
"否"
);
}
else
{
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsComboMoney49
()
+
""
))
{
map
.
put
(
"isComboMoney49"
,
studentCard
.
getIsComboMoney49
()
==
1
?
"是"
:
"否"
);
}
else
{
map
.
put
(
"isComboMoney49"
,
""
);
}
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsFull
()+
""
))
{
map
.
put
(
"isFull"
,
studentCard
.
getIsFull
()
==
1
?
"是"
:
"否"
);
}
else
{
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsFull
()
+
""
))
{
map
.
put
(
"isFull"
,
studentCard
.
getIsFull
()
==
1
?
"是"
:
"否"
);
}
else
{
map
.
put
(
"isFull"
,
""
);
}
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsClear
()+
""
))
{
map
.
put
(
"isClear"
,
studentCard
.
getIsClear
()
==
1
?
"是"
:
"否"
);
}
else
{
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsClear
()
+
""
))
{
map
.
put
(
"isClear"
,
studentCard
.
getIsClear
()
==
1
?
"是"
:
"否"
);
}
else
{
map
.
put
(
"isClear"
,
""
);
}
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsUnderYears
()+
""
))
{
map
.
put
(
"isUnderYears"
,
studentCard
.
getIsUnderYears
()
==
1
?
"是"
:
"否"
);
}
else
{
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsUnderYears
()
+
""
))
{
map
.
put
(
"isUnderYears"
,
studentCard
.
getIsUnderYears
()
==
1
?
"是"
:
"否"
);
}
else
{
map
.
put
(
"isUnderYears"
,
""
);
}
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsStudentAccordance
()+
""
))
{
map
.
put
(
"isStudentAccordance"
,
studentCard
.
getIsStudentAccordance
()
==
1
?
"是"
:
"否"
);
}
else
{
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsStudentAccordance
()
+
""
))
{
map
.
put
(
"isStudentAccordance"
,
studentCard
.
getIsStudentAccordance
()
==
1
?
"是"
:
"否"
);
}
else
{
map
.
put
(
"isStudentAccordance"
,
""
);
}
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsSchoolAccordance
()+
""
))
{
map
.
put
(
"isSchoolAccordance"
,
studentCard
.
getIsSchoolAccordance
()
==
1
?
"是"
:
"否"
);
}
else
{
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsSchoolAccordance
()
+
""
))
{
map
.
put
(
"isSchoolAccordance"
,
studentCard
.
getIsSchoolAccordance
()
==
1
?
"是"
:
"否"
);
}
else
{
map
.
put
(
"isSchoolAccordance"
,
""
);
}
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsComboMoney49
()+
""
))
{
map
.
put
(
"isUploadBeforeActivate"
,
studentCard
.
getIsUploadBeforeActivate
()
==
1
?
"是"
:
"否"
);
}
else
{
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsComboMoney49
()
+
""
))
{
map
.
put
(
"isUploadBeforeActivate"
,
studentCard
.
getIsUploadBeforeActivate
()
==
1
?
"是"
:
"否"
);
}
else
{
map
.
put
(
"isUploadBeforeActivate"
,
""
);
}
if
(
null
!=
studentCard
.
getUploadDate
())
{
map
.
put
(
"uploadDate"
,
DateUtil
.
formatDate
(
studentCard
.
getUploadDate
(),
"yyyy-mm-dd"
));
}
else
{
if
(
null
!=
studentCard
.
getUploadDate
())
{
map
.
put
(
"uploadDate"
,
DateUtil
.
formatDate
(
studentCard
.
getUploadDate
(),
"yyyy-mm-dd"
));
}
else
{
map
.
put
(
"uploadDate"
,
""
);
}
if
(
null
!=
studentCard
.
getCrnActivateDate
())
{
map
.
put
(
"crnActivateDate"
,
DateUtil
.
formatDate
(
studentCard
.
getCrnActivateDate
(),
"yyyy-mm-dd"
));
}
else
{
if
(
null
!=
studentCard
.
getCrnActivateDate
())
{
map
.
put
(
"crnActivateDate"
,
DateUtil
.
formatDate
(
studentCard
.
getCrnActivateDate
(),
"yyyy-mm-dd"
));
}
else
{
map
.
put
(
"crnActivateDate"
,
""
);
}
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsFirstUpload
()+
""
))
{
map
.
put
(
"isFirstUpload"
,
studentCard
.
getIsFirstUpload
()
==
1
?
"是"
:
"否"
);
}
else
{
if
(
StringUtils
.
isNotBlank
(
studentCard
.
getIsFirstUpload
()
+
""
))
{
map
.
put
(
"isFirstUpload"
,
studentCard
.
getIsFirstUpload
()
==
1
?
"是"
:
"否"
);
}
else
{
map
.
put
(
"isFirstUpload"
,
""
);
}
map
.
put
(
"agentBusinessman"
,
studentCard
.
getAgentBusinessman
());
list
.
add
(
map
);
}
List
<
Integer
>
list1
=
new
ArrayList
<>();
list1
.
add
(
2500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
2500
);
list1
.
add
(
2500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
4500
);
list1
.
add
(
2500
);
ServletOutputStream
os
=
null
;
XSSFWorkbook
workbook
=
ExcelDealUtils
.
getWorkBook2
(
ExcelDealUtils
.
studentCardExcel
(
"学生不限量证件清单"
),
list
,
list1
);
XSSFWorkbook
workbook
=
ExcelDealUtils
.
getWorkBook2
(
ExcelDealUtils
.
studentCardExcel
(
"学生不限量证件清单"
),
list
,
list1
);
try
{
HttpServletResponse
response
=
getHttpServletResponse
();
response
.
reset
();
...
...
service-manager/src/main/java/com/winsun/intercept/AuthIntercept.java
View file @
bee4dde4
...
...
@@ -39,6 +39,8 @@ public class AuthIntercept extends HandlerInterceptorAdapter {
private
final
static
String
AUTH_REDIS_PREFIX
=
"authRedis:"
;
private
final
static
String
AUTH_REDIS_SECURITY
=
"authRedisSecurity:"
;
private
final
static
Integer
CACHE_TIME
=
60
;
@Autowired
...
...
@@ -65,46 +67,63 @@ public class AuthIntercept extends HandlerInterceptorAdapter {
log
.
error
(
"无权限"
);
return
false
;
}
String
key
=
AUTH_REDIS_PREFIX
+
StringUtils
.
join
(
roleList
.
toArray
(),
","
);
String
securityKey
=
AUTH_REDIS_SECURITY
+
security
;
String
securityValue
=
stringRedisTemplate
.
opsForValue
().
get
(
securityKey
);
if
(
StringUtils
.
isNotBlank
(
securityValue
))
{
return
false
;
}
ResponseData
<
String
>
stringResponseData
=
LoginUtils
.
pwdDecrypt
(
security
);
if
(!
stringResponseData
.
isSuccess
())
{
log
.
error
(
"鉴权失败"
);
return
false
;
}
String
data
=
stringResponseData
.
getData
();
String
s
=
stringRedisTemplate
.
opsForValue
().
get
(
AUTH_REDIS_PREFIX
+
user
.
getRoleId
()
);
String
s
=
stringRedisTemplate
.
opsForValue
().
get
(
key
);
List
<
Menu
>
roleMenu
=
null
;
if
(
StringUtils
.
isNotBlank
(
s
))
{
roleMenu
=
JSONObject
.
parseArray
(
s
,
Menu
.
class
);
}
else
{
roleMenu
=
sysUserMapper
.
getRoleMenu
(
roleList
);
stringRedisTemplate
.
opsForValue
().
set
(
AUTH_REDIS_PREFIX
+
user
.
getRoleId
()
,
stringRedisTemplate
.
opsForValue
().
set
(
key
,
JSONObject
.
toJSONString
(
roleMenu
),
CACHE_TIME
,
TimeUnit
.
SECONDS
);
}
if
(
roleMenu
==
null
||
roleMenu
.
isEmpty
())
{
return
false
;
}
log
.
info
(
"data: {}"
,
data
);
for
(
Menu
menu
:
roleMenu
)
{
if
(
menu
==
null
||
StringUtils
.
isBlank
(
menu
.
getUrl
()))
{
continue
;
}
log
.
info
(
menu
.
getUrl
());
if
(
StringUtils
.
equals
(
menu
.
getUrl
(),
data
))
{
log
.
info
(
"获取到相同的菜单"
);
stringRedisTemplate
.
opsForValue
().
set
(
securityKey
,
"1"
,
1
,
TimeUnit
.
HOURS
);
return
true
;
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
super
.
preHandle
(
request
,
response
,
handler
);
return
false
;
}
@Override
public
void
postHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
ModelAndView
modelAndView
)
throws
Exception
{
Map
<
String
,
Object
>
model
=
modelAndView
.
getModel
();
log
.
info
(
"结束信息: {}"
,
JSONObject
.
toJSONString
(
model
));
super
.
postHandle
(
request
,
response
,
handler
,
modelAndView
);
}
}
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