|
|
@ -365,41 +365,43 @@ public class QuestionService implements IQuestionService { |
|
|
|
} |
|
|
|
|
|
|
|
private void saveAnswerRecord(QuestionDto.Score score, HtQuestion question) { |
|
|
|
if (StrUtil.isNotBlank(score.getPath())) { |
|
|
|
HtPatientQuestionRecordExample example = new HtPatientQuestionRecordExample(); |
|
|
|
String type; |
|
|
|
switch (question.getOperateType()) { |
|
|
|
//语音
|
|
|
|
case Constant.Ht.Operation.VOICE: |
|
|
|
if (CollectionUtil.isEmpty(score.getPaths())) { |
|
|
|
return; |
|
|
|
} |
|
|
|
String type; |
|
|
|
switch (question.getOperateType()) { |
|
|
|
//语音
|
|
|
|
case Constant.Ht.Operation.VOICE: |
|
|
|
//敲击
|
|
|
|
case Constant.Ht.Operation.KNOCK: |
|
|
|
type = Constant.Ht.Record.ANSWER_AUDIO; |
|
|
|
break; |
|
|
|
//画图
|
|
|
|
case Constant.Ht.Operation.PAINT: |
|
|
|
case Constant.Ht.Operation.PAINT_HALF: |
|
|
|
case Constant.Ht.Operation.PAINT_HALF_IMG: |
|
|
|
case Constant.Ht.Operation.PAINT_NO_IMG: |
|
|
|
type = Constant.Ht.Record.ANSWER_IMG; |
|
|
|
break; |
|
|
|
default: |
|
|
|
type = Constant.Ht.Record.ANSWER_TEXT; |
|
|
|
break; |
|
|
|
} |
|
|
|
example.createCriteria().andPatientReportIdEqualTo(score.getPatientReportId()).andQuestionIdEqualTo(score.getQuestionId()).andRecordTypeEqualTo(type); |
|
|
|
HtPatientQuestionRecord delRecord = new HtPatientQuestionRecord(); |
|
|
|
delRecord.setIsDel(Constant.Ht.IS_DEL); |
|
|
|
htPatientQuestionRecordMapper.updateByExampleSelective(delRecord, example); |
|
|
|
|
|
|
|
case Constant.Ht.Operation.KNOCK: |
|
|
|
type = Constant.Ht.Record.ANSWER_AUDIO; |
|
|
|
break; |
|
|
|
//画图
|
|
|
|
case Constant.Ht.Operation.PAINT: |
|
|
|
case Constant.Ht.Operation.PAINT_HALF: |
|
|
|
case Constant.Ht.Operation.PAINT_HALF_IMG: |
|
|
|
case Constant.Ht.Operation.PAINT_NO_IMG: |
|
|
|
type = Constant.Ht.Record.ANSWER_IMG; |
|
|
|
break; |
|
|
|
default: |
|
|
|
type = Constant.Ht.Record.ANSWER_TEXT; |
|
|
|
break; |
|
|
|
} |
|
|
|
HtPatientQuestionRecordExample example = new HtPatientQuestionRecordExample(); |
|
|
|
example.createCriteria().andPatientReportIdEqualTo(score.getPatientReportId()).andQuestionIdEqualTo(score.getQuestionId()).andRecordTypeEqualTo(type); |
|
|
|
HtPatientQuestionRecord delRecord = new HtPatientQuestionRecord(); |
|
|
|
delRecord.setIsDel(Constant.Ht.IS_DEL); |
|
|
|
htPatientQuestionRecordMapper.updateByExampleSelective(delRecord, example); |
|
|
|
score.getPaths().forEach(path->{ |
|
|
|
HtPatientQuestionRecord record = new HtPatientQuestionRecord(); |
|
|
|
record.setId(snowflake.nextId()); |
|
|
|
record.setPatientReportId(score.getPatientReportId()); |
|
|
|
record.setQuestionId(score.getQuestionId()); |
|
|
|
record.setRecordTime(System.currentTimeMillis()); |
|
|
|
record.setRecordType(type); |
|
|
|
record.setRecordValue(score.getPath()); |
|
|
|
record.setRecordValue(path); |
|
|
|
htPatientQuestionRecordMapper.insertSelective(record); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private void countScore(QuestionDto.Score score, String parentCode, HtPatientReport report, List<HtPatientScore> scores, HtQuestionScoringRule rule) { |
|
|
|