|
@@ -1,11 +1,13 @@
|
|
|
package cn.com.qmth.examcloud.web.helpers;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.Optional;
|
|
|
|
|
|
import org.springframework.data.repository.CrudRepository;
|
|
|
|
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
import cn.com.qmth.examcloud.commons.util.JsonUtil;
|
|
|
+import cn.com.qmth.examcloud.commons.util.Util;
|
|
|
|
|
|
/**
|
|
|
* 全局 helper
|
|
@@ -16,6 +18,18 @@ import cn.com.qmth.examcloud.commons.util.JsonUtil;
|
|
|
*/
|
|
|
public class GlobalHelper {
|
|
|
|
|
|
+ /**
|
|
|
+ * 顶级机构一致性校验
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param partitionIds
|
|
|
+ */
|
|
|
+ public static void uniformRootOrg(Long... partitionIds) {
|
|
|
+ if (!Util.equals(Arrays.asList(partitionIds))) {
|
|
|
+ throw new StatusException("120", "非法请求(顶级机构不一致)");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取存在的实体
|
|
|
*
|