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
79afe702
Commit
79afe702
authored
Jul 18, 2023
by
leizhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化电站管理列表接口,区分经销商和管理员角色查询
parent
04a4e56f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
PowerStationController.java
...ot/module/hygf/biz/controller/PowerStationController.java
+15
-4
PowerStationServiceImpl.java
...module/hygf/biz/service/impl/PowerStationServiceImpl.java
+4
-2
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/PowerStationController.java
View file @
79afe702
...
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationDto
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.PowerStationServiceImpl
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -10,6 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -20,7 +23,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
*
*
*
* @author system_generator
* @date 2023-07-15
...
...
@@ -96,12 +99,20 @@ public class PowerStationController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
public
ResponseModel
<
Page
<
PowerStationDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
public
ResponseModel
<
Page
<
PowerStationDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"powerStationCode"
,
required
=
false
)
String
powerStationCode
,
@RequestParam
(
value
=
"ownersName"
,
required
=
false
)
String
ownersName
)
{
Page
<
PowerStationDto
>
page
=
new
Page
<
PowerStationDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
powerStationServiceImpl
.
queryForPowerStationPage
(
page
));
String
serviceAgent
=
""
;
AgencyUserModel
userInfo
=
getUserInfo
();
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
userInfo
.
getOrgRoles
();
List
<
RoleModel
>
roleModels
=
orgRoles
.
get
(
userInfo
.
getCompanys
().
get
(
0
).
getSequenceNbr
());
List
<
String
>
roleTypes
=
roleModels
.
stream
().
map
(
RoleModel:
:
getRoleType
).
collect
(
Collectors
.
toList
());
serviceAgent
=
!
roleTypes
.
contains
(
"HYGFGLY"
)
?
roleTypes
.
contains
(
"HYGFJXS"
)
?
userInfo
.
getCompanys
().
get
(
0
).
getCompanyName
()
:
null
:
null
;
return
ResponseHelper
.
buildResponse
(
powerStationServiceImpl
.
queryForPowerStationPage
(
page
,
powerStationCode
,
ownersName
,
serviceAgent
));
}
/**
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PowerStationServiceImpl.java
View file @
79afe702
...
...
@@ -30,6 +30,8 @@ import org.apache.commons.lang.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.rdbms.annotation.Condition
;
import
org.typroject.tyboot.core.rdbms.annotation.Operator
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -71,8 +73,8 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
/**
* 分页查询
*/
public
Page
<
PowerStationDto
>
queryForPowerStationPage
(
Page
<
PowerStationDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
public
Page
<
PowerStationDto
>
queryForPowerStationPage
(
Page
<
PowerStationDto
>
page
,
@Condition
(
Operator
.
like
)
String
powerStationCode
,
@Condition
(
Operator
.
like
)
String
ownersName
,
String
serviceAgent
)
{
return
this
.
queryForPage
(
page
,
null
,
false
,
powerStationCode
,
ownersName
,
serviceAgent
);
}
/**
...
...
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