|
@@ -206,7 +206,40 @@ public class HandleSyncCloudServiceProvider extends ControllerSupport implements
|
|
|
@Override
|
|
|
public SyncExamResp syncExam(SyncExamReq req) {
|
|
|
// TODO Auto-generated method stub
|
|
|
- return null;
|
|
|
+ Long rootOrgId = req.getRootOrgId();
|
|
|
+ Long id = req.getId();
|
|
|
+ String name = req.getName();
|
|
|
+ String examType = req.getExamType();
|
|
|
+ if (StringUtils.isBlank(name)) {
|
|
|
+ throw new StatusException("Q-018213", "name is null");
|
|
|
+ }
|
|
|
+ if (null == id) {
|
|
|
+ throw new StatusException("Q-018216", "id is null");
|
|
|
+ }
|
|
|
+ if (null == rootOrgId) {
|
|
|
+ throw new StatusException("Q-018219", "rootOrgId is null");
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(examType)) {
|
|
|
+ throw new StatusException("Q-018223", "examType is null");
|
|
|
+ }
|
|
|
+ //同步调卷规则
|
|
|
+ Query query = new Query();
|
|
|
+ query.addCriteria(Criteria.where("orgId").is(rootOrgId+""));
|
|
|
+ query.addCriteria(Criteria.where("examId").is(id+""));
|
|
|
+ query.addCriteria(Criteria.where("course.enable").is("true"));
|
|
|
+ List<ExtractConfig> extractConfigs = this.mongoTemplate.find(query, ExtractConfig.class);
|
|
|
+ if (extractConfigs != null && extractConfigs.size() > 0) {
|
|
|
+ int i = 0;
|
|
|
+ for (ExtractConfig extractConfig : extractConfigs) {
|
|
|
+ extractConfig.setExamName(name);
|
|
|
+ extractConfig.setExamType(examType);
|
|
|
+ extractConfig.setExamType(examType);
|
|
|
+ }
|
|
|
+ extractConfigRepo.save(extractConfigs);
|
|
|
+ log.debug("调卷规则同步完成,已经同步数量:"+ i);
|
|
|
+ }
|
|
|
+ SyncExamResp resp = new SyncExamResp();
|
|
|
+ return resp;
|
|
|
}
|
|
|
|
|
|
@Override
|