Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
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
liqin
chnmuseum-party
Commits
acb265fe
Commit
acb265fe
authored
Apr 09, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://111.203.232.171:8888/lee/chnmuseum-party
into master
parents
b91f7d8d
f6e74423
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
108 additions
and
72 deletions
+108
-72
TUserService.java
...va/cn/wisenergy/chnmuseum/party/service/TUserService.java
+2
-0
TOrganServiceImpl.java
...nergy/chnmuseum/party/service/impl/TOrganServiceImpl.java
+1
-1
TUserServiceImpl.java
...energy/chnmuseum/party/service/impl/TUserServiceImpl.java
+40
-6
ChinaMobileRestApiController.java
...um/party/web/controller/ChinaMobileRestApiController.java
+2
-3
ExhibitionBoardController.java
...useum/party/web/controller/ExhibitionBoardController.java
+3
-3
TOrganController.java
...ergy/chnmuseum/party/web/controller/TOrganController.java
+56
-41
TUserController.java
...nergy/chnmuseum/party/web/controller/TUserController.java
+3
-17
TBoxOperationMapper.xml
src/main/resources/mapper/TBoxOperationMapper.xml
+1
-1
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/service/TUserService.java
View file @
acb265fe
...
@@ -23,4 +23,6 @@ public interface TUserService extends IService<TUser> {
...
@@ -23,4 +23,6 @@ public interface TUserService extends IService<TUser> {
TUser
selectById
(
String
id
);
TUser
selectById
(
String
id
);
List
<
TUser
>
getUserList
(
TUser
user
);
List
<
TUser
>
getUserList
(
TUser
user
);
boolean
addBox
(
TUser
user
);
}
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/TOrganServiceImpl.java
View file @
acb265fe
...
@@ -119,7 +119,7 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
...
@@ -119,7 +119,7 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
public
TOrgan
selectById
(
String
id
)
{
public
TOrgan
selectById
(
String
id
)
{
TOrgan
organ
=
organMapper
.
getById
(
id
);
TOrgan
organ
=
organMapper
.
getById
(
id
);
String
s
=
areaMapper
.
selectParent
(
organ
.
getAreaId
());
String
s
=
areaMapper
.
selectParent
(
organ
.
getAreaId
());
List
<
TOrgan
>
list1
=
list
(
new
UpdateWrapper
<
TOrgan
>().
eq
(
"parent_id"
,
organ
.
getId
()));
List
<
TOrgan
>
list1
=
list
(
new
UpdateWrapper
<
TOrgan
>().
eq
(
"parent_id"
,
organ
.
getId
())
.
eq
(
"is_deleted"
,
false
)
);
organ
.
setAreas
(
Arrays
.
asList
(
s
.
split
(
","
)));
organ
.
setAreas
(
Arrays
.
asList
(
s
.
split
(
","
)));
organ
.
setChildren
(
list1
);
organ
.
setChildren
(
list1
);
return
organ
;
return
organ
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/TUserServiceImpl.java
View file @
acb265fe
...
@@ -3,8 +3,10 @@ package cn.wisenergy.chnmuseum.party.service.impl;
...
@@ -3,8 +3,10 @@ package cn.wisenergy.chnmuseum.party.service.impl;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.mapper.TAreaMapper
;
import
cn.wisenergy.chnmuseum.party.mapper.TAreaMapper
;
import
cn.wisenergy.chnmuseum.party.model.TBoxOperation
;
import
cn.wisenergy.chnmuseum.party.model.TUser
;
import
cn.wisenergy.chnmuseum.party.model.TUser
;
import
cn.wisenergy.chnmuseum.party.mapper.TUserMapper
;
import
cn.wisenergy.chnmuseum.party.mapper.TUserMapper
;
import
cn.wisenergy.chnmuseum.party.model.TUserRole
;
import
cn.wisenergy.chnmuseum.party.service.TUserService
;
import
cn.wisenergy.chnmuseum.party.service.TUserService
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
@@ -15,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -15,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
...
@@ -28,6 +31,7 @@ import java.util.List;
...
@@ -28,6 +31,7 @@ import java.util.List;
*/
*/
@Slf4j
@Slf4j
@Service
@Service
@Transactional
public
class
TUserServiceImpl
extends
ServiceImpl
<
TUserMapper
,
TUser
>
implements
TUserService
{
public
class
TUserServiceImpl
extends
ServiceImpl
<
TUserMapper
,
TUser
>
implements
TUserService
{
@Resource
@Resource
...
@@ -36,6 +40,13 @@ public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements
...
@@ -36,6 +40,13 @@ public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements
@Resource
@Resource
private
TAreaMapper
areaMapper
;
private
TAreaMapper
areaMapper
;
@Resource
TBoxOperationServiceImpl
boxOperationService
;
@Resource
TUserRoleServiceImpl
tUserRoleService
;
@Override
@Override
public
TUser
selectByUsername
(
String
userName
)
{
public
TUser
selectByUsername
(
String
userName
)
{
return
tUserMapper
.
selectByUsername
(
userName
);
return
tUserMapper
.
selectByUsername
(
userName
);
...
@@ -43,15 +54,15 @@ public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements
...
@@ -43,15 +54,15 @@ public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements
@Override
@Override
public
Page
<
TUser
>
getList
(
Page
<
TUser
>
page
,
TUser
user
)
{
public
Page
<
TUser
>
getList
(
Page
<
TUser
>
page
,
TUser
user
)
{
List
<
TUser
>
list
=
tUserMapper
.
getList
(
page
,
user
);
List
<
TUser
>
list
=
tUserMapper
.
getList
(
page
,
user
);
for
(
TUser
u
:
list
)
{
for
(
TUser
u
:
list
)
{
if
(
AuditStatusEnum
.
REFUSED
.
name
().
equals
(
u
.
getAuditStatus
())
||
AuditStatusEnum
.
APPROVED_FINAL
.
name
().
equals
(
u
.
getAuditStatus
()))
{
if
(
AuditStatusEnum
.
REFUSED
.
name
().
equals
(
u
.
getAuditStatus
())
||
AuditStatusEnum
.
APPROVED_FINAL
.
name
().
equals
(
u
.
getAuditStatus
()))
{
if
(
AuditOperationEnum
.
ENABLE
.
name
().
equals
(
u
.
getStatus
())){
if
(
AuditOperationEnum
.
ENABLE
.
name
().
equals
(
u
.
getStatus
()))
{
u
.
setStatusName
(
"活跃"
);
u
.
setStatusName
(
"活跃"
);
}
else
{
}
else
{
u
.
setStatusName
(
"禁用"
);
u
.
setStatusName
(
"禁用"
);
}
}
}
else
{
}
else
{
u
.
setStatusName
(
"待审核"
);
u
.
setStatusName
(
"待审核"
);
}
}
}
}
...
@@ -61,7 +72,7 @@ public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements
...
@@ -61,7 +72,7 @@ public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements
@Override
@Override
public
TUser
selectById
(
String
id
)
{
public
TUser
selectById
(
String
id
)
{
TUser
user
=
tUserMapper
.
getById
(
id
);
TUser
user
=
tUserMapper
.
getById
(
id
);
if
(
user
.
getAreaId
()
!=
null
)
{
if
(
user
.
getAreaId
()
!=
null
)
{
String
s
=
areaMapper
.
selectParent
(
user
.
getAreaId
());
String
s
=
areaMapper
.
selectParent
(
user
.
getAreaId
());
user
.
setAreas
(
Arrays
.
asList
(
s
.
split
(
","
)));
user
.
setAreas
(
Arrays
.
asList
(
s
.
split
(
","
)));
}
}
...
@@ -74,4 +85,27 @@ public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements
...
@@ -74,4 +85,27 @@ public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements
return
list
;
return
list
;
}
}
@Override
public
boolean
addBox
(
TUser
user
)
{
boolean
ret
=
false
;
ret
=
save
(
user
);
TBoxOperation
tBoxOperation
=
new
TBoxOperation
();
tBoxOperation
.
setOrganId
(
user
.
getOrgId
());
tBoxOperation
.
setAreaId
(
user
.
getAreaId
());
tBoxOperation
.
setStatus
(
1
);
tBoxOperation
.
setCreateTime
(
LocalDateTime
.
now
());
tBoxOperation
.
setUpdateTime
(
LocalDateTime
.
now
());
ret
=
boxOperationService
.
save
(
tBoxOperation
);
TUserRole
userRole
=
new
TUserRole
();
userRole
.
setUserId
(
user
.
getId
());
userRole
.
setRoleId
(
"3"
);
userRole
.
setIsDeleted
(
false
);
ret
=
tUserRoleService
.
save
(
userRole
);
return
ret
;
}
}
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ChinaMobileRestApiController.java
View file @
acb265fe
...
@@ -145,14 +145,13 @@ public class ChinaMobileRestApiController extends BaseController {
...
@@ -145,14 +145,13 @@ public class ChinaMobileRestApiController extends BaseController {
@GetMapping
(
"/equitment/activity"
)
@GetMapping
(
"/equitment/activity"
)
//@RequiresAuthentication //@RequiresPermissions("/equitment/activity/")
//@RequiresAuthentication //@RequiresPermissions("/equitment/activity/")
public
Map
<
String
,
Object
>
getActivity
(
@RequestParam
(
required
=
true
)
String
mac
)
{
public
Map
<
String
,
Object
>
getActivity
(
@RequestParam
(
required
=
true
)
String
mac
)
{
List
<
TBoxOperation
>
list
;
try
{
try
{
UpdateWrapper
<
TBoxOperation
>
wrapper
=
new
UpdateWrapper
<>();
UpdateWrapper
<
TBoxOperation
>
wrapper
=
new
UpdateWrapper
<>();
wrapper
.
eq
(
"mac"
,
mac
);
wrapper
.
eq
(
"mac"
,
mac
);
list
=
boxOperationService
.
list
(
wrapper
);
TBoxOperation
one
=
boxOperationService
.
getOne
(
wrapper
);
HashMap
<
Object
,
Object
>
map
=
new
HashMap
<>();
HashMap
<
Object
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"activityStatus"
,
false
);
map
.
put
(
"activityStatus"
,
false
);
if
(
list
!=
null
&&
list
.
get
(
0
)
!=
null
&&
2
==
list
.
get
(
0
).
getStatus
()
)
{
if
(
one
!=
null
)
{
map
.
put
(
"activityStatus"
,
true
);
map
.
put
(
"activityStatus"
,
true
);
}
}
return
getResult
(
map
);
return
getResult
(
map
);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ExhibitionBoardController.java
View file @
acb265fe
...
@@ -200,15 +200,15 @@ public class ExhibitionBoardController extends BaseController {
...
@@ -200,15 +200,15 @@ public class ExhibitionBoardController extends BaseController {
return
getFailResult
();
return
getFailResult
();
}
}
@
Ge
tMapping
(
"/getList"
)
@
Pos
tMapping
(
"/getList"
)
@RequiresAuthentication
//@RequiresPermissions("exhibition:board:list")
@RequiresAuthentication
//@RequiresPermissions("exhibition:board:list")
@ApiOperation
(
value
=
"获取展板全部列表(无分页)"
,
notes
=
"获取展板全部列表(无分页)"
)
@ApiOperation
(
value
=
"获取展板全部列表(无分页)"
,
notes
=
"获取展板全部列表(无分页)"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"auditStatus"
,
value
=
"审核状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"auditStatus"
,
value
=
"审核状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
})
public
Map
<
String
,
Object
>
getExhibitionBoardList
(
public
Map
<
String
,
Object
>
getExhibitionBoardList
(
@RequestParam
(
value
=
"exhibitionBoardCatIdList"
,
required
=
false
)
List
<
String
>
exhibitionBoardCatIdList
,
@RequestParam
(
value
=
"exhibitionBoardCatIdList
[]
"
,
required
=
false
)
List
<
String
>
exhibitionBoardCatIdList
,
@RequestParam
(
value
=
"boardCopyrightOwnerIdList"
,
required
=
false
)
List
<
String
>
boardCopyrightOwnerIdList
,
@RequestParam
(
value
=
"boardCopyrightOwnerIdList
[]
"
,
required
=
false
)
List
<
String
>
boardCopyrightOwnerIdList
,
@RequestParam
(
value
=
"auditStatus"
,
defaultValue
=
"APPROVED_FINAL"
,
required
=
false
)
AuditStatusEnum
auditStatus
)
{
@RequestParam
(
value
=
"auditStatus"
,
defaultValue
=
"APPROVED_FINAL"
,
required
=
false
)
AuditStatusEnum
auditStatus
)
{
final
LambdaQueryWrapper
<
ExhibitionBoard
>
lambdaQueryWrapper
=
Wrappers
.<
ExhibitionBoard
>
lambdaQuery
().
eq
(
ExhibitionBoard:
:
getAuditStatus
,
auditStatus
.
name
()).
eq
(
ExhibitionBoard:
:
getPublished
,
true
);
final
LambdaQueryWrapper
<
ExhibitionBoard
>
lambdaQueryWrapper
=
Wrappers
.<
ExhibitionBoard
>
lambdaQuery
().
eq
(
ExhibitionBoard:
:
getAuditStatus
,
auditStatus
.
name
()).
eq
(
ExhibitionBoard:
:
getPublished
,
true
);
lambdaQueryWrapper
.
eq
(
ExhibitionBoard:
:
getPublished
,
true
);
lambdaQueryWrapper
.
eq
(
ExhibitionBoard:
:
getPublished
,
true
);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TOrganController.java
View file @
acb265fe
...
@@ -69,7 +69,7 @@ public class TOrganController extends BaseController {
...
@@ -69,7 +69,7 @@ public class TOrganController extends BaseController {
@PostMapping
(
"/add"
)
@PostMapping
(
"/add"
)
@RequiresAuthentication
//@RequiresPermissions("/organ/add")
@RequiresAuthentication
//@RequiresPermissions("/organ/add")
@ApiOperation
(
value
=
"添加机构"
,
notes
=
"添加机构"
)
@ApiOperation
(
value
=
"添加机构"
,
notes
=
"添加机构"
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
ADD
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
ADD
)
public
Map
<
String
,
Object
>
add
(
TOrgan
organ
)
{
public
Map
<
String
,
Object
>
add
(
TOrgan
organ
)
{
QueryWrapper
<
TOrgan
>
ew
=
new
QueryWrapper
<>();
QueryWrapper
<
TOrgan
>
ew
=
new
QueryWrapper
<>();
...
@@ -78,7 +78,7 @@ public class TOrganController extends BaseController {
...
@@ -78,7 +78,7 @@ public class TOrganController extends BaseController {
ew
.
eq
(
"is_deleted"
,
0
);
ew
.
eq
(
"is_deleted"
,
0
);
ew
.
eq
(
"name"
,
organ
.
getName
());
ew
.
eq
(
"name"
,
organ
.
getName
());
List
<
TOrgan
>
list
=
this
.
tOrganService
.
list
(
ew
);
List
<
TOrgan
>
list
=
this
.
tOrganService
.
list
(
ew
);
if
(
list
!=
null
&&
list
.
size
()>
0
&&
list
.
get
(
0
)!=
null
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
&&
list
.
get
(
0
)
!=
null
)
{
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"message"
,
"机构名称不能重复!"
);
resultMap
.
put
(
"message"
,
"机构名称不能重复!"
);
...
@@ -88,7 +88,13 @@ public class TOrganController extends BaseController {
...
@@ -88,7 +88,13 @@ public class TOrganController extends BaseController {
organ
.
setCreateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
organ
.
setCreateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
organ
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
organ
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
String
organCode
=
getOrganCode
(
organ
.
getParentId
());
String
organCode
=
getOrganCode
(
organ
.
getParentId
());
organ
.
setLevel
(
organCode
.
length
()/
3
);
organ
.
setLevel
(
organCode
.
length
()
/
3
);
if
(
organ
.
getLevel
()
>
3
)
{
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"message"
,
"不能添加4级机构!"
);
return
resultMap
;
}
organ
.
setCode
(
organCode
);
organ
.
setCode
(
organCode
);
// 保存业务节点信息
// 保存业务节点信息
boolean
result
=
tOrganService
.
save
(
organ
);
boolean
result
=
tOrganService
.
save
(
organ
);
...
@@ -104,23 +110,29 @@ public class TOrganController extends BaseController {
...
@@ -104,23 +110,29 @@ public class TOrganController extends BaseController {
@PutMapping
(
"/update"
)
@PutMapping
(
"/update"
)
@RequiresAuthentication
//@RequiresPermissions("/organ/update")
@RequiresAuthentication
//@RequiresPermissions("/organ/update")
@ApiOperation
(
value
=
"update"
,
notes
=
"修改机构信息"
)
@ApiOperation
(
value
=
"update"
,
notes
=
"修改机构信息"
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
UPDATE
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
UPDATE
)
public
Map
<
String
,
Object
>
updateTOrgan
(
TOrgan
tOrgan
)
{
public
Map
<
String
,
Object
>
updateTOrgan
(
TOrgan
tOrgan
)
{
try
{
try
{
TOrgan
byId
=
tOrganService
.
selectById
(
tOrgan
.
getId
());
TOrgan
byId
=
tOrganService
.
selectById
(
tOrgan
.
getId
());
if
(!
byId
.
getParentId
().
equals
(
tOrgan
.
getParentId
())){
if
(!
byId
.
getParentId
().
equals
(
tOrgan
.
getParentId
()))
{
tOrgan
.
setCode
(
getOrganCode
(
tOrgan
.
getParentId
()));
tOrgan
.
setCode
(
getOrganCode
(
tOrgan
.
getParentId
()));
}
}
if
(
byId
.
getLevel
()
!=
tOrgan
.
getCode
().
length
()/
3
&&
byId
.
getChildren
().
size
()>
0
)
{
if
(
byId
.
getLevel
()
!=
tOrgan
.
getCode
().
length
()
/
3
&&
byId
.
getChildren
().
size
()
>
0
)
{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"resultCode"
,
"500"
);
map
.
put
(
"resultCode"
,
"500"
);
map
.
put
(
"message"
,
"机构存在下级机构,不能修改机构级别!"
);
map
.
put
(
"message"
,
"机构存在下级机构,不能修改机构级别!"
);
map
.
put
(
"data"
,
""
);
map
.
put
(
"data"
,
""
);
return
map
;
return
map
;
}
}
tOrgan
.
setLevel
(
tOrgan
.
getCode
().
length
()
/
3
);
tOrgan
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
tOrgan
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
if
(
tOrgan
.
getLevel
()
>
3
)
{
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"message"
,
"不能修改机构为4级!"
);
return
resultMap
;
}
boolean
flag
=
false
;
boolean
flag
=
false
;
flag
=
tOrganService
.
updateById
(
tOrgan
);
flag
=
tOrganService
.
updateById
(
tOrgan
);
if
(!
flag
)
{
if
(!
flag
)
{
...
@@ -141,7 +153,7 @@ public class TOrganController extends BaseController {
...
@@ -141,7 +153,7 @@ public class TOrganController extends BaseController {
@ApiImplicitParams
(
value
=
{
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
})
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
DELETE
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
DELETE
)
public
Map
<
String
,
Object
>
deleteTOrgan
(
String
id
)
{
public
Map
<
String
,
Object
>
deleteTOrgan
(
String
id
)
{
boolean
result
=
false
;
boolean
result
=
false
;
try
{
try
{
...
@@ -162,7 +174,7 @@ public class TOrganController extends BaseController {
...
@@ -162,7 +174,7 @@ public class TOrganController extends BaseController {
@GetMapping
(
"/getList"
)
@GetMapping
(
"/getList"
)
@RequiresAuthentication
//@RequiresPermissions("/organ/getList")
@RequiresAuthentication
//@RequiresPermissions("/organ/getList")
@ApiOperation
(
value
=
"获取机构全部列表(无分页)"
,
notes
=
"获取机构全部列表(无分页)"
)
@ApiOperation
(
value
=
"获取机构全部列表(无分页)"
,
notes
=
"获取机构全部列表(无分页)"
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
SELECT
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
SELECT
)
public
Map
<
String
,
Object
>
getTOrganList
()
{
public
Map
<
String
,
Object
>
getTOrganList
()
{
TUser
user
=
null
;
TUser
user
=
null
;
try
{
try
{
...
@@ -180,7 +192,6 @@ public class TOrganController extends BaseController {
...
@@ -180,7 +192,6 @@ public class TOrganController extends BaseController {
}
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
...
@@ -191,7 +202,7 @@ public class TOrganController extends BaseController {
...
@@ -191,7 +202,7 @@ public class TOrganController extends BaseController {
@PostMapping
(
"/getPageList"
)
@PostMapping
(
"/getPageList"
)
@RequiresAuthentication
//@RequiresPermissions("/organ/getPageList")
@RequiresAuthentication
//@RequiresPermissions("/organ/getPageList")
@ApiOperation
(
value
=
"获取机构分页列表"
,
notes
=
"获取机构分页列表"
)
@ApiOperation
(
value
=
"获取机构分页列表"
,
notes
=
"获取机构分页列表"
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
SELECT
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
SELECT
)
public
Map
<
String
,
Object
>
getTOrganPageList
(
GenericPageParam
genericPageParam
)
{
public
Map
<
String
,
Object
>
getTOrganPageList
(
GenericPageParam
genericPageParam
)
{
TUser
user
=
getcurUser
();
TUser
user
=
getcurUser
();
Page
<
TOrgan
>
page
=
null
;
Page
<
TOrgan
>
page
=
null
;
...
@@ -207,8 +218,8 @@ public class TOrganController extends BaseController {
...
@@ -207,8 +218,8 @@ public class TOrganController extends BaseController {
.
le
(
TOrgan:
:
getCreateTime
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
));
.
le
(
TOrgan:
:
getCreateTime
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
));
}
}
//设置用户数据权限
//设置用户数据权限
queryWrapper
.
likeRight
(
TOrgan:
:
getCode
,
user
.
getOrgCode
());
queryWrapper
.
likeRight
(
TOrgan:
:
getCode
,
user
.
getOrgCode
());
queryWrapper
.
eq
(
TOrgan:
:
getIsDeleted
,
false
);
queryWrapper
.
eq
(
TOrgan:
:
getIsDeleted
,
false
);
// 设置排序规则
// 设置排序规则
queryWrapper
.
orderByDesc
(
TOrgan:
:
getCreateTime
);
queryWrapper
.
orderByDesc
(
TOrgan:
:
getCreateTime
);
page
=
this
.
tOrganService
.
page
(
getPage
(),
queryWrapper
);
page
=
this
.
tOrganService
.
page
(
getPage
(),
queryWrapper
);
...
@@ -222,7 +233,7 @@ public class TOrganController extends BaseController {
...
@@ -222,7 +233,7 @@ public class TOrganController extends BaseController {
@ApiOperation
(
value
=
"获取机构详情"
,
notes
=
"获取机构详情"
)
@ApiOperation
(
value
=
"获取机构详情"
,
notes
=
"获取机构详情"
)
@GetMapping
(
"/getById"
)
@GetMapping
(
"/getById"
)
@RequiresAuthentication
//@RequiresPermissions("/organ/getById")
@RequiresAuthentication
//@RequiresPermissions("/organ/getById")
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
SELECT
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
SELECT
)
public
Map
<
String
,
Object
>
getById
(
String
id
)
{
public
Map
<
String
,
Object
>
getById
(
String
id
)
{
TOrgan
tOrgan
=
null
;
TOrgan
tOrgan
=
null
;
try
{
try
{
...
@@ -235,18 +246,18 @@ public class TOrganController extends BaseController {
...
@@ -235,18 +246,18 @@ public class TOrganController extends BaseController {
}
}
@GetMapping
(
"/getTree"
)
@GetMapping
(
"/getTree"
)
@RequiresAuthentication
//@RequiresPermissions("/organ/getTree")
@RequiresAuthentication
//@RequiresPermissions("/organ/getTree")
@ApiOperation
(
value
=
"获取机构树"
,
notes
=
"获取机构树"
)
@ApiOperation
(
value
=
"获取机构树"
,
notes
=
"获取机构树"
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
SELECT
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
SELECT
)
public
Map
<
String
,
Object
>
getTree
(
String
name
)
{
public
Map
<
String
,
Object
>
getTree
(
String
name
)
{
TUser
user
=
getcurUser
();
TUser
user
=
getcurUser
();
List
<
TOrgan
>
list
=
new
ArrayList
<>();
List
<
TOrgan
>
list
=
new
ArrayList
<>();
try
{
try
{
if
(
StringUtils
.
isBlank
(
name
))
{
if
(
StringUtils
.
isBlank
(
name
))
{
list
=
tOrganService
.
getTree
(
user
.
getOrgCode
());
list
=
tOrganService
.
getTree
(
user
.
getOrgCode
());
}
else
{
}
else
{
list
=
tOrganService
.
list
(
new
UpdateWrapper
<
TOrgan
>().
like
(
"name"
,
name
).
likeRight
(
"code"
,
user
.
getOrgCode
()));
list
=
tOrganService
.
list
(
new
UpdateWrapper
<
TOrgan
>().
like
(
"name"
,
name
).
likeRight
(
"code"
,
user
.
getOrgCode
()));
}
}
return
getResult
(
list
);
return
getResult
(
list
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -258,7 +269,7 @@ public class TOrganController extends BaseController {
...
@@ -258,7 +269,7 @@ public class TOrganController extends BaseController {
@GetMapping
(
"/getAreaTree"
)
@GetMapping
(
"/getAreaTree"
)
@RequiresAuthentication
//@RequiresPermissions("/organ/getAreaTree")
@RequiresAuthentication
//@RequiresPermissions("/organ/getAreaTree")
@ApiOperation
(
value
=
"获取区域树"
,
notes
=
"获取区域树"
)
@ApiOperation
(
value
=
"获取区域树"
,
notes
=
"获取区域树"
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
SELECT
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
SELECT
)
public
Map
<
String
,
Object
>
getAreaTree
()
{
public
Map
<
String
,
Object
>
getAreaTree
()
{
List
<
TArea
>
list
=
null
;
List
<
TArea
>
list
=
null
;
try
{
try
{
...
@@ -275,7 +286,7 @@ public class TOrganController extends BaseController {
...
@@ -275,7 +286,7 @@ public class TOrganController extends BaseController {
@ApiOperation
(
value
=
"导入EXCEL"
,
notes
=
"导入EXCEL"
,
httpMethod
=
"POST"
)
@ApiOperation
(
value
=
"导入EXCEL"
,
notes
=
"导入EXCEL"
,
httpMethod
=
"POST"
)
@RequestMapping
(
value
=
"/import"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/import"
,
method
=
RequestMethod
.
POST
)
@RequiresAuthentication
//@RequiresPermissions("/organ/import")
@RequiresAuthentication
//@RequiresPermissions("/organ/import")
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
IMPORT
)
@MethodLog
(
operModule
=
OperModule
.
ORG
,
operType
=
OperType
.
IMPORT
)
public
ResponseEntity
<
Map
>
upload
(
MultipartFile
file
)
{
public
ResponseEntity
<
Map
>
upload
(
MultipartFile
file
)
{
Map
<
String
,
Object
>
resultMap
=
new
LinkedHashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
resultMap
=
new
LinkedHashMap
<
String
,
Object
>();
try
{
try
{
...
@@ -284,36 +295,40 @@ public class TOrganController extends BaseController {
...
@@ -284,36 +295,40 @@ public class TOrganController extends BaseController {
List
excelList
=
ImportExcelUtil
.
readExcel
(
file
.
getOriginalFilename
(),
file
.
getInputStream
());
List
excelList
=
ImportExcelUtil
.
readExcel
(
file
.
getOriginalFilename
(),
file
.
getInputStream
());
flag
=
tOrganService
.
batchUpload
(
excelList
);
flag
=
tOrganService
.
batchUpload
(
excelList
);
if
(!
flag
)
{
if
(!
flag
)
{
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"massage"
,
"导入失败!"
);
resultMap
.
put
(
"massage"
,
"导入失败!"
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
}
}
resultMap
.
put
(
"resultCode"
,
"200"
);
resultMap
.
put
(
"resultCode"
,
"200"
);
resultMap
.
put
(
"massage"
,
"导入成功!"
);
resultMap
.
put
(
"massage"
,
"导入成功!"
);
return
ResponseEntity
.
ok
(
resultMap
);
return
ResponseEntity
.
ok
(
resultMap
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"massage"
,
e
);
resultMap
.
put
(
"massage"
,
e
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
}
}
}
}
private
String
getOrganCode
(
String
parentId
)
{
private
String
getOrganCode
(
String
parentId
)
{
TOrgan
max
=
tOrganService
.
selectCodeMax
(
parentId
);
TOrgan
max
=
tOrganService
.
selectCodeMax
(
parentId
);
if
(
max
==
null
){
TOrgan
byId
=
tOrganService
.
getById
(
parentId
);
max
=
tOrganService
.
getById
(
parentId
);
if
(
max
==
null
)
{
String
s
=
max
.
getCode
()
+
"001"
;
if
(
byId
!=
null
)
{
return
s
;
String
s
=
byId
.
getCode
()
+
"001"
;
return
s
;
}
else
{
return
"001"
;
}
}
}
String
s
=
max
.
getCode
().
substring
(
max
.
getCode
().
length
()
-
3
);
String
s
=
max
.
getCode
().
substring
(
max
.
getCode
().
length
()
-
3
);
String
s1
=
max
.
getCode
().
substring
(
0
,
max
.
getCode
().
length
()
-
3
);
String
s1
=
max
.
getCode
().
substring
(
0
,
max
.
getCode
().
length
()
-
3
);
Integer
integer
=
Integer
.
valueOf
(
s
)
+
1
;
Integer
integer
=
Integer
.
valueOf
(
s
)
+
1
;
if
(
integer
<
10
)
{
if
(
integer
<
10
)
{
s1
=
s1
+
"00"
+
integer
.
toString
();
s1
=
s1
+
"00"
+
integer
.
toString
();
}
else
if
(
integer
<
100
)
{
}
else
if
(
integer
<
100
)
{
s1
=
s1
+
"0"
+
integer
.
toString
();
s1
=
s1
+
"0"
+
integer
.
toString
();
}
else
{
}
else
{
s1
=
s1
+
integer
.
toString
();
s1
=
s1
+
integer
.
toString
();
}
}
return
s1
;
return
s1
;
}
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TUserController.java
View file @
acb265fe
...
@@ -405,7 +405,7 @@ public class TUserController extends BaseController {
...
@@ -405,7 +405,7 @@ public class TUserController extends BaseController {
entity
.
setId
(
userId
);
entity
.
setId
(
userId
);
entity
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
entity
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
entity
.
setIsDeleted
(
true
);
entity
.
setIsDeleted
(
true
);
boolean
ret1
=
this
.
userService
.
updat
eById
(
entity
);
boolean
ret1
=
this
.
userService
.
remov
eById
(
entity
);
QueryWrapper
<
TUserRole
>
userRoleWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
TUserRole
>
userRoleWrapper
=
new
QueryWrapper
<>();
userRoleWrapper
.
eq
(
"user_id"
,
userId
);
userRoleWrapper
.
eq
(
"user_id"
,
userId
);
...
@@ -649,7 +649,7 @@ public class TUserController extends BaseController {
...
@@ -649,7 +649,7 @@ public class TUserController extends BaseController {
List
<
TUser
>
list
=
this
.
userService
.
list
(
ew
);
List
<
TUser
>
list
=
this
.
userService
.
list
(
ew
);
if
(
list
!=
null
&&
list
.
size
()>
1
&&
list
.
get
(
0
)!=
null
)
{
if
(
list
!=
null
&&
list
.
size
()>
1
&&
list
.
get
(
0
)!=
null
)
{
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"message"
,
"
每个单位只能有一个机顶盒账号
!"
);
resultMap
.
put
(
"message"
,
"
该单位机顶盒账号已存在
!"
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
}
}
}
}
...
@@ -667,21 +667,7 @@ public class TUserController extends BaseController {
...
@@ -667,21 +667,7 @@ public class TUserController extends BaseController {
user
.
setAuditStatus
(
AuditStatusEnum
.
APPROVED_FINAL
.
name
());
user
.
setAuditStatus
(
AuditStatusEnum
.
APPROVED_FINAL
.
name
());
user
.
setType
(
"3"
);
user
.
setType
(
"3"
);
boolean
ret
=
this
.
userService
.
save
(
user
);
boolean
ret
=
this
.
userService
.
addBox
(
user
);
TBoxOperation
tBoxOperation
=
new
TBoxOperation
();
tBoxOperation
.
setOrganId
(
user
.
getOrgId
());
tBoxOperation
.
setAreaId
(
user
.
getAreaId
());
tBoxOperation
.
setStatus
(
1
);
tBoxOperation
.
setCreateTime
(
LocalDateTime
.
now
());
tBoxOperation
.
setUpdateTime
(
LocalDateTime
.
now
());
ret
=
boxOperationService
.
save
(
tBoxOperation
);
TUserRole
userRole
=
new
TUserRole
();
userRole
.
setUserId
(
user
.
getId
());
userRole
.
setRoleId
(
"3"
);
userRole
.
setIsDeleted
(
false
);
tUserRoleService
.
save
(
userRole
);
if
(!
ret
)
{
if
(!
ret
)
{
// 新增失败, 500
// 新增失败, 500
...
...
src/main/resources/mapper/TBoxOperationMapper.xml
View file @
acb265fe
...
@@ -40,7 +40,7 @@ left join t_organ r on r.id = b.organ_id
...
@@ -40,7 +40,7 @@ left join t_organ r on r.id = b.organ_id
from t_user u
from t_user u
left join t_organ o on o.id = u.org_id
left join t_organ o on o.id = u.org_id
left join t_area a on u.area_id = a.id
left join t_area a on u.area_id = a.id
left
join t_box_operation b on b.organ_id = o.id
inner
join t_box_operation b on b.organ_id = o.id
where 1=1
where 1=1
<if
test=
"user.orgId!= null and user.orgId != '' "
>
<if
test=
"user.orgId!= null and user.orgId != '' "
>
and b.organ_id =#{user.orgId}
and b.organ_id =#{user.orgId}
...
...
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