REQ-3581: 备份
This commit is contained in:
parent
f2559b8d11
commit
748e1db083
@ -0,0 +1,12 @@
|
||||
package cn.axzo.nanopart.ess.api.domain;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public interface OrgPerson {
|
||||
|
||||
Long getOuId();
|
||||
|
||||
Long getPersonId();
|
||||
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package cn.axzo.nanopart.ess.api.request;
|
||||
|
||||
import cn.axzo.nanopart.ess.api.domain.OrgPerson;
|
||||
import cn.axzo.nanopart.ess.api.enums.EssSealType;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Getter;
|
||||
@ -60,7 +61,7 @@ public class CreateContractInfo {
|
||||
}
|
||||
|
||||
@Setter @Getter
|
||||
public static class ApproverInfo {
|
||||
public static class ApproverInfo implements OrgPerson {
|
||||
|
||||
/**
|
||||
* 签署方单位id
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package cn.axzo.nanopart.ess.server.entity;
|
||||
|
||||
import cn.axzo.nanopart.ess.api.domain.OrgPerson;
|
||||
import cn.axzo.nanopart.ess.server.utils.YesOrNo;
|
||||
import cn.axzo.pokonyan.config.mybatisplus.BaseEntity;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@ -15,7 +16,7 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@Getter
|
||||
@TableName(value = "ess_person", autoResultMap = true)
|
||||
public class EssPerson extends BaseEntity<EssPerson> {
|
||||
public class EssPerson extends BaseEntity<EssPerson> implements OrgPerson {
|
||||
|
||||
/**
|
||||
* 单位id
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package cn.axzo.nanopart.ess.server.entity;
|
||||
|
||||
import cn.axzo.nanopart.ess.api.domain.OrgPerson;
|
||||
import cn.axzo.nanopart.ess.server.utils.YesOrNo;
|
||||
import cn.axzo.pokonyan.config.mybatisplus.BaseEntity;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@ -15,7 +16,7 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@Getter
|
||||
@TableName(value = "ess_seal_person", autoResultMap = true)
|
||||
public class EssSealPerson extends BaseEntity<EssSealPerson> {
|
||||
public class EssSealPerson extends BaseEntity<EssSealPerson> implements OrgPerson {
|
||||
|
||||
/**
|
||||
* 单位id
|
||||
|
||||
@ -145,9 +145,7 @@ public class EssClient implements InitializingBean {
|
||||
ChannelCreateSealPolicyRequest request = new ChannelCreateSealPolicyRequest();
|
||||
request.setAgent(agent(superAdmin));
|
||||
request.setSealId(seal.getEssSealId());
|
||||
request.setUserIds(new String[]{
|
||||
PersonOpenId.create(sealPerson.getOuId(), sealPerson.getPersonId()).toOpenId()
|
||||
});
|
||||
request.setUserIds(new String[]{PersonOpenId.create(sealPerson).toOpenId()});
|
||||
exec(func()
|
||||
.context("ChannelCreateSealPolicy")
|
||||
.subject(IdBuilder.builder()
|
||||
@ -162,9 +160,7 @@ public class EssClient implements InitializingBean {
|
||||
ChannelDeleteSealPoliciesRequest request = new ChannelDeleteSealPoliciesRequest();
|
||||
request.setAgent(agent(superAdmin));
|
||||
request.setSealId(seal.getEssSealId());
|
||||
request.setUserIds(new String[]{
|
||||
PersonOpenId.create(sealPerson.getOuId(), sealPerson.getPersonId()).toOpenId()
|
||||
});
|
||||
request.setUserIds(new String[]{PersonOpenId.create(sealPerson).toOpenId()});
|
||||
exec(func()
|
||||
.context("ChannelDeleteSealPolicies")
|
||||
.subject(IdBuilder.builder()
|
||||
@ -230,9 +226,9 @@ public class EssClient implements InitializingBean {
|
||||
approvers.add(approver);
|
||||
approver.setName(personProfile.getRealName());
|
||||
approver.setMobile(personProfile.getPhone());
|
||||
approver.setOpenId(PersonOpenId.create(approverInfo.getOuId(), approverInfo.getPersonId()).toOpenId());
|
||||
approver.setOpenId(PersonOpenId.create(approverInfo).toOpenId());
|
||||
approver.setOrganizationName(orgProfile.getName());
|
||||
approver.setOrganizationOpenId(OuOpenId.create(approverInfo.getOuId()).toOpenId());
|
||||
approver.setOrganizationOpenId(OuOpenId.ofPerson(approverInfo).toOpenId());
|
||||
approver.setApproverType(approverInfo.getApproverType().name());
|
||||
approver.setNotifyType("NONE");
|
||||
approver.setPreReadTime(approverInfo.getPreReadTimeSeconds());
|
||||
@ -280,7 +276,7 @@ public class EssClient implements InitializingBean {
|
||||
ChannelCreateOrganizationBatchSignUrlRequest request = new ChannelCreateOrganizationBatchSignUrlRequest();
|
||||
request.setAgent(agent(signPerson));
|
||||
request.setFlowIds(new String[]{essContractId});
|
||||
request.setOpenId(PersonOpenId.create(signPerson.getOuId(), signPerson.getPersonId()).toOpenId());
|
||||
request.setOpenId(PersonOpenId.create(signPerson).toOpenId());
|
||||
ChannelCreateOrganizationBatchSignUrlResponse response = exec(func()
|
||||
.context("ChannelCreateOrganizationBatchSignUrl")
|
||||
.subject(essContractId)
|
||||
@ -293,7 +289,7 @@ public class EssClient implements InitializingBean {
|
||||
CreateSignUrlsRequest request = new CreateSignUrlsRequest();
|
||||
request.setAgent(agent(signPerson));
|
||||
request.setFlowIds(new String[]{essContractId});
|
||||
request.setOpenId(PersonOpenId.create(signPerson.getOuId(), signPerson.getPersonId()).toOpenId());
|
||||
request.setOpenId(PersonOpenId.create(signPerson).toOpenId());
|
||||
CreateSignUrlsResponse response = exec(func()
|
||||
.context("CreateSignUrls")
|
||||
.subject(essContractId)
|
||||
@ -319,8 +315,8 @@ public class EssClient implements InitializingBean {
|
||||
UserInfo userInfo = new UserInfo();
|
||||
agent.setAppId(props.getAppId());
|
||||
agent.setProxyAppId("");
|
||||
agent.setProxyOrganizationOpenId(OuOpenId.create(person.getOuId()).toOpenId());
|
||||
userInfo.setOpenId(PersonOpenId.create(person.getOuId(), person.getPersonId()).toOpenId());
|
||||
agent.setProxyOrganizationOpenId(OuOpenId.ofPerson(person).toOpenId());
|
||||
userInfo.setOpenId(PersonOpenId.create(person).toOpenId());
|
||||
agent.setProxyOperator(userInfo);
|
||||
return agent;
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package cn.axzo.nanopart.ess.server.ess.domain;
|
||||
|
||||
import cn.axzo.nanopart.ess.api.domain.OrgPerson;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -13,6 +14,10 @@ public class OuOpenId {
|
||||
|
||||
private final Long ouId;
|
||||
|
||||
public static OuOpenId ofPerson(OrgPerson person) {
|
||||
return create(person.getOuId());
|
||||
}
|
||||
|
||||
public static OuOpenId create(Long ouId) {
|
||||
return new OuOpenId(ouId);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package cn.axzo.nanopart.ess.server.ess.domain;
|
||||
|
||||
import cn.axzo.nanopart.ess.api.domain.OrgPerson;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -20,6 +21,10 @@ public class PersonOpenId {
|
||||
return NONE;
|
||||
}
|
||||
|
||||
public static PersonOpenId create(OrgPerson person) {
|
||||
return create(person.getOuId(), person.getPersonId());
|
||||
}
|
||||
|
||||
public static PersonOpenId create(Long ouId, Long personId) {
|
||||
return new PersonOpenId(ouId, personId);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user