Ver código fonte

Merge remote-tracking branch 'origin/master'

hyq 1 ano atrás
pai
commit
feb246dca9

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

@@ -115,11 +115,16 @@ public class TrainingDemandServiceImpl implements TrainingDemandService {
         List<TrainingDemandTempDo> trainingDemandTempDos = trainingDemandTempDao.selectList(new LambdaQueryWrapper<TrainingDemandTempDo>()
                 .in(TrainingDemandTempDo::getId, surveyTempDetailDos.stream().map(TrainingDemandSurveyTempDetailDo::getTempid).collect(Collectors.toList())));
         // 模板子表
-        List<TrainingDemandTempDetailDo> trainingDemandTempDetailDos = trainingDemandTempDetailDao.selectList(new LambdaQueryWrapper<TrainingDemandTempDetailDo>()
-                .in(TrainingDemandTempDetailDo::getDemandtempid, trainingDemandTempDos.stream().map(TrainingDemandTempDo::getId).collect(Collectors.toList())));
+        List<TrainingDemandTempDetailDo> trainingDemandTempDetailDos = trainingDemandTempDetailDao.selectList(
+                new LambdaQueryWrapper<TrainingDemandTempDetailDo>()
+                .in(TrainingDemandTempDetailDo::getDemandtempid,
+                        trainingDemandTempDos.stream().map(TrainingDemandTempDo::getId).collect(Collectors.toList()))
+                        .orderByAsc(TrainingDemandTempDetailDo::getNum));
         // 模板问题选项记录表
         List<TrainingDemandTempQuestionOptionDo> trainingDemandTempQuestionOptionDos = trainingDemandTempQuestionOptionDao.selectList(new LambdaQueryWrapper<TrainingDemandTempQuestionOptionDo>()
-                .in(TrainingDemandTempQuestionOptionDo::getDemandtempdetailid, trainingDemandTempDetailDos.stream().map(TrainingDemandTempDetailDo::getId).collect(Collectors.toList())));
+                .in(TrainingDemandTempQuestionOptionDo::getDemandtempdetailid,
+                        trainingDemandTempDetailDos.stream().map(TrainingDemandTempDetailDo::getId).collect(Collectors.toList()))
+                .orderByAsc(TrainingDemandTempQuestionOptionDo::getNum));
 
         String userIds = participantUserId.stream().map(info -> info.split("-;-")[0]).collect(Collectors.joining(","));
         String userNames = participantUserId.stream().map(info -> info.split("-;-")[1]).collect(Collectors.joining(","));
@@ -222,12 +227,16 @@ public class TrainingDemandServiceImpl implements TrainingDemandService {
         List<TrainingDemandTempDo> trainingDemandTempDos = trainingDemandTempDao.selectList(new LambdaQueryWrapper<TrainingDemandTempDo>()
                 .in(TrainingDemandTempDo::getId, tempIdList).eq(BaseDo::getDeleted, "0"));
         // 问题模板问题
-        List<TrainingDemandTempDetailDo> trainingDemandTempDetailDos = trainingDemandTempDetailDao.selectList(new LambdaQueryWrapper<TrainingDemandTempDetailDo>()
-                .in(TrainingDemandTempDetailDo::getDemandtempid, tempIdList).eq(BaseDo::getDeleted, "0"));
+        List<TrainingDemandTempDetailDo> trainingDemandTempDetailDos = trainingDemandTempDetailDao.selectList(
+                new LambdaQueryWrapper<TrainingDemandTempDetailDo>()
+                .in(TrainingDemandTempDetailDo::getDemandtempid, tempIdList)
+                        .eq(BaseDo::getDeleted, "0").orderByAsc(TrainingDemandTempDetailDo::getNum));
         List<String> questionIdList = trainingDemandTempDetailDos.stream().map(TrainingDemandTempDetailDo::getQuestionid).collect(Collectors.toList());
         // 问题答案
         List<TrainingDemandQuestionOptionDo> trainingDemandQuestionDos = trainingDemandQuestionOptionDao.selectList(new LambdaQueryWrapper<TrainingDemandQuestionOptionDo>()
-                .in(TrainingDemandQuestionOptionDo::getQuestionid, questionIdList).eq(BaseDo::getDeleted, "0"));
+                .in(TrainingDemandQuestionOptionDo::getQuestionid, questionIdList)
+                .eq(BaseDo::getDeleted, "0")
+                .orderByAsc(TrainingDemandQuestionOptionDo::getNum));
 
         List<TrainingDemandVo> trainingDemandVoList = new ArrayList<>();
         int num = 1;