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 623c14d..f421640 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 @@ -49,6 +49,39 @@ import java.util.stream.Collectors; @RequestMapping("/api/app") public class AppController extends BaseController { + /** + * 01.06新需求,以下字段新增bar字段,需要把base64转为图片保存 + */ + private static final List BAR_PROPERTY = new ArrayList(){{ + add("sz_pangshou"); + add("st_houbo"); + add("st_funi"); + add("st_runzao"); + add("st_cao"); + }}; + + /** + * 所有带图片的键集合 + */ + private static final List jsonKeyList = new ArrayList(){{ + add("st_avg_yellow"); + add("img_sz"); + add("img_sz_yudian"); + add("img_sz_yuban"); + add("img_sz_liewen"); + add("img_st"); + add("img_sx"); + add("img_sx_vein"); + add("sz_avg_red"); + add("sz_avg_purple"); + add("sx_vein_avg_purple"); + add("sz_pangshou"); + add("st_houbo"); + add("st_funi"); + add("st_runzao"); + add("st_cao"); + }}; + @Autowired private ITRecordService tRecordService; @@ -692,19 +725,6 @@ public class AppController extends BaseController public JSONObject removeBase64Image(JSONObject jsonObject,Long recordId) { - List jsonKeyList = new ArrayList(){{ - add("st_avg_yellow"); - add("img_sz"); - add("img_sz_yudian"); - add("img_sz_yuban"); - add("img_sz_liewen"); - add("img_st"); - add("img_sx"); - add("img_sx_vein"); - add("sz_avg_red"); - add("sz_avg_purple"); - add("sx_vein_avg_purple"); - }}; try { doRemoveBase64Image(jsonObject.getJSONObject("data"), "data", jsonKeyList, recordId); } @@ -743,7 +763,7 @@ public class AppController extends BaseController String imageKey = null; if (entry.getValue() instanceof JSONObject) { logger.info("entry key is {}", entry.getKey()); - if (entry.getKey().contains("avg")) { + if (entry.getKey().contains("avg") || BAR_PROPERTY.contains(entry.getKey())) { imageStr = ((JSONObject) entry.getValue()).getString("bar"); imageKey = "bar"; } else { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java index a988605..dcf494f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java @@ -69,13 +69,24 @@ public class TRecordServiceImpl implements ITRecordService }}; /** - * 需要获取量化值的key + * 只需要获取量化值的key */ private static final List getQuantificationKeys = new ArrayList(){{ add("sx_vein_width"); add("sx_vein_length"); }}; + /** + * 需要追加量化值的keys + */ + private static final List addQuantificationKeys = new ArrayList(){{ + add("sz_pangshou"); + add("st_houbo"); + add("st_funi"); + add("st_runzao"); + add("st_cao"); + }}; + @Autowired private TRecordMapper tRecordMapper; @@ -373,6 +384,11 @@ public class TRecordServiceImpl implements ITRecordService if (!getQuantificationKeys.contains(listName) && "v".equals(entry.getKey())) { doSetHistoryData(historyDataMap, listName, entry.getValue()); } + // 追加量化值数据 + if (addQuantificationKeys.contains(listName) && "quantification".equals(entry.getKey())) { + String newListName = listName + "_q"; + doSetHistoryData(historyDataMap, newListName, entry.getValue()); + } } } }