Browse Source

添加统计接口

zsf 10 months ago
parent
commit
8136290919
26 changed files with 91 additions and 1895 deletions
  1. 0 48
      src/main/java/com/rf/psychological/dao/model/HearingTestEntity.java
  2. 0 41
      src/main/java/com/rf/psychological/dao/repository/HearingTestRepository.java
  3. 1 0
      src/main/java/com/rf/psychological/douyin/config/DouYinConfig.java
  4. 1 2
      src/main/java/com/rf/psychological/douyin/util/SignUtil.java
  5. 1 1
      src/main/java/com/rf/psychological/filter/JWTInterceptorConfig.java
  6. 1 5
      src/main/java/com/rf/psychological/filter/JWTInterceptorPublicConfig.java
  7. 2 166
      src/main/java/com/rf/psychological/rest/DeviceController.java
  8. 0 51
      src/main/java/com/rf/psychological/scale/dao/model/PsychologicalCapitalEntity.java
  9. 0 30
      src/main/java/com/rf/psychological/scale/dao/repository/PsychologicalCapitalRepository.java
  10. 2 0
      src/main/java/com/rf/psychological/scale/dao/repository/UserRecordRepository.java
  11. 11 37
      src/main/java/com/rf/psychological/scale/rest/CognizeResultController.java
  12. 0 291
      src/main/java/com/rf/psychological/scale/rest/HearingTestController.java
  13. 0 88
      src/main/java/com/rf/psychological/scale/rest/PsychologicalCapitalController.java
  14. 3 102
      src/main/java/com/rf/psychological/scale/rest/SubjectController.java
  15. 18 0
      src/main/java/com/rf/psychological/scale/rest/UserRecordController.java
  16. 14 33
      src/main/java/com/rf/psychological/scale/rest/WebScaleResultController.java
  17. 0 104
      src/main/java/com/rf/psychological/scale/resultBusiness/cognitiveResult/PSYCAPITALCognize.java
  18. 0 38
      src/main/java/com/rf/psychological/scale/service/HearingTestService.java
  19. 0 28
      src/main/java/com/rf/psychological/scale/service/PsychologicalCapitalService.java
  20. 2 0
      src/main/java/com/rf/psychological/scale/service/UserRecordService.java
  21. 0 68
      src/main/java/com/rf/psychological/scale/service/impl/HearingTestServiceImpl.java
  22. 0 43
      src/main/java/com/rf/psychological/scale/service/impl/PsychologicalCapitalServiceImpl.java
  23. 5 0
      src/main/java/com/rf/psychological/scale/service/impl/UserRecordServiceImpl.java
  24. 15 2
      src/main/java/com/rf/psychological/security/DESede.java
  25. 2 2
      src/main/java/com/rf/psychological/security/SSLConfig.java
  26. 13 715
      src/main/java/com/rf/psychological/utils/Constant.java

+ 0 - 48
src/main/java/com/rf/psychological/dao/model/HearingTestEntity.java

@@ -1,48 +0,0 @@
-package com.rf.psychological.dao.model;
-
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.*;
-import org.hibernate.annotations.DynamicUpdate;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-
-/**
- * @author zsf
- * @description:听觉词语学习测验(华山版)
- * @date 2021/5/13 11:02
- */
-@Entity
-@Data
-@Getter
-@Setter
-@NoArgsConstructor
-@AllArgsConstructor
-@Table(name = "t_hearing_test" )
-@org.hibernate.annotations.Table(appliesTo = "t_hearing_test", comment = "听觉词语学习测验(华山版)表")
-@DynamicUpdate
-public class HearingTestEntity extends BaseEntity {
-
-    @Column(name = "phone",columnDefinition = "varchar(11) not null comment '用户手机号'")
-    private String phone;
-
-    @Column(name = "round",columnDefinition = "varchar(5) not null comment '所属轮次'")
-    private String round;
-
-    @Column(name = "correct_no",columnDefinition = "int(4) comment '正确数'")
-    private String correctNo;
-
-    @Column(name = "grade",columnDefinition = "int(4) comment '得分'")
-    private String grade;
-
-    @Column(name = "status",columnDefinition = "int(2) not null comment '状态:0-已结束;1-进行中'")
-    private int status;
-
-    @Column(name = "test_date",columnDefinition = "varchar(50) not null comment '测试日期'")
-    private String testDate;
-
-    @Column(name = "correlation",columnDefinition = "varchar(36) comment '关联测试id'")
-    private String correlation;
-
-}

+ 0 - 41
src/main/java/com/rf/psychological/dao/repository/HearingTestRepository.java

@@ -1,41 +0,0 @@
-package com.rf.psychological.dao.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.dao.model.HearingTestEntity;
-import org.springframework.data.jpa.repository.Modifying;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.query.Param;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-
-/**
- * @author zsy
- * @description:
- * @date 2021/5/14 10:54
- */
-public interface HearingTestRepository extends BaseRepository<HearingTestEntity,String> {
-
-    /**
-     * 根据id修改状态
-     * @param id
-     */
-    @Transactional
-    @Modifying(clearAutomatically = true)
-    @Query(value="update t_hearing_test set status = '0' where id = :id ",nativeQuery=true)
-    void updateStatus(@Param("id")String id);
-
-    /**
-     * 根据phone获取用户进行中任务
-     * @param phone
-     */
-    @Query(value="select * from t_hearing_test where status = '1' and binary phone = :phone",nativeQuery=true)
-    List<HearingTestEntity> getHearingTestList(@Param("phone") String phone);
-    /**
-     * 清除进行中任务
-     * @param
-     */
-    @Transactional
-    @Modifying(clearAutomatically = true)
-    @Query(value="update t_hearing_test set status = '0' where status = '1' and binary phone = :phone",nativeQuery=true)
-    void clearHearing(@Param("phone") String phone);}

+ 1 - 0
src/main/java/com/rf/psychological/douyin/config/DouYinConfig.java

@@ -12,6 +12,7 @@ import org.springframework.context.annotation.Configuration;
  */
 @Data
 @Configuration
