Browse Source

Merge remote-tracking branch 'origin/master'

周箭河 5 years ago
parent
commit
373de79b80

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -1636,6 +1636,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 newCourseSchedule.setEndClassTime(endClassTime);
             }*/
 
+            if (Objects.isNull(newCourseSchedule.getGroupType())) {
+                newCourseSchedule.setGroupType(oldCourseSchedule.getGroupType());
+            }
             if (Objects.isNull(newCourseSchedule.getActualTeacherId())) {
                 newCourseSchedule.setActualTeacherId(oldCourseSchedule.getActualTeacherId());
             }

+ 22 - 23
mec-util/src/main/java/com/ym/mec/util/collection/ListUtil.java

@@ -2,7 +2,6 @@ package com.ym.mec.util.collection;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.ListIterator;
 
 public class ListUtil {
 
@@ -13,35 +12,35 @@ public class ListUtil {
 	 * @return
 	 */
 	public static boolean isEquals(List<?> list1, List<?> list2) {
-		if (null != list1 && null != list2) {
-			if(list1.size() != list2.size()){
-				return false;
-			}
-			ListIterator<?> listIterator = list1.listIterator();
-			while(listIterator.hasNext()){
-				Object obj = listIterator.next();
-				if(!list2.contains(obj)){
-					return false;
-				}
-				listIterator.remove();
-				list2.remove(obj);
-			}
+		if (list1 == list2) {
+			return true;
 		}
-		return true;
+		if (list1 == null && list2 == null) {
+			return true;
+		}
+		if (list1 == null || list2 == null) {
+			return false;
+		}
+		if (list1.size() != list2.size()) {
+			return false;
+		}
+		if (list1.containsAll(list2) && list2.containsAll(list1)) {
+			return true;
+		}
+		return false;
 	}
-	
-	
+
 	public static void main(String[] args) {
 		List<Integer> list1 = new ArrayList<Integer>();
 		list1.add(2);
-		list1.add(2);
 		list1.add(1);
-		
+		list1.add(1);
+
 		List<Integer> list2 = new ArrayList<Integer>();
+		list2.add(1);
 		list2.add(2);
-		list2.add(2);
-		list2.add(2);
-		
-		System.out.println(isEquals(list1,list2)? "true" : "false");
+		list2.add(1);
+
+		System.out.println(isEquals(list1, list2) ? "true" : "false");
 	}
 }