|
@@ -19,15 +19,15 @@ import com.qmth.teachcloud.common.bean.dto.stmms.PicConfig;
|
|
import com.qmth.teachcloud.common.bean.dto.stmms.QuestionBaseDTO;
|
|
import com.qmth.teachcloud.common.bean.dto.stmms.QuestionBaseDTO;
|
|
import com.qmth.teachcloud.common.bean.dto.stmms.QuestionDTO;
|
|
import com.qmth.teachcloud.common.bean.dto.stmms.QuestionDTO;
|
|
import com.qmth.teachcloud.common.config.DictionaryConfig;
|
|
import com.qmth.teachcloud.common.config.DictionaryConfig;
|
|
|
|
+import com.qmth.teachcloud.common.contant.SpringContextHolder;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
-import com.qmth.teachcloud.common.entity.BasicAttachment;
|
|
|
|
-import com.qmth.teachcloud.common.entity.BasicCollege;
|
|
|
|
-import com.qmth.teachcloud.common.entity.SysOrg;
|
|
|
|
-import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
|
-import com.qmth.teachcloud.common.enums.*;
|
|
|
|
-import com.qmth.teachcloud.common.service.BasicAttachmentService;
|
|
|
|
-import com.qmth.teachcloud.common.service.SysOrgService;
|
|
|
|
-import com.qmth.teachcloud.common.service.TeachcloudCommonService;
|
|
|
|
|
|
+import com.qmth.teachcloud.common.entity.*;
|
|
|
|
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
|
+import com.qmth.teachcloud.common.enums.SyncFileTypeEnum;
|
|
|
|
+import com.qmth.teachcloud.common.enums.TaskResultEnum;
|
|
|
|
+import com.qmth.teachcloud.common.enums.TaskStatusEnum;
|
|
|
|
+import com.qmth.teachcloud.common.enums.userPush.SpecialPrivilegeEnum;
|
|
|
|
+import com.qmth.teachcloud.common.service.*;
|
|
import com.qmth.teachcloud.common.sync.CloudMarkingTaskUtils;
|
|
import com.qmth.teachcloud.common.sync.CloudMarkingTaskUtils;
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -79,6 +79,12 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
@Resource
|
|
@Resource
|
|
private BasicAttachmentService basicAttachmentService;
|
|
private BasicAttachmentService basicAttachmentService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private SysOrgService sysOrgService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private SysUserService sysUserService;
|
|
|
|
+
|
|
@Resource
|
|
@Resource
|
|
private ExamPaperGroupService examPaperGroupService;
|
|
private ExamPaperGroupService examPaperGroupService;
|
|
|
|
|
|
@@ -286,12 +292,19 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
for (ExamPaperGroup examPaperGroup : examPaperGroups) {
|
|
for (ExamPaperGroup examPaperGroup : examPaperGroups) {
|
|
List<ExamPaperGroupMarker> examPaperGroupMarkers = examPaperGroupMarkerService.listByGroupId(examPaperGroup.getId());
|
|
List<ExamPaperGroupMarker> examPaperGroupMarkers = examPaperGroupMarkerService.listByGroupId(examPaperGroup.getId());
|
|
for (ExamPaperGroupMarker examPaperGroupMarker : examPaperGroupMarkers) {
|
|
for (ExamPaperGroupMarker examPaperGroupMarker : examPaperGroupMarkers) {
|
|
|
|
+ // 推送用户
|
|
|
|
+ String orgCode = cloudMarkingTaskUtils.isCollegeMode(schoolId) ? sysOrgService.findCollegeByCourseCode(examPaperStructure.getCourseCode()).getCode() : null;
|
|
|
|
+ SysUser markerUser = sysUserService.getById(examPaperGroupMarker.getMarkerId());
|
|
|
|
+ SysConfigService sysConfigService = SpringContextHolder.getBean(SysConfigService.class);
|
|
|
|
+ SysConfig sysConfig = sysConfigService.getByKey("sys.user.initPassword");
|
|
|
|
+ cloudMarkingTaskUtils.syncUser(markerUser.getLoginName(), markerUser.getRealName(), sysConfig.getConfigValue(), SpecialPrivilegeEnum.MARKER.getValue(), markerUser.getEnable(), schoolId, orgCode);
|
|
|
|
+ // 绑定评卷员
|
|
cloudMarkingTaskUtils.saveMarker(schoolId, examId, subjectCode, examPaperGroup.getGroupNumber(), examPaperGroupMarker.getLoginName());
|
|
cloudMarkingTaskUtils.saveMarker(schoolId, examId, subjectCode, examPaperGroup.getGroupNumber(), examPaperGroupMarker.getLoginName());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
structureStatus = ExamPaperStructureStatusEnum.FINISH;
|
|
structureStatus = ExamPaperStructureStatusEnum.FINISH;
|
|
result = TaskResultEnum.SUCCESS;
|
|
result = TaskResultEnum.SUCCESS;
|
|
- } catch (ApiException e) {
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
result = TaskResultEnum.ERROR;
|
|
result = TaskResultEnum.ERROR;
|
|
errorMessage = errorMessage + e.getMessage();
|
|
errorMessage = errorMessage + e.getMessage();
|
|
} finally {
|
|
} finally {
|
|
@@ -463,11 +476,18 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
if (StringUtils.isNotBlank(markLeader)) {
|
|
if (StringUtils.isNotBlank(markLeader)) {
|
|
List<JSONObject> objectiveJsons = JSONObject.parseArray(markLeader, JSONObject.class);
|
|
List<JSONObject> objectiveJsons = JSONObject.parseArray(markLeader, JSONObject.class);
|
|
for (JSONObject object : objectiveJsons) {
|
|
for (JSONObject object : objectiveJsons) {
|
|
|
|
+ // 推送用户
|
|
|
|
+ String orgCode = cloudMarkingTaskUtils.isCollegeMode(schoolId) ? sysOrgService.findCollegeByCourseCode(examPaperStructure.getCourseCode()).getCode() : null;
|
|
|
|
+ SysUser markerUser = sysUserService.getById(object.getLong("id"));
|
|
|
|
+ SysConfigService sysConfigService = SpringContextHolder.getBean(SysConfigService.class);
|
|
|
|
+ SysConfig sysConfig = sysConfigService.getByKey("sys.user.initPassword");
|
|
|
|
+ cloudMarkingTaskUtils.syncUser(markerUser.getLoginName(), markerUser.getRealName(), sysConfig.getConfigValue(), SpecialPrivilegeEnum.MARKER.getValue(), markerUser.getEnable(), schoolId, orgCode);
|
|
|
|
+
|
|
cloudMarkingTaskUtils.saveMarkLeader(schoolId, subjectCode, object.getString("loginName"));
|
|
cloudMarkingTaskUtils.saveMarkLeader(schoolId, subjectCode, object.getString("loginName"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
result = TaskResultEnum.SUCCESS;
|
|
result = TaskResultEnum.SUCCESS;
|
|
- } catch (ApiException e) {
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
result = TaskResultEnum.ERROR;
|
|
result = TaskResultEnum.ERROR;
|
|
errorMessage = e.getMessage();
|
|
errorMessage = e.getMessage();
|
|
} finally {
|
|
} finally {
|