feat(REQ-4624) - 兼容一些表单默认内容的处理
This commit is contained in:
parent
86f7f2ba0b
commit
7c5c21fbbd
@ -323,20 +323,22 @@ public class CustomGetFormInstanceModelCmd extends GetFormInstanceModelCmd {
|
|||||||
}
|
}
|
||||||
} else if (FormFieldTypes.UPLOAD.equals(sf.getType())
|
} else if (FormFieldTypes.UPLOAD.equals(sf.getType())
|
||||||
|| FORM_FIELD_TYPE_IMAGE.equals(sf.getType())) {
|
|| FORM_FIELD_TYPE_IMAGE.equals(sf.getType())) {
|
||||||
if (rows.get(0).containsKey(sf.getId())) {
|
if (StringUtils.hasText(String.valueOf(rows.get(0).get(sf.getId())))) {
|
||||||
|
if (rows.get(0).containsKey(sf.getId())) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String updateValueJson = objectMapper.writeValueAsString(rows.get(0).get(sf.getId()));
|
String updateValueJson = objectMapper.writeValueAsString(rows.get(0).get(sf.getId()));
|
||||||
if (StringUtils.hasText(updateValueJson)) {
|
if (StringUtils.hasText(updateValueJson)) {
|
||||||
List<UploadFieldDTO> uploadFiles = formEngineConfiguration.getObjectMapper()
|
List<UploadFieldDTO> uploadFiles = formEngineConfiguration.getObjectMapper()
|
||||||
.readValue(updateValueJson, new TypeReference<List<UploadFieldDTO>>() {
|
.readValue(updateValueJson, new TypeReference<List<UploadFieldDTO>>() {
|
||||||
});
|
});
|
||||||
sf.setValue(uploadFiles);
|
sf.setValue(uploadFiles);
|
||||||
|
}
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new FlowableException("Error parsing upload files json ", e);
|
||||||
}
|
}
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
throw new FlowableException("Error parsing upload files json ", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user