Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
base-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
赵啸非
base-platform
Commits
af099e2b
Commit
af099e2b
authored
Apr 13, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加批量新增窗口业务接口
parent
fbbf784a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
7 deletions
+17
-7
base-manager/src/main/java/com/mortals/xhx/common/key/Constant.java
...er/src/main/java/com/mortals/xhx/common/key/Constant.java
+10
-0
base-manager/src/main/java/com/mortals/xhx/module/site/model/SiteTreeSelect.java
...ava/com/mortals/xhx/module/site/model/SiteTreeSelect.java
+1
-1
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
...mortals/xhx/module/site/service/impl/SiteServiceImpl.java
+6
-6
No files found.
base-manager/src/main/java/com/mortals/xhx/common/key/Constant.java
View file @
af099e2b
...
...
@@ -17,6 +17,16 @@ public final class Constant {
*/
public
static
final
String
HTTP
=
"http://"
;
/**
* 站点编号分隔符
*/
public
static
final
String
SITE_SPLIT_MARK
=
"-"
;
/**
* 站点编号补零位数
*/
public
static
final
Integer
SITE_CODE_NUM
=
4
;
/** 基础代码版本 Z-BASE.MANAGER-S1.0.0 */
public
final
static
String
BASEMANAGER_VERSION
=
"Z-BASE.MANAGER-S1.0.0"
;
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/model/SiteTreeSelect.java
View file @
af099e2b
...
...
@@ -75,7 +75,7 @@ public class SiteTreeSelect implements Serializable {
.
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
collect
))
{
this
.
id
=
collect
.
stream
().
map
(
item
->
item
.
getId
().
toString
()).
collect
(
Collectors
.
joining
(
","
));
this
.
label
=
collect
.
stream
().
map
(
item
->
item
.
getSiteName
()
.
toString
()
).
collect
(
Collectors
.
joining
(
","
));
this
.
label
=
collect
.
stream
().
map
(
item
->
item
.
getSiteName
()).
collect
(
Collectors
.
joining
(
","
));
this
.
type
=
"site"
;
this
.
icon
=
"el-icon-document"
;
}
else
{
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
View file @
af099e2b
...
...
@@ -2,6 +2,9 @@ package com.mortals.xhx.module.site.service.impl;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.util.DataUtil
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.common.key.Constant
;
import
com.mortals.xhx.module.area.model.AreaEntity
;
import
com.mortals.xhx.module.area.model.AreaQuery
;
import
com.mortals.xhx.module.area.model.AreaTreeSelect
;
...
...
@@ -49,22 +52,19 @@ public class SiteServiceImpl extends AbstractCRUDServiceImpl<SiteDao, SiteEntity
@Override
protected
void
saveBefore
(
SiteEntity
entity
,
Context
context
)
throws
AppException
{
List
<
SiteEntity
>
siteEntities
=
this
.
find
(
new
SiteQuery
().
areaCode
(
entity
.
getAreaCode
()));
entity
.
setSiteCode
(
entity
.
getAreaCode
()
+
"#"
+
(
siteEntities
.
size
()
+
1
));
entity
.
setSiteCode
(
entity
.
getAreaCode
()
+
Constant
.
SITE_SPLIT_MARK
+
StringUtils
.
lpad
(
siteEntities
.
size
()
+
1
,
Constant
.
SITE_CODE_NUM
));
super
.
saveBefore
(
entity
,
context
);
}
@Override
public
List
<
SiteTreeSelect
>
siteTree
(
Context
context
)
{
Map
<
String
,
AreaEntity
>
areaMap
=
new
HashMap
<>();
//查询所有已配置的站点
List
<
SiteEntity
>
siteList
=
this
.
find
(
new
SiteQuery
());
Map
<
String
,
SiteEntity
>
siteMap
=
this
.
find
(
new
SiteQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getSiteCode
(),
y
->
y
,
(
o
,
n
)
->
n
));
Map
<
String
,
SiteEntity
>
siteMap
=
siteList
.
parallelStream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getSiteCode
(),
y
->
y
,
(
o
,
n
)
->
n
));
//遍历过滤站点树
for
(
SiteEntity
siteEntity
:
siteList
)
{
String
areaCode
=
siteEntity
.
getAreaCode
();
AreaEntity
areaEntity
=
areaService
.
getExtCache
(
areaCode
);
AreaEntity
areaEntity
=
areaService
.
getExtCache
(
siteEntity
.
getAreaCode
());
//根据区域添加父节点
if
(!
ObjectUtils
.
isEmpty
(
areaEntity
)
&&
!
ObjectUtils
.
isEmpty
(
areaEntity
.
getPid
()))
{
//递归查找父节点并添加
...
...
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