feat(REQ-4624) - 兼容一些表单默认内容的处理

This commit is contained in:
wangli 2025-07-30 16:34:36 +08:00
parent c45b7298e3
commit 4ebda69a05

View File

@ -323,20 +323,22 @@ public class CustomGetFormInstanceModelCmd extends GetFormInstanceModelCmd {
}
} else if (FormFieldTypes.UPLOAD.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 {
String updateValueJson = objectMapper.writeValueAsString(rows.get(0).get(sf.getId()));
if (StringUtils.hasText(updateValueJson)) {
List<UploadFieldDTO> uploadFiles = formEngineConfiguration.getObjectMapper()
.readValue(updateValueJson, new TypeReference<List<UploadFieldDTO>>() {
});
sf.setValue(uploadFiles);
try {
String updateValueJson = objectMapper.writeValueAsString(rows.get(0).get(sf.getId()));
if (StringUtils.hasText(updateValueJson)) {
List<UploadFieldDTO> uploadFiles = formEngineConfiguration.getObjectMapper()
.readValue(updateValueJson, new TypeReference<List<UploadFieldDTO>>() {
});
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);
}
}
}
}
});