REQ-3581: 返回单位认证人信息
This commit is contained in:
parent
1a484c2c2d
commit
23d0cea896
@ -4,12 +4,6 @@ import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@ -42,9 +36,4 @@ public enum EssContractState {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<EssContractState> collectFinalStates() {
|
||||
return Arrays.stream(values())
|
||||
.filter(EssContractState::isFinalState)
|
||||
.collect(toList());
|
||||
}
|
||||
}
|
||||
@ -20,8 +20,12 @@ public class GetOrgAuthStatesResponse {
|
||||
private boolean isAuthorized;
|
||||
|
||||
/**
|
||||
* 单位创建人id, 可能为空
|
||||
* 单位创建人id
|
||||
*/
|
||||
private Long createByPersonId;
|
||||
|
||||
/**
|
||||
* 单位创建人姓名
|
||||
*/
|
||||
private String createByPersonName;
|
||||
}
|
||||
@ -1,8 +1,8 @@
|
||||
package cn.axzo.nanopart.ess.server.dao;
|
||||
|
||||
import cn.axzo.nanopart.ess.api.utils.YesOrNo;
|
||||
import cn.axzo.nanopart.ess.server.entity.EssOrg;
|
||||
import cn.axzo.nanopart.ess.server.mapper.EssOrgMapper;
|
||||
import cn.axzo.nanopart.ess.api.utils.YesOrNo;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@ -138,10 +138,6 @@ public class EssContract extends BaseEntity<EssContract> {
|
||||
.findFirst();
|
||||
}
|
||||
|
||||
public Constraint getAssignType() {
|
||||
return assignment == null ? null : assignment.getConstraint();
|
||||
}
|
||||
|
||||
public boolean isAllSignPersonPreset() {
|
||||
return approvers.stream().allMatch(Approver::isSignPersonPresent);
|
||||
}
|
||||
|
||||
@ -152,10 +152,8 @@ public class EssService {
|
||||
|
||||
public String getContractPDFUrl(String essContractId) {
|
||||
EssContract contract = essContractDao.getOrThrow(essContractId);
|
||||
if (essProps.isUseContractPdfOnOss()
|
||||
&& StringUtils.isNotBlank(contract.getOssFileKey())) {
|
||||
if (StringUtils.isNotBlank(contract.getOssFileKey()))
|
||||
return ossService.getOssUrl(contract.getOssFileKey());
|
||||
}
|
||||
maybeUploadContractToOss(contract);
|
||||
return getContractPDFUrlFromEss(contract);
|
||||
}
|
||||
|
||||
@ -34,7 +34,9 @@ import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
import static java.util.function.Function.identity;
|
||||
@ -57,6 +59,11 @@ public class QueryService {
|
||||
|
||||
public List<GetOrgAuthStatesResponse> getOrgAuthStates(GetOrgAuthStatesRequest request) {
|
||||
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<>();
|
||||
for (Long ouId : request.getOuIds()) {
|
||||
EssOrg org = orgs.stream()
|
||||
@ -66,8 +73,12 @@ public class QueryService {
|
||||
GetOrgAuthStatesResponse response = new GetOrgAuthStatesResponse();
|
||||
responses.add(response);
|
||||
response.setOuId(ouId);
|
||||
response.setCreateByPersonId(org == null ? null : org.getCreateByPersonId());
|
||||
response.setAuthorized(org != null && org.isAuthorized());
|
||||
response.setCreateByPersonId(org == null ? null : org.getCreateByPersonId());
|
||||
if (response.getCreateByPersonId() != null) {
|
||||
PersonProfileDto person = personProfiles.findOrNull(response.getCreateByPersonId());
|
||||
response.setCreateByPersonName(person == null ? "" : person.getRealName());
|
||||
}
|
||||
}
|
||||
return responses;
|
||||
}
|
||||
|
||||
@ -28,8 +28,6 @@ public class EssProps {
|
||||
|
||||
private boolean testEnv;
|
||||
|
||||
private boolean useContractPdfOnOss = true;
|
||||
|
||||
private String ossAppCode = "elec-signature-contract";
|
||||
|
||||
private String ossBizScene = "elec-signature-contract";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user