REQ-3581: 印章授权人问题

This commit is contained in:
yanglin 2025-03-03 11:36:19 +08:00
parent ab7351bbae
commit 31551bb223
3 changed files with 10 additions and 10 deletions

View File

@ -23,7 +23,7 @@ import cn.axzo.nanopart.ess.server.dao.EssContractDao;
import cn.axzo.nanopart.ess.server.dao.EssLogDao;
import cn.axzo.nanopart.ess.server.entity.EssContract;
import cn.axzo.nanopart.ess.server.entity.EssPerson;
import cn.axzo.nanopart.ess.server.ess.domain.JsonObjectAsString;
import cn.axzo.nanopart.ess.server.ess.domain.StringObject;
import cn.axzo.nanopart.ess.server.ess.mq.EssBroadcaster;
import cn.axzo.nanopart.ess.server.ess.support.ContractSupport;
import cn.axzo.nanopart.ess.server.utils.BizAssertions;
@ -64,7 +64,7 @@ public class ContractManager {
EssPerson superAdmin = orgManager.getSuperAdminOrThrow(request.getCreator().getOuId());
List<String> essFileIds = essClient.uploadDocument(superAdmin, request.getByFile().getBase64Files());
ChannelCreateFlowByFilesResponse essResponse = essClient.createContractByFile(superAdmin, essFileIds,
request.getByFile(), JsonObjectAsString.create().put(CONTRACT_ID, contract.getId()).toString());
request.getByFile(), StringObject.create().put(CONTRACT_ID, contract.getId()).toString());
List<String> essRecipientIds = Arrays.stream(essResponse.getApprovers()) //
.map(ApproverItem::getRecipientId) //
.collect(toList());

View File

@ -43,7 +43,7 @@ import cn.axzo.nanopart.ess.server.entity.EssSealPerson;
import cn.axzo.nanopart.ess.server.ess.ContractManager;
import cn.axzo.nanopart.ess.server.ess.EssService;
import cn.axzo.nanopart.ess.server.ess.OrgManager;
import cn.axzo.nanopart.ess.server.ess.domain.JsonObjectAsString;
import cn.axzo.nanopart.ess.server.ess.domain.StringObject;
import cn.axzo.nanopart.ess.server.ess.domain.OrgOpenId;
import cn.axzo.nanopart.ess.server.ess.domain.PersonOpenId;
import cn.axzo.nanopart.ess.server.ess.support.EssSupport;
@ -183,7 +183,7 @@ class CallbackController implements EssCallbackApi, InitializingBean {
}).collect(toList());
EssContract contract = essContractDao.findOrNull(changes.getFlowId());
if (contract == null && StringUtils.isNotBlank(changes.getCustomerData())) {
JSONObject customData = JsonObjectAsString.parse(changes.getCustomerData()).asJsonObject();
JSONObject customData = StringObject.parse(changes.getCustomerData()).asJsonObject();
contract = essContractDao.getById(customData.getLong(ContractManager.CONTRACT_ID));
}
if (contract == null) {

View File

@ -9,23 +9,23 @@ import lombok.RequiredArgsConstructor;
* @author yanglin
*/
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public class JsonObjectAsString {
public class StringObject {
private final JSONObject obj;
public static JsonObjectAsString create() {
return new JsonObjectAsString(new JSONObject());
public static StringObject create() {
return new StringObject(new JSONObject());
}
public static JsonObjectAsString parse(String jsonStr) {
return new JsonObjectAsString(JSONObject.parseObject(jsonStr));
public static StringObject parse(String jsonStr) {
return new StringObject(JSONObject.parseObject(jsonStr));
}
public JSONObject asJsonObject() {
return obj;
}
public JsonObjectAsString put(String key, Object value) {
public StringObject put(String key, Object value) {
obj.put(key, value);
return this;
}