REQ-3581: 下载合同
This commit is contained in:
parent
552d25bd28
commit
18712e1cba
@ -19,13 +19,4 @@ public class GetOrgAuthStatesResponse {
|
|||||||
*/
|
*/
|
||||||
private boolean isAuthorized;
|
private boolean isAuthorized;
|
||||||
|
|
||||||
/**
|
|
||||||
* 单位创建人id
|
|
||||||
*/
|
|
||||||
private Long createByPersonId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 单位创建人姓名
|
|
||||||
*/
|
|
||||||
private String createByPersonName;
|
|
||||||
}
|
}
|
||||||
@ -34,9 +34,7 @@ import java.util.Collections;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static java.util.Collections.emptyList;
|
import static java.util.Collections.emptyList;
|
||||||
import static java.util.function.Function.identity;
|
import static java.util.function.Function.identity;
|
||||||
@ -59,26 +57,16 @@ public class QueryService {
|
|||||||
|
|
||||||
public List<GetOrgAuthStatesResponse> getOrgAuthStates(GetOrgAuthStatesRequest request) {
|
public List<GetOrgAuthStatesResponse> getOrgAuthStates(GetOrgAuthStatesRequest request) {
|
||||||
List<EssOrg> orgs = essOrgDao.getByOuIds(request.getOuIds());
|
List<EssOrg> orgs = essOrgDao.getByOuIds(request.getOuIds());
|
||||||
List<Long> creatorPersonIds = orgs.stream()
|
|
||||||
.map(EssOrg::getCreateByPersonId)
|
|
||||||
.filter(Objects::nonNull)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
PersonProfiles personProfiles = PersonProfiles.wrap(essSupport.getPersonProfiles(creatorPersonIds));
|
|
||||||
ArrayList<GetOrgAuthStatesResponse> responses = new ArrayList<>();
|
ArrayList<GetOrgAuthStatesResponse> responses = new ArrayList<>();
|
||||||
for (Long ouId : request.getOuIds()) {
|
for (Long ouId : request.getOuIds()) {
|
||||||
EssOrg org = orgs.stream()
|
|
||||||
.filter(o -> o.getOuId().equals(ouId))
|
|
||||||
.findFirst()
|
|
||||||
.orElse(null);
|
|
||||||
GetOrgAuthStatesResponse response = new GetOrgAuthStatesResponse();
|
GetOrgAuthStatesResponse response = new GetOrgAuthStatesResponse();
|
||||||
responses.add(response);
|
responses.add(response);
|
||||||
response.setOuId(ouId);
|
response.setOuId(ouId);
|
||||||
response.setAuthorized(org != null && org.isAuthorized());
|
response.setAuthorized(orgs.stream()
|
||||||
response.setCreateByPersonId(org == null ? null : org.getCreateByPersonId());
|
.filter(org -> org.getOuId().equals(ouId))
|
||||||
if (response.getCreateByPersonId() != null) {
|
.map(EssOrg::isAuthorized)
|
||||||
PersonProfileDto person = personProfiles.findOrNull(response.getCreateByPersonId());
|
.findFirst()
|
||||||
response.setCreateByPersonName(person == null ? "" : person.getRealName());
|
.orElse(false));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return responses;
|
return responses;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user