|
@@ -305,7 +305,20 @@ public class TrainingDemandServiceImpl implements TrainingDemandService {
|
|
|
log.debug("参数异常");
|
|
|
return R.ok();
|
|
|
}
|
|
|
+
|
|
|
TrainingDemandSurveyBackupsDo trainingDemandSurveyBackupsDo = trainingDemandSurveyBackupsServiceImpl.getById(id);
|
|
|
+ if (trainingDemandSurveyBackupsDo == null) {
|
|
|
+ log.debug("问卷不存在");
|
|
|
+ return R.error("当前问卷已结束");
|
|
|
+ }
|
|
|
+ SysUserVo currentUser = TrainingUtils.getCurrentUser();
|
|
|
+ // 不需要显示答案时如果当前用户已参与培训 则提示
|
|
|
+ if (!showAnswer && currentUser != null && StringUtils.isNotBlank(trainingDemandSurveyBackupsDo.getParticipatinguserid())
|
|
|
+ && trainingDemandSurveyBackupsDo.getParticipatinguserid().contains(currentUser.getId())) {
|
|
|
+ log.debug("已参与问卷");
|
|
|
+ return R.error("您已参与过当前问卷");
|
|
|
+ }
|
|
|
+
|
|
|
String oldSurveyId = trainingDemandSurveyBackupsDo.getOldSurveyId();
|
|
|
TrainingDemandSurveyDo trainingDemandSurveyDo = trainingDemandSurveyDao.selectById(oldSurveyId);
|
|
|
if (StringUtils.isBlank(trainingDemandSurveyDo.getState()) || !"1".equals(trainingDemandSurveyDo.getState())) {
|
|
@@ -316,7 +329,7 @@ public class TrainingDemandServiceImpl implements TrainingDemandService {
|
|
|
log.debug("问卷调查发布状态异常");
|
|
|
return R.error("问卷调查已结束");
|
|
|
}
|
|
|
- SysUserVo currentUser = TrainingUtils.getCurrentUser();
|
|
|
+
|
|
|
List<TrainingDemandVo> surveyContent = demandSurveyContentDao.getSurveyContent(id,
|
|
|
showAnswer ? currentUser == null ? "" : currentUser.getId() : "");
|
|
|
|