Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
self-service
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
廖旭伟
self-service
Commits
bacc03ac
Commit
bacc03ac
authored
Jun 13, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改站点树接口返回值结构
parent
a11f641e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
7 deletions
+99
-7
common-lib/src/main/java/com/mortals/xhx/common/pdu/site/SiteTreeSelectVO.java
...ava/com/mortals/xhx/common/pdu/site/SiteTreeSelectVO.java
+61
-0
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeSiteServiceImpl.java
...module/converge/service/impl/ConvergeSiteServiceImpl.java
+3
-6
sst-manager/src/main/java/com/mortals/xhx/module/site/web/vo/SiteTreeVO.java
...n/java/com/mortals/xhx/module/site/web/vo/SiteTreeVO.java
+4
-0
sst-manager/src/main/java/com/mortals/xhx/module/sst/web/SstBasicController.java
...va/com/mortals/xhx/module/sst/web/SstBasicController.java
+31
-1
No files found.
common-lib/src/main/java/com/mortals/xhx/common/pdu/site/SiteTreeSelectVO.java
0 → 100644
View file @
bacc03ac
package
com.mortals.xhx.common.pdu.site
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
SiteTreeSelectVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 节点ID
*/
private
String
id
;
/**
* 站点编码
*/
private
String
siteCode
;
/**
* 节点名称
*/
private
String
label
;
/**
* 区域编码
*/
private
String
areaCode
;
/**
* 是否叶子节点
*/
private
Boolean
isLeaf
;
/**
* 经度
*/
private
String
longitude
;
/**
* 纬度
*/
private
String
latitude
;
/**
* 节点类型
*/
private
String
type
;
/**
* 图标
*/
private
String
icon
;
/**
* 子节点
*/
private
List
<
SiteTreeSelectVO
>
children
;
private
Integer
siteCount
;
}
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeSiteServiceImpl.java
View file @
bacc03ac
...
...
@@ -65,7 +65,8 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit
}
branchVO
.
setEquipments
(
equipments
);
}
else
{
branchVO
.
setEquipments
(
Collections
.
emptyList
());
//branchVO.setEquipments(Collections.emptyList());
continue
;
}
result
.
add
(
branchVO
);
...
...
@@ -109,11 +110,7 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit
entity
.
setSiteId
(
sitePdu
.
getId
());
entity
.
setBranchName
(
sitePdu
.
getSiteName
());
entity
.
setBranchLogo
(
sitePdu
.
getSiteCode
());
if
(
sitePdu
.
getStatus
()!=
null
&&
sitePdu
.
getStatus
()==
1
)
{
entity
.
setStatus
(
"Y"
);
}
else
{
entity
.
setStatus
(
"N"
);
}
entity
.
setStatus
(
"Y"
);
entity
.
setServerTime
(
"星期一至星期五 上午:09:00-12:00 下午:14:00-17:00 备注:法定节假日除外;"
);
entity
.
setConsultPhone
(
sitePdu
.
getSiteTel
());
entity
.
setBranchStyle
(
"1"
);
...
...
sst-manager/src/main/java/com/mortals/xhx/module/site/web/vo/SiteTreeVO.java
0 → 100644
View file @
bacc03ac
package
com.mortals.xhx.module.site.web.vo
;
public
class
SiteTreeVO
{
}
sst-manager/src/main/java/com/mortals/xhx/module/sst/web/SstBasicController.java
View file @
bacc03ac
...
...
@@ -14,6 +14,7 @@ import com.mortals.xhx.common.code.YesNoEnum;
import
com.mortals.xhx.common.key.ParamKey
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.app.AppPdu
;
import
com.mortals.xhx.common.pdu.site.SiteTreeSelectVO
;
import
com.mortals.xhx.feign.app.IAppFeign
;
import
com.mortals.xhx.feign.base.IApiBaseManagerFeign
;
import
com.mortals.xhx.feign.base.pdu.SitePdu
;
...
...
@@ -24,6 +25,7 @@ import com.mortals.xhx.module.sst.model.SstAppsEntity;
import
com.mortals.xhx.module.sst.service.SstAppsDeskService
;
import
com.mortals.xhx.module.sst.service.SstAppsService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -159,7 +161,21 @@ public class SstBasicController extends BaseCRUDJsonBodyMappingController<SstBas
throw
new
AppException
(
"获取用户站点列表树数据失败:"
+
apiResp
.
getMsg
());
}
if
(
apiResp
.
getData
().
get
(
"siteTree"
)
!=
null
)
{
model
.
put
(
"data"
,
apiResp
.
getData
().
get
(
"siteTree"
));
List
<
SiteTreeSelectVO
>
resultList
=
JSONObject
.
parseArray
(
apiResp
.
getData
().
get
(
"siteTree"
).
toString
(),
SiteTreeSelectVO
.
class
);
SiteTreeSelectVO
rootNode
=
new
SiteTreeSelectVO
();
rootNode
.
setId
(
"6182157d00ce41559e001a89d87f4057"
);
rootNode
.
setAreaCode
(
"510000000000"
);
rootNode
.
setLabel
(
"四川省"
);
rootNode
.
setType
(
"area"
);
rootNode
.
setIcon
(
"el-icon-folder"
);
rootNode
.
setIsLeaf
(
false
);
rootNode
.
setLatitude
(
"30.595081"
);
rootNode
.
setLongitude
(
"104.062983"
);
rootNode
.
setSiteCount
(
getChildrenCount
(
resultList
)-
1
);
rootNode
.
setChildren
(
resultList
);
List
<
SiteTreeSelectVO
>
dataList
=
new
ArrayList
<>();
dataList
.
add
(
rootNode
);
model
.
put
(
"data"
,
dataList
);
}
else
{
model
.
put
(
"data"
,
Collections
.
emptyList
());
}
...
...
@@ -177,6 +193,20 @@ public class SstBasicController extends BaseCRUDJsonBodyMappingController<SstBas
return
ret
;
}
private
static
Integer
getChildrenCount
(
List
<
SiteTreeSelectVO
>
children
){
if
(
CollectionUtils
.
isEmpty
(
children
))
{
return
1
;
}
else
{
int
size
=
1
;
for
(
SiteTreeSelectVO
vo:
children
){
int
c
=
getChildrenCount
(
vo
.
getChildren
());
vo
.
setSiteCount
(
c
);
size
+=
c
;
}
return
size
;
}
}
@PostMapping
({
"site/list"
})
public
Rest
<
Object
>
list
()
{
IUser
user
=
this
.
getCurUser
();
...
...
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