diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java index 4f03ccb..d19160a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java @@ -629,6 +629,10 @@ public class AppController extends BaseController add("img_st"); add("img_sx"); add("img_sx_vein"); + add("sz_avg_red"); + add("sz_avg_purple"); + add("st_avg_yellow"); + add("sx_vein_avg_purple"); }}; try { doRemoveBase64Image(jsonObject.getJSONObject("data"), "data", jsonKeyList, recordId); @@ -639,7 +643,7 @@ public class AppController extends BaseController tRecord.setId(recordId); tRecord.setStatus("0"); tRecordService.updateTRecord(tRecord); - throw new ServiceException("JSON解析错误:" + jsonObject.toJSONString()); + throw new ServiceException("JSON解析错误:" + e.getMessage()); } return jsonObject; } @@ -665,24 +669,26 @@ public class AppController extends BaseController // 如果key包含在图片 if (imageKeys.contains(entry.getKey())) { String imageStr = null; + String imageKey = null; if (entry.getValue() instanceof JSONObject) { - String v = ((JSONObject) entry.getValue()).getString("v"); - if (null != v) { - imageStr = v; + if (null != ((JSONObject) entry.getValue()).getString("bar")) { + imageStr = ((JSONObject) entry.getValue()).getString("bar"); + imageKey = "bar"; + } else { + imageStr = ((JSONObject) entry.getValue()).getString("v"); + imageKey = "v"; } - } else { - imageStr = (String) entry.getValue(); } - if (null != imageStr) { + if (null != imageStr && !"".equals(imageStr) && null != imageKey && !"".equals(imageKey)) { // 将base64转为图片存在服务器,并将返回值置空 - String path=FileUtils.GenerateImage(imageStr, entry.getKey()); + String path = FileUtils.GenerateImage(imageStr, entry.getKey()); TImage tImage = new TImage(); tImage.setName(entry.getKey()); tImage.setPath(path); tImage.setCreateTime(new Date()); tImage.setThirdId(recordId); imageService.insertTImage(tImage); - ((JSONObject) entry.getValue()).put("v", ""); + ((JSONObject) entry.getValue()).put(imageKey, ""); } } if (!(entry.getValue() instanceof String)) {