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