Ver código fonte

多余代码调整

zsf 5 meses atrás
pai
commit
17a8ad9dc8

+ 0 - 50
src/main/java/com/rf/psychological/dao/model/PSQIEntity.java

@@ -1,50 +0,0 @@
-package com.rf.psychological.dao.model;
-
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.*;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-
-/**
- * @author zzf
- * @description:匹茨堡睡眠质量指数
- * @date 2021/1/19 16:31
- */
-@Entity
-@Data
-@Getter
-@Setter
-@NoArgsConstructor
-@AllArgsConstructor
-@Table(name = "t_qsti_info")
-@org.hibernate.annotations.Table(appliesTo = "t_qsti_info", comment = "匹兹堡睡眠质量指数测试信息表")
-public class PSQIEntity extends BaseEntity {
-
-
-    /**
-     * 编号
-     */
-    @Column(name = "no", columnDefinition = "varchar(10) comment '编号'")
-    private String no;
-
-    /**
-     * 内容
-     */
-    @Column(name = "content", columnDefinition = "text comment '内容'")
-    private String content;
-
-    /**
-     * 选项
-     */
-    @Column(name = "check_items", columnDefinition = "text comment '选项'")
-    private String checkItems;
-
-    /**
-     * 默认选项
-     */
-    @Column(name = "checked", columnDefinition = "text comment '默认选项'")
-    private String checked;
-
-}

+ 0 - 41
src/main/java/com/rf/psychological/dao/model/SCLEntity.java

@@ -1,41 +0,0 @@
-package com.rf.psychological.dao.model;
-
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.*;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-
-/**
- * @author zzf
- * @description:测试类型症状自评量表SCL-90
- * @date 2021/1/20 16:51
- */
-@Entity
-@Data
-@Getter
-@Setter
-@NoArgsConstructor
-@AllArgsConstructor
-@Table(name = "t_scl_info")
-@org.hibernate.annotations.Table(appliesTo = "t_scl_info", comment = "测试类型症状自评量表SCL-90测试信息表")
-public class SCLEntity extends BaseEntity {
-    /**
-     * 编号
-     */
-    @Column(name = "no", columnDefinition = "int(10) comment '编号'")
-    private int no;
-
-    /**
-     * 内容
-     */
-    @Column(name = "content", columnDefinition = "text comment '内容'")
-    private String content;
-
-    @Column(name = "type", columnDefinition = "varchar(2) comment '分量编号 0躯体化 1强迫症状 2人际关系敏感 3抑郁 4焦虑 5敌对 6恐怖 7偏执 8精神病性 9 其他'")
-    private String type;
-
-    @Column(name = "checked", columnDefinition = "varchar(50) comment '选择项'")
-    private String checked;
-}

+ 0 - 56
src/main/java/com/rf/psychological/dao/model/StatusEntity.java

@@ -1,56 +0,0 @@
-package com.rf.psychological.dao.model;
-
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.*;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-
-/**
- * @author zzf
- * @description:状态-特质焦虑量表
- * @date 2021/1/20 18:47
- */
-@Entity
-@Data
-@Getter
-@Setter
-@NoArgsConstructor
-@AllArgsConstructor
-@Table(name = "t_status_info")
-@org.hibernate.annotations.Table(appliesTo = "t_status_info", comment = "状态-特质焦虑量表")
-public class StatusEntity extends BaseEntity {
-
-    /**
-     * 编号
-     */
-    @Column(name = "no", columnDefinition = "int(10) comment '编号'")
-    private int no;
-
-    /**
-     * 内容
-     */
-    @Column(name = "content", columnDefinition = "text comment '内容'")
-    private String content;
-
-    /**
-     * 选项
-     */
-    @Column(name = "check_items", columnDefinition = "text comment '选项'")
-    private String checkItems;
-
-    /**
-     * 默认选项
-     */
-    @Column(name = "checked", columnDefinition = "text comment '默认选项'")
-    private String checked;
-
-    /**
-     * 类型:0反向得分  1正向得分
-     */
-    @Column(name = "type", columnDefinition = "varchar(2) comment '类型:0反向得分  1正向得分'")
-    private String type;
-
-
-}

