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
163131d0
Commit
163131d0
authored
Feb 21, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
58565875
b2238d9d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
0 deletions
+72
-0
sst-manager/src/main/java/com/mortals/xhx/module/sst/service/SstAppsService.java
...va/com/mortals/xhx/module/sst/service/SstAppsService.java
+8
-0
sst-manager/src/main/java/com/mortals/xhx/module/sst/service/impl/SstAppsServiceImpl.java
...rtals/xhx/module/sst/service/impl/SstAppsServiceImpl.java
+33
-0
sst-manager/src/main/java/com/mortals/xhx/module/sst/web/SstBasicController.java
...va/com/mortals/xhx/module/sst/web/SstBasicController.java
+31
-0
No files found.
sst-manager/src/main/java/com/mortals/xhx/module/sst/service/SstAppsService.java
View file @
163131d0
...
...
@@ -2,6 +2,7 @@ package com.mortals.xhx.module.sst.service;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.apps.model.AppsInfoEntity
;
import
com.mortals.xhx.module.sst.model.SstAppsEntity
;
import
java.util.List
;
...
...
@@ -31,4 +32,11 @@ public interface SstAppsService extends ICRUDService<SstAppsEntity,Long>{
* @throws AppException
*/
void
settingSave
(
Long
siteId
,
String
showAppIds
,
String
hotAppIds
,
Context
context
)
throws
AppException
;
/***
* 获取站点热门应用or展示应用
* @param siteId 站点ID
* @return
*/
Map
<
String
,
Object
>
getAppListBySite
(
Long
siteId
);
}
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/sst/service/impl/SstAppsServiceImpl.java
View file @
163131d0
...
...
@@ -15,6 +15,7 @@ import com.mortals.xhx.module.sst.model.SstAppsEntity;
import
com.mortals.xhx.module.sst.service.SstAppsService
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -133,4 +134,36 @@ public class SstAppsServiceImpl extends AbstractCRUDServiceImpl<SstAppsDao, SstA
this
.
dao
.
insertBatch
(
list
);
}
}
@Override
public
Map
<
String
,
Object
>
getAppListBySite
(
Long
siteId
)
{
SstAppsEntity
query
=
new
SstAppsEntity
();
query
.
setSiteId
(
siteId
);
List
<
SstAppsEntity
>
appsEntities
=
this
.
find
(
query
);
AppsInfoEntity
appsInfoQuery
=
new
AppsInfoEntity
();
appsInfoQuery
.
setSiteId
(
siteId
);
List
<
AppsInfoEntity
>
allApps
=
appsInfoService
.
find
(
appsInfoQuery
);
Map
<
Long
,
AppsInfoEntity
>
appInfoMap
=
allApps
.
stream
().
collect
(
Collectors
.
toMap
(
AppsInfoEntity:
:
getId
,
Function
.
identity
()));
Map
<
String
,
Object
>
siteApp
=
new
HashMap
<>();
siteApp
.
put
(
"allApps"
,
allApps
);
if
(
CollectionUtils
.
isNotEmpty
(
appsEntities
)){
List
<
AppsInfoEntity
>
showApps
=
new
ArrayList
<>();
List
<
AppsInfoEntity
>
hotApps
=
new
ArrayList
<>();
for
(
SstAppsEntity
sstAppsEntity:
appsEntities
){
if
(
sstAppsEntity
.
getShowBasic
()==
1
){
showApps
.
add
(
appInfoMap
.
get
(
sstAppsEntity
.
getAppId
()));
}
if
(
sstAppsEntity
.
getShowHot
()==
1
){
hotApps
.
add
(
appInfoMap
.
get
(
sstAppsEntity
.
getAppId
()));
}
}
siteApp
.
put
(
"showApps"
,
showApps
);
siteApp
.
put
(
"hotApps"
,
hotApps
);
}
else
{
siteApp
.
put
(
"showApps"
,
Collections
.
emptyList
());
siteApp
.
put
(
"hotApps"
,
Collections
.
emptyList
());
}
return
siteApp
;
}
}
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/sst/web/SstBasicController.java
View file @
163131d0
package
com.mortals.xhx.module.sst.web
;
import
com.alibaba.fastjson.JSON
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.IUser
;
...
...
@@ -204,4 +205,34 @@ public class SstBasicController extends BaseCRUDJsonBodyMappingController<SstBas
return
ret
;
}
@PostMapping
({
"site/apps"
})
@UnAuth
public
Rest
<
Object
>
showApps
(
@RequestBody
SstBasicEntity
query
)
{
// IUser user = this.getCurUser();
// if(user==null){
// throw new AppException("用户未登录");
// }
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
String
busiDesc
=
"查询自助终端应用展示数据"
;
int
code
=
1
;
try
{
Map
<
String
,
Object
>
sstApps
=
sstAppsService
.
getAppListBySite
(
query
.
getSiteId
());
model
.
put
(
"showApps"
,
sstApps
.
get
(
"showApps"
));
model
.
put
(
"hotApps"
,
sstApps
.
get
(
"hotApps"
));
model
.
put
(
"allApps"
,
sstApps
.
get
(
"allApps"
));
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
var9
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var9
);
}
ret
.
setCode
(
code
);
ret
.
setData
(
model
);
ret
.
setDict
(
model
.
get
(
"dict"
));
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
}
\ No newline at end of file
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