Browse Source

工具类调整

zsf 1 year ago
parent
commit
4e75e3ab9c

+ 0 - 1
src/main/java/com/rf/psychological/base/rest/BaseController.java

@@ -2,7 +2,6 @@ package com.rf.psychological.base.rest;
 
 import com.rf.psychological.utils.HttpStatus;
 import com.rf.psychological.utils.Result;
-import com.rf.psychological.utils.ScaleResultBusinessMap;
 
 
 /**

+ 0 - 3
src/main/java/com/rf/psychological/file/ApkDownloadController.java

@@ -42,9 +42,6 @@ public class ApkDownloadController extends BaseController {
                 file = new File(filepath);
             }
             if (file.exists()) {
-               /* response.setContentType("application/force-download");// 设置强制下载不打开
-                response.addHeader("Content-Disposition", "attachment;fileName=" + fileName);// 设置文件名
-                response.setContentType("application/binary;charset=ISO8859-1");*/
                 response.reset();
                 response.setContentType("application/octet-stream");
                 response.setCharacterEncoding("utf-8");

+ 8 - 5
src/main/java/com/rf/psychological/scale/rest/CognizeResultController.java

@@ -1,11 +1,13 @@
 package com.rf.psychological.scale.rest;
 
+import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 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.file.excel.ExcelClass;
 import com.rf.psychological.opLog.annotation.OperationLogAnnotation;
 import com.rf.psychological.plan.dao.model.TestPlanEntity;
 import com.rf.psychological.plan.service.TestPlanContendService;
@@ -13,21 +15,21 @@ 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.UserRecordEntity;
-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.security.AesEncryptUtils;
+import com.rf.psychological.security.SafetyProcess;
+import com.rf.psychological.socket.MyClient;
 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 io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+
 import java.io.File;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -3272,7 +3274,8 @@ public class CognizeResultController extends BaseController {
     //瑞文根据年龄分值转换
     private int RIVENScore(String userBirthday, int score) throws Exception {
         int resultScore = 0;
-        double age = AgeUtil.getAge(userBirthday);
+        //double age = AgeUtil.getAge(userBirthday);
+        double age = DateUtil.ageOfNow(userBirthday);
         if (age <= 5.5) {
             if (score >= 9 && score < 12) {
                 resultScore = 5;