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
938b7331
Commit
938b7331
authored
Jul 19, 2023
by
leizhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化:电站管理列表,根据用户角色查询接口报错的问题
parent
ec8f258a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
18 deletions
+30
-18
PowerStationController.java
...ot/module/hygf/biz/controller/PowerStationController.java
+4
-6
PowerStationServiceImpl.java
...module/hygf/biz/service/impl/PowerStationServiceImpl.java
+26
-12
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 @
938b7331
...
...
@@ -10,6 +10,9 @@ import io.swagger.annotations.ApiOperation;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -106,13 +109,8 @@ public class PowerStationController extends BaseController {
Page
<
PowerStationDto
>
page
=
new
Page
<
PowerStationDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
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
));
return
ResponseHelper
.
buildResponse
(
powerStationServiceImpl
.
queryForPowerStationUserRoles
(
page
,
powerStationCode
,
ownersName
,
userInfo
));
}
/**
...
...
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 @
938b7331
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.FieldStrategy
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationNodeEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.WorkDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.DesignInformation
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.PowerStation
;
import
com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.DesignInformationMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.PeasantHouseholdMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.PowerStationMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IPowerStationService
;
import
com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient
;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IDesignInformationService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
lombok.extern.slf4j.Slf4j
;
import
net.sf.cglib.beans.BeanMap
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -35,9 +27,10 @@ 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
;
import
springfox.documentation.service.ApiListing
;
import
java.util.Date
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Iterator
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -70,6 +63,23 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
@Autowired
WorkflowFeignClient
workflowFeignClient
;
public
Page
<
PowerStationDto
>
queryForPowerStationUserRoles
(
Page
<
PowerStationDto
>
page
,
String
powerStationCode
,
String
ownersName
,
AgencyUserModel
userInfo
){
String
serviceAgent
=
""
;
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
userInfo
.
getOrgRoles
();
Collection
<
List
<
RoleModel
>>
roleModels
=
orgRoles
.
values
();
if
(
roleModels
!=
null
){
List
<
String
>
roleTypes
=
new
ArrayList
<>();
Iterator
<
List
<
RoleModel
>>
iterator
=
roleModels
.
iterator
();
while
(
iterator
.
hasNext
()){
List
<
RoleModel
>
next
=
iterator
.
next
();
roleTypes
.
addAll
(
next
.
stream
().
map
(
RoleModel:
:
getRoleType
).
collect
(
Collectors
.
toList
()));
}
if
(
roleTypes
.
size
()>
0
){
serviceAgent
=
!
roleTypes
.
contains
(
"HYGFGLY"
)
?
roleTypes
.
contains
(
"HYGFJXS"
)
?
userInfo
.
getCompanys
().
get
(
0
).
getCompanyName
()
:
null
:
null
;
}
}
return
this
.
queryForPowerStationPage
(
page
,
powerStationCode
,
ownersName
,
serviceAgent
);
}
/**
* 分页查询
*/
...
...
@@ -268,5 +278,8 @@ public void updateSeve(String peasantHouseholdId, Map<String, Object> kv ){
}
// private CollectionToList(Collection<? extends E> c){
// Object[] objects = c.toArray();
// }
}
\ 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