|
@@ -87,39 +87,6 @@ public class ScaleResultController extends BaseController {
|
|
|
// 导出文件
|
|
|
ExcelUtil.createExcelFile(ASKEntity.class,dataList,resultMapList,new ExcelClass().contentExcel(Constant.QUEST_TYPE_ASK),fileName,Constant.SHEET_NAME_ASK);
|
|
|
//匹兹堡睡眠质量指数
|
|
|
- }else if(Constant.QUEST_TYPE_PSQI.equals(type)){
|
|
|
- //睡眠质量
|
|
|
- int scoreQuality = checkQuality(jsonArray);
|
|
|
- //入睡时间
|
|
|
- int scoreTime = checkTime(jsonArray);
|
|
|
- //睡眠时间
|
|
|
- int scoreHour = checkHour(jsonArray);
|
|
|
- //睡眠效率
|
|
|
- int scoreEfficiency = checkEfficiency(jsonArray);
|
|
|
- //睡眠障碍
|
|
|
- int scoreObstruct = checkObstruct(jsonArray);
|
|
|
- //催眠药物
|
|
|
- int scoreMedicine = checkMedicine(jsonArray);
|
|
|
- //日间功能障碍
|
|
|
- int scoreDay = checkDay(jsonArray);
|
|
|
- System.out.println("A睡眠质量:"+scoreQuality+";B入睡时间:"+scoreTime+";C睡眠时间:"+scoreHour+";D睡眠效率:"+scoreEfficiency+";E失眠障碍:"+scoreObstruct+";F催眠药物:"+scoreMedicine+";日间工程障碍:"+scoreDay);
|
|
|
- int score = scoreQuality+scoreTime+scoreHour+scoreEfficiency+scoreObstruct+scoreMedicine+scoreDay;
|
|
|
- System.out.println("PSQI总分:"+score);
|
|
|
- Map<String,String> resultMap = new LinkedHashMap<>();
|
|
|
- resultMap.put("A睡眠质量",String.valueOf(scoreQuality));
|
|
|
- resultMap.put("B入睡时间",String.valueOf(scoreTime));
|
|
|
- resultMap.put("C睡眠时间",String.valueOf(scoreHour));
|
|
|
- resultMap.put("D睡眠效率",String.valueOf(scoreEfficiency));
|
|
|
- resultMap.put("E失眠障碍",String.valueOf(scoreObstruct));
|
|
|
- resultMap.put("F催眠药物",String.valueOf(scoreMedicine));
|
|
|
- resultMap.put("日间工程障碍",String.valueOf(scoreDay));
|
|
|
- resultMap.put("PSQI总分",String.valueOf(score));
|
|
|
- fileName = fileName+"-"+Constant.SHEET_NAME_PSQI+".xlsx";
|
|
|
- List<PSQIEntity> dataList = jsonArray.toJavaList(PSQIEntity.class);
|
|
|
- resultMapList = new ArrayList<>();
|
|
|
- resultMapList.add(resultMap);
|
|
|
- ExcelUtil.createExcelFile(PSQIEntity.class,dataList,resultMapList,new ExcelClass().contentExcel(Constant.QUEST_TYPE_PSQI),fileName,Constant.SHEET_NAME_PSQI);
|
|
|
- //心境状态
|
|
|
}else if(Constant.QUEST_TYPE_POMS.equals(type)){
|
|
|
int [] scores= {0,0,0,0,0,0,0,0};
|
|
|
for (int i=0;i<jsonArray.size();i++) {
|
|
@@ -155,42 +122,6 @@ public class ScaleResultController extends BaseController {
|
|
|
resultMapList.add(resultMap);
|
|
|
ExcelUtil.createExcelFile(POMSEntity.class,jsonArray.toJavaList(POMSEntity.class),resultMapList,new ExcelClass().contentExcel(Constant.QUEST_TYPE_POMS),fileName,Constant.SHEET_NAME_POMS);
|
|
|
//症状自评
|
|
|
- }else if (Constant.QUEST_TYPE_SCL.equals(type)){
|
|
|
- int [] scores = {0,0,0,0,0,0,0,0,0,0};
|
|
|
- for (int i=0;i<jsonArray.size();i++){
|
|
|
- JSONObject jsonObject1 = jsonArray.getJSONObject(i);
|
|
|
- int model = Integer.parseInt(jsonObject1.getString("type"));
|
|
|
- String checked = jsonObject1.getString("checked");
|
|
|
- if(checked.equals("从无")){
|
|
|
-
|
|
|
- }else if (checked.equals("很轻")){
|
|
|
- scores[model] +=1;
|
|
|
- }else if (checked.equals("中等")){
|
|
|
- scores[model] +=2;
|
|
|
- }else if (checked.equals("偏重")){
|
|
|
- scores[model] +=3;
|
|
|
- }else if (checked.equals("严重")){
|
|
|
- scores[model] +=4;
|
|
|
- }
|
|
|
- }
|
|
|
- System.out.println("SCL-90各项得分:"+scores.toString());
|
|
|
- //分量编号 0躯体化 1强迫症状 2人际关系敏感 3抑郁 4焦虑 5敌对 6恐怖 7偏执 8精神病性 9 其他
|
|
|
- Map<String,String> resultMap = new LinkedHashMap<>();
|
|
|
- resultMap.put("躯体化",String.valueOf(scores[0]));
|
|
|
- resultMap.put("强迫症状",String.valueOf(scores[1]));
|
|
|
- resultMap.put("人际关系敏感",String.valueOf(scores[2]));
|
|
|
- resultMap.put("抑郁",String.valueOf(scores[3]));
|
|
|
- resultMap.put("焦虑",String.valueOf(scores[4]));
|
|
|
- resultMap.put("敌对",String.valueOf(scores[5]));
|
|
|
- resultMap.put("恐怖",String.valueOf(scores[6]));
|
|
|
- resultMap.put("偏执",String.valueOf(scores[7]));
|
|
|
- resultMap.put("精神病性",String.valueOf(scores[8]));
|
|
|
- resultMap.put("其他",String.valueOf(scores[9]));
|
|
|
- fileName = fileName+"-"+Constant.SHEET_NAME_SCL+".xlsx";
|
|
|
- resultMapList = new ArrayList<>();
|
|
|
- resultMapList.add(resultMap);
|
|
|
- ExcelUtil.createExcelFile(SCLEntity.class,jsonArray.toJavaList(SCLEntity.class),resultMapList,new ExcelClass().contentExcel(Constant.QUEST_TYPE_SCL),fileName,Constant.SHEET_NAME_SCL);
|
|
|
- //汉化版美国航空航天局任务负荷指数量表
|
|
|
}else if(Constant.QUEST_TYPE_AVAI.equals(type)){
|
|
|
int score = 0 ;
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
@@ -345,74 +276,6 @@ public class ScaleResultController extends BaseController {
|
|
|
resultMapList = new ArrayList<>();
|
|
|
resultMapList.add(resultMap);
|
|
|
ExcelUtil.createExcelFile(MoodEntity.class,jsonArray.toJavaList(MoodEntity.class),resultMapList,new ExcelClass().contentExcel(Constant.QUEST_TYPE_MOOD),fileName,Constant.SHEET_NAME_MOOD);
|
|
|
- //状态-特质焦虑量表
|
|
|
- }else if (Constant.QUEST_TYPE_STATUS.equals(type)){
|
|
|
- //状态焦虑
|
|
|
- int [] statusScore = {0,0};
|
|
|
- for (int i = 0; i < 20; i++) {
|
|
|
- JSONObject jsonObject1 = jsonArray.getJSONObject(i);
|
|
|
- String checked = jsonObject1.getString("checked");
|
|
|
- String model = jsonObject1.getString("type");
|
|
|
- if(model.equals("0")){
|
|
|
- if(checked.equals("完全没有")){
|
|
|
- statusScore[0]+=4;
|
|
|
- }else if (checked.equals("有些")){
|
|
|
- statusScore[0]+=3;
|
|
|
- }else if (checked.equals("经常")){
|
|
|
- statusScore[0]+=2;
|
|
|
- }else if (checked.equals("非常明显")){
|
|
|
- statusScore[0]+=1;
|
|
|
- }
|
|
|
- }else {
|
|
|
- if(checked.equals("完全没有")){
|
|
|
- statusScore[1]+=1;
|
|
|
- }else if (checked.equals("有些")){
|
|
|
- statusScore[1]+=2;
|
|
|
- }else if (checked.equals("经常")){
|
|
|
- statusScore[1]+=3;
|
|
|
- }else if (checked.equals("非常明显")){
|
|
|
- statusScore[1]+=4;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //状态焦虑
|
|
|
- int [] particularityScore = {0,0};
|
|
|
- for (int i = 20; i < jsonArray.size(); i++) {
|
|
|
- JSONObject jsonObject1 = jsonArray.getJSONObject(i);
|
|
|
- String checked = jsonObject1.getString("checked");
|
|
|
- String model = jsonObject1.getString("type");
|
|
|
- if(model.equals("0")){
|
|
|
- if(checked.equals("完全没有")){
|
|
|
- particularityScore[0]+=4;
|
|
|
- }else if (checked.equals("有些")){
|
|
|
- particularityScore[0]+=3;
|
|
|
- }else if (checked.equals("经常")){
|
|
|
- particularityScore[0]+=2;
|
|
|
- }else if (checked.equals("非常明显")){
|
|
|
- particularityScore[0]+=1;
|
|
|
- }
|
|
|
- }else {
|
|
|
- if(checked.equals("完全没有")){
|
|
|
- particularityScore[1]+=1;
|
|
|
- }else if (checked.equals("有些")){
|
|
|
- particularityScore[1]+=2;
|
|
|
- }else if (checked.equals("经常")){
|
|
|
- particularityScore[1]+=3;
|
|
|
- }else if (checked.equals("非常明显")){
|
|
|
- particularityScore[1]+=4;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- System.out.println("状态焦虑:反向得分"+statusScore[0]+";正向得分:"+statusScore[1]);
|
|
|
- System.out.println("特质焦虑:反向得分"+particularityScore[0]+";正向得分:"+particularityScore[1]);
|
|
|
- fileName = fileName+"-"+Constant.SHEET_NAME_STATUS+".xlsx";
|
|
|
- Map<String,String> resultMap = new LinkedHashMap<>();
|
|
|
- resultMap.put("状态焦虑",String.valueOf(statusScore[0]+statusScore[1]));
|
|
|
- resultMap.put("特质焦虑",String.valueOf(particularityScore[0]+particularityScore[1]));
|
|
|
- resultMapList = new ArrayList<>();
|
|
|
- resultMapList.add(resultMap);
|
|
|
- ExcelUtil.createExcelFile(StatusEntity.class,jsonArray.toJavaList(StatusEntity.class),resultMapList,new ExcelClass().contentExcel(Constant.QUEST_TYPE_STATUS),fileName,Constant.SHEET_NAME_MOOD);
|
|
|
}else if(Constant.QUEST_TYPE_LIFE.equals(type)){
|
|
|
int score = 0;
|
|
|
List<LifeEntity> dataList = jsonArray.toJavaList(LifeEntity.class);
|