feat(REQ-3300): 编辑态提交审批或保存数据,校验单据状态

This commit is contained in:
chenwenjian 2025-02-27 10:45:49 +08:00
parent 3c2c4ab54d
commit 19185780fe

View File

@ -601,12 +601,11 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
/*编辑*/
changeRecord = getById(req.getId());
AssertUtil.notNull(changeRecord, "记录不存在");
if (NumberUtil.isPositiveNumber(changeRecord.getId())) {
// 编辑态下校验单据状态
AssertUtil.isTrue(!StringUtils.hasText(changeRecord.getApprovalId())
|| (StringUtils.hasText(changeRecord.getApprovalId()) && !Objects.equals(VisaStatusEnum.APPROVING.name(), changeRecord.getApprovalStatus())),
"当前单据审批中,不允许操作");
}
// 编辑态下校验单据状态
AssertUtil.isTrue(!StringUtils.hasText(changeRecord.getApprovalId())
|| (StringUtils.hasText(changeRecord.getApprovalId()) && !Objects.equals(VisaStatusEnum.APPROVING.name(), changeRecord.getApprovalStatus())),
"当前单据审批中,不允许操作");
oldContext = new VisaAddLogContext();
oldContext.setStatus(changeRecord.getStatus());