Merge branch 'feature/REQ-3300' into feature/REQ-3581

This commit is contained in:
wangli 2025-02-27 10:15:55 +08:00
commit 6b36692dbe
2 changed files with 14 additions and 4 deletions

View File

@ -91,7 +91,11 @@ public class ImGroupAddMembersEventHandler implements EventHandler, Initializing
"initiatorName", ownerProfile.getRealName(),
"visaType", StringUtils.isNotBlank(visaType) ? VisaTypeEnum.valueOf(visaType).getDesc() : "",
"topic", group.getName())));
notice.setRouterParams(new JSONObject(Maps.of("visaId", visaId)));
notice.setRouterParams(new JSONObject(Maps.of(
"visaId", visaId,
"ouId", member.getPersonOuId(),
"workspaceId", workspaceId
)));
noticeApi.send(notice);
}
log.info("receive add member event, push notice success!");

View File

@ -745,8 +745,14 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
@Transactional(rollbackFor = Exception.class)
public Long approveCreateVisaChangeRecord(VisaChangeApproveCreateReq req) {
/*校验*/
validVisaChangeForm(req);
ChangeRecord changeRecord = this.getById(req.getId());
if (NumberUtil.isPositiveNumber(changeRecord.getId())) {
// 编辑态下校验单据状态
AssertUtil.isTrue(!StringUtils.hasText(changeRecord.getApprovalId())
|| (StringUtils.hasText(changeRecord.getApprovalId()) && !Objects.equals(VisaStatusEnum.APPROVING.name(), changeRecord.getApprovalStatus())),
"当前单据审批中,不允许操作");
}
validVisaChangeForm(req);
ChangeRecord oldChangeRecord = BeanUtil.copyProperties(changeRecord, ChangeRecord.class);
List<VisaDetailByIdResponse.VisaUploadFile> visaUploadFiles = this.buildAttachUploadFile(req.getId());
@ -1460,7 +1466,7 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
.findAny()
.ifPresent(m -> {
log.info("{} bill {} is related by {} visa {}", m.getBillType(), m.getBillId(), m.getVisaType(), m.getVisaId());
throw new ServiceException(String.format("%s已被其他%s关联,请重新选择", m.getBillType().getDesc(), visaType.getDesc()));
throw new ServiceException(String.format("%s已被其他%s关联,请重新选择", m.getBillType().getDesc(), visaType.getDesc()));
}));
}
@ -1478,7 +1484,7 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
.findAny()
.ifPresent(m -> {
log.info("{} bill {} is related by {} visa {}", m.getBillType(), m.getBillId(), m.getVisaType(), m.getVisaId());
throw new ServiceException(String.format("%s已被其他%s关联,请重新选择", m.getBillType().getDesc(), visaType.getDesc()));
throw new ServiceException(String.format("%s已被其他%s关联,请重新选择", m.getBillType().getDesc(), visaType.getDesc()));
}));
}