删除答卷同步更新回答人数#15

This commit is contained in:
KeYuan 2017-08-01 22:04:38 +08:00
parent 6339c5d472
commit dad4258969

View File

@ -103,6 +103,11 @@ public class MySurveyAnswerAction extends ActionSupport{
SurveyDirectory survey=directoryManager.getSurveyByUser(answer.getSurveyId(), user.getId());
if(survey!=null){
surveyAnswerManager.delete(answer);
Integer answerNum = survey.getAnswerNum();
if(answerNum!=null && answerNum>=1){
survey.setAnswerNum(answerNum-1);
directoryManager.save(survey);
}
}
}
}