|
|
@ -432,7 +432,8 @@ public class QuestionService implements IQuestionService { |
|
|
|
* 保存画图轨迹信息 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public QuestionVo.PatientCanvas saveCanvas(QuestionDto.SavePatientCanvas param, Long userId) { |
|
|
|
public List<QuestionVo.PatientCanvas> saveCanvas(QuestionDto.SavePatientCanvas param, Long userId) { |
|
|
|
log.info("添加数据,报告单id:{},试题id:{}",param.getPatientReportId(),param.getQuestionId()); |
|
|
|
//添加画板基本信息
|
|
|
|
HtPatientCanvas patientCanvas = new HtPatientCanvas(); |
|
|
|
patientCanvas.setId(snowflake.nextId()); |
|
|
@ -452,6 +453,7 @@ public class QuestionService implements IQuestionService { |
|
|
|
//添加轨迹信息
|
|
|
|
if(CollectionUtil.isNotEmpty(param.getPoints())){ |
|
|
|
param.getPoints().forEach(point -> { |
|
|
|
log.info("添加轨迹信息"); |
|
|
|
HtPatientCanvasLine patientCanvasLine = new HtPatientCanvasLine(); |
|
|
|
patientCanvasLine.setId(snowflake.nextId()); |
|
|
|
patientCanvasLine.setPatientCanvasId(patientCanvas.getId()); |
|
|
@ -470,31 +472,35 @@ public class QuestionService implements IQuestionService { |
|
|
|
* 查看用户画图信息 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public QuestionVo.PatientCanvas getCanvas(QuestionDto.QueryPatientCanvas param, Long userId) { |
|
|
|
QuestionVo.PatientCanvas patientCanvas = new QuestionVo.PatientCanvas(); |
|
|
|
|
|
|
|
public List<QuestionVo.PatientCanvas> getCanvas(QuestionDto.QueryPatientCanvas param, Long userId) { |
|
|
|
List<QuestionVo.PatientCanvas> canvasList = new ArrayList<>(); |
|
|
|
log.info("报告单id:{},试题id:{}",param.getPatientReportId(),param.getQuestionId()); |
|
|
|
HtPatientCanvasExample canvasExample = new HtPatientCanvasExample(); |
|
|
|
canvasExample.createCriteria().andPatientReportIdEqualTo(param.getPatientReportId()).andQuestionIdEqualTo(param.getQuestionId()); |
|
|
|
canvasExample.setOrderByClause("begin_time DESC"); |
|
|
|
List<HtPatientCanvas> patientCanvasList = patientCanvasDao.selectByExample(canvasExample); |
|
|
|
|
|
|
|
if(CollectionUtil.isEmpty(patientCanvasList)){ |
|
|
|
return patientCanvas; |
|
|
|
return canvasList; |
|
|
|
} |
|
|
|
patientCanvas.setPatientCanvasId(patientCanvasList.get(0).getId()); |
|
|
|
patientCanvas.setPatientReportId(patientCanvasList.get(0).getPatientReportId()); |
|
|
|
patientCanvas.setQuestionId(patientCanvasList.get(0).getQuestionId()); |
|
|
|
patientCanvas.setBeginTime(patientCanvasList.get(0).getBeginTime()); |
|
|
|
|
|
|
|
QuestionVo.Canvas canvas = new QuestionVo.Canvas(); |
|
|
|
canvas.setWidth(patientCanvasList.get(0).getCanvasWidth()); |
|
|
|
canvas.setHeight(patientCanvasList.get(0).getCanvasHeight()); |
|
|
|
patientCanvas.setCanvas(canvas); |
|
|
|
QuestionVo.CanvasLine canvasLine = new QuestionVo.CanvasLine(); |
|
|
|
canvasLine.setColor(patientCanvasList.get(0).getLineColor()); |
|
|
|
canvasLine.setWidth(patientCanvasList.get(0).getLineWidth()); |
|
|
|
patientCanvas.setLine(canvasLine); |
|
|
|
patientCanvas.setPoints(patientCanvasDao.getCanvasPoints(patientCanvasList.get(0).getId())); |
|
|
|
|
|
|
|
return patientCanvas; |
|
|
|
patientCanvasList.forEach(htPatientCanvas ->{ |
|
|
|
QuestionVo.PatientCanvas patientCanvas = new QuestionVo.PatientCanvas(); |
|
|
|
patientCanvas.setPatientCanvasId(htPatientCanvas.getId()); |
|
|
|
patientCanvas.setPatientReportId(htPatientCanvas.getPatientReportId()); |
|
|
|
patientCanvas.setQuestionId(htPatientCanvas.getQuestionId()); |
|
|
|
patientCanvas.setBeginTime(htPatientCanvas.getBeginTime()); |
|
|
|
|
|
|
|
QuestionVo.Canvas canvas = new QuestionVo.Canvas(); |
|
|
|
canvas.setWidth(htPatientCanvas.getCanvasWidth()); |
|
|
|
canvas.setHeight(htPatientCanvas.getCanvasHeight()); |
|
|
|
patientCanvas.setCanvas(canvas); |
|
|
|
QuestionVo.CanvasLine canvasLine = new QuestionVo.CanvasLine(); |
|
|
|
canvasLine.setColor(htPatientCanvas.getLineColor()); |
|
|
|
canvasLine.setWidth(htPatientCanvas.getLineWidth()); |
|
|
|
patientCanvas.setLine(canvasLine); |
|
|
|
patientCanvas.setPoints(patientCanvasDao.getCanvasPoints(htPatientCanvas.getId())); |
|
|
|
canvasList.add(patientCanvas); |
|
|
|
}); |
|
|
|
return canvasList; |
|
|
|
} |
|
|
|
} |
|
|
|