REQ-3300: 调整信息

This commit is contained in:
yanglin 2025-02-27 16:59:40 +08:00
parent 46700182a6
commit ee0b524564
3 changed files with 7 additions and 4 deletions

View File

@ -107,7 +107,8 @@ public class EssService {
BizAssertions.assertTrue(essPerson.isAuthorized(), "人员未加入单位, 无法授权");
EssPerson superAdmin = orgManager.getSuperAdminOrThrow(sealAndPerson.getSeal().getOuId());
essClient.addSealAuthorization(superAdmin, sealAndPerson.getSeal(), sealPerson);
orgManager.addSealAuthorization(request.getEssSealId(), request.getPersonId(), request.getOperatorPersonId());
orgManager.maybeAddPersonAndSealAuthorization(request.getEssSealId(), request.getPersonId(),
request.getOperatorPersonId());
}
@BizTransactional

View File

@ -137,7 +137,7 @@ public class OrgManager {
}
@BizTransactional
public void addSealAuthorization(String essSealId, Long personId, Long authorizedByPersonId) {
public void maybeAddPersonAndSealAuthorization(String essSealId, Long personId, Long authorizedByPersonId) {
maybeAddSealPerson(essSealId, personId);
essSealPersonDao.setPersonAuthorized(essSealId, personId, authorizedByPersonId);
String subject = idbuilder().append(essSealId).append(personId).build();

View File

@ -125,7 +125,8 @@ class CallbackController implements EssCallbackApi, InitializingBean {
EssSealType.fromEssCode(operate.getSealType()));
// 1. 印章创建人会自动获得授权; 2. 避免miss create事件
if (sealCreated)
orgManager.addSealAuthorization(operate.getSealId(), operator.getPersonId(), operator.getPersonId());
orgManager.maybeAddPersonAndSealAuthorization(operate.getSealId(), operator.getPersonId(),
operator.getPersonId());
if ("Delete".equals(operate.getOperate()))
orgManager.updateSealState(operate.getSealId(), EssSealState.DELETED);
if ("Disable".equals(operate.getOperate()))
@ -139,7 +140,8 @@ class CallbackController implements EssCallbackApi, InitializingBean {
// 可能从控制台直接授权
boolean authorizedByPreset = savedPerson != null && savedPerson.getAuthorizedByPersonId() > 0;
long authorizedByPersonId = authorizedByPreset ? 0L : operator.getPersonId();
orgManager.addSealAuthorization(operate.getSealId(), authorized.getPersonId(), authorizedByPersonId);
orgManager.maybeAddPersonAndSealAuthorization(operate.getSealId(), authorized.getPersonId(),
authorizedByPersonId);
}
if ("Invalid".equals(operate.getOperate()))
orgManager.removeSealAuthorization(operate.getSealId(), authorized.getPersonId());