Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
3af737b2
Commit
3af737b2
authored
Jun 20, 2023
by
“yiyousong”
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.scsmile.cn/zxf/smart_gov_platform
parents
1cf87920
fe037c82
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
99 additions
and
34 deletions
+99
-34
base-manager/src/main/java/com/mortals/xhx/base/system/user/service/impl/UserServiceImpl.java
...ls/xhx/base/system/user/service/impl/UserServiceImpl.java
+13
-7
base-manager/src/main/java/com/mortals/xhx/module/app/web/AppController.java
...in/java/com/mortals/xhx/module/app/web/AppController.java
+7
-6
base-manager/src/main/java/com/mortals/xhx/module/site/model/SiteTreeSelect.java
...ava/com/mortals/xhx/module/site/model/SiteTreeSelect.java
+23
-8
base-manager/src/main/java/com/mortals/xhx/module/site/service/SiteService.java
...java/com/mortals/xhx/module/site/service/SiteService.java
+9
-7
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
...mortals/xhx/module/site/service/impl/SiteServiceImpl.java
+29
-6
base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteController.java
.../java/com/mortals/xhx/module/site/web/SiteController.java
+18
-0
No files found.
base-manager/src/main/java/com/mortals/xhx/base/system/user/service/impl/UserServiceImpl.java
View file @
3af737b2
...
@@ -297,6 +297,8 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
...
@@ -297,6 +297,8 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
@Override
@Override
public
void
updateUserList
(
List
<
UserPdu
>
list
)
{
public
void
updateUserList
(
List
<
UserPdu
>
list
)
{
//更新本地用户信息,并且更新用户站点树
//更新本地用户信息,并且更新用户站点树
//如果用户未有所属站点 则不更新
for
(
UserPdu
user
:
list
)
{
for
(
UserPdu
user
:
list
)
{
UserEntity
tempUser
=
this
.
selectOne
(
new
UserQuery
().
loginName
(
user
.
getLoginName
()));
UserEntity
tempUser
=
this
.
selectOne
(
new
UserQuery
().
loginName
(
user
.
getLoginName
()));
if
(
ObjectUtils
.
isEmpty
(
tempUser
))
{
if
(
ObjectUtils
.
isEmpty
(
tempUser
))
{
...
@@ -305,18 +307,22 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
...
@@ -305,18 +307,22 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
entity
.
initAttrValue
();
entity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
user
,
entity
,
BeanUtil
.
getNullPropertyNames
(
user
));
BeanUtils
.
copyProperties
(
user
,
entity
,
BeanUtil
.
getNullPropertyNames
(
user
));
this
.
save
(
entity
);
this
.
save
(
entity
);
Context
context
=
new
Context
();
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getSiteIds
()))
{
context
.
setUser
(
entity
);
Context
context
=
new
Context
();
ThreadPool
.
getInstance
().
execute
(
new
SyncTreeSiteThread
(
context
));
context
.
setUser
(
entity
);
ThreadPool
.
getInstance
().
execute
(
new
SyncTreeSiteThread
(
context
));
}
}
else
{
}
else
{
//更新
//更新
UserEntity
userEntity
=
new
UserEntity
();
UserEntity
userEntity
=
new
UserEntity
();
BeanUtils
.
copyProperties
(
user
,
userEntity
,
new
String
[]{
"loginPwd"
,
"loginName"
,
"userType"
,
"status"
,
"lastLoginTime"
,
"lastLoginAddress"
});
BeanUtils
.
copyProperties
(
user
,
userEntity
,
new
String
[]{
"loginPwd"
,
"loginName"
,
"userType"
,
"status"
,
"lastLoginTime"
,
"lastLoginAddress"
});
userEntity
.
setId
(
tempUser
.
getId
());
userEntity
.
setId
(
tempUser
.
getId
());
this
.
updateWidthDao
(
userEntity
);
this
.
updateWidthDao
(
userEntity
);
Context
context
=
new
Context
();
if
(!
ObjectUtils
.
isEmpty
(
userEntity
.
getSiteIds
()))
{
context
.
setUser
(
userEntity
);
Context
context
=
new
Context
();
ThreadPool
.
getInstance
().
execute
(
new
SyncTreeSiteThread
(
context
));
context
.
setUser
(
userEntity
);
ThreadPool
.
getInstance
().
execute
(
new
SyncTreeSiteThread
(
context
));
}
}
}
}
}
}
}
...
...
base-manager/src/main/java/com/mortals/xhx/module/app/web/AppController.java
View file @
3af737b2
...
@@ -2,7 +2,6 @@ package com.mortals.xhx.module.app.web;
...
@@ -2,7 +2,6 @@ package com.mortals.xhx.module.app.web;
import
cn.hutool.core.net.url.UrlBuilder
;
import
cn.hutool.core.net.url.UrlBuilder
;
import
cn.hutool.core.util.ZipUtil
;
import
cn.hutool.core.util.ZipUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.ap.GlobalSysInfo
;
import
com.mortals.framework.ap.GlobalSysInfo
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
...
@@ -31,10 +30,7 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -31,10 +30,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
CUSTAPP_ROOT_PATH
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
CUSTAPP_ROOT_PATH
;
...
@@ -66,7 +62,7 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
...
@@ -66,7 +62,7 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"type"
,
AppTypeEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"type"
,
AppTypeEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"shelves"
,
paramService
.
getParamBySecondOrganize
(
"App"
,
"shelves"
));
this
.
addDict
(
model
,
"shelves"
,
paramService
.
getParamBySecondOrganize
(
"App"
,
"shelves"
));
this
.
addDict
(
model
,
"appThemeName"
,
paramService
.
getParamBySecondOrganize
(
"App"
,
"appThemeName"
));
//
this.addDict(model, "appThemeName", paramService.getParamBySecondOrganize("App", "appThemeName"));
this
.
addDict
(
model
,
"distribute"
,
YesNoEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"distribute"
,
YesNoEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"dateUpdate"
,
YesNoEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"dateUpdate"
,
YesNoEnum
.
getEnumMap
());
super
.
init
(
model
,
context
);
super
.
init
(
model
,
context
);
...
@@ -106,6 +102,11 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
...
@@ -106,6 +102,11 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
List
<
AppCategoryEntity
>
appCategoryEntities
=
appCategoryService
.
find
(
appCategoryQuery
);
List
<
AppCategoryEntity
>
appCategoryEntities
=
appCategoryService
.
find
(
appCategoryQuery
);
if
(!
ObjectUtils
.
isEmpty
(
appCategoryEntities
))
{
if
(!
ObjectUtils
.
isEmpty
(
appCategoryEntities
))
{
model
.
put
(
"appCategory"
,
appCategoryEntities
);
model
.
put
(
"appCategory"
,
appCategoryEntities
);
Map
<
String
,
Object
>
appThemeName
=
new
HashMap
<>();
for
(
AppCategoryEntity
appCategory:
appCategoryEntities
){
appThemeName
.
put
(
appCategory
.
getId
().
toString
(),
appCategory
.
getCategoryName
());
}
this
.
addDict
(
model
,
"appThemeName"
,
appThemeName
);
}
}
}
}
return
super
.
doListAfter
(
query
,
model
,
context
);
return
super
.
doListAfter
(
query
,
model
,
context
);
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/model/SiteTreeSelect.java
View file @
3af737b2
...
@@ -37,6 +37,11 @@ public class SiteTreeSelect implements Serializable {
...
@@ -37,6 +37,11 @@ public class SiteTreeSelect implements Serializable {
*/
*/
private
String
siteCode
;
private
String
siteCode
;
/**
* 站点详细地址
*/
private
String
detailAddress
;
/**
/**
* 节点名称
* 节点名称
*/
*/
...
@@ -45,6 +50,12 @@ public class SiteTreeSelect implements Serializable {
...
@@ -45,6 +50,12 @@ public class SiteTreeSelect implements Serializable {
* 区域编码
* 区域编码
*/
*/
private
String
areaCode
;
private
String
areaCode
;
/**
* 为区域时 层级
*/
private
Integer
level
;
/**
/**
* 是否叶子节点
* 是否叶子节点
*/
*/
...
@@ -79,7 +90,6 @@ public class SiteTreeSelect implements Serializable {
...
@@ -79,7 +90,6 @@ public class SiteTreeSelect implements Serializable {
public
SiteTreeSelect
(
AreaEntity
entity
)
{
public
SiteTreeSelect
(
AreaEntity
entity
)
{
//如果是站点,则替换名称和id
//如果是站点,则替换名称和id
this
.
id
=
entity
.
getIid
();
this
.
id
=
entity
.
getIid
();
this
.
label
=
entity
.
getName
();
this
.
label
=
entity
.
getName
();
if
(
"False"
.
equalsIgnoreCase
(
entity
.
getHaveSonArea
()))
{
if
(
"False"
.
equalsIgnoreCase
(
entity
.
getHaveSonArea
()))
{
...
@@ -103,14 +113,18 @@ public class SiteTreeSelect implements Serializable {
...
@@ -103,14 +113,18 @@ public class SiteTreeSelect implements Serializable {
this
.
siteCode
=
collect
.
stream
().
map
(
item
->
item
.
getSiteCode
()).
collect
(
Collectors
.
joining
(
","
));
this
.
siteCode
=
collect
.
stream
().
map
(
item
->
item
.
getSiteCode
()).
collect
(
Collectors
.
joining
(
","
));
this
.
type
=
"site"
;
this
.
type
=
"site"
;
this
.
icon
=
"el-icon-wind-power"
;
this
.
icon
=
"el-icon-wind-power"
;
this
.
longitude
=
collect
.
stream
().
findFirst
().
map
(
item
->
item
.
getLongitude
()).
orElseGet
(()
->
""
);
this
.
detailAddress
=
collect
.
stream
().
map
(
item
->
item
.
getDetailAddress
()).
collect
(
Collectors
.
joining
(
","
));
this
.
latitude
=
collect
.
stream
().
findFirst
().
map
(
item
->
item
.
getLatitude
()).
orElseGet
(()
->
""
);
this
.
areaCode
=
collect
.
stream
().
map
(
item
->
item
.
getAreaCode
()).
collect
(
Collectors
.
joining
(
","
));
this
.
longitude
=
collect
.
stream
().
map
(
item
->
item
.
getLongitude
()).
collect
(
Collectors
.
joining
(
","
));
this
.
latitude
=
collect
.
stream
().
map
(
item
->
item
.
getLatitude
()).
collect
(
Collectors
.
joining
(
","
));
}
else
{
}
else
{
this
.
id
=
entity
.
getIid
();
this
.
id
=
entity
.
getIid
();
this
.
label
=
entity
.
getName
();
this
.
label
=
entity
.
getName
();
this
.
type
=
"area"
;
this
.
type
=
"area"
;
this
.
icon
=
"el-icon-place"
;
this
.
icon
=
"el-icon-place"
;
this
.
areaCode
=
entity
.
getAreaCode
();
}
}
this
.
level
=
entity
.
getAreaLevel
();
if
(
"False"
.
equalsIgnoreCase
(
entity
.
getHaveSonArea
()))
{
if
(
"False"
.
equalsIgnoreCase
(
entity
.
getHaveSonArea
()))
{
this
.
isLeaf
=
true
;
this
.
isLeaf
=
true
;
//this.children = new ArrayList();
//this.children = new ArrayList();
...
@@ -120,7 +134,6 @@ public class SiteTreeSelect implements Serializable {
...
@@ -120,7 +134,6 @@ public class SiteTreeSelect implements Serializable {
}
}
this
.
areaCode
=
entity
.
getAreaCode
();
this
.
areaCode
=
entity
.
getAreaCode
();
}
}
// 反序列化器
// 反序列化器
...
@@ -132,7 +145,7 @@ public class SiteTreeSelect implements Serializable {
...
@@ -132,7 +145,7 @@ public class SiteTreeSelect implements Serializable {
node
.
setId
(
jsonObject
.
getString
(
"id"
));
node
.
setId
(
jsonObject
.
getString
(
"id"
));
node
.
setSiteCode
(
jsonObject
.
getString
(
"siteCode"
));
node
.
setSiteCode
(
jsonObject
.
getString
(
"siteCode"
));
node
.
setLabel
(
jsonObject
.
getString
(
"label"
));
node
.
setLabel
(
jsonObject
.
getString
(
"label"
));
node
.
setAreaCode
(
jsonObject
.
getString
(
"area
c
ode"
));
node
.
setAreaCode
(
jsonObject
.
getString
(
"area
C
ode"
));
node
.
setIsLeaf
(
jsonObject
.
getBoolean
(
"isLeaf"
));
node
.
setIsLeaf
(
jsonObject
.
getBoolean
(
"isLeaf"
));
node
.
setLongitude
(
jsonObject
.
getString
(
"longitude"
));
node
.
setLongitude
(
jsonObject
.
getString
(
"longitude"
));
node
.
setLatitude
(
jsonObject
.
getString
(
"latitude"
));
node
.
setLatitude
(
jsonObject
.
getString
(
"latitude"
));
...
@@ -140,9 +153,11 @@ public class SiteTreeSelect implements Serializable {
...
@@ -140,9 +153,11 @@ public class SiteTreeSelect implements Serializable {
node
.
setIcon
(
jsonObject
.
getString
(
"icon"
));
node
.
setIcon
(
jsonObject
.
getString
(
"icon"
));
JSONArray
jsonArray
=
jsonObject
.
getJSONArray
(
"children"
);
JSONArray
jsonArray
=
jsonObject
.
getJSONArray
(
"children"
);
List
<
SiteTreeSelect
>
children
=
new
ArrayList
<>();
List
<
SiteTreeSelect
>
children
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
if
(!
ObjectUtils
.
isEmpty
(
jsonArray
)){
SiteTreeSelect
child
=
JSON
.
parseObject
(
jsonArray
.
getJSONObject
(
i
).
toJSONString
(),
SiteTreeSelect
.
class
);
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
children
.
add
(
child
);
SiteTreeSelect
child
=
JSON
.
parseObject
(
jsonArray
.
getJSONObject
(
i
).
toJSONString
(),
SiteTreeSelect
.
class
);
children
.
add
(
child
);
}
}
}
node
.
setChildren
(
children
);
node
.
setChildren
(
children
);
return
node
;
return
node
;
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/service/SiteService.java
View file @
3af737b2
...
@@ -44,25 +44,27 @@ public interface SiteService extends ICRUDCacheService<SiteEntity, Long> {
...
@@ -44,25 +44,27 @@ public interface SiteService extends ICRUDCacheService<SiteEntity, Long> {
*/
*/
List
<
SiteTreeSelect
>
getSiteTree
(
Context
context
);
List
<
SiteTreeSelect
>
getSiteTree
(
Context
context
);
List
<
SiteEntity
>
getFlatSitesByAreaCode
(
String
areaCode
,
Context
context
);
List
<
SiteEntity
>
getFlatSitesByAreaCode
(
String
areaCode
,
Context
context
);
List
<
SiteEntity
>
getFlatSitesBySiteId
(
Long
siteId
,
Context
context
);
List
<
SiteEntity
>
getFlatSitesBySiteId
(
Long
siteId
,
Context
context
);
Rest
<
List
<
SiteAreaVo
>>
getAreaSitesBySite
(
SiteQuery
query
,
Context
context
);
Integer
countSitesByArea
(
SiteQuery
query
,
Context
context
);
Rest
<
List
<
SiteEntity
>>
getAreaSitesByAreaLevel
(
SiteQuery
query
,
Context
context
);
Rest
<
List
<
SiteAreaVo
>>
getAreaSitesBySite
(
SiteQuery
query
,
Context
context
);
Rest
<
List
<
SiteEntity
>>
getAreaSitesByAreaLevel
(
SiteQuery
query
,
Context
context
);
void
setSiteTree
(
List
<
SiteTreeSelect
>
list
,
Context
context
);
void
setSiteTree
(
List
<
SiteTreeSelect
>
list
,
Context
context
);
void
removeSiteTree
(
List
<
SiteTreeSelect
>
list
,
Context
context
);
void
removeSiteTree
(
List
<
SiteTreeSelect
>
list
,
Context
context
);
List
<
SiteEntity
>
getListAllInfoByQuery
(
SiteQuery
query
,
Context
context
)
throws
AppException
;
List
<
SiteEntity
>
getListAllInfoByQuery
(
SiteQuery
query
,
Context
context
)
throws
AppException
;
void
changeUrlPath
(
SiteEntity
siteEntity
);
void
changeUrlPath
(
SiteEntity
siteEntity
);
Rest
<
List
<
MatterEntity
>>
getMatterAllListByGOV
(
Map
<
String
,
String
>
params
,
Integer
pageNum
,
Context
context
);
Rest
<
List
<
MatterEntity
>>
getMatterAllListByGOV
(
Map
<
String
,
String
>
params
,
Integer
pageNum
,
Context
context
);
Rest
<
String
>
syncMatterBySiteId
(
SiteEntity
siteEntity
,
Context
context
);
Rest
<
String
>
syncMatterBySiteId
(
SiteEntity
siteEntity
,
Context
context
);
void
deleteBysiteIdAndSource
(
Long
siteId
,
Integer
source
,
Context
context
);
void
deleteBysiteIdAndSource
(
Long
siteId
,
Integer
source
,
Context
context
);
}
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
View file @
3af737b2
...
@@ -185,7 +185,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -185,7 +185,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Override
@Override
protected
void
saveAfter
(
SiteEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
saveAfter
(
SiteEntity
entity
,
Context
context
)
throws
AppException
{
log
.
info
(
"站点更新1"
);
//刷新站点树
//刷新站点树
//ThreadPool.getInstance().execute(new SyncTreeSiteThread(this,context));
//ThreadPool.getInstance().execute(new SyncTreeSiteThread(this,context));
Rest
<
String
>
rest
=
userFeign
.
synchSiteAuth
();
Rest
<
String
>
rest
=
userFeign
.
synchSiteAuth
();
...
@@ -364,7 +363,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -364,7 +363,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Override
@Override
public
List
<
SiteTreeSelect
>
getSiteTree
(
Context
context
)
{
public
List
<
SiteTreeSelect
>
getSiteTree
(
Context
context
)
{
List
<
SiteTreeSelect
>
siteTreeSelects
=
siteTreeMap
.
get
(
context
.
getUser
().
getId
());
//
List<SiteTreeSelect> siteTreeSelects = siteTreeMap.get(context.getUser().getId());
List
<
SiteTreeSelect
>
collect
=
getSiteTreeSelects
(
context
.
getUser
().
getId
().
toString
());
List
<
SiteTreeSelect
>
collect
=
getSiteTreeSelects
(
context
.
getUser
().
getId
().
toString
());
log
.
info
(
"siteTree:{}"
,
JSON
.
toJSONString
(
collect
));
log
.
info
(
"siteTree:{}"
,
JSON
.
toJSONString
(
collect
));
if
(!
ObjectUtils
.
isEmpty
(
collect
))
{
if
(!
ObjectUtils
.
isEmpty
(
collect
))
{
...
@@ -389,7 +388,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -389,7 +388,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
if
(
ObjectUtils
.
isEmpty
(
siteTreeSelectStr
))
{
if
(
ObjectUtils
.
isEmpty
(
siteTreeSelectStr
))
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
JSONArray
jsonArray
=
JSON
.
parseArray
(
siteTreeSelectStr
);
JSONArray
jsonArray
=
JSON
.
parseArray
(
siteTreeSelectStr
);
if
(
ObjectUtils
.
isEmpty
(
jsonArray
))
{
if
(
ObjectUtils
.
isEmpty
(
jsonArray
))
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
...
@@ -450,12 +448,37 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -450,12 +448,37 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
return
siteList
;
return
siteList
;
}
}
/**
* @param query
* @param context
* @return
*/
@Override
public
Integer
countSitesByArea
(
SiteQuery
query
,
Context
context
)
{
List
<
SiteEntity
>
siteList
=
new
ArrayList
<>();
if
(
ObjectUtils
.
isEmpty
(
query
.
getAreaCode
()))
{
throw
new
AppException
(
"区域编码不能为空!"
);
}
AreaEntity
areaEntity
=
areaService
.
getExtCache
(
query
.
getAreaCode
());
if
(
ObjectUtils
.
isEmpty
(
areaEntity
))
{
throw
new
AppException
(
String
.
format
(
"区域不存在!区域编码:%s"
,
query
.
getAreaCode
()));
}
String
matchCode
=
query
.
getAreaCode
().
replaceAll
(
"(0)+$"
,
""
);
SiteQuery
siteQuery
=
new
SiteQuery
();
siteQuery
.
setAreaCode
(
matchCode
+
"%"
);
List
<
SiteEntity
>
siteEntities
=
this
.
find
(
siteQuery
);
if
(!
ObjectUtils
.
isEmpty
(
siteEntities
))
{
siteList
.
addAll
(
siteEntities
);
}
return
siteList
.
size
();
}
@Override
@Override
public
Rest
<
List
<
SiteAreaVo
>>
getAreaSitesBySite
(
SiteQuery
query
,
Context
context
)
{
public
Rest
<
List
<
SiteAreaVo
>>
getAreaSitesBySite
(
SiteQuery
query
,
Context
context
)
{
List
<
SiteAreaVo
>
list
=
new
ArrayList
<>();
List
<
SiteAreaVo
>
list
=
new
ArrayList
<>();
SiteAreaVo
siteAreaVo
=
new
SiteAreaVo
();
SiteAreaVo
siteAreaVo
=
new
SiteAreaVo
();
//获取当前节点的第一层子节点
//获取当前节点的第一层子节点
if
(
ObjectUtils
.
isEmpty
(
query
.
getAreaName
()))
{
if
(
ObjectUtils
.
isEmpty
(
query
.
getAreaName
()))
{
throw
new
AppException
(
"区域名称查询参数不能为空!"
);
throw
new
AppException
(
"区域名称查询参数不能为空!"
);
...
@@ -553,7 +576,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -553,7 +576,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Override
@Override
public
void
setSiteTree
(
List
<
SiteTreeSelect
>
list
,
Context
context
)
{
public
void
setSiteTree
(
List
<
SiteTreeSelect
>
list
,
Context
context
)
{
siteTreeMap
.
put
(
context
.
getUser
().
getId
(),
list
);
//
siteTreeMap.put(context.getUser().getId(), list);
//存放到redis中去
//存放到redis中去
cacheService
.
hset
(
USER_SITE_TREE
,
context
.
getUser
().
getId
().
toString
(),
JSON
.
toJSONString
(
list
));
cacheService
.
hset
(
USER_SITE_TREE
,
context
.
getUser
().
getId
().
toString
(),
JSON
.
toJSONString
(
list
));
}
}
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteController.java
View file @
3af737b2
...
@@ -255,6 +255,24 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
...
@@ -255,6 +255,24 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
return
jsonObject
.
toJSONString
();
return
jsonObject
.
toJSONString
();
}
}
/**
* 根据区域获取子站点数量
*/
@PostMapping
(
value
=
"countSitesByArea"
)
@UnAuth
public
Rest
<
Integer
>
countSitesByArea
(
@RequestBody
SiteQuery
site
)
{
String
busiDesc
=
"根据站点id查询站点列表子集"
+
this
.
getModuleDesc
();
try
{
Integer
count
=
this
.
service
.
countSitesByArea
(
site
,
getContext
());
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
return
Rest
.
ok
(
count
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取异常"
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
}
/**
/**
* 根据站点id查询站点列表子集,包含当前站点,二层结构
* 根据站点id查询站点列表子集,包含当前站点,二层结构
* {rootname:}
* {rootname:}
...
...
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