|
@@ -89,8 +89,7 @@ public class ESignServiceImpl implements IESignService {
|
|
|
@Override
|
|
|
public boolean getOrgIdentityInfos(String orgCode) throws EsignDemoException {
|
|
|
SysDepart sysDepart = sysDepartMapper.selectOne(Wrappers.<SysDepart>lambdaQuery().eq(SysDepart::getOrgCode, orgCode));
|
|
|
- AppSite appSite = appSiteMapper.selectOne(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getOrgCode, orgCode));
|
|
|
- if(appSite == null) return false;
|
|
|
+ if(sysDepart == null) return false;
|
|
|
EsignHttpResponse getOrgIdentityInfo = getOrgIdentityInfo(sysDepart.getDepartName());
|
|
|
JsonObject getOrgIdentityInfoObject = gson.fromJson(getOrgIdentityInfo.getBody(), JsonObject.class);
|
|
|
JsonElement dataElement = getOrgIdentityInfoObject.get("data");
|
|
@@ -104,9 +103,9 @@ public class ESignServiceImpl implements IESignService {
|
|
|
String orgId = dataObj.get("orgId").getAsString();
|
|
|
JsonObject jsonObject = dataObj.get("orgInfo").getAsJsonObject();
|
|
|
String orgIDCardNum = jsonObject.get("orgIDCardNum").getAsString();
|
|
|
- appSite.setEsignOrgId(orgId);
|
|
|
- appSite.setOrgIdCardNum(orgIDCardNum);
|
|
|
- appSiteMapper.updateById(appSite);
|
|
|
+ sysDepart.setEsignOrgId(orgId);
|
|
|
+ sysDepart.setOrgIdCardNum(orgIDCardNum);
|
|
|
+ sysDepartMapper.updateById(sysDepart);
|
|
|
return orgRealnameStatus.equals("1");
|
|
|
}
|
|
|
|
|
@@ -196,7 +195,6 @@ public class ESignServiceImpl implements IESignService {
|
|
|
SysDepart sysDepart,
|
|
|
FamilyMembers familyMembers) throws EsignDemoException {
|
|
|
JsonObject dto = new JsonObject();
|
|
|
- AppSite appSite = appSiteMapper.selectOne(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getOrgCode, sysDepart.getOrgCode()));
|
|
|
// 构建文档信息
|
|
|
JsonArray docs = new JsonArray();
|
|
|
JsonObject doc = new JsonObject();
|
|
@@ -242,7 +240,7 @@ public class ESignServiceImpl implements IESignService {
|
|
|
// 发起人信息
|
|
|
JsonObject signFlowInitiator = new JsonObject();
|
|
|
JsonObject orgInitiator = new JsonObject();
|
|
|
- orgInitiator.addProperty("orgId", appSite.getEsignOrgId());
|
|
|
+ orgInitiator.addProperty("orgId", sysDepart.getEsignOrgId());
|
|
|
|
|
|
JsonObject transactor = new JsonObject();
|
|
|
transactor.addProperty("psnId", familyMembers.getPsnId());
|
|
@@ -253,7 +251,7 @@ public class ESignServiceImpl implements IESignService {
|
|
|
dto.add("signFlowInitiator", signFlowInitiator);
|
|
|
|
|
|
// 签署人信息
|
|
|
- dto.add("signers", buildSigners(contractInfo, familyMembers,appSite.getEsignOrgId()));
|
|
|
+ dto.add("signers", buildSigners(contractInfo, familyMembers,sysDepart.getEsignOrgId()));
|
|
|
|
|
|
return dto;
|
|
|
}
|
|
@@ -509,11 +507,11 @@ public class ESignServiceImpl implements IESignService {
|
|
|
@Override
|
|
|
public List<SealInfoDTO> orgOwnSeal(String orgCode) {
|
|
|
List<SealInfoDTO> sealInfoDTOLists = new ArrayList<>();
|
|
|
- List<AppSite> appSites = appSiteMapper.selectList(Wrappers.<AppSite>lambdaQuery().like(AppSite::getOrgCode, orgCode));
|
|
|
- appSites.forEach(appSite -> {
|
|
|
+ List<SysDepart> sysDeparts = sysDepartMapper.selectList(Wrappers.<SysDepart>lambdaQuery().like(SysDepart::getOrgCode, orgCode));
|
|
|
+ sysDeparts.forEach(sysDepart -> {
|
|
|
try {
|
|
|
// 调用API获取响应
|
|
|
- EsignHttpResponse response = orgOwnSealList(appSite.getEsignOrgId());
|
|
|
+ EsignHttpResponse response = orgOwnSealList(sysDepart.getEsignOrgId());
|
|
|
|
|
|
// 解析JSON响应
|
|
|
JsonObject result = gson.fromJson(response.getBody(), JsonObject.class);
|
|
@@ -543,7 +541,7 @@ public class ESignServiceImpl implements IESignService {
|
|
|
a.setOrgCode(orgCode);
|
|
|
try {
|
|
|
// 调用接口获取授权信息
|
|
|
- EsignHttpResponse response1 = orgSealsExternalAuth(appSite.getEsignOrgId(), a.getSealId());
|
|
|
+ EsignHttpResponse response1 = orgSealsExternalAuth(sysDepart.getEsignOrgId(), a.getSealId());
|
|
|
JsonObject result1 = gson.fromJson(response1.getBody(), JsonObject.class);
|
|
|
|
|
|
// 检查 data 字段
|
|
@@ -596,8 +594,8 @@ public class ESignServiceImpl implements IESignService {
|
|
|
|
|
|
@Override
|
|
|
public Boolean orgSealsExternal(String orgCode, String sealId) throws EsignDemoException {
|
|
|
- AppSite appSite = appSiteMapper.selectOne(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getOrgCode, orgCode));
|
|
|
- EsignHttpResponse administrators = administrators(appSite.getEsignOrgId());
|
|
|
+ SysDepart sysDepart = sysDepartMapper.selectOne(Wrappers.<SysDepart>lambdaQuery().eq(SysDepart::getOrgCode, orgCode));
|
|
|
+ EsignHttpResponse administrators = administrators(sysDepart.getEsignOrgId());
|
|
|
JsonObject administratorsObject = gson.fromJson(administrators.getBody(), JsonObject.class);
|
|
|
JsonObject data = administratorsObject.getAsJsonObject("data");
|
|
|
String psnId = null;
|
|
@@ -611,7 +609,7 @@ public class ESignServiceImpl implements IESignService {
|
|
|
}
|
|
|
}
|
|
|
ExternalAuthRequestDTO requestDTO = new ExternalAuthRequestDTO();
|
|
|
- requestDTO.setOrgId(appSite.getEsignOrgId());
|
|
|
+ requestDTO.setOrgId(sysDepart.getEsignOrgId());
|
|
|
requestDTO.setTransactorPsnId(psnId);
|
|
|
requestDTO.setLongTermEffective(true);
|
|
|
requestDTO.setSealIds(Collections.singletonList(sealId));
|
|
@@ -679,7 +677,7 @@ public class ESignServiceImpl implements IESignService {
|
|
|
|
|
|
public String orgAuthorizedSeal(String orgId) throws EsignDemoException {
|
|
|
// 使用传入的 orgId
|
|
|
- EsignHttpResponse orgAuthorizedSealList = orgAuthorizedSealList(orgId);
|
|
|
+ EsignHttpResponse orgAuthorizedSealList = orgAuthorizedSealList("585f3eabc65b42b1ad5ae56f4e2bdde6");
|
|
|
JsonObject orgAuthorizedSealListObject = gson.fromJson(orgAuthorizedSealList.getBody(), JsonObject.class);
|
|
|
|
|
|
// 检查 data.seals 是否存在
|