|
@@ -72,7 +72,7 @@ public class PushLogicServiceImpl implements PushLogicService {
|
|
|
count = sysUserList.size();
|
|
|
for (SysUser user : sysUserList) {
|
|
|
Set<Long> roleIdSet = sysUserRoleService.listRoleByUserId(user.getId()).stream().map(BaseEntity::getId).collect(Collectors.toSet());
|
|
|
- List<PushUserTrack> pushUserTrackList = pushUserTrackService.createPushTrackUser(null,roleIdSet,user.getId(),user.getEnable(),sysUser.getId());
|
|
|
+ List<PushUserTrack> pushUserTrackList = pushUserTrackService.createPushTrackUser(null, roleIdSet, user.getId(), user.getEnable(), sysUser.getId());
|
|
|
List<UserPushParam> userPushParamList = pushUserTrackService.analyzeUserPushSpecialPrivilege(pushUserTrackList);
|
|
|
|
|
|
boolean syncResult = sysUserService.userPushService(userPushParamList, sysUser.getId());
|
|
@@ -104,6 +104,7 @@ public class PushLogicServiceImpl implements PushLogicService {
|
|
|
String examCode = (String) map.get("examCode");
|
|
|
Long examIdLong = Long.parseLong(String.valueOf(examId));
|
|
|
List<TSyncExamStudentScore> tSyncExamStudentScoreList = null;
|
|
|
+ List<String> errorTSyncExamStudentScoreList = null;
|
|
|
try {
|
|
|
int totalCount = stmmsUtils.getStudentCount(schoolId, examId, examCode, null, null, null, null, null, null);
|
|
|
log.info("云阅卷:考试成绩考生数量查询接口调用,返回数量:{}", totalCount);
|
|
@@ -115,40 +116,47 @@ public class PushLogicServiceImpl implements PushLogicService {
|
|
|
Map<String, BasicClazz> clazzMap = new HashMap<>();
|
|
|
Long semesterId = examPrintPlanService.getOne(new QueryWrapper<ExamPrintPlan>().lambda().eq(ExamPrintPlan::getThirdRelateId, examIdLong)).getId();
|
|
|
tSyncExamStudentScoreList = new ArrayList<>();
|
|
|
- for (int i = 1; i <= 1; i++) {
|
|
|
+ errorTSyncExamStudentScoreList = new ArrayList<>();
|
|
|
+ for (int i = 1; i <= pageNos; i++) {
|
|
|
List<Map> students = stmmsUtils.getStudentScore(schoolId, examId, examCode, null, null, null, null, null, null, i, pageSize);
|
|
|
for (Map student : students) {
|
|
|
- //查学院id
|
|
|
- Long orgId = null;
|
|
|
- if (!orgMap.containsKey(student.get("college"))) {
|
|
|
- SysOrg sysOrg = sysOrgService.getOne(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSchoolId, schoolId).eq(SysOrg::getName, student.get("college")));
|
|
|
- if (Objects.nonNull(sysOrg)) {
|
|
|
- orgId = sysOrg.getId();
|
|
|
- orgMap.put(sysOrg.getName(), sysOrg);
|
|
|
+ try {
|
|
|
+ //查学院id
|
|
|
+ Long orgId = null;
|
|
|
+ if (!orgMap.containsKey(student.get("college"))) {
|
|
|
+ SysOrg sysOrg = sysOrgService.getOne(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSchoolId, schoolId).eq(SysOrg::getName, student.get("college")));
|
|
|
+ if (Objects.nonNull(sysOrg)) {
|
|
|
+ orgId = sysOrg.getId();
|
|
|
+ orgMap.put(sysOrg.getName(), sysOrg);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ orgId = orgMap.get(student.get("college")).getId();
|
|
|
}
|
|
|
- } else {
|
|
|
- orgId = orgMap.get(student.get("college")).getId();
|
|
|
- }
|
|
|
|
|
|
- //查班级和专业id
|
|
|
- Long clazzId = null, majorId = null;
|
|
|
- if (!clazzMap.containsKey(student.get("className"))) {
|
|
|
- BasicClazz basicClazz = basicClazzService.getOne(new QueryWrapper<BasicClazz>().lambda().eq(BasicClazz::getSchoolId, schoolId).eq(BasicClazz::getClazzName, student.get("className")));
|
|
|
- if (Objects.nonNull(basicClazz)) {
|
|
|
- clazzId = basicClazz.getId();
|
|
|
- majorId = basicClazz.getMajorId();
|
|
|
- clazzMap.put(basicClazz.getClazzName(), basicClazz);
|
|
|
+ //查班级和专业id
|
|
|
+ Long clazzId = null, majorId = null;
|
|
|
+ if (!clazzMap.containsKey(student.get("className"))) {
|
|
|
+ BasicClazz basicClazz = basicClazzService.getOne(new QueryWrapper<BasicClazz>().lambda().eq(BasicClazz::getSchoolId, schoolId).eq(BasicClazz::getClazzName, student.get("className")));
|
|
|
+ if (Objects.nonNull(basicClazz)) {
|
|
|
+ clazzId = basicClazz.getId();
|
|
|
+ majorId = basicClazz.getMajorId();
|
|
|
+ clazzMap.put(basicClazz.getClazzName(), basicClazz);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ clazzId = clazzMap.get(student.get("className")).getId();
|
|
|
+ majorId = clazzMap.get(student.get("className")).getMajorId();
|
|
|
}
|
|
|
- } else {
|
|
|
- clazzId = clazzMap.get(student.get("className")).getId();
|
|
|
- majorId = clazzMap.get(student.get("className")).getMajorId();
|
|
|
+ student.put(SystemConstant.SCHOOL_ID, schoolId);
|
|
|
+ student.put("semesterId", semesterId);
|
|
|
+ student.put("orgId", orgId);
|
|
|
+ student.put("clazzId", clazzId);
|
|
|
+ student.put("userId", 2L);
|
|
|
+ tSyncExamStudentScoreList.add(new TSyncExamStudentScore(student));
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("同步学生成绩信息失败:{}", e.getMessage());
|
|
|
+ e.printStackTrace();
|
|
|
+ errorTSyncExamStudentScoreList.add(student.get("name") + "," + student.get("studentCode") + "\r\n");
|
|
|
}
|
|
|
- student.put(SystemConstant.SCHOOL_ID, schoolId);
|
|
|
- student.put("semesterId", semesterId);
|
|
|
- student.put("orgId", orgId);
|
|
|
- student.put("clazzId", clazzId);
|
|
|
- student.put("userId", 2L);
|
|
|
- tSyncExamStudentScoreList.add(new TSyncExamStudentScore(student));
|
|
|
}
|
|
|
}
|
|
|
tSyncExamStudentScoreService.remove(new QueryWrapper<TSyncExamStudentScore>().lambda().eq(TSyncExamStudentScore::getSchoolId, schoolId).eq(TSyncExamStudentScore::getExamId, examIdLong));
|
|
@@ -157,7 +165,12 @@ public class PushLogicServiceImpl implements PushLogicService {
|
|
|
map.computeIfAbsent("count", v -> totalCount);
|
|
|
List<TSyncExamStudentScore> finalTSyncExamStudentScoreList = tSyncExamStudentScoreList;
|
|
|
map.computeIfAbsent("correct", v -> finalTSyncExamStudentScoreList.size());
|
|
|
- } catch (Exception e) {
|
|
|
+ if (Objects.nonNull(errorTSyncExamStudentScoreList) && errorTSyncExamStudentScoreList.size() > 0) {
|
|
|
+ List<String> finalErrorTSyncExamStudentScoreList = errorTSyncExamStudentScoreList;
|
|
|
+ map.computeIfAbsent("error", v -> "未同步成功数据" + finalErrorTSyncExamStudentScoreList.size() + "条:\r\n" + finalErrorTSyncExamStudentScoreList.toString());
|
|
|
+ }
|
|
|
+ } catch (
|
|
|
+ Exception e) {
|
|
|
log.info("云阅卷:接口调用失败:{}", e.getMessage());
|
|
|
throw new RuntimeException("云阅卷:接口调用失败:" + e.getMessage());
|
|
|
}
|