+@ConfigurationProperties(prefix = "douyin")
 @ConditionalOnProperty(prefix="douyin",name = "isDouYin", havingValue = "true")
 public class DouYinConfig {
 

+ 1 - 2
src/main/java/com/rf/psychological/douyin/util/SignUtil.java

@@ -40,8 +40,7 @@ public class SignUtil {
      *
      * Payment key value, you need to replace it with your own key
      */
-    //private static final String SALT = "I9mmeXYF5lvXonBkvohpVnHOqm2LMJQhLZbrAFDK";
-    private static final String SALT = "YqZmSCq156ZfbM8Fg5QhhJhR1KQZiG4QCt9kayez";
+    private static final String SALT = "I9mmeXYF5lvXonBkvohpVnHOqm2LMJQhLZbrAFDK";
 
     /**
      * callbackToken 是平台上配置的token

+ 1 - 1
src/main/java/com/rf/psychological/filter/JWTInterceptorConfig.java

@@ -31,7 +31,7 @@ public class JWTInterceptorConfig implements WebMvcConfigurer {
         String[] webLogin = new String[]{"/user/authCode", "/user/saveUser", "/user/webLogin", "/user/webUpdatePassword", "/user/*/checkUser"};
         String[] automaticImport = new String[]{"/category/loadCategory", "/subjectInfo", "/subjectInfoList", "/importTest", "/subjectInfoUpload/importTest", "/subjectInfo/update", "/subjectInfoUpload/update"};
         String[] wxPay = new String[]{"/api/wx-pay/native/notify","/api/wx-pay/refunds/notify","/api/wx-pay/code2openid"};
-        String[] systemApi = new String[]{"/system/login","/system/forgotPassword","/system/registerUser","/system/update/*","/v1/getToken","/v1/registerUser"};
+        String[] systemApi = new String[]{"/system/login","/system/forgotPassword","/system/registerUser","/system/update/*","/v1/getToken","/v1/registerUser","/api/douyin/code2Session"};
         String[] temporarily = new String []{"/category/**","/api/wx-pay/**"};
         registry.addInterceptor(jwtInterceptor)
                 .addPathPatterns("/**")

+ 1 - 5
src/main/java/com/rf/psychological/filter/JWTInterceptorPublicConfig.java

@@ -38,7 +38,7 @@ public class JWTInterceptorPublicConfig implements WebMvcConfigurer {
         String[] wxPay = new String[]{"/api/wx-pay/native/notify","/api/wx-pay/refunds/notify",
                 "/api/wx-pay/getPhone/*","/api/wx-pay/code2openid","/api/wx-pay/h5Pay",
                 "/api/wx-pay/code2openid2","/api/wx-pay/queryOrder/**","/api/promotionInfo/queryPromotionDetail/**","/record/getWeiboRecordById","/record/getWeiboRecordById/**"};
-        String[] systemApi = new String[]{"/system/login","/system/loginH5","/system/forgotPassword","/system/registerUser","/system/temporaryUser","/result/**"};
+        String[] systemApi = new String[]{"/system/login","/system/loginH5","/system/forgotPassword","/system/registerUser","/system/temporaryUser","/api/douyin/code2Session","/result/**"};
         registry.addInterceptor(jwtInterceptor)
                 .addPathPatterns("/**")
                 .excludePathPatterns("/", "/index**", "/error")
@@ -46,9 +46,7 @@ public class JWTInterceptorPublicConfig implements WebMvcConfigurer {
                 .excludePathPatterns(automaticImport)
                 .excludePathPatterns(wxPay)
                 .excludePathPatterns(systemApi)
-                .excludePathPatterns("/user/saveUserV2", "/institution/saveUser")
                 .excludePathPatterns(webLogin)
-                .excludePathPatterns("/user/LANSaveUserInfo", "/user/LANLogin", "/user/LANUpdatePassword")
                 .excludePathPatterns("/file/**", "/result/download/**")
                 .excludePathPatterns("/download/**")
                 .excludePathPatterns("/apk/**")
@@ -68,9 +66,7 @@ public class JWTInterceptorPublicConfig implements WebMvcConfigurer {
                 .excludePathPatterns(automaticImport)
                 .excludePathPatterns(wxPay)
                 .excludePathPatterns(systemApi)
-                .excludePathPatterns("/user/saveUserV2", "/institution/saveUser")
                 .excludePathPatterns(webLogin)
-                .excludePathPatterns("/user/LANSaveUserInfo", "/user/LANLogin", "/user/LANUpdatePassword")
                 .excludePathPatterns("/file/**", "/result/download/**")
                 .excludePathPatterns("/download/**")
                 .excludePathPatterns("/apk/**")

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

@@ -64,27 +64,8 @@ public class DeviceController extends BaseController {
         File file = new File("C:\\Users\\Administrator\\Desktop\\标准情商测试.xlsx");
         try {
             List<List<List<Object>>> datas = ExcelUtil.getBankListByExcelSheet(new FileInputStream(file.getAbsolutePath()), file.getName());
-            List<ScaleEntity> scaleEntities = scaleService.getScaleByFlag("20210820143117");
-            List<List<Object>> an = datas.get(1);
-            for (ScaleEntity scaleEntity :scaleEntities){
-                log.info("------"+scaleEntity.getCheckItems());
-                String no = scaleEntity.getQuestionNo();
-                String item =null;
-                for (List<Object> objects :an){
-                    if (objects.get(0).equals(no)){
-                        if (StringUtils.isEmpty(item)){
-                            item = objects.get(1).toString();
-                        }else {
-                            item = item+";"+objects.get(1).toString();
-                        }
-                    }
-                }
-                scaleEntity.setCheckItems(item);
-                log.info("------"+scaleEntity.getCheckItems());
-                //scaleService.saveScale(scaleEntity);
-            }
-
-
+            List<ScaleMarksEntity> scaleEntities = scaleMarksService.getScaleMarksByFlag("20240516150818");
+            List<List<Object>> an = datas.get(0);
 //            marksObj.forEach(item ->{
 //                ScaleMarksEntity entity = new ScaleMarksEntity();
 //                entity.setName("总分");
@@ -118,151 +99,6 @@ public class DeviceController extends BaseController {
         } catch (Exception e) {
             e.printStackTrace();
         }
-
-        /*File file = new File("d:/11/竞品量表筛选后基本信息.xlsx");
-        try {
-            List<List<List<Object>>> datas = ExcelUtil.getBankListByExcelSheet(new FileInputStream(file.getAbsolutePath()), file.getName());
-            //根据flag获取量表名称
-            List<SubjectEntity> subjectEntities = this.subjectService.findAll("0");
-            //获取题目信息并入库
-            List<List<Object>> sheet0 = datas.get(0);
-            for (int i = 0; i < sheet0.size(); i++) {
-                List<Object> scales = sheet0.get(i);
-                for (SubjectEntity subject:subjectEntities) {
-                    if (subject.getName().equals(scales.get(0).toString())){
-                        System.out.println("YXL:"+scales.get(0).toString());
-                    }
-                }
-            }
-            List<List<Object>> sheet1 = datas.get(1);
-            for (int i = 0; i < sheet1.size(); i++) {
-                List<Object> scales = sheet1.get(i);
-                for (SubjectEntity subject:subjectEntities) {
-                    if (subject.getName().equals(scales.get(0).toString())){
-                        System.out.println("JL:"+scales.get(0).toString());
-                    }
-                }
-            }
-
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }*/
-
-        //新增判断标准
-        /*String flag = "111aaa";
-        File file = new File("d:/22/心理年龄测试.xlsx");
-        List<List<List<Object>>> datas = ExcelUtil.getBankListByExcelSheet(new FileInputStream(file.getAbsolutePath()), file.getName());
-        //获取判断标准信息并入库
-        List<List<Object>> sheet2 = datas.get(2);
-        for (int i = 0; i < sheet2.size(); i++) {
-            List<Object> scaleMarks = sheet2.get(i);
-            if (scaleMarks.size() < 10){
-                //删除量表判断标准信息
-                this.scaleMarksService.deleteScaleMarkByFlag(flag);
-            }
-            ScaleMarksEntity scaleMarksEntity = new ScaleMarksEntity();
-            scaleMarksEntity.setFlag(flag);
-            scaleMarksEntity.setName(scaleMarks.get(1).toString());
-            scaleMarksEntity.setImprovementSuggestions(scaleMarks.get(7).toString());
-            scaleMarksEntity.setSymptom(scaleMarks.get(5).toString());
-            scaleMarksEntity.setScoreEnd(scaleMarks.get(3).toString());
-            scaleMarksEntity.setScoreStart(scaleMarks.get(2).toString());
-            scaleMarksEntity.setIsTotalScoreExplain(scaleMarks.get(9).toString());
-            scaleMarksEntity.setNameExplain(scaleMarks.get(6).toString());
-            scaleMarksEntity.setReference(scaleMarks.get(4).toString());
-            scaleMarksEntity.setStandardDeviation("无");
-            scaleMarksEntity.setSuggestion(scaleMarks.get(8).toString());
-            scaleMarksEntity.setScoringType("0");
-            this.scaleMarksService.saveScaleMarks(scaleMarksEntity);
-
-        }*/
-        //获取维度信息并入库
-        /*List<List<Object>> sheet3 = datas.get(3);
-        for (int i = 0; i < sheet3.size(); i++) {
-            List<Object> dimensions = sheet3.get(i);
-            if (dimensions.size() < 2){
-                //删除量表维度信息
-                this.dimensionService.deleteDimensionByFlag(flag);
-            }
-            DimensionEntity dimensionEntity = new DimensionEntity();
-            dimensionEntity.setFlag(flag);
-            //dimensionEntity.setName(DESede.encryptString(dimensions.get(0).toString()));
-            //dimensionEntity.setQuestionNo(DESede.encryptString(dimensions.get(1).toString()));
-            dimensionEntity.setName(dimensions.get(0).toString());
-            dimensionEntity.setIsIconFlag("0");
-            dimensionEntity.setQuestionNo(dimensions.get(1).toString());
-            this.dimensionService.saveDimension(dimensionEntity);
-        }*/
-
-        /*String flag = "20230907180052";
-        //根据flag获取全部选项
-        List<ScaleEntity> scaleEntities = this.scaleService.getScaleByFlag(flag);
-        //根据flag获取全部答案
-        List<AnswerEntity> answerEntities = this.answerService.getAnswerByFlag(flag);
-        //根据flag获取全部评分规则
-        List<ScaleMarksEntity> scaleMarksEntities = this.scaleMarksService.getScaleMarksByFlag(flag);
-        //根据flag获取全部维度信息
-        List<DimensionEntity> dimensionEntities = this.dimensionService.getDimensionByFlag(flag);
-        //根据flag获取量表名称
-        List<SubjectEntity> subjectEntities = this.subjectService.getSubjectByFlag(flag);
-        System.out.println("answerEntities==="+JSONObject.toJSON(answerEntities));
-        System.out.println("dimensionEntities==="+JSONObject.toJSON(dimensionEntities));
-        System.out.println("scaleMarksEntities==="+JSONObject.toJSON(scaleMarksEntities));
-        System.out.println("scaleEntities==="+JSONObject.toJSON(scaleEntities));
-        System.out.println("subjectEntities==="+JSONObject.toJSON(subjectEntities));*/
-
-
-        //根据flag获取全部选项
-        //List<ScaleEntity> scaleEntities = this.scaleService.findAll();
-        //根据flag获取全部答案
-        //List<AnswerEntity> answerEntities = this.answerService.findAll();
-        //根据flag获取全部评分规则
-        //List<ScaleMarksEntity> scaleMarksEntities = this.scaleMarksService.findAll();
-        //根据flag获取全部维度信息
-        //List<DimensionEntity> dimensionEntities = this.dimensionService.findAll();
-        //根据flag获取量表名称
-        //List<SubjectEntity> subjectEntities = this.subjectService.findAll("1");
-
-
-        /*for (SubjectEntity subjectEntity:subjectEntities){
-            //String description = DESede.encryptString(subjectEntity.getDescription());
-            subjectEntity.setDescription(DESede.encryptString(subjectEntity.getDescription()));
-            this.subjectService.update(subjectEntity);
-        }
-
-        for (AnswerEntity answerEntity:answerEntities){
-            answerEntity.setName(DESede.encryptString(answerEntity.getName()));
-            answerEntity.setScore(DESede.encryptString(answerEntity.getScore()));
-            this.answerService.updateAnswer(answerEntity);
-
-        }
-        for (ScaleEntity scaleEntity:scaleEntities){
-            scaleEntity.setAnswer(DESede.encryptString(scaleEntity.getAnswer()));
-            scaleEntity.setCheckItems(DESede.encryptString(scaleEntity.getCheckItems()));
-            this.scaleService.updateScale(scaleEntity);
-
-        }
-        for (ScaleMarksEntity scaleMarksEntity:scaleMarksEntities){
-            scaleMarksEntity.setName(DESede.encryptString(scaleMarksEntity.getName()));
-            scaleMarksEntity.setScoreStart(DESede.encryptString(scaleMarksEntity.getScoreStart()));
-            scaleMarksEntity.setScoreEnd(DESede.encryptString(scaleMarksEntity.getScoreEnd()));
-            scaleMarksEntity.setSymptom(DESede.encryptString(scaleMarksEntity.getSymptom()));
-            scaleMarksEntity.setImprovementSuggestions(DESede.encryptString(scaleMarksEntity.getImprovementSuggestions()));
-            scaleMarksEntity.setNameExplain(DESede.encryptString(scaleMarksEntity.getNameExplain()));
-            scaleMarksEntity.setReference(DESede.encryptString(scaleMarksEntity.getReference()));
-            scaleMarksEntity.setSuggestion(DESede.encryptString(scaleMarksEntity.getSuggestion()));
-            scaleMarksEntity.setStandardDeviation(DESede.encryptString(scaleMarksEntity.getStandardDeviation()));
-            this.scaleMarksService.updateMark(scaleMarksEntity);
-
-        }
-        for (DimensionEntity dimensionEntity:dimensionEntities){
-            dimensionEntity.setName(DESede.encryptString(dimensionEntity.getName()));
-            dimensionEntity.setQuestionNo(DESede.encryptString(dimensionEntity.getQuestionNo()));
-            this.dimensionService.updateDimension(dimensionEntity);
-
-        }*/
-
         return "hello";
     }
 

+ 0 - 51
src/main/java/com/rf/psychological/scale/dao/model/PsychologicalCapitalEntity.java

@@ -1,51 +0,0 @@
-package com.rf.psychological.scale.dao.model;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import org.hibernate.annotations.DynamicUpdate;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Index;
-import javax.persistence.Table;
-import java.time.LocalDateTime;
-
-/**
- * @author zsy
- * @description: 心理资本认知任务实体类
- * @date 2022/5/28 16:15
- */
-@Entity
-@Data
-@EqualsAndHashCode(callSuper=true)
-@NoArgsConstructor
-@AllArgsConstructor
-@Table(name = "t_psychological_capital")
-@org.hibernate.annotations.Table(appliesTo = "t_psychological_capital", comment = "心理资本信息表")
-@DynamicUpdate
-public class PsychologicalCapitalEntity extends BaseEntity {
-
-    @Column(name = "task_mark", columnDefinition = "varchar(60) comment '任务关联标识(phone-机构编号-测试时间)'")
-    private String taskMark;
-
-    @Column(name = "hierarchy", columnDefinition = "varchar(10) comment '层级(1.1;1.2;1.3;2.1;2.2)'")
-    private String hierarchy;
-
-    @Column(name = "record_id", columnDefinition = "varchar(500) comment '测试记录id和用户基本信息'")
-    private String recordId;
-
-    @Column(name = "group_index", columnDefinition = "varchar(10) comment '1:高心理资本;2:低心理资本'")
-    private String groupIndex;
-
-    @Column(name = "strong_type", columnDefinition = "varchar(10) comment '1:强说服信息;2:弱说服信息'")
-    private String strongType;
-
-    @Column(name = "test_date", columnDefinition = "varchar(50) not null comment '测试日期'")
-    private String testDate;
-
-
-}

+ 0 - 30
src/main/java/com/rf/psychological/scale/dao/repository/PsychologicalCapitalRepository.java

@@ -1,30 +0,0 @@
-package com.rf.psychological.scale.dao.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.dao.model.CognitiveTaskEntity;
-import com.rf.psychological.group.dao.dto.GroupAuthConTaskDto;
-import com.rf.psychological.scale.dao.model.PsychologicalCapitalEntity;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Pageable;
-import org.springframework.data.jpa.repository.Modifying;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.query.Param;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-
-/**
- * @author zsy
- * @description:Category
- * @date 2021/6/17 15:55
- */
-public interface PsychologicalCapitalRepository extends BaseRepository<PsychologicalCapitalEntity, String> {
-
-    /**
-     * 根据任务关联标识获取信息
-     * @param taskMark
-     */
-    @Query(value = "select * from t_psychological_capital where task_mark =:taskMark ", nativeQuery = true)
-    List<PsychologicalCapitalEntity> getPsychologicalCapitalList(@Param("taskMark") String taskMark);
-
-}

+ 2 - 0
src/main/java/com/rf/psychological/scale/dao/repository/UserRecordRepository.java

@@ -327,4 +327,6 @@ public interface UserRecordRepository extends BaseRepository<UserRecordEntity, S
 
 
     int countAllByFlagAndTestDateGreaterThanEqual(String flag,String testDate);
+
+    int countAllByFlag(String flag);
 }

+ 11 - 37
src/main/java/com/rf/psychological/scale/rest/CognizeResultController.java

@@ -1,35 +1,26 @@
 package com.rf.psychological.scale.rest;
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.auth0.jwt.interfaces.DecodedJWT;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import com.rf.psychological.base.rest.BaseController;
-import com.rf.psychological.dao.cognizeModel.*;
-import com.rf.psychological.dao.model.*;
-import com.rf.psychological.file.excel.ExcelBean;
 import com.rf.psychological.institution.service.InstitutionService;
 import com.rf.psychological.opLog.annotation.OperationLogAnnotation;
 import com.rf.psychological.plan.dao.model.TestPlanEntity;
 import com.rf.psychological.plan.service.TestPlanContendService;
 import com.rf.psychological.plan.service.TestPlanService;
 import com.rf.psychological.plan.service.TestPlanUserService;
-import com.rf.psychological.rest.ServerController;
-import com.rf.psychological.scale.dao.model.PsychologicalCapitalEntity;
 import com.rf.psychological.scale.dao.model.ScaleConfigEntity;
 import com.rf.psychological.scale.dao.model.UserRecordEntity;
-import com.rf.psychological.scale.service.PsychologicalCapitalService;
+import com.rf.psychological.scale.service.CognitiveTaskService;
 import com.rf.psychological.scale.service.ScaleConfigService;
+import com.rf.psychological.scale.service.UserRecordService;
 import com.rf.psychological.security.AesEncryptUtils;
 import com.rf.psychological.security.SafetyProcess;
-import com.rf.psychological.scale.service.CognitiveTaskService;
-import com.rf.psychological.scale.service.UserRecordService;
 import com.rf.psychological.user.dao.model.UserEntity;
 import com.rf.psychological.user.service.UserService;
-import com.rf.psychological.socket.MyClient;
-import com.rf.psychological.utils.*;
-import com.rf.psychological.file.excel.ExcelClass;
+import com.rf.psychological.utils.AgeUtil;
+import com.rf.psychological.utils.Constant;
+import com.rf.psychological.utils.Result;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -37,18 +28,14 @@ import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletRequest;
-import java.io.File;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
-import java.time.LocalDateTime;
-import java.util.*;
-import java.util.stream.Collectors;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
 
 /**
  * @author zzf
@@ -79,8 +66,7 @@ public class CognizeResultController extends BaseController {
     @Autowired
     private TestPlanService testPlanService;
 
-    @Autowired
-    private PsychologicalCapitalService psychologicalCapitalService;
+
 
     @Autowired
     private ScaleConfigService scaleConfigService;
@@ -156,19 +142,7 @@ public class CognizeResultController extends BaseController {
         paramJson.put("testTime", testTime);
         paramJson.put("type", type);
         paramJson.put("jsonObject", jsonObject);
-        if (Constant.QUEST_TYPE_PSY_CAPITAL.equals(type)) {
-            String taskMark = jsonObject.getString("taskMark");
-            List<PsychologicalCapitalEntity> psyCapitalList = this.psychologicalCapitalService.getPsychologicalCapitalList(taskMark);
-            List<UserRecordEntity> userRecordEntities = new ArrayList<UserRecordEntity>();
-            for (PsychologicalCapitalEntity psyCapital : psyCapitalList) {
-                if (!psyCapital.getHierarchy().equals("1.0")){
-                    UserRecordEntity userRecordEntity = this.userRecordService.getUserRecordById(psyCapital.getRecordId());
-                    userRecordEntities.add(userRecordEntity);
-                }
-            }
-            paramJson.put("psyCapitalList", psyCapitalList);
-            paramJson.put("userRecordEntities", userRecordEntities);
-        }
+
 
         ScaleConfigEntity scaleConfigByFlag = scaleConfigService.findScaleConfigByFlag(type);
         if (scaleConfigByFlag == null) {

+ 0 - 291
src/main/java/com/rf/psychological/scale/rest/HearingTestController.java

@@ -1,291 +0,0 @@
-package com.rf.psychological.scale.rest;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.rf.psychological.base.rest.BaseController;
-import com.rf.psychological.file.excel.ExcelClass;
-import com.rf.psychological.dao.model.HearingTestEntity;
-import com.rf.psychological.dao.model.ObjectEntity;
-import com.rf.psychological.user.dao.model.UserEntity;
-import com.rf.psychological.scale.dao.model.UserRecordEntity;
-import com.rf.psychological.opLog.annotation.OperationLogAnnotation;
-import com.rf.psychological.security.AesEncryptUtils;
-import com.rf.psychological.security.SafetyProcess;
-import com.rf.psychological.scale.service.CognitiveTaskService;
-import com.rf.psychological.scale.service.HearingTestService;
-import com.rf.psychological.scale.service.UserRecordService;
-import com.rf.psychological.user.service.UserService;
-import com.rf.psychological.utils.*;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-
-/**
- * @author zsy
- * @description:听觉词语学习测验(华山版)
- * @date 2021/6/17 15:55
- */
-
-@Slf4j
-@RestController
-@RequestMapping("/hearing")
-@Api(tags = "听觉词语学习测验(华山版)")
-public class HearingTestController extends BaseController {
-
-    @Autowired
-    private HearingTestService hearingTestService;
-
-    @Autowired
-    private UserService userService;
-
-    @Autowired
-    private UserRecordService userRecordService;
-
-    @Autowired
-    private CognitiveTaskService cognitiveTaskService;
-
-    /**
-     * 添加听觉词语学习测验(华山版)信息
-     *
-     * @param
-     * @return
-     */
-    @SafetyProcess
-    @OperationLogAnnotation
-    @PostMapping("/saveHearingTest")
-    @ApiOperation("添加听觉词语学习测验(华山版)信息")
-    public Result saveHearingTest(@RequestBody String json) throws Exception {
-        //public Result saveMemoryCheck(@RequestBody JSONObject jsonObject ) throws Exception {
-        String data = AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data"));
-        JSONObject jsonObject = JSONObject.parseObject(data);
-        String userId = jsonObject.getString("userId");
-        String testPlanId = "0";
-        if (jsonObject.containsKey("testPlanId")) {
-            testPlanId = jsonObject.getString("testPlanId");
-        }
-        UserEntity userEntity = this.userService.getOne(userId);
-        String phone = userEntity.getPhone();
-        String institutionNo = userEntity.getInstitutionNo();
-
-        DateFormat df = new SimpleDateFormat("yyyyMMddHHmm");
-        //当前时间
-        String testTime = df.format(new Date());
-        JSONArray jsonArray = jsonObject.getJSONArray("HearingTests");
-        //答题结果列表
-        List<HearingTestEntity> dataList = jsonArray.toJavaList(HearingTestEntity.class);
-        //创建测试记录所需信息
-        List<HearingTestEntity> hearingTestEntityList = new ArrayList<>();
-        int y = 0;
-        for (HearingTestEntity hearingTestEntity : dataList) {
-            hearingTestEntity.setPhone(phone);
-            hearingTestEntity.setTestDate(testTime);
-            hearingTestEntity.setStatus(1);
-            if (hearingTestEntity.getRound().equals("7")) {
-                this.hearingTestService.save(hearingTestEntity);
-                //根据phone获取用户进行中任务
-                hearingTestEntityList = this.hearingTestService.getHearingTestList(phone);
-                for (HearingTestEntity hearingTestEntity1 : hearingTestEntityList) {
-                    this.hearingTestService.updateStatus(hearingTestEntity1.getId());
-                }
-            } else {
-                y++;
-                this.hearingTestService.save(hearingTestEntity);
-                if (dataList.size() == y) {
-                    return success();
-                }
-            }
-        }
-        String datas = new String();
-        //生成测试记录文件并在数据库插入用户测试记录
-        String userName = userEntity.getPetName();
-        String userBirthday = userEntity.getBirthday();
-        String userSex = userEntity.getGender();
-        if (userSex.equals("0")) {
-            userSex = "男";
-        } else {
-            userSex = "女";
-        }
-        testTime = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒").format(new Date());
-        String fileName = userName + Constant.SPLIT_CHAR + userBirthday + Constant.SPLIT_CHAR + userSex + Constant.SPLIT_CHAR + testTime;
-        String testResult = new String();
-        String name = new String();
-        List<Map<String, String>> resultMapList = new ArrayList<>();
-        // 创建返回的json对象
-        JSONObject resultJson = new JSONObject(true);
-        // 创建入库的json对象
-        JSONObject resultDBJson = new JSONObject(true);
-
-        List<ObjectEntity> objectEntityList = new ArrayList<>();
-        int x = 1;
-        for (HearingTestEntity hearingTestEntity : hearingTestEntityList) {
-
-            ObjectEntity objectEntity1 = new ObjectEntity();
-            objectEntity1.setKey("N"+x);
-            objectEntity1.setValue(String.valueOf(hearingTestEntity.getGrade()));
-            resultJson.put("N"+x, String.valueOf(hearingTestEntity.getGrade()));
-            objectEntityList.add(objectEntity1);
-            x++;
-        }
-        datas = hearingTestEntityList.toString();
-        fileName = fileName + Constant.SPLIT_CHAR + Constant.SHEET_NAME_MTH + ".xlsx";
-        name = Constant.SHEET_NAME_MTH;
-        ExcelUtil.createExcelFile(ObjectEntity.class, objectEntityList, null, new ExcelClass().contentExcel(Constant.QUEST_TYPE_MTH), fileName, Constant.SHEET_NAME_MTH);
-
-        // 获取JSON第一层所有的key
-        Set<String> keys = resultJson.keySet();
-
-        //计算结果
-        JSONArray dbJsonList = new JSONArray();
-        JSONObject dbJson = new JSONObject(true);
-        JSONArray tableContext = new JSONArray();
-        //列名
-        List colNames = new ArrayList();
-        colNames.add("项目");
-        colNames.add("内容");
-        dbJson.put("colNames", colNames);
-
-        // 获取第一层每个key对应的值 的类型
-        for (String key : keys) {
-            //列值
-            List colValue = new ArrayList();
-            colValue.add(resultJson.get(key));
-            JSONObject row = new JSONObject();
-            row.put("name", key);
-            row.put("value", colValue);
-            tableContext.add(row);
-        }
-        dbJson.put("tableContext", tableContext);
-        dbJsonList.add(dbJson);
-        int i = 1;
-        // 获取第一层每个key对应的值 的类型
-        for (String key : keys) {
-            if (i == keys.size()) {
-                testResult += key + ":" + resultJson.get(key);
-            } else {
-                testResult += key + ":" + resultJson.get(key) + ";";
-            }
-            i++;
-        }
-
-        //测试记录
-        String filePath;
-        if (OSUtil.isLinux()) {
-            filePath = "./心理检测/检测结果/" + new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + "/" + name + "/" + fileName;
-        } else {
-            filePath = "./心理检测/检测结果/" + new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + "/" + name + "/" + fileName;
-        }
-        UserRecordEntity userRecordEntity = testRecord("MTH", phone, institutionNo, testTime, filePath, dbJsonList.toString(), name, "", datas, testResult, testPlanId);
-        System.out.println("resultJson:" + resultJson);
-        return success(userRecordEntity.getId(), "完成");
-
-    }
-
-    private UserRecordEntity testRecord(String flag, String phone, String institutionNo, String testTime, String fileName, String testResult, String name, String b64Img, String datas, String testResults, String testPlanId) {
-        //根据taskCode记录测试数
-        this.cognitiveTaskService.addTestNum(flag);
-        //添加用户测试记录
-        UserRecordEntity userRecordEntity = new UserRecordEntity();
-        userRecordEntity.setFlag(flag);
-        userRecordEntity.setPhone(phone);
-        userRecordEntity.setInstitutionNo(institutionNo);
-        userRecordEntity.setTestDate(testTime);
-        userRecordEntity.setTestResult(testResult);
-        userRecordEntity.setType("1");
-        userRecordEntity.setFileName(fileName);
-        userRecordEntity.setName(name);
-        userRecordEntity.setImg(b64Img);
-        userRecordEntity.setTestRecord(datas);
-        userRecordEntity.setTestResults(testResults);
-        if (testPlanId == null || testPlanId.equals("")) {
-            userRecordEntity.setTestPlanId("0");
-        } else {
-            userRecordEntity.setTestPlanId(testPlanId);
-        }
-        this.userRecordService.save(userRecordEntity);
-        return userRecordEntity;
-    }
-
-
-    /**
-     * 查询后续测试是否可用
-     *
-     * @return
-     */
-    @SafetyProcess
-    @PostMapping("/getIfUsable")
-    @ApiOperation(value = "查询后续测试是否可用")
-    public Result getIfUsable(@RequestBody String json) throws Exception {
-        String data = AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data"));
-        JSONObject jsonObject = JSONObject.parseObject(data);
-        System.out.println("----------------result-------------------");System.out.println(jsonObject);
-        String phone = jsonObject.getString("phone");
-        //根据phone获取用户进行中任务
-        List<HearingTestEntity> hearingTestEntityList = this.hearingTestService.getHearingTestList(phone);
-        // 创建返回的json对象
-        JSONObject resultJson = new JSONObject(true);
-        resultJson.put("hearingTestEntityList",hearingTestEntityList);
-        resultJson.put("waitTime",0);
-        if (hearingTestEntityList.size() > 0) {
-            DateFormat df = new SimpleDateFormat("yyyyMMddHHmm");
-            //当前时间
-            Date endTime = df.parse(DateUtil.getNowTime("yyyyMMddHHmm"));
-            //开始时间
-            Date beginTime = df.parse(hearingTestEntityList.get(hearingTestEntityList.size()-1).getTestDate());
-            //计算时间差---分钟
-            int diff = DateUtil.getDistanceByUnit(beginTime, endTime, 2);
-            if (hearingTestEntityList.get(hearingTestEntityList.size()-1).getRound().equals("3")){
-                if (diff < 0 || diff >= 5) {
-                    resultJson.put("hearingTestEntityList",hearingTestEntityList);
-                    resultJson.put("waitTime",0);
-                    return success(resultJson);
-                } else {
-                    int a = 5 - diff;
-                    resultJson.put("hearingTestEntityList",hearingTestEntityList);
-                    resultJson.put("waitTime",a);
-                    return success(resultJson, "还未到时间");
-                }
-            }else if (hearingTestEntityList.get(hearingTestEntityList.size()-1).getRound().equals("4")){
-                if (diff < 0 || diff >= 20) {
-                    resultJson.put("hearingTestEntityList",hearingTestEntityList);
-                    resultJson.put("waitTime",0);
-                    return success(resultJson);
-                } else {
-                    int a = 20 - diff;
-                    resultJson.put("hearingTestEntityList",hearingTestEntityList);
-                    resultJson.put("waitTime",a);
-                    return success(resultJson, "还未到时间");
-                }
-            }
-        }
-        return success(resultJson, "请先进行第一轮测试");
-    }
-
-    /**
-     * 清除进行中任务
-     *
-     * @return
-     */
-    @SafetyProcess
-    @OperationLogAnnotation
-    @PostMapping("/clearHearing")
-    @ApiOperation(value = "清除进行中任务")
-    public Result clearHearing(@RequestBody String json) throws Exception {
-        //public Result saveMemoryCheck(@RequestBody JSONObject jsonObject ) throws Exception {
-        String data = AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data"));
-        JSONObject jsonObject = JSONObject.parseObject(data);
-        String phone = jsonObject.getString("phone");
-        //清除进行中任务
-        this.hearingTestService.clearHearing(phone);
-        return success();
-    }
-}

+ 0 - 88
src/main/java/com/rf/psychological/scale/rest/PsychologicalCapitalController.java

@@ -1,88 +0,0 @@
-package com.rf.psychological.scale.rest;
-
-import com.alibaba.fastjson.JSONObject;
-import com.rf.psychological.base.rest.BaseController;
-import com.rf.psychological.opLog.annotation.OperationLogAnnotation;
-import com.rf.psychological.scale.dao.model.PsychologicalCapitalEntity;
-import com.rf.psychological.scale.dao.model.UserRecordEntity;
-import com.rf.psychological.scale.service.PsychologicalCapitalService;
-import com.rf.psychological.scale.service.UserRecordService;
-import com.rf.psychological.security.AesEncryptUtils;
-import com.rf.psychological.security.SafetyProcess;
-import com.rf.psychological.utils.*;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-
-/**
- * @author zsy
- * @description:心理资本认知任务
- * @date 2021/6/17 15:55
- */
-
-@Slf4j
-@RestController
-@RequestMapping("/psycapital")
-@Api(tags = "心理资本认知任务")
-public class PsychologicalCapitalController extends BaseController {
-
-    @Autowired
-    private UserRecordService userRecordService;
-
-    @Autowired
-    private PsychologicalCapitalService psychologicalCapitalService;
-
-    /**
-     * 添加心理资本信息
-     *
-     * @param
-     * @return
-     */
-    @SafetyProcess
-    @OperationLogAnnotation
-    @PostMapping("/savePsycapital")
-    @ApiOperation("添加心理资本信息")
-    public Result savePsycapital(@RequestBody String json) throws Exception {
-        //public Result saveMemoryCheck(@RequestBody JSONObject jsonObject ) throws Exception {
-        String data = AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data"));
-        JSONObject Psycapital = JSONObject.parseObject(data);
-
-        DateFormat df = new SimpleDateFormat("yyyyMMddHHmm");
-        //当前时间
-        String testTime = df.format(new Date());
-        PsychologicalCapitalEntity psychologicalCapitalEntity = new PsychologicalCapitalEntity();
-        psychologicalCapitalEntity.setTaskMark(Psycapital.getString("taskMark"));
-        psychologicalCapitalEntity.setHierarchy(Psycapital.getString("hierarchy"));
-        psychologicalCapitalEntity.setRecordId(Psycapital.getString("recordId"));
-        psychologicalCapitalEntity.setTestDate(testTime);
-        if (Psycapital.getString("hierarchy").equals("1.3")){
-            UserRecordEntity userRecordEntity = userRecordService.getUserRecordById(Psycapital.getString("recordId"));
-            String testresult = userRecordEntity.getTestResults();
-            String[] testresults = testresult.split(";");
-            String[] scores = testresults[0].split(":");
-            double score = Double.parseDouble(scores[1]);
-            if (score <= 126){
-                psychologicalCapitalEntity.setGroupIndex("2");
-            }else {
-                psychologicalCapitalEntity.setGroupIndex("1");
-            }
-            Random r = new Random();
-            //r.nextInt(n)  n为几  就产生0~n-1的随机数
-            int num = r.nextInt(2)+1;
-            psychologicalCapitalEntity.setStrongType(String.valueOf(num));
-        }
-        this.psychologicalCapitalService.save(psychologicalCapitalEntity);
-        return success(psychologicalCapitalEntity, "完成");
-    }
-
-}

+ 3 - 102
src/main/java/com/rf/psychological/scale/rest/SubjectController.java

@@ -1,18 +1,10 @@
 package com.rf.psychological.scale.rest;
 
 import com.rf.psychological.base.rest.BaseController;
-import com.rf.psychological.dao.model.*;
-import com.rf.psychological.scale.service.ScaleService;
-import com.rf.psychological.service.*;
-import com.rf.psychological.utils.Constant;
-import com.rf.psychological.utils.Result;
 import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 
 /**
@@ -23,98 +15,7 @@ import java.util.List;
 @Slf4j
 @RestController
 @RequestMapping("/subject")
-@Api(tags = "(APP专用)量表数据查询:量表的问答选项")
+@Api(tags = "量表信息接口")
 public class SubjectController extends BaseController {
 
-    @Autowired
-    private PSQIService psqiService;
-    @Autowired
-    private POMSService pomsService;
-    @Autowired
-    private SCLService sclService;
-    @Autowired
-    private ASKService askService;
-    @Autowired
-    private AviationService aviationService;
-    @Autowired
-    private SupportService supportService;
-    @Autowired
-    private DepressService depressService;
-    @Autowired
-    private MoodService moodService;
-    @Autowired
-    private StatusService statusService;
-    @Autowired
-    private LifeService lifeService;
-    @Autowired
-    private CattellService cattellService;
-    @Autowired
-    private ScaleService scaleService;
-
-
-    //@SafetyProcess
-    @PostMapping("/save/{flag}/POST")
-    public Result saveSubject(@RequestBody Object object, @PathVariable String flag){
-        if(Constant.QUEST_TYPE_PSQI.equals(flag)){
-            PSQIEntity psqiEntity = (PSQIEntity) object;
-            psqiEntity = this.psqiService.saveSubject(psqiEntity);
-            return success(psqiEntity,"保存成功");
-        }
-        return fail();
-    }
-
-
-
-    /**
-     * 查询全量检测列表
-     * @param type
-     * @return
-     */
-    //@SafetyProcess
-    @GetMapping("/{type}")
-    @ApiOperation("查询量表问题选项列表:flag量表标志")
-    public Result getSubjectByType(@PathVariable String type){
-        if(Constant.QUEST_TYPE_PSQI.equals(type)){
-            List<PSQIEntity> psqiEntityList = this.psqiService.findAll();
-            return success(psqiEntityList);
-        }else if(Constant.QUEST_TYPE_POMS.equals(type)){
-            List<POMSEntity> pomsEntityList = this.pomsService.findAll();
-            return success(pomsEntityList);
-        }else if(Constant.QUEST_TYPE_SCL.equals(type)){
-            List<SCLEntity> sclEntityList = this.sclService.findAll();
-            return success(sclEntityList);
-        }else if(Constant.QUEST_TYPE_ASK.equals(type)){
-            List<ASKEntity> askEntityList = this.askService.findAll();
-            System.out.println(askEntityList);
-            return success(askEntityList);
-        }else if(Constant.QUEST_TYPE_AVAI.equals(type)){
-            List<AviationEntity> aviationEntityList = this.aviationService.findAll();
-            return success(aviationEntityList);
-        }else if(Constant.QUEST_TYPE_SUPP.equals(type)){
-            List<SupportEntity> supportEntityList = this.supportService.findAll();
-            return success(supportEntityList);
-        }else if(Constant.QUEST_TYPE_DEPR.equals(type)){
-            List<DepressEntity> depressEntityList = this.depressService.findAll();
-            return success(depressEntityList);
-        }else if(Constant.QUEST_TYPE_MOOD.equals(type)){
-            List<MoodEntity> moodEntityList = this.moodService.findAll();
-            return success(moodEntityList);
-        }else if(Constant.QUEST_TYPE_STATUS.equals(type)){
-            List<StatusEntity>statusEntityList = this.statusService.findAll();
-            return success(statusEntityList);
-        }else if (Constant.QUEST_TYPE_LIFE.equals(type)){
-            List<LifeEntity> lifeEntityList = this.lifeService.findAll();
-            return success(lifeEntityList);
-        }else if (Constant.QUEST_TYPE_CATTELL.equals(type)){
-            List<CattellEntity> cattellEntityList = this.cattellService.findAll();
-            return success(cattellEntityList);
-        }
-        return fail();
-
-        /*else{
-            List<ScaleEntity> scaleEntityList = this.scaleService.findAll();
-            return success(scaleEntityList);
-        }*/
-    }
-
 }

+ 18 - 0
src/main/java/com/rf/psychological/scale/rest/UserRecordController.java

@@ -101,6 +101,24 @@ public class UserRecordController extends BaseController {
         }
     }
 
+    /**
+     * 根据id查询测试详细信息
+     *
+     * @return
+     */
+    @SafetyProcess
+    @GetMapping("/countByFlag")
+    @ApiOperation(value = "根据flag统计测试数量")
+    public Result countByFlag(@RequestParam(name = "flag") String flag) {
+        try {
+            int count = userRecordService.countByFlag(flag);
+            return success(count);
+        }catch (Exception e){
+            log.error(e.getMessage());
+            return fail("操作失败");
+        }
+    }
+
 
 
 

+ 14 - 33
src/main/java/com/rf/psychological/scale/rest/WebScaleResultController.java

@@ -6,11 +6,10 @@ import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.rf.psychological.base.rest.BaseController;
-import com.rf.psychological.dao.dto.InstitutionRecordingUsersDTO;
 import com.rf.psychological.dao.dto.scale.NewResultDto;
-import com.rf.psychological.enums.UserRole;
+import com.rf.psychological.dao.model.AnswerEntity;
+import com.rf.psychological.dao.model.DimensionEntity;
 import com.rf.psychological.file.excel.ExcelClass;
-import com.rf.psychological.dao.model.*;
 import com.rf.psychological.institution.service.InstitutionService;
 import com.rf.psychological.opLog.annotation.OperationLogAnnotation;
 import com.rf.psychological.plan.dao.model.TestPlanEntity;
@@ -18,51 +17,30 @@ import com.rf.psychological.plan.dao.model.TestPlanUserEntity;
 import com.rf.psychological.plan.service.TestPlanContendService;
 import com.rf.psychological.plan.service.TestPlanService;
 import com.rf.psychological.plan.service.TestPlanUserService;
-import com.rf.psychological.scale.dao.dto.SubjectEntityDto2;
 import com.rf.psychological.scale.dao.model.*;
 import com.rf.psychological.scale.service.*;
 import com.rf.psychological.security.AesEncryptUtils;
 import com.rf.psychological.security.SafetyProcess;
 import com.rf.psychological.user.dao.model.UserEntity;
-import com.rf.psychological.user.dao.model.UserFileEntity;
-import com.rf.psychological.user.service.UserFileService;
 import com.rf.psychological.user.service.UserService;
-import com.rf.psychological.utils.*;
-import com.rf.psychological.utils.DateUtil;
-import com.rf.psychological.wxpay.model.PromotionInfo;
-import com.rf.psychological.wxpay.service.PromotionInfoService;
-import com.rf.psychological.wxpay.service.WxPayService;
+import com.rf.psychological.utils.Constant;
+import com.rf.psychological.utils.ExcelUtil;
+import com.rf.psychological.utils.Result;
+import com.rf.psychological.utils.ScaleScoringVersion;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import jodd.util.StringUtil;
-import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
-import org.apache.poi.ss.usermodel.*;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
-import javax.servlet.http.HttpServletResponse;
-import java.io.*;
+
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-import static com.rf.psychological.utils.FileUtil.html2pdf;
 
 /**
  * @author zsf
@@ -120,8 +98,7 @@ public class WebScaleResultController extends BaseController {
     @Autowired
     private InstitutionService institutionService;
 
-    @Autowired
-    private ScaleDetailsService scaleDetailsService;
+
 
     @SafetyProcess
     @Transactional(rollbackFor = Exception.class)
@@ -135,9 +112,13 @@ public class WebScaleResultController extends BaseController {
         System.out.println("----------------result-------------------");
         System.out.println(jsonObject);
         String testPlanId = "0";
-        UserEntity userEntity = this.userService.getOne(jsonObject.getString("userId"));
+        Object userIdObj = jsonObject.get("userId");
+        if (userIdObj == null){
+            return fail("参数userId不能为空");
+        }
+        UserEntity userEntity = this.userService.getOne(userIdObj.toString());
         if (userEntity == null) {
-            return fail("用户不存在");
+                return fail("用户不存在");
         }
         String userName = userEntity.getPetName();
         String userBirthday = userEntity.getBirthday();

+ 0 - 104
src/main/java/com/rf/psychological/scale/resultBusiness/cognitiveResult/PSYCAPITALCognize.java

@@ -1,104 +0,0 @@
-package com.rf.psychological.scale.resultBusiness.cognitiveResult;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.rf.psychological.dao.model.ObjectEntity;
-import com.rf.psychological.file.excel.ExcelClass;
-import com.rf.psychological.scale.dao.model.PsychologicalCapitalEntity;
-import com.rf.psychological.scale.dao.model.UserRecordEntity;
-import com.rf.psychological.scale.resultBusiness.scaleResult.BaseScale;
-import com.rf.psychological.user.dao.model.UserEntity;
-import com.rf.psychological.utils.Constant;
-import com.rf.psychological.utils.ExcelUtil;
-import com.rf.psychological.utils.Utils;
-
-import java.io.File;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * @author zsy
- * @description:心理资本
- * @date 2021/7/20 15:55
- */
-public class PSYCAPITALCognize extends BaseScale {
-
-    public PSYCAPITALCognize(JSONArray jsonArray, JSONObject resultJson) {
-        super(jsonArray, resultJson);
-    }
-
-    public  JSONObject scaleCalculate() throws Exception {
-        List<Map<String, String>> resultMapList = new ArrayList<>();
-        JSONObject jsonObject = resultJson.getJSONObject("jsonObject");
-        String fileName = resultJson.getString("fileName");
-        String name;
-
-        JSONObject resultDBJson = new JSONObject(true);
-
-        name = Constant.SHEET_NAME_PSY_CAPITAL;
-        List<PsychologicalCapitalEntity> psyCapitalList = (List<PsychologicalCapitalEntity>) resultJson.get("psyCapitalList");
-        List<UserRecordEntity> userRecordEntities = (List<UserRecordEntity>) resultJson.get("userRecordEntities");
-        for (PsychologicalCapitalEntity psyCapital : psyCapitalList) {
-            if (psyCapital.getHierarchy().equals("1.0")){
-                JSONObject information = new JSONObject(true);
-                information = JSONObject.parseObject(psyCapital.getRecordId());
-                for (String key : information.keySet()) {
-                    resultDBJson.put(key,information.get(key));
-                }
-            }else {
-                for (UserRecordEntity userRecordEntity : userRecordEntities){
-                    if (psyCapital.getRecordId().equals(userRecordEntity.getId())){
-                        String testresult = userRecordEntity.getTestResults();
-                        String[] testresults = testresult.split(";");
-                        String[] scores = testresults[0].split(":");
-                        if (psyCapital.getHierarchy().equals("1.1")){
-                            resultDBJson.put("1.1"+userRecordEntity.getName()+"总分",scores[1]);
-                        }else if (psyCapital.getHierarchy().equals("1.2")){
-                            resultDBJson.put("1.2"+userRecordEntity.getName()+"总分",scores[1]);
-                        }else if (psyCapital.getHierarchy().equals("1.3")){
-                            resultDBJson.put("1.3"+userRecordEntity.getName()+"总分",scores[1]);
-                            String keyA = testresults[1].split(":")[0];
-                            String valueA = testresults[1].split(":")[1];
-                            resultDBJson.put("1.3"+userRecordEntity.getName()+keyA,valueA);
-                            String keyB = testresults[3].split(":")[0];
-                            String valueB = testresults[3].split(":")[1];
-                            resultDBJson.put("1.3"+userRecordEntity.getName()+keyB,valueB);
-                            String keyC = testresults[5].split(":")[0];
-                            String valueC = testresults[5].split(":")[1];
-                            resultDBJson.put("1.3"+userRecordEntity.getName()+keyC,valueC);
-                            String keyD = testresults[7].split(":")[0];
-                            String valueD = testresults[7].split(":")[1];
-                            resultDBJson.put("1.3"+userRecordEntity.getName()+keyD,valueD);
-                            if(psyCapital.getGroupIndex().equals("1")){
-                                resultDBJson.put("心理资本","高心理资本");
-                            }else {
-                                resultDBJson.put("心理资本","低心理资本");
-                            }
-                            if(psyCapital.getStrongType().equals("1")){
-                                resultDBJson.put("说服信息","强说服信息");
-                            }else {
-                                resultDBJson.put("说服信息","弱说服信息");
-                            }
-                        }else if (psyCapital.getHierarchy().equals("2.1")){
-                            resultDBJson.put("2.1"+userRecordEntity.getName()+"总分",scores[1]);
-                        }else {
-                            resultDBJson.put("2.2"+userRecordEntity.getName()+"总分",scores[1]);
-                        }
-                    }
-
-                }
-
-            }
-        }
-
-        JSONObject returnJson = new JSONObject(true);
-        returnJson.put("fileName",fileName);
-        returnJson.put("name", name);
-        returnJson.put("resultJson",resultDBJson);
-        returnJson.put("datas","");
-
-        return returnJson;
-    }
-
-
-}

+ 0 - 38
src/main/java/com/rf/psychological/scale/service/HearingTestService.java

@@ -1,38 +0,0 @@
-package com.rf.psychological.scale.service;
-
-import com.rf.psychological.dao.model.HearingTestEntity;
-
-import java.util.List;
-
-/**
- * @author zsy
- * @description:
- * @date 2021/5/14 10:49
- */
-public interface HearingTestService {
-
-
-    /**
-     * 保存
-     * @param hearingTestEntity
-     */
-    void save(HearingTestEntity hearingTestEntity);
-
-    /**
-     * 根据id修改状态
-     * @param id
-     */
-    void updateStatus(String id);
-
-    /**
-     * 根据phone获取用户进行中任务
-     * @param phone
-     */
-    List<HearingTestEntity> getHearingTestList(String phone);
-
-    /**
-     * 清除进行中任务
-     * @param
-     */
-    void clearHearing(String phone);
-}

+ 0 - 28
src/main/java/com/rf/psychological/scale/service/PsychologicalCapitalService.java

@@ -1,28 +0,0 @@
-package com.rf.psychological.scale.service;
-
-import com.rf.psychological.dao.model.HearingTestEntity;
-import com.rf.psychological.scale.dao.model.PsychologicalCapitalEntity;
-
-import java.util.List;
-
-/**
- * @author zsy
- * @description:
- * @date 2021/5/14 10:49
- */
-public interface PsychologicalCapitalService {
-
-
-    /**
-     * 保存
-     * @param psychologicalCapitalEntity
-     */
-    void save(PsychologicalCapitalEntity psychologicalCapitalEntity);
-
-    /**
-     * 根据任务关联标识获取信息
-     * @param taskMark
-     */
-    List<PsychologicalCapitalEntity> getPsychologicalCapitalList(String taskMark);
-
-}

+ 2 - 0
src/main/java/com/rf/psychological/scale/service/UserRecordService.java

@@ -231,4 +231,6 @@ public interface UserRecordService {
     Page<UserRecordEntity> getRecordByModelPhone(int pageNum, int pageSize, String modelPhone, String orderStatus);
 
     int countNum(String flag, String promotionStartTime);
+
+    int countByFlag(String flag);
 }

+ 0 - 68
src/main/java/com/rf/psychological/scale/service/impl/HearingTestServiceImpl.java

@@ -1,68 +0,0 @@
-package com.rf.psychological.scale.service.impl;
-
-import com.rf.psychological.dao.model.HearingTestEntity;
-import com.rf.psychological.dao.repository.HearingTestRepository;
-import com.rf.psychological.scale.service.HearingTestService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * @author zsy
- * @description:
- * @date 2021/5/14 10:51
- */
-@Service
-public class HearingTestServiceImpl implements HearingTestService {
-    @Autowired
-    private HearingTestRepository hearingTestRepository;
-
-    /**
-     * 根据flag获取全部答案
-     *
-     * @param flag
-     */
-    //@Override
-    //public List<AnswerEntity> getAnswerByFlag(String flag) {
-    //return this.answerRepository.getAnswerByFlag(flag);
-    //}
-
-    /**
-     * 保存
-     * @param hearingTestEntity
-     */
-    @Override
-    public void save(HearingTestEntity hearingTestEntity) {
-        this.hearingTestRepository.save(hearingTestEntity);
-    }
-
-    /**
-     * 根据id修改状态
-     * @param id
-     */
-    @Override
-    public void updateStatus(String id) {
-        this.hearingTestRepository.updateStatus(id);
-    }
-
-    /**
-     * 根据phone获取用户进行中任务
-     * @param phone
-     */
-    @Override
-    public List<HearingTestEntity> getHearingTestList(String phone) {
-        return this.hearingTestRepository.getHearingTestList(phone);
-    }
-
-    /**
-     * 清除进行中任务
-     * @param
-     */
-    @Override
-    public void clearHearing(String phone) {
-        this.hearingTestRepository.clearHearing(phone);
-    }
-
-
-}

+ 0 - 43
src/main/java/com/rf/psychological/scale/service/impl/PsychologicalCapitalServiceImpl.java

@@ -1,43 +0,0 @@
-package com.rf.psychological.scale.service.impl;
-
-import com.rf.psychological.dao.model.HearingTestEntity;
-import com.rf.psychological.dao.repository.HearingTestRepository;
-import com.rf.psychological.scale.dao.model.PsychologicalCapitalEntity;
-import com.rf.psychological.scale.dao.repository.PsychologicalCapitalRepository;
-import com.rf.psychological.scale.service.HearingTestService;
-import com.rf.psychological.scale.service.PsychologicalCapitalService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * @author zsy
- * @description:
- * @date 2021/5/14 10:51
- */
-@Service
-public class PsychologicalCapitalServiceImpl implements PsychologicalCapitalService {
-
-    @Autowired
-    private PsychologicalCapitalRepository psychologicalCapitalRepository;
-
-    /**
-     * 保存
-     * @param psychologicalCapitalEntity
-     */
-    @Override
-    public void save(PsychologicalCapitalEntity psychologicalCapitalEntity) {
-        this.psychologicalCapitalRepository.save(psychologicalCapitalEntity);
-    }
-
-    /**
-     * 根据任务关联标识获取信息
-     * @param taskMark
-     */
-    @Override
-    public List<PsychologicalCapitalEntity> getPsychologicalCapitalList(String taskMark) {
-        return this.psychologicalCapitalRepository.getPsychologicalCapitalList(taskMark);
-    }
-
-}

+ 5 - 0
src/main/java/com/rf/psychological/scale/service/impl/UserRecordServiceImpl.java

@@ -515,6 +515,11 @@ public class UserRecordServiceImpl implements UserRecordService {
         return userRecordRepository.countAllByFlagAndTestDateGreaterThanEqual(flag,promotionStartTime);
     }
 
+    @Override
+    public int countByFlag(String flag) {
+        return userRecordRepository.countAllByFlag(flag);
+    }
+
     private Specification getRecord(String phone, String institutionNo, String flag) {
         String dateEnd = DateUtil.format(DateUtil.offsetDay(new Date(),1), DatePattern.CHINESE_DATE_FORMAT);
         String dateBegin = DateUtil.format(DateUtil.offsetDay(new Date(),-90),DatePattern.CHINESE_DATE_FORMAT);

+ 15 - 2
src/main/java/com/rf/psychological/security/DESede.java

@@ -171,7 +171,20 @@ public class DESede {
 
     public static void main(String[] args) throws Exception {
         String name = "hahah";
-        System.out.println(decryptString("salBQk0H3j33EwObtXOHpcFqNTbECevLIzhweNpudteBDbN8JHb30EnLt6IPZn1hR9fD33n3rAovqwHw9P5JdQ0OywESJ8JOaA64JX/jup7P9j/2F8PssEVMh8QODyz3XGK0K0feQdfB/DSXTHdMPGxQUebcsvPu5sIp4i9XsEoLvc1z/sDvUDkqp5KLQ5IQ3owRyJPD3rXbrC7/2gRXonE98f5M9IwFiIgUjh5Xnjo="));
-        System.out.println(encryptString("我觉得我没有未来;几乎不对未来抱有希望;未来还是充满希望的;多数时间对未来还是充满希望;总是对未来还是充满希望"));
+        System.out.println(decryptString("bYDrH2DB7aMik/PKWV4nxytjhZkedfEXsESEumRo3SO+nQegB5u4sQ=="));
+        System.out.println(encryptString("坚韧黑铁"));
+        System.out.println(encryptString("英勇黄铜"));
+        System.out.println(encryptString("英勇黄铜+"));
+        System.out.println(encryptString("不屈白银"));
+        System.out.println(encryptString("不屈白银+"));
+        System.out.println(encryptString("荣耀黄金"));
+        System.out.println(encryptString("荣耀黄金+"));
+        System.out.println(encryptString("华贵铂金"));
+        System.out.println(encryptString("华贵铂金+"));
+        System.out.println(encryptString("流光翡翠"));
+        System.out.println(encryptString("璀璨钻石"));
+        System.out.println(encryptString("超凡大师"));
+        System.out.println(encryptString("傲世宗师"));
+        System.out.println(encryptString("最强王者"));
       }
 }

+ 2 - 2
src/main/java/com/rf/psychological/security/SSLConfig.java

@@ -16,8 +16,8 @@ import org.springframework.context.annotation.Profile;
  * @description:
  * @date 2021/9/15 14:32
  */
-@Configuration
-@Profile({"prod", "public"})
+//@Configuration
+@Profile({"public"})
 public class SSLConfig {
 
     @Value("${spring.profiles.active}")

+ 13 - 715
src/main/java/com/rf/psychological/utils/Constant.java

@@ -483,10 +483,7 @@ public class Constant {
      **/
     public static final String QUEST_TYPE_DSST= "DSST";
 
-    /**
-     * 心理资本
-     **/
-    public static final String QUEST_TYPE_PSY_CAPITAL= "PSY_CAPITAL";
+
 
     /**
      * 数字广度测验(语音版)
@@ -526,8 +523,6 @@ public class Constant {
      * 量表测试文件SHEET名
      **/
     public static final String SHEET_NAME_ASK = "艾森克人格量表";
-    //public static final String SHEET_NAME_PSQI = "匹兹堡睡眠质量指数";
-//public static final String SHEET_NAME_POMS = "心境状态量表";
     public static final String SHEET_NAME_SCL = "症状自评量表(SCL-90)";
     public static final String SHEET_NAME_AVAI = "汉化版美国航空航天局任务负荷指数量表";
     public static final String SHEET_NAME_SUPP = "社会支持评定量表";
@@ -617,25 +612,14 @@ public class Constant {
     public static final String SHEET_NAME_STFS= "神分裂症语义距离度量";
 
 
-/** 基础常量 工作记忆能力测试 **/
-    /**
-     * 每种任务的组块数
-     **/
-    public static int GROUP_COUNT = 6;
+
     /**
      * 每个组块的字母个数
      **/
     public static int CHAR_COUNT = 18;
 
 
-    /**
-     * 魔法数
-     **/
 
-    /*public static String MAGIC_NUM_0 = "0";
-    public static String MAGIC_NUM_1 = "1";
-    public static String MAGIC_NUM_2 = "2";
-    public static String MAGIC_NUM_MINUS_1 = "-1";*/
     /**
      * 题目类型:单选题
      */
@@ -699,601 +683,18 @@ public class Constant {
     public static String MAGIC_NUM_MINUS_1 = "-1";
 
 
-    /**
-     * Aitken拖延问卷
-     **/
-    public static final String QUEST_FLAG_API = "20210617113742";
-    /**
-     * 社交焦虑量表
-     **/
-    public static final String QUEST_FLAG_LSAS = "20210622215032";
-    /**
-     * 简明精神病量表
-     **/
-    public static final String QUEST_FLAG_BPRS = "20210616235331";
-    /**
-     * 汉密顿焦虑量表
-     **/
-    public static final String QUEST_FLAG_HAMA = "20210617000138";
-    /**
-     * 孤独量表
-     **/
-    public static final String QUEST_FLAG_UCLA = "20210617000232";
-    /**
-     * 焦虑自评量表
-     **/
-    public static final String QUEST_FLAG_SAS = "20210617000853";
-    /**
-     * 密歇根酒精依赖调查表
-     **/
-    public static final String QUEST_FLAG_MAST = "20210628131017";
-    /**
-     * Beck自杀意念量表
-     **/
-    public static final String QUEST_FLAG_BSSI = "20210617013827";
-/** 儿童行为问卷 **/
-//public static final String QUEST_FLAG_CBQ = "20210617014033";
-    /**
-     * 人际信任量表
-     **/
-    public static final String QUEST_FLAG_ITS = "20210617014152";
-    /**
-     * 舒适状况量表
-     **/
-    public static final String QUEST_FLAG_GCQ = "20210617015856";
-    /**
-     * 抑郁自评量表
-     **/
-    public static final String QUEST_FLAG_SDS = "20210617020516";
-    /**
-     * 多伦多述情障碍量表
-     **/
-    public static final String QUEST_FLAG_TAS_26 = "20210617020857";
-    /**
-     * 社会期望量表
-     **/
-    public static final String QUEST_FLAG_MCSD = "20210617100627";
-    /**
-     * 儿童自我意识量表
-     **/
-    public static final String QUEST_FLAG_PHCSS = "20210617101541";
-    /**
-     * 爱德华社会期望量表
-     **/
-    public static final String QUEST_FLAG_SD = "20210617103114";
-    /**
-     * 社交回避及苦恼量表
-     **/
-    public static final String QUEST_FLAG_SAD = "20210617114158";
-    /**
-     * 安全感量表
-     **/
-    public static final String QUEST_FLAG_SQ = "20210617121023";
-    /**
-     * 贝克抑郁自评量表
-     **/
-    public static final String QUEST_FLAG_BDI = "20210617121646";
-    /**
-     * 广泛性焦虑障碍量表
-     **/
-    public static final String QUEST_FLAG_GAD_7 = "20210617122012";
-    /**
-     * 流调中心用抑郁量表
-     **/
-    public static final String QUEST_FLAG_CES_D = "20210617122312";
-    /**
-     * 纽芬兰纪念大学幸福度量表
-     **/
-    public static final String QUEST_FLAG_MUNSH = "20210617122707";
-    /**
-     * 压力知觉量表
-     **/
-    public static final String QUEST_FLAG_PSS = "20210617123132";
-    /**
-     * 医院焦虑抑郁量表
-     **/
-    public static final String QUEST_FLAG_HADS = "20210617123608";
-    /**
-     * 抑郁症筛查量表
-     **/
-    public static final String QUEST_FLAG_PHQ_9 = "20210617124011";
-    /**
-     * 自杀态度问卷
-     **/
-    public static final String QUEST_FLAG_QSA = "20210617124840";
-    /**
-     * 自尊量表
-     **/
-    public static final String QUEST_FLAG_SES = "20210617125947";
-    /**
-     * 明尼苏达多相人格测验矫正量表
-     **/
-    public static final String QUEST_FLAG_MMPI_K = "20210617130956";
-    /**
-     * 明尼苏达多相人格测验说谎L量表
-     **/
-    public static final String QUEST_FLAG_MMPI_L = "20210617131351";
-    /**
-     * 3-7岁儿童气质问卷
-     **/
-    public static final String QUEST_FLAG_NYLS = "20210617132159";
-    /**
-     * 多维度健康状况心理控制源量表(表A)
-     **/
-    public static final String QUEST_FLAG_MHLC_A = "20210617132612";
-    /**
-     * 多维度健康状况心理控制源量表(表B)
-     **/
-    public static final String QUEST_FLAG_MHLC_B = "20210617133012";
-    /**
-     * 儿童感觉统合能力发展评定量表
-     **/
-    public static final String QUEST_FLAG_SIT = "20210617133625";
-    /**
-     * 核心自我评价量表
-     **/
-    public static final String QUEST_FLAG_CSES = "20210617133919";
-    /**
-     * 精神卫生心理控制源量表
-     **/
-    public static final String QUEST_FLAG_MHLC = "20210617134847";
-    /**
-     * 酒精依赖疾患识别测验
-     **/
-    public static final String QUEST_FLAG_AUDIT = "20210617135231";
-    /**
-     * 态度与意见调查中的期望性作答
-     **/
-    public static final String QUEST_FLAG_RD = "20210617135635";
-    /**
-     * 症状自评量表(SCL-90)
-     **/
-    public static final String QUEST_FLAG_SCL_90 = "20210617140713";
-    /**
-     * 简易应对方式问卷
-     **/
-    public static final String QUEST_FLAG_SCSQ = "20210619124953";
-    /**
-     * 交流恐惧自陈量表
-     **/
-    public static final String QUEST_FLAG_PRCA_24 = "20210619130014";
-    /**
-     * 交往焦虑量表
-     **/
-    public static final String QUEST_FLAG_IAS = "20210619131525";
-    /**
-     * 领悟社会支持量表
-     **/
-    public static final String QUEST_FLAG_PSSS = "20210619131920";
-    /**
-     * 青少年病理性互联网使用量表
-     **/
-    public static final String QUEST_FLAG_APIUS = "20210619132131";
-    /**
-     * 羞怯量表
-     **/
-    public static final String QUEST_FLAG_SS = "20210619132538";
-    /**
-     * 自我和谐量表
-     **/
-    public static final String QUEST_FLAG_SCCS = "20210619132917";
-    /**
-     * 情感量表
-     **/
-    public static final String QUEST_FLAG_AS = "20210621125418";
-    /**
-     * 自动思维量表
-     **/
-    public static final String QUEST_FLAG_ATO = "20210621220908";
-    /**
-     * 儿童少年生活质量量表
-     **/
-    public static final String QUEST_FLAG_QLSCA = "20210621221508";
-    /**
-     * 老年抑郁量表
-     **/
-    public static final String QUEST_FLAG_GDS = "20210621221807";
-    /**
-     * Carroll抑郁量表
-     **/
-    public static final String QUEST_FLAG_CRS = "20210622213958";
-    /**
-     * 家庭功能评定
-     **/
-    public static final String QUEST_FLAG_FAD = "20210622214416";
-    /**
-     * 家庭环境量表中文版
-     **/
-    public static final String QUEST_FLAG_FES_CV = "20210622214546";
-    /**
-     * 青少年学生疏离感量表
-     **/
-    public static final String QUEST_FLAG_ASAS = "20210622214744";
-    /**
-     * 情绪-社交孤独问卷
-     **/
-    public static final String QUEST_FLAG_ESLI = "20210622214903";
-    /**
-     * 贝克-拉范森躁狂量表
-     **/
-    public static final String QUEST_FLAG_BRMS = "20210622215152";
-    /**
-     * 多维完美主义问卷
-     **/
-    public static final String QUEST_FLAG_MPS = "20210625181538";
-    /**
-     * 费城老年中心(PGC)信心量表
-     **/
-    public static final String QUEST_FLAG_PGC = "20210625182311";
-    /**
-     * 生活满意度指数A
-     **/
-    public static final String QUEST_FLAG_LSIA = "20210625183328";
-    /**
-     * 思维风格量表
-     **/
-    public static final String QUEST_FLAG_TSI = "20210625183509";
-    /**
-     * 特定人际信任量表
-     **/
-    public static final String QUEST_FLAG_SITS = "20210625183706";
-    /**
-     * 信赖他人量表
-     **/
-    public static final String QUEST_FLAG_FPS = "20210625183826";
-    /**
-     * 信任他人量表
-     **/
-    public static final String QUEST_FLAG_TIP = "20210625183923";
-    /**
-     * 信任量表
-     **/
-    public static final String QUEST_FLAG_TS = "20210625184248";
-    /**
-     * 学龄前儿童活动调查表
-     **/
-    public static final String QUEST_FLAG_PSAI = "20210625184726";
-    /**
-     * 学习障碍儿童筛查量表
-     **/
-    public static final String QUEST_FLAG_PRS = "20210625184948";
-    /**
-     * 抑郁状态问卷
-     **/
-    public static final String QUEST_FLAG_DSI = "20210625191902";
-    /**
-     * 抑郁-焦虑-压力量表
-     **/
-    public static final String QUEST_FLAG_DASS_42 = "20210713155333";
-    /**
-     * 阿森斯失眠量表
-     **/
-    public static final String QUEST_FLAG_AIS = "20210628213837";
-    /**
-     * 爱丁堡利手量表
-     **/
-    public static final String QUEST_FLAG_EHS = "20210628214239";
-    /**
-     * 爱泼沃斯嗜睡量表
-     **/
-    public static final String QUEST_FLAG_ESS = "20210628214628";
-    /**
-     * 气质类型测试
-     **/
-    public static final String QUEST_FLAG_TTT = "20210628214712";
-    /**
-     * 儿童依赖性评估测试(女生版)
-     **/
-    public static final String QUEST_FLAG_CDA = "20210804102135";
 
-    /**
-     * 在婚姻里,你有安全感吗?
-     **/
-    public static final String QUEST_FLAG_MRA_SAFE = "20210714220600";
-    /**
-     * 职业心理年龄测试
-     **/
-    public static final String QUEST_FLAG_OCC_AGE = "20210714221054";
-    /**
-     * 状态一特质焦虑问卷
-     **/
-    public static final String QUEST_FLAG_STAI = "20210714222004";
-    /**
-     * 子女教育心理控制源量表
-     **/
-    public static final String QUEST_FLAG_PLOC = "20210714222726";
-    /**
-     * 自测健康评定量表
-     **/
-    public static final String QUEST_FLAG_SRHMS = "20210714223333";
-    /**
-     * 自信心测试
-     **/
-    public static final String QUEST_FLAG_CFD = "20210714224230";
-    /**
-     * 自尊调查表
-     **/
-    public static final String QUEST_FLAG_SEI = "20210714224910";
-    /**
-     * 总体幸福感量表
-     **/
-    public static final String QUEST_FLAG_GWB = "20210723163240";
-    /**
-     * 舒伯职业价值观量表
-     **/
-    public static final String QUEST_FLAG_WVI = "20210717225226";
-    /**
-     * 双方性调节量表
-     **/
-    public static final String QUEST_FLAG_DSR = "20210717225706";
-    /**
-     * 双相情感障碍自评量表
-     **/
-    public static final String QUEST_FLAG_BDQ = "20210717230329";
-    /**
-     * 特质应对方式问卷
-     **/
-    public static final String QUEST_FLAG_TCSQ = "20210717230742";
-    /**
-     * 同学关系测验问卷
-     **/
-    public static final String QUEST_FLAG_STUR = "20210717231632";
-    /**
-     * 威廉斯创造力倾向测评量表
-     **/
-    public static final String QUEST_FLAG_WILL = "20210717232552";
-    /**
-     * 演说者信心自评量表
-     **/
-    public static final String QUEST_FLAG_PRCS = "20210718162607";
-    /**
-     * 医学应对问卷
-     **/
-    public static final String QUEST_FLAG_MCMQ = "20210718163433";
-    /**
-     * 抑郁形容词检查表
-     **/
-    public static final String QUEST_FLAG_DACL = "20210718164422";
-    /**
-     * 性向测试问卷
-     **/
-    public static final String QUEST_FLAG_PER = "20210718165237";
-    /**
-     * 艾森克人格量表
-     **/
-    public static final String QUEST_FLAG_EPQ = "20210721224753";
-    /**
-     * Sarason考试焦虑量表
-     **/
-    public static final String QUEST_FLAG_TAS = "20210722101531";
-    /**
-     * 人际关系综合诊断量表
-     **/
-    public static final String QUEST_FLAG_PRT = "20210722102600";
-    /**
-     * 人性的哲学修订量表
-     **/
-    public static final String QUEST_FLAG_PLP = "20210722103456";
-    /**
-     * 容纳他人量表
-     **/
-    public static final String QUEST_FLAG_AOO = "20210722103940";
-    /**
-     * 社会适应能力诊断量表
-     **/
-    public static final String QUEST_FLAG_SADS = "20210722105045";
-    /**
-     * 生活满意度指数B
-     **/
-    public static final String QUEST_FLAG_LSIB = "20210722111253";
-    /**
-     * 癫痫抑郁量表
-     **/
-    public static final String QUEST_FLAG_NDDI_E = "20210723164206";
-    /**
-     * 癫痫患者自我管理量表
-     **/
-    public static final String QUEST_FLAG_ESM = "20210723164426";
-    /**
-     * 儿童睡眠习惯问卷
-     **/
-    public static final String QUEST_FLAG_CSHQ = "20210725090145";
-    /**
-     * 马斯洛安全感-不安全感问卷
-     **/
-    public static final String QUEST_FLAG_MSIQ = "20210725091021";
-    /**
-     * 内控性、有势力的他人及机遇量表
-     **/
-    public static final String QUEST_FLAG_IPC = "20210725091833";
-    /**
-     * 内在—外在心理控制源量表
-     **/
-    public static final String QUEST_FLAG_IELCS = "20210725092332";
-    /**
-     * 你到底“几斤几两”——测测你的自我价值
-     **/
-    public static final String QUEST_FLAG_YSV = "20210725093159";
-    /**
-     * 你对另一半满意吗?
-     **/
-    public static final String QUEST_FLAG_YSP = "20210725093549";
-    /**
-     * 你给人的第一印象如何?
-     **/
-    public static final String QUEST_FLAG_YFI = "20210725094150";
-    /**
-     * 你拖延到什么程度了?
-     **/
-    public static final String QUEST_FLAG_WHD = "20210725094642";
-    /**
-     * 亲子关系问卷量表
-     **/
-    public static final String QUEST_FLAG_PCR = "20210725095324";
-    /**
-     * 情绪一社交孤独问卷
-     **/
-    public static final String QUEST_FLAG_ESLIS = "20210725100021";
-    /**
-     * DISC性格测试题
-     **/
-    public static final String QUEST_FLAG_DISC = "20210727214334";
-    /**
-     * 成人依恋量表
-     **/
-    public static final String QUEST_FLAG_AAS = "20210727214911";
-    /**
-     * 儿童行为问卷(父母用)
-     **/
-    public static final String QUEST_FLAG_CCSAS = "20210727215449";
-    /**
-     * 亲密关系经历量表
-     **/
-    public static final String QUEST_FLAG_ECR = "20210727221159";
-    /**
-     * 中国大学生适应量表
-     **/
-    public static final String QUEST_FLAG_CCSAS2 = "20210727224129";
-    /**
-     * 青少年癫痫患者生活质量评定量表(QOLIE-AD-48) 青少年(6-18岁)
-     **/
-    public static final String QUEST_FLAG_QOLIE = "20210730164451";
-    /**
-     * A型、B型性格测试
-     **/
-    public static final String QUEST_FLAG_ABT = "20210802210827";
-    /**
-     * 儿童自闭症评量量表
-     **/
-    public static final String QUEST_FLAG_CARS = "20210802215306";
-    /**
-     * 孤独症儿童行为量表
-     **/
-    public static final String QUEST_FLAG_ABC = "20210802223536";
-    /**
-     * 克氏行为量表
-     **/
-    public static final String QUEST_FLAG_CABS = "20210802223845";
-    /**
-     * 青少年忧郁情绪自我检视表
-     **/
-    public static final String QUEST_FLAG_ADSC = "20210802224305";
-    /**
-     * 痛苦表露指数
-     **/
-    public static final String QUEST_FLAG_DDI = "20210802224543";
-    /**
-     * 心理测试:你应对职场动荡的能力
-     **/
-    public static final String QUEST_FLAG_DWTA = "20210802224734";
-    /**
-     * Toronto医院警觉测试
-     **/
-    public static final String QUEST_FLAG_THAT = "20210807095612";
-    /**
-     * Zung氏焦虑自评量表
-     **/
-    public static final String QUEST_FLAG_ZAS = "20210807100155";
-    /**
-     * 心理压力测一测
-     **/
-    public static final String QUEST_FLAG_PST = "20210802225051";
-    /**
-     * 性格和压力测试
-     **/
-    public static final String QUEST_FLAG_PAST = "20210802225320";
-    /**
-     * CAGE问卷
-     **/
-    public static final String QUEST_FLAG_CAGE = "20210812131145";
-    /**
-     * STOP-Bang量表
-     **/
-    public static final String QUEST_FLAG_STOPB = "20210812131502";
-    /**
-     * Tayside儿童睡眠问卷
-     **/
-    public static final String QUEST_FLAG_TCSQT = "20210812131710";
-    /**
-     * 爱丁堡产后抑郁量表
-     **/
-    public static final String QUEST_FLAG_EPDS = "20210812132236";
-    /**
-     * 儿科日间嗜睡量表
-     **/
-    public static final String QUEST_FLAG_PDSS = "20210812132654";
-    /**
-     * 流调中心儿童抑郁量表
-     **/
-    public static final String QUEST_FLAG_CESDC = "20210812133437";
-    /**
-     * 蒙哥马利抑郁评定量表
-     **/
-    public static final String QUEST_FLAG_MADRS = "20210812135049";
-    /**
-     * 疲劳严重度量表
-     **/
-    public static final String QUEST_FLAG_FSS = "20210807100904";
-    /**
-     * 青少年睡眠-觉醒量表
-     **/
-    public static final String QUEST_FLAG_ASWS = "20210812140140";
-    /**
-     * 耶鲁布朗强迫症状量表
-     **/
-    public static final String QUEST_FLAG_YBOCS = "20210812140722";
-    /**
-     * 阳性与阴性症状量表
-     **/
-    public static final String QUEST_FLAG_PANSS = "20210718163045";
-    /**
-     * 心理适应性量表
-     **/
-    public static final String QUEST_FLAG_MFS = "20210717233329";
-    /**
-     * 儿科睡眠问卷:睡眠相关呼吸障碍分量表
-     **/
-    public static final String QUEST_FLAG_SRBD = "20210807100654";
-    /**
-     * 托兰斯创造性人格自陈量表
-     **/
-    public static final String QUEST_FLAG_TCPSS = "20210717232009";
-    /**
-     * Epworth嗜睡量表
-     **/
-    public static final String QUEST_FLAG_TESS = "20210807094852";
-    /**
-     * 测试:你的心理调节能力过关吗
-     **/
-    public static final String QUEST_FLAG_MAA = "20210802214831";
-    /**
-     * 幸福感指数、总体情感指数
-     **/
-    public static final String QUEST_FLAG_IWBIGA = "20210718164832";
-    /**
-     * 多元认知能力自评量表
-     **/
-    public static final String QUEST_FLAG_MASQ = "20210723170946";
+
     /**
      * 匹兹堡睡眠质量指数
      **/
     public static final String QUEST_TYPE_PSQI = "20210725100704";
-    /**
-     * 康奈尔健康问卷(男性用)
-     **/
-    public static final String QUEST_TYPE_CMIM = "20210908122014";
-    /**
-     * 康奈尔健康问卷(女性用)
-     **/
-    public static final String QUEST_TYPE_CMIW = "20210908122321";
+
     /**
      * 心境状态量表
      **/
     public static final String QUEST_TYPE_POMS = "20211020113719";
-    /**
-     * 职业性格测试
-     **/
-    public static final String QUEST_TYPE_MBTI = "20211020113914";
+
 
 
     /**
@@ -1305,15 +706,14 @@ public class Constant {
     public static final String SHEET_NAME_HAMA = "汉密顿焦虑量表";
     public static final String SHEET_NAME_UCLA = "孤独量表";
     public static final String SHEET_NAME_SAS = "焦虑自评量表";
-    public static final String SHEET_NAME_MAST = "密歇根酒精依赖调查表";
-    public static final String SHEET_NAME_BSSI = "Beck自杀意念量表";
-    //public static final String SHEET_NAME_CBQ = "儿童行为问卷";
+
+
     public static final String SHEET_NAME_ITS = "人际信任量表";
     public static final String SHEET_NAME_GCQ = "舒适状况量表";
     public static final String SHEET_NAME_SDS = "抑郁自评量表";
     public static final String SHEET_NAME_TAS_26 = "多伦多述情障碍量表";
     public static final String SHEET_NAME_MCSD = "社会期望量表";
-    public static final String SHEET_NAME_PHCSS = "儿童自我意识量表";
+
     public static final String SHEET_NAME_SD = "爱德华社会期望量表";
     public static final String SHEET_NAME_SAD = "社交回避及苦恼量表";
     public static final String SHEET_NAME_SQ = "安全感量表";
@@ -1329,8 +729,6 @@ public class Constant {
     public static final String SHEET_NAME_MMPI_K = "明尼苏达多相人格测验矫正量表";//开始在数据库添加计分原则
     public static final String SHEET_NAME_MMPI_L = "明尼苏达多相人格测验说谎L量表";
     public static final String SHEET_NAME_NYLS = "3-7岁儿童气质问卷";
-    public static final String SHEET_NAME_MHLC_A = "多维度健康状况心理控制源量表(表A)";
-    public static final String SHEET_NAME_MHLC_B = "多维度健康状况心理控制源量表(表B)";
     public static final String SHEET_NAME_SIT = "儿童感觉统合能力发展评定量表";
     public static final String SHEET_NAME_CSES = "核心自我评价量表";
     public static final String SHEET_NAME_MHLC = "精神卫生心理控制源量表";
@@ -1422,116 +820,16 @@ public class Constant {
     public static final String SHEET_NAME_ADSC = "青少年忧郁情绪自我检视表";
     public static final String SHEET_NAME_DDI = "痛苦表露指数";
     public static final String SHEET_NAME_DWTA = "心理测试:你应对职场动荡的能力";
-    public static final String SHEET_NAME_THAT = "Toronto医院警觉测试";
-    public static final String SHEET_NAME_ZAS = "Zung氏焦虑自评量表";
-    public static final String SHEET_NAME_PST = "心理压力测一测";
-    public static final String SHEET_NAME_PAST = "性格和压力测试";
-    public static final String SHEET_NAME_CAGE = "CAGE问卷";
+
     public static final String SHEET_NAME_STOPB = "STOP-Bang量表";
-    public static final String SHEET_NAME_TCSQT = "Tayside儿童睡眠问卷";
-    public static final String SHEET_NAME_EPDS = "爱丁堡产后抑郁量表";
-    public static final String SHEET_NAME_PDSS = "儿科日间嗜睡量表";
-    public static final String SHEET_NAME_CESDC = "流调中心儿童抑郁量表";
-    public static final String SHEET_NAME_MADRS = "蒙哥马利抑郁评定量表";
-    public static final String SHEET_NAME_FSS = "疲劳严重度量表";
-    public static final String SHEET_NAME_ASWS = "青少年睡眠-觉醒量表";
-    public static final String SHEET_NAME_YBOCS = "耶鲁布朗强迫症状量表";
-    public static final String SHEET_NAME_PANSS = "阳性与阴性症状量表";
-    public static final String SHEET_NAME_MFS = "心理适应性量表";
-    public static final String SHEET_NAME_SRBD = "儿科睡眠问卷:睡眠相关呼吸障碍分量表";
-    public static final String SHEET_NAME_TCPSS = "托兰斯创造性人格自陈量表";
-    public static final String SHEET_NAME_TESS = "Epworth嗜睡量表";
-    public static final String SHEET_NAME_MAA = "测试:你的心理调节能力过关吗";
-    public static final String SHEET_NAME_IWBIGA = "幸福感指数、总体情感指数";
-    public static final String SHEET_NAME_MASQ = "多元认知能力自评量表";
+
     public static final String SHEET_NAME_PSQI = "匹兹堡睡眠质量指数";
-    public static final String SHEET_NAME_CMIM = "康奈尔健康问卷(男性用)";
-    public static final String SHEET_NAME_CMIW = "康奈尔健康问卷(女性用)";
+
     public static final String SHEET_NAME_POMS = "心境状态量表";
-    public static final String SHEET_NAME_MBTI = "职业性格测试";
 
 
-/** 许博文 **/
-    /**
-     * 知觉压力问卷
-     **/
-    public static final String QUEST_TYPE_PSQ = "20210913093250";
-    public static final String SHEET_NAME_PSQ = "知觉压力问卷";
-    /**
-     * 儿童注意多动缺陷筛查量表
-     **/
-    public static final String QUEST_TYPE_AHDSC = "20210901113320";
-    public static final String SHEET_NAME_AHDSC = "儿童注意多动缺陷筛查量表";
-    /**
-     * 魁北克睡眠问卷
-     **/
-    public static final String QUEST_TYPE_QSQ = "20210913091839";
-    public static final String SHEET_NAME_QSQ = "魁北克睡眠问卷";
-    /**
-     * 总体睡眠障碍量表
-     **/
-    public static final String QUEST_TYPE_GSDS = "20210913093446";
-    public static final String SHEET_NAME_GSDS = "总体睡眠障碍量表";
-    /**
-     * 防御方式问卷
-     **/
-    public static final String QUEST_TYPE_DSQ = "20210916104937";
-    public static final String SHEET_NAME_DSQ = "防御方式问卷";
-    /**
-     * Zung抑郁自我评价量表
-     **/
-    public static final String QUEST_TYPE_ZungDP = "20210918160544";
-    public static final String SHEET_NAME_ZungDP = "Zung抑郁自我评价量表";
-    /**
-     * 成就倾同个体差异问卷
-     **/
-    public static final String QUEST_TYPE_IDIAT = "20210918160745";
-    public static final String SHEET_NAME_IDIAT = "成就倾同个体差异问卷";
-    /**
-     * 国立医院癫痫发作严重程度量表
-     **/
-    public static final String QUEST_TYPE_NHS3 = "20210922130731";
-    public static final String SHEET_NAME_NHS3 = "国立医院癫痫发作严重程度量表";
-    /**
-     * 老年人认知功能减退知情者问卷
-     **/
-    public static final String QUEST_TYPE_IQCODE = "20210922131640";
-    public static final String SHEET_NAME_IQCODE = "老年人认知功能减退知情者问卷";
-    /**
-     * 运动竞赛焦虑测验
-     **/
-    public static final String QUEST_TYPE_SCAT = "20210922222436";
-    public static final String SHEET_NAME_SCAT = "运动竞赛焦虑测验";
-    /**
-     * 驾驶技能自我评估量表
-     **/
-    public static final String QUEST_TYPE_SACDS = "20210923220801";
-    public static final String SHEET_NAME_SACDS = "驾驶技能自我评估量表";
-    /**
-     * 驾驶能力量表
-     **/
-    public static final String QUEST_TYPE_PPDC = "20210923221314";
-    public static final String SHEET_NAME_PPDC = "驾驶能力量表";
-    /**
-     * 竞赛失败应对量表
-     **/
-    public static final String QUEST_TYPE_CCF = "20210923221436";
-    public static final String SHEET_NAME_CCF = "竞赛失败应对量表";
-    /**
-     * 身体自尊量表
-     **/
-    public static final String QUEST_TYPE_BE = "20210923223630";
-    public static final String SHEET_NAME_BE = "身体自尊量表";
-    /**
-     * 优秀运动员意志品质评价量表
-     **/
-    public static final String QUEST_TYPE_EVQEA = "20210922222157";
-    public static final String SHEET_NAME_EVQEA = "优秀运动员意志品质评价量表";
-    /**
-     * 少年儿童身体自尊量表
-     **/
-    public static final String QUEST_TYPE_ABE = "20210923223500";
-    public static final String SHEET_NAME_ABE = "少年儿童身体自尊量表";
+
+
 /** 许博文 **/
 
     /**