|
|
@ -327,13 +327,18 @@ public class QuestionService implements IQuestionService { |
|
|
|
private void saveAnswerRecord(QuestionDto.Score score, HtQuestion question) { |
|
|
|
if (StrUtil.isNotBlank(score.getPath())) { |
|
|
|
HtPatientQuestionRecordExample example = new HtPatientQuestionRecordExample(); |
|
|
|
String type = ""; |
|
|
|
String type; |
|
|
|
switch (question.getOperateType()) { |
|
|
|
case 1://语音
|
|
|
|
case 4://敲击
|
|
|
|
|
|
|
|
case Constant.Ht.Operation.VOICE://语音
|
|
|
|
|
|
|
|
case Constant.Ht.Operation.KNOCK://敲击
|
|
|
|
type = Constant.Ht.Record.ANSWER_AUDIO; |
|
|
|
break; |
|
|
|
case 2: //画图
|
|
|
|
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: |
|
|
@ -572,7 +577,7 @@ public class QuestionService implements IQuestionService { |
|
|
|
List<QuestionVo.Point> canvasPoints = getCanvasPoints(htPatientCanvas); |
|
|
|
patientCanvas.setPoints(canvasPoints); |
|
|
|
//计算参数
|
|
|
|
QuestionVo.Parameter parameter = getParameter(htPatientCanvas, param); |
|
|
|
QuestionVo.Parameter parameter = getParameter(question, htPatientCanvas, param); |
|
|
|
patientCanvas.setParameters(parameter); |
|
|
|
canvasList.add(patientCanvas); |
|
|
|
}); |
|
|
@ -639,11 +644,13 @@ public class QuestionService implements IQuestionService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 统计画图的参数 |
|
|
|
* |
|
|
|
* @param question |
|
|
|
* @param htPatientCanvas 画板信息 |
|
|
|
* @param param 请求参数 参考长度 参考思考时间 |
|
|
|
* @return 返回此次画图的参数 |
|
|
|
*/ |
|
|
|
private QuestionVo.Parameter getParameter(HtPatientCanvas htPatientCanvas, QuestionDto.QueryPatientCanvas param) { |
|
|
|
private QuestionVo.Parameter getParameter(HtQuestion question, HtPatientCanvas htPatientCanvas, QuestionDto.QueryPatientCanvas param) { |
|
|
|
QuestionVo.Parameter parameter = new QuestionVo.Parameter(); |
|
|
|
//开始画图时长:打开画板到第一笔画图时长
|
|
|
|
parameter.setStartDuration(htPatientCanvas.getBeginTime() - htPatientCanvas.getOpenCanvasTime()); |
|
|
@ -810,6 +817,19 @@ public class QuestionService implements IQuestionService { |
|
|
|
parameter.setMinCircleAcreage(new BigDecimal(Math.PI * diameter * diameter / 4).setScale(2, BigDecimal.ROUND_HALF_UP)); |
|
|
|
// 四个边界点
|
|
|
|
setFourPoint(canvasPoints, minX, maxX, minY, maxY); |
|
|
|
// 计算四个边界点构成的长方形距离画板重心的距离
|
|
|
|
int canvasHeight = htPatientCanvas.getCanvasHeight(); |
|
|
|
int canvasWidth = htPatientCanvas.getCanvasWidth(); |
|
|
|
|
|
|
|
// 画板是否为canvas的一半
|
|
|
|
boolean half = question.getOperateType() == Constant.Ht.Operation.PAINT_HALF || |
|
|
|
question.getOperateType() == Constant.Ht.Operation.PAINT_HALF_IMG; |
|
|
|
int centerX = half ? (canvasWidth / 2 + 30) / 2 : canvasWidth / 2; |
|
|
|
int centerY = canvasHeight / 2; |
|
|
|
parameter.setTopLength(Math.abs(minY.value - centerY)); |
|
|
|
parameter.setBottomLength(Math.abs(maxY.value - centerY)); |
|
|
|
parameter.setLeftLength(Math.abs(minX.value - centerX)); |
|
|
|
parameter.setRightLength(Math.abs(maxX.value - centerX)); |
|
|
|
|
|
|
|
//平均长度
|
|
|
|
BigDecimal aveLength = BigDecimal.valueOf(totalLength / canvasPoints.size()).setScale(2, RoundingMode.HALF_UP); |
|
|
|