wangwei 5 년 전
부모
커밋
53ee5e05aa
2개의 변경된 파일19개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 0
      pom.xml
  2. 14 1
      src/main/java/cn/com/qmth/examcloud/bridge/modules/swjtu/controller/SwjtuController.java

+ 5 - 0
pom.xml

@@ -21,6 +21,11 @@
 			<artifactId>examcloud-web</artifactId>
 			<version>${examcloud.version}</version>
 		</dependency>
+		<dependency>
+			<groupId>cn.com.qmth.examcloud</groupId>
+			<artifactId>examcloud-support</artifactId>
+			<version>${examcloud.version}</version>
+		</dependency>
 
 		<dependency>
 			<groupId>cn.com.qmth.examcloud.rpc</groupId>

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

@@ -17,11 +17,14 @@ import org.springframework.web.bind.annotation.RestController;
 import com.google.common.collect.Maps;
 
 import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.util.StringUtil;
 import cn.com.qmth.examcloud.core.oe.admin.api.ExamScoreDataCloudService;
 import cn.com.qmth.examcloud.core.oe.admin.api.bean.ScoreDataBean;
 import cn.com.qmth.examcloud.core.oe.admin.api.request.GetFinalScoreDataReq;
 import cn.com.qmth.examcloud.core.oe.admin.api.response.GetFinalScoreDataResp;
 import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
+import cn.com.qmth.examcloud.support.cache.CacheHelper;
+import cn.com.qmth.examcloud.support.cache.bean.OrgPropertyCacheBean;
 import cn.com.qmth.examcloud.web.bootstrap.PropertyHolder;
 
 @RestController
@@ -53,7 +56,17 @@ public class SwjtuController {
 			throw new StatusException("001001", "loginname is not configured");
 		}
 		if (StringUtils.isBlank(passwordConf)) {
-			throw new StatusException("001001", "password is not configured");
+			throw new StatusException("001002", "password is not configured");
+		}
+
+		if (null == examId) {
+			OrgPropertyCacheBean orgPropertyCacheBean = CacheHelper.getOrgProperty(rootOrgId,
+					"THIRD_PARTY_API_DEFAULT_EXAM_ID");
+			String value = orgPropertyCacheBean.getValue();
+			if (StringUtils.isBlank(value)) {
+				throw new StatusException("001002", "password is not configured");
+			}
+			examId = StringUtil.toLong(value);
 		}
 
 		if (loginnameConf.equals(loginname) && passwordConf.equals(password)) {