wangwei hace 5 años
padre
commit
ee37b376c2

+ 11 - 1
src/main/java/cn/com/qmth/examcloud/bridge/modules/swjtu/controller/SwjtuController.java

@@ -52,10 +52,13 @@ public class SwjtuController {
 		String loginname = infoMap.get("loginname");
 		String password = infoMap.get("password");
 
-		Long rootOrgId = PropertyHolder.getLong("swjtu.rootOrgId", 0);
+		String rootOrgIdString = PropertyHolder.getString("swjtu.rootOrgId");
 		String loginnameConf = PropertyHolder.getString("swjtu.loginName");
 		String passwordConf = PropertyHolder.getString("swjtu.password");
 
+		if (StringUtils.isBlank(rootOrgIdString)) {
+			throw new StatusException("001001", "rootOrgId is not configured");
+		}
 		if (StringUtils.isBlank(loginnameConf)) {
 			throw new StatusException("001001", "loginname is not configured");
 		}
@@ -63,6 +66,13 @@ public class SwjtuController {
 			throw new StatusException("001002", "password is not configured");
 		}
 
+		Long rootOrgId = null;
+		try {
+			rootOrgId = StringUtil.toLong(rootOrgIdString);
+		} catch (Exception e1) {
+			throw new StatusException("001001", "rootOrgId is not Long value");
+		}
+
 		if (null == examId) {
 			OrgPropertyCacheBean orgPropertyCacheBean = CacheHelper.getOrgProperty(rootOrgId,
 					"THIRD_PARTY_API_DEFAULT_EXAM_ID");