feat:额外返回审核标记

This commit is contained in:
wangyu 2021-12-11 00:11:47 +08:00
parent b08fab9c4a
commit 5f2aaf5a55
3 changed files with 6 additions and 3 deletions

View File

@ -27,7 +27,7 @@ public abstract class ApprovalDomainVo<T extends ApprovalDomain> implements Vo<T
.orElse(ApproveStatus.DRAFT.getName()));
this.setApproveStatus(Optional.ofNullable(po.getApproveStatus()).map(ApproveStatus::name)
.orElse(ApproveStatus.DRAFT.name()));
if (po.getNext() != -1) {
if (null != po.getNext() && po.getNext() != -1) {
this.setNextApprover(po.getApprovers().get(po.getNext()));
}
return this;

View File

@ -1,10 +1,12 @@
package com.flyfish.framework.approval.domain.record;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.flyfish.framework.approval.enums.ApproveAction;
import com.flyfish.framework.domain.base.Vo;
import lombok.Data;
import java.util.Date;
import java.util.Optional;
/**
* 审批记录列表vo
@ -34,7 +36,7 @@ public class ApproveRecordListVo implements Vo<ApproveRecord> {
vo.setName(po.getName());
vo.setApprover(po.getModifier());
vo.setApproveTime(po.getModifyTime());
vo.setAction(po.getAction().getName());
vo.setAction(Optional.ofNullable(po.getAction()).map(ApproveAction::getName).orElse(null));
vo.setOpinion(po.getOpinion());
return vo;
}

View File

@ -158,7 +158,8 @@ public class ModuleDelegateService {
BaseReactiveService<ApprovalDomain> service = getService(data.getModule());
return service.getById(data.getId())
.flatMap(domain -> {
if (ApproveStatus.DRAFT != domain.getApproveStatus() && ApproveStatus.REJECTED != domain.getApproveStatus()) {
ApproveStatus status = domain.getApproveStatus();
if (null != status && ApproveStatus.DRAFT != status && ApproveStatus.REJECTED != status) {
return Mono.error(new InvalidBusinessException("该数据已经提交审批,请勿重复提交!"));
}
domain.setApprovers(data.getApprovers());