新增5个量化值及量化条

master
gongzhenkun 2 years ago
parent 72933986c4
commit 8bbd6ae2df

@ -49,6 +49,39 @@ import java.util.stream.Collectors;
@RequestMapping("/api/app")
public class AppController extends BaseController
{
/**
* 01.06barbase64
*/
private static final List<String> BAR_PROPERTY = new ArrayList<String>(){{
add("sz_pangshou");
add("st_houbo");
add("st_funi");
add("st_runzao");
add("st_cao");
}};
/**
*
*/
private static final List<String> jsonKeyList = new ArrayList<String>(){{
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<String> jsonKeyList = new ArrayList<String>(){{
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 {

@ -67,13 +67,24 @@ public class TRecordServiceImpl implements ITRecordService
}};
/**
* key
* key
*/
private static final List<String> getQuantificationKeys = new ArrayList<String>(){{
add("sx_vein_width");
add("sx_vein_length");
}};
/**
* keys
*/
private static final List<String> addQuantificationKeys = new ArrayList<String>(){{
add("sz_pangshou");
add("st_houbo");
add("st_funi");
add("st_runzao");
add("st_cao");
}};
@Autowired
private TRecordMapper tRecordMapper;
@ -194,6 +205,7 @@ public class TRecordServiceImpl implements ITRecordService
// 将老数据结构对应的数据读出来
JSONObject jsonObject = JSONObject.parseObject(jsonString);
readJsonToMap(jsonObject.getJSONObject("data"));
logger.info("jsonKeyMap is {}", jsonKeyMap);
// 加载新数据结构模板
String localPath = RuoYiConfig.getJSONTemplatePath();
String jsonStr = com.ruoyi.common.utils.file.FileUtils.readJsonFile(localPath +"/" + "Result.json");
@ -366,6 +378,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());
}
}
}
}

Loading…
Cancel
Save