Explorar el Código

feature 代码提交

xiahan hace 1 año
padre
commit
46cb3351e9

+ 1 - 1
rw-training/training-common/src/main/java/com/rongwei/trainingcommon/sys/service/TrainingDemandService.java

@@ -20,7 +20,7 @@ public interface TrainingDemandService {
 
     R getInfoByUser(String userId);
 
-    R showQuestionnaire(String id);
+    R showQuestionnaire(String id, boolean showAnswer);
 
     R submit(List<TrainingDemandVo> trainingDemandVoList);
 }

+ 3 - 2
rw-training/training-common/src/main/java/com/rongwei/trainingcommon/sys/service/impl/TrainingDemandServiceImpl.java

@@ -288,7 +288,7 @@ public class TrainingDemandServiceImpl implements TrainingDemandService {
      * @return
      */
     @Override
-    public R showQuestionnaire(String id) {
+    public R showQuestionnaire(String id, boolean showAnswer) {
         if (StringUtils.isBlank(id)) {
             log.debug("参数异常");
             return R.ok();
@@ -305,7 +305,8 @@ public class TrainingDemandServiceImpl implements TrainingDemandService {
             return R.error("问卷调查已结束");
         }
         SysUserVo currentUser = TrainingUtils.getCurrentUser();
-        List<TrainingDemandVo> surveyContent = demandSurveyContentDao.getSurveyContent(id, currentUser == null ? "" : currentUser.getId());
+        List<TrainingDemandVo> surveyContent = demandSurveyContentDao.getSurveyContent(id,
+                showAnswer ? currentUser == null ? "" : currentUser.getId() : "");
 
         LinkedHashMap<String, List<TrainingDemandVo>> collect = surveyContent.stream()
                 .collect(Collectors.groupingBy(TrainingDemandVo::getModelName, LinkedHashMap::new, Collectors.toList()));

+ 3 - 2
rw-training/training-server/src/main/java/com/rongwei/training/controller/TrainingDemandController.java

@@ -70,9 +70,10 @@ public class TrainingDemandController {
      * @return
      */
     @GetMapping("/show")
-    public R showQuestionnaire(@RequestParam(name = "surveyId")String surveyId) {
+    public R showQuestionnaire(@RequestParam(name = "surveyId")String surveyId,
+                               @RequestParam(name = "showAnswer") boolean showAnswer) {
         log.info("开发发布需求调查问卷");
-        return trainingDemandService.showQuestionnaire(surveyId);
+        return trainingDemandService.showQuestionnaire(surveyId,showAnswer);
     }
 
     @PostMapping("/submit")