wangliang 2 anni fa
parent
commit
f0193cee60

+ 6 - 6
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEStudentServiceImpl.java

@@ -99,18 +99,18 @@ public class TEStudentServiceImpl extends ServiceImpl<TEStudentMapper, TEStudent
                 Gson gson = new Gson();
                 List<TEStudentMonitorRecordDto> monitorRecordList = gson.fromJson(t.getTencentVideoUrl(), new TypeToken<List<TEStudentMonitorRecordDto>>() {
                 }.getType());
-                StringJoiner stringJoiner = new StringJoiner("");
+                Set<MonitorVideoSourceEnum> set = new LinkedHashSet<>(monitorRecordList.size());
                 for (TEStudentMonitorRecordDto teStudentMonitorRecordDto : monitorRecordList) {
-                    stringJoiner.add(SystemConstant.getMonitorRecordVideoSource(teStudentMonitorRecordDto.getVideoSource()).name().toUpperCase()).add(",");
+                    set.add(SystemConstant.getMonitorRecordVideoSource(teStudentMonitorRecordDto.getVideoSource()));
                 }
-                t.setMonitorRecord(stringJoiner.toString().substring(0, stringJoiner.toString().length() - 1));
+                t.setMonitorRecord(set.toString().replaceAll("\\[", "").replaceAll("\\]", "").replaceAll(", ", ",").trim());
             } else if (Objects.nonNull(t.getVideoSource()) && !Objects.equals(t.getVideoSource().trim(), "")) {
                 String[] strs = t.getVideoSource().split(",");
-                StringJoiner stringJoiner = new StringJoiner("");
+                Set<MonitorVideoSourceEnum> set = new LinkedHashSet<>(strs.length);
                 for (String s : strs) {
-                    stringJoiner.add(SystemConstant.getMonitorRecordVideoSource(s).name().toUpperCase()).add(",");
+                    set.add(SystemConstant.getMonitorRecordVideoSource(s));
                 }
-                t.setMonitorRecord(stringJoiner.toString().substring(0, stringJoiner.toString().length() - 1));
+                t.setMonitorRecord(set.toString().replaceAll("\\[", "").replaceAll("\\]", "").replaceAll(", ", ",").trim());
             }
         }
         return teStudentExamRecordDtoIPage;