feat(REQ-3004) - 解决审批模型多版本切换时,不能正常查询表单模型内容
This commit is contained in:
parent
bb409d45de
commit
bf3e4b8c2a
@ -27,4 +27,7 @@ public class FormDefinitionSearchDTO {
|
||||
|
||||
@ApiModelProperty(value = "表单归属租户")
|
||||
private String tenantId = NO_TENANT_ID;
|
||||
|
||||
@ApiModelProperty(value = "表单关联的流程定义部署 ID")
|
||||
private String parentDeploymentId;
|
||||
}
|
||||
|
||||
@ -8,8 +8,10 @@ import cn.axzo.workflow.common.model.response.BpmPageResult;
|
||||
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessDefinitionVO;
|
||||
import cn.axzo.workflow.common.model.response.form.definition.FormDefinitionVO;
|
||||
import cn.axzo.workflow.core.common.utils.BpmnJsonConverterUtil;
|
||||
import cn.axzo.workflow.core.repository.entity.ExtAxBpmnFormRelation;
|
||||
import cn.axzo.workflow.core.repository.entity.ExtAxReProcDef;
|
||||
import cn.axzo.workflow.core.service.BpmnProcessDefinitionService;
|
||||
import cn.axzo.workflow.core.service.ExtAxBpmnFormRelationService;
|
||||
import cn.axzo.workflow.core.service.ExtAxReProcDefService;
|
||||
import cn.axzo.workflow.core.service.converter.BpmnProcessDefinitionConverter;
|
||||
import cn.axzo.workflow.form.service.FormDefinitionService;
|
||||
@ -68,6 +70,8 @@ public class BpmnProcessDefinitionServiceImpl implements BpmnProcessDefinitionSe
|
||||
private String serviceVersion;
|
||||
@Resource
|
||||
private FormDefinitionService formDefinitionService;
|
||||
@Resource
|
||||
private ExtAxBpmnFormRelationService bpmnFormRelationService;
|
||||
|
||||
@Override
|
||||
public String createProcessDefinition(Model model, byte[] bpmnBytes) {
|
||||
@ -191,9 +195,16 @@ public class BpmnProcessDefinitionServiceImpl implements BpmnProcessDefinitionSe
|
||||
BpmnProcessDefinitionVO vo = processDefinitionConverter.toVo(processDefinition);
|
||||
vo.setJsonModel(BpmnJsonConverterUtil.convertToJson(repositoryService.getBpmnModel(id)));
|
||||
|
||||
ExtAxBpmnFormRelation relation = bpmnFormRelationService.queryByBpmnDefinitionId(processDefinition.getId());
|
||||
if(Objects.isNull(relation)){
|
||||
return vo;
|
||||
}
|
||||
FormDefinitionSearchDTO formDefinitionSearch = new FormDefinitionSearchDTO();
|
||||
formDefinitionSearch.setKey(processDefinition.getKey());
|
||||
formDefinitionSearch.setTenantId(processDefinition.getTenantId());
|
||||
formDefinitionSearch.setParentDeploymentId(processDefinition.getDeploymentId());
|
||||
formDefinitionSearch.setDeploymentId(relation.getFormDeploymentId());
|
||||
|
||||
FormDefinitionVO formDefinitionVO = formDefinitionService.get(formDefinitionSearch);
|
||||
if (Objects.nonNull(formDefinitionVO)) {
|
||||
vo.setFormFields(formDefinitionVO.getFields());
|
||||
|
||||
@ -46,7 +46,7 @@ public class FormDefinitionServiceImpl implements FormDefinitionService {
|
||||
public FormDefinitionVO get(FormDefinitionSearchDTO dto) {
|
||||
FormInfo formModel;
|
||||
try {
|
||||
formModel = formRepositoryService.getFormModelByKey(dto.getKey(), dto.getTenantId(), false);
|
||||
formModel = formRepositoryService.getFormModelByKeyAndParentDeploymentId(dto.getKey(),dto.getParentDeploymentId(), dto.getTenantId(),false );
|
||||
}catch (FlowableObjectNotFoundException e){
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -217,6 +217,7 @@ public class BpmnProcessDefinitionController implements ProcessDefinitionApi {
|
||||
|
||||
FormDefinitionSearchDTO search = new FormDefinitionSearchDTO();
|
||||
search.setKey(modelDetail.getKey());
|
||||
search.setParentDeploymentId(processDefinition.getId());
|
||||
search.setTenantId(finalTenantId);
|
||||
FormDefinitionVO formDefinitionVO = formDefinitionService.get(search);
|
||||
if(Objects.nonNull(formDefinitionVO)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user