Browse Source

保存试题答案接口:删除了一些无用代码

master-admin
zhangye 2 weeks ago
parent
commit
2f7d8d7536
  1. 127
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsServiceImpl.java
  2. 2
      web_client/src/api/ams.js

127
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsServiceImpl.java

@ -452,11 +452,6 @@ public class AmsServiceImpl implements IAmsService {
resultVo.setCodeEnum(ErrorConstant.PARAM_ERROR);
return resultVo;
}
// if (CollectionUtil.isEmpty(dto.getOptions())) {
// //没有选项 返回报错 修改于 2023-07-27
// resultVo.setCodeEnum(ErrorConstant.QUESTION_SAVE_ERROR);
// return resultVo;
//
if (CollectionUtil.isEmpty(dto.getOptions()) && CollectionUtil.isEmpty(dto.getPaths())) {
List<AmsPatientAnswerScore> scores = new ArrayList<>();
@ -483,7 +478,6 @@ public class AmsServiceImpl implements IAmsService {
//没有选项和画图录音等,不进行保存
resultVo.setCodeEnum(ErrorConstant.SUCCESS);
} else {
// String parentCode = question.getCognitiveCode().contains("-") ? question.getCognitiveCode().split("-")[0] : question.getCognitiveCode();
String parentCode = question.getCognitiveCode();
//查询报告单
EmsEvaluation report = emsEvaluationMapper.selectByPrimaryKey(dto.getPatientReportId());
@ -552,21 +546,9 @@ public class AmsServiceImpl implements IAmsService {
// 保存答案
saveAnswerRecord(dto, question);
//修改报告单是否完成一次测评
changeShowStatus(report, question);
// //保存自动录音文件
// if (StrUtil.isNotEmpty(dto.getPath())) {
// //自动录音
// QmsQuestionRecording htQuestionRecording = new QmsQuestionRecording();
// htQuestionRecording.setQuestionId(question.getId());
// htQuestionRecording.setReportId(report.getId());
// htQuestionRecording.setDelFlag(GenConstants.Ht.NO_DEL);
// htQuestionRecording.setId(IDGenerator.nextSnowflakeId());
// htQuestionRecording.setPath(score.getPath());
// htQuestionRecording.setPatientId(scores.get(0).getPatientId());
// questionRecordingMapper.insertSelective(htQuestionRecording);
// }
// //修改报告单是否完成一次测评
// changeShowStatus(report, question);
}
//进入延迟回忆,先删除已存在的倒计时
@ -599,7 +581,6 @@ public class AmsServiceImpl implements IAmsService {
}
if (!(dto.getStatus() != null && (dto.getStatus() == 1 || dto.getStatus() == 2))) {
//由MQ变为Redis
if (CollectionUtil.isNotEmpty(shows)
// && dto.getIsSubmit() == 1
) {
@ -661,68 +642,6 @@ public class AmsServiceImpl implements IAmsService {
resultVo.setRecallQuestion(0);
}
}
//最后一题判断量表是否已全部完成
if (ObjectUtil.isNotEmpty(dto.getLast())) {
if (dto.getLast()) {
switch (question.getScaleCode()) {
case "AD8":
BigDecimal ad8Score = getRealFinish(dto.getPatientReportId(), "AD8");
resultVo.setRealFinish(ad8Score.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "PJS":
BigDecimal pjsScore = getRealFinish(dto.getPatientReportId(), "PJS");
resultVo.setRealFinish(pjsScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "MINIC":
BigDecimal minicScore = getMinicScore(dto.getPatientReportId());
resultVo.setRealFinish(minicScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "NP":
BigDecimal npScore = getRealFinish(dto.getPatientReportId(), "NP");
resultVo.setRealFinish(npScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "HIS":
BigDecimal hisScore = getRealFinish(dto.getPatientReportId(), "HIS");
resultVo.setRealFinish(hisScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "GDS":
BigDecimal gdsScore = getRealFinish(dto.getPatientReportId(), "GDS");
resultVo.setRealFinish(gdsScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "MMSE":
BigDecimal mmseScore = getMmseScore(dto.getPatientReportId(), "MMSE");
resultVo.setRealFinish(mmseScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "ADL":
BigDecimal adlScore = getRealFinish(dto.getPatientReportId(), "ADL");
resultVo.setRealFinish(adlScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "CDR":
BigDecimal cdrScore = getRealFinish(dto.getPatientReportId(), "CDR");
resultVo.setRealFinish(cdrScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "SCD":
BigDecimal scdScore = getRealFinish(dto.getPatientReportId(), "SCD");
resultVo.setRealFinish(scdScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "WEBSTER":
BigDecimal websterScore = getRealFinish(dto.getPatientReportId(), "WEBSTER");
resultVo.setRealFinish(websterScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "SE":
BigDecimal seScore = getRealFinish(dto.getPatientReportId(), "SE");
resultVo.setRealFinish(seScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "NMSA":
BigDecimal nmsaScore = getMmseScore(dto.getPatientReportId(), "NMSA");
resultVo.setRealFinish(nmsaScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
default:
resultVo.setRealFinish(1);
}
}
}
return resultVo;
}
@ -969,26 +888,26 @@ public class AmsServiceImpl implements IAmsService {
});
}
/**
* 修改报告单显示状态
*/
private void changeShowStatus(EmsEvaluation evaluation, QmsQuestion question) {
//根据测评id查找报告单信息
RmsReportExample rmsReportExample = new RmsReportExample();
rmsReportExample.createCriteria().andEvaluationIdEqualTo(evaluation.getId());
List<RmsReport> rmsReports = rmsReportMapper.selectByExample(rmsReportExample);
if (CollUtil.isNotEmpty(rmsReports)) {
RmsReport report = rmsReports.get(0);
if (report.getShowStatus() != null && report.getShowStatus() == GenConstants.Ht.Report.SHOW_HISTORY) {
return;
}
Integer maxSort = questionDao.selectMaxSort(question.getScaleCode());
if (question.getSort() != null && maxSort != null && question.getSort() >= maxSort) {
report.setShowStatus(GenConstants.Ht.Report.SHOW_HISTORY);
rmsReportMapper.updateByPrimaryKeySelective(report);
}
}
}
// /**
// * 修改报告单显示状态
// */
// private void changeShowStatus(EmsEvaluation evaluation, QmsQuestion question) {
// //根据测评id查找报告单信息
// RmsReportExample rmsReportExample = new RmsReportExample();
// rmsReportExample.createCriteria().andEvaluationIdEqualTo(evaluation.getId());
// List<RmsReport> rmsReports = rmsReportMapper.selectByExample(rmsReportExample);
// if (CollUtil.isNotEmpty(rmsReports)) {
// RmsReport report = rmsReports.get(0);
// if (report.getShowStatus() != null && report.getShowStatus() == GenConstants.Ht.Report.SHOW_HISTORY) {
// return;
// }
// Integer maxSort = questionDao.selectMaxSort(question.getScaleCode());
// if (question.getSort() != null && maxSort != null && question.getSort() >= maxSort) {
// report.setShowStatus(GenConstants.Ht.Report.SHOW_HISTORY);
// rmsReportMapper.updateByPrimaryKeySelective(report);
// }
// }
// }
@Override
public BigDecimal getRealFinish(Long reportId, String code) {

2
web_client/src/api/ams.js

@ -217,4 +217,4 @@ export const deletePatient = (params) =>
axios.post(`${proxyUrl}/ems/delete`, params);
// 撤回评估
export const revok = (params) =>
axios.post(`${proxyUrl}/ems/revok`, params);
axios.post(`${proxyUrl}/ems/revoke`, params);
Loading…
Cancel
Save