ソースを参照

匹兹堡睡眠调整

zsf 5 ヶ月 前
コミット
ebfc6c738c

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

@@ -35,7 +35,7 @@ public class JWTInterceptorPublicConfig implements WebMvcConfigurer {
         String[] temp = new String[]{"/category/getCognizeCategoryList", "/category/getCategoryList",
                 "/subjectInfo/getSubjectListByAuth", "/subjectInfo/getCognizeListByAuth", "/subjectInfo/getRecallChar", "/subjectInfo/getRecallCharTwo",
                 "/subjectInfo/getSubjectByFlag/*","/subjectInfo/getSubjectByFlagV2/*","/scaleInfo/*","/record/getRecordByModelPhone",
-                "/api/orderInfo/queryOrderDetail/**","/scaleExternalSource/save","/system/updateItem/**","/system/updateAnswer/**"};
+                "/api/orderInfo/queryOrderDetail/**","/scaleExternalSource/save","/system/updateItem/**","/system/updateAnswer/**","/system/addMarks/**"};
         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/**"};

+ 0 - 16
src/main/java/com/rf/psychological/scale/resultBusiness/scaleResult/PSQIScale.java

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

+ 31 - 0
src/main/java/com/rf/psychological/user/rest/SystemController.java

@@ -717,4 +717,35 @@ public class SystemController extends BaseController {
         }
     }
 
+    @GetMapping("addMarks")
+    public void addMarks(String fileName,String flag){
+        File file = new File("C:\\Users\\Administrator\\Desktop\\"+fileName+".xlsx");
+        try {
+            List<List<List<Object>>> datas = ExcelUtil.getBankListByExcelSheet(new FileInputStream(file.getAbsolutePath()), file.getName());
+            List<ScaleMarksEntity> scaleMarksEntities = scaleMarksService.getScaleMarksByFlag(flag);
+            List<List<Object>> markObj = datas.get(2);
+            for (int i =0;i<markObj.size();i++){
+                List<Object> objects = markObj.get(i);
+                ScaleMarksEntity entity = new ScaleMarksEntity();
+                entity.setName(objects.get(0).toString());
+                entity.setScoreStart(objects.get(1).toString());
+                entity.setScoreEnd(objects.get(2).toString());
+                entity.setSymptom("无");
+                entity.setImprovementSuggestions(objects.get(4).toString());
+                entity.setFlag(flag);
+                entity.setReference("无");
+                entity.setStandardDeviation("无");
+                entity.setNameExplain("无");
+                entity.setSuggestion("无");
+                entity.setIsTotalScoreExplain("否");
+                entity.setScoringType("2");
+                log.info(entity.toString());
+                //scaleMarksService.saveScaleMarks(entity);
+            }
+
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+    }
+
 }