+ 0 - 12
src/main/java/com/rf/psychological/dao/repository/PSQIRepository.java

@@ -1,12 +0,0 @@
-package com.rf.psychological.dao.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.dao.model.PSQIEntity;
-
-/**
- * @author zzf
- * @description:
- * @date 2021/1/19 16:53
- */
-public interface PSQIRepository extends BaseRepository<PSQIEntity,String> {
-}

+ 0 - 12
src/main/java/com/rf/psychological/dao/repository/SCLRepository.java

@@ -1,12 +0,0 @@
-package com.rf.psychological.dao.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.dao.model.SCLEntity;
-
-/**
- * @author zzf
- * @description:
- * @date 2021/1/20 16:56
- */
-public interface SCLRepository extends BaseRepository<SCLEntity,String> {
-}

+ 0 - 12
src/main/java/com/rf/psychological/dao/repository/StatusRepository.java

@@ -1,12 +0,0 @@
-package com.rf.psychological.dao.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.dao.model.StatusEntity;
-
-/**
- * @author zzf
- * @description:状态-特质焦虑量表
- * @date 2021/1/20 18:50
- */
-public interface StatusRepository extends BaseRepository<StatusEntity,String> {
-}

+ 1 - 1
src/main/java/com/rf/psychological/rest/DeviceController.java

@@ -206,7 +206,7 @@ public class DeviceController extends BaseController {
                 detail.setSuggest(objects.get(9).toString());
                 detail.setRevered(objects.get(10).toString());
                 log.info(detail.toString());
-                detailService.save(detail);
+                //detailService.save(detail);
             }
 
         }catch (Exception e){

+ 0 - 137
src/main/java/com/rf/psychological/scale/rest/ScaleResultController.java

@@ -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);

+ 0 - 24
src/main/java/com/rf/psychological/service/PSQIService.java

@@ -1,24 +0,0 @@
-package com.rf.psychological.service;
-
-import com.rf.psychological.dao.model.PSQIEntity;
-
-import java.util.List;
-
-/**
- * @author zzf
- * @description:
- * @date 2021/1/19 16:54
- */
-public interface PSQIService {
-    /**
-     * 查询全量PSQI列表
-     * @return
-     */
-    List<PSQIEntity> findAll();
-
-    /**
-     * 保存
-     * @return
-     */
-    PSQIEntity saveSubject(PSQIEntity psqiEntity);
-}

+ 0 - 19
src/main/java/com/rf/psychological/service/SCLService.java

@@ -1,19 +0,0 @@
-package com.rf.psychological.service;
-
-import com.rf.psychological.dao.model.SCLEntity;
-
-import java.util.List;
-
-/**
- * @author zzf
- * @description:
- * @date 2021/1/20 16:58
- */
-public interface SCLService {
-    /**
-     * 查询全量SCL列表
-     *
-     * @return
-     */
-    List<SCLEntity> findAll();
-}

+ 0 - 18
src/main/java/com/rf/psychological/service/StatusService.java

@@ -1,18 +0,0 @@
-package com.rf.psychological.service;
-
-import com.rf.psychological.dao.model.StatusEntity;
-
-import java.util.List;
-
-/**
- * @author zzf
- * @description:状态-特质焦虑量表
- * @date 2021/1/20 18:50
- */
-public interface StatusService {
-    /**
-     * 全量查询
-     * @return
-     */
-    List<StatusEntity> findAll();
-}

+ 0 - 40
src/main/java/com/rf/psychological/service/impl/PSQIServiceImpl.java

