|
@@ -112,24 +112,14 @@ public class PSQIScale extends BaseScale{
|
|
}
|
|
}
|
|
|
|
|
|
public JSONObject scaleCalculateV2() throws Exception {
|
|
public JSONObject scaleCalculateV2() throws Exception {
|
|
-
|
|
|
|
//总分
|
|
//总分
|
|
double score = 0;
|
|
double score = 0;
|
|
Map<String, String> resultMap0 = new LinkedHashMap<>();
|
|
Map<String, String> resultMap0 = new LinkedHashMap<>();
|
|
List<Map<String, String>> resultMapList = new ArrayList<>();
|
|
List<Map<String, String>> resultMapList = new ArrayList<>();
|
|
-
|
|
|
|
//新版本数据格式
|
|
//新版本数据格式
|
|
Map<String, Object> newResult = new LinkedHashMap<>();
|
|
Map<String, Object> newResult = new LinkedHashMap<>();
|
|
-
|
|
|
|
//返回值以及存数据库格式
|
|
//返回值以及存数据库格式
|
|
List<NewResultDto> newResultDtos = new ArrayList<>();
|
|
List<NewResultDto> newResultDtos = new ArrayList<>();
|
|
-
|
|
|
|
- //获取答案列表
|
|
|
|
- List<AnswerEntity> answerEntities = (List<AnswerEntity>) resultJson.get("answerEntities");
|
|
|
|
- //获取评分规则列表
|
|
|
|
- List<ScaleMarksEntity> scaleMarksEntities = (List<ScaleMarksEntity>) resultJson.get("scaleMarksEntities");
|
|
|
|
- //获取维度信息列表
|
|
|
|
- List<DimensionEntity> dimensionEntities = (List<DimensionEntity>) resultJson.get("dimensionEntities");
|
|
|
|
if (jsonArray.size() > 0) {
|
|
if (jsonArray.size() > 0) {
|
|
score += checkSleepTime(jsonArray) + checkWaitTime(jsonArray) + checkWakeTime(jsonArray) + checkSleepHour(jsonArray) + checkSleepQuality(jsonArray) + checkQuality(jsonArray) + checkEnergy(jsonArray);
|
|
score += checkSleepTime(jsonArray) + checkWaitTime(jsonArray) + checkWakeTime(jsonArray) + checkSleepHour(jsonArray) + checkSleepQuality(jsonArray) + checkQuality(jsonArray) + checkEnergy(jsonArray);
|
|
resultMap0.put("总分", String.valueOf(score));
|
|
resultMap0.put("总分", String.valueOf(score));
|
|
@@ -183,21 +173,15 @@ public class PSQIScale extends BaseScale{
|
|
resultJson.put("总分解读", "无");
|
|
resultJson.put("总分解读", "无");
|
|
resultJson.put("总分建议", "建议您及时就医了,必要时采用药物治疗。");
|
|
resultJson.put("总分建议", "建议您及时就医了,必要时采用药物治疗。");
|
|
}
|
|
}
|
|
-
|
|
|
|
resultMapList.add(resultMap0);
|
|
resultMapList.add(resultMap0);
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
//需要图表展示的
|
|
//需要图表展示的
|
|
newResult.put("iconInfo", "");
|
|
newResult.put("iconInfo", "");
|
|
newResult.put("result", newResultDtos);
|
|
newResult.put("result", newResultDtos);
|
|
-
|
|
|
|
JSONObject returnJson = new JSONObject(true);
|
|
JSONObject returnJson = new JSONObject(true);
|
|
returnJson.put("resultMapList", resultMapList);
|
|
returnJson.put("resultMapList", resultMapList);
|
|
- //returnJson.put("scaleName",resultJson.getString("scaleName"));
|
|
|
|
returnJson.put("resultJson", resultJson);
|
|
returnJson.put("resultJson", resultJson);
|
|
returnJson.put(ScaleConstant.ResultEnum.RESULT_NEW_FIELD.getKeyword(), newResult);
|
|
returnJson.put(ScaleConstant.ResultEnum.RESULT_NEW_FIELD.getKeyword(), newResult);
|
|
-
|
|
|
|
return returnJson;
|
|
return returnJson;
|
|
}
|
|
}
|
|
|
|
|