Commit cbec04e9 authored by 邢磊's avatar 邢磊

*)修改附件数据

parent 9f66e99a
...@@ -594,14 +594,15 @@ public class DPSubServiceImpl { ...@@ -594,14 +594,15 @@ public class DPSubServiceImpl {
JSONArray attachmentUploadDatas = matinfo.getJSONArray("datas"); JSONArray attachmentUploadDatas = matinfo.getJSONArray("datas");
if (!ValidationUtil.isEmpty(value)) { if (!ValidationUtil.isEmpty(value)) {
JSONObject attachmentUploadDatasObj = new JSONObject(); JSONObject attachmentUploadDatasObj = new JSONObject();
log.info("附件数据:{}", value);
((JSONArray)value).stream().forEach(y -> { ((JSONArray)value).stream().forEach(y -> {
JSONObject yObj = (JSONObject) y; JSONObject yObj = (JSONObject) y;
String[] str = yObj.getString("url").split("\\."); String[] str = yObj.getString("url").split("\\.");
if (ValidationUtil.isEmpty(str)){ if (ValidationUtil.isEmpty(str)){
yObj.put("thumb", yObj.getString("url")); yObj.put("thumb", yObj.getString("url"));
} else { } else {
String icon = Objects.requireNonNull(MatinfoEnum.getIconUrl(str[1])).getIcon(); MatinfoEnum iconUrl = MatinfoEnum.getIconUrl(str[1]);
yObj.put("thumb", ValidationUtil.isEmpty(icon) ? yObj.getString("url") : icon); yObj.put("thumb", ValidationUtil.isEmpty(iconUrl) ? yObj.getString("url") : iconUrl.getIcon());
} }
}); });
attachmentUploadDatasObj.put("value", value); attachmentUploadDatasObj.put("value", value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment