|
@@ -119,6 +119,9 @@ public class WebScaleResultController extends BaseController {
|
|
|
@Autowired
|
|
|
private InstitutionService institutionService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ScaleDetailsService scaleDetailsService;
|
|
|
+
|
|
|
@SafetyProcess
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@OperationLogAnnotation("保存量表记录")
|
|
@@ -188,7 +191,8 @@ public class WebScaleResultController extends BaseController {
|
|
|
//根据flag获取全部维度信息
|
|
|
List<DimensionEntity> dimensionEntities = this.dimensionService.getDimensionByFlag(flag);
|
|
|
//根据flag获取量表名称
|
|
|
- List<SubjectEntity> subjectEntities = this.subjectService.getSubjectByFlag(flag);
|
|
|
+ //List<SubjectEntity> subjectEntities = this.subjectService.getSubjectByFlag(flag);
|
|
|
+ ScaleDetailsEntity detailsEntity = this.scaleDetailsService.getSubjectDetailsByFlag(flag);
|
|
|
resultJson.put("scaleEntities", scaleEntities);
|
|
|
resultJson.put("answerEntities", answerEntities);
|
|
|
resultJson.put("scaleMarksEntities", scaleMarksEntities);
|
|
@@ -254,9 +258,9 @@ public class WebScaleResultController extends BaseController {
|
|
|
resultJson = resultJson.getJSONObject("resultJson");
|
|
|
return success(resultJson, "完成");
|
|
|
}
|
|
|
- fileName = fileName + "-" + subjectEntities.get(0).getName() + ".xlsx";
|
|
|
+ fileName = fileName + "-" + detailsEntity.getScaleName() + ".xlsx";
|
|
|
//导出文件
|
|
|
- ExcelUtil.createExcelFile(ScaleEntity.class, dataList, (List<Map<String, String>>) resultJson.get("resultMapList"), new ExcelClass().contentExcel(), fileName, subjectEntities.get(0).getName());
|
|
|
+ ExcelUtil.createExcelFile(ScaleEntity.class, dataList, (List<Map<String, String>>) resultJson.get("resultMapList"), new ExcelClass().contentExcel(), fileName, detailsEntity.getScaleName());
|
|
|
|
|
|
//计算结果
|
|
|
JSONArray dbJsonList = new JSONArray();
|
|
@@ -316,8 +320,8 @@ public class WebScaleResultController extends BaseController {
|
|
|
i++;
|
|
|
}
|
|
|
String filePath;
|
|
|
- filePath = "./心理检测/检测结果/" + new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + "/" + subjectEntities.get(0).getName() + "/" + fileName;
|
|
|
- UserRecordEntity userRecordEntity = testRecord(flag, phone, institutionNo, testTime, filePath, JSON.toJSONString(dbJsonList, SerializerFeature.DisableCircularReferenceDetect), subjectEntities.get(0).getName(), JSON.toJSONString(dataList, SerializerFeature.DisableCircularReferenceDetect), testResult, testPlanId);
|
|
|
+ filePath = "./心理检测/检测结果/" + new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + "/" + detailsEntity.getScaleName() + "/" + fileName;
|
|
|
+ UserRecordEntity userRecordEntity = testRecord(flag, phone, institutionNo, testTime, filePath, JSON.toJSONString(dbJsonList, SerializerFeature.DisableCircularReferenceDetect), detailsEntity.getScaleName(), JSON.toJSONString(dataList, SerializerFeature.DisableCircularReferenceDetect), testResult, testPlanId);
|
|
|
//预警信息处理
|
|
|
if (dimensionScore != null && dimensionScore.size() > 0) {
|
|
|
if (dimensionEntities != null && dimensionEntities.size() > 0) {
|