update - 调整模型的描述字段解析
This commit is contained in:
parent
8ee50cd375
commit
80c60d5156
@ -24,4 +24,7 @@ public class BpmnModelDetailVO extends BpmnModelBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "启用状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String description;
|
||||
}
|
||||
|
||||
@ -1,13 +1,16 @@
|
||||
package cn.axzo.workflow.core.service.converter;
|
||||
|
||||
import cn.axzo.workflow.common.model.response.bpmn.model.BpmnModelDetailVO;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.flowable.engine.impl.persistence.entity.ModelEntityImpl;
|
||||
import org.flowable.engine.repository.Model;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.axzo.workflow.common.constant.MetaInfoConstants.MODEL_DESCRIPTION;
|
||||
import static org.mapstruct.NullValueCheckStrategy.ALWAYS;
|
||||
|
||||
/**
|
||||
@ -34,6 +37,13 @@ public interface BpmnModelConverter extends EntityConverter<BpmnModelDetailVO, M
|
||||
@Mapping(target = "tenantId", source = "tenantId")
|
||||
BpmnModelDetailVO toVo(Model entity);
|
||||
|
||||
default BpmnModelDetailVO toVoParseDesc(Model entity) {
|
||||
BpmnModelDetailVO vo = toVo(entity);
|
||||
Map<String, String> metaInfoMap = JSON.parseObject(vo.getMetaInfo(), Map.class);
|
||||
vo.setDescription(metaInfoMap.get(MODEL_DESCRIPTION));
|
||||
return vo;
|
||||
}
|
||||
|
||||
default String getEditorSourceValueId(Model entity) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
|
||||
@ -270,7 +270,7 @@ public class BpmnProcessModelServiceImpl implements BpmnProcessModelService {
|
||||
if (StringUtils.hasLength(tenantId) && !Objects.equals(model.getTenantId(), tenantId)) {
|
||||
throw new WorkflowEngineException(MODEL_ID_NOT_EXISTS, tenantId);
|
||||
}
|
||||
return bpmnModelConverter.toVo(model);
|
||||
return bpmnModelConverter.toVoParseDesc(model);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -285,7 +285,7 @@ public class BpmnProcessModelServiceImpl implements BpmnProcessModelService {
|
||||
if (StringUtils.hasLength(tenantId) && !Objects.equals(model.getTenantId(), tenantId)) {
|
||||
throw new WorkflowEngineException(MODEL_ID_NOT_EXISTS, tenantId);
|
||||
}
|
||||
return bpmnModelConverter.toVo(model);
|
||||
return bpmnModelConverter.toVoParseDesc(model);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
Reference in New Issue
Block a user