update - 调整流程配置台的按钮模型,新增 disable 属性,用于前端控制按钮是否能勾选
This commit is contained in:
parent
4e89073130
commit
5298787dae
@ -67,6 +67,7 @@ public interface BpmnConstants {
|
||||
String ELEMENT_ATTRIBUTE_CODE = "code";
|
||||
String ELEMENT_ATTRIBUTE_KEY = "key";
|
||||
String ELEMENT_ATTRIBUTE_ORDER = "order";
|
||||
String ELEMENT_ATTRIBUTE_DISABLED = "disabled";
|
||||
String ELEMENT_ATTRIBUTE_TYPE = "type";
|
||||
String START_EVENT_ID = "startEventNode";
|
||||
String SEQUENCE_FLOW_ID = "SequenceFlowId";
|
||||
|
||||
@ -19,8 +19,16 @@ public class BpmnButtonMetaInfo {
|
||||
|
||||
private String btnName;
|
||||
|
||||
/**
|
||||
* 复选框的值
|
||||
*/
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 是否禁用勾选
|
||||
*/
|
||||
private Boolean disabled;
|
||||
|
||||
public Integer getOrder() {
|
||||
return order;
|
||||
}
|
||||
@ -52,4 +60,12 @@ public class BpmnButtonMetaInfo {
|
||||
public void setEnabled(Boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Boolean getDisabled() {
|
||||
return disabled;
|
||||
}
|
||||
|
||||
public void setDisabled(Boolean disabled) {
|
||||
this.disabled = disabled;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
@ -28,6 +29,14 @@ public class BpmnProcessInstanceCreateDTO {
|
||||
@NotEmpty(message = "流程定义的标识不能为空")
|
||||
private String processDefinitionKey;
|
||||
|
||||
/**
|
||||
* 模型归属租户 ID
|
||||
* <p>
|
||||
* 可为空,为空时,默认使用发起人的租户 ID
|
||||
*/
|
||||
@ApiModelProperty(value = "发起的模型是属于哪个租户")
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 流程实例关联的变量
|
||||
*/
|
||||
@ -62,4 +71,8 @@ public class BpmnProcessInstanceCreateDTO {
|
||||
*/
|
||||
@ApiModelProperty(value = "下级审批人", notes = "可为空,定义选择审批人,如果不为空,则覆盖下一级任务的审核人")
|
||||
private BpmnTaskDelegateAssigner nextApprover;
|
||||
|
||||
public String getTenantId() {
|
||||
return StringUtils.hasLength(tenantId) ? tenantId : initiator.getTenantId();
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,6 +71,7 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_META;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_OPTION;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_NOTICE;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.ELEMENT_ATTRIBUTE_CODE;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.ELEMENT_ATTRIBUTE_DISABLED;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.ELEMENT_ATTRIBUTE_KEY;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.ELEMENT_ATTRIBUTE_NAME;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.ELEMENT_ATTRIBUTE_ORDER;
|
||||
@ -285,6 +286,11 @@ public final class BpmnJsonConverterUtil {
|
||||
orderAttribute.setName(ELEMENT_ATTRIBUTE_ORDER);
|
||||
orderAttribute.setValue(String.valueOf(i.getOrder()));
|
||||
button.addAttribute(orderAttribute);
|
||||
|
||||
ExtensionAttribute disabledAttribute = new ExtensionAttribute();
|
||||
disabledAttribute.setName(ELEMENT_ATTRIBUTE_DISABLED);
|
||||
disabledAttribute.setValue(String.valueOf(i.getDisabled()));
|
||||
button.addAttribute(disabledAttribute);
|
||||
initiator.addChildElement(button);
|
||||
});
|
||||
buttonConfigElement.addChildElement(initiator);
|
||||
|
||||
@ -41,6 +41,7 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_OPTION
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_NODE_TYPE;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_NOTICE;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.ELEMENT_ATTRIBUTE_CODE;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.ELEMENT_ATTRIBUTE_DISABLED;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.ELEMENT_ATTRIBUTE_KEY;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.ELEMENT_ATTRIBUTE_NAME;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.ELEMENT_ATTRIBUTE_ORDER;
|
||||
@ -106,6 +107,10 @@ public final class BpmnMetaParserHelper {
|
||||
return Optional.of(conf);
|
||||
}
|
||||
|
||||
public static Optional<BpmnButtonConf> getButtonConfig(UserTask userTask) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
private static void buildButtonMetaInfo(List<ExtensionElement> v, List<BpmnButtonMetaInfo> buttonMetaInfos) {
|
||||
v.get(0).getChildElements().get(CONFIG_BUTTON_META).forEach(i -> {
|
||||
BpmnButtonMetaInfo buttonMetaInfo = new BpmnButtonMetaInfo();
|
||||
@ -113,6 +118,7 @@ public final class BpmnMetaParserHelper {
|
||||
buttonMetaInfo.setBtnName(i.getAttributeValue(null, ELEMENT_ATTRIBUTE_NAME));
|
||||
buttonMetaInfo.setEnabled(Boolean.valueOf(i.getAttributeValue(null, ELEMENT_ATTRIBUTE_VALUE)));
|
||||
buttonMetaInfo.setOrder(Integer.valueOf(i.getAttributeValue(null, ELEMENT_ATTRIBUTE_ORDER)));
|
||||
buttonMetaInfo.setDisabled(Boolean.valueOf(i.getAttributeValue(null, ELEMENT_ATTRIBUTE_DISABLED)));
|
||||
buttonMetaInfos.add(buttonMetaInfo);
|
||||
});
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
|
||||
public String createProcessInstance(BpmnProcessInstanceCreateDTO dto) {
|
||||
BpmnProcessDefinitionVO definition =
|
||||
processDefinitionService.getActiveProcessDefinitionByKey(dto.getProcessDefinitionKey(),
|
||||
dto.getInitiator().getTenantId());
|
||||
dto.getTenantId());
|
||||
// 校验流程定义
|
||||
if (definition == null) {
|
||||
throw new WorkflowEngineException(PROCESS_DEFINITION_KEY_NOT_EXISTS, dto.getProcessDefinitionKey());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user