Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
25eeef38
Commit
25eeef38
authored
Jan 24, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加/idx/table/getPage前置权限控制接口
parent
3349e2e3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
0 deletions
+98
-0
IdxBizTableController.java
...ot/module/jxiop/biz/controller/IdxBizTableController.java
+33
-0
IIdxBizTableService.java
...os/boot/module/jxiop/biz/service/IIdxBizTableService.java
+14
-0
IdxBizTableServiceImpl.java
...module/jxiop/biz/service/impl/IdxBizTableServiceImpl.java
+44
-0
IdxFeign.java
...om/yeejoin/amos/boot/module/jxiop/api/feign/IdxFeign.java
+7
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/IdxBizTableController.java
0 → 100644
View file @
25eeef38
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IIdxBizTableService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Map
;
@RestController
@Api
(
tags
=
"idx业务前置接口"
)
@RequestMapping
(
value
=
"/idx"
)
public
class
IdxBizTableController
{
@Autowired
IIdxBizTableService
idxBizTableService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询业务事实表的数据"
,
notes
=
"分页查询业务事实表的数据-IDX前置接口"
)
@GetMapping
(
value
=
"/table/getPage"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getTablePage
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
idxBizTableService
.
getPage
(
map
));
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/IIdxBizTableService.java
0 → 100644
View file @
25eeef38
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.Map
;
public
interface
IIdxBizTableService
{
/**
* 分页查询业务事实表的数据-IDX(/idx/table/getPage)前置接口, 增加权限控制
*
* @param map 查询参数
*/
Page
<
Map
<
String
,
Object
>>
getPage
(
Map
<
String
,
Object
>
map
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/IdxBizTableServiceImpl.java
0 → 100644
View file @
25eeef38
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.api.feign.IdxFeign
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IIdxBizTableService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
@Service
@Slf4j
public
class
IdxBizTableServiceImpl
implements
IIdxBizTableService
{
@Autowired
private
IPermissionService
permissionService
;
@Autowired
private
IdxFeign
idxFeign
;
/**
* 分页查询业务事实表的数据-IDX(/idx/table/getPage)前置接口, 增加权限控制
*
* @param map 查询参数
*/
public
Page
<
Map
<
String
,
Object
>>
getPage
(
Map
<
String
,
Object
>
map
)
{
List
<
String
>
currentUserPermissions
=
permissionService
.
getCurrentUserPermissions
();
if
(
Objects
.
isNull
(
currentUserPermissions
))
{
currentUserPermissions
=
new
ArrayList
<>();
}
String
gatewayIds
=
String
.
join
(
","
,
currentUserPermissions
);
if
(!
gatewayIds
.
isEmpty
())
{
map
.
put
(
"GATEWAY_ID"
,
String
.
format
(
"[%s]"
,
gatewayIds
));
}
FeignClientResult
<
Page
<
Map
<
String
,
Object
>>>
page
=
idxFeign
.
getPage
(
map
);
return
page
.
getResult
();
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/feign/IdxFeign.java
View file @
25eeef38
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
feign
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -17,4 +18,10 @@ public interface IdxFeign {
FeignClientResult
<
Map
<
String
,
Object
>>
healthIndexData
(
@RequestParam
(
required
=
false
,
value
=
"parentCode"
)
String
parentCode
,
@RequestParam
(
required
=
false
,
value
=
"stationType"
)
String
stationType
);
/**
* 分页查询业务事实表的数据
*/
@GetMapping
(
"/table/getPage"
)
FeignClientResult
<
Page
<
Map
<
String
,
Object
>>>
getPage
(
@RequestParam
Map
<
String
,
Object
>
map
);
}
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