Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fill-system
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
廖旭伟
fill-system
Commits
4a061395
Commit
4a061395
authored
Nov 22, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构部分功能模块
parent
bccdb0a5
Pipeline
#2323
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
fill-manager/src/main/java/com/mortals/xhx/module/home/web/HomeController.java
.../java/com/mortals/xhx/module/home/web/HomeController.java
+21
-15
No files found.
fill-manager/src/main/java/com/mortals/xhx/module/home/web/HomeController.java
View file @
4a061395
...
...
@@ -16,6 +16,7 @@ import com.mortals.xhx.feign.base.IApiBaseManagerFeign;
import
com.mortals.xhx.feign.base.pdu.DeptPdu
;
import
com.mortals.xhx.feign.base.pdu.SitePdu
;
import
com.mortals.xhx.feign.rsp.ApiResp
;
import
com.mortals.xhx.feign.site.ISiteFeign
;
import
com.mortals.xhx.module.home.pdu.HomeQueryPdu
;
import
com.mortals.xhx.module.hotword.model.HotwordEntity
;
import
com.mortals.xhx.module.hotword.model.HotwordQuery
;
...
...
@@ -26,6 +27,7 @@ import com.mortals.xhx.module.matter.model.MatterEntity;
import
com.mortals.xhx.module.matter.model.MatterQuery
;
import
com.mortals.xhx.module.matter.service.MatterDatumService
;
import
com.mortals.xhx.module.matter.service.MatterService
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -47,26 +49,28 @@ public class HomeController extends BaseJsonBodyController {
private
MatterService
matterService
;
@Autowired
private
HotwordService
hotwordService
;
@Autowired
private
ISiteFeign
siteFeign
;
@PostMapping
({
"site/list"
})
public
Rest
<
Object
>
list
()
{
IUser
user
=
this
.
getCurUser
();
if
(
user
==
null
)
{
if
(
user
==
null
)
{
throw
new
AppException
(
"用户未登录"
);
}
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
String
busiDesc
=
"查询用户站点列表"
;
String
busiDesc
=
"查询用户站点列表"
;
int
code
=
1
;
int
code
=
1
;
try
{
if
(
StringUtils
.
isNotEmpty
(
user
.
getSiteIds
()))
{
if
(
StringUtils
.
isNotEmpty
(
user
.
getSiteIds
()))
{
SitePdu
sitePdu
=
new
SitePdu
();
List
<
String
>
siteIds
=
Arrays
.
asList
(
user
.
getSiteIds
().
split
(
","
));
List
<
Long
>
idList
=
new
ArrayList
<>();
siteIds
.
forEach
(
s
->
{
idList
.
add
(
DataUtil
.
converStr2Long
(
s
,
0
));
idList
.
add
(
DataUtil
.
converStr2Long
(
s
,
0
));
});
sitePdu
.
setIdList
(
idList
);
String
resp
=
iApiBaseManagerFeign
.
getSitesByQuery
(
sitePdu
);
...
...
@@ -74,12 +78,12 @@ public class HomeController extends BaseJsonBodyController {
if
(
apiResp
.
getCode
()
!=
YesNoEnum
.
YES
.
getValue
())
{
throw
new
AppException
(
"获取用户站点列表树数据失败:"
+
apiResp
.
getMsg
());
}
if
(
apiResp
.
getData
().
get
(
"data"
)!=
null
)
{
if
(
apiResp
.
getData
().
get
(
"data"
)
!=
null
)
{
model
.
put
(
"data"
,
apiResp
.
getData
().
get
(
"data"
));
}
else
{
}
else
{
model
.
put
(
"data"
,
Collections
.
emptyList
());
}
}
else
{
}
else
{
model
.
put
(
"data"
,
Collections
.
emptyList
());
}
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
...
...
@@ -105,10 +109,10 @@ public class HomeController extends BaseJsonBodyController {
// }
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
String
busiDesc
=
"查询站点部门列表"
;
int
code
=
1
;
String
busiDesc
=
"查询站点部门列表"
;
int
code
=
1
;
try
{
if
(
queryPdu
.
getSiteId
()!=
null
)
{
if
(
queryPdu
.
getSiteId
()
!=
null
)
{
DeptPdu
deptPdu
=
new
DeptPdu
();
deptPdu
.
setSiteId
(
queryPdu
.
getSiteId
());
deptPdu
.
setSize
(-
1
);
...
...
@@ -117,12 +121,12 @@ public class HomeController extends BaseJsonBodyController {
if
(
apiResp
.
getCode
()
!=
YesNoEnum
.
YES
.
getValue
())
{
throw
new
AppException
(
"获取用户站点部门列表失败:"
+
apiResp
.
getMsg
());
}
if
(
apiResp
.
getData
().
get
(
"data"
)!=
null
)
{
if
(
apiResp
.
getData
().
get
(
"data"
)
!=
null
)
{
model
.
put
(
"data"
,
apiResp
.
getData
().
get
(
"data"
));
}
else
{
}
else
{
model
.
put
(
"data"
,
Collections
.
emptyList
());
}
}
else
{
}
else
{
model
.
put
(
"data"
,
Collections
.
emptyList
());
}
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
...
...
@@ -177,7 +181,7 @@ public class HomeController extends BaseJsonBodyController {
try
{
List
<
String
>
hotwordEntities
=
hotwordService
.
find
(
new
HotwordQuery
().
siteId
(
homeQueryPdu
.
getSiteId
())).
stream
()
.
map
(
HotwordEntity:
:
getHotwords
)
.
flatMap
(
item
->
StrUtil
.
split
(
item
,
","
.
charAt
(
0
)).
stream
())
.
flatMap
(
item
->
StrUtil
.
split
(
item
,
","
.
charAt
(
0
)).
stream
())
.
collect
(
Collectors
.
toList
());
model
.
put
(
"hotWords"
,
hotwordEntities
);
MatterQuery
matterQuery
=
new
MatterQuery
();
...
...
@@ -199,6 +203,8 @@ public class HomeController extends BaseJsonBodyController {
model
.
put
(
"onlineSubmit"
,
20
);
//在线提交数量
model
.
put
(
"dayThrift"
,
66
);
//今日节约
model
.
put
(
"totalThrift"
,
996
);
//累计节约
Rest
<
com
.
mortals
.
xhx
.
common
.
pdu
.
site
.
SitePdu
>
info
=
siteFeign
.
info
(
homeQueryPdu
.
getSiteId
());
model
.
put
(
"title"
,
info
.
getData
().
getSiteName
());
//标题
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
var9
)
{
...
...
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