Commit 98c196096dbcb79a45006bd9b0909d347f133a95

Authored by liquanyu
1 parent 5dce3c42c0

问卷调查

Showing 1 changed file with 20 additions and 12 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/QuestionFacade.java View file @ 98c1960
... ... @@ -55,19 +55,27 @@
55 55 private BasicConfigService basicConfigService;
56 56  
57 57 public BaseResponse addQuestions(QuestionModel questionModel) {
58   - questionModel.setCreated(new Date());
59   - questionModel.setInvestDate(new Date());
60   - questionModel.setModified(new Date());
61   - String resultId = QuestionEnums.getIdByScore(questionModel.getScore());
62   - questionModel.setResultId(resultId);
63   - Patients patients = patientsService.findOnePatientById(questionModel.getPatientId());
64   - questionModel.setInvestigator(patients.getBookbuildingDoctor());
65   - QuestionModel question = questionService.addQuestions(questionModel);
66   -
67 58 BaseObjectResponse response = new BaseObjectResponse();
68   - response.setData(question.getId());
69   - response.setErrormsg("成功");
70   - response.setErrorcode(ErrorCodeConstants.SUCCESS);
  59 + try {
  60 + questionModel.setCreated(new Date());
  61 + questionModel.setInvestDate(new Date());
  62 + questionModel.setModified(new Date());
  63 + String resultId = QuestionEnums.getIdByScore(questionModel.getScore());
  64 + questionModel.setResultId(resultId);
  65 + Patients patients = patientsService.findOnePatientById(questionModel.getPatientId());
  66 + questionModel.setInvestigator(patients.getBookbuildingDoctor());
  67 + questionService.addQuestions(questionModel);
  68 + response.setData(questionModel.getId());
  69 + response.setErrormsg("成功");
  70 + response.setErrorcode(ErrorCodeConstants.SUCCESS);
  71 + return response;
  72 + }
  73 + catch (Exception e)
  74 + {
  75 + response.setErrormsg("失败");
  76 + response.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR);
  77 + }
  78 +
71 79 return response;
72 80 }
73 81