Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Y
YX_IDENT_REFACTORING
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
zhangyusheng
YX_IDENT_REFACTORING
Commits
de04730a
Commit
de04730a
authored
Nov 19, 2018
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
fe728525
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
147 additions
and
137 deletions
+147
-137
AdminApi.java
src/main/java/com/yxproject/start/api/AdminApi.java
+100
-99
UserApi.java
src/main/java/com/yxproject/start/api/UserApi.java
+40
-29
MyShiroRealm.java
src/main/java/com/yxproject/start/config/MyShiroRealm.java
+5
-6
ShiroConfig.java
src/main/java/com/yxproject/start/config/ShiroConfig.java
+2
-2
PoliceStationApplyReasonServiceImpl.java
...art/service/impl/PoliceStationApplyReasonServiceImpl.java
+0
-1
No files found.
src/main/java/com/yxproject/start/api/AdminApi.java
View file @
de04730a
...
...
@@ -39,13 +39,14 @@ public class AdminApi {
@RequestMapping
(
"test"
)
public
String
hello
(){
public
String
hello
()
{
return
"f1"
;
}
/**
* 获得用户列表
*
* @return
*/
@RequestMapping
(
"getUserList"
)
...
...
@@ -56,39 +57,41 @@ public class AdminApi {
/**
* 用户添加;
*
* @return
*/
@PostMapping
(
"userAdd"
)
public
Map
<
String
,
String
>
userInfoAdd
(
@RequestBody
String
json
)
{
public
Map
<
String
,
String
>
userInfoAdd
(
@RequestBody
String
json
)
{
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
json
);
String
salt
=
UUID
.
randomUUID
().
toString
();
UserInfo
userInfo
=
new
UserInfo
();
userInfo
.
setPassword
(
Md5Utils
.
entryptPassword
(
jsonObject
.
getString
(
"password"
),
salt
));
userInfo
.
setPassword
(
Md5Utils
.
entryptPassword
(
jsonObject
.
getString
(
"password"
),
salt
));
userInfo
.
setSalt
(
salt
);
userInfo
.
setUsername
(
jsonObject
.
getString
(
"username"
));
userInfo
.
setName
(
jsonObject
.
getString
(
"name"
));
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
boolean
flag
=
false
;
flag
=
userInfoService
.
addUser
(
userInfo
,
Integer
.
parseInt
(
jsonObject
.
getString
(
"roleId"
)));
if
(
flag
){
map
.
put
(
"resultMsg"
,
"添加成功"
);
flag
=
userInfoService
.
addUser
(
userInfo
,
Integer
.
parseInt
(
jsonObject
.
getString
(
"roleId"
)));
if
(
flag
)
{
map
.
put
(
"resultMsg"
,
"添加成功"
);
}
else
{
map
.
put
(
"resultMsg"
,
"添加失败"
);
}
else
{
map
.
put
(
"resultMsg"
,
"添加失败"
);
}
return
map
;
}
/**
* 通过id查询用户;
*
* @return
*/
@RequestMapping
(
value
=
"getUserById"
,
method
=
RequestMethod
.
GET
)
public
Map
<
String
,
Object
>
getUserById
(
@RequestParam
(
"userId"
)
String
userId
,
HttpServletResponse
response
)
{
@RequestMapping
(
value
=
"getUserById"
,
method
=
RequestMethod
.
GET
)
public
Map
<
String
,
Object
>
getUserById
(
@RequestParam
(
"userId"
)
String
userId
,
HttpServletResponse
response
)
{
response
.
setCharacterEncoding
(
"UTF-8"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
UserInfo
userInfo
=
userInfoService
.
getUserInfoByUserId
(
Integer
.
parseInt
(
userId
));
map
.
put
(
"user"
,
userInfo
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
UserInfo
userInfo
=
userInfoService
.
getUserInfoByUserId
(
Integer
.
parseInt
(
userId
));
map
.
put
(
"user"
,
userInfo
);
return
map
;
}
...
...
@@ -96,18 +99,19 @@ public class AdminApi {
/**
* 用户删除;
*
* @return
*/
@RequestMapping
(
value
=
"userDel"
,
method
=
RequestMethod
.
GET
)
public
Map
<
String
,
Object
>
userInfoDel
(
@RequestParam
(
"userId"
)
String
userId
,
HttpServletResponse
response
)
{
@RequestMapping
(
value
=
"userDel"
,
method
=
RequestMethod
.
GET
)
public
Map
<
String
,
Object
>
userInfoDel
(
@RequestParam
(
"userId"
)
String
userId
,
HttpServletResponse
response
)
{
response
.
setCharacterEncoding
(
"UTF-8"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
boolean
flag
=
false
;
flag
=
userInfoService
.
deleteUserInfo
(
Integer
.
parseInt
(
userId
));
if
(
flag
)
{
map
.
put
(
"returnMsg"
,
"删除成功"
);
}
else
{
map
.
put
(
"returnMsg"
,
"删除失败"
);
if
(
flag
)
{
map
.
put
(
"returnMsg"
,
"删除成功"
);
}
else
{
map
.
put
(
"returnMsg"
,
"删除失败"
);
}
return
map
;
...
...
@@ -116,18 +120,19 @@ public class AdminApi {
/**
* 用户启用;
*
* @return
*/
@RequestMapping
(
value
=
"userBack"
,
method
=
RequestMethod
.
GET
)
public
Map
<
String
,
Object
>
userInfoBack
(
@RequestParam
(
"userId"
)
String
userId
,
HttpServletResponse
response
)
{
@RequestMapping
(
value
=
"userBack"
,
method
=
RequestMethod
.
GET
)
public
Map
<
String
,
Object
>
userInfoBack
(
@RequestParam
(
"userId"
)
String
userId
,
HttpServletResponse
response
)
{
response
.
setCharacterEncoding
(
"UTF-8"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
boolean
flag
=
false
;
flag
=
userInfoService
.
BackUserInfo
(
Integer
.
parseInt
(
userId
));
if
(
flag
)
{
map
.
put
(
"returnMsg"
,
"启用成功"
);
}
else
{
map
.
put
(
"returnMsg"
,
"启用失败"
);
if
(
flag
)
{
map
.
put
(
"returnMsg"
,
"启用成功"
);
}
else
{
map
.
put
(
"returnMsg"
,
"启用失败"
);
}
return
map
;
...
...
@@ -135,7 +140,6 @@ public class AdminApi {
}
@RequestMapping
(
"getRoleList"
)
public
List
<
SysRole
>
selectAllRole
()
{
List
<
SysRole
>
list
=
sysRoleService
.
getAllRoleInfo
();
...
...
@@ -152,78 +156,83 @@ public class AdminApi {
/**
* 权限删除;
*
* @return
*/
@RequestMapping
(
"permissionDel"
)
public
Map
permissionDel
(
@RequestParam
(
"permissionId"
)
String
permissionId
,
HttpServletResponse
response
)
{
public
Map
permissionDel
(
@RequestParam
(
"permissionId"
)
String
permissionId
,
HttpServletResponse
response
)
{
response
.
setCharacterEncoding
(
"UTF-8"
);
Map
map
=
new
HashMap
();
boolean
flag
=
false
;
flag
=
sysPermissionService
.
deletePermission
(
Integer
.
parseInt
(
permissionId
));
if
(
flag
)
{
map
.
put
(
"returnMsg"
,
"删除成功"
);
}
else
{
map
.
put
(
"returnMsg"
,
"删除失败"
);
if
(
flag
)
{
map
.
put
(
"returnMsg"
,
"删除成功"
);
}
else
{
map
.
put
(
"returnMsg"
,
"删除失败"
);
}
return
map
;
}
/**
* 权限启用;
*
* @return
*/
@RequestMapping
(
"permissionOpen"
)
public
Map
permissionBack
(
@RequestParam
(
"permissionId"
)
String
permissionId
,
HttpServletResponse
response
)
{
public
Map
permissionBack
(
@RequestParam
(
"permissionId"
)
String
permissionId
,
HttpServletResponse
response
)
{
response
.
setCharacterEncoding
(
"UTF-8"
);
Map
map
=
new
HashMap
();
boolean
flag
=
false
;
flag
=
sysPermissionService
.
backPermission
(
Integer
.
parseInt
(
permissionId
));
if
(
flag
)
{
map
.
put
(
"returnMsg"
,
"启用成功"
);
}
else
{
map
.
put
(
"returnMsg"
,
"启用失败"
);
if
(
flag
)
{
map
.
put
(
"returnMsg"
,
"启用成功"
);
}
else
{
map
.
put
(
"returnMsg"
,
"启用失败"
);
}
return
map
;
}
/**
* 通过id查询权限;
*
* @return
*/
@RequestMapping
(
value
=
"getPermsById"
,
method
=
RequestMethod
.
GET
)
public
Map
<
String
,
Object
>
getPermsById
(
@RequestParam
(
"permissionId"
)
String
permissionId
,
HttpServletResponse
response
)
{
@RequestMapping
(
value
=
"getPermsById"
,
method
=
RequestMethod
.
GET
)
public
Map
<
String
,
Object
>
getPermsById
(
@RequestParam
(
"permissionId"
)
String
permissionId
,
HttpServletResponse
response
)
{
response
.
setCharacterEncoding
(
"UTF-8"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
SysPermission
sysPermission
=
sysPermissionService
.
getPermissionByPId
(
Integer
.
parseInt
(
permissionId
));
map
.
put
(
"permission"
,
sysPermission
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
SysPermission
sysPermission
=
sysPermissionService
.
getPermissionByPId
(
Integer
.
parseInt
(
permissionId
));
map
.
put
(
"permission"
,
sysPermission
);
return
map
;
}
/**
* 通过id查询角色;
*
* @return
*/
@RequestMapping
(
value
=
"getRoleById"
,
method
=
RequestMethod
.
GET
)
public
Map
<
String
,
Object
>
getRoleById
(
@RequestParam
(
"roleId"
)
String
roleId
,
HttpServletResponse
response
)
{
@RequestMapping
(
value
=
"getRoleById"
,
method
=
RequestMethod
.
GET
)
public
Map
<
String
,
Object
>
getRoleById
(
@RequestParam
(
"roleId"
)
String
roleId
,
HttpServletResponse
response
)
{
response
.
setCharacterEncoding
(
"UTF-8"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
SysRole
sysRole
=
sysRoleService
.
getRoleByRoleId
(
Integer
.
parseInt
(
roleId
));
map
.
put
(
"role"
,
sysRole
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
SysRole
sysRole
=
sysRoleService
.
getRoleByRoleId
(
Integer
.
parseInt
(
roleId
));
map
.
put
(
"role"
,
sysRole
);
return
map
;
}
/**
* 添加权限
*
* @param jsonStr
* @param resp
* @return
*/
@RequestMapping
(
value
=
"permissionAdd"
,
method
=
RequestMethod
.
POST
)
public
Map
<
String
,
String
>
userAdd
(
@RequestBody
String
jsonStr
,
HttpServletResponse
resp
)
{
@RequestMapping
(
value
=
"permissionAdd"
,
method
=
RequestMethod
.
POST
)
public
Map
<
String
,
String
>
userAdd
(
@RequestBody
String
jsonStr
,
HttpServletResponse
resp
)
{
resp
.
setCharacterEncoding
(
"UTF-8"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
jsonStr
);
boolean
flag
=
false
;
String
str
=
"0"
;
...
...
@@ -240,42 +249,44 @@ public class AdminApi {
// }
System
.
out
.
println
(
sysPermission
);
flag
=
sysPermissionService
.
addPermission
(
sysPermission
);
if
(
flag
){
map
.
put
(
"resultMsg"
,
"添加成功"
);
if
(
flag
)
{
map
.
put
(
"resultMsg"
,
"添加成功"
);
}
else
{
map
.
put
(
"resultMsg"
,
"添加失败"
);
}
else
{
map
.
put
(
"resultMsg"
,
"添加失败"
);
}
return
map
;
}
/**
* 查询所有非锁定角色;
*
* @return
*/
@RequestMapping
(
value
=
"getAllActiveRoleList"
,
method
=
RequestMethod
.
GET
)
public
List
<
SysRole
>
userInfoAdd
(){
@RequestMapping
(
value
=
"getAllActiveRoleList"
,
method
=
RequestMethod
.
GET
)
public
List
<
SysRole
>
userInfoAdd
()
{
List
<
SysRole
>
list
=
sysRoleService
.
getAllActiveRoleInfo
();
return
list
;
}
/**
* 查询所有非锁定权限;
*
* @return
*/
@RequestMapping
(
value
=
"getAllActivePermissionList"
,
method
=
RequestMethod
.
GET
)
public
List
<
SysPermission
>
getAllActivePermissionList
(){
@RequestMapping
(
value
=
"getAllActivePermissionList"
,
method
=
RequestMethod
.
GET
)
public
List
<
SysPermission
>
getAllActivePermissionList
()
{
List
<
SysPermission
>
list
=
sysPermissionService
.
getAllActivePermission
();
return
list
;
}
/**
* 角色删除;
*
* @return
*/
// @GET
...
...
@@ -309,14 +320,10 @@ public class AdminApi {
// }
// return map.toString();
// }
@RequestMapping
(
"roleAdd"
)
public
Map
<
String
,
String
>
roleAdd
(
@RequestBody
String
jsonStr
,
HttpServletResponse
resp
)
{
public
Map
<
String
,
String
>
roleAdd
(
@RequestBody
String
jsonStr
,
HttpServletResponse
resp
)
{
resp
.
setCharacterEncoding
(
"UTF-8"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
jsonStr
);
boolean
flag
=
false
;
SysRole
sysRole
=
new
SysRole
();
...
...
@@ -325,42 +332,42 @@ public class AdminApi {
String
permissionIds
=
jsonObject
.
getString
(
"permissionIds"
);
JSONArray
jsonArray
=
JSONArray
.
fromObject
(
permissionIds
);
flag
=
sysRoleService
.
addRole
(
sysRole
,
jsonArray
);
if
(
flag
){
map
.
put
(
"resultMsg"
,
"添加成功"
);
flag
=
sysRoleService
.
addRole
(
sysRole
,
jsonArray
);
if
(
flag
)
{
map
.
put
(
"resultMsg"
,
"添加成功"
);
}
else
{
map
.
put
(
"resultMsg"
,
"添加失败"
);
}
else
{
map
.
put
(
"resultMsg"
,
"添加失败"
);
}
return
map
;
}
@PostMapping
(
"userUpdate"
)
public
Map
<
String
,
String
>
userInfoUpdate
(
@RequestBody
String
json
,
HttpServletResponse
resp
)
{
public
Map
<
String
,
String
>
userInfoUpdate
(
@RequestBody
String
json
,
HttpServletResponse
resp
)
{
resp
.
setCharacterEncoding
(
"UTF-8"
);
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
json
);
UserInfo
userInfo
=
new
UserInfo
();
userInfo
.
setUsername
(
jsonObject
.
getString
(
"username"
));
userInfo
.
setName
(
jsonObject
.
getString
(
"name"
));
userInfo
.
setId
(
Integer
.
parseInt
(
jsonObject
.
getString
(
"id"
)));
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
boolean
flag
=
false
;
flag
=
userInfoService
.
updateUser
(
userInfo
,
Integer
.
parseInt
(
jsonObject
.
getString
(
"roleId"
)),
Integer
.
parseInt
(
jsonObject
.
getString
(
"oldRoleId"
)));
if
(
flag
){
map
.
put
(
"resultMsg"
,
"修改成功"
);
flag
=
userInfoService
.
updateUser
(
userInfo
,
Integer
.
parseInt
(
jsonObject
.
getString
(
"roleId"
)),
Integer
.
parseInt
(
jsonObject
.
getString
(
"oldRoleId"
)));
if
(
flag
)
{
map
.
put
(
"resultMsg"
,
"修改成功"
);
}
else
{
map
.
put
(
"resultMsg"
,
"修改失败"
);
}
else
{
map
.
put
(
"resultMsg"
,
"修改失败"
);
}
return
map
;
}
@RequestMapping
(
"roleUpdate"
)
public
Map
roleUpdate
(
@RequestBody
String
jsonStr
,
HttpServletResponse
resp
)
{
public
Map
roleUpdate
(
@RequestBody
String
jsonStr
,
HttpServletResponse
resp
)
{
resp
.
setCharacterEncoding
(
"UTF-8"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
jsonStr
);
boolean
flag
=
false
;
SysRole
sysRole
=
new
SysRole
();
...
...
@@ -371,12 +378,12 @@ public class AdminApi {
JSONArray
jsonArrayOldPids
=
JSONArray
.
fromObject
(
oldPermissionIds
);
String
permissionIds
=
jsonObject
.
getString
(
"permissionId"
);
JSONArray
jsonArrayPids
=
JSONArray
.
fromObject
(
permissionIds
);
flag
=
sysRoleService
.
updateRole
(
sysRole
,
jsonArrayPids
,
jsonArrayOldPids
);
if
(
flag
){
map
.
put
(
"resultMsg"
,
"修改成功"
);
flag
=
sysRoleService
.
updateRole
(
sysRole
,
jsonArrayPids
,
jsonArrayOldPids
);
if
(
flag
)
{
map
.
put
(
"resultMsg"
,
"修改成功"
);
}
else
{
map
.
put
(
"resultMsg"
,
"修改失败"
);
}
else
{
map
.
put
(
"resultMsg"
,
"修改失败"
);
}
return
map
;
...
...
@@ -384,10 +391,10 @@ public class AdminApi {
@PostMapping
(
"permissionUpdate"
)
public
Map
<
String
,
String
>
permissionUpdate
(
@RequestBody
String
jsonStr
,
HttpServletResponse
resp
)
{
public
Map
<
String
,
String
>
permissionUpdate
(
@RequestBody
String
jsonStr
,
HttpServletResponse
resp
)
{
resp
.
setCharacterEncoding
(
"UTF-8"
);
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
jsonStr
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
boolean
flag
=
false
;
// String str = "0";
SysPermission
sysPermission
=
new
SysPermission
();
...
...
@@ -404,21 +411,15 @@ public class AdminApi {
// }
System
.
out
.
println
(
sysPermission
);
flag
=
sysPermissionService
.
updatePermission
(
sysPermission
);
if
(
flag
){
map
.
put
(
"resultMsg"
,
"修改成功"
);
if
(
flag
)
{
map
.
put
(
"resultMsg"
,
"修改成功"
);
}
else
{
map
.
put
(
"resultMsg"
,
"修改失败"
);
}
else
{
map
.
put
(
"resultMsg"
,
"修改失败"
);
}
return
map
;
}
}
}
src/main/java/com/yxproject/start/api/UserApi.java
View file @
de04730a
...
...
@@ -58,14 +58,14 @@ public class UserApi {
UserInfo
userInfo
=
(
UserInfo
)
SecurityUtils
.
getSubject
().
getPrincipal
();
resultMap
.
put
(
"status"
,
200
);
resultMap
.
put
(
"message"
,
"登录成功"
);
resultMap
.
put
(
"user"
,
userInfo
);
resultMap
.
put
(
"user"
,
userInfo
);
}
catch
(
UnknownAccountException
e
)
{
resultMap
.
put
(
"status"
,
201
);
resultMap
.
put
(
"message"
,
"账号不存在!"
);
}
catch
(
IncorrectCredentialsException
e1
)
{
}
catch
(
IncorrectCredentialsException
e1
)
{
resultMap
.
put
(
"status"
,
202
);
resultMap
.
put
(
"message"
,
"密码错误!"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"message"
,
"用户名密码错误"
);
}
...
...
@@ -79,8 +79,10 @@ public class UserApi {
subject
.
logout
();
}
}
/**
* 查询任务单;
*
* @return
*/
@RequestMapping
(
value
=
"/getProductionTaskListByID"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -98,6 +100,7 @@ public class UserApi {
/**
* 更新任务单;
*
* @return
*/
@RequestMapping
(
value
=
"/updateProductionTask"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -139,6 +142,7 @@ public class UserApi {
/**
* 查询证件信息;
*
* @return
*/
@RequestMapping
(
value
=
"/findCardInfoByCardIDOrAcceptNo"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -155,6 +159,7 @@ public class UserApi {
/**
* 添加快证任务单;
*
* @return
*/
@RequestMapping
(
value
=
"/addQuickCyclesheetInfo"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -201,7 +206,7 @@ public class UserApi {
@RequestMapping
(
"/test"
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
@ResponseBody
public
String
test
(
@RequestParam
(
"id"
)
String
permissionId
,
HttpServletResponse
resp
)
{
public
String
test
(
@RequestParam
(
"id"
)
String
permissionId
,
HttpServletResponse
resp
)
{
//TODO
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
...
...
@@ -213,66 +218,70 @@ public class UserApi {
/**
* 保存废证详情;
*
* @return
*/
@RequestMapping
(
"addFailedinfo"
)
public
String
addFailedinfo
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
)
{
String
map
=
"[{\"failedinfoid\":\"20181016002\",\"failed_Reason\":1,\"groupno\":\"41108201\",\"cyclesheetid\":\"20181016001\"}]"
;
public
String
addFailedinfo
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
)
{
String
map
=
"[{\"failedinfoid\":\"20181016002\",\"failed_Reason\":1,\"groupno\":\"41108201\",\"cyclesheetid\":\"20181016001\"}]"
;
JSONArray
jsonArray
=
JSONArray
.
fromObject
(
map
);
List
<
FailedCardEntity
>
failedinfoEntityList
=
new
ArrayList
<>();
for
(
Object
object:
jsonArray
)
{
for
(
Object
object
:
jsonArray
)
{
FailedCardEntity
o
=
(
FailedCardEntity
)
JSONObject
.
toBean
((
JSONObject
)
object
,
FailedCardEntity
.
class
);
failedinfoEntityList
.
add
(
o
);
}
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
int
i
=
failedCardService
.
saveFailedinfo
(
failedinfoEntityList
);
yxjsonResponse
.
outPutSuccess
(
i
+
"添加成功"
);
yxjsonResponse
.
outPutSuccess
(
i
+
"添加成功"
);
return
yxjsonResponse
.
toJSONString
();
}
/**
* 更新废证详情;
*
* @return
*/
@RequestMapping
(
"updateFailedinfo"
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
public
String
updateFailedinfo
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
){
String
map
=
"[{\"failedinfoid\":\"201810302\",\"failed_Reason\":1,\"groupno\":\"411081\",\"cyclesheetid\":\"20181016001\"}]"
;
public
String
updateFailedinfo
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
)
{
String
map
=
"[{\"failedinfoid\":\"201810302\",\"failed_Reason\":1,\"groupno\":\"411081\",\"cyclesheetid\":\"20181016001\"}]"
;
JSONArray
jsonArray
=
JSONArray
.
fromObject
(
map
);
List
<
FailedCardEntity
>
failedinfoEntityList
=
new
ArrayList
<>();
for
(
Object
object:
jsonArray
)
{
for
(
Object
object
:
jsonArray
)
{
FailedCardEntity
o
=
(
FailedCardEntity
)
JSONObject
.
toBean
((
JSONObject
)
object
,
FailedCardEntity
.
class
);
failedinfoEntityList
.
add
(
o
);
}
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
int
i
=
failedCardService
.
updateFailedinfo
(
failedinfoEntityList
);
yxjsonResponse
.
outPutSuccess
(
i
+
"更新成功"
);
yxjsonResponse
.
outPutSuccess
(
i
+
"更新成功"
);
return
yxjsonResponse
.
toJSONString
();
}
/**
* 查询废证详情;
*
* @return
*/
@RequestMapping
(
"findFailedinfo"
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
public
String
findFailedinfo
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
)
{
public
String
findFailedinfo
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
)
{
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
List
<
Map
<
String
,
Object
>>
maps
=
failedCardService
.
selectFailedinfo
(
Integer
.
valueOf
(
id
));
yxjsonResponse
.
outPutSuccess
(
maps
+
"------添加成功---"
+
maps
.
size
());
yxjsonResponse
.
outPutSuccess
(
maps
+
"------添加成功---"
+
maps
.
size
());
return
yxjsonResponse
.
toJSONString
();
}
/**
* 查询任务单详情;
*
* @return
*/
@RequestMapping
(
"findProductionTaskListByState"
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
public
String
findProductionTaskListByState
(
@RequestParam
(
"state"
)
String
state
,
HttpServletResponse
resp
){
public
String
findProductionTaskListByState
(
@RequestParam
(
"state"
)
String
state
,
HttpServletResponse
resp
)
{
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
List
<
Map
<
String
,
Object
>>
productionTaskInfoList
=
taskService
.
findProductionTaskListEntityByState
(
Integer
.
valueOf
(
state
));
...
...
@@ -282,11 +291,12 @@ public class UserApi {
/**
* 查询区县列表详情;
*
* @return
*/
@RequestMapping
(
"findProdCountyList"
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
public
String
findProdCountyList
(
@RequestParam
(
"cyclesheetID"
)
String
cyclesheetID
,
HttpServletResponse
resp
)
{
public
String
findProdCountyList
(
@RequestParam
(
"cyclesheetID"
)
String
cyclesheetID
,
HttpServletResponse
resp
)
{
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
List
<
Map
<
String
,
Object
>>
countyInfoList
=
groupNoService
.
findCountyInfoList
(
cyclesheetID
);
...
...
@@ -296,15 +306,16 @@ public class UserApi {
/**
* 保存派出所申请类型数量;
*
* @return
*/
@RequestMapping
(
"savePoliceApplyCount"
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
public
String
savePoliceApplyCount
(
@RequestParam
(
"cyclesheetID"
)
String
cyclesheetID
,
HttpServletResponse
resp
){
public
String
savePoliceApplyCount
(
@RequestParam
(
"cyclesheetID"
)
String
cyclesheetID
,
HttpServletResponse
resp
)
{
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
int
i
=
policeStationApplyReasonService
.
savePoliceStationApplyReasonEntity
(
cyclesheetID
);
yxjsonResponse
.
outPutSuccess
(
i
+
""
);
yxjsonResponse
.
outPutSuccess
(
i
+
""
);
return
yxjsonResponse
.
toJSONString
();
}
...
...
@@ -323,7 +334,7 @@ public class UserApi {
String
fout
=
null
;
List
<
Map
<
String
,
Object
>>
countyInfoList
=
groupNoService
.
findCountyInfoList
(
taskID
);
List
<
TaskEntity
>
taskEntities
=
taskService
.
findProductionTaskListEntityByID
(
Long
.
valueOf
(
taskID
));
fout
=
exportExcel
(
countyInfoList
,
taskEntities
.
get
(
0
).
getCard_Type
()
+
""
,
"p1"
,
6000
,
taskEntities
.
get
(
0
).
getCitycode
()
,
dateTime
,
taskID
);
fout
=
exportExcel
(
countyInfoList
,
taskEntities
.
get
(
0
).
getCard_Type
()
+
""
,
"p1"
,
6000
,
taskEntities
.
get
(
0
).
getCitycode
(),
dateTime
,
taskID
);
String
outFile
=
dateTime
+
taskEntities
.
get
(
0
).
getCitycode
()
+
"二代身份证统计表"
;
try
{
FileInputStream
fis
=
new
FileInputStream
(
new
File
(
fout
));
...
...
@@ -349,9 +360,9 @@ public class UserApi {
* @param sum 总数
* @param cityName 地市
*/
private
String
exportExcel
(
List
<
Map
<
String
,
Object
>>
countyInfoList
,
String
typeName
,
String
workShop
,
int
sum
,
String
cityName
,
String
permanentPositionDate
,
String
cyclesheetid
)
{
if
(
typeName
.
contains
(
"null"
)){
typeName
=
typeName
.
replace
(
"null"
,
""
);
private
String
exportExcel
(
List
<
Map
<
String
,
Object
>>
countyInfoList
,
String
typeName
,
String
workShop
,
int
sum
,
String
cityName
,
String
permanentPositionDate
,
String
cyclesheetid
)
{
if
(
typeName
.
contains
(
"null"
))
{
typeName
=
typeName
.
replace
(
"null"
,
""
);
}
//第一步创建workbook
HSSFWorkbook
wb
=
new
HSSFWorkbook
();
...
...
@@ -458,8 +469,8 @@ public class UserApi {
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
/
250
+
1
))
+
""
);
num
+=
((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
/
250
+
1
));
cell
.
setCellValue
(((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
/
250
+
1
))
+
""
);
num
+=
((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
/
250
+
1
));
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
""
);
...
...
@@ -728,8 +739,8 @@ public class UserApi {
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellStyle
(
style
);
cell
.
setCellValue
(((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
+
1
))
+
""
);
boxNum
+=
((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
+
1
));
cell
.
setCellValue
(((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
+
1
))
+
""
);
boxNum
+=
((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
+
1
));
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
...
...
@@ -921,7 +932,7 @@ public class UserApi {
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellStyle
(
style
);
cell
.
setCellValue
(((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
+
1
))
+
""
);
cell
.
setCellValue
(((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
+
1
))
+
""
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
...
...
@@ -962,7 +973,7 @@ public class UserApi {
}
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
+
1
))
+
""
);
cell
.
setCellValue
(((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
+
1
))
+
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
permanentPositionDate
);
...
...
@@ -1049,7 +1060,7 @@ public class UserApi {
}
System
.
out
.
println
(
"Excel文件生成成功..."
+
new
Date
());
return
"F:\\Excel\\"
+
simpleDateFormat
.
format
(
new
Date
())
+
countyInfoList
.
get
(
0
).
get
(
"COUNTYNAME"
)
+
".xls"
;
return
"F:\\Excel\\"
+
simpleDateFormat
.
format
(
new
Date
())
+
countyInfoList
.
get
(
0
).
get
(
"COUNTYNAME"
)
+
".xls"
;
// return "D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("COUNTYNAME") + ".xls";
}
...
...
src/main/java/com/yxproject/start/config/MyShiroRealm.java
View file @
de04730a
...
...
@@ -38,10 +38,10 @@ public class MyShiroRealm extends AuthorizingRealm {
protected
AuthorizationInfo
doGetAuthorizationInfo
(
PrincipalCollection
principals
)
{
System
.
out
.
println
(
"权限配置-->MyShiroRealm.doGetAuthorizationInfo()"
);
SimpleAuthorizationInfo
authorizationInfo
=
new
SimpleAuthorizationInfo
();
UserInfo
userInfo
=
(
UserInfo
)
principals
.
getPrimaryPrincipal
();
for
(
SysRole
role:
userInfo
.
getRoleList
())
{
UserInfo
userInfo
=
(
UserInfo
)
principals
.
getPrimaryPrincipal
();
for
(
SysRole
role
:
userInfo
.
getRoleList
())
{
authorizationInfo
.
addRole
(
role
.
getRole
());
for
(
SysPermission
p:
role
.
getPermissions
())
{
for
(
SysPermission
p
:
role
.
getPermissions
())
{
authorizationInfo
.
addStringPermission
(
p
.
getPermission
());
}
}
...
...
@@ -49,7 +49,6 @@ public class MyShiroRealm extends AuthorizingRealm {
}
/**
*
* @param token
* @return
* @throws AuthenticationException
...
...
@@ -59,13 +58,13 @@ public class MyShiroRealm extends AuthorizingRealm {
throws
AuthenticationException
{
System
.
out
.
println
(
"MyShiroRealm.doGetAuthenticationInfo()"
);
//获取用户的输入的账号.
String
username
=
(
String
)
token
.
getPrincipal
();
String
username
=
(
String
)
token
.
getPrincipal
();
System
.
out
.
println
(
username
);
System
.
out
.
println
(
token
.
getCredentials
().
toString
());
//通过username从数据库中查找 User对象,如果找到,没找到.
//实际项目中,这里可以根据实际情况做缓存,如果不做,Shiro自己也是有时间间隔机制,2分钟内不会重复执行该方法
UserInfo
user
=
userInfoService
.
findByUsername
(
username
);
if
(
user
==
null
||
user
.
getState
()==
1
)
{
if
(
user
==
null
||
user
.
getState
()
==
1
)
{
return
null
;
}
SimpleAuthenticationInfo
authenticationInfo
=
new
SimpleAuthenticationInfo
(
...
...
src/main/java/com/yxproject/start/config/ShiroConfig.java
View file @
de04730a
...
...
@@ -50,9 +50,9 @@ public class ShiroConfig {
}
@Bean
public
static
DefaultAdvisorAutoProxyCreator
getDefaultAdvisorAutoProxyCreator
()
{
public
static
DefaultAdvisorAutoProxyCreator
getDefaultAdvisorAutoProxyCreator
()
{
DefaultAdvisorAutoProxyCreator
defaultAdvisorAutoProxyCreator
=
new
DefaultAdvisorAutoProxyCreator
();
DefaultAdvisorAutoProxyCreator
defaultAdvisorAutoProxyCreator
=
new
DefaultAdvisorAutoProxyCreator
();
defaultAdvisorAutoProxyCreator
.
setUsePrefix
(
true
);
return
defaultAdvisorAutoProxyCreator
;
...
...
src/main/java/com/yxproject/start/service/impl/PoliceStationApplyReasonServiceImpl.java
View file @
de04730a
...
...
@@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
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