@@ -1,40 +0,0 @@
-package com.rf.psychological.service.impl;
-
-import com.rf.psychological.dao.model.PSQIEntity;
-import com.rf.psychological.dao.repository.PSQIRepository;
-import com.rf.psychological.service.PSQIService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Sort;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * @author zzf
- * @description:
- * @date 2021/1/19 16:54
- */
-@Service
-public class PSQIServiceImpl implements PSQIService {
-    @Autowired
-    private PSQIRepository psqiRepository;
-    /**
-     * 查询全量PSQI列表
-     *
-     * @return
-     */
-    @Override
-    public List<PSQIEntity> findAll() {
-        return this.psqiRepository.findAll(Sort.by(Sort.Direction.ASC, "no"));
-    }
-
-    /**
-     * 保存
-     *
-     * @return
-     */
-    @Override
-    public PSQIEntity saveSubject(PSQIEntity psqiEntity) {
-        return this.psqiRepository.save(psqiEntity);
-    }
-}

+ 0 - 30
src/main/java/com/rf/psychological/service/impl/SCLServiceImpl.java

@@ -1,30 +0,0 @@
-package com.rf.psychological.service.impl;
-
-import com.rf.psychological.dao.model.SCLEntity;
-import com.rf.psychological.dao.repository.SCLRepository;
-import com.rf.psychological.service.SCLService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Sort;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * @author zzf
- * @description:
- * @date 2021/1/20 16:59
- */
-@Service
-public class SCLServiceImpl implements SCLService {
-    @Autowired
-    private SCLRepository sclRepository;
-    /**
-     * 查询全量SCL列表
-     *
-     * @return
-     */
-    @Override
-    public List<SCLEntity> findAll() {
-        return this.sclRepository.findAll(Sort.by("no"));
-    }
-}

+ 0 - 30
src/main/java/com/rf/psychological/service/impl/StatusServiceImpl.java

@@ -1,30 +0,0 @@
-package com.rf.psychological.service.impl;
-
-import com.rf.psychological.dao.model.StatusEntity;
-import com.rf.psychological.dao.repository.StatusRepository;
-import com.rf.psychological.service.StatusService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Sort;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * @author zzf
- * @description:状态-特质焦虑量表
- * @date 2021/1/20 18:51
- */
-@Service
-public class StatusServiceImpl implements StatusService {
-    @Autowired
-    private StatusRepository statusRepository;
-    /**
-     * 全量查询
-     *
-     * @return
-     */
-    @Override
-    public List<StatusEntity> findAll() {
-        return this.statusRepository.findAll(Sort.by("no"));
-    }
-}

+ 1 - 27
src/main/java/com/rf/psychological/utils/ExcelUtil.java

@@ -712,7 +712,7 @@ public class ExcelUtil {
                                     }
                                 }
                             }
-                            if (clazz.equals(ASKEntity.class) || clazz.equals(MoodEntity.class) || clazz.equals(StatusEntity.class)) {
+                            if (clazz.equals(ASKEntity.class) || clazz.equals(MoodEntity.class) ) {
                                 if (propertyName.equals("checkItems")) {
                                     if (value.equals("yes")) {
                                         value = "是";
@@ -748,32 +748,6 @@ public class ExcelUtil {
                                     }
                                 }
                             }
-                            //分量编号 0躯体化 1强迫症状 2人际关系敏感 3抑郁 4焦虑 5敌对 6恐怖 7偏执 8精神病性 9 其他
-                            if (clazz.equals(SCLEntity.class)) {
-                                if (propertyName.equals("type")) {
-                                    if (value.equals("0")) {
-                                        value = "躯体化";
-                                    } else if (value.equals("1")) {
-                                        value = "强迫症状";
-                                    } else if (value.equals("2")) {
-                                        value = "人际关系敏感";
-                                    } else if (value.equals("3")) {
-                                        value = "抑郁";
-                                    } else if (value.equals("4")) {
-                                        value = "焦虑";
-                                    } else if (value.equals("5")) {
-                                        value = "敌对";
-                                    } else if (value.equals("6")) {
-                                        value = "恐怖";
-                                    } else if (value.equals("7")) {
-                                        value = "偏执";
-                                    } else if (value.equals("8")) {
-                                        value = "精神病性";
-                                    } else if (value.equals("9")) {
-                                        value = "其他";
-                                    }
-                                }
-                            }
                             //类型 1压力指数  2焦虑指数  3抑郁指数
                             if (clazz.equals(DepressEntity.class)) {
                                 if (propertyName.equals("type")) {